Feegrant
grantAllowance Tx
Provides a way to grant allowance, the user needs to construct the desired type of allowance.
| params | description |
|---|---|
| amount | amount of Coin |
| denom | denom of Coin |
| allowedMessages | array of Msg Type URL |
| granter | the address of the user granting an allowance of their funds |
| grantee | the address of the user being granted an allowance of another user's funds. |
| expirationTime | Timestamp |
example
const tx = await client.feegrant.grantAllowance({
granter: '0x00...',
grantee: '0x00...',
allowedMessages: [MsgDeleteObjectTypeUrl],
amount: parseEther('0.09').toString(),
denom: 'BNB',
expirationTime: toTimestamp(date),
});
revokeAllowance Tx
revokes allowance on a grantee by the granter.
| params | description |
|---|---|
| granter | the address of the user granting an allowance of their funds |
| grantee | grantee is the address of the user being granted an allowance of another user's funds |
example
const tx = await client.feegrant.revokeAllowance({
granter: '0x00...',
grantee: '0x00...',
});
getAllowence Query
queries the BasicAllowance.
| params | description |
|---|---|
| granter | the address of the user granting an allowance of their funds |
| grantee | grantee is the address of the user being granted an allowance of another user's funds |
example
await client.feegrant.getAllowence({
granter: '0x00...',
grantee: '0x00...',
});
getAllowences Query
queries the BasicAllowance by account address.
| params | description |
|---|---|
| grantee | grantee is the address of the user being granted an allowance of another user's funds |
| pagination | Pagination |
example
import { Long } from '@bnb-chain/greenfield-js-sdk';
await client.feegrant.getAllowences({
grantee: '0x00...',
pagination: {
limit: Long.fromInt(10),
offset: Long.fromInt(0),
countTotal: true,
key: Uint8Array.from([]),
reverse: false,
},
});