-
Notifications
You must be signed in to change notification settings - Fork 69
@liquality.near.NearSwapProvider
@liquality/near.NearSwapProvider
-
Swap
<providers.JsonRpcProvider
,InMemorySigner
>↳
NearSwapProvider
- canUpdateFee
- claimSwap
- doesTransactionMatchInitiation
- findClaimSwapTransaction
- findInitiateSwapTransaction
- findRefundSwapTransaction
- generateSecret
- getSwapSecret
- getWallet
- initiateSwap
- refundSwap
- setWallet
- updateTransactionFee
- validateSwapParams
- verifyInitiateSwapTransaction
• new NearSwapProvider(httpConfig
, walletProvider
)
Name | Type |
---|---|
httpConfig |
AxiosRequestConfig <any > |
walletProvider |
Wallet <JsonRpcProvider , InMemorySigner > |
near/lib/swap/NearSwapProvider.ts:14
• Protected
walletProvider: any
client/dist/lib/Swap.d.ts:4
▸ canUpdateFee(): boolean
boolean
near/lib/swap/NearSwapProvider.ts:147
▸ claimSwap(swapParams
, initTxHash
, secret
): Promise
<Transaction
<NearTxLog
>>
Claim the swap
Name | Type |
---|---|
swapParams |
SwapParams |
initTxHash |
string |
secret |
string |
Promise
<Transaction
<NearTxLog
>>
near/lib/swap/NearSwapProvider.ts:34
▸ Protected
doesTransactionMatchInitiation(swapParams
, transaction
): boolean
Name | Type |
---|---|
swapParams |
SwapParams |
transaction |
Transaction <NearTxLog > |
boolean
Swap.doesTransactionMatchInitiation
near/lib/swap/NearSwapProvider.ts:94
▸ findClaimSwapTransaction(swapParams
, initTxHash
): Promise
<Transaction
<NearTxLog
>>
Find swap claim transaction from parameters
Name | Type |
---|---|
swapParams |
SwapParams |
initTxHash |
string |
Promise
<Transaction
<NearTxLog
>>
near/lib/swap/NearSwapProvider.ts:48
▸ findInitiateSwapTransaction(swapParams
, _blockNumber?
): Promise
<Transaction
<NearTxLog
>>
Find swap transaction from parameters
Name | Type |
---|---|
swapParams |
SwapParams |
_blockNumber? |
number |
Promise
<Transaction
<NearTxLog
>>
Swap.findInitiateSwapTransaction
near/lib/swap/NearSwapProvider.ts:28
▸ findRefundSwapTransaction(swapParams
, initTxHash
): Promise
<Transaction
<NearTxLog
>>
Refund the swap
Name | Type |
---|---|
swapParams |
SwapParams |
initTxHash |
string |
Promise
<Transaction
<NearTxLog
>>
Swap.findRefundSwapTransaction
near/lib/swap/NearSwapProvider.ts:76
▸ generateSecret(message
): Promise
<string
>
Generate a secret.
Name | Type |
---|---|
message |
string |
Promise
<string
>
client/dist/lib/Swap.d.ts:10
▸ getSwapSecret(claimTxHash
): Promise
<string
>
Get secret from claim transaction hash.
Name | Type |
---|---|
claimTxHash |
string |
Promise
<string
>
near/lib/swap/NearSwapProvider.ts:86
▸ getWallet(): any
any
client/dist/lib/Swap.d.ts:7
▸ initiateSwap(swapParams
): Promise
<Transaction
<NearTxLog
>>
Initiate a swap
Name | Type |
---|---|
swapParams |
SwapParams |
Promise
<Transaction
<NearTxLog
>>
near/lib/swap/NearSwapProvider.ts:19
▸ refundSwap(swapParams
, initTxHash
): Promise
<Transaction
<NearTxLog
>>
Refund the swap
Name | Type |
---|---|
swapParams |
SwapParams |
initTxHash |
string |
Promise
<Transaction
<NearTxLog
>>
near/lib/swap/NearSwapProvider.ts:65
▸ setWallet(wallet
): void
Name | Type |
---|---|
wallet |
any |
void
client/dist/lib/Swap.d.ts:6
▸ updateTransactionFee(_tx
, _newFee
): Promise
<Transaction
<any
>>
Name | Type |
---|---|
_tx |
string | Transaction <any > |
_newFee |
FeeType |
Promise
<Transaction
<any
>>
near/lib/swap/NearSwapProvider.ts:151
▸ validateSwapParams(swapParams
): void
Name | Type |
---|---|
swapParams |
SwapParams |
void
client/dist/lib/Swap.d.ts:9
▸ verifyInitiateSwapTransaction(swapParams
, initTx
): Promise
<boolean
>
Verifies that the given initiation transaction matches the given swap params
Name | Type |
---|---|
swapParams |
SwapParams |
initTx |
string | Transaction <any > |
Promise
<boolean
>
Swap.verifyInitiateSwapTransaction
client/dist/lib/Swap.d.ts:8