bridge/classes/WrapService.md
Service for cross-channel wrap and unwrap.
Constructors
Constructor
new WrapService(
config):WrapService
Parameters
| Parameter | Type | Description |
|---|---|---|
config | WrapServiceConfig | Wrap service configuration |
Returns
WrapService
wrap service config
Methods
estimateUnwrapFee()
estimateUnwrapFee(
tokenId,amount):Promise<WrapUnwrapFeeEstimate>
The fee and authorization of an unwrap (see estimateWrapFee).
Parameters
| Parameter | Type | Description |
|---|---|---|
tokenId | TokenClassKeyInput | The token to unwrap |
amount | string | The amount (checked like an unwrap's) |
Returns
Promise<WrapUnwrapFeeEstimate>
estimate unwrap fee token id wrap class key input
estimateWrapFee()
estimateWrapFee(
tokenId,amount):Promise<WrapUnwrapFeeEstimate>
The fee and authorization of a wrap. The fee is the constant "0" GALA launchpad-sdk reported (the channel bridge charges no fee the SDK can see).
Parameters
| Parameter | Type | Description |
|---|---|---|
tokenId | TokenClassKeyInput | The token to wrap |
amount | string | The amount (checked like a wrap's) |
Returns
Promise<WrapUnwrapFeeEstimate>
estimate wrap fee token id unwrap class key input
unwrapToken()
unwrapToken(
options):Promise<WrapUnwrapResult>
Unwrap a token: from the asset channel back to its own channel (e.g. GMUSIC → MUSIC).
Parameters
| Parameter | Type | Description |
|---|---|---|
options | UnwrapTokenOptions | The token, the amount, an optional recipient |
Returns
Promise<WrapUnwrapResult>
The completed unwrap
unwrap token wrap result options
wrapToken()
wrapToken(
options):Promise<WrapUnwrapResult>
Wrap a token: from its own channel to the asset channel (e.g. MUSIC → GMUSIC).
Parameters
| Parameter | Type | Description |
|---|---|---|
options | WrapTokenOptions | The token, the amount, an optional recipient |
Returns
Promise<WrapUnwrapResult>
The completed wrap
wrap token unwrap result options