@sodax/types 2.1.0-rc.2 → 2.1.0-rc.4

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.
@@ -257,6 +257,13 @@ export interface AllowanceCheckResponseV2 {
257
257
  export interface ApproveResponseV2 {
258
258
  /** Unsigned approval transaction — the `RawTxReturnType` variant for the request's `srcChainKey`. */
259
259
  tx: RawTxReturnType;
260
+ /**
261
+ * Present only when the source token rejects an allowance change from one non-zero value to
262
+ * another — the 2017 TetherToken lineage. Broadcast this first and wait for it to be mined, then
263
+ * broadcast `tx`; the second approve is only valid once the allowance has been zeroed on-chain.
264
+ * Absent for every other token, and for a wallet with nothing approved yet.
265
+ */
266
+ resetTx?: RawTxReturnType;
260
267
  }
261
268
  /** POST /swaps/intents — response body. */
262
269
  export interface CreateIntentResponseV2 {
@@ -2863,7 +2863,7 @@ export declare const spokeChainConfig: {
2863
2863
  };
2864
2864
  readonly nativeToken: "0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI";
2865
2865
  readonly bnUSD: "0xff4de2b2b57dd7611d2812d231a467d007b702a101fd5c7ad3b278257cddb507::bnusd::BNUSD";
2866
- readonly rpc_url: "https://fullnode.mainnet.sui.io:443";
2866
+ readonly rpc_url: "https://sui-rpc.publicnode.com";
2867
2867
  readonly chain: {
2868
2868
  readonly name: "SUI";
2869
2869
  readonly key: "sui";
@@ -637,7 +637,7 @@ export const spokeChainConfig = {
637
637
  supportedTokens: suiSupportedTokens,
638
638
  nativeToken: '0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI',
639
639
  bnUSD: '0xff4de2b2b57dd7611d2812d231a467d007b702a101fd5c7ad3b278257cddb507::bnusd::BNUSD',
640
- rpc_url: 'https://fullnode.mainnet.sui.io:443',
640
+ rpc_url: 'https://sui-rpc.publicnode.com',
641
641
  chain: baseChainInfo[ChainKeys.SUI_MAINNET],
642
642
  pollingConfig: {
643
643
  pollingIntervalMs: 500,
@@ -7,6 +7,12 @@ import type { SpokeChainKey } from '../chains/chains.js';
7
7
  export declare const HookKind: {
8
8
  /** Deposits delivered USDC into the recipient's HyperCore perps account (HyperEVM). */
9
9
  readonly HYPERCORE_DEPOSIT: "hyperCoreDeposit";
10
+ /**
11
+ * Requests an ERC-7540 deposit of delivered USDC into the Flint RWA vault (Ethereum), with the
12
+ * recipient as the request's controller. Asynchronous: the request mints no shares — Flint's
13
+ * curator settles a NAV and then claims the shares on the controller's behalf.
14
+ */
15
+ readonly FLINT_DEPOSIT: "flintDeposit";
10
16
  };
11
17
  export type HookKind = (typeof HookKind)[keyof typeof HookKind];
12
18
  export type SpokeHookConfig = {
@@ -13,6 +13,12 @@ import { ChainKeys, spokeChainConfig } from '../chains/chains.js';
13
13
  export const HookKind = {
14
14
  /** Deposits delivered USDC into the recipient's HyperCore perps account (HyperEVM). */
15
15
  HYPERCORE_DEPOSIT: 'hyperCoreDeposit',
16
+ /**
17
+ * Requests an ERC-7540 deposit of delivered USDC into the Flint RWA vault (Ethereum), with the
18
+ * recipient as the request's controller. Asynchronous: the request mints no shares — Flint's
19
+ * curator settles a NAV and then claims the shares on the controller's behalf.
20
+ */
21
+ FLINT_DEPOSIT: 'flintDeposit',
16
22
  };
17
23
  /**
18
24
  * Deployed delivery hooks, keyed by the chain they live on. Many hooks per chain and many chains
@@ -26,6 +32,20 @@ export const spokeHooks = {
26
32
  supportedTokens: [spokeChainConfig[ChainKeys.HYPEREVM_MAINNET].supportedTokens.USDC.address], // USDC on HyperEVM
27
33
  },
28
34
  ],
35
+ // HookKind.FLINT_DEPOSIT is not registered yet: FlintDepositHook is not deployed to Ethereum
36
+ // mainnet (icon-project/sodax-contracts#693). Registering it with a placeholder address would
37
+ // route real intent output to that address, so the entry lands with the deployment:
38
+ //
39
+ // [ChainKeys.ETHEREUM_MAINNET]: [
40
+ // {
41
+ // kind: HookKind.FLINT_DEPOSIT,
42
+ // address: '0x…',
43
+ // supportedTokens: [spokeChainConfig[ChainKeys.ETHEREUM_MAINNET].supportedTokens.USDC.address],
44
+ // },
45
+ // ],
46
+ //
47
+ // Until then `getSpokeHook` returns undefined and `resolveDeliveryHook` throws, which is the
48
+ // correct behaviour for a hook that does not exist on chain.
29
49
  };
30
50
  /** Returns the deployed hook of the given kind on `chainKey`, or `undefined` if none is registered. */
31
51
  export const getSpokeHook = (chainKey, kind) => spokeHooks[chainKey]?.find(h => h.kind === kind);
package/dist/index.d.ts CHANGED
@@ -19,4 +19,4 @@ export * from './sui/index.js';
19
19
  export * from './swap/index.js';
20
20
  export * from './utils/index.js';
21
21
  export * from './wallet/index.js';
22
- export declare const CONFIG_VERSION = 222;
22
+ export declare const CONFIG_VERSION = 224;
package/dist/index.js CHANGED
@@ -19,4 +19,4 @@ export * from './sui/index.js';
19
19
  export * from './swap/index.js';
20
20
  export * from './utils/index.js';
21
21
  export * from './wallet/index.js';
22
- export const CONFIG_VERSION = 222; // this value should be incremented (inside release/sdk branch) each time @sodax/types package is updated
22
+ export const CONFIG_VERSION = 224; // this value should be incremented (inside release/sdk branch) each time @sodax/types package is updated
@@ -31,6 +31,12 @@ export type BitcoinSharedChainConfig = TxPollingConfig & {
31
31
  export type BridgeConfig = Prettify<BridgeDefaultConfig & BridgeOptions>;
32
32
  export type BridgeOptions = {
33
33
  partnerFee?: PartnerFee;
34
+ /**
35
+ * Route `bridge()` through the backend submit-tx flow. Default `true`.
36
+ * Set `false` for the fully client-side relay. Client-side only — not part of backend SodaxDefaultConfig.
37
+ * Omitted here means the default, not off: read the effective value via `sodax.config.bridgeUseBackendSubmitTx`.
38
+ */
39
+ useBackendSubmitTx?: boolean;
34
40
  };
35
41
  export type BridgeDefaultConfig = {};
36
42
  export declare const bridgeConfig: {};
@@ -52,6 +58,20 @@ export type RadfiSigner = (ctx: RadfiSignContext) => Record<string, string> | Pr
52
58
  export type RadfiOptions = {
53
59
  signRequest?: RadfiSigner;
54
60
  };
61
+ /**
62
+ * @deprecated in favor of `swaps` property of SodaxOptionalConfig, kept for backward compatibility.
63
+ * Still honoured, but only when `swaps.useBackendSubmitTx` is omitted; the default is now `true`.
64
+ */
65
+ export type SwapsClientOptions = {
66
+ useBackendSubmitTx?: boolean;
67
+ };
68
+ /**
69
+ * @deprecated in favor of `bridge` property of SodaxOptionalConfig, kept for backward compatibility.
70
+ * Still honoured, but only when `bridge.useBackendSubmitTx` is omitted; the default is now `true`.
71
+ */
72
+ export type BridgeClientOptions = {
73
+ useBackendSubmitTx?: boolean;
74
+ };
55
75
  export type SodaxOptionalConfig = {
56
76
  logger?: SodaxLoggerOption;
57
77
  analytics?: AnalyticsOption;
@@ -61,7 +81,9 @@ export type SodaxOptionalConfig = {
61
81
  moneyMarket?: MoneyMarketOptions;
62
82
  bridge?: BridgeOptions;
63
83
  leverageYield?: LeverageYieldOptions;
84
+ /** @deprecated Use `swaps` instead — still honoured, but only when `swaps.useBackendSubmitTx` is absent. */
64
85
  swapsOptions?: SwapsClientOptions;
86
+ /** @deprecated Use `bridge` instead — still honoured, but only when `bridge.useBackendSubmitTx` is absent. */
65
87
  bridgeOptions?: BridgeClientOptions;
66
88
  };
67
89
  /**
@@ -90,31 +112,6 @@ export type SodaxDefaultConfig = {
90
112
  solver: SolverConfig;
91
113
  relay: RelayConfig;
92
114
  };
93
- /**
94
- * Client-side swap behavior options. Like {@link SodaxOptionalConfig.logger}, these are runtime toggles
95
- * resolved once at construction — NOT part of the backend-fetched {@link SodaxDefaultConfig} data.
96
- */
97
- export type SwapsClientOptions = {
98
- /**
99
- * Opt-in: route `swap()` through the backend submit-tx 2-step flow (the backend relays +
100
- * post-executes server-side). On ANY non-success the SDK falls back to the client-side relay so
101
- * the swap still completes. Default `false` (the current fully client-side flow).
102
- */
103
- useBackendSubmitTx?: boolean;
104
- };
105
- /**
106
- * Client-side bridge behavior options. Like {@link SwapsClientOptions}, these are runtime toggles
107
- * resolved once at construction — NOT part of the backend-fetched {@link SodaxDefaultConfig} data.
108
- */
109
- export type BridgeClientOptions = {
110
- /**
111
- * Opt-in: route `bridge()` through the backend submit-tx flow (the backend relays the spoke
112
- * deposit server-side). On ANY non-success the SDK falls back to the client-side
113
- * `relayTxAndWaitPacket` flow so the bridge still completes. Default `false` (the current fully
114
- * client-side flow).
115
- */
116
- useBackendSubmitTx?: boolean;
117
- };
118
115
  export declare const sodaxConfig: {
119
116
  chains: {
120
117
  readonly sonic: {
@@ -2433,7 +2430,7 @@ export declare const sodaxConfig: {
2433
2430
  };
2434
2431
  readonly nativeToken: "0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI";
2435
2432
  readonly bnUSD: "0xff4de2b2b57dd7611d2812d231a467d007b702a101fd5c7ad3b278257cddb507::bnusd::BNUSD";
2436
- readonly rpc_url: "https://fullnode.mainnet.sui.io:443";
2433
+ readonly rpc_url: "https://sui-rpc.publicnode.com";
2437
2434
  readonly chain: {
2438
2435
  readonly name: "SUI";
2439
2436
  readonly key: "sui";
@@ -1939,6 +1939,12 @@ export declare const stagingSwapSupportedTokens: {
1939
1939
  };
1940
1940
  export type SwapsOptions = {
1941
1941
  partnerFee?: PartnerFee;
1942
+ /**
1943
+ * Route `swap()` through the backend submit-tx 2-step flow. Default `true`.
1944
+ * Set `false` for the fully client-side relay. Client-side only — not part of backend SodaxDefaultConfig.
1945
+ * Omitted here means the default, not off: read the effective value via `sodax.config.swapUseBackendSubmitTx`.
1946
+ */
1947
+ useBackendSubmitTx?: boolean;
1942
1948
  };
1943
1949
  export type SwapsDefaultConfig = {
1944
1950
  supportedTokens: Record<SpokeChainKey, readonly XToken[]>;
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
7
- "version": "2.1.0-rc.2",
7
+ "version": "2.1.0-rc.4",
8
8
  "description": "Sodax Common Types",
9
9
  "main": "dist/index.js",
10
10
  "homepage": "https://github.com/icon-project/sodax-sdks/tree/main/packages/types",