npm i --save siennajs
All smart contract interfaces are created with the following parameters.
- The address of the contract.
- An instance of
SigningCosmWasmClient
fromsecretjs
(Optional). - An instance of
CosmWasmClient
fromsecretjs
(Optional).
At least one type of client is required. Depending on the type of client provided you will get access to different functionalities:
SigningCosmWasmClient
- both executing transactions and queriesCosmWasmClient
- queries only
If both instances are passed it will use SigningCosmWasmClient
for executing and CosmWasmClient
for queries.
const query_client = new CosmWasmClient('API_URL_HERE')
const sienna_token = new Snip20Contract(
'secret1rgm2m5t530tdzyd99775n6vzumxa5luxcllml4',
undefined, // We don't pass a SigningCosmWasmClient as we don't need it for queries
query_client
)
const token_info = await sienna_token.query().get_token_info()
SiennaJS exposes the Signer
interface which must implement an offline signing method. See the SNIP-24 spec for more info.
An implementation for the Keplr wallet is provided by the library - KeplrSigner