Function: externalDeploymentMessage()
function externalDeploymentMessage(data, chainId): ExternalMessageEnvelope
Creates a new external deployment message.
Parameters
Parameter | Type | Description |
---|---|---|
| The message data. | |
|
| The chain ID. |
Returns
The envelope of the external deployment message.
Example
import {
Faucet,
LocalECDSAKeySigner,
HttpTransport,
PublicClient
WalletV1,
externalDeploymentMessage,
generateRandomPrivateKey,
} from '@nilfoundation/niljs';
const signer = new LocalECDSAKeySigner({
privateKey: generateRandomPrivateKey(),
});
const pubkey = signer.getPublicKey();
const chainId = await client.chainId();
const deploymentMessage = externalDeploymentMessage(
{
salt: 100n,
shard: 1,
bytecode: WalletV1.code,
abi: WalletV1.abi,
args: [bytesToHex(pubkey)],
},
chainId,
);
Defined
@nilfoundation/niljs/src/encoding/externalMessage.ts:237