Closed mohaijiang closed 1 year ago
I want submit some tx with argent-x, such as declare contract and deploy contract.
But I got issue with construct Account .
const starkKeyPair = ec.getKeyPair("0xsome_private_key") const deployContract = () => { // const provider = store.getters["stark/l2ActiveProvider"] // const activeAccount = store.getters["stark/l2ActiveAccount"] // const activeSigner = store.getters["stark/l2ActiveSigner"] const provider = new Provider({ sequencer: { baseUrl: 'https://alpha4.starknet.io', feederGatewayUrl: 'feeder_gateway', gatewayUrl: 'gateway', } }) const activeAccount = "0x215e3d4c42b32b05429902adf90137fe3ca62056ea51a8d026165bf140f9fa2" //TODO... Here use keypair with ec and privateKey . How Can I get keypair from wallet ? const account = new Account(provider,activeAccount,starkKeyPair) account.declare({ classHash: classHash, contract: compiledContractObj }).then(resp => { console.log(resp.transaction_hash) }) }
I tried use starknet.account to replace starkKeyPair , such as below. Bug got some sign method error.
starkKeyPair
import { connect } from "@argent/get-starknet"; .... let starknet = await connect({ showModal: true }); let [walletAddress] = await starknet.enable(); if (starknet.isConnected) { commit("setl2ActiveAccount", walletAddress); commit("setl2ActiveSigner", starknet.account); // use starknet.account to fill Account keypair argument commit("setl2ActiveProvider", starknet.provider); commit("setl2IsConnected", true); }
Is there some example that can help me ?
we're working on making declare functionality available to dapps. This is currentlky not supported
I want submit some tx with argent-x, such as declare contract and deploy contract.
But I got issue with construct Account .
I tried use starknet.account to replace
starkKeyPair
, such as below. Bug got some sign method error.Is there some example that can help me ?