Skip to content

@liquality.near.NearSwapProvider

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

Class: NearSwapProvider

@liquality/near.NearSwapProvider

Hierarchy

  • Swap<providers.JsonRpcProvider, InMemorySigner>

    NearSwapProvider

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new NearSwapProvider(httpConfig, walletProvider)

Parameters

Name Type
httpConfig AxiosRequestConfig<any>
walletProvider Wallet<JsonRpcProvider, InMemorySigner>

Overrides

Swap.constructor

Defined in

near/lib/swap/NearSwapProvider.ts:14

Properties

walletProvider

Protected walletProvider: any

Inherited from

Swap.walletProvider

Defined in

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

Methods

canUpdateFee

canUpdateFee(): boolean

Returns

boolean

Overrides

Swap.canUpdateFee

Defined in

near/lib/swap/NearSwapProvider.ts:147


claimSwap

claimSwap(swapParams, initTxHash, secret): Promise<Transaction<NearTxLog>>

Claim the swap

Parameters

Name Type
swapParams SwapParams
initTxHash string
secret string

Returns

Promise<Transaction<NearTxLog>>

Overrides

Swap.claimSwap

Defined in

near/lib/swap/NearSwapProvider.ts:34


doesTransactionMatchInitiation

Protected doesTransactionMatchInitiation(swapParams, transaction): boolean

Parameters

Name Type
swapParams SwapParams
transaction Transaction<NearTxLog>

Returns

boolean

Overrides

Swap.doesTransactionMatchInitiation

Defined in

near/lib/swap/NearSwapProvider.ts:94


findClaimSwapTransaction

findClaimSwapTransaction(swapParams, initTxHash): Promise<Transaction<NearTxLog>>

Find swap claim transaction from parameters

Parameters

Name Type
swapParams SwapParams
initTxHash string

Returns

Promise<Transaction<NearTxLog>>

Overrides

Swap.findClaimSwapTransaction

Defined in

near/lib/swap/NearSwapProvider.ts:48


findInitiateSwapTransaction

findInitiateSwapTransaction(swapParams, _blockNumber?): Promise<Transaction<NearTxLog>>

Find swap transaction from parameters

Parameters

Name Type
swapParams SwapParams
_blockNumber? number

Returns

Promise<Transaction<NearTxLog>>

Overrides

Swap.findInitiateSwapTransaction

Defined in

near/lib/swap/NearSwapProvider.ts:28


findRefundSwapTransaction

findRefundSwapTransaction(swapParams, initTxHash): Promise<Transaction<NearTxLog>>

Refund the swap

Parameters

Name Type
swapParams SwapParams
initTxHash string

Returns

Promise<Transaction<NearTxLog>>

Overrides

Swap.findRefundSwapTransaction

Defined in

near/lib/swap/NearSwapProvider.ts:76


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): Promise<string>

Get secret from claim transaction hash.

Parameters

Name Type
claimTxHash string

Returns

Promise<string>

Overrides

Swap.getSwapSecret

Defined in

near/lib/swap/NearSwapProvider.ts:86


getWallet

getWallet(): any

Returns

any

Inherited from

Swap.getWallet

Defined in

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


initiateSwap

initiateSwap(swapParams): Promise<Transaction<NearTxLog>>

Initiate a swap

Parameters

Name Type
swapParams SwapParams

Returns

Promise<Transaction<NearTxLog>>

Overrides

Swap.initiateSwap

Defined in

near/lib/swap/NearSwapProvider.ts:19


refundSwap

refundSwap(swapParams, initTxHash): Promise<Transaction<NearTxLog>>

Refund the swap

Parameters

Name Type
swapParams SwapParams
initTxHash string

Returns

Promise<Transaction<NearTxLog>>

Overrides

Swap.refundSwap

Defined in

near/lib/swap/NearSwapProvider.ts:65


setWallet

setWallet(wallet): void

Parameters

Name Type
wallet any

Returns

void

Inherited from

Swap.setWallet

Defined in

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


updateTransactionFee

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

Parameters

Name Type
_tx string | Transaction<any>
_newFee FeeType

Returns

Promise<Transaction<any>>

Overrides

Swap.updateTransactionFee

Defined in

near/lib/swap/NearSwapProvider.ts:151


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