Decrease allowance for a user

Decrease allowance for another user to transfer or burn currency token on behalf of a user. Both users must be the currency members of the currency.


Call URL

/currencies/(currencyAddress)/members/(memberWalletAddress)/allowance/decrement

Type : POST


Call request header parameters

Field Type Required/Optional Description Accepted values
wallet-address string Required The sender's wallet address. Any valid wallet address
wallet-key string Required The key of the sender's wallet. Any valid wallet key that unlocks the sender's wallet

Call request URL parameters

Field Type Required/Optional Description Accepted values
currencyAddress string Required The address of the involved currency. Any valid currency address

Call request body parameters

Field Type Required/Optional Description Accepted values
memberWalletAddress string Required The wallet address of the user receiving the allowance decrement. Any valid wallet address which is also a currency member of the involved currency
amountToDecrease number (in string) Required The number of allowance to decrease for a user. Any number in a string format

Sample Call Request

https://api.tetrium.io/currencies/0x29341b674091d600c227B137a457b0573515A7A8/members/0x34d86f8b9ece5ad06ef757d1c21c4373026d3345/allowance/decrement

Parameters:

{
   "amountToDecrease":"5"
}

Call responses

Success response

Field Type Description Respond Values
status string Status of the API call. "success"
message string Information about the status. "decrease-allowance initiated"
transactionHash string The hash of the transaction. To be used to verify the transaction's sealing status. Any string

Error response

Field Type Description Respond Values
status string Status of the API call. "fail"
error string Information about the error. (See below)

Information contained in error:

Error Messages Description
"missing amountToDecrease" amountToDecrease was not provide as a parameter in the API call body.
"invalid amountToDecrease" amountToDecrease provided was not in the correct format.
"user cannot decrease allowance for self" memberWalletAddress cannot be the same as wallet-address.

For any other errors, please refer to List of Common Error Messages

Sample Call Response

{
   "status":"success",
   "message":"decrease-allowance initiated",
   "transactionHash":"0x9f3c874c13935b792f53a07ffdb5f880c3b81c5e36182c7c34b898bfb7124b6a"
}

results matching ""

    No results matching ""