Submitting the Transaction
Once the user has approved the token transfer, it’s time to construct the submit
request to the Kima Transaction Backend.
Calculate the Submit Amount
Using the Kima Backend
Use the submitAmount
property returned from the /submit/fees
endpoint.
Using the Kima API
The submit amount should always be the amount the target addreess will receive. This means the submit amount needs to be adjusted based on whether the fees are deducted from the amount or not.
Submitting the Transaction
POST /submit
Request Body:
originAddress
(Address): sending user addressoriginChain
(string): sending chainoriginSymbol
(string): sending token symboltargetAddress
(Address): receiving user addresstargetChain
(string): receiving chaintargetSymbol
(string): receiving token symbolamount
(bigint string): amount of token received by the target addressfee
(bigint string): amount of token that Kima consumes to pay gas fees for pulling & releasing token transactionsdecimals
(number): the number of decimals for the bigint amountsFor Bitcoin transactions:
Set these to the empty string or zero for non-BTC transactions
htlcCreationHash
(string): the tx hash locking the funds in the HTLChtlcCreationVout
(number): the output index of the locked funds in the HTLC creation transactionhtlcExpirationTimestamp
(string): the timestamp when the HTLC contract expires and the user can reclaim the funds locked therehtclVersion
(string)senderPubKey
(string): for bitcoin transactions this is the public key of the sender
Success Response:
height
: numbertxIndex
: numbercode
: number: error code; will be zero when successfultransactionHash
: stringevents
: Event[]type
: stringattributes
: Attribute[]key
: stringvalue
: string
rawLog
?: stringdata
?: MsgData[]msgResponses
: Uint8ArraygasUsed
: bigintgasWanted
: bigint
Chain Names
See the short names in the Supported Blockchains section.
Get Transaction Id
The transaction Id will be needed to get the transaction status. The following code can be used to extract the Id from the submit
response.
Authentication
Before calling submit
a JWT token must be obtained with the body payload. The JWT will be checked against the request body and if it does not match will respond with a 500
error.
Validation
If provided, the Kima Backend will use the Explorisk url defined in the ENV var XPLORISK_URL
to get the risk score for the origin and target user addresses. If the score is anything other than low
it will respond with a 500
error.
Last updated