@arkiv-network/sdk 0.7.0-dev.1 → 0.8.0-advanced.2
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 +71 -16
- package/dist/actions/advanced/index.cjs +13 -0
- package/dist/actions/advanced/index.d.cts +8 -0
- package/dist/actions/advanced/index.d.ts +9 -0
- package/dist/actions/advanced/index.js +9 -0
- package/dist/advanced-8ZPTmmaN.js +598 -0
- package/dist/advanced-8ZPTmmaN.js.map +1 -0
- package/dist/advanced-fPImL6lW.cjs +656 -0
- package/dist/arkivTransactions-D74gERHG.d.cts +571 -0
- package/dist/arkivTransactions-D74gERHG.d.cts.map +1 -0
- package/dist/arkivTransactions-NtGD6uk5.d.ts +571 -0
- package/dist/arkivTransactions-NtGD6uk5.d.ts.map +1 -0
- package/dist/attr/index.cjs +35 -0
- package/dist/attr/index.d.cts +2 -0
- package/dist/attr/index.d.ts +3 -0
- package/dist/attr/index.js +4 -0
- package/dist/attributes-BhY5DwJp.js +809 -0
- package/dist/attributes-BhY5DwJp.js.map +1 -0
- package/dist/attributes-Df9IsCVs.cjs +1029 -0
- package/dist/chains/index.cjs +2 -3
- package/dist/chains/index.d.cts +22 -60
- package/dist/chains/index.d.cts.map +1 -1
- package/dist/chains/index.d.ts +22 -60
- package/dist/chains/index.d.ts.map +1 -1
- package/dist/chains/index.js +2 -2
- package/dist/chains-BJrZs6sG.js +57 -0
- package/dist/chains-BJrZs6sG.js.map +1 -0
- package/dist/chains-BYRTTipa.cjs +73 -0
- package/dist/codec-Car3KkFF.d.ts +102 -0
- package/dist/codec-Car3KkFF.d.ts.map +1 -0
- package/dist/entity/index.cjs +20 -0
- package/dist/entity/index.d.cts +4 -0
- package/dist/entity/index.d.ts +5 -0
- package/dist/entity/index.js +7 -0
- package/dist/entity-B00Li04j.cjs +71 -0
- package/dist/entity-B7G8q_Eo.cjs +0 -0
- package/dist/entity-BYQR1uoe.js +67 -0
- package/dist/entity-BYQR1uoe.js.map +1 -0
- package/dist/entity-CD_qFF2M.js +0 -0
- package/dist/errors-BVbjKVMN.cjs +56 -0
- package/dist/errors-LTe7bOYS.js +33 -0
- package/dist/errors-LTe7bOYS.js.map +1 -0
- package/dist/expiry-BELY2Kpw.cjs +135 -0
- package/dist/expiry-BjpxZZQU.js +95 -0
- package/dist/expiry-BjpxZZQU.js.map +1 -0
- package/dist/expiry-DRV29F1r.d.cts +79 -0
- package/dist/expiry-DRV29F1r.d.cts.map +1 -0
- package/dist/expiry-nDbCgZX4.d.ts +79 -0
- package/dist/expiry-nDbCgZX4.d.ts.map +1 -0
- package/dist/flags-5dTNRnow.d.ts +41 -0
- package/dist/flags-5dTNRnow.d.ts.map +1 -0
- package/dist/flags-CRjPpoh3.d.cts +41 -0
- package/dist/flags-CRjPpoh3.d.cts.map +1 -0
- package/dist/flags-DFBs2J94.js +33 -0
- package/dist/flags-DFBs2J94.js.map +1 -0
- package/dist/flags-kr276q6i.cjs +43 -0
- package/dist/index-B5j76711.d.ts +184 -0
- package/dist/index-B5j76711.d.ts.map +1 -0
- package/dist/index-BF7Mq9Is.d.cts +280 -0
- package/dist/index-BF7Mq9Is.d.cts.map +1 -0
- package/dist/index-CA4V7Pdh.d.cts +167 -0
- package/dist/index-CA4V7Pdh.d.cts.map +1 -0
- package/dist/index-CV5zCdpa.d.cts +417 -0
- package/dist/index-CV5zCdpa.d.cts.map +1 -0
- package/dist/index-DHDud2hC.d.ts +280 -0
- package/dist/index-DHDud2hC.d.ts.map +1 -0
- package/dist/index-DvYvrkdk.d.ts +320 -0
- package/dist/index-DvYvrkdk.d.ts.map +1 -0
- package/dist/index-EeUO0nnJ.d.cts +184 -0
- package/dist/index-EeUO0nnJ.d.cts.map +1 -0
- package/dist/index-fX_XyqLp.d.ts +167 -0
- package/dist/index-fX_XyqLp.d.ts.map +1 -0
- package/dist/index.cjs +411 -405
- package/dist/index.d.cts +360 -209
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +361 -209
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +342 -387
- package/dist/index.js.map +1 -1
- package/dist/key-D1Bh7MF0.js +70 -0
- package/dist/key-D1Bh7MF0.js.map +1 -0
- package/dist/key-WKhXnXuU.cjs +98 -0
- package/dist/logger-CVpvU8ik.js +153 -0
- package/dist/logger-CVpvU8ik.js.map +1 -0
- package/dist/logger-Cr15lPAQ.cjs +188 -0
- package/dist/payload-BNoud2KZ.d.cts +94 -0
- package/dist/payload-BNoud2KZ.d.cts.map +1 -0
- package/dist/payload-Bz6651ax.js +67 -0
- package/dist/payload-Bz6651ax.js.map +1 -0
- package/dist/payload-CcUj85ys.d.ts +94 -0
- package/dist/payload-CcUj85ys.d.ts.map +1 -0
- package/dist/payload-KC14SDlN.cjs +83 -0
- package/dist/query/index.cjs +26 -150
- package/dist/query/index.d.cts +5 -3
- package/dist/query/index.d.ts +6 -3
- package/dist/query/index.js +8 -138
- package/dist/queryBuilder-DM6AWCBa.js +820 -0
- package/dist/queryBuilder-DM6AWCBa.js.map +1 -0
- package/dist/queryBuilder-DbUMEZln.cjs +944 -0
- package/dist/selection-C4UhsMOO.d.ts +434 -0
- package/dist/selection-C4UhsMOO.d.ts.map +1 -0
- package/dist/selection-DPg0uyJf.d.cts +433 -0
- package/dist/selection-DPg0uyJf.d.cts.map +1 -0
- package/dist/types/index.cjs +3 -3
- package/dist/types/index.d.cts +7 -2
- package/dist/types/index.d.ts +8 -2
- package/dist/types/index.js +3 -3
- package/dist/types-Bu_ZwMbZ.js +0 -0
- package/dist/types-NRqymi6S.cjs +0 -0
- package/dist/utils/index.cjs +4 -17
- package/dist/utils/index.d.cts +3 -17
- package/dist/utils/index.d.ts +3 -17
- package/dist/utils/index.js +4 -18
- package/package.json +26 -5
- package/src/actions/advanced/advanced.test.ts +258 -0
- package/src/actions/advanced/buildMutation.ts +104 -0
- package/src/actions/advanced/getMutationResult.ts +112 -0
- package/src/actions/advanced/index.ts +21 -0
- package/src/actions/advanced/pingTransaction.ts +43 -0
- package/src/actions/advanced/sendMutation.ts +59 -0
- package/src/actions/public/getEntity.ts +27 -43
- package/src/actions/public/getEntityNonce.ts +30 -0
- package/src/actions/public/predictEntityKeys.test.ts +143 -0
- package/src/actions/public/predictEntityKeys.ts +138 -0
- package/src/actions/public/query.ts +35 -67
- package/src/actions/public/watchEntityEvents.test.ts +414 -0
- package/src/actions/public/watchEntityEvents.ts +225 -0
- package/src/actions/wallet/changeOwnership.ts +2 -2
- package/src/actions/wallet/createEntity.ts +99 -24
- package/src/actions/wallet/extendEntity.ts +37 -13
- package/src/actions/wallet/mutateEntities.test.ts +76 -0
- package/src/actions/wallet/mutateEntities.ts +16 -33
- package/src/actions/wallet/patchEntity.ts +90 -0
- package/src/attr/attributes.test.ts +120 -0
- package/src/attr/attributes.ts +190 -0
- package/src/attr/codec.test.ts +162 -0
- package/src/attr/codec.ts +220 -0
- package/src/attr/decimal.ts +86 -0
- package/src/attr/errors.ts +145 -0
- package/src/attr/index.ts +50 -0
- package/src/attr/names.ts +106 -0
- package/src/attr/types.ts +150 -0
- package/src/attr/values.test.ts +271 -0
- package/src/attr/values.ts +502 -0
- package/src/chains/cheesecake.ts +22 -0
- package/src/chains/index.ts +1 -2
- package/src/clients/createPublicClient.test.ts +3 -5
- package/src/clients/createPublicClient.ts +5 -4
- package/src/clients/createWalletClient.test.ts +2 -2
- package/src/clients/createWalletClient.ts +13 -7
- package/src/clients/decorators/arkivAdvanced.ts +144 -0
- package/src/clients/decorators/arkivPublic.ts +172 -139
- package/src/clients/decorators/arkivWallet.ts +101 -94
- package/src/entity/create.test.ts +184 -0
- package/src/entity/errors.ts +38 -0
- package/src/entity/events.ts +16 -0
- package/src/entity/expiry.test.ts +195 -0
- package/src/entity/expiry.ts +181 -0
- package/src/entity/flags.ts +65 -0
- package/src/entity/index.ts +15 -0
- package/src/entity/key.ts +68 -0
- package/src/entity/operations.ts +134 -0
- package/src/entity/params.ts +15 -0
- package/src/errors.ts +26 -49
- package/src/index.ts +19 -0
- package/src/query/engine.ts +68 -137
- package/src/query/errors.ts +151 -0
- package/src/query/expression.test.ts +286 -0
- package/src/query/expression.ts +493 -0
- package/src/query/index.ts +40 -4
- package/src/query/injection.test.ts +151 -0
- package/src/query/queryBuilder.test.ts +342 -637
- package/src/query/queryBuilder.ts +133 -359
- package/src/query/queryResult.ts +54 -51
- package/src/query/selection.test.ts +48 -98
- package/src/query/selection.ts +77 -65
- package/src/types/entity.test.ts +44 -155
- package/src/types/entity.ts +60 -52
- package/src/types/events.ts +59 -16
- package/src/types/index.ts +20 -17
- package/src/types/rpcSchema.ts +69 -37
- package/src/utils/arkivTransactions.test.ts +600 -155
- package/src/utils/arkivTransactions.ts +350 -219
- package/src/utils/chains.test.ts +21 -24
- package/src/utils/compression.ts +1 -1
- package/src/utils/entities.test.ts +62 -0
- package/src/utils/entities.ts +109 -37
- package/src/utils/expirationTime.ts +114 -10
- package/src/utils/logger.ts +2 -2
- package/src/utils/revert.test.ts +99 -0
- package/src/utils/revert.ts +145 -0
- package/dist/chains-BifaY04V.cjs +0 -108
- package/dist/chains-CrtkVbBh.js +0 -86
- package/dist/chains-CrtkVbBh.js.map +0 -1
- package/dist/consts-Bz0LZQZY.js +0 -7
- package/dist/consts-Bz0LZQZY.js.map +0 -1
- package/dist/consts-CxT1-RXU.cjs +0 -18
- package/dist/entity-BhSXaB23.cjs +0 -81
- package/dist/entity-CN41IOrq.d.cts +0 -401
- package/dist/entity-CN41IOrq.d.cts.map +0 -1
- package/dist/entity-DGfVyB-a.js +0 -71
- package/dist/entity-DGfVyB-a.js.map +0 -1
- package/dist/entity-NnEVlePN.d.ts +0 -401
- package/dist/entity-NnEVlePN.d.ts.map +0 -1
- package/dist/index-ClkpS6s_.d.ts +0 -481
- package/dist/index-ClkpS6s_.d.ts.map +0 -1
- package/dist/index-w4qop0Pe.d.cts +0 -481
- package/dist/index-w4qop0Pe.d.cts.map +0 -1
- package/dist/payload-BpNUPOnY.js +0 -13
- package/dist/payload-BpNUPOnY.js.map +0 -1
- package/dist/payload-C2KHOUoj.d.ts +0 -6
- package/dist/payload-C2KHOUoj.d.ts.map +0 -1
- package/dist/payload-CJN8fTvX.d.cts +0 -6
- package/dist/payload-CJN8fTvX.d.cts.map +0 -1
- package/dist/payload-D8YLKcJj.cjs +0 -23
- package/dist/query/index.js.map +0 -1
- package/dist/queryBuilder-BE_XhLLa.js +0 -735
- package/dist/queryBuilder-BE_XhLLa.js.map +0 -1
- package/dist/queryBuilder-J37buGCi.cjs +0 -865
- package/dist/utils/index.d.cts.map +0 -1
- package/dist/utils/index.d.ts.map +0 -1
- package/dist/utils/index.js.map +0 -1
- package/src/actions/public/buildQuery.ts +0 -10
- package/src/actions/public/subscribeEntityEvents.ts +0 -93
- package/src/actions/wallet/updateEntity.ts +0 -59
- package/src/chains/braga.ts +0 -26
- package/src/chains/kaolin.ts +0 -29
- package/src/query/engine.test.ts +0 -571
- package/src/query/predicate.test.ts +0 -461
- package/src/query/predicate.ts +0 -144
- package/src/query/queryResult.test.ts +0 -270
- package/src/query/selectQueryBuilder.test.ts +0 -213
- package/src/types/attributes.ts +0 -28
- package/src/utils/validation.test.ts +0 -106
- package/src/utils/validation.ts +0 -80
- /package/dist/{types-Ci4BRClw.js → attr-DlmErkvR.cjs} +0 -0
- /package/dist/{types-a8gm_IaQ.cjs → attr-GcQKatub.js} +0 -0
package/dist/chains/index.cjs
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
const require_chains = require('../chains-
|
|
1
|
+
const require_chains = require('../chains-BYRTTipa.cjs');
|
|
2
2
|
|
|
3
|
-
exports.
|
|
4
|
-
exports.kaolin = require_chains.kaolin;
|
|
3
|
+
exports.cheesecake = require_chains.cheesecake;
|
|
5
4
|
exports.localhost = require_chains.localhost;
|
package/dist/chains/index.d.cts
CHANGED
|
@@ -1,60 +1,22 @@
|
|
|
1
1
|
import * as viem8 from "viem";
|
|
2
2
|
|
|
3
|
-
//#region src/chains/
|
|
4
|
-
declare const braga: {
|
|
5
|
-
blockExplorers: {
|
|
6
|
-
readonly default: {
|
|
7
|
-
readonly name: "Braga Arkiv Explorer";
|
|
8
|
-
readonly url: "https://explorer.braga.hoodi.arkiv.network";
|
|
9
|
-
readonly apiUrl: "https://explorer.braga.hoodi.arkiv.network/api";
|
|
10
|
-
};
|
|
11
|
-
};
|
|
12
|
-
blockTime?: number | undefined | undefined;
|
|
13
|
-
contracts?: {
|
|
14
|
-
[x: string]: viem8.ChainContract | {
|
|
15
|
-
[sourceId: number]: viem8.ChainContract | undefined;
|
|
16
|
-
} | undefined;
|
|
17
|
-
ensRegistry?: viem8.ChainContract | undefined;
|
|
18
|
-
ensUniversalResolver?: viem8.ChainContract | undefined;
|
|
19
|
-
multicall3?: viem8.ChainContract | undefined;
|
|
20
|
-
erc6492Verifier?: viem8.ChainContract | undefined;
|
|
21
|
-
} | undefined;
|
|
22
|
-
ensTlds?: readonly string[] | undefined;
|
|
23
|
-
id: 60138453102;
|
|
24
|
-
name: "Braga";
|
|
25
|
-
nativeCurrency: {
|
|
26
|
-
readonly name: "Golem";
|
|
27
|
-
readonly symbol: "GLM";
|
|
28
|
-
readonly decimals: 18;
|
|
29
|
-
};
|
|
30
|
-
experimental_preconfirmationTime?: number | undefined | undefined;
|
|
31
|
-
rpcUrls: {
|
|
32
|
-
readonly default: {
|
|
33
|
-
readonly http: readonly ["https://braga.hoodi.arkiv.network/rpc"];
|
|
34
|
-
readonly webSocket: readonly ["wss://braga.hoodi.arkiv.network/rpc/ws"];
|
|
35
|
-
};
|
|
36
|
-
};
|
|
37
|
-
sourceId?: number | undefined | undefined;
|
|
38
|
-
testnet: true;
|
|
39
|
-
custom?: Record<string, unknown> | undefined;
|
|
40
|
-
fees?: viem8.ChainFees<undefined> | undefined;
|
|
41
|
-
formatters?: undefined;
|
|
42
|
-
serializers?: viem8.ChainSerializers<undefined, viem8.TransactionSerializable> | undefined;
|
|
43
|
-
readonly network: "braga";
|
|
44
|
-
};
|
|
45
|
-
//#endregion
|
|
46
|
-
//#region src/chains/kaolin.d.ts
|
|
3
|
+
//#region src/chains/cheesecake.d.ts
|
|
47
4
|
/**
|
|
48
|
-
*
|
|
5
|
+
* Cheesecake is Arkiv's testnet.
|
|
49
6
|
*/
|
|
50
|
-
declare const
|
|
51
|
-
blockExplorers
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
7
|
+
declare const cheesecake: {
|
|
8
|
+
blockExplorers?: {
|
|
9
|
+
[key: string]: {
|
|
10
|
+
name: string;
|
|
11
|
+
url: string;
|
|
12
|
+
apiUrl?: string | undefined;
|
|
56
13
|
};
|
|
57
|
-
|
|
14
|
+
default: {
|
|
15
|
+
name: string;
|
|
16
|
+
url: string;
|
|
17
|
+
apiUrl?: string | undefined;
|
|
18
|
+
};
|
|
19
|
+
} | undefined | undefined;
|
|
58
20
|
blockTime?: number | undefined | undefined;
|
|
59
21
|
contracts?: {
|
|
60
22
|
[x: string]: viem8.ChainContract | {
|
|
@@ -66,18 +28,18 @@ declare const kaolin: {
|
|
|
66
28
|
erc6492Verifier?: viem8.ChainContract | undefined;
|
|
67
29
|
} | undefined;
|
|
68
30
|
ensTlds?: readonly string[] | undefined;
|
|
69
|
-
id:
|
|
70
|
-
name: "
|
|
31
|
+
id: 7733102;
|
|
32
|
+
name: "Cheesecake";
|
|
71
33
|
nativeCurrency: {
|
|
72
|
-
readonly name: "
|
|
73
|
-
readonly symbol: "
|
|
34
|
+
readonly name: "Golem";
|
|
35
|
+
readonly symbol: "GLM";
|
|
74
36
|
readonly decimals: 18;
|
|
75
37
|
};
|
|
76
38
|
experimental_preconfirmationTime?: number | undefined | undefined;
|
|
77
39
|
rpcUrls: {
|
|
78
40
|
readonly default: {
|
|
79
|
-
readonly http: readonly ["https://
|
|
80
|
-
readonly webSocket: readonly ["wss://
|
|
41
|
+
readonly http: readonly ["https://rpc.cheesecake.db-chain.devnet.gobas.me"];
|
|
42
|
+
readonly webSocket: readonly ["wss://rpc.cheesecake.db-chain.devnet.gobas.me"];
|
|
81
43
|
};
|
|
82
44
|
};
|
|
83
45
|
sourceId?: number | undefined | undefined;
|
|
@@ -86,7 +48,7 @@ declare const kaolin: {
|
|
|
86
48
|
fees?: viem8.ChainFees<undefined> | undefined;
|
|
87
49
|
formatters?: undefined;
|
|
88
50
|
serializers?: viem8.ChainSerializers<undefined, viem8.TransactionSerializable> | undefined;
|
|
89
|
-
readonly network: "
|
|
51
|
+
readonly network: "cheesecake";
|
|
90
52
|
};
|
|
91
53
|
//#endregion
|
|
92
54
|
//#region src/chains/localhost.d.ts
|
|
@@ -135,5 +97,5 @@ declare const localhost: {
|
|
|
135
97
|
serializers?: viem8.ChainSerializers<undefined, viem8.TransactionSerializable> | undefined;
|
|
136
98
|
};
|
|
137
99
|
//#endregion
|
|
138
|
-
export {
|
|
100
|
+
export { cheesecake, localhost };
|
|
139
101
|
//# sourceMappingURL=index.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../../src/chains/
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../../src/chains/cheesecake.ts","../../src/chains/localhost.ts"],"sourcesContent":[],"mappings":";;;;;;AAKa,cAAA,UAgBX,EAAA;EAAA,cAAA,CAAA,EAAA;;;;;;;;;;;;;;ICnBW,CAAA,CAAA,EAAA,MAWX,CAAA,EDQA,KAAA,CAAA,aAAA,GCRA;MAAA,CAAA,QAAA,EAAA,MAAA,CAAA,wBAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAXW;;;MDGA,IAAA,EAgBX,MAAA;MAAA,GAAA,EAAA,MAAA;;;;;;;;;;;iBCRA,KAAA,CAAA,aAAA;;;IAXW,WAWX,CAAA,wBAAA,SAAA;IAAA,oBAAA,CAAA,wBAAA,SAAA"}
|
package/dist/chains/index.d.ts
CHANGED
|
@@ -1,60 +1,22 @@
|
|
|
1
1
|
import * as viem8 from "viem";
|
|
2
2
|
|
|
3
|
-
//#region src/chains/
|
|
4
|
-
declare const braga: {
|
|
5
|
-
blockExplorers: {
|
|
6
|
-
readonly default: {
|
|
7
|
-
readonly name: "Braga Arkiv Explorer";
|
|
8
|
-
readonly url: "https://explorer.braga.hoodi.arkiv.network";
|
|
9
|
-
readonly apiUrl: "https://explorer.braga.hoodi.arkiv.network/api";
|
|
10
|
-
};
|
|
11
|
-
};
|
|
12
|
-
blockTime?: number | undefined | undefined;
|
|
13
|
-
contracts?: {
|
|
14
|
-
[x: string]: viem8.ChainContract | {
|
|
15
|
-
[sourceId: number]: viem8.ChainContract | undefined;
|
|
16
|
-
} | undefined;
|
|
17
|
-
ensRegistry?: viem8.ChainContract | undefined;
|
|
18
|
-
ensUniversalResolver?: viem8.ChainContract | undefined;
|
|
19
|
-
multicall3?: viem8.ChainContract | undefined;
|
|
20
|
-
erc6492Verifier?: viem8.ChainContract | undefined;
|
|
21
|
-
} | undefined;
|
|
22
|
-
ensTlds?: readonly string[] | undefined;
|
|
23
|
-
id: 60138453102;
|
|
24
|
-
name: "Braga";
|
|
25
|
-
nativeCurrency: {
|
|
26
|
-
readonly name: "Golem";
|
|
27
|
-
readonly symbol: "GLM";
|
|
28
|
-
readonly decimals: 18;
|
|
29
|
-
};
|
|
30
|
-
experimental_preconfirmationTime?: number | undefined | undefined;
|
|
31
|
-
rpcUrls: {
|
|
32
|
-
readonly default: {
|
|
33
|
-
readonly http: readonly ["https://braga.hoodi.arkiv.network/rpc"];
|
|
34
|
-
readonly webSocket: readonly ["wss://braga.hoodi.arkiv.network/rpc/ws"];
|
|
35
|
-
};
|
|
36
|
-
};
|
|
37
|
-
sourceId?: number | undefined | undefined;
|
|
38
|
-
testnet: true;
|
|
39
|
-
custom?: Record<string, unknown> | undefined;
|
|
40
|
-
fees?: viem8.ChainFees<undefined> | undefined;
|
|
41
|
-
formatters?: undefined;
|
|
42
|
-
serializers?: viem8.ChainSerializers<undefined, viem8.TransactionSerializable> | undefined;
|
|
43
|
-
readonly network: "braga";
|
|
44
|
-
};
|
|
45
|
-
//#endregion
|
|
46
|
-
//#region src/chains/kaolin.d.ts
|
|
3
|
+
//#region src/chains/cheesecake.d.ts
|
|
47
4
|
/**
|
|
48
|
-
*
|
|
5
|
+
* Cheesecake is Arkiv's testnet.
|
|
49
6
|
*/
|
|
50
|
-
declare const
|
|
51
|
-
blockExplorers
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
7
|
+
declare const cheesecake: {
|
|
8
|
+
blockExplorers?: {
|
|
9
|
+
[key: string]: {
|
|
10
|
+
name: string;
|
|
11
|
+
url: string;
|
|
12
|
+
apiUrl?: string | undefined;
|
|
56
13
|
};
|
|
57
|
-
|
|
14
|
+
default: {
|
|
15
|
+
name: string;
|
|
16
|
+
url: string;
|
|
17
|
+
apiUrl?: string | undefined;
|
|
18
|
+
};
|
|
19
|
+
} | undefined | undefined;
|
|
58
20
|
blockTime?: number | undefined | undefined;
|
|
59
21
|
contracts?: {
|
|
60
22
|
[x: string]: viem8.ChainContract | {
|
|
@@ -66,18 +28,18 @@ declare const kaolin: {
|
|
|
66
28
|
erc6492Verifier?: viem8.ChainContract | undefined;
|
|
67
29
|
} | undefined;
|
|
68
30
|
ensTlds?: readonly string[] | undefined;
|
|
69
|
-
id:
|
|
70
|
-
name: "
|
|
31
|
+
id: 7733102;
|
|
32
|
+
name: "Cheesecake";
|
|
71
33
|
nativeCurrency: {
|
|
72
|
-
readonly name: "
|
|
73
|
-
readonly symbol: "
|
|
34
|
+
readonly name: "Golem";
|
|
35
|
+
readonly symbol: "GLM";
|
|
74
36
|
readonly decimals: 18;
|
|
75
37
|
};
|
|
76
38
|
experimental_preconfirmationTime?: number | undefined | undefined;
|
|
77
39
|
rpcUrls: {
|
|
78
40
|
readonly default: {
|
|
79
|
-
readonly http: readonly ["https://
|
|
80
|
-
readonly webSocket: readonly ["wss://
|
|
41
|
+
readonly http: readonly ["https://rpc.cheesecake.db-chain.devnet.gobas.me"];
|
|
42
|
+
readonly webSocket: readonly ["wss://rpc.cheesecake.db-chain.devnet.gobas.me"];
|
|
81
43
|
};
|
|
82
44
|
};
|
|
83
45
|
sourceId?: number | undefined | undefined;
|
|
@@ -86,7 +48,7 @@ declare const kaolin: {
|
|
|
86
48
|
fees?: viem8.ChainFees<undefined> | undefined;
|
|
87
49
|
formatters?: undefined;
|
|
88
50
|
serializers?: viem8.ChainSerializers<undefined, viem8.TransactionSerializable> | undefined;
|
|
89
|
-
readonly network: "
|
|
51
|
+
readonly network: "cheesecake";
|
|
90
52
|
};
|
|
91
53
|
//#endregion
|
|
92
54
|
//#region src/chains/localhost.d.ts
|
|
@@ -135,5 +97,5 @@ declare const localhost: {
|
|
|
135
97
|
serializers?: viem8.ChainSerializers<undefined, viem8.TransactionSerializable> | undefined;
|
|
136
98
|
};
|
|
137
99
|
//#endregion
|
|
138
|
-
export {
|
|
100
|
+
export { cheesecake, localhost };
|
|
139
101
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/chains/
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/chains/cheesecake.ts","../../src/chains/localhost.ts"],"sourcesContent":[],"mappings":";;;;;;AAKa,cAAA,UAgBX,EAAA;EAAA,cAAA,CAAA,EAAA;;;;;;;;;;;;;;ICnBW,CAAA,CAAA,EAAA,MAWX,CAAA,EDQA,KAAA,CAAA,aAAA,GCRA;MAAA,CAAA,QAAA,EAAA,MAAA,CAAA,wBAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAXW;;;MDGA,IAAA,EAgBX,MAAA;MAAA,GAAA,EAAA,MAAA;;;;;;;;;;;iBCRA,KAAA,CAAA,aAAA;;;IAXW,WAWX,CAAA,wBAAA,SAAA;IAAA,oBAAA,CAAA,wBAAA,SAAA"}
|
package/dist/chains/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as localhost, r as cheesecake } from "../chains-BJrZs6sG.js";
|
|
2
2
|
|
|
3
|
-
export {
|
|
3
|
+
export { cheesecake, localhost };
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { defineChain } from "viem";
|
|
2
|
+
|
|
3
|
+
//#region rolldown:runtime
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __export = (all) => {
|
|
6
|
+
let target = {};
|
|
7
|
+
for (var name in all) __defProp(target, name, {
|
|
8
|
+
get: all[name],
|
|
9
|
+
enumerable: true
|
|
10
|
+
});
|
|
11
|
+
return target;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
//#endregion
|
|
15
|
+
//#region src/chains/cheesecake.ts
|
|
16
|
+
/**
|
|
17
|
+
* Cheesecake is Arkiv's testnet.
|
|
18
|
+
*/
|
|
19
|
+
const cheesecake = defineChain({
|
|
20
|
+
id: 7733102,
|
|
21
|
+
name: "Cheesecake",
|
|
22
|
+
network: "cheesecake",
|
|
23
|
+
nativeCurrency: {
|
|
24
|
+
name: "Golem",
|
|
25
|
+
symbol: "GLM",
|
|
26
|
+
decimals: 18
|
|
27
|
+
},
|
|
28
|
+
rpcUrls: { default: {
|
|
29
|
+
http: ["https://rpc.cheesecake.db-chain.devnet.gobas.me"],
|
|
30
|
+
webSocket: ["wss://rpc.cheesecake.db-chain.devnet.gobas.me"]
|
|
31
|
+
} },
|
|
32
|
+
testnet: true
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
//#endregion
|
|
36
|
+
//#region src/chains/localhost.ts
|
|
37
|
+
const localhost = defineChain({
|
|
38
|
+
id: 1337,
|
|
39
|
+
name: "Localhost",
|
|
40
|
+
nativeCurrency: {
|
|
41
|
+
decimals: 18,
|
|
42
|
+
name: "Ether",
|
|
43
|
+
symbol: "ETH"
|
|
44
|
+
},
|
|
45
|
+
rpcUrls: { default: { http: ["http://127.0.0.1:8545"] } }
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
//#endregion
|
|
49
|
+
//#region src/chains/index.ts
|
|
50
|
+
var chains_exports = /* @__PURE__ */ __export({
|
|
51
|
+
cheesecake: () => cheesecake,
|
|
52
|
+
localhost: () => localhost
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
//#endregion
|
|
56
|
+
export { localhost as n, cheesecake as r, chains_exports as t };
|
|
57
|
+
//# sourceMappingURL=chains-BJrZs6sG.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chains-BJrZs6sG.js","names":[],"sources":["../src/chains/cheesecake.ts","../src/chains/localhost.ts","../src/chains/index.ts"],"sourcesContent":["import { defineChain } from \"viem\"\n\n/**\n * Cheesecake is Arkiv's testnet.\n */\nexport const cheesecake = defineChain({\n id: 7733102,\n name: \"Cheesecake\",\n network: \"cheesecake\",\n nativeCurrency: {\n name: \"Golem\",\n symbol: \"GLM\",\n decimals: 18,\n },\n rpcUrls: {\n default: {\n http: [\"https://rpc.cheesecake.db-chain.devnet.gobas.me\"],\n webSocket: [\"wss://rpc.cheesecake.db-chain.devnet.gobas.me\"],\n },\n },\n testnet: true,\n})\n","import { defineChain } from \"viem\"\n\nexport const localhost = defineChain({\n id: 1337,\n name: \"Localhost\",\n nativeCurrency: {\n decimals: 18,\n name: \"Ether\",\n symbol: \"ETH\",\n },\n rpcUrls: {\n default: { http: [\"http://127.0.0.1:8545\"] },\n },\n})\n","export { cheesecake } from \"./cheesecake\"\nexport { localhost } from \"./localhost\"\n"],"mappings":";;;;;;;;;;;;;;;;;;AAKA,MAAa,aAAa,YAAY;CACpC,IAAI;CACJ,MAAM;CACN,SAAS;CACT,gBAAgB;EACd,MAAM;EACN,QAAQ;EACR,UAAU;EACX;CACD,SAAS,EACP,SAAS;EACP,MAAM,CAAC,kDAAkD;EACzD,WAAW,CAAC,gDAAgD;EAC7D,EACF;CACD,SAAS;CACV,CAAC;;;;ACnBF,MAAa,YAAY,YAAY;CACnC,IAAI;CACJ,MAAM;CACN,gBAAgB;EACd,UAAU;EACV,MAAM;EACN,QAAQ;EACT;CACD,SAAS,EACP,SAAS,EAAE,MAAM,CAAC,wBAAwB,EAAE,EAC7C;CACF,CAAC"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
//#region rolldown:runtime
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __export = (all) => {
|
|
4
|
+
let target = {};
|
|
5
|
+
for (var name in all) __defProp(target, name, {
|
|
6
|
+
get: all[name],
|
|
7
|
+
enumerable: true
|
|
8
|
+
});
|
|
9
|
+
return target;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
//#endregion
|
|
13
|
+
let viem = require("viem");
|
|
14
|
+
|
|
15
|
+
//#region src/chains/cheesecake.ts
|
|
16
|
+
/**
|
|
17
|
+
* Cheesecake is Arkiv's testnet.
|
|
18
|
+
*/
|
|
19
|
+
const cheesecake = (0, viem.defineChain)({
|
|
20
|
+
id: 7733102,
|
|
21
|
+
name: "Cheesecake",
|
|
22
|
+
network: "cheesecake",
|
|
23
|
+
nativeCurrency: {
|
|
24
|
+
name: "Golem",
|
|
25
|
+
symbol: "GLM",
|
|
26
|
+
decimals: 18
|
|
27
|
+
},
|
|
28
|
+
rpcUrls: { default: {
|
|
29
|
+
http: ["https://rpc.cheesecake.db-chain.devnet.gobas.me"],
|
|
30
|
+
webSocket: ["wss://rpc.cheesecake.db-chain.devnet.gobas.me"]
|
|
31
|
+
} },
|
|
32
|
+
testnet: true
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
//#endregion
|
|
36
|
+
//#region src/chains/localhost.ts
|
|
37
|
+
const localhost = (0, viem.defineChain)({
|
|
38
|
+
id: 1337,
|
|
39
|
+
name: "Localhost",
|
|
40
|
+
nativeCurrency: {
|
|
41
|
+
decimals: 18,
|
|
42
|
+
name: "Ether",
|
|
43
|
+
symbol: "ETH"
|
|
44
|
+
},
|
|
45
|
+
rpcUrls: { default: { http: ["http://127.0.0.1:8545"] } }
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
//#endregion
|
|
49
|
+
//#region src/chains/index.ts
|
|
50
|
+
var chains_exports = /* @__PURE__ */ __export({
|
|
51
|
+
cheesecake: () => cheesecake,
|
|
52
|
+
localhost: () => localhost
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
//#endregion
|
|
56
|
+
Object.defineProperty(exports, 'chains_exports', {
|
|
57
|
+
enumerable: true,
|
|
58
|
+
get: function () {
|
|
59
|
+
return chains_exports;
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
Object.defineProperty(exports, 'cheesecake', {
|
|
63
|
+
enumerable: true,
|
|
64
|
+
get: function () {
|
|
65
|
+
return cheesecake;
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
Object.defineProperty(exports, 'localhost', {
|
|
69
|
+
enumerable: true,
|
|
70
|
+
get: function () {
|
|
71
|
+
return localhost;
|
|
72
|
+
}
|
|
73
|
+
});
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { Address, Hex } from "viem";
|
|
2
|
+
|
|
3
|
+
//#region src/attr/types.d.ts
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* The protocol's attribute type vocabulary, mapping each short **tag** (the name used by the
|
|
7
|
+
* client, the query language and this SDK) to its **typeId** (the byte carried on the wire and in
|
|
8
|
+
* the entity record).
|
|
9
|
+
*
|
|
10
|
+
* The typeIds are consensus-critical: they are written into entity records and mixed into index
|
|
11
|
+
* keys, so this table must never drift from the node's `AttributeType`.
|
|
12
|
+
*
|
|
13
|
+
* | tag | typeId | ABI wire type | indexing |
|
|
14
|
+
* | --------- | ------ | ------------------- | ----------------- |
|
|
15
|
+
* | `bool` | 1 | `bool` | equality |
|
|
16
|
+
* | `i32` | 2 | `int32` | equality + range |
|
|
17
|
+
* | `u64` | 3 | `uint64` | equality + range |
|
|
18
|
+
* | `u256` | 4 | `uint256` | equality + range |
|
|
19
|
+
* | `dec` | 5 | `int256` (18 dp) | equality + range |
|
|
20
|
+
* | `bytes32` | 6 | `bytes32` | equality |
|
|
21
|
+
* | `bytes` | 7 | `bytes` | none — system-only |
|
|
22
|
+
* | `str` | 8 | `string` (<= 128 B) | equality + prefix |
|
|
23
|
+
* | `addr` | 9 | `address` | equality |
|
|
24
|
+
* | `key` | 10 | `bytes32` | equality |
|
|
25
|
+
*/
|
|
26
|
+
declare const TYPE_IDS: {
|
|
27
|
+
readonly bool: 1;
|
|
28
|
+
readonly i32: 2;
|
|
29
|
+
readonly u64: 3;
|
|
30
|
+
readonly u256: 4;
|
|
31
|
+
readonly dec: 5;
|
|
32
|
+
readonly bytes32: 6;
|
|
33
|
+
readonly bytes: 7;
|
|
34
|
+
readonly str: 8;
|
|
35
|
+
readonly addr: 9;
|
|
36
|
+
readonly key: 10;
|
|
37
|
+
};
|
|
38
|
+
/** Every type tag, including the system-only `bytes`. */
|
|
39
|
+
type TypeTag = keyof typeof TYPE_IDS;
|
|
40
|
+
/**
|
|
41
|
+
* The tags a client may set on an attribute. `bytes` is excluded: it backs the system `$payload`
|
|
42
|
+
* cell, which travels in its own operation field and is never carried in an attribute array.
|
|
43
|
+
*/
|
|
44
|
+
type UserTypeTag = Exclude<TypeTag, "bytes">;
|
|
45
|
+
/**
|
|
46
|
+
* Marks a value as having passed its constructor's validation. The symbol is module-private, so a
|
|
47
|
+
* hand-written object literal is not assignable to {@link ArkivValue} — every value crossing the
|
|
48
|
+
* wire has been range-, length- and format-checked by {@link i32}, {@link u256}, {@link dec}, and
|
|
49
|
+
* friends.
|
|
50
|
+
*/
|
|
51
|
+
declare const validated: unique symbol;
|
|
52
|
+
/**
|
|
53
|
+
* A typed attribute value: the tag it was created with, plus the JavaScript representation of that
|
|
54
|
+
* type. Constructed only by the tagged constructors in `@arkiv-network/sdk/attr`.
|
|
55
|
+
*
|
|
56
|
+
* @typeParam tag - The type tag, which also discriminates the {@link ArkivValue} union.
|
|
57
|
+
* @typeParam value - The decoded JavaScript representation.
|
|
58
|
+
*/
|
|
59
|
+
type Value<tag extends TypeTag, value> = {
|
|
60
|
+
readonly type: tag;
|
|
61
|
+
readonly value: value;
|
|
62
|
+
readonly [validated]: tag;
|
|
63
|
+
};
|
|
64
|
+
/** A boolean. */
|
|
65
|
+
type BoolValue = Value<"bool", boolean>;
|
|
66
|
+
/** A 32-bit signed integer — the default for an untagged number. */
|
|
67
|
+
type I32Value = Value<"i32", number>;
|
|
68
|
+
/**
|
|
69
|
+
* A 64-bit unsigned integer — block heights, the
|
|
70
|
+
* entity-nonce and `$expiresAt` are all `u64` */
|
|
71
|
+
type U64Value = Value<"u64", bigint>;
|
|
72
|
+
/** A 256-bit unsigned integer. */
|
|
73
|
+
type U256Value = Value<"u256", bigint>;
|
|
74
|
+
/**
|
|
75
|
+
* A fixed-point decimal with 18 decimal places, held as its canonical decimal string (`"3.5"`).
|
|
76
|
+
* Use {@link decUnits} for the exact scaled integer when you need to do arithmetic.
|
|
77
|
+
*/
|
|
78
|
+
type DecValue = Value<"dec", string>;
|
|
79
|
+
/** 32 opaque bytes, as lowercase `0x` hex. */
|
|
80
|
+
type Bytes32Value = Value<"bytes32", Hex>;
|
|
81
|
+
/** A UTF-8 string of at most 128 bytes. */
|
|
82
|
+
type StrValue = Value<"str", string>;
|
|
83
|
+
/** A 20-byte Ethereum address, as EIP-55 checksummed hex. */
|
|
84
|
+
type AddrValue = Value<"addr", Address>;
|
|
85
|
+
/** A reference to another entity. Weak by spec: dangling references are permitted. */
|
|
86
|
+
type KeyValue = Value<"key", Hex>;
|
|
87
|
+
/**
|
|
88
|
+
* Opaque variable-length bytes, as lowercase `0x` hex. System-only — it backs `$payload` and is
|
|
89
|
+
* never settable as an attribute, so it is produced by decoding but has no constructor.
|
|
90
|
+
*/
|
|
91
|
+
type BytesValue = Value<"bytes", Hex>;
|
|
92
|
+
/** Any value a client may set on an attribute. */
|
|
93
|
+
type ArkivValue = BoolValue | I32Value | U64Value | U256Value | DecValue | Bytes32Value | StrValue | AddrValue | KeyValue;
|
|
94
|
+
/** Any value that can come back from the node, including the system-only `bytes`. */
|
|
95
|
+
type AnyArkivValue = ArkivValue | BytesValue;
|
|
96
|
+
/**
|
|
97
|
+
* Whether `input` has the *shape* of an {@link ArkivValue} — a known type tag and a value.
|
|
98
|
+
*/
|
|
99
|
+
declare function isArkivValue(input: unknown): input is AnyArkivValue;
|
|
100
|
+
//#endregion
|
|
101
|
+
export { Bytes32Value as a, I32Value as c, TypeTag as d, U256Value as f, isArkivValue as h, BoolValue as i, KeyValue as l, UserTypeTag as m, AnyArkivValue as n, BytesValue as o, U64Value as p, ArkivValue as r, DecValue as s, AddrValue as t, StrValue as u };
|
|
102
|
+
//# sourceMappingURL=codec-Car3KkFF.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codec-Car3KkFF.d.ts","names":[],"sources":["../src/attr/types.ts"],"sourcesContent":[],"mappings":";;;;;;AAuBA;AAcA;AASA;AAKC;AAiBD;;;;;;;AAOA;AAEA;AAIA;AAEA;AAKA;AAEA;AAEA;AAEA;AAEY,cAzEC,QAyEuB,EAAA;EAKxB,SAAA,IAAU,EAAA,CAAA;EAGV,SAAA,GAAA,EAAU,CAAA;EAClB,SAAA,GAAA,EAAA,CAAA;EACA,SAAA,IAAA,EAAA,CAAA;EACA,SAAA,GAAA,EAAA,CAAA;EACA,SAAA,OAAA,EAAA,CAAA;EACA,SAAA,KAAA,EAAA,CAAA;EACA,SAAA,GAAA,EAAA,CAAA;EACA,SAAA,IAAA,EAAA,CAAA;EACA,SAAA,GAAA,EAAA,EAAA;CACA;;AAGQ,KA/EA,OAAA,GA+Ea,MAAA,OA/EU,QA+EP;;;;;KAtEhB,WAAA,GAAc,QAAQ;;;;;;;cAapB;;;;;;;;KASF,kBAAkB;iBACb;kBACC;YACN,SAAA,GAAY;;;KAIZ,SAAA,GAAY;;KAEZ,QAAA,GAAW;;;;KAIX,QAAA,GAAW;;KAEX,SAAA,GAAY;;;;;KAKZ,QAAA,GAAW;;KAEX,YAAA,GAAe,iBAAiB;;KAEhC,QAAA,GAAW;;KAEX,SAAA,GAAY,cAAc;;KAE1B,QAAA,GAAW,aAAa;;;;;KAKxB,UAAA,GAAa,eAAe;;KAG5B,UAAA,GACR,YACA,WACA,WACA,YACA,WACA,eACA,WACA,YACA;;KAGQ,aAAA,GAAgB,aAAa;;;;iBAsBzB,YAAA,2BAAuC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
const require_expiry = require('../expiry-BELY2Kpw.cjs');
|
|
2
|
+
const require_key = require('../key-WKhXnXuU.cjs');
|
|
3
|
+
const require_errors = require('../errors-BVbjKVMN.cjs');
|
|
4
|
+
const require_flags = require('../flags-kr276q6i.cjs');
|
|
5
|
+
require('../entity-B7G8q_Eo.cjs');
|
|
6
|
+
|
|
7
|
+
exports.ENTITY_EVENTS_ABI = require_key.ENTITY_EVENTS_ABI;
|
|
8
|
+
exports.InvalidCreationFlagsError = require_errors.InvalidCreationFlagsError;
|
|
9
|
+
exports.InvalidExpiryError = require_errors.InvalidExpiryError;
|
|
10
|
+
exports.InvalidSaltError = require_errors.InvalidSaltError;
|
|
11
|
+
exports.MAX_EXPIRES_AT = require_expiry.MAX_EXPIRES_AT;
|
|
12
|
+
exports.MAX_SALT = require_key.MAX_SALT;
|
|
13
|
+
exports.NoRandomSourceError = require_errors.NoRandomSourceError;
|
|
14
|
+
exports.OperationType = require_expiry.OperationType;
|
|
15
|
+
exports.decodeCreationFlags = require_flags.decodeCreationFlags;
|
|
16
|
+
exports.encodeCreationFlags = require_flags.encodeCreationFlags;
|
|
17
|
+
exports.predictEntityKey = require_key.predictEntityKey;
|
|
18
|
+
exports.randomSalt = require_key.randomSalt;
|
|
19
|
+
exports.resolveExpiry = require_expiry.resolveExpiry;
|
|
20
|
+
exports.toBlocks = require_expiry.toBlocks;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { a as ResolvedExpiry, i as Lifetime, n as Expiry, o as resolveExpiry, r as ExpiryContext, s as toBlocks, t as EncodedExpiry } from "../expiry-DRV29F1r.cjs";
|
|
2
|
+
import { a as randomSalt, c as InvalidCreationFlagsError, d as NoRandomSourceError, f as Operation, i as predictEntityKey, l as InvalidExpiryError, n as OperationType, o as ENTITY_EVENTS_ABI, r as MAX_SALT, s as EntityEventName, t as MAX_EXPIRES_AT, u as InvalidSaltError } from "../index-CA4V7Pdh.cjs";
|
|
3
|
+
import { i as encodeCreationFlags, n as ResolvedCreationFlags, r as decodeCreationFlags, t as CreationFlags } from "../flags-CRjPpoh3.cjs";
|
|
4
|
+
export { CreationFlags, ENTITY_EVENTS_ABI, EncodedExpiry, EntityEventName, Expiry, ExpiryContext, InvalidCreationFlagsError, InvalidExpiryError, InvalidSaltError, Lifetime, MAX_EXPIRES_AT, MAX_SALT, NoRandomSourceError, Operation, OperationType, ResolvedCreationFlags, ResolvedExpiry, decodeCreationFlags, encodeCreationFlags, predictEntityKey, randomSalt, resolveExpiry, toBlocks };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import "../codec-Car3KkFF.js";
|
|
2
|
+
import { a as ResolvedExpiry, i as Lifetime, n as Expiry, o as resolveExpiry, r as ExpiryContext, s as toBlocks, t as EncodedExpiry } from "../expiry-nDbCgZX4.js";
|
|
3
|
+
import { a as randomSalt, c as InvalidCreationFlagsError, d as NoRandomSourceError, f as Operation, i as predictEntityKey, l as InvalidExpiryError, n as OperationType, o as ENTITY_EVENTS_ABI, r as MAX_SALT, s as EntityEventName, t as MAX_EXPIRES_AT, u as InvalidSaltError } from "../index-fX_XyqLp.js";
|
|
4
|
+
import { i as encodeCreationFlags, n as ResolvedCreationFlags, r as decodeCreationFlags, t as CreationFlags } from "../flags-5dTNRnow.js";
|
|
5
|
+
export { CreationFlags, ENTITY_EVENTS_ABI, EncodedExpiry, EntityEventName, Expiry, ExpiryContext, InvalidCreationFlagsError, InvalidExpiryError, InvalidSaltError, Lifetime, MAX_EXPIRES_AT, MAX_SALT, NoRandomSourceError, Operation, OperationType, ResolvedCreationFlags, ResolvedExpiry, decodeCreationFlags, encodeCreationFlags, predictEntityKey, randomSalt, resolveExpiry, toBlocks };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { a as OperationType, i as MAX_EXPIRES_AT, n as resolveExpiry, r as toBlocks } from "../expiry-BjpxZZQU.js";
|
|
2
|
+
import { a as ENTITY_EVENTS_ABI, n as predictEntityKey, r as randomSalt, t as MAX_SALT } from "../key-D1Bh7MF0.js";
|
|
3
|
+
import { i as NoRandomSourceError, n as InvalidExpiryError, r as InvalidSaltError, t as InvalidCreationFlagsError } from "../errors-LTe7bOYS.js";
|
|
4
|
+
import { n as encodeCreationFlags, t as decodeCreationFlags } from "../flags-DFBs2J94.js";
|
|
5
|
+
import "../entity-CD_qFF2M.js";
|
|
6
|
+
|
|
7
|
+
export { ENTITY_EVENTS_ABI, InvalidCreationFlagsError, InvalidExpiryError, InvalidSaltError, MAX_EXPIRES_AT, MAX_SALT, NoRandomSourceError, OperationType, decodeCreationFlags, encodeCreationFlags, predictEntityKey, randomSalt, resolveExpiry, toBlocks };
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
let viem = require("viem");
|
|
2
|
+
|
|
3
|
+
//#region src/types/entity.ts
|
|
4
|
+
/**
|
|
5
|
+
* An entity as it comes back from a query.
|
|
6
|
+
*
|
|
7
|
+
* Which fields are populated is decided by the query's selection — `select({ key: true })` gives
|
|
8
|
+
* back an entity carrying only its key. The static type of a `select()` result is narrowed to
|
|
9
|
+
* exactly the selected fields, so in typed code the `undefined`s here are not reachable.
|
|
10
|
+
*/
|
|
11
|
+
var Entity = class {
|
|
12
|
+
key;
|
|
13
|
+
owner;
|
|
14
|
+
creator;
|
|
15
|
+
createdAt;
|
|
16
|
+
updatedAt;
|
|
17
|
+
expiresAt;
|
|
18
|
+
creationFlags;
|
|
19
|
+
contentType;
|
|
20
|
+
payload;
|
|
21
|
+
attributeSchema;
|
|
22
|
+
attributes;
|
|
23
|
+
constructor(fields = {}) {
|
|
24
|
+
this.key = fields.key;
|
|
25
|
+
this.owner = fields.owner;
|
|
26
|
+
this.creator = fields.creator;
|
|
27
|
+
this.createdAt = fields.createdAt;
|
|
28
|
+
this.updatedAt = fields.updatedAt;
|
|
29
|
+
this.expiresAt = fields.expiresAt;
|
|
30
|
+
this.creationFlags = fields.creationFlags;
|
|
31
|
+
this.contentType = fields.contentType;
|
|
32
|
+
this.payload = fields.payload;
|
|
33
|
+
this.attributeSchema = fields.attributeSchema;
|
|
34
|
+
this.attributes = fields.attributes;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* The payload decoded as UTF-8 text.
|
|
38
|
+
*
|
|
39
|
+
* @throws If the payload was not selected, or is not valid UTF-8.
|
|
40
|
+
*/
|
|
41
|
+
toText() {
|
|
42
|
+
if (this.payload === void 0) throw new Error("Entity has no payload — the query did not select it. Use select({ payload: true }).");
|
|
43
|
+
try {
|
|
44
|
+
return (0, viem.bytesToString)(this.payload);
|
|
45
|
+
} catch (e) {
|
|
46
|
+
throw new Error(`Failed to convert entity payload to text: ${e instanceof Error ? e.message : String(e)}`, { cause: e });
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* The payload parsed as JSON.
|
|
51
|
+
*
|
|
52
|
+
* @throws If the payload was not selected, is empty, or is not valid JSON.
|
|
53
|
+
*/
|
|
54
|
+
toJson() {
|
|
55
|
+
const text = this.toText();
|
|
56
|
+
if (!text) throw new Error("Entity has empty payload, cannot parse as JSON");
|
|
57
|
+
try {
|
|
58
|
+
return JSON.parse(text);
|
|
59
|
+
} catch (e) {
|
|
60
|
+
throw new Error(`Failed to parse entity payload as JSON: ${e instanceof Error ? e.message : String(e)}`, { cause: e });
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
//#endregion
|
|
66
|
+
Object.defineProperty(exports, 'Entity', {
|
|
67
|
+
enumerable: true,
|
|
68
|
+
get: function () {
|
|
69
|
+
return Entity;
|
|
70
|
+
}
|
|
71
|
+
});
|
|
File without changes
|