Skip to content

@liquality.terra.TerraSwapBaseProvider

Krasimir Raykov edited this page Mar 30, 2022 · 4 revisions

Class: TerraSwapBaseProvider

@liquality/terra.TerraSwapBaseProvider

Hierarchy

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new TerraSwapBaseProvider(walletProvider?)

Parameters

Name Type
walletProvider? TerraWalletProvider

Inherited from

Swap.constructor

Defined in

client/dist/lib/Swap.d.ts:5

Properties

walletProvider

Protected walletProvider: TerraWalletProvider

Inherited from

Swap.walletProvider

Defined in

client/dist/lib/Swap.d.ts:4

Methods

canUpdateFee

canUpdateFee(): boolean

Returns

boolean

Overrides

Swap.canUpdateFee

Defined in

terra/lib/swap/TerraSwapBaseProvider.ts:87


claimSwap

claimSwap(swapParams, initiationTxHash, secret, fee?): Promise<Transaction<TerraTxInfo>>

Claim the swap

Parameters

Name Type
swapParams SwapParams
initiationTxHash string
secret string
fee? FeeType

Returns

Promise<Transaction<TerraTxInfo>>

Overrides

Swap.claimSwap

Defined in

terra/lib/swap/TerraSwapBaseProvider.ts:42


doesTransactionMatchInitiation

Protected doesTransactionMatchInitiation(swapParams, initTx): Promise<boolean>

Parameters

Name Type
swapParams SwapParams
initTx Transaction<TerraTxInfo>

Returns

Promise<boolean>

Overrides

Swap.doesTransactionMatchInitiation

Defined in

terra/lib/swap/TerraSwapBaseProvider.ts:73


findClaimSwapTransaction

Abstract findClaimSwapTransaction(_swapParams, _initTxHash, _blockNumber?): Promise<Transaction<TerraTxInfo>>

Find swap claim transaction from parameters

Parameters

Name Type
_swapParams SwapParams
_initTxHash string
_blockNumber? number

Returns

Promise<Transaction<TerraTxInfo>>

Overrides

Swap.findClaimSwapTransaction

Defined in

terra/lib/swap/TerraSwapBaseProvider.ts:97


findInitiateSwapTransaction

Abstract findInitiateSwapTransaction(_swapParams, _blockNumber?): Promise<Transaction<TerraTxInfo>>

Find swap transaction from parameters

Parameters

Name Type
_swapParams SwapParams
_blockNumber? number

Returns

Promise<Transaction<TerraTxInfo>>

Overrides

Swap.findInitiateSwapTransaction

Defined in

terra/lib/swap/TerraSwapBaseProvider.ts:95


findRefundSwapTransaction

Abstract findRefundSwapTransaction(_swapParams, _initiationTxHash, _blockNumber?): Promise<Transaction<TerraTxInfo>>

Refund the swap

Parameters

Name Type
_swapParams SwapParams
_initiationTxHash string
_blockNumber? number

Returns

Promise<Transaction<TerraTxInfo>>

Overrides

Swap.findRefundSwapTransaction

Defined in

terra/lib/swap/TerraSwapBaseProvider.ts:103


generateSecret

generateSecret(message): Promise<string>

Generate a secret.

Parameters

Name Type
message string

Returns

Promise<string>

Inherited from

Swap.generateSecret

Defined in

client/dist/lib/Swap.d.ts:10


getSwapSecret

getSwapSecret(claimTxHash, _initTxHash?): Promise<string>

Get secret from claim transaction hash.

Parameters

Name Type
claimTxHash string
_initTxHash? string

Returns

Promise<string>

Overrides

Swap.getSwapSecret

Defined in

terra/lib/swap/TerraSwapBaseProvider.ts:68


getWallet

getWallet(): TerraWalletProvider

Returns

TerraWalletProvider

Inherited from

Swap.getWallet

Defined in

client/dist/lib/Swap.d.ts:7


initiateSwap

initiateSwap(swapParams, fee?): Promise<Transaction<TerraTxInfo>>

Initiate a swap

Parameters

Name Type
swapParams SwapParams
fee? FeeType

Returns

Promise<Transaction<TerraTxInfo>>

Overrides

Swap.initiateSwap

Defined in

terra/lib/swap/TerraSwapBaseProvider.ts:11


refundSwap

refundSwap(swapParams, initTx, fee?): Promise<Transaction<TerraTxInfo>>

Refund the swap

Parameters

Name Type
swapParams SwapParams
initTx string
fee? FeeType

Returns

Promise<Transaction<TerraTxInfo>>

Overrides

Swap.refundSwap

Defined in

terra/lib/swap/TerraSwapBaseProvider.ts:59


setWallet

setWallet(wallet): void

Parameters

Name Type
wallet TerraWalletProvider

Returns

void

Inherited from

Swap.setWallet

Defined in

client/dist/lib/Swap.d.ts:6


updateTransactionFee

updateTransactionFee(_tx, _newFee): Promise<Transaction<TerraTxInfo>>

Parameters

Name Type
_tx string | Transaction<TerraTxInfo>
_newFee FeeType

Returns

Promise<Transaction<TerraTxInfo>>

Overrides

Swap.updateTransactionFee

Defined in

terra/lib/swap/TerraSwapBaseProvider.ts:91


validateSwapParams

validateSwapParams(swapParams): void

Parameters

Name Type
swapParams SwapParams

Returns

void

Inherited from

Swap.validateSwapParams

Defined in

client/dist/lib/Swap.d.ts:9


verifyInitiateSwapTransaction

verifyInitiateSwapTransaction(swapParams, initTx): Promise<boolean>

Verifies that the given initiation transaction matches the given swap params

Parameters

Name Type
swapParams SwapParams
initTx string | Transaction<any>

Returns

Promise<boolean>

Inherited from

Swap.verifyInitiateSwapTransaction

Defined in

client/dist/lib/Swap.d.ts:8

Clone this wiki locally