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
  }
}

Last updated