Credit
Profile
Leaderboard
Webhook
Webhook Secret
Credit
Create an allowance
This is endpoint returns an unsigned transaction that pre-approves a spender_address
account to transfer a specified amount of tokens from the holder_address
account. Once you sign this transaction, using your private key held in your local environment variables, you can broadcast it using the Execute Transaction endpoint; or if you prefer to wait for confirmation using the Execute Transaction and Wait endpoint.
POST
/
credit
/
approve
curl --request POST \
--url https://api.openformat.tech/v1/credit/approve \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '{
"chain": "arbitrum-sepolia",
"token_id": "0xd1f09c70f6f2838a3ab6209c1465af68594667ec",
"holder_address": "0xcf7ed3acca5a467e9e704c703e8d87f634fb0fc9",
"spender_address": "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266",
"amount": 123
}'
{
"success": true,
"unsignedTransaction": {
"to": "0x014b680bed2433b1861239cf812dbe660fe339f2",
"data": "0x609512c90000000000000000000000009574e9ba92cb0966c9d2ff1a9ab9e11949b9b873000000000000000000000000f39fd6e51aad88f6f4ce6ab8827279cfffb922660000000000000000000000000000000000000000000000000de0b6b3a7640000647261676f6e5f736c6179656400000000000000000000000000000000000000414354494f4e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000000",
"maxPriorityFeePerGas": "1020840008",
"maxFeePerGas": "1035102698",
"gas": "476358",
"gasLimit": "476358",
"nonce": 36,
"chainId": 31337,
"type": 2
}
}
{
"success": true,
"unsignedTransaction": {
"to": "0x014b680bed2433b1861239cf812dbe660fe339f2",
"data": "0x609512c90000000000000000000000009574e9ba92cb0966c9d2ff1a9ab9e11949b9b873000000000000000000000000f39fd6e51aad88f6f4ce6ab8827279cfffb922660000000000000000000000000000000000000000000000000de0b6b3a7640000647261676f6e5f736c6179656400000000000000000000000000000000000000414354494f4e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000000",
"maxPriorityFeePerGas": "1020840008",
"maxFeePerGas": "1035102698",
"gas": "476358",
"gasLimit": "476358",
"nonce": 36,
"chainId": 31337,
"type": 2
}
}
Authorizations
Body
application/json
Response
200
application/json
Transfer transaction to sign
The response is of type object
.
curl --request POST \
--url https://api.openformat.tech/v1/credit/approve \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '{
"chain": "arbitrum-sepolia",
"token_id": "0xd1f09c70f6f2838a3ab6209c1465af68594667ec",
"holder_address": "0xcf7ed3acca5a467e9e704c703e8d87f634fb0fc9",
"spender_address": "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266",
"amount": 123
}'
{
"success": true,
"unsignedTransaction": {
"to": "0x014b680bed2433b1861239cf812dbe660fe339f2",
"data": "0x609512c90000000000000000000000009574e9ba92cb0966c9d2ff1a9ab9e11949b9b873000000000000000000000000f39fd6e51aad88f6f4ce6ab8827279cfffb922660000000000000000000000000000000000000000000000000de0b6b3a7640000647261676f6e5f736c6179656400000000000000000000000000000000000000414354494f4e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000000",
"maxPriorityFeePerGas": "1020840008",
"maxFeePerGas": "1035102698",
"gas": "476358",
"gasLimit": "476358",
"nonce": 36,
"chainId": 31337,
"type": 2
}
}
Assistant
Responses are generated using AI and may contain mistakes.