nomos
  • V1
    • Getting Started
      • Technology Stack
      • Setting Up Your Environment
      • Deploying Smart Contracts
      • Interacting with Smart Contracts
    • Protocol Overview
      • Factory
      • Nomos
      • Supported Networks
      • GraphQL API
    • Nomos SDK
      • Nomos
      • Multisig
      • Examples
      • Utils
    • Nomos Providers
      • Nomos Client
      • Signing Nomos Client
      • Archway Nomos Client
      • Adding a Nomos App
      • User authentication
    • ICA
  • V2
    • Features
    • Networks
    • Structure
      • Account Settings
      • Factory
        • Wallet
        • Membership
        • Vote Module
        • Authz Proxy
    • Frontend
      • Create Proposal
Powered by GitBook
On this page
  1. V1

Nomos Providers

Nomos base provider

PreviousUtilsNextNomos Client

Last updated 1 year ago

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:

  • NomosClient: implements

  • SigningNomosClient: implements

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"
);
@cosmjs/cosmwasm-stargate/src/cosmwasmclient.ts
@cosmjs/cosmwasm-stargate/src/signingcosmwasmclient.ts