genlayer-js 0.11.1 → 0.12.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/CHANGELOG.md +14 -0
- package/dist/{index-dnt5ldCd.d.ts → index-TWCEN45Z.d.ts} +2 -1
- package/dist/{index-BhRfI25e.d.cts → index-icLJcrDm.d.cts} +2 -1
- package/dist/index.cjs +19 -17
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +19 -17
- package/dist/types/index.d.cts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/package.json +1 -1
- package/src/transactions/actions.ts +19 -17
- package/src/types/contracts.ts +1 -0
- package/src/types/transactions.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
+
## 0.12.0 (2025-07-15)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* add payable to ContractMethod ([#96](https://github.com/genlayerlabs/genlayer-js/issues/96)) ([011a749](https://github.com/genlayerlabs/genlayer-js/commit/011a7498ffce22a34d20d9fb88a72e7c56badaf9))
|
|
9
|
+
|
|
10
|
+
## 0.11.2 (2025-07-10)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* handle new leader receipt and decode eq outputs ([#98](https://github.com/genlayerlabs/genlayer-js/issues/98)) ([fadb53d](https://github.com/genlayerlabs/genlayer-js/commit/fadb53d5f8946074a80047003323a0bd3d4f8108))
|
|
16
|
+
|
|
3
17
|
## 0.11.1 (2025-07-09)
|
|
4
18
|
|
|
5
19
|
## 0.11.0 (2025-05-28)
|
|
@@ -198,7 +198,7 @@ type GenLayerTransaction = {
|
|
|
198
198
|
pending_transactions: unknown[];
|
|
199
199
|
vote: string;
|
|
200
200
|
result: string;
|
|
201
|
-
};
|
|
201
|
+
}[];
|
|
202
202
|
validators?: Record<string, unknown>[];
|
|
203
203
|
votes?: Record<string, string>;
|
|
204
204
|
};
|
|
@@ -269,6 +269,7 @@ interface ContractMethodBase {
|
|
|
269
269
|
interface ContractMethod extends ContractMethodBase {
|
|
270
270
|
ret: ContractParamsSchema;
|
|
271
271
|
readonly: boolean;
|
|
272
|
+
payable?: boolean;
|
|
272
273
|
}
|
|
273
274
|
type ContractSchema = {
|
|
274
275
|
ctor: ContractMethodBase;
|
|
@@ -198,7 +198,7 @@ type GenLayerTransaction = {
|
|
|
198
198
|
pending_transactions: unknown[];
|
|
199
199
|
vote: string;
|
|
200
200
|
result: string;
|
|
201
|
-
};
|
|
201
|
+
}[];
|
|
202
202
|
validators?: Record<string, unknown>[];
|
|
203
203
|
votes?: Record<string, string>;
|
|
204
204
|
};
|
|
@@ -269,6 +269,7 @@ interface ContractMethodBase {
|
|
|
269
269
|
interface ContractMethod extends ContractMethodBase {
|
|
270
270
|
ret: ContractParamsSchema;
|
|
271
271
|
readonly: boolean;
|
|
272
|
+
payable?: boolean;
|
|
272
273
|
}
|
|
273
274
|
type ContractSchema = {
|
|
274
275
|
ctor: ContractMethodBase;
|
package/dist/index.cjs
CHANGED
|
@@ -819,23 +819,25 @@ var _decodeLocalnetTransaction = (tx) => {
|
|
|
819
819
|
try {
|
|
820
820
|
const leaderReceipt = _optionalChain([tx, 'access', _31 => _31.consensus_data, 'optionalAccess', _32 => _32.leader_receipt]);
|
|
821
821
|
if (leaderReceipt) {
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
822
|
+
const receipts = Array.isArray(leaderReceipt) ? leaderReceipt : [leaderReceipt];
|
|
823
|
+
receipts.forEach((receipt) => {
|
|
824
|
+
if (receipt.result && typeof receipt.result === "string") {
|
|
825
|
+
receipt.result = resultToUserFriendlyJson(receipt.result);
|
|
826
|
+
}
|
|
827
|
+
if (receipt.calldata && typeof receipt.calldata === "string") {
|
|
828
|
+
receipt.calldata = {
|
|
829
|
+
base64: receipt.calldata,
|
|
830
|
+
...calldataToUserFriendlyJson(b64ToArray(receipt.calldata))
|
|
831
|
+
};
|
|
832
|
+
}
|
|
833
|
+
if (receipt.eq_outputs) {
|
|
834
|
+
receipt.eq_outputs = Object.fromEntries(
|
|
835
|
+
Object.entries(receipt.eq_outputs).map(([key, value]) => {
|
|
836
|
+
return [key, resultToUserFriendlyJson(String(value))];
|
|
837
|
+
})
|
|
838
|
+
);
|
|
839
|
+
}
|
|
840
|
+
});
|
|
839
841
|
}
|
|
840
842
|
if (_optionalChain([tx, 'access', _33 => _33.data, 'optionalAccess', _34 => _34.calldata]) && typeof tx.data.calldata === "string") {
|
|
841
843
|
tx.data.calldata = {
|
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as viem from 'viem';
|
|
2
2
|
import { Account, Address } from 'viem';
|
|
3
3
|
import { G as GenLayerChain } from './chains-BYSCF33g.cjs';
|
|
4
|
-
import { G as GenLayerClient, C as CalldataEncodable, T as TransactionDataElement } from './index-
|
|
4
|
+
import { G as GenLayerClient, C as CalldataEncodable, T as TransactionDataElement } from './index-icLJcrDm.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 } from 'viem';
|
|
3
3
|
import { G as GenLayerChain } from './chains-BYSCF33g.js';
|
|
4
|
-
import { G as GenLayerClient, C as CalldataEncodable, T as TransactionDataElement } from './index-
|
|
4
|
+
import { G as GenLayerClient, C as CalldataEncodable, T as TransactionDataElement } from './index-TWCEN45Z.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
|
@@ -819,23 +819,25 @@ var _decodeLocalnetTransaction = (tx) => {
|
|
|
819
819
|
try {
|
|
820
820
|
const leaderReceipt = tx.consensus_data?.leader_receipt;
|
|
821
821
|
if (leaderReceipt) {
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
822
|
+
const receipts = Array.isArray(leaderReceipt) ? leaderReceipt : [leaderReceipt];
|
|
823
|
+
receipts.forEach((receipt) => {
|
|
824
|
+
if (receipt.result && typeof receipt.result === "string") {
|
|
825
|
+
receipt.result = resultToUserFriendlyJson(receipt.result);
|
|
826
|
+
}
|
|
827
|
+
if (receipt.calldata && typeof receipt.calldata === "string") {
|
|
828
|
+
receipt.calldata = {
|
|
829
|
+
base64: receipt.calldata,
|
|
830
|
+
...calldataToUserFriendlyJson(b64ToArray(receipt.calldata))
|
|
831
|
+
};
|
|
832
|
+
}
|
|
833
|
+
if (receipt.eq_outputs) {
|
|
834
|
+
receipt.eq_outputs = Object.fromEntries(
|
|
835
|
+
Object.entries(receipt.eq_outputs).map(([key, value]) => {
|
|
836
|
+
return [key, resultToUserFriendlyJson(String(value))];
|
|
837
|
+
})
|
|
838
|
+
);
|
|
839
|
+
}
|
|
840
|
+
});
|
|
839
841
|
}
|
|
840
842
|
if (tx.data?.calldata && typeof tx.data.calldata === "string") {
|
|
841
843
|
tx.data.calldata = {
|
package/dist/types/index.d.cts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { Account, Address } from 'viem';
|
|
2
|
-
export { a as CalldataAddress, C as CalldataEncodable, f as ContractMethod, e as ContractMethodBase, c as ContractParamsArraySchemaElement, d as ContractParamsSchema, g as ContractSchema, q as DecodedCallData, D as DecodedDeployData, G as GenLayerClient, b as GenLayerMethod, s as GenLayerRawTransaction, r as GenLayerTransaction, H as Hash, M as MethodDescription, N as Network, S as SnapSource, h as TransactionHash, p as TransactionHashVariant, j as TransactionResult, m as TransactionResultNameToNumber, i as TransactionStatus, o as TransactionType, V as VoteType, l as transactionResultNumberToName, k as transactionsStatusNameToNumber, t as transactionsStatusNumberToName, n as voteTypeNameToNumber, v as voteTypeNumberToName } from '../index-
|
|
2
|
+
export { a as CalldataAddress, C as CalldataEncodable, f as ContractMethod, e as ContractMethodBase, c as ContractParamsArraySchemaElement, d as ContractParamsSchema, g as ContractSchema, q as DecodedCallData, D as DecodedDeployData, G as GenLayerClient, b as GenLayerMethod, s as GenLayerRawTransaction, r as GenLayerTransaction, H as Hash, M as MethodDescription, N as Network, S as SnapSource, h as TransactionHash, p as TransactionHashVariant, j as TransactionResult, m as TransactionResultNameToNumber, i as TransactionStatus, o as TransactionType, V as VoteType, l as transactionResultNumberToName, k as transactionsStatusNameToNumber, t as transactionsStatusNumberToName, n as voteTypeNameToNumber, v as voteTypeNumberToName } from '../index-icLJcrDm.cjs';
|
|
3
3
|
export { G as GenLayerChain } from '../chains-BYSCF33g.cjs';
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { Account, Address } from 'viem';
|
|
2
|
-
export { a as CalldataAddress, C as CalldataEncodable, f as ContractMethod, e as ContractMethodBase, c as ContractParamsArraySchemaElement, d as ContractParamsSchema, g as ContractSchema, q as DecodedCallData, D as DecodedDeployData, G as GenLayerClient, b as GenLayerMethod, s as GenLayerRawTransaction, r as GenLayerTransaction, H as Hash, M as MethodDescription, N as Network, S as SnapSource, h as TransactionHash, p as TransactionHashVariant, j as TransactionResult, m as TransactionResultNameToNumber, i as TransactionStatus, o as TransactionType, V as VoteType, l as transactionResultNumberToName, k as transactionsStatusNameToNumber, t as transactionsStatusNumberToName, n as voteTypeNameToNumber, v as voteTypeNumberToName } from '../index-
|
|
2
|
+
export { a as CalldataAddress, C as CalldataEncodable, f as ContractMethod, e as ContractMethodBase, c as ContractParamsArraySchemaElement, d as ContractParamsSchema, g as ContractSchema, q as DecodedCallData, D as DecodedDeployData, G as GenLayerClient, b as GenLayerMethod, s as GenLayerRawTransaction, r as GenLayerTransaction, H as Hash, M as MethodDescription, N as Network, S as SnapSource, h as TransactionHash, p as TransactionHashVariant, j as TransactionResult, m as TransactionResultNameToNumber, i as TransactionStatus, o as TransactionType, V as VoteType, l as transactionResultNumberToName, k as transactionsStatusNameToNumber, t as transactionsStatusNumberToName, n as voteTypeNameToNumber, v as voteTypeNumberToName } from '../index-TWCEN45Z.js';
|
|
3
3
|
export { G as GenLayerChain } from '../chains-BYSCF33g.js';
|
package/package.json
CHANGED
|
@@ -188,23 +188,25 @@ const _decodeLocalnetTransaction = (tx: GenLayerTransaction): GenLayerTransactio
|
|
|
188
188
|
try {
|
|
189
189
|
const leaderReceipt = tx.consensus_data?.leader_receipt;
|
|
190
190
|
if (leaderReceipt) {
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
191
|
+
const receipts = Array.isArray(leaderReceipt) ? leaderReceipt : [leaderReceipt];
|
|
192
|
+
receipts.forEach((receipt) => {
|
|
193
|
+
if (receipt.result && typeof receipt.result === "string") {
|
|
194
|
+
receipt.result = resultToUserFriendlyJson(receipt.result);
|
|
195
|
+
}
|
|
196
|
+
if (receipt.calldata && typeof receipt.calldata === "string") {
|
|
197
|
+
receipt.calldata = {
|
|
198
|
+
base64: receipt.calldata as string,
|
|
199
|
+
...calldataToUserFriendlyJson(b64ToArray(receipt.calldata as string)),
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
if (receipt.eq_outputs) {
|
|
203
|
+
receipt.eq_outputs = Object.fromEntries(
|
|
204
|
+
Object.entries(receipt.eq_outputs).map(([key, value]) => {
|
|
205
|
+
return [key, resultToUserFriendlyJson(String(value))];
|
|
206
|
+
}),
|
|
207
|
+
);
|
|
208
|
+
}
|
|
209
|
+
});
|
|
208
210
|
}
|
|
209
211
|
if (tx.data?.calldata && typeof tx.data.calldata === "string") {
|
|
210
212
|
tx.data.calldata = {
|
package/src/types/contracts.ts
CHANGED