@sodax/sdk 1.0.1-beta-rc1 → 1.0.1-beta-rc3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +20 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +17 -4
- package/dist/index.d.ts +17 -4
- package/dist/index.mjs +20 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -6387,7 +6387,7 @@ type MoneyMarketSupplyParams = {
|
|
|
6387
6387
|
amount: bigint;
|
|
6388
6388
|
action: 'supply';
|
|
6389
6389
|
toChainId?: SpokeChainId;
|
|
6390
|
-
toAddress?:
|
|
6390
|
+
toAddress?: string;
|
|
6391
6391
|
};
|
|
6392
6392
|
/**
|
|
6393
6393
|
* Parameters for a Money Market borrow operation.
|
|
@@ -6405,7 +6405,7 @@ type MoneyMarketBorrowParams = {
|
|
|
6405
6405
|
amount: bigint;
|
|
6406
6406
|
action: 'borrow';
|
|
6407
6407
|
toChainId?: SpokeChainId;
|
|
6408
|
-
toAddress?:
|
|
6408
|
+
toAddress?: string;
|
|
6409
6409
|
};
|
|
6410
6410
|
/**
|
|
6411
6411
|
* Parameters for a Money Market withdraw operation.
|
|
@@ -6423,7 +6423,7 @@ type MoneyMarketWithdrawParams = {
|
|
|
6423
6423
|
amount: bigint;
|
|
6424
6424
|
action: 'withdraw';
|
|
6425
6425
|
toChainId?: SpokeChainId;
|
|
6426
|
-
toAddress?:
|
|
6426
|
+
toAddress?: string;
|
|
6427
6427
|
};
|
|
6428
6428
|
/**
|
|
6429
6429
|
* Parameters for a Money Market repay operation.
|
|
@@ -6441,7 +6441,7 @@ type MoneyMarketRepayParams = {
|
|
|
6441
6441
|
amount: bigint;
|
|
6442
6442
|
action: 'repay';
|
|
6443
6443
|
toChainId?: SpokeChainId;
|
|
6444
|
-
toAddress?:
|
|
6444
|
+
toAddress?: string;
|
|
6445
6445
|
};
|
|
6446
6446
|
type MoneyMarketParams = MoneyMarketSupplyParams | MoneyMarketBorrowParams | MoneyMarketWithdrawParams | MoneyMarketRepayParams;
|
|
6447
6447
|
type MoneyMarketUnknownErrorCode = 'SUPPLY_UNKNOWN_ERROR' | 'BORROW_UNKNOWN_ERROR' | 'WITHDRAW_UNKNOWN_ERROR' | 'REPAY_UNKNOWN_ERROR';
|
|
@@ -8587,6 +8587,19 @@ declare class SwapService {
|
|
|
8587
8587
|
* @returns {Promise<IntentState>} The intent state
|
|
8588
8588
|
*/
|
|
8589
8589
|
getFilledIntent(txHash: Hash$1): Promise<IntentState>;
|
|
8590
|
+
/**
|
|
8591
|
+
* Get the intent delivery info about solved intent from the Relayer API.
|
|
8592
|
+
* Packet data contains info about the intent execution on the destination chain.
|
|
8593
|
+
* @param {SpokeChainId} chainId - The destination spoke chain ID
|
|
8594
|
+
* @param {string} fillTxHash - The fill transaction hash (received from getStatus when status is 3 - SOLVED)
|
|
8595
|
+
* @param {number} timeout - The timeout in milliseconds (default: 120 seconds)
|
|
8596
|
+
* @returns {Promise<Result<PacketData, IntentError<'RELAY_TIMEOUT'>>>} A Result containing either the packet data or an IntentError with code 'RELAY_TIMEOUT'
|
|
8597
|
+
*/
|
|
8598
|
+
getSolvedIntentPacket({ chainId, fillTxHash, timeout, }: {
|
|
8599
|
+
chainId: SpokeChainId;
|
|
8600
|
+
fillTxHash: string;
|
|
8601
|
+
timeout?: number;
|
|
8602
|
+
}): Promise<Result<PacketData, IntentError<'RELAY_TIMEOUT'>>>;
|
|
8590
8603
|
/**
|
|
8591
8604
|
* Gets the keccak256 hash of an intent. Hash serves as the intent id on Hub chain.
|
|
8592
8605
|
* @param {Intent} intent - The intent
|
package/dist/index.d.ts
CHANGED
|
@@ -6387,7 +6387,7 @@ type MoneyMarketSupplyParams = {
|
|
|
6387
6387
|
amount: bigint;
|
|
6388
6388
|
action: 'supply';
|
|
6389
6389
|
toChainId?: SpokeChainId;
|
|
6390
|
-
toAddress?:
|
|
6390
|
+
toAddress?: string;
|
|
6391
6391
|
};
|
|
6392
6392
|
/**
|
|
6393
6393
|
* Parameters for a Money Market borrow operation.
|
|
@@ -6405,7 +6405,7 @@ type MoneyMarketBorrowParams = {
|
|
|
6405
6405
|
amount: bigint;
|
|
6406
6406
|
action: 'borrow';
|
|
6407
6407
|
toChainId?: SpokeChainId;
|
|
6408
|
-
toAddress?:
|
|
6408
|
+
toAddress?: string;
|
|
6409
6409
|
};
|
|
6410
6410
|
/**
|
|
6411
6411
|
* Parameters for a Money Market withdraw operation.
|
|
@@ -6423,7 +6423,7 @@ type MoneyMarketWithdrawParams = {
|
|
|
6423
6423
|
amount: bigint;
|
|
6424
6424
|
action: 'withdraw';
|
|
6425
6425
|
toChainId?: SpokeChainId;
|
|
6426
|
-
toAddress?:
|
|
6426
|
+
toAddress?: string;
|
|
6427
6427
|
};
|
|
6428
6428
|
/**
|
|
6429
6429
|
* Parameters for a Money Market repay operation.
|
|
@@ -6441,7 +6441,7 @@ type MoneyMarketRepayParams = {
|
|
|
6441
6441
|
amount: bigint;
|
|
6442
6442
|
action: 'repay';
|
|
6443
6443
|
toChainId?: SpokeChainId;
|
|
6444
|
-
toAddress?:
|
|
6444
|
+
toAddress?: string;
|
|
6445
6445
|
};
|
|
6446
6446
|
type MoneyMarketParams = MoneyMarketSupplyParams | MoneyMarketBorrowParams | MoneyMarketWithdrawParams | MoneyMarketRepayParams;
|
|
6447
6447
|
type MoneyMarketUnknownErrorCode = 'SUPPLY_UNKNOWN_ERROR' | 'BORROW_UNKNOWN_ERROR' | 'WITHDRAW_UNKNOWN_ERROR' | 'REPAY_UNKNOWN_ERROR';
|
|
@@ -8587,6 +8587,19 @@ declare class SwapService {
|
|
|
8587
8587
|
* @returns {Promise<IntentState>} The intent state
|
|
8588
8588
|
*/
|
|
8589
8589
|
getFilledIntent(txHash: Hash$1): Promise<IntentState>;
|
|
8590
|
+
/**
|
|
8591
|
+
* Get the intent delivery info about solved intent from the Relayer API.
|
|
8592
|
+
* Packet data contains info about the intent execution on the destination chain.
|
|
8593
|
+
* @param {SpokeChainId} chainId - The destination spoke chain ID
|
|
8594
|
+
* @param {string} fillTxHash - The fill transaction hash (received from getStatus when status is 3 - SOLVED)
|
|
8595
|
+
* @param {number} timeout - The timeout in milliseconds (default: 120 seconds)
|
|
8596
|
+
* @returns {Promise<Result<PacketData, IntentError<'RELAY_TIMEOUT'>>>} A Result containing either the packet data or an IntentError with code 'RELAY_TIMEOUT'
|
|
8597
|
+
*/
|
|
8598
|
+
getSolvedIntentPacket({ chainId, fillTxHash, timeout, }: {
|
|
8599
|
+
chainId: SpokeChainId;
|
|
8600
|
+
fillTxHash: string;
|
|
8601
|
+
timeout?: number;
|
|
8602
|
+
}): Promise<Result<PacketData, IntentError<'RELAY_TIMEOUT'>>>;
|
|
8590
8603
|
/**
|
|
8591
8604
|
* Gets the keccak256 hash of an intent. Hash serves as the intent id on Hub chain.
|
|
8592
8605
|
* @param {Intent} intent - The intent
|
package/dist/index.mjs
CHANGED
|
@@ -13049,6 +13049,26 @@ var SwapService = class {
|
|
|
13049
13049
|
getFilledIntent(txHash) {
|
|
13050
13050
|
return EvmSolverService.getFilledIntent(txHash, this.config, this.hubProvider);
|
|
13051
13051
|
}
|
|
13052
|
+
/**
|
|
13053
|
+
* Get the intent delivery info about solved intent from the Relayer API.
|
|
13054
|
+
* Packet data contains info about the intent execution on the destination chain.
|
|
13055
|
+
* @param {SpokeChainId} chainId - The destination spoke chain ID
|
|
13056
|
+
* @param {string} fillTxHash - The fill transaction hash (received from getStatus when status is 3 - SOLVED)
|
|
13057
|
+
* @param {number} timeout - The timeout in milliseconds (default: 120 seconds)
|
|
13058
|
+
* @returns {Promise<Result<PacketData, IntentError<'RELAY_TIMEOUT'>>>} A Result containing either the packet data or an IntentError with code 'RELAY_TIMEOUT'
|
|
13059
|
+
*/
|
|
13060
|
+
async getSolvedIntentPacket({
|
|
13061
|
+
chainId,
|
|
13062
|
+
fillTxHash,
|
|
13063
|
+
timeout = DEFAULT_RELAY_TX_TIMEOUT
|
|
13064
|
+
}) {
|
|
13065
|
+
return waitUntilIntentExecuted({
|
|
13066
|
+
intentRelayChainId: getIntentRelayChainId(chainId).toString(),
|
|
13067
|
+
spokeTxHash: fillTxHash,
|
|
13068
|
+
timeout,
|
|
13069
|
+
apiUrl: this.config.relayerApiEndpoint
|
|
13070
|
+
});
|
|
13071
|
+
}
|
|
13052
13072
|
/**
|
|
13053
13073
|
* Gets the keccak256 hash of an intent. Hash serves as the intent id on Hub chain.
|
|
13054
13074
|
* @param {Intent} intent - The intent
|