genlayer-js 0.18.3 → 0.18.4
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/CHANGELOG.md +7 -0
- package/dist/chains/index.cjs +2 -2
- package/dist/chains/index.d.cts +2 -2
- package/dist/chains/index.d.ts +2 -2
- package/dist/chains/index.js +1 -1
- package/dist/{chains-BYSCF33g.d.cts → chains-BIe_Q0mF.d.cts} +1 -0
- package/dist/{chains-BYSCF33g.d.ts → chains-BIe_Q0mF.d.ts} +1 -0
- package/dist/{chunk-GEN4SJ6K.js → chunk-NO75TOQL.js} +3 -0
- package/dist/{chunk-ZKBMABRA.cjs → chunk-SMGWE7OH.cjs} +3 -0
- package/dist/{index-Rls_T310.d.ts → index-B2AY6_eD.d.ts} +1 -1
- package/dist/{index-tixobC8m.d.cts → index-BYma5s90.d.cts} +1 -1
- package/dist/{index-DCzgdyMa.d.ts → index-BpFWfpio.d.ts} +1 -1
- package/dist/{index-Bw-kn7CF.d.cts → index-C5zeayBB.d.cts} +1 -1
- package/dist/index.cjs +14 -14
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +2 -2
- package/dist/types/index.d.cts +2 -2
- package/dist/types/index.d.ts +2 -2
- package/package.json +1 -1
- package/src/chains/localnet.ts +1 -0
- package/src/chains/studionet.ts +1 -0
- package/src/chains/testnetAsimov.ts +875 -874
- package/src/transactions/actions.ts +6 -8
- package/src/types/chains.ts +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
+
## 0.18.4 (2025-11-11)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* differentiate chains using the studio from testnet ([#122](https://github.com/genlayerlabs/genlayer-js/issues/122)) ([1fa8d4c](https://github.com/genlayerlabs/genlayer-js/commit/1fa8d4cd0856d9eb437902f330feb1de4782d112))
|
|
9
|
+
|
|
3
10
|
## 0.18.3 (2025-11-03)
|
|
4
11
|
|
|
5
12
|
|
package/dist/chains/index.cjs
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _chunkSMGWE7OHcjs = require('../chunk-SMGWE7OH.cjs');
|
|
6
6
|
require('../chunk-75ZPJI57.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
exports.localnet =
|
|
11
|
+
exports.localnet = _chunkSMGWE7OHcjs.localnet; exports.studionet = _chunkSMGWE7OHcjs.studionet; exports.testnetAsimov = _chunkSMGWE7OHcjs.testnetAsimov;
|
package/dist/chains/index.d.cts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { l as localnet, s as studionet, t as testnetAsimov } from '../index-
|
|
2
|
-
import '../chains-
|
|
1
|
+
export { l as localnet, s as studionet, t as testnetAsimov } from '../index-C5zeayBB.cjs';
|
|
2
|
+
import '../chains-BIe_Q0mF.cjs';
|
|
3
3
|
import 'viem';
|
package/dist/chains/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { l as localnet, s as studionet, t as testnetAsimov } from '../index-
|
|
2
|
-
import '../chains-
|
|
1
|
+
export { l as localnet, s as studionet, t as testnetAsimov } from '../index-BpFWfpio.js';
|
|
2
|
+
import '../chains-BIe_Q0mF.js';
|
|
3
3
|
import 'viem';
|
package/dist/chains/index.js
CHANGED
|
@@ -3997,6 +3997,7 @@ var CONSENSUS_DATA_CONTRACT = {
|
|
|
3997
3997
|
};
|
|
3998
3998
|
var localnet = defineChain({
|
|
3999
3999
|
id: 61999,
|
|
4000
|
+
isStudio: true,
|
|
4000
4001
|
name: "Genlayer Localnet",
|
|
4001
4002
|
rpcUrls: {
|
|
4002
4003
|
default: {
|
|
@@ -8009,6 +8010,7 @@ var CONSENSUS_DATA_CONTRACT2 = {
|
|
|
8009
8010
|
};
|
|
8010
8011
|
var studionet = defineChain2({
|
|
8011
8012
|
id: 61999,
|
|
8013
|
+
isStudio: true,
|
|
8012
8014
|
name: "Genlayer Studio Network",
|
|
8013
8015
|
rpcUrls: {
|
|
8014
8016
|
default: {
|
|
@@ -12009,6 +12011,7 @@ var CONSENSUS_DATA_CONTRACT3 = {
|
|
|
12009
12011
|
};
|
|
12010
12012
|
var testnetAsimov = defineChain3({
|
|
12011
12013
|
id: 4221,
|
|
12014
|
+
isStudio: false,
|
|
12012
12015
|
name: "Genlayer Asimov Testnet",
|
|
12013
12016
|
rpcUrls: {
|
|
12014
12017
|
default: {
|
|
@@ -3997,6 +3997,7 @@ var CONSENSUS_DATA_CONTRACT = {
|
|
|
3997
3997
|
};
|
|
3998
3998
|
var localnet = _viem.defineChain.call(void 0, {
|
|
3999
3999
|
id: 61999,
|
|
4000
|
+
isStudio: true,
|
|
4000
4001
|
name: "Genlayer Localnet",
|
|
4001
4002
|
rpcUrls: {
|
|
4002
4003
|
default: {
|
|
@@ -8009,6 +8010,7 @@ var CONSENSUS_DATA_CONTRACT2 = {
|
|
|
8009
8010
|
};
|
|
8010
8011
|
var studionet = _viem.defineChain.call(void 0, {
|
|
8011
8012
|
id: 61999,
|
|
8013
|
+
isStudio: true,
|
|
8012
8014
|
name: "Genlayer Studio Network",
|
|
8013
8015
|
rpcUrls: {
|
|
8014
8016
|
default: {
|
|
@@ -12009,6 +12011,7 @@ var CONSENSUS_DATA_CONTRACT3 = {
|
|
|
12009
12011
|
};
|
|
12010
12012
|
var testnetAsimov = _viem.defineChain.call(void 0, {
|
|
12011
12013
|
id: 4221,
|
|
12014
|
+
isStudio: false,
|
|
12012
12015
|
name: "Genlayer Asimov Testnet",
|
|
12013
12016
|
rpcUrls: {
|
|
12014
12017
|
default: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Hex, Address, Client, Transport, WalletActions, PublicActions, Account } from 'viem';
|
|
2
|
-
import { G as GenLayerChain } from './chains-
|
|
2
|
+
import { G as GenLayerChain } from './chains-BIe_Q0mF.js';
|
|
3
3
|
|
|
4
4
|
declare class CalldataAddress {
|
|
5
5
|
bytes: Uint8Array;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Hex, Address, Client, Transport, WalletActions, PublicActions, Account } from 'viem';
|
|
2
|
-
import { G as GenLayerChain } from './chains-
|
|
2
|
+
import { G as GenLayerChain } from './chains-BIe_Q0mF.cjs';
|
|
3
3
|
|
|
4
4
|
declare class CalldataAddress {
|
|
5
5
|
bytes: Uint8Array;
|
package/dist/index.cjs
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkSMGWE7OHcjs = require('./chunk-SMGWE7OH.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
@@ -29,7 +29,7 @@ var _viem = require('viem');
|
|
|
29
29
|
function accountActions(client) {
|
|
30
30
|
return {
|
|
31
31
|
fundAccount: async ({ address, amount }) => {
|
|
32
|
-
if (_optionalChain([client, 'access', _ => _.chain, 'optionalAccess', _2 => _2.id]) !==
|
|
32
|
+
if (_optionalChain([client, 'access', _ => _.chain, 'optionalAccess', _2 => _2.id]) !== _chunkSMGWE7OHcjs.localnet.id) {
|
|
33
33
|
throw new Error("Client is not connected to the localnet");
|
|
34
34
|
}
|
|
35
35
|
return client.request({
|
|
@@ -512,7 +512,7 @@ function _toJsonSafeDeep(value, seen) {
|
|
|
512
512
|
var contractActions = (client, publicClient) => {
|
|
513
513
|
return {
|
|
514
514
|
getContractCode: async (address) => {
|
|
515
|
-
if (client.chain.id !==
|
|
515
|
+
if (client.chain.id !== _chunkSMGWE7OHcjs.localnet.id) {
|
|
516
516
|
throw new Error("Getting contract code is not supported on this network");
|
|
517
517
|
}
|
|
518
518
|
const result = await client.request({
|
|
@@ -523,7 +523,7 @@ var contractActions = (client, publicClient) => {
|
|
|
523
523
|
return new TextDecoder().decode(codeBytes);
|
|
524
524
|
},
|
|
525
525
|
getContractSchema: async (address) => {
|
|
526
|
-
if (client.chain.id !==
|
|
526
|
+
if (client.chain.id !== _chunkSMGWE7OHcjs.localnet.id) {
|
|
527
527
|
throw new Error("Contract schema is not supported on this network");
|
|
528
528
|
}
|
|
529
529
|
const schema = await client.request({
|
|
@@ -533,7 +533,7 @@ var contractActions = (client, publicClient) => {
|
|
|
533
533
|
return schema;
|
|
534
534
|
},
|
|
535
535
|
getContractSchemaForCode: async (contractCode) => {
|
|
536
|
-
if (client.chain.id !==
|
|
536
|
+
if (client.chain.id !== _chunkSMGWE7OHcjs.localnet.id) {
|
|
537
537
|
throw new Error("Contract schema is not supported on this network");
|
|
538
538
|
}
|
|
539
539
|
const schema = await client.request({
|
|
@@ -1050,7 +1050,7 @@ var receiptActions = (client, publicClient) => ({
|
|
|
1050
1050
|
const requestedStatus = _chunkFPZNF3JHcjs.transactionsStatusNameToNumber[status];
|
|
1051
1051
|
if (transactionStatusString === requestedStatus || status === "ACCEPTED" /* ACCEPTED */ && _chunkFPZNF3JHcjs.isDecidedState.call(void 0, transactionStatusString)) {
|
|
1052
1052
|
let finalTransaction = transaction;
|
|
1053
|
-
if (client.chain.id ===
|
|
1053
|
+
if (client.chain.id === _chunkSMGWE7OHcjs.localnet.id) {
|
|
1054
1054
|
finalTransaction = decodeLocalnetTransaction(transaction);
|
|
1055
1055
|
}
|
|
1056
1056
|
if (!fullTransaction) {
|
|
@@ -1073,7 +1073,7 @@ var receiptActions = (client, publicClient) => ({
|
|
|
1073
1073
|
});
|
|
1074
1074
|
var transactionActions = (client, publicClient) => ({
|
|
1075
1075
|
getTransaction: async ({ hash }) => {
|
|
1076
|
-
if (client.chain.
|
|
1076
|
+
if (client.chain.isStudio) {
|
|
1077
1077
|
const transaction2 = await client.getTransaction({ hash });
|
|
1078
1078
|
const localnetStatus = transaction2.status === "ACTIVATED" ? "PENDING" /* PENDING */ : transaction2.status;
|
|
1079
1079
|
transaction2.status = Number(_chunkFPZNF3JHcjs.transactionsStatusNameToNumber[localnetStatus]);
|
|
@@ -1115,9 +1115,9 @@ var snapID = {
|
|
|
1115
1115
|
|
|
1116
1116
|
// src/wallet/connect.ts
|
|
1117
1117
|
var networks = {
|
|
1118
|
-
localnet:
|
|
1119
|
-
studionet:
|
|
1120
|
-
testnetAsimov:
|
|
1118
|
+
localnet: _chunkSMGWE7OHcjs.localnet,
|
|
1119
|
+
studionet: _chunkSMGWE7OHcjs.studionet,
|
|
1120
|
+
testnetAsimov: _chunkSMGWE7OHcjs.testnetAsimov
|
|
1121
1121
|
};
|
|
1122
1122
|
var connect = async (client, network = "studionet", snapSource = "npm") => {
|
|
1123
1123
|
if (!window.ethereum) {
|
|
@@ -1216,7 +1216,7 @@ function walletActions(client) {
|
|
|
1216
1216
|
function chainActions(client) {
|
|
1217
1217
|
return {
|
|
1218
1218
|
initializeConsensusSmartContract: async (forceReset = false) => {
|
|
1219
|
-
if (_optionalChain([client, 'access', _54 => _54.chain, 'optionalAccess', _55 => _55.id]) ===
|
|
1219
|
+
if (_optionalChain([client, 'access', _54 => _54.chain, 'optionalAccess', _55 => _55.id]) === _chunkSMGWE7OHcjs.testnetAsimov.id) {
|
|
1220
1220
|
return;
|
|
1221
1221
|
}
|
|
1222
1222
|
if (!forceReset && _optionalChain([client, 'access', _56 => _56.chain, 'access', _57 => _57.consensusMainContract, 'optionalAccess', _58 => _58.address]) && _optionalChain([client, 'access', _59 => _59.chain, 'access', _60 => _60.consensusMainContract, 'optionalAccess', _61 => _61.abi])) {
|
|
@@ -1289,8 +1289,8 @@ var getCustomTransportConfig = (config) => {
|
|
|
1289
1289
|
}
|
|
1290
1290
|
};
|
|
1291
1291
|
};
|
|
1292
|
-
var createClient = (config = { chain:
|
|
1293
|
-
const chainConfig = config.chain ||
|
|
1292
|
+
var createClient = (config = { chain: _chunkSMGWE7OHcjs.localnet }) => {
|
|
1293
|
+
const chainConfig = config.chain || _chunkSMGWE7OHcjs.localnet;
|
|
1294
1294
|
if (config.endpoint) {
|
|
1295
1295
|
chainConfig.rpcUrls.default.http = [config.endpoint];
|
|
1296
1296
|
}
|
|
@@ -1345,4 +1345,4 @@ var createAccount = (accountPrivateKey) => {
|
|
|
1345
1345
|
|
|
1346
1346
|
|
|
1347
1347
|
|
|
1348
|
-
exports.abi = abi_exports; exports.chains =
|
|
1348
|
+
exports.abi = abi_exports; exports.chains = _chunkSMGWE7OHcjs.chains_exports; exports.createAccount = createAccount; exports.createClient = createClient; exports.decodeInputData = decodeInputData; exports.decodeLocalnetTransaction = decodeLocalnetTransaction; exports.decodeTransaction = decodeTransaction; exports.generatePrivateKey = generatePrivateKey; exports.simplifyTransactionReceipt = simplifyTransactionReceipt;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import * as viem from 'viem';
|
|
2
2
|
import { Account, Address, Hex } from 'viem';
|
|
3
|
-
import { G as GenLayerChain } from './chains-
|
|
4
|
-
import { G as GenLayerClient, D as DecodedDeployData, a as DecodedCallData, b as GenLayerRawTransaction, c as GenLayerTransaction, C as CalldataEncodable, T as TransactionDataElement } from './index-
|
|
3
|
+
import { G as GenLayerChain } from './chains-BIe_Q0mF.cjs';
|
|
4
|
+
import { G as GenLayerClient, D as DecodedDeployData, a as DecodedCallData, b as GenLayerRawTransaction, c as GenLayerTransaction, C as CalldataEncodable, T as TransactionDataElement } from './index-BYma5s90.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';
|
|
8
|
-
export { i as chains } from './index-
|
|
8
|
+
export { i as chains } from './index-C5zeayBB.cjs';
|
|
9
9
|
|
|
10
10
|
interface ClientConfig {
|
|
11
11
|
chain?: {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import * as viem from 'viem';
|
|
2
2
|
import { Account, Address, Hex } from 'viem';
|
|
3
|
-
import { G as GenLayerChain } from './chains-
|
|
4
|
-
import { G as GenLayerClient, D as DecodedDeployData, a as DecodedCallData, b as GenLayerRawTransaction, c as GenLayerTransaction, C as CalldataEncodable, T as TransactionDataElement } from './index-
|
|
3
|
+
import { G as GenLayerChain } from './chains-BIe_Q0mF.js';
|
|
4
|
+
import { G as GenLayerClient, D as DecodedDeployData, a as DecodedCallData, b as GenLayerRawTransaction, c as GenLayerTransaction, C as CalldataEncodable, T as TransactionDataElement } from './index-B2AY6_eD.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';
|
|
8
|
-
export { i as chains } from './index-
|
|
8
|
+
export { i as chains } from './index-BpFWfpio.js';
|
|
9
9
|
|
|
10
10
|
interface ClientConfig {
|
|
11
11
|
chain?: {
|
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
localnet,
|
|
4
4
|
studionet,
|
|
5
5
|
testnetAsimov
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-NO75TOQL.js";
|
|
7
7
|
import {
|
|
8
8
|
CalldataAddress,
|
|
9
9
|
isDecidedState,
|
|
@@ -1073,7 +1073,7 @@ var receiptActions = (client, publicClient) => ({
|
|
|
1073
1073
|
});
|
|
1074
1074
|
var transactionActions = (client, publicClient) => ({
|
|
1075
1075
|
getTransaction: async ({ hash }) => {
|
|
1076
|
-
if (client.chain.
|
|
1076
|
+
if (client.chain.isStudio) {
|
|
1077
1077
|
const transaction2 = await client.getTransaction({ hash });
|
|
1078
1078
|
const localnetStatus = transaction2.status === "ACTIVATED" ? "PENDING" /* PENDING */ : transaction2.status;
|
|
1079
1079
|
transaction2.status = Number(transactionsStatusNameToNumber[localnetStatus]);
|
package/dist/types/index.d.cts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { Account, Address } from 'viem';
|
|
2
|
-
export { d as CalldataAddress, C as CalldataEncodable, i as ContractMethod, h as ContractMethodBase, f as ContractParamsArraySchemaElement, g as ContractParamsSchema, j as ContractSchema, o as DECIDED_STATES, a as DecodedCallData, D as DecodedDeployData, G as GenLayerClient, e as GenLayerMethod, b as GenLayerRawTransaction, c as GenLayerTransaction, H as Hash, M as MethodDescription, N as Network, S as SnapSource, k as TransactionHash, w as TransactionHashVariant, m as TransactionResult, r as TransactionResultNameToNumber, l as TransactionStatus, u as TransactionType, V as VoteType, p as isDecidedState, q as transactionResultNumberToName, n as transactionsStatusNameToNumber, t as transactionsStatusNumberToName, s as voteTypeNameToNumber, v as voteTypeNumberToName } from '../index-
|
|
3
|
-
export { G as GenLayerChain } from '../chains-
|
|
2
|
+
export { d as CalldataAddress, C as CalldataEncodable, i as ContractMethod, h as ContractMethodBase, f as ContractParamsArraySchemaElement, g as ContractParamsSchema, j as ContractSchema, o as DECIDED_STATES, a as DecodedCallData, D as DecodedDeployData, G as GenLayerClient, e as GenLayerMethod, b as GenLayerRawTransaction, c as GenLayerTransaction, H as Hash, M as MethodDescription, N as Network, S as SnapSource, k as TransactionHash, w as TransactionHashVariant, m as TransactionResult, r as TransactionResultNameToNumber, l as TransactionStatus, u as TransactionType, V as VoteType, p as isDecidedState, q as transactionResultNumberToName, n as transactionsStatusNameToNumber, t as transactionsStatusNumberToName, s as voteTypeNameToNumber, v as voteTypeNumberToName } from '../index-BYma5s90.cjs';
|
|
3
|
+
export { G as GenLayerChain } from '../chains-BIe_Q0mF.cjs';
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { Account, Address } from 'viem';
|
|
2
|
-
export { d as CalldataAddress, C as CalldataEncodable, i as ContractMethod, h as ContractMethodBase, f as ContractParamsArraySchemaElement, g as ContractParamsSchema, j as ContractSchema, o as DECIDED_STATES, a as DecodedCallData, D as DecodedDeployData, G as GenLayerClient, e as GenLayerMethod, b as GenLayerRawTransaction, c as GenLayerTransaction, H as Hash, M as MethodDescription, N as Network, S as SnapSource, k as TransactionHash, w as TransactionHashVariant, m as TransactionResult, r as TransactionResultNameToNumber, l as TransactionStatus, u as TransactionType, V as VoteType, p as isDecidedState, q as transactionResultNumberToName, n as transactionsStatusNameToNumber, t as transactionsStatusNumberToName, s as voteTypeNameToNumber, v as voteTypeNumberToName } from '../index-
|
|
3
|
-
export { G as GenLayerChain } from '../chains-
|
|
2
|
+
export { d as CalldataAddress, C as CalldataEncodable, i as ContractMethod, h as ContractMethodBase, f as ContractParamsArraySchemaElement, g as ContractParamsSchema, j as ContractSchema, o as DECIDED_STATES, a as DecodedCallData, D as DecodedDeployData, G as GenLayerClient, e as GenLayerMethod, b as GenLayerRawTransaction, c as GenLayerTransaction, H as Hash, M as MethodDescription, N as Network, S as SnapSource, k as TransactionHash, w as TransactionHashVariant, m as TransactionResult, r as TransactionResultNameToNumber, l as TransactionStatus, u as TransactionType, V as VoteType, p as isDecidedState, q as transactionResultNumberToName, n as transactionsStatusNameToNumber, t as transactionsStatusNumberToName, s as voteTypeNameToNumber, v as voteTypeNumberToName } from '../index-B2AY6_eD.js';
|
|
3
|
+
export { G as GenLayerChain } from '../chains-BIe_Q0mF.js';
|
package/package.json
CHANGED
package/src/chains/localnet.ts
CHANGED