How to initialise a VM contracts?
init
Function:
This function is used to Initialise a VM contract.
import { L1XProvider, VMInitArg } from "@l1x/l1x-wallet-sdk";
let l1xProvider = new L1XProvider({
clusterType: "mainnet",
endpoint: "https://v2-mainnet-rpc.l1x.foundation",
});
let params: VMInitArg = {
attrib: {
arguments: {},
base_contract_address: "1e6c0451505da3afeb1ed547b0cbfeefa40bfd15",
},
private_key: "YOUR_PRIVATE_KEY",
fee_limit: 1,
};
l1xProvider.vm
.init(params)
.then((response) => console.log(response)) // log response
.catch((err) => console.error(err)); // log error
Parameters:
The VM contract initialisation object
Returns:
A promise that resolves when the transaction is submitted.
Last updated