Send USD onchain
Get the wallet IDs and Check the Balances
Can run this query at any stage to confirm the change in the balances.
The "BTC" wallet balance is denominated in satoshis.
The "USD" wallet balance is in cents.
The body of the GraphQL request
query Me {
me {
defaultAccount {
wallets {
id
walletCurrency
balance
}
}
}
}
Estimate
Estimate how many satoshis the transaction will cost.
The body of the GraphQL request
query onChainUsdTxFee($walletId: WalletId!, $address: OnChainAddress!, $amount: CentAmount!) {
onChainUsdTxFee(walletId: $walletId, address: $address, amount: $amount) {
amount
}
}
Send a Transaction in USD Cents
Send a transaction onchain from your USD account with the amount denominated in USD cents.
The satoshi amount will be calculated based on the current exchange rate.
The body of the GraphQL request
mutation onChainUsdPaymentSend($input: OnChainUsdPaymentSendInput!) {
onChainUsdPaymentSend(input: $input) {
errors {
message
}
status
}
}
Send a Transaction in Satoshis
Send a transaction onchain from your USD account with the amount denominated in satoshis.
The body of the GraphQL request
mutation onChainUsdPaymentSendAsBtcDenominated($input: OnChainUsdPaymentSendAsBtcDenominatedInput!) {
onChainUsdPaymentSendAsBtcDenominated(input: $input) {
errors {
message
}
status
}
}
To test the GraphQL requests further use the GraphQL playground at api.blink.sv/graphql for mainnet or api.staging.blink.sv/graphql for staging.
Check out the Galoy API Postman collection to find examples in multiple programming languages.