@t2000/sdk 2.14.0 → 2.14.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/adapters/index.d.cts +1 -1
- package/dist/adapters/index.d.ts +1 -1
- package/dist/browser.cjs.map +1 -1
- package/dist/browser.d.cts +2 -2
- package/dist/browser.d.ts +2 -2
- package/dist/browser.js.map +1 -1
- package/dist/index.cjs +13 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +13 -1
- package/dist/index.js.map +1 -1
- package/dist/{types-D65N3sBO.d.ts → types-BMdhu0D7.d.ts} +1 -1
- package/dist/{types-1WUNZK-9.d.cts → types-C2Va_r0h.d.cts} +1 -1
- package/dist/{types-CFJrgLm2.d.cts → types-I7U99DvG.d.cts} +25 -8
- package/dist/{types-CFJrgLm2.d.ts → types-I7U99DvG.d.ts} +25 -8
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Ed25519Keypair } from '@mysten/sui/keypairs/ed25519';
|
|
2
2
|
import { SuiJsonRpcClient } from '@mysten/sui/jsonRpc';
|
|
3
|
-
import { T as TransactionLeg, k as TransactionRecord } from './types-
|
|
3
|
+
import { T as TransactionLeg, k as TransactionRecord } from './types-I7U99DvG.js';
|
|
4
4
|
import { Transaction, TransactionObjectArgument } from '@mysten/sui/transactions';
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Ed25519Keypair } from '@mysten/sui/keypairs/ed25519';
|
|
2
2
|
import { SuiJsonRpcClient } from '@mysten/sui/jsonRpc';
|
|
3
|
-
import { T as TransactionLeg, k as TransactionRecord } from './types-
|
|
3
|
+
import { T as TransactionLeg, k as TransactionRecord } from './types-I7U99DvG.cjs';
|
|
4
4
|
import { Transaction, TransactionObjectArgument } from '@mysten/sui/transactions';
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -179,14 +179,18 @@ declare function buildSwapTx(params: {
|
|
|
179
179
|
* split. This is the SPEC 7 multi-write enabler ("withdraw → swap →
|
|
180
180
|
* save" without intermediate wallet materialization).
|
|
181
181
|
*
|
|
182
|
-
* **SUI in wallet mode:**
|
|
183
|
-
*
|
|
184
|
-
*
|
|
185
|
-
*
|
|
186
|
-
*
|
|
187
|
-
*
|
|
188
|
-
*
|
|
189
|
-
*
|
|
182
|
+
* **SUI in wallet mode:** ALWAYS sources through `selectSuiCoin` (which
|
|
183
|
+
* routes via `coinWithBalance({ type: SUI, useGasCoin: false })` under
|
|
184
|
+
* sponsored flows, OR `tx.splitCoins(tx.gas, ...)` under self-funded
|
|
185
|
+
* flows). The caller MUST set `sponsoredContext` correctly — otherwise
|
|
186
|
+
* sponsored swaps with SUI source fail with `Cannot use GasCoin as a
|
|
187
|
+
* transaction argument` (Enoki owns `tx.gas`, the PTB body referencing
|
|
188
|
+
* it as an argument is invalid for sponsorship). 2.14.0 shipped without
|
|
189
|
+
* this branch and broke audric/web-v2 SUI→USDC swaps; restored in 2.14.1
|
|
190
|
+
* (S.260). For non-sponsored flows (CLI), `T2000.swap()` pre-builds the
|
|
191
|
+
* inputCoin via `tx.splitCoins(tx.gas, [rawAmount])[0]` and uses chain
|
|
192
|
+
* mode, sidestepping wallet-mode entirely — this branch is a defensive
|
|
193
|
+
* safety net for future direct SDK users who pass SUI in wallet mode.
|
|
190
194
|
*
|
|
191
195
|
* **`swapAll` semantics (wallet mode):** if the requested raw amount
|
|
192
196
|
* is >= the wallet's total `from` balance, the appender consumes the
|
|
@@ -235,6 +239,19 @@ declare function addSwapToTx(tx: Transaction, client: SuiJsonRpcClient, address:
|
|
|
235
239
|
* config (the route data already encodes the chosen DEX path).
|
|
236
240
|
*/
|
|
237
241
|
precomputedRoute?: SwapRouteResult;
|
|
242
|
+
/**
|
|
243
|
+
* Whether this swap is being built inside a sponsored-tx flow (Enoki)
|
|
244
|
+
* vs self-funded (CLI / direct sign). Load-bearing for SUI-source
|
|
245
|
+
* swaps in wallet mode: under sponsored flows, `tx.gas` belongs to
|
|
246
|
+
* the sponsor and CANNOT be referenced as a transaction argument
|
|
247
|
+
* (Sui protocol rejects with `Cannot use GasCoin as a transaction
|
|
248
|
+
* argument`). When `true`, SUI source routes through `selectSuiCoin`
|
|
249
|
+
* with `useGasCoin: false` so the resolver sources from the user's
|
|
250
|
+
* SUI coin objects + address balance instead. Defaults to `false`
|
|
251
|
+
* (back-compat — pre-2.14.1 behavior). Audric/web-v2's compose path
|
|
252
|
+
* threads this through via `composeTx({ sponsoredContext: true })`.
|
|
253
|
+
*/
|
|
254
|
+
sponsoredContext?: boolean;
|
|
238
255
|
}): Promise<{
|
|
239
256
|
coin: TransactionObjectArgument;
|
|
240
257
|
effectiveAmountIn: number;
|
|
@@ -179,14 +179,18 @@ declare function buildSwapTx(params: {
|
|
|
179
179
|
* split. This is the SPEC 7 multi-write enabler ("withdraw → swap →
|
|
180
180
|
* save" without intermediate wallet materialization).
|
|
181
181
|
*
|
|
182
|
-
* **SUI in wallet mode:**
|
|
183
|
-
*
|
|
184
|
-
*
|
|
185
|
-
*
|
|
186
|
-
*
|
|
187
|
-
*
|
|
188
|
-
*
|
|
189
|
-
*
|
|
182
|
+
* **SUI in wallet mode:** ALWAYS sources through `selectSuiCoin` (which
|
|
183
|
+
* routes via `coinWithBalance({ type: SUI, useGasCoin: false })` under
|
|
184
|
+
* sponsored flows, OR `tx.splitCoins(tx.gas, ...)` under self-funded
|
|
185
|
+
* flows). The caller MUST set `sponsoredContext` correctly — otherwise
|
|
186
|
+
* sponsored swaps with SUI source fail with `Cannot use GasCoin as a
|
|
187
|
+
* transaction argument` (Enoki owns `tx.gas`, the PTB body referencing
|
|
188
|
+
* it as an argument is invalid for sponsorship). 2.14.0 shipped without
|
|
189
|
+
* this branch and broke audric/web-v2 SUI→USDC swaps; restored in 2.14.1
|
|
190
|
+
* (S.260). For non-sponsored flows (CLI), `T2000.swap()` pre-builds the
|
|
191
|
+
* inputCoin via `tx.splitCoins(tx.gas, [rawAmount])[0]` and uses chain
|
|
192
|
+
* mode, sidestepping wallet-mode entirely — this branch is a defensive
|
|
193
|
+
* safety net for future direct SDK users who pass SUI in wallet mode.
|
|
190
194
|
*
|
|
191
195
|
* **`swapAll` semantics (wallet mode):** if the requested raw amount
|
|
192
196
|
* is >= the wallet's total `from` balance, the appender consumes the
|
|
@@ -235,6 +239,19 @@ declare function addSwapToTx(tx: Transaction, client: SuiJsonRpcClient, address:
|
|
|
235
239
|
* config (the route data already encodes the chosen DEX path).
|
|
236
240
|
*/
|
|
237
241
|
precomputedRoute?: SwapRouteResult;
|
|
242
|
+
/**
|
|
243
|
+
* Whether this swap is being built inside a sponsored-tx flow (Enoki)
|
|
244
|
+
* vs self-funded (CLI / direct sign). Load-bearing for SUI-source
|
|
245
|
+
* swaps in wallet mode: under sponsored flows, `tx.gas` belongs to
|
|
246
|
+
* the sponsor and CANNOT be referenced as a transaction argument
|
|
247
|
+
* (Sui protocol rejects with `Cannot use GasCoin as a transaction
|
|
248
|
+
* argument`). When `true`, SUI source routes through `selectSuiCoin`
|
|
249
|
+
* with `useGasCoin: false` so the resolver sources from the user's
|
|
250
|
+
* SUI coin objects + address balance instead. Defaults to `false`
|
|
251
|
+
* (back-compat — pre-2.14.1 behavior). Audric/web-v2's compose path
|
|
252
|
+
* threads this through via `composeTx({ sponsoredContext: true })`.
|
|
253
|
+
*/
|
|
254
|
+
sponsoredContext?: boolean;
|
|
238
255
|
}): Promise<{
|
|
239
256
|
coin: TransactionObjectArgument;
|
|
240
257
|
effectiveAmountIn: number;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@t2000/sdk",
|
|
3
|
-
"version": "2.14.
|
|
3
|
+
"version": "2.14.2",
|
|
4
4
|
"description": "TypeScript SDK for AI agent bank accounts on Sui — send, save, borrow, swap. NAVI lending + Cetus aggregator routing, sponsored gas, zkLogin compatible.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|