genlayer-js 0.28.5 → 0.28.6

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.cjs CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
 
8
8
 
9
- var _chunkPZEHAYIUcjs = require('./chunk-PZEHAYIU.cjs');
9
+ var _chunkN74TARFYcjs = require('./chunk-N74TARFY.cjs');
10
10
 
11
11
 
12
12
 
@@ -33,7 +33,7 @@ var _viem = require('viem');
33
33
  function accountActions(client) {
34
34
  return {
35
35
  fundAccount: async ({ address, amount }) => {
36
- if (_optionalChain([client, 'access', _ => _.chain, 'optionalAccess', _2 => _2.id]) !== _chunkPZEHAYIUcjs.localnet.id) {
36
+ if (_optionalChain([client, 'access', _ => _.chain, 'optionalAccess', _2 => _2.id]) !== _chunkN74TARFYcjs.localnet.id) {
37
37
  throw new Error("Client is not connected to the localnet");
38
38
  }
39
39
  return client.request({
@@ -417,8 +417,8 @@ function serialize(data) {
417
417
  // src/abi/index.ts
418
418
  var abi_exports = {};
419
419
  _chunk75ZPJI57cjs.__export.call(void 0, abi_exports, {
420
- STAKING_ABI: () => _chunkPZEHAYIUcjs.STAKING_ABI,
421
- VALIDATOR_WALLET_ABI: () => _chunkPZEHAYIUcjs.VALIDATOR_WALLET_ABI,
420
+ STAKING_ABI: () => _chunkN74TARFYcjs.STAKING_ABI,
421
+ VALIDATOR_WALLET_ABI: () => _chunkN74TARFYcjs.VALIDATOR_WALLET_ABI,
422
422
  calldata: () => calldata,
423
423
  transactions: () => transactions
424
424
  });
@@ -1605,10 +1605,10 @@ var snapID = {
1605
1605
 
1606
1606
  // src/wallet/connect.ts
1607
1607
  var networks = {
1608
- localnet: _chunkPZEHAYIUcjs.localnet,
1609
- studionet: _chunkPZEHAYIUcjs.studionet,
1610
- testnetAsimov: _chunkPZEHAYIUcjs.testnetAsimov,
1611
- testnetBradbury: _chunkPZEHAYIUcjs.testnetBradbury
1608
+ localnet: _chunkN74TARFYcjs.localnet,
1609
+ studionet: _chunkN74TARFYcjs.studionet,
1610
+ testnetAsimov: _chunkN74TARFYcjs.testnetAsimov,
1611
+ testnetBradbury: _chunkN74TARFYcjs.testnetBradbury
1612
1612
  };
1613
1613
  var connect = async (client, network = "studionet", snapSource = "npm") => {
1614
1614
  if (!window.ethereum) {
@@ -1724,7 +1724,7 @@ function formatStakingAmount(amount) {
1724
1724
  // src/staking/actions.ts
1725
1725
  var FALLBACK_GAS = 1000000n;
1726
1726
  var GAS_BUFFER_MULTIPLIER = 2n;
1727
- var COMBINED_ERROR_ABI = [..._chunkPZEHAYIUcjs.STAKING_ABI, ..._chunkPZEHAYIUcjs.VALIDATOR_WALLET_ABI];
1727
+ var COMBINED_ERROR_ABI = [..._chunkN74TARFYcjs.STAKING_ABI, ..._chunkN74TARFYcjs.VALIDATOR_WALLET_ABI];
1728
1728
  function extractRevertReason(err) {
1729
1729
  if (err instanceof _viem.BaseError) {
1730
1730
  const rawError = err.walk((e) => e instanceof _viem.RawContractError);
@@ -1856,7 +1856,7 @@ var stakingActions = (client, publicClient) => {
1856
1856
  const address = getStakingAddress();
1857
1857
  return _viem.getContract.call(void 0, {
1858
1858
  address,
1859
- abi: _chunkPZEHAYIUcjs.STAKING_ABI,
1859
+ abi: _chunkN74TARFYcjs.STAKING_ABI,
1860
1860
  client: { public: publicClient, wallet: client }
1861
1861
  });
1862
1862
  };
@@ -1864,7 +1864,7 @@ var stakingActions = (client, publicClient) => {
1864
1864
  const address = getStakingAddress();
1865
1865
  return _viem.getContract.call(void 0, {
1866
1866
  address,
1867
- abi: _chunkPZEHAYIUcjs.STAKING_ABI,
1867
+ abi: _chunkN74TARFYcjs.STAKING_ABI,
1868
1868
  client: publicClient
1869
1869
  });
1870
1870
  };
@@ -1874,11 +1874,11 @@ var stakingActions = (client, publicClient) => {
1874
1874
  const amount = parseStakingAmount(options.amount);
1875
1875
  const stakingAddress = getStakingAddress();
1876
1876
  const data = options.operator ? _viem.encodeFunctionData.call(void 0, {
1877
- abi: _chunkPZEHAYIUcjs.STAKING_ABI,
1877
+ abi: _chunkN74TARFYcjs.STAKING_ABI,
1878
1878
  functionName: "validatorJoin",
1879
1879
  args: [options.operator]
1880
1880
  }) : _viem.encodeFunctionData.call(void 0, {
1881
- abi: _chunkPZEHAYIUcjs.STAKING_ABI,
1881
+ abi: _chunkN74TARFYcjs.STAKING_ABI,
1882
1882
  functionName: "validatorJoin"
1883
1883
  });
1884
1884
  const result = await executeWrite({ to: stakingAddress, data, value: amount });
@@ -1887,7 +1887,7 @@ var stakingActions = (client, publicClient) => {
1887
1887
  let eventFound = false;
1888
1888
  for (const log of receipt.logs) {
1889
1889
  try {
1890
- const decoded = _viem.decodeEventLog.call(void 0, { abi: _chunkPZEHAYIUcjs.STAKING_ABI, data: log.data, topics: log.topics });
1890
+ const decoded = _viem.decodeEventLog.call(void 0, { abi: _chunkN74TARFYcjs.STAKING_ABI, data: log.data, topics: log.topics });
1891
1891
  if (decoded.eventName === "ValidatorJoin") {
1892
1892
  validatorWallet = decoded.args.validator;
1893
1893
  eventFound = true;
@@ -1915,7 +1915,7 @@ var stakingActions = (client, publicClient) => {
1915
1915
  validatorDeposit: async (options) => {
1916
1916
  const amount = parseStakingAmount(options.amount);
1917
1917
  const data = _viem.encodeFunctionData.call(void 0, {
1918
- abi: _chunkPZEHAYIUcjs.STAKING_ABI,
1918
+ abi: _chunkN74TARFYcjs.STAKING_ABI,
1919
1919
  functionName: "validatorDeposit"
1920
1920
  });
1921
1921
  return executeWrite({ to: getStakingAddress(), data, value: amount });
@@ -1924,7 +1924,7 @@ var stakingActions = (client, publicClient) => {
1924
1924
  validatorExit: async (options) => {
1925
1925
  const shares = typeof options.shares === "string" ? BigInt(options.shares) : options.shares;
1926
1926
  const data = _viem.encodeFunctionData.call(void 0, {
1927
- abi: _chunkPZEHAYIUcjs.STAKING_ABI,
1927
+ abi: _chunkN74TARFYcjs.STAKING_ABI,
1928
1928
  functionName: "validatorExit",
1929
1929
  args: [shares]
1930
1930
  });
@@ -1937,7 +1937,7 @@ var stakingActions = (client, publicClient) => {
1937
1937
  }
1938
1938
  const validatorAddress = _optionalChain([options, 'optionalAccess', _155 => _155.validator]) || client.account.address;
1939
1939
  const data = _viem.encodeFunctionData.call(void 0, {
1940
- abi: _chunkPZEHAYIUcjs.STAKING_ABI,
1940
+ abi: _chunkN74TARFYcjs.STAKING_ABI,
1941
1941
  functionName: "validatorClaim",
1942
1942
  args: [validatorAddress]
1943
1943
  });
@@ -1947,7 +1947,7 @@ var stakingActions = (client, publicClient) => {
1947
1947
  /** Primes a validator for participation in the next epoch. */
1948
1948
  validatorPrime: async (options) => {
1949
1949
  const data = _viem.encodeFunctionData.call(void 0, {
1950
- abi: _chunkPZEHAYIUcjs.STAKING_ABI,
1950
+ abi: _chunkN74TARFYcjs.STAKING_ABI,
1951
1951
  functionName: "validatorPrime",
1952
1952
  args: [options.validator]
1953
1953
  });
@@ -1956,7 +1956,7 @@ var stakingActions = (client, publicClient) => {
1956
1956
  /** Sets the operator address for a validator wallet. */
1957
1957
  setOperator: async (options) => {
1958
1958
  const data = _viem.encodeFunctionData.call(void 0, {
1959
- abi: _chunkPZEHAYIUcjs.VALIDATOR_WALLET_ABI,
1959
+ abi: _chunkN74TARFYcjs.VALIDATOR_WALLET_ABI,
1960
1960
  functionName: "setOperator",
1961
1961
  args: [options.operator]
1962
1962
  });
@@ -1973,7 +1973,7 @@ var stakingActions = (client, publicClient) => {
1973
1973
  }
1974
1974
  }
1975
1975
  const data = _viem.encodeFunctionData.call(void 0, {
1976
- abi: _chunkPZEHAYIUcjs.VALIDATOR_WALLET_ABI,
1976
+ abi: _chunkN74TARFYcjs.VALIDATOR_WALLET_ABI,
1977
1977
  functionName: "setIdentity",
1978
1978
  args: [
1979
1979
  options.moniker,
@@ -1993,7 +1993,7 @@ var stakingActions = (client, publicClient) => {
1993
1993
  delegatorJoin: async (options) => {
1994
1994
  const amount = parseStakingAmount(options.amount);
1995
1995
  const data = _viem.encodeFunctionData.call(void 0, {
1996
- abi: _chunkPZEHAYIUcjs.STAKING_ABI,
1996
+ abi: _chunkN74TARFYcjs.STAKING_ABI,
1997
1997
  functionName: "delegatorJoin",
1998
1998
  args: [options.validator]
1999
1999
  });
@@ -2010,7 +2010,7 @@ var stakingActions = (client, publicClient) => {
2010
2010
  delegatorExit: async (options) => {
2011
2011
  const shares = typeof options.shares === "string" ? BigInt(options.shares) : options.shares;
2012
2012
  const data = _viem.encodeFunctionData.call(void 0, {
2013
- abi: _chunkPZEHAYIUcjs.STAKING_ABI,
2013
+ abi: _chunkN74TARFYcjs.STAKING_ABI,
2014
2014
  functionName: "delegatorExit",
2015
2015
  args: [options.validator, shares]
2016
2016
  });
@@ -2023,7 +2023,7 @@ var stakingActions = (client, publicClient) => {
2023
2023
  }
2024
2024
  const delegatorAddress = options.delegator || client.account.address;
2025
2025
  const data = _viem.encodeFunctionData.call(void 0, {
2026
- abi: _chunkPZEHAYIUcjs.STAKING_ABI,
2026
+ abi: _chunkN74TARFYcjs.STAKING_ABI,
2027
2027
  functionName: "delegatorClaim",
2028
2028
  args: [delegatorAddress, options.validator]
2029
2029
  });
@@ -2043,7 +2043,7 @@ var stakingActions = (client, publicClient) => {
2043
2043
  }
2044
2044
  const walletContract = _viem.getContract.call(void 0, {
2045
2045
  address: validator,
2046
- abi: _chunkPZEHAYIUcjs.VALIDATOR_WALLET_ABI,
2046
+ abi: _chunkN74TARFYcjs.VALIDATOR_WALLET_ABI,
2047
2047
  client: publicClient
2048
2048
  });
2049
2049
  const [view, owner, operator, identityRaw, currentEpoch] = await Promise.all([
@@ -2378,8 +2378,8 @@ var getCustomTransportConfig = (config, chainConfig) => {
2378
2378
  }
2379
2379
  };
2380
2380
  };
2381
- var createClient = (config = { chain: _chunkPZEHAYIUcjs.localnet }) => {
2382
- const chainConfig = config.chain || _chunkPZEHAYIUcjs.localnet;
2381
+ var createClient = (config = { chain: _chunkN74TARFYcjs.localnet }) => {
2382
+ const chainConfig = config.chain || _chunkN74TARFYcjs.localnet;
2383
2383
  if (config.endpoint) {
2384
2384
  chainConfig.rpcUrls.default.http = [config.endpoint];
2385
2385
  }
@@ -2516,4 +2516,4 @@ function validateValueAgainstType(value, type) {
2516
2516
 
2517
2517
 
2518
2518
 
2519
- exports.abi = abi_exports; exports.buildGenVmPositionalArgs = buildGenVmPositionalArgs; exports.chains = _chunkPZEHAYIUcjs.chains_exports; exports.createAccount = createAccount; exports.createClient = createClient; exports.decodeInputData = decodeInputData; exports.decodeLocalnetTransaction = decodeLocalnetTransaction; exports.decodeTransaction = decodeTransaction; exports.formatStakingAmount = formatStakingAmount; exports.generatePrivateKey = generatePrivateKey; exports.parseStakingAmount = parseStakingAmount; exports.simplifyTransactionReceipt = simplifyTransactionReceipt;
2519
+ exports.abi = abi_exports; exports.buildGenVmPositionalArgs = buildGenVmPositionalArgs; exports.chains = _chunkN74TARFYcjs.chains_exports; exports.createAccount = createAccount; exports.createClient = createClient; exports.decodeInputData = decodeInputData; exports.decodeLocalnetTransaction = decodeLocalnetTransaction; exports.decodeTransaction = decodeTransaction; exports.formatStakingAmount = formatStakingAmount; exports.generatePrivateKey = generatePrivateKey; exports.parseStakingAmount = parseStakingAmount; exports.simplifyTransactionReceipt = simplifyTransactionReceipt;
package/dist/index.js CHANGED
@@ -6,7 +6,7 @@ import {
6
6
  studionet,
7
7
  testnetAsimov,
8
8
  testnetBradbury
9
- } from "./chunk-SGAVFNGA.js";
9
+ } from "./chunk-XCQTIUTU.js";
10
10
  import {
11
11
  CalldataAddress,
12
12
  executionResultNumberToName,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "genlayer-js",
3
3
  "type": "module",
4
- "version": "0.28.5",
4
+ "version": "0.28.6",
5
5
  "description": "GenLayer JavaScript SDK",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",