@t2000/sdk 10.26.0 → 10.27.1
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 +4 -2
- 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 +4 -2
- package/dist/browser.js.map +1 -1
- package/dist/{commerce-DOKu1FYI.d.cts → commerce-DR_F-Eg6.d.cts} +12 -2
- package/dist/{commerce-DOKu1FYI.d.ts → commerce-DR_F-Eg6.d.ts} +12 -2
- package/dist/index.cjs +13 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +24 -3
- package/dist/index.d.ts +24 -3
- package/dist/index.js +11 -3
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
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 { Z as T2000Error, b4 as T2000Options, a4 as TransactionSigner, w as PayOptions, b5 as X402Probe, x as PayResult, b6 as SerializedCetusRoute, b7 as SwapResult, b8 as SwapQuoteResult, X as SupportedAsset, Q as SendResult, B as BalanceResponse, a3 as TransactionRecord, i as DepositInfo, b9 as PaymentRequest, ae as ZkLoginProof, ba as SuiCoreClient, u as OverlayFeeConfig, bb as SponsoredCoinMergeCache, Y as SwapRouteResult, bc as SendableAsset } from './commerce-
|
|
5
|
-
export { A as A2A_ESCROW_FEE_CONFIG_ID, a as A2A_ESCROW_PACKAGE_ID, b as ActivityReportConfig, bd as CETUS_USDC_SUI_POOL, C as CLOCK_ID, c as COIN_REGISTRY, d as ClassifyBalanceChange, e as ClassifyResult, f as CoinMeta, be as CoinPage, D as DEFAULT_ACTIVITY_REPORT_URL, g as DEFAULT_COMMERCE_API_BASE, bf as DEFAULT_GRPC_URL, h as DEFAULT_NETWORK, E as ETH_TYPE, j as ExtractedTransfer, bg as GASLESS_MIN_STABLE_AMOUNT, bh as GASLESS_STABLE_TYPES, G as GAS_RESERVE_MIN, I as IKA_TYPE, J as JOB_STATES, k as Job, l as JobState, m as JobTerms, n as JobVerification, K as KNOWN_TARGETS, o as KeypairSigner, L as LABEL_PATTERNS, p as LOFI_TYPE, M as MANIFEST_TYPE, q as MAX_DELIVER_HORIZON_MS, r as MAX_JOB_USDC, s as MAX_REVIEW_WINDOW_MS, t as MIST_PER_SUI, N as NAVX_TYPE,
|
|
4
|
+
import { Z as T2000Error, b4 as T2000Options, a4 as TransactionSigner, w as PayOptions, b5 as X402Probe, x as PayResult, b6 as SerializedCetusRoute, b7 as SwapResult, b8 as SwapQuoteResult, X as SupportedAsset, Q as SendResult, B as BalanceResponse, a3 as TransactionRecord, i as DepositInfo, b9 as PaymentRequest, ae as ZkLoginProof, ba as SuiCoreClient, u as OverlayFeeConfig, bb as SponsoredCoinMergeCache, Y as SwapRouteResult, bc as SendableAsset } from './commerce-DR_F-Eg6.cjs';
|
|
5
|
+
export { A as A2A_ESCROW_FEE_CONFIG_ID, a as A2A_ESCROW_PACKAGE_ID, b as ActivityReportConfig, bd as CETUS_USDC_SUI_POOL, C as CLOCK_ID, c as COIN_REGISTRY, d as ClassifyBalanceChange, e as ClassifyResult, f as CoinMeta, be as CoinPage, D as DEFAULT_ACTIVITY_REPORT_URL, g as DEFAULT_COMMERCE_API_BASE, bf as DEFAULT_GRPC_URL, h as DEFAULT_NETWORK, E as ETH_TYPE, j as ExtractedTransfer, bg as GASLESS_MIN_STABLE_AMOUNT, bh as GASLESS_STABLE_TYPES, G as GAS_RESERVE_MIN, I as IKA_TYPE, J as JOB_STATES, k as Job, l as JobState, m as JobTerms, n as JobVerification, K as KNOWN_TARGETS, o as KeypairSigner, L as LABEL_PATTERNS, p as LOFI_TYPE, bi as MAINNET_A2A_ESCROW_PACKAGE_ID, M as MANIFEST_TYPE, q as MAX_DELIVER_HORIZON_MS, r as MAX_JOB_USDC, s as MAX_REVIEW_WINDOW_MS, t as MIST_PER_SUI, N as NAVX_TYPE, bj as OPERATION_ASSETS, O as OVERLAY_FEE_RATE, bk as Operation, P as PREFLIGHT_MAX_AMOUNT, v as PREFLIGHT_OK, y as PreflightResult, bl as SENDABLE_ASSETS, S as STABLE_ASSETS, z as SUI_DECIMALS, F as SUI_TYPE, H as SUPPORTED_ASSETS, bm as SelectAndSplitResult, bn as SerializedCetusRoutePath, bo as SerializedRouterDataV3, R as ServiceListing, T as SimulationResult, U as StableAsset, V as SuiHolding, W as SuiRpcTxBlock, _ as T2000ErrorCode, $ as T2000ErrorData, a0 as T2000_OVERLAY_FEE_WALLET, a1 as TOKEN_MAP, a2 as TransactionLeg, a5 as TxDirection, a6 as USDC_DECIMALS, a7 as USDC_TYPE, a8 as USDE_TYPE, a9 as USDSUI_TYPE, aa as USDT_TYPE, ab as WAL_TYPE, ac as WBTC_TYPE, ad as X402ActivityPayload, af as ZkLoginSigner, bp as addSendToTx, bq as addSwapToTx, br as assertAllowedAsset, bs as assertBuyerRequirements, ag as buildCreateJobTx, bt as buildDeclineJobTx, ah as buildDeliverJobTx, ai as buildRefundJobTx, aj as buildRejectJobTx, ak as buildReleaseJobTx, al as buildSendTx, am as buildSwapTx, an as checkPositiveAmount, ao as checkSuiAddress, ap as classifyAction, aq as classifyLabel, ar as classifyTransaction, bu as deserializeCetusRoute, as as executeTx, at as extractAllUserLegs, au as extractTransferDetails, av as extractTxCommands, aw as extractTxSender, ax as fallbackLabel, bv as fetchAllCoins, ay as fetchService, az as findSwapRoute, aA as formatAssetAmount, aB as formatSui, aC as formatUsd, bw as getCoinMeta, aD as getDecimals, aE as getDecimalsForCoinType, aF as getJob, aG as getJobSpec, bx as getSuiClient, by as getSuiGrpcClient, bz as isAllowedAsset, bA as isCetusRouteFresh, bB as isInRegistry, aH as jobActionsFor, aI as listServices, aJ as mapMoveAbortCode, aK as mapWalletError, aL as mistToSui, bC as normalizeAsset, bD as normalizeCoinType, aM as parseSuiRpcTx, aN as payWithX402, aO as preflightCreateJob, aP as preflightFail, aQ as preflightPay, aR as preflightSend, aS as preflightSwap, bE as probeX402, aT as putJobSpec, bF as queryHistory, bG as queryTransaction, aU as rawToStable, aV as rawToUsdc, aW as refineLendingLabel, aX as reportX402Activity, aY as resolveSymbol, aZ as resolveTokenType, bH as selectAndSplitCoin, bI as selectSuiCoin, bJ as serializeCetusRoute, bK as simulateTransaction, a_ as stableToRaw, a$ as suiToMist, bL as throwIfSimulationFailed, b0 as truncateAddress, b1 as usdcToRaw, b2 as validateAddress, bM as verifyCetusRouteCoinMatch, b3 as verifyJobForSeller } from './commerce-DR_F-Eg6.cjs';
|
|
6
6
|
import { Transaction, TransactionObjectArgument } from '@mysten/sui/transactions';
|
|
7
7
|
import { SuinsClient } from '@mysten/suins';
|
|
8
8
|
import '@mysten/sui/client';
|
|
@@ -595,6 +595,10 @@ declare function getAddress(keypair: Ed25519Keypair): string;
|
|
|
595
595
|
* adds `escrow::decline`; v2 added the `opening` module). New-verb calls
|
|
596
596
|
* (opening + decline) target this; original-id verbs stay put, and older
|
|
597
597
|
* package ids remain callable for published clients. */
|
|
598
|
+
/** The published `opening` package id on MAINNET — a literal, never an env
|
|
599
|
+
* read, so it can serve as a signature-time trust anchor (S.930). Must match
|
|
600
|
+
* the Move upgrade publish notes. */
|
|
601
|
+
declare const MAINNET_A2A_ESCROW_OPENING_PACKAGE_ID = "0x69ad93c555519de520a5c7f7f2963ad6f8b91cefc098fc2eed75942dcb5bcbe7";
|
|
598
602
|
declare const A2A_ESCROW_OPENING_PACKAGE_ID: string;
|
|
599
603
|
/**
|
|
600
604
|
* PINNED per-upgrade package ids — event-filter anchors, NEVER bump these.
|
|
@@ -672,6 +676,23 @@ declare function getOpening(client: SuiCoreClient, openingId: string): Promise<O
|
|
|
672
676
|
* on-chain Openings. `id` is the Opening OBJECT id (0x…). Buyer addresses
|
|
673
677
|
* never appear (registered-agent buyers surface by id); the claiming ASP
|
|
674
678
|
* is public. Title + brief are public by design. */
|
|
679
|
+
/** A host-installed veto on sponsored open-board transactions (S.930).
|
|
680
|
+
*
|
|
681
|
+
* Called twice per verb: once with no `txBytes` before the prepare request
|
|
682
|
+
* (so an untrusted API host can be refused before it learns the address),
|
|
683
|
+
* and once with the prepared bytes before they are signed. Throwing from
|
|
684
|
+
* either aborts the verb.
|
|
685
|
+
*
|
|
686
|
+
* The SDK deliberately ships NO default policy: package-id verification
|
|
687
|
+
* needs non-env literals and a notion of "the canonical host", both of which
|
|
688
|
+
* belong to the host application. Unset = today's behavior. */
|
|
689
|
+
type SponsoredTxGuard = (ctx: {
|
|
690
|
+
base: string;
|
|
691
|
+
action: string;
|
|
692
|
+
txBytes?: string;
|
|
693
|
+
}) => void;
|
|
694
|
+
/** Install (or clear, with `null`) the sponsored-tx guard. */
|
|
695
|
+
declare function setSponsoredTxGuard(guard: SponsoredTxGuard | null): void;
|
|
675
696
|
interface OpenJobRow {
|
|
676
697
|
id: string;
|
|
677
698
|
title: string | null;
|
|
@@ -1267,4 +1288,4 @@ declare function fullHandle(label: string, parentName?: string): string;
|
|
|
1267
1288
|
*/
|
|
1268
1289
|
declare function displayHandle(label: string, parentName?: string): string;
|
|
1269
1290
|
|
|
1270
|
-
export { A2A_ESCROW_OPENING_PACKAGE_ID, A2A_ESCROW_PACKAGE_V2_ID, A2A_ESCROW_PACKAGE_V3_ID, AUDRIC_PARENT, AUDRIC_PARENT_NAME, AUDRIC_PARENT_NFT_ID, type ApiModel, type AppenderContext, BalanceResponse, type BuildAddLeafParams, type BuildRevokeLeafParams, type ChatMessage, type ChatParams, type ChatResult, type ChatUsage, type CheckStatus, type ComposeTxOptions, type ComposeTxResult, DEFAULT_API_BASE, type DailySpend, DepositInfo, ESCROW_JOB_TYPE_MARKER, InvalidAddressError, type LabelValidationResult, type LimitAssertInput, LimitEnforcer, LimitExceededError, type LimitKind, type LimitOperation, type LimitsConfig, type LimitsFile, MAX_OPEN_WINDOW_MS, type NormalizedAddress, OPENING_CLAIM_POLICY_ANY_ACTIVE, OPENING_TYPE_MARKER, type OpenJobFilter, type OpenJobRow, type Opening, type OpeningTerms, OverlayFeeConfig, PayOptions, PayResult, PaymentRequest, SPONSORED_PYTH_DEPENDENT_PROVIDERS, SUINS_NAME_REGEX, SUI_ADDRESS_REGEX, SUI_ADDRESS_STRICT_REGEX, SendResult, type SendTransferInput, SendableAsset, SerializedCetusRoute, type StepPreview, SuinsNotRegisteredError, type SuinsParent, SuinsRpcError, SupportedAsset, type SwapExecuteInput, SwapQuoteResult, SwapResult, SwapRouteResult, T2000, T2000Error, T2000Options, TransactionRecord, TransactionSigner, type TrustMode, type UpstreamClaim, type VerifyAnchor, type VerifyCheck, type VerifyOptions, type VerifyResult, type VerifyUpstream, WRITE_APPENDER_REGISTRY, type WriteStep, type WriteToolName, X402Probe, ZkLoginProof, approxUsdValue, assertLimitConfig, buildAddLeafTx, buildCancelOpeningTx, buildClaimOpeningTx, buildCreateOpeningTx, buildRefundUnclaimedTx, buildRevokeLeafTx, cancelOpenJob, canonicalizeRecipientInput, chatCompletion, chatCompletionStream, claimOpenJob, clearLimits, composeTx, dailySpentToday, deriveAllowedAddressesFromPtb, displayHandle, exportPrivateKey, fullHandle, generateKeypair, getAddress, getLimits, getOpenJob, getOpening, getSponsoredSwapProviders, getSwapQuote, hasLimits, keypairFromPrivateKey, listModels, listOpenJobs, loadKey, looksLikeSuiNs, normalizeAddressInput, postOpenJob, preflightCreateOpening, queryBalance, readLimitsFile, recordDailySpend, refundOpenJob, resolveAddressToSuinsViaRpc, resolveCreatedObjectId, resolveSuinsViaRpc, saveBech32, saveKey, setLimits, validateLabel, verifyReceipt, walletExists, writeLimitsFile };
|
|
1291
|
+
export { A2A_ESCROW_OPENING_PACKAGE_ID, A2A_ESCROW_PACKAGE_V2_ID, A2A_ESCROW_PACKAGE_V3_ID, AUDRIC_PARENT, AUDRIC_PARENT_NAME, AUDRIC_PARENT_NFT_ID, type ApiModel, type AppenderContext, BalanceResponse, type BuildAddLeafParams, type BuildRevokeLeafParams, type ChatMessage, type ChatParams, type ChatResult, type ChatUsage, type CheckStatus, type ComposeTxOptions, type ComposeTxResult, DEFAULT_API_BASE, type DailySpend, DepositInfo, ESCROW_JOB_TYPE_MARKER, InvalidAddressError, type LabelValidationResult, type LimitAssertInput, LimitEnforcer, LimitExceededError, type LimitKind, type LimitOperation, type LimitsConfig, type LimitsFile, MAINNET_A2A_ESCROW_OPENING_PACKAGE_ID, MAX_OPEN_WINDOW_MS, type NormalizedAddress, OPENING_CLAIM_POLICY_ANY_ACTIVE, OPENING_TYPE_MARKER, type OpenJobFilter, type OpenJobRow, type Opening, type OpeningTerms, OverlayFeeConfig, PayOptions, PayResult, PaymentRequest, SPONSORED_PYTH_DEPENDENT_PROVIDERS, SUINS_NAME_REGEX, SUI_ADDRESS_REGEX, SUI_ADDRESS_STRICT_REGEX, SendResult, type SendTransferInput, SendableAsset, SerializedCetusRoute, type SponsoredTxGuard, type StepPreview, SuinsNotRegisteredError, type SuinsParent, SuinsRpcError, SupportedAsset, type SwapExecuteInput, SwapQuoteResult, SwapResult, SwapRouteResult, T2000, T2000Error, T2000Options, TransactionRecord, TransactionSigner, type TrustMode, type UpstreamClaim, type VerifyAnchor, type VerifyCheck, type VerifyOptions, type VerifyResult, type VerifyUpstream, WRITE_APPENDER_REGISTRY, type WriteStep, type WriteToolName, X402Probe, ZkLoginProof, approxUsdValue, assertLimitConfig, buildAddLeafTx, buildCancelOpeningTx, buildClaimOpeningTx, buildCreateOpeningTx, buildRefundUnclaimedTx, buildRevokeLeafTx, cancelOpenJob, canonicalizeRecipientInput, chatCompletion, chatCompletionStream, claimOpenJob, clearLimits, composeTx, dailySpentToday, deriveAllowedAddressesFromPtb, displayHandle, exportPrivateKey, fullHandle, generateKeypair, getAddress, getLimits, getOpenJob, getOpening, getSponsoredSwapProviders, getSwapQuote, hasLimits, keypairFromPrivateKey, listModels, listOpenJobs, loadKey, looksLikeSuiNs, normalizeAddressInput, postOpenJob, preflightCreateOpening, queryBalance, readLimitsFile, recordDailySpend, refundOpenJob, resolveAddressToSuinsViaRpc, resolveCreatedObjectId, resolveSuinsViaRpc, saveBech32, saveKey, setLimits, setSponsoredTxGuard, validateLabel, verifyReceipt, walletExists, writeLimitsFile };
|
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 { Z as T2000Error, b4 as T2000Options, a4 as TransactionSigner, w as PayOptions, b5 as X402Probe, x as PayResult, b6 as SerializedCetusRoute, b7 as SwapResult, b8 as SwapQuoteResult, X as SupportedAsset, Q as SendResult, B as BalanceResponse, a3 as TransactionRecord, i as DepositInfo, b9 as PaymentRequest, ae as ZkLoginProof, ba as SuiCoreClient, u as OverlayFeeConfig, bb as SponsoredCoinMergeCache, Y as SwapRouteResult, bc as SendableAsset } from './commerce-
|
|
5
|
-
export { A as A2A_ESCROW_FEE_CONFIG_ID, a as A2A_ESCROW_PACKAGE_ID, b as ActivityReportConfig, bd as CETUS_USDC_SUI_POOL, C as CLOCK_ID, c as COIN_REGISTRY, d as ClassifyBalanceChange, e as ClassifyResult, f as CoinMeta, be as CoinPage, D as DEFAULT_ACTIVITY_REPORT_URL, g as DEFAULT_COMMERCE_API_BASE, bf as DEFAULT_GRPC_URL, h as DEFAULT_NETWORK, E as ETH_TYPE, j as ExtractedTransfer, bg as GASLESS_MIN_STABLE_AMOUNT, bh as GASLESS_STABLE_TYPES, G as GAS_RESERVE_MIN, I as IKA_TYPE, J as JOB_STATES, k as Job, l as JobState, m as JobTerms, n as JobVerification, K as KNOWN_TARGETS, o as KeypairSigner, L as LABEL_PATTERNS, p as LOFI_TYPE, M as MANIFEST_TYPE, q as MAX_DELIVER_HORIZON_MS, r as MAX_JOB_USDC, s as MAX_REVIEW_WINDOW_MS, t as MIST_PER_SUI, N as NAVX_TYPE,
|
|
4
|
+
import { Z as T2000Error, b4 as T2000Options, a4 as TransactionSigner, w as PayOptions, b5 as X402Probe, x as PayResult, b6 as SerializedCetusRoute, b7 as SwapResult, b8 as SwapQuoteResult, X as SupportedAsset, Q as SendResult, B as BalanceResponse, a3 as TransactionRecord, i as DepositInfo, b9 as PaymentRequest, ae as ZkLoginProof, ba as SuiCoreClient, u as OverlayFeeConfig, bb as SponsoredCoinMergeCache, Y as SwapRouteResult, bc as SendableAsset } from './commerce-DR_F-Eg6.js';
|
|
5
|
+
export { A as A2A_ESCROW_FEE_CONFIG_ID, a as A2A_ESCROW_PACKAGE_ID, b as ActivityReportConfig, bd as CETUS_USDC_SUI_POOL, C as CLOCK_ID, c as COIN_REGISTRY, d as ClassifyBalanceChange, e as ClassifyResult, f as CoinMeta, be as CoinPage, D as DEFAULT_ACTIVITY_REPORT_URL, g as DEFAULT_COMMERCE_API_BASE, bf as DEFAULT_GRPC_URL, h as DEFAULT_NETWORK, E as ETH_TYPE, j as ExtractedTransfer, bg as GASLESS_MIN_STABLE_AMOUNT, bh as GASLESS_STABLE_TYPES, G as GAS_RESERVE_MIN, I as IKA_TYPE, J as JOB_STATES, k as Job, l as JobState, m as JobTerms, n as JobVerification, K as KNOWN_TARGETS, o as KeypairSigner, L as LABEL_PATTERNS, p as LOFI_TYPE, bi as MAINNET_A2A_ESCROW_PACKAGE_ID, M as MANIFEST_TYPE, q as MAX_DELIVER_HORIZON_MS, r as MAX_JOB_USDC, s as MAX_REVIEW_WINDOW_MS, t as MIST_PER_SUI, N as NAVX_TYPE, bj as OPERATION_ASSETS, O as OVERLAY_FEE_RATE, bk as Operation, P as PREFLIGHT_MAX_AMOUNT, v as PREFLIGHT_OK, y as PreflightResult, bl as SENDABLE_ASSETS, S as STABLE_ASSETS, z as SUI_DECIMALS, F as SUI_TYPE, H as SUPPORTED_ASSETS, bm as SelectAndSplitResult, bn as SerializedCetusRoutePath, bo as SerializedRouterDataV3, R as ServiceListing, T as SimulationResult, U as StableAsset, V as SuiHolding, W as SuiRpcTxBlock, _ as T2000ErrorCode, $ as T2000ErrorData, a0 as T2000_OVERLAY_FEE_WALLET, a1 as TOKEN_MAP, a2 as TransactionLeg, a5 as TxDirection, a6 as USDC_DECIMALS, a7 as USDC_TYPE, a8 as USDE_TYPE, a9 as USDSUI_TYPE, aa as USDT_TYPE, ab as WAL_TYPE, ac as WBTC_TYPE, ad as X402ActivityPayload, af as ZkLoginSigner, bp as addSendToTx, bq as addSwapToTx, br as assertAllowedAsset, bs as assertBuyerRequirements, ag as buildCreateJobTx, bt as buildDeclineJobTx, ah as buildDeliverJobTx, ai as buildRefundJobTx, aj as buildRejectJobTx, ak as buildReleaseJobTx, al as buildSendTx, am as buildSwapTx, an as checkPositiveAmount, ao as checkSuiAddress, ap as classifyAction, aq as classifyLabel, ar as classifyTransaction, bu as deserializeCetusRoute, as as executeTx, at as extractAllUserLegs, au as extractTransferDetails, av as extractTxCommands, aw as extractTxSender, ax as fallbackLabel, bv as fetchAllCoins, ay as fetchService, az as findSwapRoute, aA as formatAssetAmount, aB as formatSui, aC as formatUsd, bw as getCoinMeta, aD as getDecimals, aE as getDecimalsForCoinType, aF as getJob, aG as getJobSpec, bx as getSuiClient, by as getSuiGrpcClient, bz as isAllowedAsset, bA as isCetusRouteFresh, bB as isInRegistry, aH as jobActionsFor, aI as listServices, aJ as mapMoveAbortCode, aK as mapWalletError, aL as mistToSui, bC as normalizeAsset, bD as normalizeCoinType, aM as parseSuiRpcTx, aN as payWithX402, aO as preflightCreateJob, aP as preflightFail, aQ as preflightPay, aR as preflightSend, aS as preflightSwap, bE as probeX402, aT as putJobSpec, bF as queryHistory, bG as queryTransaction, aU as rawToStable, aV as rawToUsdc, aW as refineLendingLabel, aX as reportX402Activity, aY as resolveSymbol, aZ as resolveTokenType, bH as selectAndSplitCoin, bI as selectSuiCoin, bJ as serializeCetusRoute, bK as simulateTransaction, a_ as stableToRaw, a$ as suiToMist, bL as throwIfSimulationFailed, b0 as truncateAddress, b1 as usdcToRaw, b2 as validateAddress, bM as verifyCetusRouteCoinMatch, b3 as verifyJobForSeller } from './commerce-DR_F-Eg6.js';
|
|
6
6
|
import { Transaction, TransactionObjectArgument } from '@mysten/sui/transactions';
|
|
7
7
|
import { SuinsClient } from '@mysten/suins';
|
|
8
8
|
import '@mysten/sui/client';
|
|
@@ -595,6 +595,10 @@ declare function getAddress(keypair: Ed25519Keypair): string;
|
|
|
595
595
|
* adds `escrow::decline`; v2 added the `opening` module). New-verb calls
|
|
596
596
|
* (opening + decline) target this; original-id verbs stay put, and older
|
|
597
597
|
* package ids remain callable for published clients. */
|
|
598
|
+
/** The published `opening` package id on MAINNET — a literal, never an env
|
|
599
|
+
* read, so it can serve as a signature-time trust anchor (S.930). Must match
|
|
600
|
+
* the Move upgrade publish notes. */
|
|
601
|
+
declare const MAINNET_A2A_ESCROW_OPENING_PACKAGE_ID = "0x69ad93c555519de520a5c7f7f2963ad6f8b91cefc098fc2eed75942dcb5bcbe7";
|
|
598
602
|
declare const A2A_ESCROW_OPENING_PACKAGE_ID: string;
|
|
599
603
|
/**
|
|
600
604
|
* PINNED per-upgrade package ids — event-filter anchors, NEVER bump these.
|
|
@@ -672,6 +676,23 @@ declare function getOpening(client: SuiCoreClient, openingId: string): Promise<O
|
|
|
672
676
|
* on-chain Openings. `id` is the Opening OBJECT id (0x…). Buyer addresses
|
|
673
677
|
* never appear (registered-agent buyers surface by id); the claiming ASP
|
|
674
678
|
* is public. Title + brief are public by design. */
|
|
679
|
+
/** A host-installed veto on sponsored open-board transactions (S.930).
|
|
680
|
+
*
|
|
681
|
+
* Called twice per verb: once with no `txBytes` before the prepare request
|
|
682
|
+
* (so an untrusted API host can be refused before it learns the address),
|
|
683
|
+
* and once with the prepared bytes before they are signed. Throwing from
|
|
684
|
+
* either aborts the verb.
|
|
685
|
+
*
|
|
686
|
+
* The SDK deliberately ships NO default policy: package-id verification
|
|
687
|
+
* needs non-env literals and a notion of "the canonical host", both of which
|
|
688
|
+
* belong to the host application. Unset = today's behavior. */
|
|
689
|
+
type SponsoredTxGuard = (ctx: {
|
|
690
|
+
base: string;
|
|
691
|
+
action: string;
|
|
692
|
+
txBytes?: string;
|
|
693
|
+
}) => void;
|
|
694
|
+
/** Install (or clear, with `null`) the sponsored-tx guard. */
|
|
695
|
+
declare function setSponsoredTxGuard(guard: SponsoredTxGuard | null): void;
|
|
675
696
|
interface OpenJobRow {
|
|
676
697
|
id: string;
|
|
677
698
|
title: string | null;
|
|
@@ -1267,4 +1288,4 @@ declare function fullHandle(label: string, parentName?: string): string;
|
|
|
1267
1288
|
*/
|
|
1268
1289
|
declare function displayHandle(label: string, parentName?: string): string;
|
|
1269
1290
|
|
|
1270
|
-
export { A2A_ESCROW_OPENING_PACKAGE_ID, A2A_ESCROW_PACKAGE_V2_ID, A2A_ESCROW_PACKAGE_V3_ID, AUDRIC_PARENT, AUDRIC_PARENT_NAME, AUDRIC_PARENT_NFT_ID, type ApiModel, type AppenderContext, BalanceResponse, type BuildAddLeafParams, type BuildRevokeLeafParams, type ChatMessage, type ChatParams, type ChatResult, type ChatUsage, type CheckStatus, type ComposeTxOptions, type ComposeTxResult, DEFAULT_API_BASE, type DailySpend, DepositInfo, ESCROW_JOB_TYPE_MARKER, InvalidAddressError, type LabelValidationResult, type LimitAssertInput, LimitEnforcer, LimitExceededError, type LimitKind, type LimitOperation, type LimitsConfig, type LimitsFile, MAX_OPEN_WINDOW_MS, type NormalizedAddress, OPENING_CLAIM_POLICY_ANY_ACTIVE, OPENING_TYPE_MARKER, type OpenJobFilter, type OpenJobRow, type Opening, type OpeningTerms, OverlayFeeConfig, PayOptions, PayResult, PaymentRequest, SPONSORED_PYTH_DEPENDENT_PROVIDERS, SUINS_NAME_REGEX, SUI_ADDRESS_REGEX, SUI_ADDRESS_STRICT_REGEX, SendResult, type SendTransferInput, SendableAsset, SerializedCetusRoute, type StepPreview, SuinsNotRegisteredError, type SuinsParent, SuinsRpcError, SupportedAsset, type SwapExecuteInput, SwapQuoteResult, SwapResult, SwapRouteResult, T2000, T2000Error, T2000Options, TransactionRecord, TransactionSigner, type TrustMode, type UpstreamClaim, type VerifyAnchor, type VerifyCheck, type VerifyOptions, type VerifyResult, type VerifyUpstream, WRITE_APPENDER_REGISTRY, type WriteStep, type WriteToolName, X402Probe, ZkLoginProof, approxUsdValue, assertLimitConfig, buildAddLeafTx, buildCancelOpeningTx, buildClaimOpeningTx, buildCreateOpeningTx, buildRefundUnclaimedTx, buildRevokeLeafTx, cancelOpenJob, canonicalizeRecipientInput, chatCompletion, chatCompletionStream, claimOpenJob, clearLimits, composeTx, dailySpentToday, deriveAllowedAddressesFromPtb, displayHandle, exportPrivateKey, fullHandle, generateKeypair, getAddress, getLimits, getOpenJob, getOpening, getSponsoredSwapProviders, getSwapQuote, hasLimits, keypairFromPrivateKey, listModels, listOpenJobs, loadKey, looksLikeSuiNs, normalizeAddressInput, postOpenJob, preflightCreateOpening, queryBalance, readLimitsFile, recordDailySpend, refundOpenJob, resolveAddressToSuinsViaRpc, resolveCreatedObjectId, resolveSuinsViaRpc, saveBech32, saveKey, setLimits, validateLabel, verifyReceipt, walletExists, writeLimitsFile };
|
|
1291
|
+
export { A2A_ESCROW_OPENING_PACKAGE_ID, A2A_ESCROW_PACKAGE_V2_ID, A2A_ESCROW_PACKAGE_V3_ID, AUDRIC_PARENT, AUDRIC_PARENT_NAME, AUDRIC_PARENT_NFT_ID, type ApiModel, type AppenderContext, BalanceResponse, type BuildAddLeafParams, type BuildRevokeLeafParams, type ChatMessage, type ChatParams, type ChatResult, type ChatUsage, type CheckStatus, type ComposeTxOptions, type ComposeTxResult, DEFAULT_API_BASE, type DailySpend, DepositInfo, ESCROW_JOB_TYPE_MARKER, InvalidAddressError, type LabelValidationResult, type LimitAssertInput, LimitEnforcer, LimitExceededError, type LimitKind, type LimitOperation, type LimitsConfig, type LimitsFile, MAINNET_A2A_ESCROW_OPENING_PACKAGE_ID, MAX_OPEN_WINDOW_MS, type NormalizedAddress, OPENING_CLAIM_POLICY_ANY_ACTIVE, OPENING_TYPE_MARKER, type OpenJobFilter, type OpenJobRow, type Opening, type OpeningTerms, OverlayFeeConfig, PayOptions, PayResult, PaymentRequest, SPONSORED_PYTH_DEPENDENT_PROVIDERS, SUINS_NAME_REGEX, SUI_ADDRESS_REGEX, SUI_ADDRESS_STRICT_REGEX, SendResult, type SendTransferInput, SendableAsset, SerializedCetusRoute, type SponsoredTxGuard, type StepPreview, SuinsNotRegisteredError, type SuinsParent, SuinsRpcError, SupportedAsset, type SwapExecuteInput, SwapQuoteResult, SwapResult, SwapRouteResult, T2000, T2000Error, T2000Options, TransactionRecord, TransactionSigner, type TrustMode, type UpstreamClaim, type VerifyAnchor, type VerifyCheck, type VerifyOptions, type VerifyResult, type VerifyUpstream, WRITE_APPENDER_REGISTRY, type WriteStep, type WriteToolName, X402Probe, ZkLoginProof, approxUsdValue, assertLimitConfig, buildAddLeafTx, buildCancelOpeningTx, buildClaimOpeningTx, buildCreateOpeningTx, buildRefundUnclaimedTx, buildRevokeLeafTx, cancelOpenJob, canonicalizeRecipientInput, chatCompletion, chatCompletionStream, claimOpenJob, clearLimits, composeTx, dailySpentToday, deriveAllowedAddressesFromPtb, displayHandle, exportPrivateKey, fullHandle, generateKeypair, getAddress, getLimits, getOpenJob, getOpening, getSponsoredSwapProviders, getSwapQuote, hasLimits, keypairFromPrivateKey, listModels, listOpenJobs, loadKey, looksLikeSuiNs, normalizeAddressInput, postOpenJob, preflightCreateOpening, queryBalance, readLimitsFile, recordDailySpend, refundOpenJob, resolveAddressToSuinsViaRpc, resolveCreatedObjectId, resolveSuinsViaRpc, saveBech32, saveKey, setLimits, setSponsoredTxGuard, validateLabel, verifyReceipt, walletExists, writeLimitsFile };
|
package/dist/index.js
CHANGED
|
@@ -3286,7 +3286,8 @@ init_coinSelection();
|
|
|
3286
3286
|
init_errors();
|
|
3287
3287
|
init_token_registry();
|
|
3288
3288
|
init_coinSelection();
|
|
3289
|
-
var
|
|
3289
|
+
var MAINNET_A2A_ESCROW_OPENING_PACKAGE_ID = "0x69ad93c555519de520a5c7f7f2963ad6f8b91cefc098fc2eed75942dcb5bcbe7";
|
|
3290
|
+
var A2A_ESCROW_OPENING_PACKAGE_ID = process.env.A2A_ESCROW_OPENING_PACKAGE_ID ?? MAINNET_A2A_ESCROW_OPENING_PACKAGE_ID;
|
|
3290
3291
|
var A2A_ESCROW_PACKAGE_V2_ID = "0x860288d789dc617f6474a0a6801d6011e53bf30d5fb801cdad47b9bc6adb098b";
|
|
3291
3292
|
var A2A_ESCROW_PACKAGE_V3_ID = "0x69ad93c555519de520a5c7f7f2963ad6f8b91cefc098fc2eed75942dcb5bcbe7";
|
|
3292
3293
|
var CLOCK_ID2 = "0x6";
|
|
@@ -3422,7 +3423,8 @@ async function getOpening(client, openingId) {
|
|
|
3422
3423
|
}
|
|
3423
3424
|
|
|
3424
3425
|
// src/wallet/job.ts
|
|
3425
|
-
var
|
|
3426
|
+
var MAINNET_A2A_ESCROW_PACKAGE_ID = "0x358a819c1c016e2cc84ef5fbea81cba90c31f7f8a62bf45cb5e5276acf198bdd";
|
|
3427
|
+
var A2A_ESCROW_PACKAGE_ID = process.env.A2A_ESCROW_PACKAGE_ID ?? MAINNET_A2A_ESCROW_PACKAGE_ID;
|
|
3426
3428
|
var A2A_ESCROW_FEE_CONFIG_ID = process.env.A2A_ESCROW_FEE_CONFIG_ID ?? "0xddaa25570950b7484dbf20797ebcf75707be9c87cd67bef2a06ed2e81d2c494b";
|
|
3427
3429
|
var A2A_ESCROW_FEE_CONFIG_VERSION = Number(
|
|
3428
3430
|
process.env.A2A_ESCROW_FEE_CONFIG_VERSION ?? 931861903
|
|
@@ -3792,6 +3794,10 @@ async function fetchJson(url, init) {
|
|
|
3792
3794
|
}
|
|
3793
3795
|
return json;
|
|
3794
3796
|
}
|
|
3797
|
+
var sponsoredTxGuard = null;
|
|
3798
|
+
function setSponsoredTxGuard(guard) {
|
|
3799
|
+
sponsoredTxGuard = guard;
|
|
3800
|
+
}
|
|
3795
3801
|
async function listOpenJobs(base, filter = {}) {
|
|
3796
3802
|
const params = new URLSearchParams();
|
|
3797
3803
|
if (filter.status) params.set("status", filter.status);
|
|
@@ -3810,6 +3816,7 @@ async function getOpenJob(base, id) {
|
|
|
3810
3816
|
}
|
|
3811
3817
|
async function sponsoredOpeningVerb(base, signer, action, params) {
|
|
3812
3818
|
const address = signer.getAddress();
|
|
3819
|
+
sponsoredTxGuard?.({ base, action });
|
|
3813
3820
|
const prep = await fetchJson(`${base}/job/prepare`, {
|
|
3814
3821
|
method: "POST",
|
|
3815
3822
|
body: { address, action, params }
|
|
@@ -3819,6 +3826,7 @@ async function sponsoredOpeningVerb(base, signer, action, params) {
|
|
|
3819
3826
|
if (!(nonce && txBytes)) {
|
|
3820
3827
|
throw new Error("Failed to prepare the transaction.");
|
|
3821
3828
|
}
|
|
3829
|
+
sponsoredTxGuard?.({ base, action, txBytes });
|
|
3822
3830
|
const { signature } = await signer.signTransaction(fromBase64(txBytes));
|
|
3823
3831
|
const json = await fetchJson(`${base}/job/submit`, {
|
|
3824
3832
|
method: "POST",
|
|
@@ -4285,6 +4293,6 @@ function displayHandle(label, parentName = AUDRIC_PARENT_NAME) {
|
|
|
4285
4293
|
// src/index.ts
|
|
4286
4294
|
init_preflight();
|
|
4287
4295
|
|
|
4288
|
-
export { A2A_ESCROW_FEE_CONFIG_ID, A2A_ESCROW_OPENING_PACKAGE_ID, A2A_ESCROW_PACKAGE_ID, A2A_ESCROW_PACKAGE_V2_ID, A2A_ESCROW_PACKAGE_V3_ID, AUDRIC_PARENT, AUDRIC_PARENT_NAME, AUDRIC_PARENT_NFT_ID, CETUS_USDC_SUI_POOL, CLOCK_ID, COIN_REGISTRY, DEFAULT_ACTIVITY_REPORT_URL, DEFAULT_API_BASE, DEFAULT_COMMERCE_API_BASE, DEFAULT_GRPC_URL, DEFAULT_NETWORK, ESCROW_JOB_TYPE_MARKER, 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, MIST_PER_SUI, NAVX_TYPE, OPENING_CLAIM_POLICY_ANY_ACTIVE, OPENING_TYPE_MARKER, 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, 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, buildCancelOpeningTx, buildClaimOpeningTx, buildCreateJobTx, buildCreateOpeningTx, buildDeclineJobTx, buildDeliverJobTx, buildRefundJobTx, buildRefundUnclaimedTx, buildRejectJobTx, buildReleaseJobTx, buildRevokeLeafTx, buildSendTx, buildSwapTx, cancelOpenJob, canonicalizeRecipientInput, 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, parseSuiRpcTx, payWithX402, postOpenJob, preflightCreateJob, preflightCreateOpening, preflightFail, preflightPay, preflightSend, preflightSwap, probeX402, putJobSpec, queryBalance, queryHistory, queryTransaction, rawToStable, rawToUsdc, readLimitsFile, recordDailySpend, refineLendingLabel, refundOpenJob, reportX402Activity, resolveAddressToSuinsViaRpc, resolveCreatedObjectId, resolveSuinsViaRpc, resolveSymbol, resolveTokenType, saveBech32, saveKey, selectAndSplitCoin, selectSuiCoin, serializeCetusRoute, setLimits, simulateTransaction, stableToRaw, suiToMist, throwIfSimulationFailed, truncateAddress, usdcToRaw, validateAddress, validateLabel, verifyCetusRouteCoinMatch, verifyJobForSeller, verifyReceipt, walletExists, writeLimitsFile };
|
|
4296
|
+
export { A2A_ESCROW_FEE_CONFIG_ID, A2A_ESCROW_OPENING_PACKAGE_ID, A2A_ESCROW_PACKAGE_ID, A2A_ESCROW_PACKAGE_V2_ID, A2A_ESCROW_PACKAGE_V3_ID, AUDRIC_PARENT, AUDRIC_PARENT_NAME, AUDRIC_PARENT_NFT_ID, CETUS_USDC_SUI_POOL, CLOCK_ID, COIN_REGISTRY, DEFAULT_ACTIVITY_REPORT_URL, DEFAULT_API_BASE, DEFAULT_COMMERCE_API_BASE, DEFAULT_GRPC_URL, DEFAULT_NETWORK, ESCROW_JOB_TYPE_MARKER, 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, MAINNET_A2A_ESCROW_OPENING_PACKAGE_ID, MAINNET_A2A_ESCROW_PACKAGE_ID, MANIFEST_TYPE, MAX_DELIVER_HORIZON_MS, MAX_JOB_USDC, MAX_OPEN_WINDOW_MS, MAX_REVIEW_WINDOW_MS, MIST_PER_SUI, NAVX_TYPE, OPENING_CLAIM_POLICY_ANY_ACTIVE, OPENING_TYPE_MARKER, 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, 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, buildCancelOpeningTx, buildClaimOpeningTx, buildCreateJobTx, buildCreateOpeningTx, buildDeclineJobTx, buildDeliverJobTx, buildRefundJobTx, buildRefundUnclaimedTx, buildRejectJobTx, buildReleaseJobTx, buildRevokeLeafTx, buildSendTx, buildSwapTx, cancelOpenJob, canonicalizeRecipientInput, 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, parseSuiRpcTx, payWithX402, postOpenJob, preflightCreateJob, preflightCreateOpening, preflightFail, preflightPay, preflightSend, preflightSwap, probeX402, putJobSpec, queryBalance, queryHistory, queryTransaction, rawToStable, rawToUsdc, readLimitsFile, recordDailySpend, refineLendingLabel, refundOpenJob, reportX402Activity, resolveAddressToSuinsViaRpc, resolveCreatedObjectId, resolveSuinsViaRpc, resolveSymbol, resolveTokenType, saveBech32, saveKey, selectAndSplitCoin, selectSuiCoin, serializeCetusRoute, setLimits, setSponsoredTxGuard, simulateTransaction, stableToRaw, suiToMist, throwIfSimulationFailed, truncateAddress, usdcToRaw, validateAddress, validateLabel, verifyCetusRouteCoinMatch, verifyJobForSeller, verifyReceipt, walletExists, writeLimitsFile };
|
|
4289
4297
|
//# sourceMappingURL=index.js.map
|
|
4290
4298
|
//# sourceMappingURL=index.js.map
|