@t2000/sdk 10.15.0 → 10.16.0
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/browser.cjs +8 -0
- package/dist/browser.cjs.map +1 -1
- package/dist/browser.d.cts +1 -1
- package/dist/browser.d.ts +1 -1
- package/dist/browser.js +8 -0
- package/dist/browser.js.map +1 -1
- package/dist/{commerce-C4D3VxBu.d.cts → commerce-BkSSPS1w.d.cts} +6 -1
- package/dist/{commerce-C4D3VxBu.d.ts → commerce-BkSSPS1w.d.ts} +6 -1
- package/dist/index.cjs +168 -156
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -4
- package/dist/index.d.ts +6 -4
- package/dist/index.js +168 -157
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { EventEmitter } from 'eventemitter3';
|
|
2
2
|
import { SuiGrpcClient } from '@mysten/sui/grpc';
|
|
3
3
|
import { Ed25519Keypair } from '@mysten/sui/keypairs/ed25519';
|
|
4
|
-
import { X as T2000Error, b1 as T2000Options, a2 as TransactionSigner, u as PayOptions, v as PayResult, b2 as SwapResult, b3 as SwapQuoteResult, V as SupportedAsset, F as SendResult, B as BalanceResponse, a1 as TransactionRecord, g as DepositInfo, b4 as PaymentRequest, ab as ZkLoginProof, b5 as SuiCoreClient, s as OverlayFeeConfig, b6 as SponsoredCoinMergeCache, W as SwapRouteResult, b7 as SendableAsset } from './commerce-
|
|
5
|
-
export { A as A2A_ESCROW_FEE_CONFIG_ID, a as A2A_ESCROW_PACKAGE_ID, b8 as CETUS_USDC_SUI_POOL, C as CLOCK_ID, b as COIN_REGISTRY, c as ClassifyBalanceChange, d as ClassifyResult, e as CoinMeta, b9 as CoinPage, D as DEFAULT_COMMERCE_API_BASE, ba as DEFAULT_GRPC_URL, f as DEFAULT_NETWORK, E as ETH_TYPE, h as ExtractedTransfer, bb as GASLESS_MIN_STABLE_AMOUNT, bc as GASLESS_STABLE_TYPES, G as GAS_RESERVE_MIN, I as IKA_TYPE, J as JOB_STATES, i as Job, j as JobState, k as JobTerms, l as JobVerification, K as KNOWN_TARGETS, m as KeypairSigner, L as LABEL_PATTERNS, n as LOFI_TYPE, M as MANIFEST_TYPE, o as MAX_DELIVER_HORIZON_MS, p as MAX_JOB_USDC, q as MAX_REVIEW_WINDOW_MS, r as MIST_PER_SUI, N as NAVX_TYPE, bd as OPERATION_ASSETS, O as OVERLAY_FEE_RATE, be as Operation, P as PREFLIGHT_MAX_AMOUNT, t as PREFLIGHT_OK, w as PreflightResult, bf as SENDABLE_ASSETS, S as STABLE_ASSETS, x as SUI_DECIMALS, y as SUI_TYPE, z as SUPPORTED_ASSETS, bg as SelectAndSplitResult, bh as SerializedCetusRoute, bi as SerializedCetusRoutePath, bj as SerializedRouterDataV3, H as ServiceListing, Q as SimulationResult, R as StableAsset, T as SuiHolding, U as SuiRpcTxBlock, Y as T2000ErrorCode, Z as T2000ErrorData, _ as T2000_OVERLAY_FEE_WALLET, $ as TOKEN_MAP, a0 as TransactionLeg, a3 as TxDirection, a4 as USDC_DECIMALS, a5 as USDC_TYPE, a6 as USDE_TYPE, a7 as USDSUI_TYPE, a8 as USDT_TYPE, a9 as WAL_TYPE, aa as WBTC_TYPE, ac as ZkLoginSigner, bk as addSendToTx, bl as addSwapToTx, bm as assertAllowedAsset, bn as assertBuyerRequirements, ad as buildCreateJobTx, ae as buildDeliverJobTx, af as buildRefundJobTx, ag as buildRejectJobTx, ah as buildReleaseJobTx, ai as buildSendTx, aj as buildSwapTx, ak as checkPositiveAmount, al as checkSuiAddress, am as classifyAction, an as classifyLabel, ao as classifyTransaction,
|
|
4
|
+
import { X as T2000Error, b1 as T2000Options, a2 as TransactionSigner, u as PayOptions, v as PayResult, b2 as SwapResult, b3 as SwapQuoteResult, V as SupportedAsset, F as SendResult, B as BalanceResponse, a1 as TransactionRecord, g as DepositInfo, b4 as PaymentRequest, ab as ZkLoginProof, b5 as SuiCoreClient, s as OverlayFeeConfig, b6 as SponsoredCoinMergeCache, W as SwapRouteResult, b7 as SendableAsset } from './commerce-BkSSPS1w.cjs';
|
|
5
|
+
export { A as A2A_ESCROW_FEE_CONFIG_ID, a as A2A_ESCROW_PACKAGE_ID, b8 as CETUS_USDC_SUI_POOL, C as CLOCK_ID, b as COIN_REGISTRY, c as ClassifyBalanceChange, d as ClassifyResult, e as CoinMeta, b9 as CoinPage, D as DEFAULT_COMMERCE_API_BASE, ba as DEFAULT_GRPC_URL, f as DEFAULT_NETWORK, E as ETH_TYPE, h as ExtractedTransfer, bb as GASLESS_MIN_STABLE_AMOUNT, bc as GASLESS_STABLE_TYPES, G as GAS_RESERVE_MIN, I as IKA_TYPE, J as JOB_STATES, i as Job, j as JobState, k as JobTerms, l as JobVerification, K as KNOWN_TARGETS, m as KeypairSigner, L as LABEL_PATTERNS, n as LOFI_TYPE, M as MANIFEST_TYPE, o as MAX_DELIVER_HORIZON_MS, p as MAX_JOB_USDC, q as MAX_REVIEW_WINDOW_MS, r as MIST_PER_SUI, N as NAVX_TYPE, bd as OPERATION_ASSETS, O as OVERLAY_FEE_RATE, be as Operation, P as PREFLIGHT_MAX_AMOUNT, t as PREFLIGHT_OK, w as PreflightResult, bf as SENDABLE_ASSETS, S as STABLE_ASSETS, x as SUI_DECIMALS, y as SUI_TYPE, z as SUPPORTED_ASSETS, bg as SelectAndSplitResult, bh as SerializedCetusRoute, bi as SerializedCetusRoutePath, bj as SerializedRouterDataV3, H as ServiceListing, Q as SimulationResult, R as StableAsset, T as SuiHolding, U as SuiRpcTxBlock, Y as T2000ErrorCode, Z as T2000ErrorData, _ as T2000_OVERLAY_FEE_WALLET, $ as TOKEN_MAP, a0 as TransactionLeg, a3 as TxDirection, a4 as USDC_DECIMALS, a5 as USDC_TYPE, a6 as USDE_TYPE, a7 as USDSUI_TYPE, a8 as USDT_TYPE, a9 as WAL_TYPE, aa as WBTC_TYPE, ac as ZkLoginSigner, bk as addSendToTx, bl as addSwapToTx, bm as assertAllowedAsset, bn as assertBuyerRequirements, ad as buildCreateJobTx, bo as buildDeclineJobTx, ae as buildDeliverJobTx, af as buildRefundJobTx, ag as buildRejectJobTx, ah as buildReleaseJobTx, ai as buildSendTx, aj as buildSwapTx, ak as checkPositiveAmount, al as checkSuiAddress, am as classifyAction, an as classifyLabel, ao as classifyTransaction, bp as deserializeCetusRoute, ap as executeTx, aq as extractAllUserLegs, ar as extractTransferDetails, as as extractTxCommands, at as extractTxSender, au as fallbackLabel, bq as fetchAllCoins, av as fetchService, aw as findSwapRoute, ax as formatAssetAmount, ay as formatSui, az as formatUsd, br as getCoinMeta, aA as getDecimals, aB as getDecimalsForCoinType, aC as getJob, aD as getJobSpec, bs as getSuiClient, bt as getSuiGrpcClient, bu as isAllowedAsset, bv as isCetusRouteFresh, bw as isInRegistry, aE as jobActionsFor, aF as listServices, aG as mapMoveAbortCode, aH as mapWalletError, aI as mistToSui, bx as normalizeAsset, by as normalizeCoinType, aJ as parseMppSuiChallenge, aK as parseSuiRpcTx, aL as payWithMpp, aM as preflightCreateJob, aN as preflightFail, aO as preflightPay, aP as preflightSend, aQ as preflightSwap, aR as putJobSpec, bz as queryHistory, bA as queryTransaction, aS as rawToStable, aT as rawToUsdc, aU as refineLendingLabel, aV as resolveSymbol, aW as resolveTokenType, bB as selectAndSplitCoin, bC as selectSuiCoin, bD as serializeCetusRoute, bE as simulateTransaction, aX as stableToRaw, aY as suiToMist, bF as throwIfSimulationFailed, aZ as truncateAddress, a_ as usdcToRaw, a$ as validateAddress, bG as verifyCetusRouteCoinMatch, b0 as verifyJobForSeller } from './commerce-BkSSPS1w.cjs';
|
|
6
6
|
import { Transaction, TransactionObjectArgument } from '@mysten/sui/transactions';
|
|
7
7
|
import { SuinsClient } from '@mysten/suins';
|
|
8
8
|
import '@mysten/sui/client';
|
|
@@ -565,8 +565,10 @@ declare function getAddress(keypair: Ed25519Keypair): string;
|
|
|
565
565
|
* target the LATEST published id — the original id (types, Job verbs) is
|
|
566
566
|
* unchanged.
|
|
567
567
|
*/
|
|
568
|
-
/** The
|
|
569
|
-
* adds the `opening` module).
|
|
568
|
+
/** The LATEST published `a2a_escrow` package id (v3 upgrade 2026-07-28 —
|
|
569
|
+
* adds `escrow::decline`; v2 added the `opening` module). New-verb calls
|
|
570
|
+
* (opening + decline) target this; original-id verbs stay put, and older
|
|
571
|
+
* package ids remain callable for published clients. */
|
|
570
572
|
declare const A2A_ESCROW_OPENING_PACKAGE_ID: string;
|
|
571
573
|
/** v1 claim policy: any ACTIVE registered Agent ID. */
|
|
572
574
|
declare const OPENING_CLAIM_POLICY_ANY_ACTIVE = 0;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { EventEmitter } from 'eventemitter3';
|
|
2
2
|
import { SuiGrpcClient } from '@mysten/sui/grpc';
|
|
3
3
|
import { Ed25519Keypair } from '@mysten/sui/keypairs/ed25519';
|
|
4
|
-
import { X as T2000Error, b1 as T2000Options, a2 as TransactionSigner, u as PayOptions, v as PayResult, b2 as SwapResult, b3 as SwapQuoteResult, V as SupportedAsset, F as SendResult, B as BalanceResponse, a1 as TransactionRecord, g as DepositInfo, b4 as PaymentRequest, ab as ZkLoginProof, b5 as SuiCoreClient, s as OverlayFeeConfig, b6 as SponsoredCoinMergeCache, W as SwapRouteResult, b7 as SendableAsset } from './commerce-
|
|
5
|
-
export { A as A2A_ESCROW_FEE_CONFIG_ID, a as A2A_ESCROW_PACKAGE_ID, b8 as CETUS_USDC_SUI_POOL, C as CLOCK_ID, b as COIN_REGISTRY, c as ClassifyBalanceChange, d as ClassifyResult, e as CoinMeta, b9 as CoinPage, D as DEFAULT_COMMERCE_API_BASE, ba as DEFAULT_GRPC_URL, f as DEFAULT_NETWORK, E as ETH_TYPE, h as ExtractedTransfer, bb as GASLESS_MIN_STABLE_AMOUNT, bc as GASLESS_STABLE_TYPES, G as GAS_RESERVE_MIN, I as IKA_TYPE, J as JOB_STATES, i as Job, j as JobState, k as JobTerms, l as JobVerification, K as KNOWN_TARGETS, m as KeypairSigner, L as LABEL_PATTERNS, n as LOFI_TYPE, M as MANIFEST_TYPE, o as MAX_DELIVER_HORIZON_MS, p as MAX_JOB_USDC, q as MAX_REVIEW_WINDOW_MS, r as MIST_PER_SUI, N as NAVX_TYPE, bd as OPERATION_ASSETS, O as OVERLAY_FEE_RATE, be as Operation, P as PREFLIGHT_MAX_AMOUNT, t as PREFLIGHT_OK, w as PreflightResult, bf as SENDABLE_ASSETS, S as STABLE_ASSETS, x as SUI_DECIMALS, y as SUI_TYPE, z as SUPPORTED_ASSETS, bg as SelectAndSplitResult, bh as SerializedCetusRoute, bi as SerializedCetusRoutePath, bj as SerializedRouterDataV3, H as ServiceListing, Q as SimulationResult, R as StableAsset, T as SuiHolding, U as SuiRpcTxBlock, Y as T2000ErrorCode, Z as T2000ErrorData, _ as T2000_OVERLAY_FEE_WALLET, $ as TOKEN_MAP, a0 as TransactionLeg, a3 as TxDirection, a4 as USDC_DECIMALS, a5 as USDC_TYPE, a6 as USDE_TYPE, a7 as USDSUI_TYPE, a8 as USDT_TYPE, a9 as WAL_TYPE, aa as WBTC_TYPE, ac as ZkLoginSigner, bk as addSendToTx, bl as addSwapToTx, bm as assertAllowedAsset, bn as assertBuyerRequirements, ad as buildCreateJobTx, ae as buildDeliverJobTx, af as buildRefundJobTx, ag as buildRejectJobTx, ah as buildReleaseJobTx, ai as buildSendTx, aj as buildSwapTx, ak as checkPositiveAmount, al as checkSuiAddress, am as classifyAction, an as classifyLabel, ao as classifyTransaction,
|
|
4
|
+
import { X as T2000Error, b1 as T2000Options, a2 as TransactionSigner, u as PayOptions, v as PayResult, b2 as SwapResult, b3 as SwapQuoteResult, V as SupportedAsset, F as SendResult, B as BalanceResponse, a1 as TransactionRecord, g as DepositInfo, b4 as PaymentRequest, ab as ZkLoginProof, b5 as SuiCoreClient, s as OverlayFeeConfig, b6 as SponsoredCoinMergeCache, W as SwapRouteResult, b7 as SendableAsset } from './commerce-BkSSPS1w.js';
|
|
5
|
+
export { A as A2A_ESCROW_FEE_CONFIG_ID, a as A2A_ESCROW_PACKAGE_ID, b8 as CETUS_USDC_SUI_POOL, C as CLOCK_ID, b as COIN_REGISTRY, c as ClassifyBalanceChange, d as ClassifyResult, e as CoinMeta, b9 as CoinPage, D as DEFAULT_COMMERCE_API_BASE, ba as DEFAULT_GRPC_URL, f as DEFAULT_NETWORK, E as ETH_TYPE, h as ExtractedTransfer, bb as GASLESS_MIN_STABLE_AMOUNT, bc as GASLESS_STABLE_TYPES, G as GAS_RESERVE_MIN, I as IKA_TYPE, J as JOB_STATES, i as Job, j as JobState, k as JobTerms, l as JobVerification, K as KNOWN_TARGETS, m as KeypairSigner, L as LABEL_PATTERNS, n as LOFI_TYPE, M as MANIFEST_TYPE, o as MAX_DELIVER_HORIZON_MS, p as MAX_JOB_USDC, q as MAX_REVIEW_WINDOW_MS, r as MIST_PER_SUI, N as NAVX_TYPE, bd as OPERATION_ASSETS, O as OVERLAY_FEE_RATE, be as Operation, P as PREFLIGHT_MAX_AMOUNT, t as PREFLIGHT_OK, w as PreflightResult, bf as SENDABLE_ASSETS, S as STABLE_ASSETS, x as SUI_DECIMALS, y as SUI_TYPE, z as SUPPORTED_ASSETS, bg as SelectAndSplitResult, bh as SerializedCetusRoute, bi as SerializedCetusRoutePath, bj as SerializedRouterDataV3, H as ServiceListing, Q as SimulationResult, R as StableAsset, T as SuiHolding, U as SuiRpcTxBlock, Y as T2000ErrorCode, Z as T2000ErrorData, _ as T2000_OVERLAY_FEE_WALLET, $ as TOKEN_MAP, a0 as TransactionLeg, a3 as TxDirection, a4 as USDC_DECIMALS, a5 as USDC_TYPE, a6 as USDE_TYPE, a7 as USDSUI_TYPE, a8 as USDT_TYPE, a9 as WAL_TYPE, aa as WBTC_TYPE, ac as ZkLoginSigner, bk as addSendToTx, bl as addSwapToTx, bm as assertAllowedAsset, bn as assertBuyerRequirements, ad as buildCreateJobTx, bo as buildDeclineJobTx, ae as buildDeliverJobTx, af as buildRefundJobTx, ag as buildRejectJobTx, ah as buildReleaseJobTx, ai as buildSendTx, aj as buildSwapTx, ak as checkPositiveAmount, al as checkSuiAddress, am as classifyAction, an as classifyLabel, ao as classifyTransaction, bp as deserializeCetusRoute, ap as executeTx, aq as extractAllUserLegs, ar as extractTransferDetails, as as extractTxCommands, at as extractTxSender, au as fallbackLabel, bq as fetchAllCoins, av as fetchService, aw as findSwapRoute, ax as formatAssetAmount, ay as formatSui, az as formatUsd, br as getCoinMeta, aA as getDecimals, aB as getDecimalsForCoinType, aC as getJob, aD as getJobSpec, bs as getSuiClient, bt as getSuiGrpcClient, bu as isAllowedAsset, bv as isCetusRouteFresh, bw as isInRegistry, aE as jobActionsFor, aF as listServices, aG as mapMoveAbortCode, aH as mapWalletError, aI as mistToSui, bx as normalizeAsset, by as normalizeCoinType, aJ as parseMppSuiChallenge, aK as parseSuiRpcTx, aL as payWithMpp, aM as preflightCreateJob, aN as preflightFail, aO as preflightPay, aP as preflightSend, aQ as preflightSwap, aR as putJobSpec, bz as queryHistory, bA as queryTransaction, aS as rawToStable, aT as rawToUsdc, aU as refineLendingLabel, aV as resolveSymbol, aW as resolveTokenType, bB as selectAndSplitCoin, bC as selectSuiCoin, bD as serializeCetusRoute, bE as simulateTransaction, aX as stableToRaw, aY as suiToMist, bF as throwIfSimulationFailed, aZ as truncateAddress, a_ as usdcToRaw, a$ as validateAddress, bG as verifyCetusRouteCoinMatch, b0 as verifyJobForSeller } from './commerce-BkSSPS1w.js';
|
|
6
6
|
import { Transaction, TransactionObjectArgument } from '@mysten/sui/transactions';
|
|
7
7
|
import { SuinsClient } from '@mysten/suins';
|
|
8
8
|
import '@mysten/sui/client';
|
|
@@ -565,8 +565,10 @@ declare function getAddress(keypair: Ed25519Keypair): string;
|
|
|
565
565
|
* target the LATEST published id — the original id (types, Job verbs) is
|
|
566
566
|
* unchanged.
|
|
567
567
|
*/
|
|
568
|
-
/** The
|
|
569
|
-
* adds the `opening` module).
|
|
568
|
+
/** The LATEST published `a2a_escrow` package id (v3 upgrade 2026-07-28 —
|
|
569
|
+
* adds `escrow::decline`; v2 added the `opening` module). New-verb calls
|
|
570
|
+
* (opening + decline) target this; original-id verbs stay put, and older
|
|
571
|
+
* package ids remain callable for published clients. */
|
|
570
572
|
declare const A2A_ESCROW_OPENING_PACKAGE_ID: string;
|
|
571
573
|
/** v1 claim policy: any ACTIVE registered Agent ID. */
|
|
572
574
|
declare const OPENING_CLAIM_POLICY_ANY_ACTIVE = 0;
|
package/dist/index.js
CHANGED
|
@@ -3193,14 +3193,153 @@ init_errors();
|
|
|
3193
3193
|
init_token_registry();
|
|
3194
3194
|
init_preflight();
|
|
3195
3195
|
init_coinSelection();
|
|
3196
|
+
|
|
3197
|
+
// src/wallet/opening.ts
|
|
3198
|
+
init_errors();
|
|
3199
|
+
init_token_registry();
|
|
3200
|
+
init_coinSelection();
|
|
3201
|
+
var A2A_ESCROW_OPENING_PACKAGE_ID = process.env.A2A_ESCROW_OPENING_PACKAGE_ID ?? "0x69ad93c555519de520a5c7f7f2963ad6f8b91cefc098fc2eed75942dcb5bcbe7";
|
|
3202
|
+
var CLOCK_ID2 = "0x6";
|
|
3203
|
+
var MODULE = "opening";
|
|
3204
|
+
var SHA256_HEX_RE = /^(0x)?[0-9a-fA-F]{64}$/;
|
|
3205
|
+
var OPENING_CLAIM_POLICY_ANY_ACTIVE = 0;
|
|
3206
|
+
var MAX_OPEN_WINDOW_MS = 2592e6;
|
|
3207
|
+
function feeConfigArg(tx) {
|
|
3208
|
+
return tx.sharedObjectRef({
|
|
3209
|
+
objectId: A2A_ESCROW_FEE_CONFIG_ID,
|
|
3210
|
+
initialSharedVersion: A2A_ESCROW_FEE_CONFIG_VERSION,
|
|
3211
|
+
mutable: false
|
|
3212
|
+
});
|
|
3213
|
+
}
|
|
3214
|
+
function hexToBytes2(hex) {
|
|
3215
|
+
const clean = hex.replace(/^0x/, "");
|
|
3216
|
+
const bytes = [];
|
|
3217
|
+
for (let i = 0; i < clean.length; i += 2) {
|
|
3218
|
+
bytes.push(Number.parseInt(clean.slice(i, i + 2), 16));
|
|
3219
|
+
}
|
|
3220
|
+
return bytes;
|
|
3221
|
+
}
|
|
3222
|
+
function preflightCreateOpening(terms) {
|
|
3223
|
+
if (!Number.isFinite(terms.amountUsdc) || terms.amountUsdc <= 0) {
|
|
3224
|
+
return { valid: false, code: "INVALID_AMOUNT", error: "Budget must be positive." };
|
|
3225
|
+
}
|
|
3226
|
+
if (terms.amountUsdc > MAX_JOB_USDC) {
|
|
3227
|
+
return {
|
|
3228
|
+
valid: false,
|
|
3229
|
+
code: "INVALID_AMOUNT",
|
|
3230
|
+
error: `Open jobs cap at ${MAX_JOB_USDC} USDC (v1).`
|
|
3231
|
+
};
|
|
3232
|
+
}
|
|
3233
|
+
if (!SHA256_HEX_RE.test(terms.specHash)) {
|
|
3234
|
+
return { valid: false, code: "INVALID_INPUT", error: "specHash must be a sha256 hex string." };
|
|
3235
|
+
}
|
|
3236
|
+
const now = Date.now();
|
|
3237
|
+
if (terms.openUntilMs <= now) {
|
|
3238
|
+
return { valid: false, code: "INVALID_INPUT", error: "openUntil must be in the future." };
|
|
3239
|
+
}
|
|
3240
|
+
if (terms.openUntilMs > now + MAX_OPEN_WINDOW_MS) {
|
|
3241
|
+
return { valid: false, code: "INVALID_INPUT", error: "Openings can stay claimable at most 30 days." };
|
|
3242
|
+
}
|
|
3243
|
+
if (terms.slaMs <= 0) {
|
|
3244
|
+
return { valid: false, code: "INVALID_INPUT", error: "Delivery window must be positive." };
|
|
3245
|
+
}
|
|
3246
|
+
return { valid: true };
|
|
3247
|
+
}
|
|
3248
|
+
async function buildCreateOpeningTx({
|
|
3249
|
+
client,
|
|
3250
|
+
buyer,
|
|
3251
|
+
terms
|
|
3252
|
+
}) {
|
|
3253
|
+
const pf = preflightCreateOpening(terms);
|
|
3254
|
+
if (!pf.valid) throw new T2000Error(pf.code ?? "INVALID_INPUT", pf.error ?? "Invalid opening.");
|
|
3255
|
+
const rawAmount = BigInt(Math.floor(terms.amountUsdc * 10 ** USDC_DECIMALS));
|
|
3256
|
+
const tx = new Transaction();
|
|
3257
|
+
const { coin } = await selectAndSplitCoin(tx, client, validateAddress(buyer), USDC_TYPE, rawAmount, {
|
|
3258
|
+
allowSwapAll: false
|
|
3259
|
+
});
|
|
3260
|
+
tx.moveCall({
|
|
3261
|
+
target: `${A2A_ESCROW_OPENING_PACKAGE_ID}::${MODULE}::create_open`,
|
|
3262
|
+
typeArguments: [USDC_TYPE],
|
|
3263
|
+
arguments: [
|
|
3264
|
+
coin,
|
|
3265
|
+
tx.pure.vector("u8", hexToBytes2(terms.specHash)),
|
|
3266
|
+
tx.pure.u64(terms.openUntilMs),
|
|
3267
|
+
tx.pure.u64(terms.slaMs),
|
|
3268
|
+
tx.pure.u64(terms.reviewWindowMs),
|
|
3269
|
+
tx.pure.u64(terms.rejectSplitBps),
|
|
3270
|
+
tx.pure.u8(OPENING_CLAIM_POLICY_ANY_ACTIVE),
|
|
3271
|
+
feeConfigArg(tx),
|
|
3272
|
+
tx.object(CLOCK_ID2)
|
|
3273
|
+
]
|
|
3274
|
+
});
|
|
3275
|
+
return tx;
|
|
3276
|
+
}
|
|
3277
|
+
function buildClaimOpeningTx({
|
|
3278
|
+
openingId,
|
|
3279
|
+
registryId
|
|
3280
|
+
}) {
|
|
3281
|
+
const tx = new Transaction();
|
|
3282
|
+
tx.moveCall({
|
|
3283
|
+
target: `${A2A_ESCROW_OPENING_PACKAGE_ID}::${MODULE}::claim`,
|
|
3284
|
+
typeArguments: [USDC_TYPE],
|
|
3285
|
+
arguments: [
|
|
3286
|
+
tx.object(openingId),
|
|
3287
|
+
tx.object(registryId),
|
|
3288
|
+
feeConfigArg(tx),
|
|
3289
|
+
tx.object(CLOCK_ID2)
|
|
3290
|
+
]
|
|
3291
|
+
});
|
|
3292
|
+
return tx;
|
|
3293
|
+
}
|
|
3294
|
+
function openingCall(openingId, fn) {
|
|
3295
|
+
const tx = new Transaction();
|
|
3296
|
+
tx.moveCall({
|
|
3297
|
+
target: `${A2A_ESCROW_OPENING_PACKAGE_ID}::${MODULE}::${fn}`,
|
|
3298
|
+
typeArguments: [USDC_TYPE],
|
|
3299
|
+
arguments: [tx.object(openingId), feeConfigArg(tx), tx.object(CLOCK_ID2)]
|
|
3300
|
+
});
|
|
3301
|
+
return tx;
|
|
3302
|
+
}
|
|
3303
|
+
function buildCancelOpeningTx(openingId) {
|
|
3304
|
+
return openingCall(openingId, "cancel_open");
|
|
3305
|
+
}
|
|
3306
|
+
function buildRefundUnclaimedTx(openingId) {
|
|
3307
|
+
return openingCall(openingId, "refund_unclaimed");
|
|
3308
|
+
}
|
|
3309
|
+
function bytesToHex2(bytes) {
|
|
3310
|
+
return `0x${Array.from(bytes).map((b) => b.toString(16).padStart(2, "0")).join("")}`;
|
|
3311
|
+
}
|
|
3312
|
+
async function getOpening(client, openingId) {
|
|
3313
|
+
const resp = await client.core.getObject({ objectId: openingId, include: { json: true } }).catch(() => null);
|
|
3314
|
+
const objType = resp?.object?.type ?? "";
|
|
3315
|
+
const json = resp?.object?.json;
|
|
3316
|
+
if (!json || !objType.includes(`::${MODULE}::Opening<`)) {
|
|
3317
|
+
return null;
|
|
3318
|
+
}
|
|
3319
|
+
return {
|
|
3320
|
+
id: openingId,
|
|
3321
|
+
buyer: String(json.buyer),
|
|
3322
|
+
amountUsdc: Number(json.amount) / 10 ** USDC_DECIMALS,
|
|
3323
|
+
feeBps: Number(json.fee_bps ?? 0),
|
|
3324
|
+
specHash: bytesToHex2(json.spec_hash ?? []),
|
|
3325
|
+
openUntilMs: Number(json.open_until_ms),
|
|
3326
|
+
slaMs: Number(json.sla_ms),
|
|
3327
|
+
reviewWindowMs: Number(json.review_window_ms),
|
|
3328
|
+
rejectSplitBps: Number(json.reject_split_bps),
|
|
3329
|
+
claimPolicy: Number(json.claim_policy ?? 0),
|
|
3330
|
+
createdAtMs: Number(json.created_at_ms ?? 0)
|
|
3331
|
+
};
|
|
3332
|
+
}
|
|
3333
|
+
|
|
3334
|
+
// src/wallet/job.ts
|
|
3196
3335
|
var A2A_ESCROW_PACKAGE_ID = process.env.A2A_ESCROW_PACKAGE_ID ?? "0x358a819c1c016e2cc84ef5fbea81cba90c31f7f8a62bf45cb5e5276acf198bdd";
|
|
3197
3336
|
var A2A_ESCROW_FEE_CONFIG_ID = process.env.A2A_ESCROW_FEE_CONFIG_ID ?? "0xddaa25570950b7484dbf20797ebcf75707be9c87cd67bef2a06ed2e81d2c494b";
|
|
3198
3337
|
var A2A_ESCROW_FEE_CONFIG_VERSION = Number(
|
|
3199
3338
|
process.env.A2A_ESCROW_FEE_CONFIG_VERSION ?? 931861903
|
|
3200
3339
|
);
|
|
3201
|
-
var
|
|
3202
|
-
var
|
|
3203
|
-
function
|
|
3340
|
+
var CLOCK_ID3 = "0x6";
|
|
3341
|
+
var MODULE2 = "escrow";
|
|
3342
|
+
function feeConfigArg2(tx) {
|
|
3204
3343
|
return tx.sharedObjectRef({
|
|
3205
3344
|
objectId: A2A_ESCROW_FEE_CONFIG_ID,
|
|
3206
3345
|
initialSharedVersion: A2A_ESCROW_FEE_CONFIG_VERSION,
|
|
@@ -3217,7 +3356,7 @@ var JOB_STATES = [
|
|
|
3217
3356
|
"refunded",
|
|
3218
3357
|
"rejected"
|
|
3219
3358
|
];
|
|
3220
|
-
function
|
|
3359
|
+
function hexToBytes3(hex) {
|
|
3221
3360
|
const clean = hex.startsWith("0x") ? hex.slice(2) : hex;
|
|
3222
3361
|
if (clean.length === 0 || clean.length % 2 !== 0 || /[^0-9a-fA-F]/.test(clean)) {
|
|
3223
3362
|
throw new T2000Error(
|
|
@@ -3231,7 +3370,7 @@ function hexToBytes2(hex) {
|
|
|
3231
3370
|
}
|
|
3232
3371
|
return out;
|
|
3233
3372
|
}
|
|
3234
|
-
function
|
|
3373
|
+
function bytesToHex3(bytes) {
|
|
3235
3374
|
const arr = typeof bytes === "string" ? Array.from(atob(bytes), (c) => c.charCodeAt(0)) : bytes;
|
|
3236
3375
|
let s = "0x";
|
|
3237
3376
|
for (const b of arr) s += b.toString(16).padStart(2, "0");
|
|
@@ -3262,7 +3401,7 @@ function preflightCreateJob(terms) {
|
|
|
3262
3401
|
return preflightFail("INVALID_AMOUNT", "rejectSplitBps must be an integer 0\u201310000.");
|
|
3263
3402
|
}
|
|
3264
3403
|
try {
|
|
3265
|
-
|
|
3404
|
+
hexToBytes3(terms.specHash);
|
|
3266
3405
|
} catch (e) {
|
|
3267
3406
|
return preflightFail("INVALID_AMOUNT", e.message);
|
|
3268
3407
|
}
|
|
@@ -3285,40 +3424,49 @@ async function buildCreateJobTx({
|
|
|
3285
3424
|
allowSwapAll: false
|
|
3286
3425
|
});
|
|
3287
3426
|
tx.moveCall({
|
|
3288
|
-
target: `${A2A_ESCROW_PACKAGE_ID}::${
|
|
3427
|
+
target: `${A2A_ESCROW_PACKAGE_ID}::${MODULE2}::create`,
|
|
3289
3428
|
typeArguments: [USDC_TYPE],
|
|
3290
3429
|
arguments: [
|
|
3291
3430
|
tx.pure.address(seller),
|
|
3292
3431
|
coin,
|
|
3293
|
-
tx.pure.vector("u8",
|
|
3432
|
+
tx.pure.vector("u8", hexToBytes3(terms.specHash)),
|
|
3294
3433
|
tx.pure.u64(terms.deliverByMs),
|
|
3295
3434
|
tx.pure.u64(terms.reviewWindowMs),
|
|
3296
3435
|
tx.pure.u64(terms.rejectSplitBps),
|
|
3297
|
-
|
|
3298
|
-
tx.object(
|
|
3436
|
+
feeConfigArg2(tx),
|
|
3437
|
+
tx.object(CLOCK_ID3)
|
|
3299
3438
|
]
|
|
3300
3439
|
});
|
|
3301
3440
|
return tx;
|
|
3302
3441
|
}
|
|
3442
|
+
function buildDeclineJobTx(jobId) {
|
|
3443
|
+
const tx = new Transaction();
|
|
3444
|
+
tx.moveCall({
|
|
3445
|
+
target: `${A2A_ESCROW_OPENING_PACKAGE_ID}::${MODULE2}::decline`,
|
|
3446
|
+
typeArguments: [USDC_TYPE],
|
|
3447
|
+
arguments: [tx.object(jobId), feeConfigArg2(tx), tx.object(CLOCK_ID3)]
|
|
3448
|
+
});
|
|
3449
|
+
return tx;
|
|
3450
|
+
}
|
|
3303
3451
|
function jobCall(jobId, fn) {
|
|
3304
3452
|
const tx = new Transaction();
|
|
3305
3453
|
tx.moveCall({
|
|
3306
|
-
target: `${A2A_ESCROW_PACKAGE_ID}::${
|
|
3454
|
+
target: `${A2A_ESCROW_PACKAGE_ID}::${MODULE2}::${fn}`,
|
|
3307
3455
|
typeArguments: [USDC_TYPE],
|
|
3308
|
-
arguments: [tx.object(jobId),
|
|
3456
|
+
arguments: [tx.object(jobId), feeConfigArg2(tx), tx.object(CLOCK_ID3)]
|
|
3309
3457
|
});
|
|
3310
3458
|
return tx;
|
|
3311
3459
|
}
|
|
3312
3460
|
function buildDeliverJobTx(jobId, deliveryHash) {
|
|
3313
3461
|
const tx = new Transaction();
|
|
3314
3462
|
tx.moveCall({
|
|
3315
|
-
target: `${A2A_ESCROW_PACKAGE_ID}::${
|
|
3463
|
+
target: `${A2A_ESCROW_PACKAGE_ID}::${MODULE2}::deliver`,
|
|
3316
3464
|
typeArguments: [USDC_TYPE],
|
|
3317
3465
|
arguments: [
|
|
3318
3466
|
tx.object(jobId),
|
|
3319
|
-
tx.pure.vector("u8",
|
|
3320
|
-
|
|
3321
|
-
tx.object(
|
|
3467
|
+
tx.pure.vector("u8", hexToBytes3(deliveryHash)),
|
|
3468
|
+
feeConfigArg2(tx),
|
|
3469
|
+
tx.object(CLOCK_ID3)
|
|
3322
3470
|
]
|
|
3323
3471
|
});
|
|
3324
3472
|
return tx;
|
|
@@ -3341,7 +3489,7 @@ async function getJob(client, jobId) {
|
|
|
3341
3489
|
});
|
|
3342
3490
|
const objType = resp.object?.type ?? "";
|
|
3343
3491
|
const json = resp.object?.json;
|
|
3344
|
-
if (!json || !objType.includes(`::${
|
|
3492
|
+
if (!json || !objType.includes(`::${MODULE2}::Job<`)) {
|
|
3345
3493
|
throw new T2000Error("RPC_ERROR", `Object ${jobId} is not an a2a_escrow Job.`);
|
|
3346
3494
|
}
|
|
3347
3495
|
const stateNum = Number(json.state ?? -1);
|
|
@@ -3359,12 +3507,12 @@ async function getJob(client, jobId) {
|
|
|
3359
3507
|
amountUsdc: Number(json.amount) / 10 ** USDC_DECIMALS,
|
|
3360
3508
|
escrowUsdc: Number(json.escrow) / 10 ** USDC_DECIMALS,
|
|
3361
3509
|
feeBps: Number(json.fee_bps ?? 0),
|
|
3362
|
-
specHash:
|
|
3510
|
+
specHash: bytesToHex3(json.spec_hash ?? []),
|
|
3363
3511
|
deliverByMs: Number(json.deliver_by_ms),
|
|
3364
3512
|
reviewWindowMs: Number(json.review_window_ms),
|
|
3365
3513
|
rejectSplitBps: Number(json.reject_split_bps),
|
|
3366
3514
|
state,
|
|
3367
|
-
deliveryHash: hasDelivery ?
|
|
3515
|
+
deliveryHash: hasDelivery ? bytesToHex3(deliveryBytes) : null,
|
|
3368
3516
|
deliveredAtMs: hasDelivery ? deliveredAtMs : null,
|
|
3369
3517
|
createdAtMs: Number(json.created_at_ms)
|
|
3370
3518
|
};
|
|
@@ -3409,143 +3557,6 @@ async function verifyJobForSeller({
|
|
|
3409
3557
|
return { ok: problems.length === 0, job, problems };
|
|
3410
3558
|
}
|
|
3411
3559
|
|
|
3412
|
-
// src/wallet/opening.ts
|
|
3413
|
-
init_errors();
|
|
3414
|
-
init_token_registry();
|
|
3415
|
-
init_coinSelection();
|
|
3416
|
-
var A2A_ESCROW_OPENING_PACKAGE_ID = process.env.A2A_ESCROW_OPENING_PACKAGE_ID ?? "0x860288d789dc617f6474a0a6801d6011e53bf30d5fb801cdad47b9bc6adb098b";
|
|
3417
|
-
var CLOCK_ID3 = "0x6";
|
|
3418
|
-
var MODULE2 = "opening";
|
|
3419
|
-
var SHA256_HEX_RE = /^(0x)?[0-9a-fA-F]{64}$/;
|
|
3420
|
-
var OPENING_CLAIM_POLICY_ANY_ACTIVE = 0;
|
|
3421
|
-
var MAX_OPEN_WINDOW_MS = 2592e6;
|
|
3422
|
-
function feeConfigArg2(tx) {
|
|
3423
|
-
return tx.sharedObjectRef({
|
|
3424
|
-
objectId: A2A_ESCROW_FEE_CONFIG_ID,
|
|
3425
|
-
initialSharedVersion: A2A_ESCROW_FEE_CONFIG_VERSION,
|
|
3426
|
-
mutable: false
|
|
3427
|
-
});
|
|
3428
|
-
}
|
|
3429
|
-
function hexToBytes3(hex) {
|
|
3430
|
-
const clean = hex.replace(/^0x/, "");
|
|
3431
|
-
const bytes = [];
|
|
3432
|
-
for (let i = 0; i < clean.length; i += 2) {
|
|
3433
|
-
bytes.push(Number.parseInt(clean.slice(i, i + 2), 16));
|
|
3434
|
-
}
|
|
3435
|
-
return bytes;
|
|
3436
|
-
}
|
|
3437
|
-
function preflightCreateOpening(terms) {
|
|
3438
|
-
if (!Number.isFinite(terms.amountUsdc) || terms.amountUsdc <= 0) {
|
|
3439
|
-
return { valid: false, code: "INVALID_AMOUNT", error: "Budget must be positive." };
|
|
3440
|
-
}
|
|
3441
|
-
if (terms.amountUsdc > MAX_JOB_USDC) {
|
|
3442
|
-
return {
|
|
3443
|
-
valid: false,
|
|
3444
|
-
code: "INVALID_AMOUNT",
|
|
3445
|
-
error: `Open jobs cap at ${MAX_JOB_USDC} USDC (v1).`
|
|
3446
|
-
};
|
|
3447
|
-
}
|
|
3448
|
-
if (!SHA256_HEX_RE.test(terms.specHash)) {
|
|
3449
|
-
return { valid: false, code: "INVALID_INPUT", error: "specHash must be a sha256 hex string." };
|
|
3450
|
-
}
|
|
3451
|
-
const now = Date.now();
|
|
3452
|
-
if (terms.openUntilMs <= now) {
|
|
3453
|
-
return { valid: false, code: "INVALID_INPUT", error: "openUntil must be in the future." };
|
|
3454
|
-
}
|
|
3455
|
-
if (terms.openUntilMs > now + MAX_OPEN_WINDOW_MS) {
|
|
3456
|
-
return { valid: false, code: "INVALID_INPUT", error: "Openings can stay claimable at most 30 days." };
|
|
3457
|
-
}
|
|
3458
|
-
if (terms.slaMs <= 0) {
|
|
3459
|
-
return { valid: false, code: "INVALID_INPUT", error: "Delivery window must be positive." };
|
|
3460
|
-
}
|
|
3461
|
-
return { valid: true };
|
|
3462
|
-
}
|
|
3463
|
-
async function buildCreateOpeningTx({
|
|
3464
|
-
client,
|
|
3465
|
-
buyer,
|
|
3466
|
-
terms
|
|
3467
|
-
}) {
|
|
3468
|
-
const pf = preflightCreateOpening(terms);
|
|
3469
|
-
if (!pf.valid) throw new T2000Error(pf.code ?? "INVALID_INPUT", pf.error ?? "Invalid opening.");
|
|
3470
|
-
const rawAmount = BigInt(Math.floor(terms.amountUsdc * 10 ** USDC_DECIMALS));
|
|
3471
|
-
const tx = new Transaction();
|
|
3472
|
-
const { coin } = await selectAndSplitCoin(tx, client, validateAddress(buyer), USDC_TYPE, rawAmount, {
|
|
3473
|
-
allowSwapAll: false
|
|
3474
|
-
});
|
|
3475
|
-
tx.moveCall({
|
|
3476
|
-
target: `${A2A_ESCROW_OPENING_PACKAGE_ID}::${MODULE2}::create_open`,
|
|
3477
|
-
typeArguments: [USDC_TYPE],
|
|
3478
|
-
arguments: [
|
|
3479
|
-
coin,
|
|
3480
|
-
tx.pure.vector("u8", hexToBytes3(terms.specHash)),
|
|
3481
|
-
tx.pure.u64(terms.openUntilMs),
|
|
3482
|
-
tx.pure.u64(terms.slaMs),
|
|
3483
|
-
tx.pure.u64(terms.reviewWindowMs),
|
|
3484
|
-
tx.pure.u64(terms.rejectSplitBps),
|
|
3485
|
-
tx.pure.u8(OPENING_CLAIM_POLICY_ANY_ACTIVE),
|
|
3486
|
-
feeConfigArg2(tx),
|
|
3487
|
-
tx.object(CLOCK_ID3)
|
|
3488
|
-
]
|
|
3489
|
-
});
|
|
3490
|
-
return tx;
|
|
3491
|
-
}
|
|
3492
|
-
function buildClaimOpeningTx({
|
|
3493
|
-
openingId,
|
|
3494
|
-
registryId
|
|
3495
|
-
}) {
|
|
3496
|
-
const tx = new Transaction();
|
|
3497
|
-
tx.moveCall({
|
|
3498
|
-
target: `${A2A_ESCROW_OPENING_PACKAGE_ID}::${MODULE2}::claim`,
|
|
3499
|
-
typeArguments: [USDC_TYPE],
|
|
3500
|
-
arguments: [
|
|
3501
|
-
tx.object(openingId),
|
|
3502
|
-
tx.object(registryId),
|
|
3503
|
-
feeConfigArg2(tx),
|
|
3504
|
-
tx.object(CLOCK_ID3)
|
|
3505
|
-
]
|
|
3506
|
-
});
|
|
3507
|
-
return tx;
|
|
3508
|
-
}
|
|
3509
|
-
function openingCall(openingId, fn) {
|
|
3510
|
-
const tx = new Transaction();
|
|
3511
|
-
tx.moveCall({
|
|
3512
|
-
target: `${A2A_ESCROW_OPENING_PACKAGE_ID}::${MODULE2}::${fn}`,
|
|
3513
|
-
typeArguments: [USDC_TYPE],
|
|
3514
|
-
arguments: [tx.object(openingId), feeConfigArg2(tx), tx.object(CLOCK_ID3)]
|
|
3515
|
-
});
|
|
3516
|
-
return tx;
|
|
3517
|
-
}
|
|
3518
|
-
function buildCancelOpeningTx(openingId) {
|
|
3519
|
-
return openingCall(openingId, "cancel_open");
|
|
3520
|
-
}
|
|
3521
|
-
function buildRefundUnclaimedTx(openingId) {
|
|
3522
|
-
return openingCall(openingId, "refund_unclaimed");
|
|
3523
|
-
}
|
|
3524
|
-
function bytesToHex3(bytes) {
|
|
3525
|
-
return `0x${Array.from(bytes).map((b) => b.toString(16).padStart(2, "0")).join("")}`;
|
|
3526
|
-
}
|
|
3527
|
-
async function getOpening(client, openingId) {
|
|
3528
|
-
const resp = await client.core.getObject({ objectId: openingId, include: { json: true } }).catch(() => null);
|
|
3529
|
-
const objType = resp?.object?.type ?? "";
|
|
3530
|
-
const json = resp?.object?.json;
|
|
3531
|
-
if (!json || !objType.includes(`::${MODULE2}::Opening<`)) {
|
|
3532
|
-
return null;
|
|
3533
|
-
}
|
|
3534
|
-
return {
|
|
3535
|
-
id: openingId,
|
|
3536
|
-
buyer: String(json.buyer),
|
|
3537
|
-
amountUsdc: Number(json.amount) / 10 ** USDC_DECIMALS,
|
|
3538
|
-
feeBps: Number(json.fee_bps ?? 0),
|
|
3539
|
-
specHash: bytesToHex3(json.spec_hash ?? []),
|
|
3540
|
-
openUntilMs: Number(json.open_until_ms),
|
|
3541
|
-
slaMs: Number(json.sla_ms),
|
|
3542
|
-
reviewWindowMs: Number(json.review_window_ms),
|
|
3543
|
-
rejectSplitBps: Number(json.reject_split_bps),
|
|
3544
|
-
claimPolicy: Number(json.claim_policy ?? 0),
|
|
3545
|
-
createdAtMs: Number(json.created_at_ms ?? 0)
|
|
3546
|
-
};
|
|
3547
|
-
}
|
|
3548
|
-
|
|
3549
3560
|
// src/commerce.ts
|
|
3550
3561
|
var DEFAULT_COMMERCE_API_BASE = "https://api.t2000.ai/v1";
|
|
3551
3562
|
async function commerceFetchJson(url, init) {
|
|
@@ -4552,6 +4563,6 @@ async function buildDirectPoolSwapTx(args) {
|
|
|
4552
4563
|
return tx;
|
|
4553
4564
|
}
|
|
4554
4565
|
|
|
4555
|
-
export { A2A_ESCROW_FEE_CONFIG_ID, A2A_ESCROW_OPENING_PACKAGE_ID, A2A_ESCROW_PACKAGE_ID, AGENT_CAPITAL_PACKAGE_ID, AGENT_CAPITAL_PUBLISHED_AT, AGENT_ID_PARENT, AGENT_ID_PARENT_NAME, AGENT_ID_PARENT_NFT_ID, AGENT_POOL_TICK_SPACING, AGENT_TOKEN_DECIMALS, AGENT_TOKEN_LP_ALLOCATION, AGENT_TOKEN_TOTAL_SUPPLY, AGENT_TOKEN_TREASURY_ALLOCATION, AUDRIC_PARENT, AUDRIC_PARENT_NAME, AUDRIC_PARENT_NFT_ID, CAPITAL_REGISTRY_ID, CAPITAL_REGISTRY_VERSION, CETUS_CLMM_PACKAGE_ID, CETUS_GLOBAL_CONFIG_ID, CETUS_INTEGRATE_PUBLISHED_AT, CETUS_POOLS_ID, CETUS_POSITION_TYPE, CETUS_USDC_SUI_POOL, CLOCK_ID, COIN_REGISTRY, DEFAULT_API_BASE, DEFAULT_COMMERCE_API_BASE, DEFAULT_GRPC_URL, DEFAULT_NETWORK, ETH_TYPE, GASLESS_MIN_STABLE_AMOUNT, GASLESS_STABLE_TYPES, GAS_RESERVE_MIN, IKA_TYPE, InvalidAddressError, JOB_STATES, KNOWN_TARGETS, KeypairSigner, LABEL_PATTERNS, LOFI_TYPE, LimitEnforcer, LimitExceededError, MANIFEST_TYPE, MAX_DELIVER_HORIZON_MS, MAX_JOB_USDC, MAX_OPEN_WINDOW_MS, MAX_REVIEW_WINDOW_MS, MIN_LP_USDC, MIST_PER_SUI, NAVX_TYPE, OPENING_CLAIM_POLICY_ANY_ACTIVE, OPERATION_ASSETS, OVERLAY_FEE_RATE, PREFLIGHT_MAX_AMOUNT, PREFLIGHT_OK, SENDABLE_ASSETS, SPONSORED_PYTH_DEPENDENT_PROVIDERS, STABLE_ASSETS, SUINS_NAME_REGEX, SUI_ADDRESS_REGEX, SUI_ADDRESS_STRICT_REGEX, SUI_DECIMALS, SUI_TYPE, SUPPORTED_ASSETS, SYMBOL_BLOCKLIST, SuinsNotRegisteredError, SuinsRpcError, T2000, T2000Error, T2000_OVERLAY_FEE_WALLET, TOKEN_MAP, USDC_DECIMALS, USDC_TYPE, USDE_TYPE, USDSUI_TYPE, USDT_TYPE, WAL_TYPE, WBTC_TYPE, WRITE_APPENDER_REGISTRY, ZkLoginSigner, addSendToTx, addSwapToTx, approxUsdValue, assertAllowedAsset, assertBuyerRequirements, assertLimitConfig, buildAddLeafTx, buildAgentCoinModule, buildCancelOpeningTx, buildClaimOpeningTx, buildCreateJobTx, buildCreateOpeningTx, buildDeliverJobTx, buildDirectPoolSwapTx, buildPublishAgentCoinTx, buildRefundJobTx, buildRefundUnclaimedTx, buildRejectJobTx, buildReleaseJobTx, buildRevokeLeafTx, buildSendTx, buildSwapTx, buildTokenizeTx, cancelOpenJob, chatCompletion, chatCompletionStream, checkPositiveAmount, checkSuiAddress, claimOpenJob, classifyAction, classifyLabel, classifyTransaction, clearLimits, composeTx, dailySpentToday, deriveAllowedAddressesFromPtb, deserializeCetusRoute, displayHandle, executeTx, exportPrivateKey, extractAllUserLegs, extractTransferDetails, extractTxCommands, extractTxSender, fallbackLabel, fetchAllCoins, fetchService, findSwapRoute, formatAssetAmount, formatSui, formatUsd, fullHandle, generateKeypair, getAddress, getCoinMeta, getDecimals, getDecimalsForCoinType, getJob, getJobSpec, getLimits, getOpenJob, getOpening, getSponsoredSwapProviders, getSuiClient, getSuiGrpcClient, getSwapQuote, hasLimits, isAllowedAsset, isCetusRouteFresh, isInRegistry, jobActionsFor, keypairFromPrivateKey, listModels, listOpenJobs, listServices, loadKey, looksLikeSuiNs, mapMoveAbortCode, mapWalletError, mistToSui, normalizeAddressInput, normalizeAsset, normalizeCoinType, parseMppSuiChallenge, parseSuiRpcTx, payWithMpp, postOpenJob, preflightCreateJob, preflightCreateOpening, preflightFail, preflightPay, preflightSend, preflightSwap, putJobSpec, queryBalance, queryHistory, queryTransaction, rawToStable, rawToUsdc, readLimitsFile, recordDailySpend, refineLendingLabel, refundOpenJob, resolveAddressToSuinsViaRpc, resolveSuinsViaRpc, resolveSymbol, resolveTokenType, saveBech32, saveKey, selectAndSplitCoin, selectSuiCoin, serializeCetusRoute, setLimits, simulateTransaction, stableToRaw, suiToMist, throwIfSimulationFailed, truncateAddress, usdcToRaw, validateAddress, validateAgentCoinParams, validateLabel, verifyCetusRouteCoinMatch, verifyJobForSeller, verifyReceipt, walletExists, writeLimitsFile };
|
|
4566
|
+
export { A2A_ESCROW_FEE_CONFIG_ID, A2A_ESCROW_OPENING_PACKAGE_ID, A2A_ESCROW_PACKAGE_ID, AGENT_CAPITAL_PACKAGE_ID, AGENT_CAPITAL_PUBLISHED_AT, AGENT_ID_PARENT, AGENT_ID_PARENT_NAME, AGENT_ID_PARENT_NFT_ID, AGENT_POOL_TICK_SPACING, AGENT_TOKEN_DECIMALS, AGENT_TOKEN_LP_ALLOCATION, AGENT_TOKEN_TOTAL_SUPPLY, AGENT_TOKEN_TREASURY_ALLOCATION, AUDRIC_PARENT, AUDRIC_PARENT_NAME, AUDRIC_PARENT_NFT_ID, CAPITAL_REGISTRY_ID, CAPITAL_REGISTRY_VERSION, CETUS_CLMM_PACKAGE_ID, CETUS_GLOBAL_CONFIG_ID, CETUS_INTEGRATE_PUBLISHED_AT, CETUS_POOLS_ID, CETUS_POSITION_TYPE, CETUS_USDC_SUI_POOL, CLOCK_ID, COIN_REGISTRY, DEFAULT_API_BASE, DEFAULT_COMMERCE_API_BASE, DEFAULT_GRPC_URL, DEFAULT_NETWORK, ETH_TYPE, GASLESS_MIN_STABLE_AMOUNT, GASLESS_STABLE_TYPES, GAS_RESERVE_MIN, IKA_TYPE, InvalidAddressError, JOB_STATES, KNOWN_TARGETS, KeypairSigner, LABEL_PATTERNS, LOFI_TYPE, LimitEnforcer, LimitExceededError, MANIFEST_TYPE, MAX_DELIVER_HORIZON_MS, MAX_JOB_USDC, MAX_OPEN_WINDOW_MS, MAX_REVIEW_WINDOW_MS, MIN_LP_USDC, MIST_PER_SUI, NAVX_TYPE, OPENING_CLAIM_POLICY_ANY_ACTIVE, OPERATION_ASSETS, OVERLAY_FEE_RATE, PREFLIGHT_MAX_AMOUNT, PREFLIGHT_OK, SENDABLE_ASSETS, SPONSORED_PYTH_DEPENDENT_PROVIDERS, STABLE_ASSETS, SUINS_NAME_REGEX, SUI_ADDRESS_REGEX, SUI_ADDRESS_STRICT_REGEX, SUI_DECIMALS, SUI_TYPE, SUPPORTED_ASSETS, SYMBOL_BLOCKLIST, SuinsNotRegisteredError, SuinsRpcError, T2000, T2000Error, T2000_OVERLAY_FEE_WALLET, TOKEN_MAP, USDC_DECIMALS, USDC_TYPE, USDE_TYPE, USDSUI_TYPE, USDT_TYPE, WAL_TYPE, WBTC_TYPE, WRITE_APPENDER_REGISTRY, ZkLoginSigner, addSendToTx, addSwapToTx, approxUsdValue, assertAllowedAsset, assertBuyerRequirements, assertLimitConfig, buildAddLeafTx, buildAgentCoinModule, buildCancelOpeningTx, buildClaimOpeningTx, buildCreateJobTx, buildCreateOpeningTx, buildDeclineJobTx, buildDeliverJobTx, buildDirectPoolSwapTx, buildPublishAgentCoinTx, buildRefundJobTx, buildRefundUnclaimedTx, buildRejectJobTx, buildReleaseJobTx, buildRevokeLeafTx, buildSendTx, buildSwapTx, buildTokenizeTx, cancelOpenJob, chatCompletion, chatCompletionStream, checkPositiveAmount, checkSuiAddress, claimOpenJob, classifyAction, classifyLabel, classifyTransaction, clearLimits, composeTx, dailySpentToday, deriveAllowedAddressesFromPtb, deserializeCetusRoute, displayHandle, executeTx, exportPrivateKey, extractAllUserLegs, extractTransferDetails, extractTxCommands, extractTxSender, fallbackLabel, fetchAllCoins, fetchService, findSwapRoute, formatAssetAmount, formatSui, formatUsd, fullHandle, generateKeypair, getAddress, getCoinMeta, getDecimals, getDecimalsForCoinType, getJob, getJobSpec, getLimits, getOpenJob, getOpening, getSponsoredSwapProviders, getSuiClient, getSuiGrpcClient, getSwapQuote, hasLimits, isAllowedAsset, isCetusRouteFresh, isInRegistry, jobActionsFor, keypairFromPrivateKey, listModels, listOpenJobs, listServices, loadKey, looksLikeSuiNs, mapMoveAbortCode, mapWalletError, mistToSui, normalizeAddressInput, normalizeAsset, normalizeCoinType, parseMppSuiChallenge, parseSuiRpcTx, payWithMpp, postOpenJob, preflightCreateJob, preflightCreateOpening, preflightFail, preflightPay, preflightSend, preflightSwap, putJobSpec, queryBalance, queryHistory, queryTransaction, rawToStable, rawToUsdc, readLimitsFile, recordDailySpend, refineLendingLabel, refundOpenJob, resolveAddressToSuinsViaRpc, resolveSuinsViaRpc, resolveSymbol, resolveTokenType, saveBech32, saveKey, selectAndSplitCoin, selectSuiCoin, serializeCetusRoute, setLimits, simulateTransaction, stableToRaw, suiToMist, throwIfSimulationFailed, truncateAddress, usdcToRaw, validateAddress, validateAgentCoinParams, validateLabel, verifyCetusRouteCoinMatch, verifyJobForSeller, verifyReceipt, walletExists, writeLimitsFile };
|
|
4556
4567
|
//# sourceMappingURL=index.js.map
|
|
4557
4568
|
//# sourceMappingURL=index.js.map
|