Permit ERC-20 Tokens
curl 'https://groupos.xyz/api/v1/erc20/permit' \
--request POST \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <token>' \
--data-raw '{
"chainId": 5,
"contractAddress": "0x67F4732266C7300cca593C814d46bee72e40659F",
"recipientAddress": "0xc517c83f417b73dA98647dad0FCB80af9f3b9531",
"amount": 1.5
}'
{
"success": true,
"permitId": "8493b65e-e0a1-4b13-90ec-7af3a923f8b9",
"signature": "0xecb043a2da3a1c5e9a0a00cea8ffabb5815b12a9e1f91b97005c8d92b41b19cea8ffabb5815b12a9e1f91b97005c8d92b41b19ce",
"preparedCall": {
"to": "0xfb7b7f2d7ecef20a3a7a8ff4b3ae4a66d06a8df7",
"value": "0",
"data": "0x23b872dd000000000000000000000000c517c83f417b73da98647dad0fcb80af9f3b9531000000000000..."
}
}
Permiting vs. Minting
Permiting enables you to permit an address to mint tokens on their own time and does not itself produce a blockchain transaction. This makes permiting free for your application as users will be paying with their own gas at the time of mint, which can take place on your own interface or use a default experience provided by Station.
When you permit an token, our cloud-wallets sign an approval for the recipient that is used to authenticate their mint call within the smart contract. Each signature can optionally be set with an expiration as well.
Body
The id of the chain supporting the token. This cannot be changed after creation.
The token smart contract address to permit with.
The address to permit an token to.
The amount of tokens to mint to recipient in human-readable form, decimals supported.
The datetime for when this permit expires.
Response
Indicates whether the call was successful.
ID for the newly created permit.
Raw bytes signature of approval for the newly created permit.
A call object prepared to be used in a new transaction.
curl 'https://groupos.xyz/api/v1/erc20/permit' \
--request POST \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <token>' \
--data-raw '{
"chainId": 5,
"contractAddress": "0x67F4732266C7300cca593C814d46bee72e40659F",
"recipientAddress": "0xc517c83f417b73dA98647dad0FCB80af9f3b9531",
"amount": 1.5
}'
{
"success": true,
"permitId": "8493b65e-e0a1-4b13-90ec-7af3a923f8b9",
"signature": "0xecb043a2da3a1c5e9a0a00cea8ffabb5815b12a9e1f91b97005c8d92b41b19cea8ffabb5815b12a9e1f91b97005c8d92b41b19ce",
"preparedCall": {
"to": "0xfb7b7f2d7ecef20a3a7a8ff4b3ae4a66d06a8df7",
"value": "0",
"data": "0x23b872dd000000000000000000000000c517c83f417b73da98647dad0fcb80af9f3b9531000000000000..."
}
}