import { L1XProvider, VMDeployArg } from "@l1x/l1x-wallet-sdk";
import fs from "fs/promises";
let l1xProvider = new L1XProvider({
clusterType: "mainnet",
endpoint: "https://v2-mainnet-rpc.l1x.foundation",
});
(async () => {
let params: VMDeployArg = {
attrib: {
base_contract_bytes: await fs.readFile("./l1x_nft.o"),
},
private_key: "YOUR_PRIVATE_KEY"
};
l1xProvider.vm
.deploy(params)
.then((response) => console.log(response))
.catch((err) => console.error(err));
})()
attrib: {
base_contract_bytes: Buffer,
}
private_key: string,
fee_limit?: number,
nonce?: number
}
A promise that resolves when the transaction is submitted.
{
"contract_address": "cf0289e86714d97979d726eeb2fa3a23b9c007c1",
"hash": "dc224ba854d5fbd3371f6d509b9a0b5451fff78a70ad3a209b5c273f8da0abfb"
}