genlayer-js 0.24.0 → 0.25.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/README.md CHANGED
@@ -152,6 +152,22 @@ console.log(childTxIds);
152
152
  // ["0xabc...", "0xdef..."]
153
153
  ```
154
154
 
155
+ ### Debugging transaction execution
156
+
157
+ Use `debugTraceTransaction` to inspect the full execution trace of a transaction, including return data, errors, and GenVM logs:
158
+
159
+ ```typescript
160
+ const trace = await client.debugTraceTransaction({
161
+ hash: txHash,
162
+ round: 0, // optional, defaults to 0
163
+ });
164
+
165
+ console.log(trace.result_code); // 0=success, 1=user error, 2=VM error
166
+ console.log(trace.return_data); // hex-encoded contract return data
167
+ console.log(trace.stderr); // standard error output
168
+ console.log(trace.genvm_log); // detailed GenVM execution logs
169
+ ```
170
+
155
171
  ### Staking Operations
156
172
 
157
173
  The SDK provides staking functionality for validators and delegators on testnet-bradbury (and testnet-asimov).
@@ -150,6 +150,18 @@ type DecodedCallData = {
150
150
  leaderOnly?: boolean;
151
151
  type: TransactionType;
152
152
  };
153
+ type DebugTraceResult = {
154
+ transaction_id: string;
155
+ result_code: number;
156
+ return_data: string;
157
+ stdout: string;
158
+ stderr: string;
159
+ genvm_log: Record<string, unknown>[];
160
+ storage_proof: string;
161
+ run_time: string;
162
+ eq_outputs: string[];
163
+ stored_at?: string;
164
+ };
153
165
  interface LeaderReceipt {
154
166
  calldata: string;
155
167
  class_name: string;
@@ -2886,4 +2898,4 @@ type GenLayerClient<TGenLayerChain extends GenLayerChain> = Omit<Client<Transpor
2886
2898
  }) => Promise<bigint>;
2887
2899
  } & StakingActions;
2888
2900
 
2889
- export { type ValidatorExitOptions as $, type StakingContract as A, type ValidatorView as B, type CalldataEncodable as C, type DecodedDeployData as D, ExecutionResult as E, type ValidatorIdentity as F, type GenLayerClient as G, type Hash as H, type ValidatorInfo as I, type PendingWithdrawal as J, type BannedValidatorInfo as K, type LeaderReceipt as L, type MethodDescription as M, type Network as N, type StakeInfo as O, type PendingDeposit as P, type EpochData as Q, type EpochInfo as R, STAKING_ABI as S, type TransactionDataElement as T, type StakingTransactionResult as U, VALIDATOR_WALLET_ABI as V, type WithdrawalCommit as W, type ValidatorJoinResult as X, type DelegatorJoinResult as Y, type ValidatorJoinOptions as Z, type ValidatorDepositOptions as _, type DecodedCallData as a, type ValidatorClaimOptions as a0, type ValidatorPrimeOptions as a1, type SetOperatorOptions as a2, type SetIdentityOptions as a3, type DelegatorJoinOptions as a4, type DelegatorExitOptions as a5, type DelegatorClaimOptions as a6, type StakingActions as a7, type GenLayerRawTransaction as b, type GenLayerTransaction as c, type ContractSchema as d, CalldataAddress as e, type GenLayerMethod as f, type ContractParamsArraySchemaElement as g, type ContractParamsSchema as h, type ContractMethodBase as i, type ContractMethod as j, type TransactionHash as k, TransactionStatus as l, TransactionResult as m, transactionsStatusNameToNumber as n, DECIDED_STATES as o, isDecidedState as p, transactionResultNumberToName as q, TransactionResultNameToNumber as r, executionResultNumberToName as s, transactionsStatusNumberToName as t, VoteType as u, voteTypeNumberToName as v, voteTypeNameToNumber as w, type TransactionType as x, TransactionHashVariant as y, type SnapSource as z };
2901
+ export { type ValidatorDepositOptions as $, type SnapSource as A, type StakingContract as B, type CalldataEncodable as C, type DecodedDeployData as D, ExecutionResult as E, type ValidatorView as F, type GenLayerClient as G, type Hash as H, type ValidatorIdentity as I, type ValidatorInfo as J, type PendingWithdrawal as K, type LeaderReceipt as L, type MethodDescription as M, type Network as N, type BannedValidatorInfo as O, type PendingDeposit as P, type StakeInfo as Q, type EpochData as R, STAKING_ABI as S, type TransactionDataElement as T, type EpochInfo as U, VALIDATOR_WALLET_ABI as V, type WithdrawalCommit as W, type StakingTransactionResult as X, type ValidatorJoinResult as Y, type DelegatorJoinResult as Z, type ValidatorJoinOptions as _, type DecodedCallData as a, type ValidatorExitOptions as a0, type ValidatorClaimOptions as a1, type ValidatorPrimeOptions as a2, type SetOperatorOptions as a3, type SetIdentityOptions as a4, type DelegatorJoinOptions as a5, type DelegatorExitOptions as a6, type DelegatorClaimOptions as a7, type StakingActions as a8, type GenLayerRawTransaction as b, type GenLayerTransaction as c, type ContractSchema as d, CalldataAddress as e, type GenLayerMethod as f, type ContractParamsArraySchemaElement as g, type ContractParamsSchema as h, type ContractMethodBase as i, type ContractMethod as j, type TransactionHash as k, TransactionStatus as l, TransactionResult as m, transactionsStatusNameToNumber as n, DECIDED_STATES as o, isDecidedState as p, transactionResultNumberToName as q, TransactionResultNameToNumber as r, executionResultNumberToName as s, transactionsStatusNumberToName as t, VoteType as u, voteTypeNumberToName as v, voteTypeNameToNumber as w, type TransactionType as x, TransactionHashVariant as y, type DebugTraceResult as z };
@@ -150,6 +150,18 @@ type DecodedCallData = {
150
150
  leaderOnly?: boolean;
151
151
  type: TransactionType;
152
152
  };
153
+ type DebugTraceResult = {
154
+ transaction_id: string;
155
+ result_code: number;
156
+ return_data: string;
157
+ stdout: string;
158
+ stderr: string;
159
+ genvm_log: Record<string, unknown>[];
160
+ storage_proof: string;
161
+ run_time: string;
162
+ eq_outputs: string[];
163
+ stored_at?: string;
164
+ };
153
165
  interface LeaderReceipt {
154
166
  calldata: string;
155
167
  class_name: string;
@@ -2886,4 +2898,4 @@ type GenLayerClient<TGenLayerChain extends GenLayerChain> = Omit<Client<Transpor
2886
2898
  }) => Promise<bigint>;
2887
2899
  } & StakingActions;
2888
2900
 
2889
- export { type ValidatorExitOptions as $, type StakingContract as A, type ValidatorView as B, type CalldataEncodable as C, type DecodedDeployData as D, ExecutionResult as E, type ValidatorIdentity as F, type GenLayerClient as G, type Hash as H, type ValidatorInfo as I, type PendingWithdrawal as J, type BannedValidatorInfo as K, type LeaderReceipt as L, type MethodDescription as M, type Network as N, type StakeInfo as O, type PendingDeposit as P, type EpochData as Q, type EpochInfo as R, STAKING_ABI as S, type TransactionDataElement as T, type StakingTransactionResult as U, VALIDATOR_WALLET_ABI as V, type WithdrawalCommit as W, type ValidatorJoinResult as X, type DelegatorJoinResult as Y, type ValidatorJoinOptions as Z, type ValidatorDepositOptions as _, type DecodedCallData as a, type ValidatorClaimOptions as a0, type ValidatorPrimeOptions as a1, type SetOperatorOptions as a2, type SetIdentityOptions as a3, type DelegatorJoinOptions as a4, type DelegatorExitOptions as a5, type DelegatorClaimOptions as a6, type StakingActions as a7, type GenLayerRawTransaction as b, type GenLayerTransaction as c, type ContractSchema as d, CalldataAddress as e, type GenLayerMethod as f, type ContractParamsArraySchemaElement as g, type ContractParamsSchema as h, type ContractMethodBase as i, type ContractMethod as j, type TransactionHash as k, TransactionStatus as l, TransactionResult as m, transactionsStatusNameToNumber as n, DECIDED_STATES as o, isDecidedState as p, transactionResultNumberToName as q, TransactionResultNameToNumber as r, executionResultNumberToName as s, transactionsStatusNumberToName as t, VoteType as u, voteTypeNumberToName as v, voteTypeNameToNumber as w, type TransactionType as x, TransactionHashVariant as y, type SnapSource as z };
2901
+ export { type ValidatorDepositOptions as $, type SnapSource as A, type StakingContract as B, type CalldataEncodable as C, type DecodedDeployData as D, ExecutionResult as E, type ValidatorView as F, type GenLayerClient as G, type Hash as H, type ValidatorIdentity as I, type ValidatorInfo as J, type PendingWithdrawal as K, type LeaderReceipt as L, type MethodDescription as M, type Network as N, type BannedValidatorInfo as O, type PendingDeposit as P, type StakeInfo as Q, type EpochData as R, STAKING_ABI as S, type TransactionDataElement as T, type EpochInfo as U, VALIDATOR_WALLET_ABI as V, type WithdrawalCommit as W, type StakingTransactionResult as X, type ValidatorJoinResult as Y, type DelegatorJoinResult as Z, type ValidatorJoinOptions as _, type DecodedCallData as a, type ValidatorExitOptions as a0, type ValidatorClaimOptions as a1, type ValidatorPrimeOptions as a2, type SetOperatorOptions as a3, type SetIdentityOptions as a4, type DelegatorJoinOptions as a5, type DelegatorExitOptions as a6, type DelegatorClaimOptions as a7, type StakingActions as a8, type GenLayerRawTransaction as b, type GenLayerTransaction as c, type ContractSchema as d, CalldataAddress as e, type GenLayerMethod as f, type ContractParamsArraySchemaElement as g, type ContractParamsSchema as h, type ContractMethodBase as i, type ContractMethod as j, type TransactionHash as k, TransactionStatus as l, TransactionResult as m, transactionsStatusNameToNumber as n, DECIDED_STATES as o, isDecidedState as p, transactionResultNumberToName as q, TransactionResultNameToNumber as r, executionResultNumberToName as s, transactionsStatusNumberToName as t, VoteType as u, voteTypeNumberToName as v, voteTypeNameToNumber as w, type TransactionType as x, TransactionHashVariant as y, type DebugTraceResult as z };
package/dist/index.cjs CHANGED
@@ -1328,6 +1328,13 @@ var transactionActions = (client, publicClient) => ({
1328
1328
  });
1329
1329
  return logs.map((log) => log.topics[1]).filter(Boolean);
1330
1330
  },
1331
+ debugTraceTransaction: async ({ hash, round = 0 }) => {
1332
+ const result = await client.request({
1333
+ method: "gen_dbg_traceTransaction",
1334
+ params: [{ txID: hash, round }]
1335
+ });
1336
+ return result;
1337
+ },
1331
1338
  cancelTransaction: async ({ hash }) => {
1332
1339
  if (!client.chain.isStudio) {
1333
1340
  throw new Error("cancelTransaction is only available on studio-based chains (localnet/studionet)");
package/dist/index.d.cts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as viem from 'viem';
2
2
  import { Account, Address, Hex } from 'viem';
3
3
  import { G as GenLayerChain } from './chains-DqSbucSW.cjs';
4
- import { G as GenLayerClient, D as DecodedDeployData, a as DecodedCallData, b as GenLayerRawTransaction, c as GenLayerTransaction, C as CalldataEncodable, T as TransactionDataElement, S as STAKING_ABI, V as VALIDATOR_WALLET_ABI, d as ContractSchema } from './index-BJI82mwC.cjs';
4
+ import { G as GenLayerClient, D as DecodedDeployData, a as DecodedCallData, b as GenLayerRawTransaction, c as GenLayerTransaction, C as CalldataEncodable, T as TransactionDataElement, S as STAKING_ABI, V as VALIDATOR_WALLET_ABI, d as ContractSchema } from './index-BVTLJo0j.cjs';
5
5
  import * as abitype from 'abitype';
6
6
  import * as viem__types_types_authorization from 'viem/_types/types/authorization';
7
7
  import * as viem_accounts from 'viem/accounts';
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as viem from 'viem';
2
2
  import { Account, Address, Hex } from 'viem';
3
3
  import { G as GenLayerChain } from './chains-DqSbucSW.js';
4
- import { G as GenLayerClient, D as DecodedDeployData, a as DecodedCallData, b as GenLayerRawTransaction, c as GenLayerTransaction, C as CalldataEncodable, T as TransactionDataElement, S as STAKING_ABI, V as VALIDATOR_WALLET_ABI, d as ContractSchema } from './index-DEWwFm0_.js';
4
+ import { G as GenLayerClient, D as DecodedDeployData, a as DecodedCallData, b as GenLayerRawTransaction, c as GenLayerTransaction, C as CalldataEncodable, T as TransactionDataElement, S as STAKING_ABI, V as VALIDATOR_WALLET_ABI, d as ContractSchema } from './index-Dc8L54mZ.js';
5
5
  import * as abitype from 'abitype';
6
6
  import * as viem__types_types_authorization from 'viem/_types/types/authorization';
7
7
  import * as viem_accounts from 'viem/accounts';
package/dist/index.js CHANGED
@@ -1328,6 +1328,13 @@ var transactionActions = (client, publicClient) => ({
1328
1328
  });
1329
1329
  return logs.map((log) => log.topics[1]).filter(Boolean);
1330
1330
  },
1331
+ debugTraceTransaction: async ({ hash, round = 0 }) => {
1332
+ const result = await client.request({
1333
+ method: "gen_dbg_traceTransaction",
1334
+ params: [{ txID: hash, round }]
1335
+ });
1336
+ return result;
1337
+ },
1331
1338
  cancelTransaction: async ({ hash }) => {
1332
1339
  if (!client.chain.isStudio) {
1333
1340
  throw new Error("cancelTransaction is only available on studio-based chains (localnet/studionet)");
@@ -1,3 +1,3 @@
1
1
  export { Account, Address } from 'viem';
2
- export { K as BannedValidatorInfo, e as CalldataAddress, C as CalldataEncodable, j as ContractMethod, i as ContractMethodBase, g as ContractParamsArraySchemaElement, h as ContractParamsSchema, d as ContractSchema, o as DECIDED_STATES, a as DecodedCallData, D as DecodedDeployData, a6 as DelegatorClaimOptions, a5 as DelegatorExitOptions, a4 as DelegatorJoinOptions, Y as DelegatorJoinResult, Q as EpochData, R as EpochInfo, E as ExecutionResult, G as GenLayerClient, f as GenLayerMethod, b as GenLayerRawTransaction, c as GenLayerTransaction, H as Hash, L as LeaderReceipt, M as MethodDescription, N as Network, P as PendingDeposit, J as PendingWithdrawal, a3 as SetIdentityOptions, a2 as SetOperatorOptions, z as SnapSource, O as StakeInfo, a7 as StakingActions, A as StakingContract, U as StakingTransactionResult, k as TransactionHash, y as TransactionHashVariant, m as TransactionResult, r as TransactionResultNameToNumber, l as TransactionStatus, x as TransactionType, a0 as ValidatorClaimOptions, _ as ValidatorDepositOptions, $ as ValidatorExitOptions, F as ValidatorIdentity, I as ValidatorInfo, Z as ValidatorJoinOptions, X as ValidatorJoinResult, a1 as ValidatorPrimeOptions, B as ValidatorView, u as VoteType, W as WithdrawalCommit, s as executionResultNumberToName, p as isDecidedState, q as transactionResultNumberToName, n as transactionsStatusNameToNumber, t as transactionsStatusNumberToName, w as voteTypeNameToNumber, v as voteTypeNumberToName } from '../index-BJI82mwC.cjs';
2
+ export { O as BannedValidatorInfo, e as CalldataAddress, C as CalldataEncodable, j as ContractMethod, i as ContractMethodBase, g as ContractParamsArraySchemaElement, h as ContractParamsSchema, d as ContractSchema, o as DECIDED_STATES, z as DebugTraceResult, a as DecodedCallData, D as DecodedDeployData, a7 as DelegatorClaimOptions, a6 as DelegatorExitOptions, a5 as DelegatorJoinOptions, Z as DelegatorJoinResult, R as EpochData, U as EpochInfo, E as ExecutionResult, G as GenLayerClient, f as GenLayerMethod, b as GenLayerRawTransaction, c as GenLayerTransaction, H as Hash, L as LeaderReceipt, M as MethodDescription, N as Network, P as PendingDeposit, K as PendingWithdrawal, a4 as SetIdentityOptions, a3 as SetOperatorOptions, A as SnapSource, Q as StakeInfo, a8 as StakingActions, B as StakingContract, X as StakingTransactionResult, k as TransactionHash, y as TransactionHashVariant, m as TransactionResult, r as TransactionResultNameToNumber, l as TransactionStatus, x as TransactionType, a1 as ValidatorClaimOptions, $ as ValidatorDepositOptions, a0 as ValidatorExitOptions, I as ValidatorIdentity, J as ValidatorInfo, _ as ValidatorJoinOptions, Y as ValidatorJoinResult, a2 as ValidatorPrimeOptions, F as ValidatorView, u as VoteType, W as WithdrawalCommit, s as executionResultNumberToName, p as isDecidedState, q as transactionResultNumberToName, n as transactionsStatusNameToNumber, t as transactionsStatusNumberToName, w as voteTypeNameToNumber, v as voteTypeNumberToName } from '../index-BVTLJo0j.cjs';
3
3
  export { G as GenLayerChain } from '../chains-DqSbucSW.cjs';
@@ -1,3 +1,3 @@
1
1
  export { Account, Address } from 'viem';
2
- export { K as BannedValidatorInfo, e as CalldataAddress, C as CalldataEncodable, j as ContractMethod, i as ContractMethodBase, g as ContractParamsArraySchemaElement, h as ContractParamsSchema, d as ContractSchema, o as DECIDED_STATES, a as DecodedCallData, D as DecodedDeployData, a6 as DelegatorClaimOptions, a5 as DelegatorExitOptions, a4 as DelegatorJoinOptions, Y as DelegatorJoinResult, Q as EpochData, R as EpochInfo, E as ExecutionResult, G as GenLayerClient, f as GenLayerMethod, b as GenLayerRawTransaction, c as GenLayerTransaction, H as Hash, L as LeaderReceipt, M as MethodDescription, N as Network, P as PendingDeposit, J as PendingWithdrawal, a3 as SetIdentityOptions, a2 as SetOperatorOptions, z as SnapSource, O as StakeInfo, a7 as StakingActions, A as StakingContract, U as StakingTransactionResult, k as TransactionHash, y as TransactionHashVariant, m as TransactionResult, r as TransactionResultNameToNumber, l as TransactionStatus, x as TransactionType, a0 as ValidatorClaimOptions, _ as ValidatorDepositOptions, $ as ValidatorExitOptions, F as ValidatorIdentity, I as ValidatorInfo, Z as ValidatorJoinOptions, X as ValidatorJoinResult, a1 as ValidatorPrimeOptions, B as ValidatorView, u as VoteType, W as WithdrawalCommit, s as executionResultNumberToName, p as isDecidedState, q as transactionResultNumberToName, n as transactionsStatusNameToNumber, t as transactionsStatusNumberToName, w as voteTypeNameToNumber, v as voteTypeNumberToName } from '../index-DEWwFm0_.js';
2
+ export { O as BannedValidatorInfo, e as CalldataAddress, C as CalldataEncodable, j as ContractMethod, i as ContractMethodBase, g as ContractParamsArraySchemaElement, h as ContractParamsSchema, d as ContractSchema, o as DECIDED_STATES, z as DebugTraceResult, a as DecodedCallData, D as DecodedDeployData, a7 as DelegatorClaimOptions, a6 as DelegatorExitOptions, a5 as DelegatorJoinOptions, Z as DelegatorJoinResult, R as EpochData, U as EpochInfo, E as ExecutionResult, G as GenLayerClient, f as GenLayerMethod, b as GenLayerRawTransaction, c as GenLayerTransaction, H as Hash, L as LeaderReceipt, M as MethodDescription, N as Network, P as PendingDeposit, K as PendingWithdrawal, a4 as SetIdentityOptions, a3 as SetOperatorOptions, A as SnapSource, Q as StakeInfo, a8 as StakingActions, B as StakingContract, X as StakingTransactionResult, k as TransactionHash, y as TransactionHashVariant, m as TransactionResult, r as TransactionResultNameToNumber, l as TransactionStatus, x as TransactionType, a1 as ValidatorClaimOptions, $ as ValidatorDepositOptions, a0 as ValidatorExitOptions, I as ValidatorIdentity, J as ValidatorInfo, _ as ValidatorJoinOptions, Y as ValidatorJoinResult, a2 as ValidatorPrimeOptions, F as ValidatorView, u as VoteType, W as WithdrawalCommit, s as executionResultNumberToName, p as isDecidedState, q as transactionResultNumberToName, n as transactionsStatusNameToNumber, t as transactionsStatusNumberToName, w as voteTypeNameToNumber, v as voteTypeNumberToName } from '../index-Dc8L54mZ.js';
3
3
  export { G as GenLayerChain } from '../chains-DqSbucSW.js';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "genlayer-js",
3
3
  "type": "module",
4
- "version": "0.24.0",
4
+ "version": "0.25.0",
5
5
  "description": "GenLayer JavaScript SDK",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",