client
): BondTokenClient
Name | Type |
---|---|
client | SpaceportSDK |
BondTokenClient
address
): Promise
<bigint
>
Retrieves the balance of bond tokens for an address.
Name | Type | Description |
---|---|---|
address | `0x${string}` | The address to check balance for |
Promise
<bigint
>
The balance as a bigint
spender
, amount
): Promise
<`0x${string}`>
Approves a specific address to spend a certain amount of bond tokens.
Name | Type | Description |
---|---|---|
spender | `0x${string}` | The address being approved to spend tokens |
amount | bigint | The amount of tokens to approve |
Promise
<`0x${string}`>
Transaction hash
owner
, spender
): Promise
<bigint
>
Checks the current allowance granted to a spender.
Name | Type | Description |
---|---|---|
owner | `0x${string}` | The owner of the tokens |
spender | `0x${string}` | The address with spending approval |
Promise
<bigint
>
The current allowance as a bigint
walletAddress
, spenderAddress
, requiredAmount
): Promise
<void
>
Checks if a wallet has sufficient balance and allowance for a specific amount.
Name | Type | Description |
---|---|---|
walletAddress | `0x${string}` | The wallet address to check |
spenderAddress | `0x${string}` | The address that needs allowance to spend tokens |
requiredAmount | bigint | The amount of tokens required |
Promise
<void
>
Promise that resolves if checks pass, throws error if insufficient funds/allowance
to
, amount
): Promise
<`0x${string}`>
Mints new bond tokens to a specified address (admin function).
Name | Type | Description |
---|---|---|
to | `0x${string}` | The recipient of the minted tokens |
amount | bigint | The amount of tokens to mint |
Promise
<`0x${string}`>
Transaction hash
amount
): Promise
<Record
<string
, { hash
: `0x${string}` ; status
: "success"
| "reverted"
}>>
Approves all Cultura and Spaceport contracts to spend a specific amount of tokens and waits for confirmations
Name | Type | Description |
---|---|---|
amount | bigint | Amount of tokens to approve for each contract |
Promise
<Record
<string
, { hash
: `0x${string}` ; status
: "success"
| "reverted"
}>>
Object containing transaction receipts for each approval
Example