naracli 1.0.88 → 1.0.90

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/README.md CHANGED
@@ -76,7 +76,12 @@ zkid withdraw <name> [--recipient <addr>] Withdraw deposit
76
76
  bridge transfer <token> <amount> --from <chain> Bridge tokens between Solana and Nara
77
77
  bridge status <tx-or-message-id> --from <chain> Check bridge transfer delivery status
78
78
  bridge info Show bridgeable token balances on both chains
79
- bridge tokens List supported bridge tokens
79
+ bridge tokens List supported bridge tokens (shows min amount + min fee per token)
80
+ dex pools [token-mint] Find Meteora pools containing a token (default: NARA)
81
+ dex smart-quote <input> <output> <amount> Best-route quote via smart router
82
+ dex smart-swap <input> <output> <amount> [--slippage] Execute best-route swap via smart router
83
+ dex quote <pool> <input-mint> <amount> [--slippage] Quote on a specific pool (auto-detects type)
84
+ dex swap <pool> <input-mint> <amount> [--slippage] Swap on a specific Meteora pool
80
85
  guide Show the full NARA usage guide
81
86
  activity Show current community activities
82
87
  config get Show current config
@@ -86,6 +91,8 @@ config reset [key] Reset config to default
86
91
 
87
92
  Most agent commands default to your saved agent ID (from `agent register` / `agent myid`). Use `--agent-id <id>` to override.
88
93
 
94
+ For `dex` commands, token symbols `NARA`, `USDC`, `USDT`, `SOL` can be used instead of mint addresses. `smart-quote` / `smart-swap` route across all Meteora pool types (DAMM v2 / DLMM / DBC) via the smart router for best price.
95
+
89
96
  ## Global Options
90
97
 
91
98
  | Option | Description |
@@ -66721,10 +66721,10 @@ var require_dist3 = __commonJS({
66721
66721
  }
66722
66722
  });
66723
66723
 
66724
- // node_modules/.pnpm/nara-sdk@1.0.78_bufferutil@4.1.0_fastestsmallesttextencoderdecoder@1.0.22_typescript@5.9.3_utf-8-validate@6.0.6/node_modules/nara-sdk/src/constants.ts
66724
+ // node_modules/.pnpm/nara-sdk@1.0.83_bufferutil@4.1.0_fastestsmallesttextencoderdecoder@1.0.22_typescript@5.9.3_utf-8-validate@6.0.6/node_modules/nara-sdk/src/constants.ts
66725
66725
  var DEFAULT_RPC_URL, DEFAULT_QUEST_RELAY_URL, DEFAULT_QUEST_PROGRAM_ID, DEFAULT_SKILLS_PROGRAM_ID, DEFAULT_ZKID_PROGRAM_ID, DEFAULT_AGENT_REGISTRY_PROGRAM_ID, DEFAULT_ALT_ADDRESS, DEFAULT_BRIDGE_FEE_BPS, BRIDGE_FEE_BPS_DENOMINATOR, DEFAULT_BRIDGE_FEE_RECIPIENT_SOLANA, DEFAULT_BRIDGE_FEE_RECIPIENT_NARA;
66726
66726
  var init_constants2 = __esm({
66727
- "node_modules/.pnpm/nara-sdk@1.0.78_bufferutil@4.1.0_fastestsmallesttextencoderdecoder@1.0.22_typescript@5.9.3_utf-8-validate@6.0.6/node_modules/nara-sdk/src/constants.ts"() {
66727
+ "node_modules/.pnpm/nara-sdk@1.0.83_bufferutil@4.1.0_fastestsmallesttextencoderdecoder@1.0.22_typescript@5.9.3_utf-8-validate@6.0.6/node_modules/nara-sdk/src/constants.ts"() {
66728
66728
  DEFAULT_RPC_URL = process.env.RPC_URL || "https://mainnet-api.nara.build/";
66729
66729
  DEFAULT_QUEST_RELAY_URL = process.env.QUEST_RELAY_URL || "https://quest-api.nara.build/";
66730
66730
  DEFAULT_QUEST_PROGRAM_ID = process.env.QUEST_PROGRAM_ID || "Quest11111111111111111111111111111111111111";
@@ -66739,7 +66739,7 @@ var init_constants2 = __esm({
66739
66739
  }
66740
66740
  });
66741
66741
 
66742
- // node_modules/.pnpm/nara-sdk@1.0.78_bufferutil@4.1.0_fastestsmallesttextencoderdecoder@1.0.22_typescript@5.9.3_utf-8-validate@6.0.6/node_modules/nara-sdk/src/tx.ts
66742
+ // node_modules/.pnpm/nara-sdk@1.0.83_bufferutil@4.1.0_fastestsmallesttextencoderdecoder@1.0.22_typescript@5.9.3_utf-8-validate@6.0.6/node_modules/nara-sdk/src/tx.ts
66743
66743
  function getAltAddress() {
66744
66744
  if (_overrideAltAddresses !== null) return _overrideAltAddresses;
66745
66745
  if (!DEFAULT_ALT_ADDRESS) return [];
@@ -66837,16 +66837,12 @@ async function sendTx(connection, payer, instructions, signers, opts) {
66837
66837
  skipPreflight: opts?.skipPreflight ?? _globalSkipPreflight ?? false
66838
66838
  });
66839
66839
  }
66840
- const startTime = Date.now();
66841
66840
  const TIMEOUT_MS = 2e4;
66842
- const POLL_INTERVAL_MS = 1e3;
66841
+ const POLL_INTERVAL_MS = 2e3;
66842
+ const INITIAL_DELAY_MS = 2e3;
66843
+ await new Promise((r) => setTimeout(r, INITIAL_DELAY_MS));
66844
+ const startTime = Date.now();
66843
66845
  while (Date.now() - startTime < TIMEOUT_MS) {
66844
- const currentBlockHeight = await connection.getBlockHeight("confirmed");
66845
- if (currentBlockHeight > lastValidBlockHeight) {
66846
- throw new Error(
66847
- `Transaction ${signature} expired: block height exceeded`
66848
- );
66849
- }
66850
66846
  const statusResult = await connection.getSignatureStatuses([signature]);
66851
66847
  const status = statusResult?.value?.[0];
66852
66848
  if (status) {
@@ -66865,7 +66861,7 @@ async function sendTx(connection, payer, instructions, signers, opts) {
66865
66861
  }
66866
66862
  var import_web394, _cachedAlts, _cachedAltKey, _overrideAltAddresses, _globalSkipPreflight;
66867
66863
  var init_tx = __esm({
66868
- "node_modules/.pnpm/nara-sdk@1.0.78_bufferutil@4.1.0_fastestsmallesttextencoderdecoder@1.0.22_typescript@5.9.3_utf-8-validate@6.0.6/node_modules/nara-sdk/src/tx.ts"() {
66864
+ "node_modules/.pnpm/nara-sdk@1.0.83_bufferutil@4.1.0_fastestsmallesttextencoderdecoder@1.0.22_typescript@5.9.3_utf-8-validate@6.0.6/node_modules/nara-sdk/src/tx.ts"() {
66869
66865
  import_web394 = __toESM(require_index_cjs(), 1);
66870
66866
  init_constants2();
66871
66867
  _cachedAlts = [];
@@ -83120,10 +83116,10 @@ var require_cjs2 = __commonJS({
83120
83116
  }
83121
83117
  });
83122
83118
 
83123
- // node_modules/.pnpm/nara-sdk@1.0.78_bufferutil@4.1.0_fastestsmallesttextencoderdecoder@1.0.22_typescript@5.9.3_utf-8-validate@6.0.6/node_modules/nara-sdk/src/idls/nara_quest.json
83119
+ // node_modules/.pnpm/nara-sdk@1.0.83_bufferutil@4.1.0_fastestsmallesttextencoderdecoder@1.0.22_typescript@5.9.3_utf-8-validate@6.0.6/node_modules/nara-sdk/src/idls/nara_quest.json
83124
83120
  var nara_quest_default;
83125
83121
  var init_nara_quest = __esm({
83126
- "node_modules/.pnpm/nara-sdk@1.0.78_bufferutil@4.1.0_fastestsmallesttextencoderdecoder@1.0.22_typescript@5.9.3_utf-8-validate@6.0.6/node_modules/nara-sdk/src/idls/nara_quest.json"() {
83122
+ "node_modules/.pnpm/nara-sdk@1.0.83_bufferutil@4.1.0_fastestsmallesttextencoderdecoder@1.0.22_typescript@5.9.3_utf-8-validate@6.0.6/node_modules/nara-sdk/src/idls/nara_quest.json"() {
83127
83123
  nara_quest_default = {
83128
83124
  address: "Quest11111111111111111111111111111111111111",
83129
83125
  metadata: {
@@ -85277,10 +85273,10 @@ var init_nara_quest = __esm({
85277
85273
  }
85278
85274
  });
85279
85275
 
85280
- // node_modules/.pnpm/nara-sdk@1.0.78_bufferutil@4.1.0_fastestsmallesttextencoderdecoder@1.0.22_typescript@5.9.3_utf-8-validate@6.0.6/node_modules/nara-sdk/src/idls/nara_agent_registry.json
85276
+ // node_modules/.pnpm/nara-sdk@1.0.83_bufferutil@4.1.0_fastestsmallesttextencoderdecoder@1.0.22_typescript@5.9.3_utf-8-validate@6.0.6/node_modules/nara-sdk/src/idls/nara_agent_registry.json
85281
85277
  var nara_agent_registry_default;
85282
85278
  var init_nara_agent_registry = __esm({
85283
- "node_modules/.pnpm/nara-sdk@1.0.78_bufferutil@4.1.0_fastestsmallesttextencoderdecoder@1.0.22_typescript@5.9.3_utf-8-validate@6.0.6/node_modules/nara-sdk/src/idls/nara_agent_registry.json"() {
85279
+ "node_modules/.pnpm/nara-sdk@1.0.83_bufferutil@4.1.0_fastestsmallesttextencoderdecoder@1.0.22_typescript@5.9.3_utf-8-validate@6.0.6/node_modules/nara-sdk/src/idls/nara_agent_registry.json"() {
85284
85280
  nara_agent_registry_default = {
85285
85281
  address: "AgentRegistry111111111111111111111111111111",
85286
85282
  metadata: {
@@ -87790,6 +87786,129 @@ var init_nara_agent_registry = __esm({
87790
87786
  }
87791
87787
  ]
87792
87788
  },
87789
+ {
87790
+ name: "reject_twitter_with_reason",
87791
+ discriminator: [
87792
+ 3,
87793
+ 212,
87794
+ 79,
87795
+ 37,
87796
+ 41,
87797
+ 111,
87798
+ 209,
87799
+ 83
87800
+ ],
87801
+ accounts: [
87802
+ {
87803
+ name: "verifier",
87804
+ writable: true,
87805
+ signer: true
87806
+ },
87807
+ {
87808
+ name: "config",
87809
+ pda: {
87810
+ seeds: [
87811
+ {
87812
+ kind: "const",
87813
+ value: [
87814
+ 99,
87815
+ 111,
87816
+ 110,
87817
+ 102,
87818
+ 105,
87819
+ 103
87820
+ ]
87821
+ }
87822
+ ]
87823
+ }
87824
+ },
87825
+ {
87826
+ name: "agent",
87827
+ pda: {
87828
+ seeds: [
87829
+ {
87830
+ kind: "const",
87831
+ value: [
87832
+ 97,
87833
+ 103,
87834
+ 101,
87835
+ 110,
87836
+ 116
87837
+ ]
87838
+ },
87839
+ {
87840
+ kind: "arg",
87841
+ path: "agent_id"
87842
+ }
87843
+ ]
87844
+ }
87845
+ },
87846
+ {
87847
+ name: "twitter",
87848
+ writable: true,
87849
+ pda: {
87850
+ seeds: [
87851
+ {
87852
+ kind: "const",
87853
+ value: [
87854
+ 116,
87855
+ 119,
87856
+ 105,
87857
+ 116,
87858
+ 116,
87859
+ 101,
87860
+ 114
87861
+ ]
87862
+ },
87863
+ {
87864
+ kind: "account",
87865
+ path: "agent"
87866
+ }
87867
+ ]
87868
+ }
87869
+ },
87870
+ {
87871
+ name: "twitter_queue",
87872
+ writable: true,
87873
+ pda: {
87874
+ seeds: [
87875
+ {
87876
+ kind: "const",
87877
+ value: [
87878
+ 116,
87879
+ 119,
87880
+ 105,
87881
+ 116,
87882
+ 116,
87883
+ 101,
87884
+ 114,
87885
+ 95,
87886
+ 113,
87887
+ 117,
87888
+ 101,
87889
+ 117,
87890
+ 101
87891
+ ]
87892
+ }
87893
+ ]
87894
+ }
87895
+ },
87896
+ {
87897
+ name: "system_program",
87898
+ address: "11111111111111111111111111111111"
87899
+ }
87900
+ ],
87901
+ args: [
87902
+ {
87903
+ name: "agent_id",
87904
+ type: "string"
87905
+ },
87906
+ {
87907
+ name: "reason",
87908
+ type: "u64"
87909
+ }
87910
+ ]
87911
+ },
87793
87912
  {
87794
87913
  name: "set_bio",
87795
87914
  discriminator: [
@@ -90216,12 +90335,25 @@ var init_nara_agent_registry = __esm({
90216
90335
  ]
90217
90336
  }
90218
90337
  },
90338
+ {
90339
+ name: "rejection_reason",
90340
+ type: "u64"
90341
+ },
90219
90342
  {
90220
90343
  name: "_reserved",
90221
90344
  type: {
90222
90345
  array: [
90223
90346
  "u8",
90224
- 128
90347
+ 96
90348
+ ]
90349
+ }
90350
+ },
90351
+ {
90352
+ name: "_reserved_a",
90353
+ type: {
90354
+ array: [
90355
+ "u8",
90356
+ 24
90225
90357
  ]
90226
90358
  }
90227
90359
  },
@@ -90661,7 +90793,7 @@ var init_nara_agent_registry = __esm({
90661
90793
  }
90662
90794
  });
90663
90795
 
90664
- // node_modules/.pnpm/nara-sdk@1.0.78_bufferutil@4.1.0_fastestsmallesttextencoderdecoder@1.0.22_typescript@5.9.3_utf-8-validate@6.0.6/node_modules/nara-sdk/src/agent_registry.ts
90796
+ // node_modules/.pnpm/nara-sdk@1.0.83_bufferutil@4.1.0_fastestsmallesttextencoderdecoder@1.0.22_typescript@5.9.3_utf-8-validate@6.0.6/node_modules/nara-sdk/src/agent_registry.ts
90665
90797
  var agent_registry_exports = {};
90666
90798
  __export(agent_registry_exports, {
90667
90799
  approveRejectedTwitter: () => approveRejectedTwitter,
@@ -91568,7 +91700,7 @@ async function rejectTweet(connection, wallet, agentId, options) {
91568
91700
  }
91569
91701
  var import_web395, anchor, import_anchor, import_bn, DEFAULT_CHUNK_SIZE, BUFFER_HEADER_SIZE, MEMORY_HEADER_SIZE, BIO_META_HEADER_SIZE;
91570
91702
  var init_agent_registry = __esm({
91571
- "node_modules/.pnpm/nara-sdk@1.0.78_bufferutil@4.1.0_fastestsmallesttextencoderdecoder@1.0.22_typescript@5.9.3_utf-8-validate@6.0.6/node_modules/nara-sdk/src/agent_registry.ts"() {
91703
+ "node_modules/.pnpm/nara-sdk@1.0.83_bufferutil@4.1.0_fastestsmallesttextencoderdecoder@1.0.22_typescript@5.9.3_utf-8-validate@6.0.6/node_modules/nara-sdk/src/agent_registry.ts"() {
91572
91704
  import_web395 = __toESM(require_index_cjs(), 1);
91573
91705
  anchor = __toESM(require_cjs2(), 1);
91574
91706
  import_anchor = __toESM(require_cjs2(), 1);
@@ -171329,7 +171461,7 @@ var init_main3 = __esm({
171329
171461
  }
171330
171462
  });
171331
171463
 
171332
- // node_modules/.pnpm/nara-sdk@1.0.78_bufferutil@4.1.0_fastestsmallesttextencoderdecoder@1.0.22_typescript@5.9.3_utf-8-validate@6.0.6/node_modules/nara-sdk/src/quest.ts
171464
+ // node_modules/.pnpm/nara-sdk@1.0.83_bufferutil@4.1.0_fastestsmallesttextencoderdecoder@1.0.22_typescript@5.9.3_utf-8-validate@6.0.6/node_modules/nara-sdk/src/quest.ts
171333
171465
  var quest_exports = {};
171334
171466
  __export(quest_exports, {
171335
171467
  adjustFreeStake: () => adjustFreeStake,
@@ -171588,13 +171720,18 @@ async function submitAnswer(connection, wallet, proof, agent = "", model = "", o
171588
171720
  if (options.stake === "auto") {
171589
171721
  const quest = await getQuestInfo(connection, wallet, options);
171590
171722
  const stakeInfo = await getStakeInfo(connection, wallet.publicKey, options);
171591
- const required = quest.effectiveStakeRequirement;
171592
- const current = stakeInfo?.amount ?? 0;
171593
- const deficit = required - current;
171594
- if (deficit > 0) {
171595
- stakeLamports = new import_bn2.default(Math.round(deficit * import_web396.LAMPORTS_PER_SOL));
171596
- } else {
171723
+ const freeCredits = stakeInfo?.freeCredits ?? 0;
171724
+ if (freeCredits > 0) {
171597
171725
  stakeLamports = new import_bn2.default(0);
171726
+ } else {
171727
+ const required = quest.effectiveStakeRequirement;
171728
+ const current = stakeInfo?.amount ?? 0;
171729
+ const deficit = required - current;
171730
+ if (deficit > 0) {
171731
+ stakeLamports = new import_bn2.default(Math.round(deficit * import_web396.LAMPORTS_PER_SOL));
171732
+ } else {
171733
+ stakeLamports = new import_bn2.default(0);
171734
+ }
171598
171735
  }
171599
171736
  } else {
171600
171737
  stakeLamports = new import_bn2.default(Math.round(options.stake * import_web396.LAMPORTS_PER_SOL));
@@ -171847,7 +171984,7 @@ async function setAirdropConfig(connection, wallet, airdropAmount, maxAirdropCou
171847
171984
  }
171848
171985
  var import_web396, anchor2, import_anchor2, import_bn2, import_meta, BN254_FIELD, WSOL_MINT;
171849
171986
  var init_quest = __esm({
171850
- "node_modules/.pnpm/nara-sdk@1.0.78_bufferutil@4.1.0_fastestsmallesttextencoderdecoder@1.0.22_typescript@5.9.3_utf-8-validate@6.0.6/node_modules/nara-sdk/src/quest.ts"() {
171987
+ "node_modules/.pnpm/nara-sdk@1.0.83_bufferutil@4.1.0_fastestsmallesttextencoderdecoder@1.0.22_typescript@5.9.3_utf-8-validate@6.0.6/node_modules/nara-sdk/src/quest.ts"() {
171851
171988
  import_web396 = __toESM(require_index_cjs(), 1);
171852
171989
  init_esm4();
171853
171990
  anchor2 = __toESM(require_cjs2(), 1);
@@ -266493,7 +266630,7 @@ var esm_default = base;
266493
266630
  var ALPHABET = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";
266494
266631
  var esm_default2 = esm_default(ALPHABET);
266495
266632
 
266496
- // node_modules/.pnpm/nara-sdk@1.0.78_bufferutil@4.1.0_fastestsmallesttextencoderdecoder@1.0.22_typescript@5.9.3_utf-8-validate@6.0.6/node_modules/nara-sdk/src/client.ts
266633
+ // node_modules/.pnpm/nara-sdk@1.0.83_bufferutil@4.1.0_fastestsmallesttextencoderdecoder@1.0.22_typescript@5.9.3_utf-8-validate@6.0.6/node_modules/nara-sdk/src/client.ts
266497
266634
  var import_web393 = __toESM(require_index_cjs(), 1);
266498
266635
  var NaraSDK = class {
266499
266636
  connection;
@@ -266508,10 +266645,10 @@ var NaraSDK = class {
266508
266645
  }
266509
266646
  };
266510
266647
 
266511
- // node_modules/.pnpm/nara-sdk@1.0.78_bufferutil@4.1.0_fastestsmallesttextencoderdecoder@1.0.22_typescript@5.9.3_utf-8-validate@6.0.6/node_modules/nara-sdk/index.ts
266648
+ // node_modules/.pnpm/nara-sdk@1.0.83_bufferutil@4.1.0_fastestsmallesttextencoderdecoder@1.0.22_typescript@5.9.3_utf-8-validate@6.0.6/node_modules/nara-sdk/index.ts
266512
266649
  init_constants2();
266513
266650
 
266514
- // node_modules/.pnpm/nara-sdk@1.0.78_bufferutil@4.1.0_fastestsmallesttextencoderdecoder@1.0.22_typescript@5.9.3_utf-8-validate@6.0.6/node_modules/nara-sdk/src/sign.ts
266651
+ // node_modules/.pnpm/nara-sdk@1.0.83_bufferutil@4.1.0_fastestsmallesttextencoderdecoder@1.0.22_typescript@5.9.3_utf-8-validate@6.0.6/node_modules/nara-sdk/src/sign.ts
266515
266652
  var import_tweetnacl = __toESM(require_nacl_fast(), 1);
266516
266653
  function buildSignMessage(params) {
266517
266654
  return Object.keys(params).filter((k2) => k2 !== "sign").sort().map((k2) => `${k2}=${params[k2]}`).join("&");
@@ -266539,17 +266676,17 @@ function signUrl(baseUrl, wallet, params) {
266539
266676
  return url.toString();
266540
266677
  }
266541
266678
 
266542
- // node_modules/.pnpm/nara-sdk@1.0.78_bufferutil@4.1.0_fastestsmallesttextencoderdecoder@1.0.22_typescript@5.9.3_utf-8-validate@6.0.6/node_modules/nara-sdk/index.ts
266679
+ // node_modules/.pnpm/nara-sdk@1.0.83_bufferutil@4.1.0_fastestsmallesttextencoderdecoder@1.0.22_typescript@5.9.3_utf-8-validate@6.0.6/node_modules/nara-sdk/index.ts
266543
266680
  init_tx();
266544
266681
  init_quest();
266545
266682
 
266546
- // node_modules/.pnpm/nara-sdk@1.0.78_bufferutil@4.1.0_fastestsmallesttextencoderdecoder@1.0.22_typescript@5.9.3_utf-8-validate@6.0.6/node_modules/nara-sdk/src/skills.ts
266683
+ // node_modules/.pnpm/nara-sdk@1.0.83_bufferutil@4.1.0_fastestsmallesttextencoderdecoder@1.0.22_typescript@5.9.3_utf-8-validate@6.0.6/node_modules/nara-sdk/src/skills.ts
266547
266684
  var import_web397 = __toESM(require_index_cjs(), 1);
266548
266685
  var anchor3 = __toESM(require_cjs2(), 1);
266549
266686
  var import_anchor3 = __toESM(require_cjs2(), 1);
266550
266687
  init_constants2();
266551
266688
 
266552
- // node_modules/.pnpm/nara-sdk@1.0.78_bufferutil@4.1.0_fastestsmallesttextencoderdecoder@1.0.22_typescript@5.9.3_utf-8-validate@6.0.6/node_modules/nara-sdk/src/idls/nara_skills_hub.json
266689
+ // node_modules/.pnpm/nara-sdk@1.0.83_bufferutil@4.1.0_fastestsmallesttextencoderdecoder@1.0.22_typescript@5.9.3_utf-8-validate@6.0.6/node_modules/nara-sdk/src/idls/nara_skills_hub.json
266553
266690
  var nara_skills_hub_default = {
266554
266691
  address: "SkiLLHub11111111111111111111111111111111111",
266555
266692
  metadata: {
@@ -267947,7 +268084,7 @@ var nara_skills_hub_default = {
267947
268084
  ]
267948
268085
  };
267949
268086
 
267950
- // node_modules/.pnpm/nara-sdk@1.0.78_bufferutil@4.1.0_fastestsmallesttextencoderdecoder@1.0.22_typescript@5.9.3_utf-8-validate@6.0.6/node_modules/nara-sdk/src/skills.ts
268087
+ // node_modules/.pnpm/nara-sdk@1.0.83_bufferutil@4.1.0_fastestsmallesttextencoderdecoder@1.0.22_typescript@5.9.3_utf-8-validate@6.0.6/node_modules/nara-sdk/src/skills.ts
267951
268088
  init_tx();
267952
268089
  var DEFAULT_CHUNK_SIZE2 = 800;
267953
268090
  var BUFFER_HEADER_SIZE2 = 144;
@@ -268177,7 +268314,7 @@ async function uploadSkillContent(connection, wallet, name, content, options) {
268177
268314
  }
268178
268315
  }
268179
268316
 
268180
- // node_modules/.pnpm/nara-sdk@1.0.78_bufferutil@4.1.0_fastestsmallesttextencoderdecoder@1.0.22_typescript@5.9.3_utf-8-validate@6.0.6/node_modules/nara-sdk/src/zkid.ts
268317
+ // node_modules/.pnpm/nara-sdk@1.0.83_bufferutil@4.1.0_fastestsmallesttextencoderdecoder@1.0.22_typescript@5.9.3_utf-8-validate@6.0.6/node_modules/nara-sdk/src/zkid.ts
268181
268318
  var import_web398 = __toESM(require_index_cjs(), 1);
268182
268319
  var anchor4 = __toESM(require_cjs2(), 1);
268183
268320
  var import_anchor4 = __toESM(require_cjs2(), 1);
@@ -268187,7 +268324,7 @@ var import_bn3 = __toESM(require_bn(), 1);
268187
268324
  init_constants2();
268188
268325
  init_tx();
268189
268326
 
268190
- // node_modules/.pnpm/nara-sdk@1.0.78_bufferutil@4.1.0_fastestsmallesttextencoderdecoder@1.0.22_typescript@5.9.3_utf-8-validate@6.0.6/node_modules/nara-sdk/src/idls/nara_zk.json
268327
+ // node_modules/.pnpm/nara-sdk@1.0.83_bufferutil@4.1.0_fastestsmallesttextencoderdecoder@1.0.22_typescript@5.9.3_utf-8-validate@6.0.6/node_modules/nara-sdk/src/idls/nara_zk.json
268191
268328
  var nara_zk_default = {
268192
268329
  address: "ZKidentity111111111111111111111111111111111",
268193
268330
  metadata: {
@@ -269398,7 +269535,7 @@ var nara_zk_default = {
269398
269535
  ]
269399
269536
  };
269400
269537
 
269401
- // node_modules/.pnpm/nara-sdk@1.0.78_bufferutil@4.1.0_fastestsmallesttextencoderdecoder@1.0.22_typescript@5.9.3_utf-8-validate@6.0.6/node_modules/nara-sdk/src/zkid.ts
269538
+ // node_modules/.pnpm/nara-sdk@1.0.83_bufferutil@4.1.0_fastestsmallesttextencoderdecoder@1.0.22_typescript@5.9.3_utf-8-validate@6.0.6/node_modules/nara-sdk/src/zkid.ts
269402
269539
  var import_meta2 = {};
269403
269540
  var BN254_PRIME = 21888242871839275222246405745257275088696311157297823662689037894645226208583n;
269404
269541
  var MERKLE_LEVELS = 64;
@@ -269760,10 +269897,10 @@ async function transferZkIdByCommitment(connection, payer, name, currentIdSecret
269760
269897
  return sendTx(connection, payer, [ix]);
269761
269898
  }
269762
269899
 
269763
- // node_modules/.pnpm/nara-sdk@1.0.78_bufferutil@4.1.0_fastestsmallesttextencoderdecoder@1.0.22_typescript@5.9.3_utf-8-validate@6.0.6/node_modules/nara-sdk/index.ts
269900
+ // node_modules/.pnpm/nara-sdk@1.0.83_bufferutil@4.1.0_fastestsmallesttextencoderdecoder@1.0.22_typescript@5.9.3_utf-8-validate@6.0.6/node_modules/nara-sdk/index.ts
269764
269901
  init_agent_registry();
269765
269902
 
269766
- // node_modules/.pnpm/nara-sdk@1.0.78_bufferutil@4.1.0_fastestsmallesttextencoderdecoder@1.0.22_typescript@5.9.3_utf-8-validate@6.0.6/node_modules/nara-sdk/src/bridge.ts
269903
+ // node_modules/.pnpm/nara-sdk@1.0.83_bufferutil@4.1.0_fastestsmallesttextencoderdecoder@1.0.22_typescript@5.9.3_utf-8-validate@6.0.6/node_modules/nara-sdk/src/bridge.ts
269767
269904
  var import_web399 = __toESM(require_index_cjs(), 1);
269768
269905
  init_esm4();
269769
269906
  init_constants2();
@@ -269794,6 +269931,10 @@ var BRIDGE_TOKENS = {
269794
269931
  USDC: {
269795
269932
  symbol: "USDC",
269796
269933
  decimals: 6,
269934
+ minAmount: 5000000n,
269935
+ // 5 USDC
269936
+ minFee: 500000n,
269937
+ // 0.5 USDC (fee floor)
269797
269938
  solana: {
269798
269939
  warpProgram: new import_web399.PublicKey("4GcZJTa8s9vxtTz97Vj1RrwKMqPkT3DiiJkvUQDwsuZP"),
269799
269940
  mode: "collateral",
@@ -269810,6 +269951,10 @@ var BRIDGE_TOKENS = {
269810
269951
  USDT: {
269811
269952
  symbol: "USDT",
269812
269953
  decimals: 6,
269954
+ minAmount: 5000000n,
269955
+ // 5 USDT
269956
+ minFee: 500000n,
269957
+ // 0.5 USDT (fee floor)
269813
269958
  solana: {
269814
269959
  warpProgram: new import_web399.PublicKey("DCTt9H3pwwU89qC3Z4voYNThZypV68AwhYNzMNBxWXoy"),
269815
269960
  mode: "collateral",
@@ -269826,6 +269971,10 @@ var BRIDGE_TOKENS = {
269826
269971
  SOL: {
269827
269972
  symbol: "SOL",
269828
269973
  decimals: 9,
269974
+ minAmount: 100000000n,
269975
+ // 0.1 SOL
269976
+ minFee: 10000000n,
269977
+ // 0.01 SOL (fee floor)
269829
269978
  solana: {
269830
269979
  warpProgram: new import_web399.PublicKey("46MmAWwKRAt9uvn7m44NXbVq2DCWBQE2r1TDw25nyXrt"),
269831
269980
  mode: "native",
@@ -269929,14 +270078,15 @@ function encodeTransferRemote(destinationDomain, recipient, amount) {
269929
270078
  buf.writeBigUInt64LE(amount, 45);
269930
270079
  return buf;
269931
270080
  }
269932
- function calculateBridgeFee(amount, feeBps) {
270081
+ function calculateBridgeFee(amount, feeBps, minFee = 0n) {
269933
270082
  const bps = feeBps ?? DEFAULT_BRIDGE_FEE_BPS;
269934
270083
  if (bps < 0 || bps > BRIDGE_FEE_BPS_DENOMINATOR) {
269935
270084
  throw new Error(`Invalid feeBps: ${bps}`);
269936
270085
  }
269937
- const feeAmount = amount * BigInt(bps) / BigInt(BRIDGE_FEE_BPS_DENOMINATOR);
270086
+ const pctFee = amount * BigInt(bps) / BigInt(BRIDGE_FEE_BPS_DENOMINATOR);
270087
+ const feeAmount = pctFee > minFee ? pctFee : minFee;
269938
270088
  const bridgeAmount = amount - feeAmount;
269939
- return { feeAmount, bridgeAmount, feeBps: bps };
270089
+ return { feeAmount, bridgeAmount, feeBps: bps, minFee };
269940
270090
  }
269941
270091
  function makeBridgeFeeIxs(params) {
269942
270092
  const { token, fromChain, sender, feeRecipient, feeAmount } = params;
@@ -270070,9 +270220,16 @@ function makeBridgeIxs(params) {
270070
270220
  skipFee
270071
270221
  } = params;
270072
270222
  if (amount <= 0n) throw new Error("amount must be > 0");
270073
- const split = skipFee ? { feeAmount: 0n, bridgeAmount: amount, feeBps: 0 } : calculateBridgeFee(amount, feeBps);
270223
+ const tokenCfg = getToken(token);
270224
+ if (amount < tokenCfg.minAmount) {
270225
+ const min2 = Number(tokenCfg.minAmount) / Math.pow(10, tokenCfg.decimals);
270226
+ throw new Error(
270227
+ `Bridge amount too small: minimum for ${token} is ${min2} (raw ${tokenCfg.minAmount})`
270228
+ );
270229
+ }
270230
+ const split = skipFee ? { feeAmount: 0n, bridgeAmount: amount, feeBps: 0, minFee: 0n } : calculateBridgeFee(amount, feeBps, tokenCfg.minFee);
270074
270231
  if (split.bridgeAmount <= 0n) {
270075
- throw new Error("bridge amount after fee is zero \u2014 increase amount or lower feeBps");
270232
+ throw new Error("bridge amount after fee is zero \u2014 increase amount or lower fee");
270076
270233
  }
270077
270234
  const recipientForFee = feeRecipient ?? getBridgeFeeRecipient(fromChain);
270078
270235
  const feeIxs = makeBridgeFeeIxs({
@@ -270235,7 +270392,7 @@ async function scanValidator(folder, messageId, maxScan) {
270235
270392
  };
270236
270393
  }
270237
270394
 
270238
- // node_modules/.pnpm/nara-sdk@1.0.78_bufferutil@4.1.0_fastestsmallesttextencoderdecoder@1.0.22_typescript@5.9.3_utf-8-validate@6.0.6/node_modules/nara-sdk/src/tx_parser.ts
270395
+ // node_modules/.pnpm/nara-sdk@1.0.83_bufferutil@4.1.0_fastestsmallesttextencoderdecoder@1.0.22_typescript@5.9.3_utf-8-validate@6.0.6/node_modules/nara-sdk/src/tx_parser.ts
270239
270396
  var import_web3100 = __toESM(require_index_cjs(), 1);
270240
270397
  init_esm4();
270241
270398
  init_constants2();
@@ -270359,7 +270516,7 @@ function buildAnchorDiscriminators() {
270359
270516
  }
270360
270517
  var anchorDiscs = buildAnchorDiscriminators();
270361
270518
 
270362
- // node_modules/.pnpm/nara-sdk@1.0.78_bufferutil@4.1.0_fastestsmallesttextencoderdecoder@1.0.22_typescript@5.9.3_utf-8-validate@6.0.6/node_modules/nara-sdk/index.ts
270519
+ // node_modules/.pnpm/nara-sdk@1.0.83_bufferutil@4.1.0_fastestsmallesttextencoderdecoder@1.0.22_typescript@5.9.3_utf-8-validate@6.0.6/node_modules/nara-sdk/index.ts
270363
270520
  var import_web3101 = __toESM(require_index_cjs(), 1);
270364
270521
  var import_bn4 = __toESM(require_bn(), 1);
270365
270522
 
@@ -274910,17 +275067,24 @@ async function handleBridgeStatus(id, options) {
274910
275067
  }
274911
275068
  function handleBridgeTokens(options) {
274912
275069
  const tokens = Object.values(BRIDGE_TOKENS);
275070
+ const toUi = (n, d) => n ? Number(n) / 10 ** d : null;
274913
275071
  if (options.json) {
274914
275072
  formatOutput(tokens.map((t2) => ({
274915
275073
  symbol: t2.symbol,
274916
275074
  decimals: t2.decimals,
275075
+ minAmount: toUi(t2.minAmount, t2.decimals),
275076
+ minFee: toUi(t2.minFee, t2.decimals),
274917
275077
  solanaMint: t2.solana.mint?.toBase58() ?? "native",
274918
275078
  naraMint: t2.nara.mint?.toBase58() ?? "native"
274919
275079
  })), true);
274920
275080
  } else {
274921
275081
  console.log("");
274922
275082
  for (const t2 of tokens) {
274923
- console.log(` ${t2.symbol} (${t2.decimals} decimals)`);
275083
+ const minAmt = toUi(t2.minAmount, t2.decimals);
275084
+ const minFee = toUi(t2.minFee, t2.decimals);
275085
+ const minAmtStr = minAmt !== null ? `${minAmt} ${t2.symbol}` : "\u2014";
275086
+ const minFeeStr = minFee !== null ? `${minFee} ${t2.symbol}` : "\u2014";
275087
+ console.log(` ${t2.symbol} (${t2.decimals} decimals) min: ${minAmtStr} min fee: ${minFeeStr}`);
274924
275088
  console.log(` Solana: ${t2.solana.mint?.toBase58() ?? "native SOL"} (${t2.solana.mode})`);
274925
275089
  console.log(` Nara: ${t2.nara.mint?.toBase58() ?? "native NARA"} (${t2.nara.mode})`);
274926
275090
  }
@@ -275008,7 +275172,7 @@ function registerBridgeCommands(program3) {
275008
275172
  const bridge = program3.command("bridge").description("Cross-chain bridge between Solana and Nara (powered by Hyperlane)").addHelpText("after", `
275009
275173
  1. Solana and Nara use the same wallet address (Ed25519). To bridge from Solana, your wallet must have SOL on Solana mainnet for gas.
275010
275174
  2. Delivery takes ~5-10 minutes (Hyperlane multi-validator signing).
275011
- 3. Bridge fee: 0.5%.
275175
+ 3. Bridge fee: 0.5% of amount, with a per-token minimum fee floor (see "bridge tokens"). Each token also has a minimum bridgeable amount.
275012
275176
 
275013
275177
  Examples:
275014
275178
  npx naracli bridge transfer USDC 10 --from solana # Solana \u2192 Nara
@@ -276734,7 +276898,7 @@ function registerCommands(program3) {
276734
276898
  }
276735
276899
 
276736
276900
  // bin/nara-cli.ts
276737
- var version2 = true ? "1.0.88" : "dev";
276901
+ var version2 = true ? "1.0.90" : "dev";
276738
276902
  var program2 = new Command();
276739
276903
  program2.name("naracli").description("CLI for the Nara chain. Native coin is NARA (not SOL). Mine NARA for free via PoMI quests, manage wallets, register agents, and more. Run 'naracli <command> --help' for details on any command.").version(version2);
276740
276904
  program2.option("-r, --rpc-url <url>", "RPC endpoint (default: https://mainnet-api.nara.build/)").option("-w, --wallet <path>", "Path to wallet keypair JSON file (default: ~/.config/nara/id.json)").option("-j, --json", "Output in JSON format");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "naracli",
3
- "version": "1.0.88",
3
+ "version": "1.0.90",
4
4
  "description": "CLI for the Nara chain (Solana-compatible)",
5
5
  "homepage": "https://nara.build",
6
6
  "repository": {
@@ -55,8 +55,8 @@
55
55
  "typescript": "^5"
56
56
  },
57
57
  "dependencies": {
58
- "@coral-xyz/anchor": "^0.32.1",
59
58
  "@clack/prompts": "^1.0.1",
59
+ "@coral-xyz/anchor": "^0.32.1",
60
60
  "@meteora-ag/cp-amm-sdk": "^1.4.1",
61
61
  "@meteora-ag/dlmm": "^1.9.4",
62
62
  "@meteora-ag/dynamic-bonding-curve-sdk": "^1.5.7",
@@ -67,7 +67,7 @@
67
67
  "bs58": "^6.0.0",
68
68
  "commander": "^12.1.0",
69
69
  "ed25519-hd-key": "^1.3.0",
70
- "nara-sdk": "^1.0.78",
70
+ "nara-sdk": "^1.0.83",
71
71
  "picocolors": "^1.1.1"
72
72
  },
73
73
  "packageManager": "pnpm@10.27.0+sha512.72d699da16b1179c14ba9e64dc71c9a40988cbdc65c264cb0e489db7de917f20dcf4d64d8723625f2969ba52d4b7e2a1170682d9ac2a5dcaeaab732b7e16f04a"
@@ -205,17 +205,24 @@ async function handleBridgeStatus(
205
205
 
206
206
  function handleBridgeTokens(options: GlobalOptions) {
207
207
  const tokens = Object.values(BRIDGE_TOKENS) as any[];
208
+ const toUi = (n: bigint | undefined, d: number) => n ? Number(n) / 10 ** d : null;
208
209
  if (options.json) {
209
210
  formatOutput(tokens.map((t: any) => ({
210
211
  symbol: t.symbol,
211
212
  decimals: t.decimals,
213
+ minAmount: toUi(t.minAmount, t.decimals),
214
+ minFee: toUi(t.minFee, t.decimals),
212
215
  solanaMint: t.solana.mint?.toBase58() ?? "native",
213
216
  naraMint: t.nara.mint?.toBase58() ?? "native",
214
217
  })), true);
215
218
  } else {
216
219
  console.log("");
217
220
  for (const t of tokens) {
218
- console.log(` ${t.symbol} (${t.decimals} decimals)`);
221
+ const minAmt = toUi(t.minAmount, t.decimals);
222
+ const minFee = toUi(t.minFee, t.decimals);
223
+ const minAmtStr = minAmt !== null ? `${minAmt} ${t.symbol}` : "—";
224
+ const minFeeStr = minFee !== null ? `${minFee} ${t.symbol}` : "—";
225
+ console.log(` ${t.symbol} (${t.decimals} decimals) min: ${minAmtStr} min fee: ${minFeeStr}`);
219
226
  console.log(` Solana: ${t.solana.mint?.toBase58() ?? "native SOL"} (${t.solana.mode})`);
220
227
  console.log(` Nara: ${t.nara.mint?.toBase58() ?? "native NARA"} (${t.nara.mode})`);
221
228
  }
@@ -332,7 +339,7 @@ export function registerBridgeCommands(program: Command): void {
332
339
  .addHelpText("after", `
333
340
  1. Solana and Nara use the same wallet address (Ed25519). To bridge from Solana, your wallet must have SOL on Solana mainnet for gas.
334
341
  2. Delivery takes ~5-10 minutes (Hyperlane multi-validator signing).
335
- 3. Bridge fee: 0.5%.
342
+ 3. Bridge fee: 0.5% of amount, with a per-token minimum fee floor (see "bridge tokens"). Each token also has a minimum bridgeable amount.
336
343
 
337
344
  Examples:
338
345
  npx naracli bridge transfer USDC 10 --from solana # Solana → Nara