Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Отправляем запрос по валютеSending request applicable to Currency

Code Block
query {
  currency(id: "ETH") {
    id
    currencyPaymentInterfaces {
      id
      paymentInterface {
        id
      }
      userDepositEnable
      userDirectDepositEnabled
      enable
    }
  }
}

Для валюты приходит несколько currencyPaymentInterfaces.

Выбираем For the Currency returns options for available Payment Interfaces currencyPaymentInterfaces

Select enable=true, userDepositEnable=true - эти используются для депозита через these will be used for deposit via proxy-address - generateWallet

Выбираем Select enable=true, userDirectDepositEnabled=true - эти используются для депозита walletConnectЗапоминаем выбор пользователя these are used for walletConnect

Remembering user’s request selection - ETH + FIREBLOCKS-GOERLI-PI

запрашиваем Request:

Code Block
mutation {
  getWalletConnectURI_v1
}

показываем Showing qr-code и подписываемся на and subscribe to:

Code Block
subscription {
  walletToConnect_v1(
    currencyId:"ETH",
    token:"eyJhbGciOiJSUzI1NiJ9.eyJ...."
  ) {
    address
    paymentInterface {
      id
    }
    action
    chainId
  }
}

Как только получаем по подписке сообщение, где As soon as we see the message from subscription where paymentInterface.id равен запомненному equals remembered FIREBLOCKS-GOERLI-PI

Code Block
{
  "data": {
    "walletToConnect_v1": {
      "address": "0x57e4469e047577bd1f47328989d6651198154cc2",
      "paymentInterface": {
        "id": "FIREBLOCKS-GOERLI-PI"
      },
      "action": "connecting",
      "chainId": 5
    }
  }
}

Отправляем на подпись верификационное сообщениеSending for signature verified message:

Code Block
mutation {
  connectWallet_v1(
    paymentInterfaceId:"FIREBLOCKS-GOERLI-PI",
    address:"0x57e4469e047577bd1f47328989d6651198154cc2") {
    id
  }
}

Затем запрашиваем подпись депозитной транзакцииFollowing request for signature for deposit transaction:

Code Block
mutation {
  userDirectDeposit (
    paymentInterfaceId:"FIREBLOCKS-GOERLI-PI"
    type: DIRECT_DEPOSIT
    address: "0x57E4469E047577bd1f47328989d6651198154cc2"
    currencyId: "ETH"
    amount: 0.0013
  )
}