@shogun-sdk/intents-sdk 1.4.0 → 1.4.2
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 +16 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +16 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/chains.ts +18 -0
- package/src/core/orders/api/index.ts +5 -3
- package/src/utils/quote/paraswap.ts +7 -0
package/dist/index.d.cts
CHANGED
|
@@ -859,7 +859,7 @@ declare function fetchUserOrders({ token, wallet, network }: FetchUserOrdersPara
|
|
|
859
859
|
interface GetUserOrdersParams {
|
|
860
860
|
/** Wallet address to query. Combined with any wallet(s) carried by the JWT claims. */
|
|
861
861
|
wallet?: string;
|
|
862
|
-
/** Restrict results to a single chain. Serialized as
|
|
862
|
+
/** Restrict results to a single chain. Serialized as the auctioneer's network name (e.g. Base). */
|
|
863
863
|
network?: SupportedChain;
|
|
864
864
|
}
|
|
865
865
|
declare class AuctioneerAPI {
|
package/dist/index.d.ts
CHANGED
|
@@ -859,7 +859,7 @@ declare function fetchUserOrders({ token, wallet, network }: FetchUserOrdersPara
|
|
|
859
859
|
interface GetUserOrdersParams {
|
|
860
860
|
/** Wallet address to query. Combined with any wallet(s) carried by the JWT claims. */
|
|
861
861
|
wallet?: string;
|
|
862
|
-
/** Restrict results to a single chain. Serialized as
|
|
862
|
+
/** Restrict results to a single chain. Serialized as the auctioneer's network name (e.g. Base). */
|
|
863
863
|
network?: SupportedChain;
|
|
864
864
|
}
|
|
865
865
|
declare class AuctioneerAPI {
|
package/dist/index.js
CHANGED
|
@@ -20,7 +20,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
20
20
|
function isEvmChain(chainId) {
|
|
21
21
|
return chainId !== 7565164 /* Solana */ && chainId !== 101 /* Sui */;
|
|
22
22
|
}
|
|
23
|
-
var ChainType, ChainID, SupportedChains, isSupportedChain, chainIdToChainTypeMap;
|
|
23
|
+
var ChainType, ChainID, SupportedChains, isSupportedChain, chainIdToChainTypeMap, chainIdToNetworkName;
|
|
24
24
|
var init_chains = __esm({
|
|
25
25
|
"src/chains.ts"() {
|
|
26
26
|
"use strict";
|
|
@@ -65,6 +65,16 @@ var init_chains = __esm({
|
|
|
65
65
|
[56 /* BSC */]: "EVM" /* EVM */,
|
|
66
66
|
[143 /* MONAD */]: "EVM" /* EVM */
|
|
67
67
|
};
|
|
68
|
+
chainIdToNetworkName = {
|
|
69
|
+
[42161 /* Arbitrum */]: "ArbitrumOne",
|
|
70
|
+
[10 /* Optimism */]: "Optimism",
|
|
71
|
+
[8453 /* Base */]: "Base",
|
|
72
|
+
[999 /* Hyperliquid */]: "HyperEVM",
|
|
73
|
+
[7565164 /* Solana */]: "Solana",
|
|
74
|
+
[101 /* Sui */]: "Sui",
|
|
75
|
+
[56 /* BSC */]: "Bsc",
|
|
76
|
+
[143 /* MONAD */]: "Monad"
|
|
77
|
+
};
|
|
68
78
|
}
|
|
69
79
|
});
|
|
70
80
|
|
|
@@ -4831,6 +4841,9 @@ var ParaswapQuoteProvider = class {
|
|
|
4831
4841
|
}
|
|
4832
4842
|
async getQuote(paraswapParams) {
|
|
4833
4843
|
const params = { ...paraswapParams };
|
|
4844
|
+
if (isNativeEvmToken(params.srcToken)) {
|
|
4845
|
+
params.srcToken = WRAPPED_ETH_ADDRESSES[this.chainId];
|
|
4846
|
+
}
|
|
4834
4847
|
if (isNativeEvmToken(params.destToken)) {
|
|
4835
4848
|
params.destToken = WRAPPED_ETH_ADDRESSES[this.chainId];
|
|
4836
4849
|
}
|
|
@@ -8063,6 +8076,7 @@ var SuiSDK = class extends BaseSDK {
|
|
|
8063
8076
|
|
|
8064
8077
|
// src/core/orders/api/index.ts
|
|
8065
8078
|
init_constants();
|
|
8079
|
+
init_chains();
|
|
8066
8080
|
var AuctioneerAPI = class {
|
|
8067
8081
|
constructor(aggregatedToken) {
|
|
8068
8082
|
__publicField(this, "aggregatedToken");
|
|
@@ -8077,7 +8091,7 @@ var AuctioneerAPI = class {
|
|
|
8077
8091
|
query.set("wallet", params.wallet);
|
|
8078
8092
|
}
|
|
8079
8093
|
if (params.network !== void 0) {
|
|
8080
|
-
query.set("network",
|
|
8094
|
+
query.set("network", chainIdToNetworkName[params.network]);
|
|
8081
8095
|
}
|
|
8082
8096
|
const queryString = query.toString();
|
|
8083
8097
|
const url = `${AUCTIONEER_URL}/user_intent${queryString ? `?${queryString}` : ""}`;
|