Nomos Providers

Nomos base provider

We implemented a CosmWasm provider for third party applications to add. It will forward every request to our application and allow those applications to be used in our interface.

Initialization

You can initialize any of our Nomos providers the same as you would with the CosmWasm providers. We have implemented 2 different providers:

If your application uses any of these two providers or another tool that wraps around them, you can integrate easily in our interface with the following:

const isIframe = window !== window.parent; //check if its an iframe
const client = isIframe
  ? await SigningNomosClient.connectWithSigner(network.rpc, offlineSigner) //use our provider
  : await SigningCosmWasmClient.connectWithSigner(network.rpc, offlineSigner); //use cosmos provider

We first check that we are on an iframe, that will mean that our application is inside the Nomos interface. Then we start the provider the same way we do it with the cosmwasm provider. Then any transaction made with the provider will be the same as with the conventional provider. Instead of sending transactions directly to the blockchain, the Nomos provider sends it to the parent window and our application transforms the message to be compatible with the multisig proposals.

//Send tokens example with our provider
await client.sendTokens(
  userAddress,
  receiverAddr,
  [{amount: amount.toString(), denom: "aarch"}],
  "auto"
);

Last updated