Sandbox HIFI USD
Test out our API with HIFI USD in the Sandbox environment
Introduction
To simulate stablecoin movement in the Sandbox environment, we deployed the HIFI USD (USDHIFI) token on POLYGON AMOY. Users will be able to simulate converting fiat to stablecoin, transferring stablecoin between wallets, and converting stablecoin to fiat with HIFI USD.
Implementations
Wallet Balance
Users can use the wallet balance endpoint to get the up-to-date HIFI USD balance as other stablecoins
Example Request
curl --request GET \
--url 'https://production.hifibridge.com/user/wallet/balance?userId=3df6cf60-0c3a-4371-8cd7-4fee0901594e&chain=POLYGON_AMOY¤cy=usdHifi' \
--header 'accept: application/json'
Example Response
{
"balance": "539000000",
"displayBalance": "539.00",
"tokenInfo": {
"chain": "POLYGON_AMOY",
"contractAddress": "0x545f651965f3322fda6232f010df37ab41969505",
"assetType": "ERC20",
"quantity": "539000000",
"symbol": "USDHIFI",
"decimals": "6"
}
}
Simulate converting fiat currency to HIFI USD
After linking a Plaid account for USD onramp, you can use the account id
created to simulate pulling USD from a bank account and converting it to HIFI USD with the convert fiat to stablecoin endpoint.
Example Request
`curl --request POST \
--url https://sandbox.hifibridge.com/transfer/fiat-to-crypto \
--header 'accept: application/json' \
--header 'authorization: Bearer zpka_123456789' \
--header 'content-type: application/json' \
--data '
{
"sourceCurrency": "usd",
"destinationCurrency": "usdHifi",
"chain": "POLYGON_AMOY",
"isInstant": false,
"requestId": "984da3b6-b930-4641-87ab-93fc131ba0f8",
"sourceUserId": "75d7c01f-5f93-4490-8b93-a62fd8020358",
"sourceAccountId": "0de2ae79-737d-4266-8c7d-ec82df476d3a",
"destinationUserId": "75d7c01f-5f93-4490-8b93-a62fd8020358",
"amount": 0
}
'
Example Response
{
"transferType": "FIAT_TO_CRYPTO",
"transferDetails": {
"id": "476989be-dac6-4c4c-929a-6f17eb25509a",
"requestId": "5737c27a-87aa-48a4-a2be-db56a10442e3",
"sourceUserId": "2c055327-1202-4c08-aa95-e3a0b5da0886",
"destinationUserId": "2c055327-1202-4c08-aa95-e3a0b5da0886",
"transactionHash": "0xb05f1e9bc8286ac15a93495fc94b1ffaa52139017db8716b31f073dd24e3d703",
"chain": "POLYGON_AMOY",
"sourceCurrency": "usd",
"amount": 140,
"destinationCurrency": "usdHifi",
"sourceAccountId": "3df6cf60-0c3a-4371-8cd7-4fee0901594e",
"createdAt": "2024-09-09T20:51:07.734702+00:00",
"updatedAt": "2024-09-09T20:58:10.975+00:00",
"status": "CREATED",
"sourceUser": {
"business_name": null,
"legal_last_name": "Man",
"compliance_email": "[email protected]",
"legal_first_name": "Post"
},
"destinationUser": {
"business_name": null,
"legal_last_name": "Man",
"compliance_email": "[email protected]",
"legal_first_name": "Post"
},
"sourceAccount": {
"id": "3df6cf60-0c3a-4371-8cd7-4fee0901594e",
"account_number": "1111",
"routing_number": "011401533",
"bank_name": "Bank of America"
},
"fee": null
}
}
Transfer HIFI USD Between Wallets
Users can also transfer HIFI USD between HIFI wallets or external wallets
Example Request
curl --request POST \
--url https://sandbox.hifibridge.com/transfer/crypto-to-crypto \
--header 'accept: application/json' \
--header 'authorization: Bearer zpka_123456789' \
--header 'content-type: application/json' \
--data '
{
"chain": "POLYGON_AMOY",
"currency": "usdHifi",
"requestId": "5d0a55aa-9a2a-486a-a57e-d5d9e576cf6d",
"senderUserId": "75d7c01f-5f93-4490-8b93-a62fd8020358",
"recipientUserId": "0c91a2a3-b0da-4779-bd15-2b29b8854de4",
"amount": 10
}
'
Example Response
{
"transferType": "CRYPTO_TO_CRYPTO",
"transferDetails": {
"id": "0b9a8c80-3ce3-4aee-9d94-8a8ac43a2543",
"requestId": "5d0a55aa-9a2a-486a-a57e-d5d9e576cf6d",
"senderUserId": "75d7c01f-5f93-4490-8b93-a62fd8020358",
"recipientUserId": "0c91a2a3-b0da-4779-bd15-2b29b8854de4",
"recipientAddress": "0x89dfD8792c7E7041c24F01223929F1d8Dd642F0c",
"chain": "POLYGON_AMOY",
"currency": "usdHifi",
"amount": 10,
"transactionHash": "0x23188acdf798d97d481f86fe1904a74cd885ed8bcff9d52d8bb7c3a2f54a3a59",
"createdAt": "2024-06-25T20:41:57.671322+00:00",
"status": "CREATED",
"contractAddress": "0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359",
"failedReason": ""
}
}
Covert HIFI USD to Fiat currency
After adding an external bank account for fiat currency, you can use the account id
created to simulate offramping HIFI USD to fiat currency with the convert stablecoin to fiat endpoint.
Example Request
curl --request POST \
--url https://sandbox.hifibridge.com/transfer/crypto-to-fiat \
--header 'accept: application/json' \
--header 'authorization: Bearer zpka_123456789' \
--header 'content-type: application/json' \
--data '
{
"sourceCurrency": "usdHifi",
"destinationCurrency": "usd",
"chain": "POLYGON_AMOY",
"paymentRail": "ach",
"requestId": "233fb9a1-cf0d-425a-9d71-2f4b84040160",
"sourceUserId": "75d7c01f-5f93-4490-8b93-a62fd8020358 ",
"destinationUserId": "b7eef868-c72c-4215-a2b9-38272e362b5a ",
"destinationAccountId": "daa6ad75-a4c2-486f-a937-1bbf4d19553c ",
"amount": 120,
}
'
Example Response
{
"transferType": "CRYPTO_TO_FIAT",
"transferDetails": {
"id": "12c7c56a-f91e-498a-8300-90922cdff190",
"requestId": "8b371a64-6b89-47d3-823b-5ec2b9e2eead",
"sourceUserId": "2c055327-1202-4c08-aa95-e3a0b5da0886",
"destinationUserId": "2c055327-1202-4c08-aa95-e3a0b5da0886",
"chain": "POLYGON_AMOY",
"sourceCurrency": "usdHifi",
"amount": 120,
"destinationCurrency": "usd",
"liquidationAddress": "0xdeadbeef2usdcpolygonf8dc90ad-b901-49f2-82dd-47418c25f1f8",
"destinationAccountId": "5ece0e44-c087-4edd-b45a-7412cfc2347c",
"transactionHash": null,
"createdAt": "2024-09-09T20:05:02.662681+00:00",
"updatedAt": "2024-09-10T20:43:00.757+00:00",
"status": "CREATED",
"contractAddress": "0x41e94eb019c0762f9bfcf9fb1e58725bfb0e7582",
"sourceUser": {
"business_name": null,
"legal_last_name": "Man",
"compliance_email": "[email protected]",
"legal_first_name": "Post"
},
"destinationUser": {
"business_name": null,
"legal_last_name": "Man",
"compliance_email": "[email protected]",
"legal_first_name": "Post"
},
"destinationAccount": {
"id": "5ece0e44-c087-4edd-b45a-7412cfc2347c",
"accountOwnerName": "Post Man",
"bankName": "Chase",
"accountNumber": "483101817824",
"routingNumber": "021000323",
"accountType": "us",
"businessIdentifierCode": null,
"bankCountry": null,
"iban": null,
"beneficiaryFirstName": null,
"beneficiaryLastName": null
},
"failedReason": "This is a simulated success response for sandbox environment only.",
"fee": null,
"conversionRate": {
"validFrom": "2024-09-09T20:05:03.158Z",
"toCurrency": "usd",
"validUntil": "2024-09-09T20:05:33.158Z",
"fromCurrency": "usdc",
"conversionRate": 1
}
}
}
Updated about 1 month ago