Function: externalDeploymentTransaction()
function externalDeploymentTransaction(data, maybeChainId?): ExternalTransactionEnvelope
Creates a new external deployment transaction.
Parameters
Parameter | Type | Description |
---|---|---|
| The transaction data. | |
|
| ‐ |
Returns
The envelope of the external deployment transaction.
Example
import {
Faucet,
LocalECDSAKeySigner,
HttpTransport,
PublicClient
SmartAccountV1,
externalDeploymentTransaction,
generateRandomPrivateKey,
} from '@nilfoundation/niljs';
const signer = new LocalECDSAKeySigner({
privateKey: generateRandomPrivateKey(),
});
const pubkey = signer.getPublicKey();
const chainId = await client.chainId();
const deploymentTransaction = externalDeploymentTransaction(
{
salt: 100n,
shard: 1,
bytecode: SmartAccountV1.code,
abi: SmartAccountV1.abi,
args: [bytesToHex(pubkey)],
},
chainId,
);
Defined
@nilfoundation/niljs/src/encoding/externalTransaction.ts:276