@settlemint/sdk-cli 2.5.1-pr59c2ec7c → 2.5.1-pr5eba79d0

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.
Files changed (3) hide show
  1. package/dist/cli.js +63 -34
  2. package/dist/cli.js.map +12 -12
  3. package/package.json +11 -11
package/dist/cli.js CHANGED
@@ -231623,7 +231623,7 @@ function size(value4) {
231623
231623
  var init_size = () => {};
231624
231624
 
231625
231625
  // ../../node_modules/viem/_esm/errors/version.js
231626
- var version5 = "2.32.0";
231626
+ var version5 = "2.33.0";
231627
231627
 
231628
231628
  // ../../node_modules/viem/_esm/errors/base.js
231629
231629
  function walk(err, fn) {
@@ -239020,7 +239020,7 @@ var init_ccip2 = __esm(() => {
239020
239020
 
239021
239021
  // ../../node_modules/viem/_esm/actions/public/call.js
239022
239022
  async function call(client, args) {
239023
- const { account: account_ = client.account, authorizationList, batch = Boolean(client.batch?.multicall), blockNumber, blockTag = "latest", accessList, blobs, blockOverrides, code: code2, data: data_, factory, factoryData, gas, gasPrice, maxFeePerBlobGas, maxFeePerGas, maxPriorityFeePerGas, nonce, to, value: value4, stateOverride, ...rest } = args;
239023
+ const { account: account_ = client.account, authorizationList, batch = Boolean(client.batch?.multicall), blockNumber, blockTag = client.experimental_blockTag ?? "latest", accessList, blobs, blockOverrides, code: code2, data: data_, factory, factoryData, gas, gasPrice, maxFeePerBlobGas, maxFeePerGas, maxPriorityFeePerGas, nonce, to, value: value4, stateOverride, ...rest } = args;
239024
239024
  const account = account_ ? parseAccount(account_) : undefined;
239025
239025
  if (code2 && (factory || factoryData))
239026
239026
  throw new BaseError2("Cannot provide both `code` & `factory`/`factoryData` as parameters.");
@@ -239128,7 +239128,7 @@ function shouldPerformMulticall({ request: request2 }) {
239128
239128
  }
239129
239129
  async function scheduleMulticall(client, args) {
239130
239130
  const { batchSize = 1024, wait = 0 } = typeof client.batch?.multicall === "object" ? client.batch.multicall : {};
239131
- const { blockNumber, blockTag = "latest", data, multicallAddress: multicallAddress_, to } = args;
239131
+ const { blockNumber, blockTag = client.experimental_blockTag ?? "latest", data, multicallAddress: multicallAddress_, to } = args;
239132
239132
  let multicallAddress = multicallAddress_;
239133
239133
  if (!multicallAddress) {
239134
239134
  if (!client.chain)
@@ -265083,7 +265083,7 @@ function pruneCurrentEnv(currentEnv, env2) {
265083
265083
  var package_default = {
265084
265084
  name: "@settlemint/sdk-cli",
265085
265085
  description: "Command-line interface for SettleMint SDK, providing development tools and project management capabilities",
265086
- version: "2.5.1-pr59c2ec7c",
265086
+ version: "2.5.1-pr5eba79d0",
265087
265087
  type: "module",
265088
265088
  private: false,
265089
265089
  license: "FSL-1.1-MIT",
@@ -265130,15 +265130,15 @@ var package_default = {
265130
265130
  devDependencies: {
265131
265131
  "@commander-js/extra-typings": "14.0.0",
265132
265132
  commander: "14.0.0",
265133
- "@inquirer/confirm": "5.1.13",
265134
- "@inquirer/input": "4.2.0",
265135
- "@inquirer/password": "4.0.16",
265136
- "@inquirer/select": "4.2.4",
265137
- "@settlemint/sdk-hasura": "2.5.1-pr59c2ec7c",
265138
- "@settlemint/sdk-js": "2.5.1-pr59c2ec7c",
265139
- "@settlemint/sdk-utils": "2.5.1-pr59c2ec7c",
265140
- "@settlemint/sdk-viem": "2.5.1-pr59c2ec7c",
265141
- "@types/node": "24.0.14",
265133
+ "@inquirer/confirm": "5.1.14",
265134
+ "@inquirer/input": "4.2.1",
265135
+ "@inquirer/password": "4.0.17",
265136
+ "@inquirer/select": "4.3.0",
265137
+ "@settlemint/sdk-hasura": "2.5.1-pr5eba79d0",
265138
+ "@settlemint/sdk-js": "2.5.1-pr5eba79d0",
265139
+ "@settlemint/sdk-utils": "2.5.1-pr5eba79d0",
265140
+ "@settlemint/sdk-viem": "2.5.1-pr5eba79d0",
265141
+ "@types/node": "24.0.15",
265142
265142
  "@types/semver": "7.7.0",
265143
265143
  "@types/which": "3.0.4",
265144
265144
  "get-tsconfig": "4.10.1",
@@ -265146,7 +265146,7 @@ var package_default = {
265146
265146
  "is-in-ci": "1.0.0",
265147
265147
  semver: "7.7.2",
265148
265148
  slugify: "1.6.6",
265149
- viem: "2.32.0",
265149
+ viem: "2.33.0",
265150
265150
  which: "5.0.0",
265151
265151
  yaml: "2.8.0",
265152
265152
  yoctocolors: "2.1.1"
@@ -303428,7 +303428,14 @@ var esm_default3 = createPrompt((config4, done) => {
303428
303428
  setActive(next);
303429
303429
  }
303430
303430
  } else if (isNumberKey(key2) && !Number.isNaN(Number(rl.line))) {
303431
- const position = Number(rl.line) - 1;
303431
+ const selectedIndex = Number(rl.line) - 1;
303432
+ let selectableIndex = -1;
303433
+ const position = items.findIndex((item2) => {
303434
+ if (Separator.isSeparator(item2))
303435
+ return false;
303436
+ selectableIndex++;
303437
+ return selectableIndex === selectedIndex;
303438
+ });
303432
303439
  const item = items[position];
303433
303440
  if (item != null && isSelectable(item)) {
303434
303441
  setActive(position);
@@ -304346,8 +304353,7 @@ function formatBlock(block) {
304346
304353
  }
304347
304354
 
304348
304355
  // ../../node_modules/viem/_esm/actions/public/getBlock.js
304349
- async function getBlock(client, { blockHash, blockNumber, blockTag: blockTag_, includeTransactions: includeTransactions_ } = {}) {
304350
- const blockTag = blockTag_ ?? "latest";
304356
+ async function getBlock(client, { blockHash, blockNumber, blockTag = client.experimental_blockTag ?? "latest", includeTransactions: includeTransactions_ } = {}) {
304351
304357
  const includeTransactions = includeTransactions_ ?? false;
304352
304358
  const blockNumberHex = blockNumber !== undefined ? numberToHex(blockNumber) : undefined;
304353
304359
  let block = null;
@@ -304794,7 +304800,7 @@ async function prepareTransactionRequest(client, args) {
304794
304800
 
304795
304801
  // ../../node_modules/viem/_esm/actions/public/getBalance.js
304796
304802
  init_toHex();
304797
- async function getBalance(client, { address, blockNumber, blockTag = "latest" }) {
304803
+ async function getBalance(client, { address, blockNumber, blockTag = client.experimental_blockTag ?? "latest" }) {
304798
304804
  const blockNumberHex = typeof blockNumber === "bigint" ? numberToHex(blockNumber) : undefined;
304799
304805
  const balance = await client.request({
304800
304806
  method: "eth_getBalance",
@@ -304812,7 +304818,11 @@ async function estimateGas(client, args) {
304812
304818
  const { block: block2, request: request3, rpcStateOverride: rpcStateOverride2 } = parameters;
304813
304819
  return client.request({
304814
304820
  method: "eth_estimateGas",
304815
- params: rpcStateOverride2 ? [request3, block2 ?? "latest", rpcStateOverride2] : block2 ? [request3, block2] : [request3]
304821
+ params: rpcStateOverride2 ? [
304822
+ request3,
304823
+ block2 ?? client.experimental_blockTag ?? "latest",
304824
+ rpcStateOverride2
304825
+ ] : block2 ? [request3, block2] : [request3]
304816
304826
  });
304817
304827
  };
304818
304828
  const { accessList, authorizationList, blobs, blobVersionedHashes, blockNumber, blockTag, data, gas, gasPrice, maxFeePerBlobGas, maxFeePerGas, maxPriorityFeePerGas, nonce, value: value4, stateOverride, ...rest } = await prepareTransactionRequest(client, {
@@ -305626,6 +305636,7 @@ function uid(length = 11) {
305626
305636
  // ../../node_modules/viem/_esm/clients/createClient.js
305627
305637
  function createClient(parameters) {
305628
305638
  const { batch, chain, ccipRead, key: key2 = "base", name: name3 = "Base Client", type: type4 = "base" } = parameters;
305639
+ const experimental_blockTag = parameters.experimental_blockTag ?? (typeof chain?.experimental_preconfirmationTime === "number" ? "pending" : undefined);
305629
305640
  const blockTime = chain?.blockTime ?? 12000;
305630
305641
  const defaultPollingInterval = Math.min(Math.max(Math.floor(blockTime / 2), 500), 4000);
305631
305642
  const pollingInterval = parameters.pollingInterval ?? defaultPollingInterval;
@@ -305648,7 +305659,8 @@ function createClient(parameters) {
305648
305659
  request: request2,
305649
305660
  transport,
305650
305661
  type: type4,
305651
- uid: uid()
305662
+ uid: uid(),
305663
+ ...experimental_blockTag ? { experimental_blockTag } : {}
305652
305664
  };
305653
305665
  function extend4(base2) {
305654
305666
  return (extendFn) => {
@@ -307391,7 +307403,7 @@ init_transactionRequest();
307391
307403
  init_stateOverride2();
307392
307404
  init_assertRequest();
307393
307405
  async function simulateBlocks(client, parameters) {
307394
- const { blockNumber, blockTag = "latest", blocks, returnFullTransactions, traceTransfers, validation } = parameters;
307406
+ const { blockNumber, blockTag = client.experimental_blockTag ?? "latest", blocks, returnFullTransactions, traceTransfers, validation } = parameters;
307395
307407
  try {
307396
307408
  const blockStateCalls = [];
307397
307409
  for (const block2 of blocks) {
@@ -308760,16 +308772,24 @@ function watchBlockNumber(client, { emitOnBegin = false, emitMissed = false, onB
308760
308772
  }
308761
308773
 
308762
308774
  // ../../node_modules/viem/_esm/actions/public/waitForTransactionReceipt.js
308763
- async function waitForTransactionReceipt(client, {
308764
- confirmations = 1,
308765
- hash: hash2,
308766
- onReplaced,
308767
- pollingInterval = client.pollingInterval,
308768
- retryCount = 6,
308769
- retryDelay = ({ count }) => ~~(1 << count) * 200,
308770
- timeout = 180000
308771
- }) {
308775
+ async function waitForTransactionReceipt(client, parameters) {
308776
+ const {
308777
+ checkReplacement = true,
308778
+ confirmations = 1,
308779
+ hash: hash2,
308780
+ onReplaced,
308781
+ retryCount = 6,
308782
+ retryDelay = ({ count }) => ~~(1 << count) * 200,
308783
+ timeout = 180000
308784
+ } = parameters;
308772
308785
  const observerId = stringify3(["waitForTransactionReceipt", client.uid, hash2]);
308786
+ const pollingInterval = (() => {
308787
+ if (parameters.pollingInterval)
308788
+ return parameters.pollingInterval;
308789
+ if (client.chain?.experimental_preconfirmationTime)
308790
+ return client.chain.experimental_preconfirmationTime;
308791
+ return client.pollingInterval;
308792
+ })();
308773
308793
  let transaction;
308774
308794
  let replacedTransaction;
308775
308795
  let receipt;
@@ -308782,7 +308802,16 @@ async function waitForTransactionReceipt(client, {
308782
308802
  _unobserve();
308783
308803
  reject(new WaitForTransactionReceiptTimeoutError({ hash: hash2 }));
308784
308804
  }, timeout) : undefined;
308785
- _unobserve = observe(observerId, { onReplaced, resolve: resolve6, reject }, (emit) => {
308805
+ _unobserve = observe(observerId, { onReplaced, resolve: resolve6, reject }, async (emit) => {
308806
+ receipt = await getAction(client, getTransactionReceipt, "getTransactionReceipt")({ hash: hash2 }).catch(() => {
308807
+ return;
308808
+ });
308809
+ if (receipt && confirmations <= 1) {
308810
+ clearTimeout(timer);
308811
+ emit.resolve(receipt);
308812
+ _unobserve();
308813
+ return;
308814
+ }
308786
308815
  _unwatch = getAction(client, watchBlockNumber, "watchBlockNumber")({
308787
308816
  emitMissed: true,
308788
308817
  emitOnBegin: true,
@@ -308805,7 +308834,7 @@ async function waitForTransactionReceipt(client, {
308805
308834
  done(() => emit.resolve(receipt));
308806
308835
  return;
308807
308836
  }
308808
- if (!transaction) {
308837
+ if (checkReplacement && !transaction) {
308809
308838
  retrying = true;
308810
308839
  await withRetry(async () => {
308811
308840
  transaction = await getAction(client, getTransaction, "getTransaction")({ hash: hash2 });
@@ -308875,7 +308904,7 @@ async function waitForTransactionReceipt(client, {
308875
308904
  return promise4;
308876
308905
  }
308877
308906
  // ../../node_modules/viem/_esm/actions/public/watchBlocks.js
308878
- function watchBlocks(client, { blockTag = "latest", emitMissed = false, emitOnBegin = false, onBlock, onError, includeTransactions: includeTransactions_, poll: poll_, pollingInterval = client.pollingInterval }) {
308907
+ function watchBlocks(client, { blockTag = client.experimental_blockTag ?? "latest", emitMissed = false, emitOnBegin = false, onBlock, onError, includeTransactions: includeTransactions_, poll: poll_, pollingInterval = client.pollingInterval }) {
308879
308908
  const enablePolling = (() => {
308880
308909
  if (typeof poll_ !== "undefined")
308881
308910
  return poll_;
@@ -330929,4 +330958,4 @@ async function sdkCliCommand(argv = process.argv) {
330929
330958
  // src/cli.ts
330930
330959
  sdkCliCommand();
330931
330960
 
330932
- //# debugId=9FCFC650C3ED596364756E2164756E21
330961
+ //# debugId=31BAFBB4F29982D764756E2164756E21