@t2000/sdk 10.5.0 → 10.6.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/index.d.cts CHANGED
@@ -1140,8 +1140,8 @@ declare function buildAgentCoinModule(params: AgentCoinParams): Promise<AgentCoi
1140
1140
  * freezes CoinMetadata + TreasuryCap (the can't-rug set).
1141
1141
  *
1142
1142
  * PTB 2 — `buildTokenizeTx`: bind the coin type to the Agent ID → split the
1143
- * supply 50/50 → create the Cetus AGENT/SUI pool seeded with the LP half +
1144
- * launcher-supplied SUI → wrap the position in a 10-year `LpLock` whose sole
1143
+ * supply 50/50 → create the Cetus AGENT/USDC pool seeded with the LP half +
1144
+ * launcher-supplied USDC → wrap the position in a 10-year `LpLock` whose sole
1145
1145
  * beneficiary is the agent wallet → finalize the registry record. Atomic:
1146
1146
  * either the agent ends tokenized-with-locked-LP or nothing is recorded.
1147
1147
  *
@@ -1150,10 +1150,10 @@ declare function buildAgentCoinModule(params: AgentCoinParams): Promise<AgentCoi
1150
1150
  * leaves a published-but-unbound coin (launcher's gas, nobody's harm) and
1151
1151
  * PTB 2 is simply retried.
1152
1152
  *
1153
- * NO GAS SPONSORSHIP on either PTB: PTB 2 seeds SUI liquidity from `tx.gas`,
1154
- * and under Enoki sponsorship `tx.gas` is the SPONSOR's coin t2000 must
1155
- * never seed LP (SPEC_AGENT_CAPITAL guards). The launcher holds SUI by
1156
- * construction (they're supplying the liquidity).
1153
+ * The quote side is USDC (L3 override 2026-07-25) selected from the
1154
+ * launcher's own coins, so gas sponsorship is now PERMITTED (sponsor gas can
1155
+ * no longer become LP). v1 ships unsponsored; wire the job/register sponsor
1156
+ * pattern if SUI-less launchers appear.
1157
1157
  *
1158
1158
  * These builders construct UNSIGNED transactions; auth lives in the Move
1159
1159
  * layer (`registry::bind/finalize` re-check agent-or-confirmed-owner on
@@ -1168,9 +1168,10 @@ declare const CAPITAL_REGISTRY_ID: string;
1168
1168
  /** `initial_shared_version` of the CapitalRegistry — lets builders reference
1169
1169
  * the shared object without a resolution round-trip. */
1170
1170
  declare const CAPITAL_REGISTRY_VERSION: number;
1171
- /** Minimum SUI the launcher must seed the pool with enough that the pool
1172
- * opens with real two-sided liquidity rather than dust. Floor, no rounding. */
1173
- declare const MIN_LP_SUI = 1000000000n;
1171
+ /** Minimum USDC the launcher must seed the pool with (L3 override 2026-07-25:
1172
+ * the quote side is USDC, the settlement stable never SUI). Enough that the
1173
+ * pool opens with real two-sided liquidity rather than dust. */
1174
+ declare const MIN_LP_USDC = 5000000n;
1174
1175
  interface PublishAgentCoinArgs {
1175
1176
  /** Coin branding; `recipient` MUST be the launcher (checked). */
1176
1177
  coin: AgentCoinParams;
@@ -1198,24 +1199,26 @@ interface TokenizeArgs {
1198
1199
  supplyCoinId: string;
1199
1200
  /** The published coin's CoinMetadata object id (frozen, from PTB 1). */
1200
1201
  coinMetadataId: string;
1201
- /** SUI CoinMetadata object id (constant on mainnet, arg for testnet). */
1202
- suiMetadataId?: string;
1203
- /** Raw MIST the launcher seeds the pool with (≥ MIN_LP_SUI). Split from
1204
- * gas the launcher's own SUI, definitionally. */
1205
- lpSuiAmount: bigint;
1202
+ /** USDC CoinMetadata object id (constant on mainnet, arg for testnet). */
1203
+ usdcMetadataId?: string;
1204
+ /** Raw USDC (6dp) the launcher seeds the pool with (≥ MIN_LP_USDC)
1205
+ * selected from the launcher's own coins, never platform funds. */
1206
+ lpUsdcAmount: bigint;
1206
1207
  /** Pool display url — the agent icon; optional. */
1207
1208
  poolUrl?: string;
1208
1209
  /** Pair orientation — from `simulate`-then-flip (see cetus-clmm.ts note). */
1209
- suiFirst?: boolean;
1210
+ usdcFirst?: boolean;
1210
1211
  /** The `agent_id::registry` shared object id. */
1211
1212
  agentRegistryId: string;
1213
+ /** Client for USDC coin selection (gRPC). */
1214
+ client: SuiCoreClient;
1212
1215
  }
1213
- /** SUI CoinMetadata on mainnet (immutable, well-known). */
1214
- declare const SUI_COIN_METADATA_ID = "0x9258181f5ceac8dbffb7030890243caed69a9599d2886d957a9cb7656af3bdb3";
1216
+ /** USDC CoinMetadata on mainnet (immutable, well-known). */
1217
+ declare const USDC_COIN_METADATA_ID = "0x75cfbbf8c962d542e99a1d15731e6069f60a00db895407785b15d14f606f2b4a";
1215
1218
  /**
1216
1219
  * PTB 2 — bind + split 50/50 + pool + 10y lock + finalize, atomically.
1217
1220
  */
1218
- declare function buildTokenizeTx(args: TokenizeArgs): Transaction;
1221
+ declare function buildTokenizeTx(args: TokenizeArgs): Promise<Transaction>;
1219
1222
 
1220
1223
  /**
1221
1224
  * Cetus CLMM — pool creation + position plumbing for Agent Capital launches
@@ -1247,4 +1250,4 @@ declare const CETUS_POSITION_TYPE: string;
1247
1250
  */
1248
1251
  declare const AGENT_POOL_TICK_SPACING = 200;
1249
1252
 
1250
- export { AGENT_CAPITAL_PACKAGE_ID, 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, type AgentCoinModule, type AgentCoinParams, type ApiModel, type AppenderContext, BalanceResponse, type BuildAddLeafParams, type BuildRevokeLeafParams, CAPITAL_REGISTRY_ID, CAPITAL_REGISTRY_VERSION, CETUS_CLMM_PACKAGE_ID, CETUS_GLOBAL_CONFIG_ID, CETUS_POOLS_ID, CETUS_POSITION_TYPE, type ChatMessage, type ChatParams, type ChatResult, type ChatUsage, type CheckStatus, type ComposeTxOptions, type ComposeTxResult, DEFAULT_API_BASE, type DailySpend, DepositInfo, InvalidAddressError, type LabelValidationResult, type LimitAssertInput, LimitEnforcer, LimitExceededError, type LimitKind, type LimitOperation, type LimitsConfig, type LimitsFile, MIN_LP_SUI, type NormalizedAddress, OverlayFeeConfig, PayOptions, PayResult, PaymentRequest, type PublishAgentCoinArgs, type PublishAgentCoinResult, SPONSORED_PYTH_DEPENDENT_PROVIDERS, SUINS_NAME_REGEX, SUI_ADDRESS_REGEX, SUI_ADDRESS_STRICT_REGEX, SUI_COIN_METADATA_ID, SYMBOL_BLOCKLIST, SendResult, type SendTransferInput, SendableAsset, type StepPreview, SuinsNotRegisteredError, type SuinsParent, SuinsRpcError, SupportedAsset, type SwapExecuteInput, SwapQuoteResult, SwapResult, SwapRouteResult, T2000, T2000Error, T2000Options, type TokenizeArgs, TransactionRecord, TransactionSigner, type TrustMode, type UpstreamClaim, type VerifyAnchor, type VerifyCheck, type VerifyOptions, type VerifyResult, type VerifyUpstream, WRITE_APPENDER_REGISTRY, type WriteStep, type WriteToolName, ZkLoginProof, approxUsdValue, assertLimitConfig, buildAddLeafTx, buildAgentCoinModule, buildPublishAgentCoinTx, buildRevokeLeafTx, buildTokenizeTx, chatCompletion, chatCompletionStream, clearLimits, composeTx, dailySpentToday, deriveAllowedAddressesFromPtb, displayHandle, exportPrivateKey, fullHandle, generateKeypair, getAddress, getLimits, getSponsoredSwapProviders, getSwapQuote, hasLimits, keypairFromPrivateKey, listModels, loadKey, looksLikeSuiNs, normalizeAddressInput, queryBalance, readLimitsFile, recordDailySpend, resolveAddressToSuinsViaRpc, resolveSuinsViaRpc, saveBech32, saveKey, setLimits, validateAgentCoinParams, validateLabel, verifyReceipt, walletExists, writeLimitsFile };
1253
+ export { AGENT_CAPITAL_PACKAGE_ID, 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, type AgentCoinModule, type AgentCoinParams, type ApiModel, type AppenderContext, BalanceResponse, type BuildAddLeafParams, type BuildRevokeLeafParams, CAPITAL_REGISTRY_ID, CAPITAL_REGISTRY_VERSION, CETUS_CLMM_PACKAGE_ID, CETUS_GLOBAL_CONFIG_ID, CETUS_POOLS_ID, CETUS_POSITION_TYPE, type ChatMessage, type ChatParams, type ChatResult, type ChatUsage, type CheckStatus, type ComposeTxOptions, type ComposeTxResult, DEFAULT_API_BASE, type DailySpend, DepositInfo, InvalidAddressError, type LabelValidationResult, type LimitAssertInput, LimitEnforcer, LimitExceededError, type LimitKind, type LimitOperation, type LimitsConfig, type LimitsFile, MIN_LP_USDC, type NormalizedAddress, OverlayFeeConfig, PayOptions, PayResult, PaymentRequest, type PublishAgentCoinArgs, type PublishAgentCoinResult, SPONSORED_PYTH_DEPENDENT_PROVIDERS, SUINS_NAME_REGEX, SUI_ADDRESS_REGEX, SUI_ADDRESS_STRICT_REGEX, SYMBOL_BLOCKLIST, SendResult, type SendTransferInput, SendableAsset, type StepPreview, SuinsNotRegisteredError, type SuinsParent, SuinsRpcError, SupportedAsset, type SwapExecuteInput, SwapQuoteResult, SwapResult, SwapRouteResult, T2000, T2000Error, T2000Options, type TokenizeArgs, TransactionRecord, TransactionSigner, type TrustMode, USDC_COIN_METADATA_ID, type UpstreamClaim, type VerifyAnchor, type VerifyCheck, type VerifyOptions, type VerifyResult, type VerifyUpstream, WRITE_APPENDER_REGISTRY, type WriteStep, type WriteToolName, ZkLoginProof, approxUsdValue, assertLimitConfig, buildAddLeafTx, buildAgentCoinModule, buildPublishAgentCoinTx, buildRevokeLeafTx, buildTokenizeTx, chatCompletion, chatCompletionStream, clearLimits, composeTx, dailySpentToday, deriveAllowedAddressesFromPtb, displayHandle, exportPrivateKey, fullHandle, generateKeypair, getAddress, getLimits, getSponsoredSwapProviders, getSwapQuote, hasLimits, keypairFromPrivateKey, listModels, loadKey, looksLikeSuiNs, normalizeAddressInput, queryBalance, readLimitsFile, recordDailySpend, resolveAddressToSuinsViaRpc, resolveSuinsViaRpc, saveBech32, saveKey, setLimits, validateAgentCoinParams, validateLabel, verifyReceipt, walletExists, writeLimitsFile };
package/dist/index.d.ts CHANGED
@@ -1140,8 +1140,8 @@ declare function buildAgentCoinModule(params: AgentCoinParams): Promise<AgentCoi
1140
1140
  * freezes CoinMetadata + TreasuryCap (the can't-rug set).
1141
1141
  *
1142
1142
  * PTB 2 — `buildTokenizeTx`: bind the coin type to the Agent ID → split the
1143
- * supply 50/50 → create the Cetus AGENT/SUI pool seeded with the LP half +
1144
- * launcher-supplied SUI → wrap the position in a 10-year `LpLock` whose sole
1143
+ * supply 50/50 → create the Cetus AGENT/USDC pool seeded with the LP half +
1144
+ * launcher-supplied USDC → wrap the position in a 10-year `LpLock` whose sole
1145
1145
  * beneficiary is the agent wallet → finalize the registry record. Atomic:
1146
1146
  * either the agent ends tokenized-with-locked-LP or nothing is recorded.
1147
1147
  *
@@ -1150,10 +1150,10 @@ declare function buildAgentCoinModule(params: AgentCoinParams): Promise<AgentCoi
1150
1150
  * leaves a published-but-unbound coin (launcher's gas, nobody's harm) and
1151
1151
  * PTB 2 is simply retried.
1152
1152
  *
1153
- * NO GAS SPONSORSHIP on either PTB: PTB 2 seeds SUI liquidity from `tx.gas`,
1154
- * and under Enoki sponsorship `tx.gas` is the SPONSOR's coin t2000 must
1155
- * never seed LP (SPEC_AGENT_CAPITAL guards). The launcher holds SUI by
1156
- * construction (they're supplying the liquidity).
1153
+ * The quote side is USDC (L3 override 2026-07-25) selected from the
1154
+ * launcher's own coins, so gas sponsorship is now PERMITTED (sponsor gas can
1155
+ * no longer become LP). v1 ships unsponsored; wire the job/register sponsor
1156
+ * pattern if SUI-less launchers appear.
1157
1157
  *
1158
1158
  * These builders construct UNSIGNED transactions; auth lives in the Move
1159
1159
  * layer (`registry::bind/finalize` re-check agent-or-confirmed-owner on
@@ -1168,9 +1168,10 @@ declare const CAPITAL_REGISTRY_ID: string;
1168
1168
  /** `initial_shared_version` of the CapitalRegistry — lets builders reference
1169
1169
  * the shared object without a resolution round-trip. */
1170
1170
  declare const CAPITAL_REGISTRY_VERSION: number;
1171
- /** Minimum SUI the launcher must seed the pool with enough that the pool
1172
- * opens with real two-sided liquidity rather than dust. Floor, no rounding. */
1173
- declare const MIN_LP_SUI = 1000000000n;
1171
+ /** Minimum USDC the launcher must seed the pool with (L3 override 2026-07-25:
1172
+ * the quote side is USDC, the settlement stable never SUI). Enough that the
1173
+ * pool opens with real two-sided liquidity rather than dust. */
1174
+ declare const MIN_LP_USDC = 5000000n;
1174
1175
  interface PublishAgentCoinArgs {
1175
1176
  /** Coin branding; `recipient` MUST be the launcher (checked). */
1176
1177
  coin: AgentCoinParams;
@@ -1198,24 +1199,26 @@ interface TokenizeArgs {
1198
1199
  supplyCoinId: string;
1199
1200
  /** The published coin's CoinMetadata object id (frozen, from PTB 1). */
1200
1201
  coinMetadataId: string;
1201
- /** SUI CoinMetadata object id (constant on mainnet, arg for testnet). */
1202
- suiMetadataId?: string;
1203
- /** Raw MIST the launcher seeds the pool with (≥ MIN_LP_SUI). Split from
1204
- * gas the launcher's own SUI, definitionally. */
1205
- lpSuiAmount: bigint;
1202
+ /** USDC CoinMetadata object id (constant on mainnet, arg for testnet). */
1203
+ usdcMetadataId?: string;
1204
+ /** Raw USDC (6dp) the launcher seeds the pool with (≥ MIN_LP_USDC)
1205
+ * selected from the launcher's own coins, never platform funds. */
1206
+ lpUsdcAmount: bigint;
1206
1207
  /** Pool display url — the agent icon; optional. */
1207
1208
  poolUrl?: string;
1208
1209
  /** Pair orientation — from `simulate`-then-flip (see cetus-clmm.ts note). */
1209
- suiFirst?: boolean;
1210
+ usdcFirst?: boolean;
1210
1211
  /** The `agent_id::registry` shared object id. */
1211
1212
  agentRegistryId: string;
1213
+ /** Client for USDC coin selection (gRPC). */
1214
+ client: SuiCoreClient;
1212
1215
  }
1213
- /** SUI CoinMetadata on mainnet (immutable, well-known). */
1214
- declare const SUI_COIN_METADATA_ID = "0x9258181f5ceac8dbffb7030890243caed69a9599d2886d957a9cb7656af3bdb3";
1216
+ /** USDC CoinMetadata on mainnet (immutable, well-known). */
1217
+ declare const USDC_COIN_METADATA_ID = "0x75cfbbf8c962d542e99a1d15731e6069f60a00db895407785b15d14f606f2b4a";
1215
1218
  /**
1216
1219
  * PTB 2 — bind + split 50/50 + pool + 10y lock + finalize, atomically.
1217
1220
  */
1218
- declare function buildTokenizeTx(args: TokenizeArgs): Transaction;
1221
+ declare function buildTokenizeTx(args: TokenizeArgs): Promise<Transaction>;
1219
1222
 
1220
1223
  /**
1221
1224
  * Cetus CLMM — pool creation + position plumbing for Agent Capital launches
@@ -1247,4 +1250,4 @@ declare const CETUS_POSITION_TYPE: string;
1247
1250
  */
1248
1251
  declare const AGENT_POOL_TICK_SPACING = 200;
1249
1252
 
1250
- export { AGENT_CAPITAL_PACKAGE_ID, 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, type AgentCoinModule, type AgentCoinParams, type ApiModel, type AppenderContext, BalanceResponse, type BuildAddLeafParams, type BuildRevokeLeafParams, CAPITAL_REGISTRY_ID, CAPITAL_REGISTRY_VERSION, CETUS_CLMM_PACKAGE_ID, CETUS_GLOBAL_CONFIG_ID, CETUS_POOLS_ID, CETUS_POSITION_TYPE, type ChatMessage, type ChatParams, type ChatResult, type ChatUsage, type CheckStatus, type ComposeTxOptions, type ComposeTxResult, DEFAULT_API_BASE, type DailySpend, DepositInfo, InvalidAddressError, type LabelValidationResult, type LimitAssertInput, LimitEnforcer, LimitExceededError, type LimitKind, type LimitOperation, type LimitsConfig, type LimitsFile, MIN_LP_SUI, type NormalizedAddress, OverlayFeeConfig, PayOptions, PayResult, PaymentRequest, type PublishAgentCoinArgs, type PublishAgentCoinResult, SPONSORED_PYTH_DEPENDENT_PROVIDERS, SUINS_NAME_REGEX, SUI_ADDRESS_REGEX, SUI_ADDRESS_STRICT_REGEX, SUI_COIN_METADATA_ID, SYMBOL_BLOCKLIST, SendResult, type SendTransferInput, SendableAsset, type StepPreview, SuinsNotRegisteredError, type SuinsParent, SuinsRpcError, SupportedAsset, type SwapExecuteInput, SwapQuoteResult, SwapResult, SwapRouteResult, T2000, T2000Error, T2000Options, type TokenizeArgs, TransactionRecord, TransactionSigner, type TrustMode, type UpstreamClaim, type VerifyAnchor, type VerifyCheck, type VerifyOptions, type VerifyResult, type VerifyUpstream, WRITE_APPENDER_REGISTRY, type WriteStep, type WriteToolName, ZkLoginProof, approxUsdValue, assertLimitConfig, buildAddLeafTx, buildAgentCoinModule, buildPublishAgentCoinTx, buildRevokeLeafTx, buildTokenizeTx, chatCompletion, chatCompletionStream, clearLimits, composeTx, dailySpentToday, deriveAllowedAddressesFromPtb, displayHandle, exportPrivateKey, fullHandle, generateKeypair, getAddress, getLimits, getSponsoredSwapProviders, getSwapQuote, hasLimits, keypairFromPrivateKey, listModels, loadKey, looksLikeSuiNs, normalizeAddressInput, queryBalance, readLimitsFile, recordDailySpend, resolveAddressToSuinsViaRpc, resolveSuinsViaRpc, saveBech32, saveKey, setLimits, validateAgentCoinParams, validateLabel, verifyReceipt, walletExists, writeLimitsFile };
1253
+ export { AGENT_CAPITAL_PACKAGE_ID, 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, type AgentCoinModule, type AgentCoinParams, type ApiModel, type AppenderContext, BalanceResponse, type BuildAddLeafParams, type BuildRevokeLeafParams, CAPITAL_REGISTRY_ID, CAPITAL_REGISTRY_VERSION, CETUS_CLMM_PACKAGE_ID, CETUS_GLOBAL_CONFIG_ID, CETUS_POOLS_ID, CETUS_POSITION_TYPE, type ChatMessage, type ChatParams, type ChatResult, type ChatUsage, type CheckStatus, type ComposeTxOptions, type ComposeTxResult, DEFAULT_API_BASE, type DailySpend, DepositInfo, InvalidAddressError, type LabelValidationResult, type LimitAssertInput, LimitEnforcer, LimitExceededError, type LimitKind, type LimitOperation, type LimitsConfig, type LimitsFile, MIN_LP_USDC, type NormalizedAddress, OverlayFeeConfig, PayOptions, PayResult, PaymentRequest, type PublishAgentCoinArgs, type PublishAgentCoinResult, SPONSORED_PYTH_DEPENDENT_PROVIDERS, SUINS_NAME_REGEX, SUI_ADDRESS_REGEX, SUI_ADDRESS_STRICT_REGEX, SYMBOL_BLOCKLIST, SendResult, type SendTransferInput, SendableAsset, type StepPreview, SuinsNotRegisteredError, type SuinsParent, SuinsRpcError, SupportedAsset, type SwapExecuteInput, SwapQuoteResult, SwapResult, SwapRouteResult, T2000, T2000Error, T2000Options, type TokenizeArgs, TransactionRecord, TransactionSigner, type TrustMode, USDC_COIN_METADATA_ID, type UpstreamClaim, type VerifyAnchor, type VerifyCheck, type VerifyOptions, type VerifyResult, type VerifyUpstream, WRITE_APPENDER_REGISTRY, type WriteStep, type WriteToolName, ZkLoginProof, approxUsdValue, assertLimitConfig, buildAddLeafTx, buildAgentCoinModule, buildPublishAgentCoinTx, buildRevokeLeafTx, buildTokenizeTx, chatCompletion, chatCompletionStream, clearLimits, composeTx, dailySpentToday, deriveAllowedAddressesFromPtb, displayHandle, exportPrivateKey, fullHandle, generateKeypair, getAddress, getLimits, getSponsoredSwapProviders, getSwapQuote, hasLimits, keypairFromPrivateKey, listModels, loadKey, looksLikeSuiNs, normalizeAddressInput, queryBalance, readLimitsFile, recordDailySpend, resolveAddressToSuinsViaRpc, resolveSuinsViaRpc, saveBech32, saveKey, setLimits, validateAgentCoinParams, validateLabel, verifyReceipt, walletExists, writeLimitsFile };
package/dist/index.js CHANGED
@@ -3886,6 +3886,7 @@ init_preflight();
3886
3886
  // src/capital/launch.ts
3887
3887
  init_errors();
3888
3888
  init_token_registry();
3889
+ init_coinSelection();
3889
3890
 
3890
3891
  // src/protocols/cetus-clmm.ts
3891
3892
  var CETUS_CLMM_PACKAGE_ID = process.env.CETUS_CLMM_PACKAGE_ID ?? "0x1eabed72c53feb3805120a081dc15963c204dc8d091542592abaf7a35689b2fb";
@@ -4104,7 +4105,7 @@ function assertDeployed() {
4104
4105
  );
4105
4106
  }
4106
4107
  }
4107
- var MIN_LP_SUI = 1000000000n;
4108
+ var MIN_LP_USDC = 5000000n;
4108
4109
  var REGISTRY_MODULE = "registry";
4109
4110
  var LP_LOCK_MODULE = "lp_lock";
4110
4111
  async function buildPublishAgentCoinTx(args) {
@@ -4130,8 +4131,8 @@ async function buildPublishAgentCoinTx(args) {
4130
4131
  });
4131
4132
  return { tx, moduleName: mod.moduleName, otw: mod.otw };
4132
4133
  }
4133
- var SUI_COIN_METADATA_ID = "0x9258181f5ceac8dbffb7030890243caed69a9599d2886d957a9cb7656af3bdb3";
4134
- function buildTokenizeTx(args) {
4134
+ var USDC_COIN_METADATA_ID = "0x75cfbbf8c962d542e99a1d15731e6069f60a00db895407785b15d14f606f2b4a";
4135
+ async function buildTokenizeTx(args) {
4135
4136
  assertDeployed();
4136
4137
  if (!isValidSuiAddress(args.agent)) {
4137
4138
  throw new T2000Error("INVALID_ADDRESS", `bad agent: ${args.agent}`);
@@ -4139,10 +4140,10 @@ function buildTokenizeTx(args) {
4139
4140
  if (!isValidSuiAddress(args.launcher)) {
4140
4141
  throw new T2000Error("INVALID_ADDRESS", `bad launcher: ${args.launcher}`);
4141
4142
  }
4142
- if (args.lpSuiAmount < MIN_LP_SUI) {
4143
+ if (args.lpUsdcAmount < MIN_LP_USDC) {
4143
4144
  throw new T2000Error(
4144
4145
  "INVALID_AMOUNT",
4145
- `lpSuiAmount ${args.lpSuiAmount} < minimum ${MIN_LP_SUI} MIST (1 SUI)`
4146
+ `lpUsdcAmount ${args.lpUsdcAmount} < minimum ${MIN_LP_USDC} raw (5 USDC)`
4146
4147
  );
4147
4148
  }
4148
4149
  const tx = new Transaction();
@@ -4166,18 +4167,25 @@ function buildTokenizeTx(args) {
4166
4167
  const [lpCoin] = tx.splitCoins(supplyCoin, [
4167
4168
  tx.pure.u64(AGENT_TOKEN_LP_ALLOCATION)
4168
4169
  ]);
4169
- const [lpSui] = tx.splitCoins(tx.gas, [tx.pure.u64(args.lpSuiAmount)]);
4170
- const suiFirst = args.suiFirst ?? false;
4171
- const sqrtPrice = suiFirst ? sqrtPriceX64FromAmounts(args.lpSuiAmount, AGENT_TOKEN_LP_ALLOCATION) : sqrtPriceX64FromAmounts(AGENT_TOKEN_LP_ALLOCATION, args.lpSuiAmount);
4170
+ const { coin: lpUsdc } = await selectAndSplitCoin(
4171
+ tx,
4172
+ args.client,
4173
+ args.launcher,
4174
+ USDC_TYPE,
4175
+ args.lpUsdcAmount
4176
+ );
4177
+ const usdcFirst = args.usdcFirst ?? false;
4178
+ const sqrtPrice = usdcFirst ? sqrtPriceX64FromAmounts(args.lpUsdcAmount, AGENT_TOKEN_LP_ALLOCATION) : sqrtPriceX64FromAmounts(AGENT_TOKEN_LP_ALLOCATION, args.lpUsdcAmount);
4179
+ const usdcMeta = args.usdcMetadataId ?? USDC_COIN_METADATA_ID;
4172
4180
  const poolResult = createPoolV2(tx, {
4173
- coinTypeA: suiFirst ? SUI_TYPE : args.coinType,
4174
- coinTypeB: suiFirst ? args.coinType : SUI_TYPE,
4175
- metadataA: suiFirst ? args.suiMetadataId ?? SUI_COIN_METADATA_ID : args.coinMetadataId,
4176
- metadataB: suiFirst ? args.coinMetadataId : args.suiMetadataId ?? SUI_COIN_METADATA_ID,
4177
- coinA: suiFirst ? lpSui : lpCoin,
4178
- coinB: suiFirst ? lpCoin : lpSui,
4181
+ coinTypeA: usdcFirst ? USDC_TYPE : args.coinType,
4182
+ coinTypeB: usdcFirst ? args.coinType : USDC_TYPE,
4183
+ metadataA: usdcFirst ? usdcMeta : args.coinMetadataId,
4184
+ metadataB: usdcFirst ? args.coinMetadataId : usdcMeta,
4185
+ coinA: usdcFirst ? lpUsdc : lpCoin,
4186
+ coinB: usdcFirst ? lpCoin : lpUsdc,
4179
4187
  sqrtPriceX64: sqrtPrice,
4180
- fixAmountA: !suiFirst,
4188
+ fixAmountA: !usdcFirst,
4181
4189
  // always fix the AGENT side
4182
4190
  url: args.poolUrl
4183
4191
  });
@@ -4202,13 +4210,13 @@ function buildTokenizeTx(args) {
4202
4210
  tx.object.clock()
4203
4211
  ]
4204
4212
  });
4205
- const agentRefund = suiFirst ? refundB : refundA;
4206
- const suiRefund = suiFirst ? refundA : refundB;
4213
+ const agentRefund = usdcFirst ? refundB : refundA;
4214
+ const usdcRefund = usdcFirst ? refundA : refundB;
4207
4215
  tx.transferObjects([supplyCoin, agentRefund], tx.pure.address(args.agent));
4208
- tx.transferObjects([suiRefund], tx.pure.address(args.launcher));
4216
+ tx.transferObjects([usdcRefund], tx.pure.address(args.launcher));
4209
4217
  return tx;
4210
4218
  }
4211
4219
 
4212
- export { A2A_ESCROW_FEE_CONFIG_ID, A2A_ESCROW_PACKAGE_ID, AGENT_CAPITAL_PACKAGE_ID, 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_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_REVIEW_WINDOW_MS, MIN_LP_SUI, MIST_PER_SUI, NAVX_TYPE, 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_COIN_METADATA_ID, 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, assertLimitConfig, buildAddLeafTx, buildAgentCoinModule, buildCreateJobTx, buildDeliverJobTx, buildPublishAgentCoinTx, buildRefundJobTx, buildRejectJobTx, buildReleaseJobTx, buildRevokeLeafTx, buildSendTx, buildSwapTx, buildTokenizeTx, chatCompletion, chatCompletionStream, checkPositiveAmount, checkSuiAddress, 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, getSponsoredSwapProviders, getSuiClient, getSuiGrpcClient, getSwapQuote, hasLimits, isAllowedAsset, isCetusRouteFresh, isInRegistry, jobActionsFor, keypairFromPrivateKey, listModels, listServices, loadKey, looksLikeSuiNs, mapMoveAbortCode, mapWalletError, mistToSui, normalizeAddressInput, normalizeAsset, normalizeCoinType, parseMppSuiChallenge, parseSuiRpcTx, payWithMpp, preflightCreateJob, preflightFail, preflightPay, preflightSend, preflightSwap, putJobSpec, queryBalance, queryHistory, queryTransaction, rawToStable, rawToUsdc, readLimitsFile, recordDailySpend, refineLendingLabel, resolveAddressToSuinsViaRpc, resolveSuinsViaRpc, resolveSymbol, resolveTokenType, saveBech32, saveKey, selectAndSplitCoin, selectSuiCoin, serializeCetusRoute, setLimits, simulateTransaction, stableToRaw, suiToMist, throwIfSimulationFailed, truncateAddress, usdcToRaw, validateAddress, validateAgentCoinParams, validateLabel, verifyCetusRouteCoinMatch, verifyJobForSeller, verifyReceipt, walletExists, writeLimitsFile };
4220
+ export { A2A_ESCROW_FEE_CONFIG_ID, A2A_ESCROW_PACKAGE_ID, AGENT_CAPITAL_PACKAGE_ID, 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_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_REVIEW_WINDOW_MS, MIN_LP_USDC, MIST_PER_SUI, NAVX_TYPE, 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_COIN_METADATA_ID, USDC_DECIMALS, USDC_TYPE, USDE_TYPE, USDSUI_TYPE, USDT_TYPE, WAL_TYPE, WBTC_TYPE, WRITE_APPENDER_REGISTRY, ZkLoginSigner, addSendToTx, addSwapToTx, approxUsdValue, assertAllowedAsset, assertLimitConfig, buildAddLeafTx, buildAgentCoinModule, buildCreateJobTx, buildDeliverJobTx, buildPublishAgentCoinTx, buildRefundJobTx, buildRejectJobTx, buildReleaseJobTx, buildRevokeLeafTx, buildSendTx, buildSwapTx, buildTokenizeTx, chatCompletion, chatCompletionStream, checkPositiveAmount, checkSuiAddress, 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, getSponsoredSwapProviders, getSuiClient, getSuiGrpcClient, getSwapQuote, hasLimits, isAllowedAsset, isCetusRouteFresh, isInRegistry, jobActionsFor, keypairFromPrivateKey, listModels, listServices, loadKey, looksLikeSuiNs, mapMoveAbortCode, mapWalletError, mistToSui, normalizeAddressInput, normalizeAsset, normalizeCoinType, parseMppSuiChallenge, parseSuiRpcTx, payWithMpp, preflightCreateJob, preflightFail, preflightPay, preflightSend, preflightSwap, putJobSpec, queryBalance, queryHistory, queryTransaction, rawToStable, rawToUsdc, readLimitsFile, recordDailySpend, refineLendingLabel, resolveAddressToSuinsViaRpc, resolveSuinsViaRpc, resolveSymbol, resolveTokenType, saveBech32, saveKey, selectAndSplitCoin, selectSuiCoin, serializeCetusRoute, setLimits, simulateTransaction, stableToRaw, suiToMist, throwIfSimulationFailed, truncateAddress, usdcToRaw, validateAddress, validateAgentCoinParams, validateLabel, verifyCetusRouteCoinMatch, verifyJobForSeller, verifyReceipt, walletExists, writeLimitsFile };
4213
4221
  //# sourceMappingURL=index.js.map
4214
4222
  //# sourceMappingURL=index.js.map