Skip to main content

Redeeming at Bank

You will need to handle the Deposit Fiat request in Event API from DCC middleware in your application to convert USDF back to Fiat for your registered accounts.

In addition, you can use the Burn request in USDF API to remove coin that you no longer want to hold in circulation.

Redeeming Sequence

1. Transfer USDF to Bank

Your registered account can transfer USDF back to your DCC middleware key pair to initialize a conversion from USDF back to Fiat.

You can simulate this using the CLI.

provenanced tx wasm execute \
tp14hj2tavq8fpesdwxxcu44rty3hh90vhuz3ljwv \
'{"transfer":{"amount":"10000","recipient":"tp1zl388azlallp5rygath0kmpz6w2agpampukfc3"}}' \
--from user2 \
--keyring-backend test \
--home build/node0 \
--chain-id chain-local \
--gas auto --gas-prices 1905nhash --gas-adjustment 2 \
--broadcast-mode block \
--yes \
--testnet -o json | jq

2. Deposit Fiat to Bank Middleware

DCC middleware will watch for inbound tranfers of USDF coin back to your bank key pair. Upon seeing the transaction commit on the Provenance Blockchain, it will make a request to POST /api/v1/fiat/deposits at your bank middleware.

If running this locally using default properties, a curl equivalent request would be made.

curl -X POST "http://localhost:8888/service-omnibus-ops/api/v1/fiat/deposits" \
-H "accept: text/plain" \
-H "Content-Type: application/json" \
-d "{ \"bankAccountUUID\": \"e2ab9433-6a6b-4b23-aff4-8c4026120cec\", \"uuid\": \"7d0b92bc-3eba-4588-a439-0b601f35479f\", \"amount\": 100.00}"

The human-readable payload is:

{
"bankAccountUUID": "e2ab9433-6a6b-4b23-aff4-8c4026120cec",
"uuid": "7d0b92bc-3eba-4588-a439-0b601f35479f",
"amount": 100.00
}
Third Party Setup Note

If Figure Tech or a third party consultancy is supporting your environment on testnet and mainnet, make the BANK_URI and BANK_CONTEXT environmental variables are set up in the DCC middleware deployment to correctly call your exposed application.

If a non-200 response is returned, the DCC middleware will continue to make this request until successful.

3. Burn USDF

Your bank middleware can tell the DCC middleware to remove USDF from circulation. This is most frequently coupled with a conversion back to Fiat although it is up to each bank middleware integration to decide how it wants to handle this process.

Burn by using the POST /api/v1/burns endpoint.

curl -X POST "http://localhost:8080/digital-currency-consortium/api/v1/burns" \
-H "accept: application/json" \
-H "Content-Type: application/json" \
-d "{ \"amount\": 100.00, \"uuid\": \"f86a844d-11dd-415a-933d-a35f70edf6fc\"}"

The human-readable payload is:

{
"uuid": "f86a844d-11dd-415a-933d-a35f70edf6fc",
"amount": 100.00
}
Validation Note

Burn is validated based on the amount of USDF coin your bank key pair has available. If balance is insufficient for the amount specified, you will receive an error response.