Skip to main content

Common Types

Overview

These are shared request structures used across REST API calls.

Types

CrossChainUser

type CrossChainUser = {
chain_uid?: string
address?: string
}
FieldTypeDescription
chain_uidstringUnique chain identifier for the user address.
addressstringUser address on the specified chain.

CrossChainUserInput

Alias of CrossChainUser, used by some GQL queries. See CrossChainUser for the full field breakdown.

type CrossChainUserInput = CrossChainUser

CrossChainUserWithAmount

type CrossChainUserWithAmount = {
  chain_uid?: string
  address?: string
  amount?: string
  social?: {
    email?: string
    telegram?: string
    twitter?: string
  }
}
{
  "chain_uid": "base",
  "address": "0xB0b123456789abcdef123456789abcdef1234567",
  "amount": "1000000"
}
FieldTypeDescription
chain_uidstringUnique chain identifier for the user address.
addressstringUser address on the specified chain.
amountstringOptional amount associated with this user.
socialobjectOptional social recipient descriptor (email/telegram/twitter).

CrossChainAddressWithLimit

type CrossChainAddressWithLimit = {
  user: CrossChainUserWithAmount
  amount?: {
    dynamic?: string
    equal?: string
    greater_than_or_equal?: string
    less_than_or_equal?: string
  }
  denom?: TokenType
  forwarding_message?: string
  unsafe_refund_as_voucher?: boolean
}
{
  "user": {
    "chain_uid": "base",
    "address": "0xB0b123456789abcdef123456789abcdef1234567",
    "amount": "1000000"
  },
  "amount": {
    "less_than_or_equal": "950000"
  },
  "denom": {
    "native": { "denom": "base" }
  },
  "forwarding_message": "",
  "unsafe_refund_as_voucher": false
}
FieldTypeDescription
userCrossChainUserWithAmountTarget recipient user object.
amountLimitOptional amount constraints for this recipient.
denomTokenTypeOptional preferred output denomination/type.
forwarding_messagestringOptional forwarding payload.
unsafe_refund_as_voucherbooleanIf true, refunds are returned as vouchers.

Limit

Use Limit to control how much should be released to a recipient when output amount handling matters.

type Limit = {
  dynamic?: string
  equal?: string
  greater_than_or_equal?: string
  less_than_or_equal?: string
}
{
  "dynamic": "true"
}
FieldTypeDescription
dynamicstringUse when final output is unknown before execution (for example swaps). It forces release of the full computed amount to this recipient; if full release is not possible, the transaction fails.
equalstringEnforces an exact release amount. Useful when the expected output is known beforehand.
greater_than_or_equalstringSets a minimum amount that must be released. Execution can still release more than this threshold.
less_than_or_equalstringSets a maximum amount that may be released to this recipient.

Example behavior:

  • Swap from euclid to mon where exact output is unknown: use dynamic to force all actual output to be released on mon.
  • Using greater_than_or_equal: "1" only sets a floor, so partial release can still pass.
  • Using equal is only valid when exact output is known in advance.

TokenWithDenom

Represents a token and how it should be interpreted on-chain.

type TokenWithDenom = {
  token: string
  token_type?: TokenType
  amount?: string
}
{
  "token": "usdc",
  "amount": "10000000",
  "token_type": {
    "smart": {
      "contract_address": "0xA1b2C3d4E5F67890123456789abcdef123456789"
    }
  }
}
FieldTypeDescription
tokenstringToken identifier (for example usdc).
token_typeTokenTypeSpecifies whether the token is native, smart, or voucher.
amountstringOptional token amount when used in amount-bearing payloads.

TokenType Variants

type TokenType =
  | { native: { denom: string } }
  | { smart: { contract_address: string } }
  | { voucher: {} }
{
  "native": {
    "denom": "uusdc"
  }
}
VariantShapeDescription
native{ native: { denom: string } }Uses a native chain denomination for routing and settlement.
smart{ smart: { contract_address: string } }Uses a smart-token contract address for contract-based assets.
voucher{ voucher: {} }Marks voucher form with no nested fields.

PairWithDenomAndAmount

Used in add-liquidity requests (pair_info).

type PairWithDenomAndAmount = {
  token_1: {
    token: string
    amount: string
    token_type?: TokenType
  }
  token_2: {
    token: string
    amount: string
    token_type?: TokenType
  }
}
{
  "token_1": {
    "token": "usdc",
    "amount": "1000000",
    "token_type": { "native": { "denom": "uusdc" } }
  },
  "token_2": {
    "token": "eth",
    "amount": "500000000000000",
    "token_type": { "smart": { "contract_address": "0xA1b2C3d4E5F67890123456789abcdef123456789" } }
  }
}
FieldTypeDescription
token_1objectFirst token entry with token, amount, and optional token_type.
token_2objectSecond token entry with token, amount, and optional token_type.
token_1.token_typeTokenTypeOptional type metadata for the first token.
token_2.token_typeTokenTypeOptional type metadata for the second token.

PairWithDenom

Used in pool-creation requests (pair).

type PairWithDenom = {
  token_1: TokenWithDenom
  token_2: TokenWithDenom
}
{
  "token_1": {
    "token": "usdc",
    "token_type": { "native": { "denom": "uusdc" } }
  },
  "token_2": {
    "token": "eth",
    "token_type": { "smart": { "contract_address": "0xA1b2C3d4E5F67890123456789abcdef123456789" } }
  }
}
FieldTypeDescription
token_1TokenWithDenomFirst token definition in the pair.
token_2TokenWithDenomSecond token definition in the pair.

PairToken

Used in remove-liquidity requests (pair).

type PairToken = {
  token_1: string
  token_2: string
}
{
  "token_1": "usdc",
  "token_2": "eth"
}
FieldTypeDescription
token_1stringFirst token identifier in the pair (for example usdc).
token_2stringSecond token identifier in the pair (for example eth).