Smart Contract Abstractions!
Pre-release
Pre-release
jevonearth
released this
11 Sep 20:03
·
3247 commits
to master
since this release
New features
New smart contract methods abstraction. Allows developers to load a smart contract's parameters, and get a contract object with methods that correspond to the smart contract params.
const contract = await Tezos.contract.at('KT1SawqvsVdAbDzqc4KwPpaS1S1veuFgF9AN');
console.log(Object.keys(contract.methods));
// { transfer: [Function: method],
// approve: [Function: method],
// getAllowance: [Function: method],
// getBalance: [Function: method],
// getTotalSupply: [Function: method],
// setPause: [Function: method],
// setAdministrator: [Function: method],
// getAdministrator: [Function: method],
// mint: [Function: method],
// burn: [Function: method] }
const op = await contract.methods.mint("tz1QZ6KY7d3BuZDT1d19dUxoQrtFPN2QJ3hn", 100).send({ gasLimit: 200000 })
await op.confirmation();
See the example/ directory for an example.
New signer package that provides a signer API
TezBridge supported is implemented for signing operations.
Note that accounts must be revealed to originate or call smart contracts. Because TezBridge does not allow direct exposure of the public key.
Other changes
Add contract origination example
Add get manager key support to rpc package.
Error response now allows access to the raw request body
michelson-encoder now supports "parameter" encoding in addition to decoding.