LogoLogo
  • Welcome!
  • The Protocol
    • Overview
    • Stakeholders
    • SecretTokens
    • Viewing Keys
    • Bridges
    • SEFI Token
    • CSHBK Token
    • Governance
  • User Guide
    • Swapping
    • Liquidity Providing
    • Tutorials
      • How to Buy SCRT in the U.S. Tutorial - Coinbase and Osmosis
      • Secret Ethereum Bridge (Video Tutorial)
      • Secret BSC Bridge (Video Tutorial)
      • Secret Monero Bridge (Video Tutorial) (1 of 4)
      • Secret Monero Bridge (Written Tutorial)
      • SecretSwap Full Length (Video Tutorial)
      • Trade & Earn Yield on SecretSwap (Written Tutorial)
      • Provide Liquidity on SecretSwap (Written Tutorial)
      • SEFI Governance (Written Tutorial)
    • Frequently Asked Questions
    • Glossary
  • Developer Guide
    • Create a New Pair
    • Factory
    • Query
    • Pair
  • Resources
    • Contract Addresses
Powered by GitBook
On this page
  • Transaction
  • Create pair
  • Query
  • Config
  • Pair
  • Pairs
  1. Developer Guide

Factory

This contract registers the relation between your token and others. It uses the pre-stored pair contract binary and instantiate it. So, you don't have to execute the pair contract additionally.

Transaction

Create pair

Instantiate pair from uploaded WASM binary.

{
  "pair_code_id": 1,
  "pair_code_hash": "<HASH>",
  "token_code_id": 2,
  "token_code_hash": "<HASH>",
  "init_hook": {
    "msg": "<base64_encoded_json_string>",
    "contract_addr": "secret...",
    "code_hash": "<HASH>"
  }
}

Query

Config

{
  "config": {}
}

Pair

{
  "pair": {
    "asset_infos": [
      {
        "token": {
          "contract_addr": "<HumanAddr>",
          "token_code_hash": "<HASH>",
          "viewing_key": "..."
        }
      },
      {
        "native_token": {
          "denom": "uscrt"
        }
      }
    ]
  }
}

Pairs

{
  "pairs": {
    "start_after": [
      //optional
      {
        "token": {
          "contract_addr": "<HumanAddr>"
        }
      },
      {
        "native_token": {
          "denom": "uscrt"
        }
      }
    ],
    "limit": 10 //optional, default=10, max=30
  }
}
PreviousCreate a New PairNextQuery

Last updated 3 years ago