Skip to main content

bridge/classes/WrapService.md

Service for cross-channel wrap and unwrap.

Constructors​

Constructor​

new WrapService(config): WrapService

Parameters​

ParameterTypeDescription
configWrapServiceConfigWrap service configuration

Returns​

WrapService

Methods​

estimateUnwrapFee()​

estimateUnwrapFee(tokenId, amount): Promise<WrapUnwrapFeeEstimate>

The fee and authorization of an unwrap (see estimateWrapFee).

Parameters​

ParameterTypeDescription
tokenIdTokenClassKeyInputThe token to unwrap
amountstringThe amount (checked like an unwrap's)

Returns​

Promise<WrapUnwrapFeeEstimate>


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​

ParameterTypeDescription
tokenIdTokenClassKeyInputThe token to wrap
amountstringThe amount (checked like a wrap's)

Returns​

Promise<WrapUnwrapFeeEstimate>


unwrapToken()​

unwrapToken(options): Promise<WrapUnwrapResult>

Unwrap a token: from the asset channel back to its own channel (e.g. GMUSIC → MUSIC).

Parameters​

ParameterTypeDescription
optionsUnwrapTokenOptionsThe token, the amount, an optional recipient

Returns​

Promise<WrapUnwrapResult>

The completed unwrap


wrapToken()​

wrapToken(options): Promise<WrapUnwrapResult>

Wrap a token: from its own channel to the asset channel (e.g. MUSIC → GMUSIC).

Parameters​

ParameterTypeDescription
optionsWrapTokenOptionsThe token, the amount, an optional recipient

Returns​

Promise<WrapUnwrapResult>

The completed wrap