You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Can I exec ink contract function with go-substrate-rpc-client ?
The following picture is an example of js, does go have a similar method?
// Construct the API as per the API sections// (as in all examples, this connects to a local chain)constapi=awaitApiPromise.create();// Construct our Code helper. The abi is an Abi object, an unparsed JSON string// or the raw JSON data (after doing a JSON.parse). The wasm is either a hex// string (0x prefixed), an Uint8Array or a Node.js Buffer objectconstjson= JSON.parse(fs.readFileSync('src/contract/flipper.contract','utf8'));constcontractAbi=newAbi(json,api.registry.getChainProperties())constkeyring=newKeyring({type: 'sr25519',ss58Format: 42});constpair=keyring.addFromUri('//Alice');constcontract=newContractPromise(api,contractAbi,"some-address");constvalue=0;constincValue=1;awaitcontract.tx.flip({ value, gasLimit },)// 方法名({value,gasLimit}, ...params ) 此处flip 是合约方法名.signAndSend(pair,(result)=>{if(result.status.isInBlock){console.log('in a block');}elseif(result.status.isFinalized){console.log('finalized');}});
The text was updated successfully, but these errors were encountered:
mohaijiang
changed the title
How to exec ink contract ?
How to exec ink contract method ?
Apr 18, 2022
We have not tested this nor any EVM-related calls so far. Is there a specific chain that we can use for checking this? We need to take a look at the pallet and see the arguments for the extrinsic that you're trying to call.
Can I exec ink contract function with go-substrate-rpc-client ?
The following picture is an example of js, does go have a similar method?
The text was updated successfully, but these errors were encountered: