-
Notifications
You must be signed in to change notification settings - Fork 69
@liquality.terra.TerraSwapBaseProvider
@liquality/terra.TerraSwapBaseProvider
-
Swap
<LCDClient
,MnemonicKey
,TerraWalletProvider
>↳
TerraSwapBaseProvider
- canUpdateFee
- claimSwap
- doesTransactionMatchInitiation
- findClaimSwapTransaction
- findInitiateSwapTransaction
- findRefundSwapTransaction
- generateSecret
- getSwapSecret
- getWallet
- initiateSwap
- refundSwap
- setWallet
- updateTransactionFee
- validateSwapParams
- verifyInitiateSwapTransaction
• new TerraSwapBaseProvider(walletProvider?
)
Name | Type |
---|---|
walletProvider? |
TerraWalletProvider |
client/dist/lib/Swap.d.ts:5
• Protected
walletProvider: TerraWalletProvider
client/dist/lib/Swap.d.ts:4
▸ canUpdateFee(): boolean
boolean
terra/lib/swap/TerraSwapBaseProvider.ts:87
▸ claimSwap(swapParams
, initiationTxHash
, secret
, fee?
): Promise
<Transaction
<TerraTxInfo
>>
Claim the swap
Name | Type |
---|---|
swapParams |
SwapParams |
initiationTxHash |
string |
secret |
string |
fee? |
FeeType |
Promise
<Transaction
<TerraTxInfo
>>
terra/lib/swap/TerraSwapBaseProvider.ts:42
▸ Protected
doesTransactionMatchInitiation(swapParams
, initTx
): Promise
<boolean
>
Name | Type |
---|---|
swapParams |
SwapParams |
initTx |
Transaction <TerraTxInfo > |
Promise
<boolean
>
Swap.doesTransactionMatchInitiation
terra/lib/swap/TerraSwapBaseProvider.ts:73
▸ Abstract
findClaimSwapTransaction(_swapParams
, _initTxHash
, _blockNumber?
): Promise
<Transaction
<TerraTxInfo
>>
Find swap claim transaction from parameters
Name | Type |
---|---|
_swapParams |
SwapParams |
_initTxHash |
string |
_blockNumber? |
number |
Promise
<Transaction
<TerraTxInfo
>>
terra/lib/swap/TerraSwapBaseProvider.ts:97
▸ Abstract
findInitiateSwapTransaction(_swapParams
, _blockNumber?
): Promise
<Transaction
<TerraTxInfo
>>
Find swap transaction from parameters
Name | Type |
---|---|
_swapParams |
SwapParams |
_blockNumber? |
number |
Promise
<Transaction
<TerraTxInfo
>>
Swap.findInitiateSwapTransaction
terra/lib/swap/TerraSwapBaseProvider.ts:95
▸ Abstract
findRefundSwapTransaction(_swapParams
, _initiationTxHash
, _blockNumber?
): Promise
<Transaction
<TerraTxInfo
>>
Refund the swap
Name | Type |
---|---|
_swapParams |
SwapParams |
_initiationTxHash |
string |
_blockNumber? |
number |
Promise
<Transaction
<TerraTxInfo
>>
Swap.findRefundSwapTransaction
terra/lib/swap/TerraSwapBaseProvider.ts:103
▸ generateSecret(message
): Promise
<string
>
Generate a secret.
Name | Type |
---|---|
message |
string |
Promise
<string
>
client/dist/lib/Swap.d.ts:10
▸ getSwapSecret(claimTxHash
, _initTxHash?
): Promise
<string
>
Get secret from claim transaction hash.
Name | Type |
---|---|
claimTxHash |
string |
_initTxHash? |
string |
Promise
<string
>
terra/lib/swap/TerraSwapBaseProvider.ts:68
▸ getWallet(): TerraWalletProvider
client/dist/lib/Swap.d.ts:7
▸ initiateSwap(swapParams
, fee?
): Promise
<Transaction
<TerraTxInfo
>>
Initiate a swap
Name | Type |
---|---|
swapParams |
SwapParams |
fee? |
FeeType |
Promise
<Transaction
<TerraTxInfo
>>
terra/lib/swap/TerraSwapBaseProvider.ts:11
▸ refundSwap(swapParams
, initTx
, fee?
): Promise
<Transaction
<TerraTxInfo
>>
Refund the swap
Name | Type |
---|---|
swapParams |
SwapParams |
initTx |
string |
fee? |
FeeType |
Promise
<Transaction
<TerraTxInfo
>>
terra/lib/swap/TerraSwapBaseProvider.ts:59
▸ setWallet(wallet
): void
Name | Type |
---|---|
wallet |
TerraWalletProvider |
void
client/dist/lib/Swap.d.ts:6
▸ updateTransactionFee(_tx
, _newFee
): Promise
<Transaction
<TerraTxInfo
>>
Name | Type |
---|---|
_tx |
string | Transaction <TerraTxInfo > |
_newFee |
FeeType |
Promise
<Transaction
<TerraTxInfo
>>
terra/lib/swap/TerraSwapBaseProvider.ts:91
▸ 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