@arkiv-network/sdk 0.5.0-dev.1 → 0.5.0-dev.3
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/chains/index.cjs +1 -1
- package/dist/{chains-XCO31x6G.cjs → chains-DVQiGmF6.cjs} +13 -2
- package/dist/index-B801JxcV.d.ts +1003 -0
- package/dist/index-B801JxcV.d.ts.map +1 -0
- package/dist/index-DQGx5KZ6.d.cts +1003 -0
- package/dist/index-DQGx5KZ6.d.cts.map +1 -0
- package/dist/index.cjs +32 -11
- package/dist/index.d.cts +3 -392
- package/dist/index.d.ts +3 -392
- package/dist/index.js +30 -8
- package/dist/index.js.map +1 -1
- package/dist/{payload-Da9gJMG5.d.ts → payload-BI2NXPDf.d.ts} +1 -1
- package/dist/{payload-Da9gJMG5.d.ts.map → payload-BI2NXPDf.d.ts.map} +1 -1
- package/dist/{payload-CJN8fTvX.d.cts → payload-D3fyOBWn.d.cts} +1 -1
- package/dist/{payload-CJN8fTvX.d.cts.map → payload-D3fyOBWn.d.cts.map} +1 -1
- package/dist/{payload-eB1a8vZH.cjs → payload-vwU3Rc6P.cjs} +0 -1
- package/dist/query/index.cjs +1 -2
- package/dist/query/index.d.cts +3 -6
- package/dist/query/index.d.cts.map +1 -1
- package/dist/query/index.d.ts +3 -6
- package/dist/query/index.d.ts.map +1 -1
- package/dist/query/index.js +2 -2
- package/dist/{queryBuilder-DS2Q9bgk.cjs → queryBuilder-B7063DYt.cjs} +111 -17
- package/dist/{queryBuilder-Cy7vf54g.js → queryBuilder-DMzL_J5-.js} +113 -11
- package/dist/queryBuilder-DMzL_J5-.js.map +1 -0
- package/dist/types/index.d.cts +3 -2
- package/dist/types/index.d.ts +3 -2
- package/dist/utils/index.cjs +1 -1
- package/dist/utils/index.d.cts +1 -1
- package/dist/utils/index.d.ts +1 -1
- package/package.json +6 -5
- package/src/actions/public/query.ts +49 -2
- package/src/actions/public/subscribeEntityEvents.ts +2 -2
- package/src/clients/createPublicClient.ts +1 -1
- package/src/clients/createWalletClient.ts +2 -2
- package/src/clients/decorators/arkivPublic.ts +26 -11
- package/src/clients/decorators/arkivWallet.ts +21 -15
- package/src/index.ts +6 -0
- package/src/query/errors.ts +0 -6
- package/src/query/queryBuilder.ts +7 -4
- package/src/types/index.ts +21 -1
- package/src/types/rpcSchema.ts +10 -10
- package/src/utils/compression.ts +1 -1
- package/src/utils/logger.ts +202 -5
- package/dist/chunk-pbleEpgJ.cjs +0 -44
- package/dist/entity-BNSCqNpu.d.cts +0 -254
- package/dist/entity-BNSCqNpu.d.cts.map +0 -1
- package/dist/entity-D7fzI0Hc.d.ts +0 -254
- package/dist/entity-D7fzI0Hc.d.ts.map +0 -1
- package/dist/index.d.cts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/queryBuilder-BGz98Y1C.d.ts +0 -314
- package/dist/queryBuilder-BGz98Y1C.d.ts.map +0 -1
- package/dist/queryBuilder-CvAx57pq.d.cts +0 -314
- package/dist/queryBuilder-CvAx57pq.d.cts.map +0 -1
- package/dist/queryBuilder-Cy7vf54g.js.map +0 -1
|
@@ -1,254 +0,0 @@
|
|
|
1
|
-
import { Account, Chain, Client, Hash, Hex, RpcSchema, Transport } from "viem";
|
|
2
|
-
|
|
3
|
-
//#region src/types/mimeTypes.d.ts
|
|
4
|
-
type MimeType = "text/plain" | "text/html" | "text/css" | "text/csv" | "text/xml" | "text/javascript" | "application/json" | "application/xml" | "application/pdf" | "application/zip" | "application/gzip" | "application/octet-stream" | "application/javascript" | "application/x-www-form-urlencoded" | "image/png" | "image/jpeg" | "image/webp" | "image/gif" | "image/svg+xml" | "audio/mpeg" | "audio/wav" | "audio/ogg" | "video/mp4" | "video/webm" | "video/ogg" | "multipart/form-data";
|
|
5
|
-
//#endregion
|
|
6
|
-
//#region src/types/rpcSchema.d.ts
|
|
7
|
-
type RpcEntity = {
|
|
8
|
-
key: Hex;
|
|
9
|
-
contentType: MimeType;
|
|
10
|
-
value: string;
|
|
11
|
-
expiresAt: string;
|
|
12
|
-
createdAtBlock: string;
|
|
13
|
-
lastModifiedAtBlock: string;
|
|
14
|
-
transactionIndexInBlock: string;
|
|
15
|
-
operationIndexInTransaction: string;
|
|
16
|
-
owner: Hex;
|
|
17
|
-
stringAttributes?: [{
|
|
18
|
-
key: string;
|
|
19
|
-
value: string;
|
|
20
|
-
}];
|
|
21
|
-
numericAttributes?: [{
|
|
22
|
-
key: string;
|
|
23
|
-
value: number;
|
|
24
|
-
}];
|
|
25
|
-
};
|
|
26
|
-
type RpcOrderByAttribute = {
|
|
27
|
-
name: string;
|
|
28
|
-
type: "string" | "numeric";
|
|
29
|
-
desc: boolean;
|
|
30
|
-
};
|
|
31
|
-
type RpcQueryOptions = {
|
|
32
|
-
atBlock?: number;
|
|
33
|
-
includeData?: RpcIncludeData;
|
|
34
|
-
orderBy?: RpcOrderByAttribute[];
|
|
35
|
-
resultsPerPage?: number;
|
|
36
|
-
cursor?: string;
|
|
37
|
-
};
|
|
38
|
-
type RpcIncludeData = {
|
|
39
|
-
key: boolean;
|
|
40
|
-
attributes: boolean;
|
|
41
|
-
payload: boolean;
|
|
42
|
-
contentType: boolean;
|
|
43
|
-
expiration: boolean;
|
|
44
|
-
owner: boolean;
|
|
45
|
-
createdAtBlock: boolean;
|
|
46
|
-
lastModifiedAtBlock: boolean;
|
|
47
|
-
transactionIndexInBlock: boolean;
|
|
48
|
-
operationIndexInTransaction: boolean;
|
|
49
|
-
};
|
|
50
|
-
type ArkivRpcSchema = [{
|
|
51
|
-
Method: "arkiv_query";
|
|
52
|
-
Parameters?: [query: string, queryOptions?: RpcQueryOptions];
|
|
53
|
-
ReturnType: {
|
|
54
|
-
data: RpcEntity[];
|
|
55
|
-
blockNumber: bigint;
|
|
56
|
-
cursor: string;
|
|
57
|
-
};
|
|
58
|
-
}, {
|
|
59
|
-
Method: "arkiv_getBlockTiming";
|
|
60
|
-
Parameters?: [];
|
|
61
|
-
ReturnType: {
|
|
62
|
-
current_block: bigint;
|
|
63
|
-
current_block_time: number;
|
|
64
|
-
duration: number;
|
|
65
|
-
};
|
|
66
|
-
}, {
|
|
67
|
-
Method: "arkiv_getEntityCount";
|
|
68
|
-
Parameters?: [];
|
|
69
|
-
ReturnType: number;
|
|
70
|
-
}];
|
|
71
|
-
//#endregion
|
|
72
|
-
//#region src/clients/baseClient.d.ts
|
|
73
|
-
type ArkivClient<transport extends Transport = Transport, chain extends Chain | undefined = Chain | undefined, accountOrAddress extends Account | undefined = Account | undefined, rpcSchema extends RpcSchema | undefined = ArkivRpcSchema> = Client<transport, chain, accountOrAddress, rpcSchema>;
|
|
74
|
-
//#endregion
|
|
75
|
-
//#region src/actions/wallet/changeOwnership.d.ts
|
|
76
|
-
/**
|
|
77
|
-
* Parameters for the deleteEntity function.
|
|
78
|
-
* - entityKey: The key of the entity to delete.
|
|
79
|
-
*/
|
|
80
|
-
type ChangeOwnershipParameters = {
|
|
81
|
-
entityKey: Hex;
|
|
82
|
-
newOwner: Hex;
|
|
83
|
-
};
|
|
84
|
-
/**
|
|
85
|
-
* Return type for the deleteEntity function.
|
|
86
|
-
* - entityKey: The key of the entity.
|
|
87
|
-
* - txHash: The transaction hash.
|
|
88
|
-
*/
|
|
89
|
-
type ChangeOwnershipReturnType = {
|
|
90
|
-
entityKey: Hex;
|
|
91
|
-
txHash: string;
|
|
92
|
-
};
|
|
93
|
-
//#endregion
|
|
94
|
-
//#region src/actions/wallet/createEntity.d.ts
|
|
95
|
-
/**
|
|
96
|
-
* Parameters for the createEntity function.
|
|
97
|
-
* - payload: The payload of the entity.
|
|
98
|
-
* - attributes: The attributes of the entity.
|
|
99
|
-
* - contentType: The content type of the entity.
|
|
100
|
-
* - expiresIn: The expires in of the entity in seconds.
|
|
101
|
-
*/
|
|
102
|
-
type CreateEntityParameters = {
|
|
103
|
-
payload: Uint8Array;
|
|
104
|
-
attributes: Attribute[];
|
|
105
|
-
contentType: MimeType;
|
|
106
|
-
expiresIn: number;
|
|
107
|
-
};
|
|
108
|
-
/**
|
|
109
|
-
* Return type for the createEntity function.
|
|
110
|
-
* - entityKey: The key of the entity.
|
|
111
|
-
* - txHash: The transaction hash.
|
|
112
|
-
*/
|
|
113
|
-
type CreateEntityReturnType = {
|
|
114
|
-
entityKey: Hex;
|
|
115
|
-
txHash: Hash;
|
|
116
|
-
};
|
|
117
|
-
//#endregion
|
|
118
|
-
//#region src/actions/wallet/deleteEntity.d.ts
|
|
119
|
-
/**
|
|
120
|
-
* Parameters for the deleteEntity function.
|
|
121
|
-
* - entityKey: The key of the entity to delete.
|
|
122
|
-
*/
|
|
123
|
-
type DeleteEntityParameters = {
|
|
124
|
-
entityKey: Hex;
|
|
125
|
-
};
|
|
126
|
-
/**
|
|
127
|
-
* Return type for the deleteEntity function.
|
|
128
|
-
* - entityKey: The key of the entity.
|
|
129
|
-
* - txHash: The transaction hash.
|
|
130
|
-
*/
|
|
131
|
-
type DeleteEntityReturnType = {
|
|
132
|
-
entityKey: Hex;
|
|
133
|
-
txHash: Hash;
|
|
134
|
-
};
|
|
135
|
-
//#endregion
|
|
136
|
-
//#region src/actions/wallet/extendEntity.d.ts
|
|
137
|
-
/**
|
|
138
|
-
* Parameters for the extendEntity function.
|
|
139
|
-
* - entityKey: The key of the entity to extend.
|
|
140
|
-
* - expiresIn: The expires in of the entity in seconds.
|
|
141
|
-
*/
|
|
142
|
-
type ExtendEntityParameters = {
|
|
143
|
-
entityKey: Hex;
|
|
144
|
-
expiresIn: number;
|
|
145
|
-
};
|
|
146
|
-
/**
|
|
147
|
-
* Return type for the extendEntity function.
|
|
148
|
-
* - entityKey: The key of the entity.
|
|
149
|
-
* - txHash: The transaction hash.
|
|
150
|
-
*/
|
|
151
|
-
type ExtendEntityReturnType = {
|
|
152
|
-
entityKey: Hex;
|
|
153
|
-
txHash: Hash;
|
|
154
|
-
};
|
|
155
|
-
//#endregion
|
|
156
|
-
//#region src/actions/wallet/updateEntity.d.ts
|
|
157
|
-
/**
|
|
158
|
-
* Parameters for the updateEntity function.
|
|
159
|
-
* - entityKey: The key of the entity to update.
|
|
160
|
-
* - payload: The payload of the entity.
|
|
161
|
-
* - attributes: The attributes of the entity.
|
|
162
|
-
* - contentType: The content type of the entity.
|
|
163
|
-
* - expiresIn: The expires in of the entity in seconds.
|
|
164
|
-
*/
|
|
165
|
-
type UpdateEntityParameters = {
|
|
166
|
-
entityKey: Hex;
|
|
167
|
-
payload: Uint8Array;
|
|
168
|
-
attributes: Attribute[];
|
|
169
|
-
contentType: MimeType;
|
|
170
|
-
expiresIn: number;
|
|
171
|
-
};
|
|
172
|
-
/**
|
|
173
|
-
* Return type for the updateEntity function.
|
|
174
|
-
* - entityKey: The key of the entity.
|
|
175
|
-
* - txHash: The transaction hash.
|
|
176
|
-
*/
|
|
177
|
-
type UpdateEntityReturnType = {
|
|
178
|
-
entityKey: Hex;
|
|
179
|
-
txHash: Hash;
|
|
180
|
-
};
|
|
181
|
-
//#endregion
|
|
182
|
-
//#region src/actions/wallet/mutateEntities.d.ts
|
|
183
|
-
/**
|
|
184
|
-
* Parameters for the mutateEntities function.
|
|
185
|
-
* - creates: The creates to perform.
|
|
186
|
-
* - updates: The updates to perform.
|
|
187
|
-
* - deletes: The deletes to perform.
|
|
188
|
-
* - extensions: The extensions to perform.
|
|
189
|
-
*/
|
|
190
|
-
type MutateEntitiesParameters = {
|
|
191
|
-
creates?: CreateEntityParameters[];
|
|
192
|
-
updates?: UpdateEntityParameters[];
|
|
193
|
-
deletes?: DeleteEntityParameters[];
|
|
194
|
-
extensions?: ExtendEntityParameters[];
|
|
195
|
-
ownershipChanges?: ChangeOwnershipParameters[];
|
|
196
|
-
};
|
|
197
|
-
/**
|
|
198
|
-
* Return type for the mutateEntities function.
|
|
199
|
-
* - txHash: The transaction hash.
|
|
200
|
-
* - createdEntities: The keys of the created entities.
|
|
201
|
-
* - updatedEntities: The keys of the updated entities.
|
|
202
|
-
* - deletedEntities: The keys of the deleted entities.
|
|
203
|
-
* - extendedEntities: The keys of the extended entities.
|
|
204
|
-
* - ownershipChanges: The keys of the ownership changes.
|
|
205
|
-
*/
|
|
206
|
-
type MutateEntitiesReturnType = {
|
|
207
|
-
txHash: Hash;
|
|
208
|
-
createdEntities: Hex[];
|
|
209
|
-
updatedEntities: Hex[];
|
|
210
|
-
deletedEntities: Hex[];
|
|
211
|
-
extendedEntities: Hex[];
|
|
212
|
-
ownershipChanges: Hex[];
|
|
213
|
-
};
|
|
214
|
-
//#endregion
|
|
215
|
-
//#region src/types/attributes.d.ts
|
|
216
|
-
type Attribute = {
|
|
217
|
-
key: string;
|
|
218
|
-
value: string | number;
|
|
219
|
-
};
|
|
220
|
-
//#endregion
|
|
221
|
-
//#region src/types/txParams.d.ts
|
|
222
|
-
type TxParams = {
|
|
223
|
-
gas?: bigint;
|
|
224
|
-
nonce?: number;
|
|
225
|
-
gasPrice?: bigint;
|
|
226
|
-
maxFeePerGas?: never;
|
|
227
|
-
maxPriorityFeePerGas?: never;
|
|
228
|
-
} | {
|
|
229
|
-
gas?: bigint;
|
|
230
|
-
nonce?: number;
|
|
231
|
-
maxFeePerGas?: bigint;
|
|
232
|
-
maxPriorityFeePerGas?: bigint;
|
|
233
|
-
gasPrice?: never;
|
|
234
|
-
};
|
|
235
|
-
//#endregion
|
|
236
|
-
//#region src/types/entity.d.ts
|
|
237
|
-
declare class Entity {
|
|
238
|
-
key: Hex;
|
|
239
|
-
contentType: MimeType | undefined;
|
|
240
|
-
owner: Hex | undefined;
|
|
241
|
-
expiresAtBlock: bigint | undefined;
|
|
242
|
-
createdAtBlock: bigint | undefined;
|
|
243
|
-
lastModifiedAtBlock: bigint | undefined;
|
|
244
|
-
transactionIndexInBlock: bigint | undefined;
|
|
245
|
-
operationIndexInTransaction: bigint | undefined;
|
|
246
|
-
payload: Uint8Array | undefined;
|
|
247
|
-
attributes: Attribute[];
|
|
248
|
-
constructor(key: Hex, contentType: MimeType | undefined, owner: Hex | undefined, expiresAtBlock: bigint | undefined, createdAtBlock: bigint | undefined, lastModifiedAtBlock: bigint | undefined, transactionIndexInBlock: bigint | undefined, operationIndexInTransaction: bigint | undefined, payload: Uint8Array | undefined, attributes: Attribute[]);
|
|
249
|
-
toText(): string;
|
|
250
|
-
toJson(): any;
|
|
251
|
-
}
|
|
252
|
-
//#endregion
|
|
253
|
-
export { ArkivRpcSchema as _, MutateEntitiesReturnType as a, RpcQueryOptions as b, ExtendEntityParameters as c, DeleteEntityReturnType as d, CreateEntityParameters as f, ArkivClient as g, ChangeOwnershipReturnType as h, MutateEntitiesParameters as i, ExtendEntityReturnType as l, ChangeOwnershipParameters as m, TxParams as n, UpdateEntityParameters as o, CreateEntityReturnType as p, Attribute as r, UpdateEntityReturnType as s, Entity as t, DeleteEntityParameters as u, RpcEntity as v, MimeType as x, RpcIncludeData as y };
|
|
254
|
-
//# sourceMappingURL=entity-D7fzI0Hc.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"entity-D7fzI0Hc.d.ts","names":[],"sources":["../src/types/mimeTypes.ts","../src/types/rpcSchema.ts","../src/clients/baseClient.ts","../src/actions/wallet/changeOwnership.ts","../src/actions/wallet/createEntity.ts","../src/actions/wallet/deleteEntity.ts","../src/actions/wallet/extendEntity.ts","../src/actions/wallet/updateEntity.ts","../src/actions/wallet/mutateEntities.ts","../src/types/attributes.ts","../src/types/txParams.ts","../src/types/entity.ts"],"sourcesContent":[],"mappings":";;;KAAY,QAAA;;;KCGA,SAAA;EDHA,GAAA,ECIL,GDJK;eCKG;;;EAFH,cAAS,EAAA,MAAA;EACd,mBAAA,EAAA,MAAA;EACQ,uBAAA,EAAA,MAAA;EAON,2BAAA,EAAA,MAAA;EAAG,KAAA,EAAH,GAAG;EAKA,gBAAA,CAAA,EAAA,CAAA;IAMA,GAAA,EAAA,MAAA;IAQA,KAAA,EAAA,MAAc;EAad,CAAA,CAAA;;;;ECzCA,CAAA,CAAA;CACQ;AAAY,KDapB,mBAAA,GCboB;EAChB,IAAA,EAAA,MAAA;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EAAA,MAAA,GAAA,SAAA;EACQ,mBAAA,EAAA,MAAA,GAAA,SAAA;EAON,uBAAA,EAAA,MAAA,GAAA,SAAA;EAAG,2BAAA,EAAA,MAAA,GAAA,SAAA;EAKA,OAAA,EUJD,UVIC,GAAmB,SAAA;EAMnB,UAAA,EUTE,SVSa,EAAA;EAQf,WAAA,CAAA,GAAA,EUdH,GVciB,EAAA,WAAA,EUbT,QVaS,GAAA,SAAA,EAAA,KAAA,EUZf,GVYe,GAAA,SAAA,EAAA,cAAA,EAAA,MAAA,GAAA,SAAA,EAAA,cAAA,EAAA,MAAA,GAAA,SAAA,EAAA,mBAAA,EAAA,MAAA,GAAA,SAAA,EAAA,uBAAA,EAAA,MAAA,GAAA,SAAA,EAAA,2BAAA,EAAA,MAAA,GAAA,SAAA,EAAA,OAAA,EUNb,UVMa,GAAA,SAAA,EAAA,UAAA,EULV,SVKU,EAAA;EAad,MAAA,CAAA,CAAA,EAAA,MAAA"}
|
package/dist/index.d.cts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/types/events.ts","../src/clients/decorators/arkivPublic.ts","../src/clients/createPublicClient.ts","../src/clients/decorators/arkivWallet.ts","../src/clients/createWalletClient.ts","../src/utils/chains.ts"],"sourcesContent":[],"mappings":";;;;;;;KAEY,oBAAA;aACC;SACJ;;;;KAKG,oBAAA;EAPA,SAAA,EAQC,GARD;EAOA,KAAA,EAEH,GAFG;EAQA,kBAAA,EAAA,MAAoB;EAKpB,kBAAA,EAAA,MAAoB;EAKpB,IAAA,EAAA,MAAA;;KAVA,oBAAA;aACC;ECFD,KAAA,EDGH,GCHG;CACQ;AAAY,KDKpB,oBAAA,GCLoB;EAChB,SAAA,EDKH,GCLG;EAAoB,KAAA,EDM3B,GCN2B;CAClB;AAAsB,KDQ5B,8BAAA,GCR4B;EAExB,SAAA,EDOH,GCPG;EAAW,KAAA,EDQlB,GCRkB;EAAO,kBAAA,EAAA,M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BHtBA,CAAA,kBGuBI,SHvBJ,EAAA,cGwBA,KHxBA,GAAA,SAAA,GAAA,SAAA,EAAA,yBGyBW,OHzBX,GGyBqB,OHzBrB,GAAA,SAAA,GAAA,SAAA,EAAA,kBG0BI,SH1BJ,GAAA,SAAA,GG0B4B,cH1B5B,CAAA,CAAA,UAAA,EG4BF,kBH5BE,CG4BiB,SH5BjB,EG4B4B,KH5B5B,EG4BmC,gBH5BnC,EG4BqD,SH5BrD,CAAA,CAAA,EG6Bb,iBH7Ba,CG6BK,SH7BL,EG6BgB,KH7BhB,EG6BuB,YH7BvB,CG6BoC,gBH7BpC,CAAA,EG6BuD,SH7BvD,CAAA;;;;;;;;;iBITA,aAAA,gBAA6B"}
|
package/dist/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/types/events.ts","../src/clients/decorators/arkivPublic.ts","../src/clients/createPublicClient.ts","../src/clients/decorators/arkivWallet.ts","../src/clients/createWalletClient.ts","../src/utils/chains.ts"],"sourcesContent":[],"mappings":";;;;;;;KAEY,oBAAA;aACC;SACJ;;;;KAKG,oBAAA;EAPA,SAAA,EAQC,GARD;EAOA,KAAA,EAEH,GAFG;EAQA,kBAAA,EAAA,MAAoB;EAKpB,kBAAA,EAAA,MAAoB;EAKpB,IAAA,EAAA,MAAA;;KAVA,oBAAA;aACC;ECFD,KAAA,EDGH,GCHG;CACQ;AAAY,KDKpB,oBAAA,GCLoB;EAChB,SAAA,EDKH,GCLG;EAAoB,KAAA,EDM3B,GCN2B;CAClB;AAAsB,KDQ5B,8BAAA,GCR4B;EAExB,SAAA,EDOH,GCPG;EAAW,KAAA,EDQlB,GCRkB;EAAO,kBAAA,EAAA,MAAA;EAAhC,kBAAA,EAAA,MAAA;EADE,IAAA,EAAA,MAAA;CAmCe;;;KAvCP,qCACQ,YAAY,yBAChB,oBAAoB,mCAClB,sBAAsB,uBACpC,KACF,cAAc,WAAW,OAAO;;;;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I,SH1BJ,GAAA,SAAA,GG0B4B,cH1B5B,CAAA,CAAA,UAAA,EG4BF,kBH5BE,CG4BiB,SH5BjB,EG4B4B,KH5B5B,EG4BmC,gBH5BnC,EG4BqD,SH5BrD,CAAA,CAAA,EG6Bb,iBH7Ba,CG6BK,SH7BL,EG6BgB,KH7BhB,EG6BuB,YH7BvB,CG6BoC,gBH7BpC,CAAA,EG6BuD,SH7BvD,CAAA;;;;;;;;;iBITA,aAAA,gBAA6B"}
|
|
@@ -1,314 +0,0 @@
|
|
|
1
|
-
import { g as ArkivClient, t as Entity } from "./entity-D7fzI0Hc.js";
|
|
2
|
-
import { Hex } from "viem";
|
|
3
|
-
|
|
4
|
-
//#region src/query/predicate.d.ts
|
|
5
|
-
type PredicateType = "eq" | "neq" | "gt" | "gte" | "lt" | "lte" | "not";
|
|
6
|
-
type PredicateContainerType = "or" | "and";
|
|
7
|
-
type Predicate = {
|
|
8
|
-
type: PredicateType;
|
|
9
|
-
key: string;
|
|
10
|
-
value: string | number;
|
|
11
|
-
} | {
|
|
12
|
-
type: PredicateContainerType;
|
|
13
|
-
predicates: Predicate[];
|
|
14
|
-
};
|
|
15
|
-
/**
|
|
16
|
-
* Creates an OR predicate
|
|
17
|
-
* @param predicates - The predicates to combine
|
|
18
|
-
* @returns The OR predicate
|
|
19
|
-
*
|
|
20
|
-
* @example
|
|
21
|
-
* const predicates = [eq("name", "John"), eq("age", 30)]
|
|
22
|
-
* const result = or(predicates)
|
|
23
|
-
* // result = { type: "or", predicates: [eq("name", "John"), eq("age", 30)] }
|
|
24
|
-
*
|
|
25
|
-
*/
|
|
26
|
-
declare function or(predicates: Predicate[]): Predicate;
|
|
27
|
-
/**
|
|
28
|
-
* Creates an AND predicate
|
|
29
|
-
* @param predicates - The predicates to combine
|
|
30
|
-
* @returns The AND predicate
|
|
31
|
-
*
|
|
32
|
-
* @example
|
|
33
|
-
* const predicates = [eq("name", "John"), eq("age", 30)]
|
|
34
|
-
* const result = and(predicates)
|
|
35
|
-
* // result = { type: "and", predicates: [eq("name", "John"), eq("age", 30)] }
|
|
36
|
-
*
|
|
37
|
-
*/
|
|
38
|
-
declare function and(predicates: Predicate[]): Predicate;
|
|
39
|
-
/**
|
|
40
|
-
* Creates an equality predicate
|
|
41
|
-
* @param key - The key to compare
|
|
42
|
-
* @param value - The value to compare
|
|
43
|
-
* @returns The equality predicate
|
|
44
|
-
*
|
|
45
|
-
* @example
|
|
46
|
-
* const predicate = eq("name", "John")
|
|
47
|
-
* // result = { type: "eq", key: "name", value: "John" }
|
|
48
|
-
*/
|
|
49
|
-
declare function eq(key: string, value: string | number): Predicate;
|
|
50
|
-
/**
|
|
51
|
-
* Creates a not equal predicate
|
|
52
|
-
* @param key - The key to compare
|
|
53
|
-
* @param value - The value to compare
|
|
54
|
-
* @returns The not equal predicate
|
|
55
|
-
*
|
|
56
|
-
* @example
|
|
57
|
-
* const predicate = neq("name", "John")
|
|
58
|
-
* // result = { type: "neq", key: "name", value: "John" }
|
|
59
|
-
*/
|
|
60
|
-
declare function neq(key: string, value: string | number): Predicate;
|
|
61
|
-
/**
|
|
62
|
-
* Creates a greater than predicate
|
|
63
|
-
* @param key - The key to compare
|
|
64
|
-
* @param value - The value to compare
|
|
65
|
-
* @returns The greater than predicate
|
|
66
|
-
*
|
|
67
|
-
* @example
|
|
68
|
-
* const predicate = gt("name", "John")
|
|
69
|
-
* // result = { type: "gt", key: "name", value: "John" }
|
|
70
|
-
*/
|
|
71
|
-
declare function gt(key: string, value: string | number): Predicate;
|
|
72
|
-
/**
|
|
73
|
-
* Creates a greater than or equal predicate
|
|
74
|
-
* @param key - The key to compare
|
|
75
|
-
* @param value - The value to compare
|
|
76
|
-
* @returns The greater than or equal predicate
|
|
77
|
-
*
|
|
78
|
-
* @example
|
|
79
|
-
* const predicate = gte("name", "John")
|
|
80
|
-
* // result = { type: "gte", key: "name", value: "John" }
|
|
81
|
-
*/
|
|
82
|
-
declare function gte(key: string, value: string | number): Predicate;
|
|
83
|
-
/**
|
|
84
|
-
* Creates a less than predicate
|
|
85
|
-
* @param key - The key to compare
|
|
86
|
-
* @param value - The value to compare
|
|
87
|
-
* @returns The less than predicate
|
|
88
|
-
*
|
|
89
|
-
* @example
|
|
90
|
-
* const predicate = lt("name", "John")
|
|
91
|
-
* // result = { type: "lt", key: "name", value: "John" }
|
|
92
|
-
*/
|
|
93
|
-
declare function lt(key: string, value: string | number): Predicate;
|
|
94
|
-
/**
|
|
95
|
-
* Creates a less than or equal predicate
|
|
96
|
-
* @param key - The key to compare
|
|
97
|
-
* @param value - The value to compare
|
|
98
|
-
* @returns The less than or equal predicate
|
|
99
|
-
*
|
|
100
|
-
* @example
|
|
101
|
-
* const predicate = lte("name", "John")
|
|
102
|
-
* // result = { type: "lte", key: "name", value: "John" }
|
|
103
|
-
*/
|
|
104
|
-
declare function lte(key: string, value: string | number): Predicate;
|
|
105
|
-
/**
|
|
106
|
-
* Creates a not predicate
|
|
107
|
-
* @param key - The key to compare
|
|
108
|
-
* @returns The not predicate
|
|
109
|
-
*
|
|
110
|
-
* @example
|
|
111
|
-
* const predicate = not("name")
|
|
112
|
-
* // result = { type: "not", key: "name", value: "" }
|
|
113
|
-
*/
|
|
114
|
-
declare function not(key: string): Predicate;
|
|
115
|
-
//#endregion
|
|
116
|
-
//#region src/query/queryResult.d.ts
|
|
117
|
-
declare class QueryResult {
|
|
118
|
-
entities: Entity[];
|
|
119
|
-
private _endOfIteration;
|
|
120
|
-
private _cursor;
|
|
121
|
-
private _limit;
|
|
122
|
-
private _validAtBlock;
|
|
123
|
-
private _queryBuilder;
|
|
124
|
-
get queryBuilder(): QueryBuilder;
|
|
125
|
-
get cursor(): string | undefined;
|
|
126
|
-
constructor(entities: Entity[], queryBuilder: QueryBuilder, cursor: string | undefined, limit: number | undefined, validAtBlock: bigint | undefined);
|
|
127
|
-
next(): Promise<void>;
|
|
128
|
-
hasNextPage(): boolean;
|
|
129
|
-
}
|
|
130
|
-
//#endregion
|
|
131
|
-
//#region src/query/queryBuilder.d.ts
|
|
132
|
-
type OrderByAttribute = {
|
|
133
|
-
name: string;
|
|
134
|
-
type: "string" | "number";
|
|
135
|
-
order: "asc" | "desc";
|
|
136
|
-
};
|
|
137
|
-
/**
|
|
138
|
-
* Helper function to create an ascending order by attribute
|
|
139
|
-
* @param attributeName - The name of the attribute to order by
|
|
140
|
-
* @param attributeType - The type of the attribute to order by (string or number)
|
|
141
|
-
* @returns The OrderByAttribute instance
|
|
142
|
-
*
|
|
143
|
-
* @example
|
|
144
|
-
* const ascAttribute = asc("name", "string")
|
|
145
|
-
*/
|
|
146
|
-
declare function asc(attributeName: string, attributeType: "string" | "number"): OrderByAttribute;
|
|
147
|
-
/**
|
|
148
|
-
* Helper function to create a descending order by attribute
|
|
149
|
-
* @param attributeName - The name of the attribute to order by
|
|
150
|
-
* @param attributeType - The type of the attribute to order by (string or number)
|
|
151
|
-
* @returns The OrderByAttribute instance
|
|
152
|
-
*
|
|
153
|
-
* @example
|
|
154
|
-
* const descAttribute = desc("name", "string")
|
|
155
|
-
*/
|
|
156
|
-
declare function desc(attributeName: string, attributeType: "string" | "number"): OrderByAttribute;
|
|
157
|
-
/**
|
|
158
|
-
* QueryBuilder is a helper class to build queries to the Arkiv DBChains.
|
|
159
|
-
* It can be used to fetch entities from the Arkiv DBChains. It follows the Builder pattern allowing chaining of methods.
|
|
160
|
-
* @param client - The Arkiv client
|
|
161
|
-
* @returns The QueryBuilder instance {@link QueryBuilder}
|
|
162
|
-
*/
|
|
163
|
-
declare class QueryBuilder {
|
|
164
|
-
private _client;
|
|
165
|
-
private _ownedBy;
|
|
166
|
-
private _orderBy;
|
|
167
|
-
private _validAtBlock;
|
|
168
|
-
private _withAttributes;
|
|
169
|
-
private _withMetadata;
|
|
170
|
-
private _withPayload;
|
|
171
|
-
private _limit;
|
|
172
|
-
private _cursor;
|
|
173
|
-
private _predicates;
|
|
174
|
-
constructor(client: ArkivClient);
|
|
175
|
-
/**
|
|
176
|
-
* Sets the ownedBy filter
|
|
177
|
-
* @param ownedBy - The address of the owner
|
|
178
|
-
* @returns The QueryBuilder instance
|
|
179
|
-
*
|
|
180
|
-
* @example
|
|
181
|
-
* const builder = new QueryBuilder(client)
|
|
182
|
-
* builder.ownedBy("0x1234567890123456789012345678901234567890")
|
|
183
|
-
*/
|
|
184
|
-
ownedBy(ownedBy: Hex): this;
|
|
185
|
-
/**
|
|
186
|
-
* Sets the orderBy for the query.
|
|
187
|
-
* It can be called multiple times to order by multiple attributes.
|
|
188
|
-
* The order of the attributes is important. The first attribute is the primary order by attribute.
|
|
189
|
-
* @param attributeName - The name of the attribute to order by
|
|
190
|
-
* @param attributeType - The type of the attribute to order by (string or number)
|
|
191
|
-
* @param order - The order to set the order by (asc or desc)
|
|
192
|
-
* @returns The QueryBuilder instance
|
|
193
|
-
*
|
|
194
|
-
* @example
|
|
195
|
-
* const builder = new QueryBuilder(client)
|
|
196
|
-
* builder.orderBy("name", "string", "desc")
|
|
197
|
-
*/
|
|
198
|
-
orderBy(attributeName: string, attributeType: "string" | "number", order?: "asc" | "desc"): this;
|
|
199
|
-
/**
|
|
200
|
-
* Sets the orderBy for the query.
|
|
201
|
-
* This method takes the OrderByAttribute object as an argument and is mainly
|
|
202
|
-
* used to use the helper functions asc() and desc() to create the OrderByAttribute instances.
|
|
203
|
-
* @param orderByAttribute - The OrderByAttribute instance to set
|
|
204
|
-
* @returns The QueryBuilder instance
|
|
205
|
-
*
|
|
206
|
-
* @example
|
|
207
|
-
* const builder = new QueryBuilder(client)
|
|
208
|
-
* builder.orderBy(asc("name", "string"))
|
|
209
|
-
* builder.orderBy(desc("name", "string"))
|
|
210
|
-
*/
|
|
211
|
-
orderBy(orderByAttribute: OrderByAttribute): this;
|
|
212
|
-
/**
|
|
213
|
-
* Sets the withAttributes flag which will return the attributes for the entities if true
|
|
214
|
-
* @param withAttributes - The boolean value to set
|
|
215
|
-
* @returns The QueryBuilder instance
|
|
216
|
-
*
|
|
217
|
-
* @example
|
|
218
|
-
* const builder = new QueryBuilder(client)
|
|
219
|
-
* builder.withAttributes(true)
|
|
220
|
-
*/
|
|
221
|
-
withAttributes(withAttributes?: boolean): this;
|
|
222
|
-
/**
|
|
223
|
-
* Sets the withMetadata flag which will return the metadata (like owner, expiredAt, etc.) for the entities if true
|
|
224
|
-
* @param withMetadata - The boolean value to set
|
|
225
|
-
* @returns The QueryBuilder instance
|
|
226
|
-
*
|
|
227
|
-
* @example
|
|
228
|
-
* const builder = new QueryBuilder(client)
|
|
229
|
-
* builder.withMetadata(true)
|
|
230
|
-
*/
|
|
231
|
-
withMetadata(withMetadata?: boolean): this;
|
|
232
|
-
/**
|
|
233
|
-
* Sets the withPayload flag which will return the payload for the entities if true
|
|
234
|
-
* @param withPayload - The boolean value to set
|
|
235
|
-
* @returns The QueryBuilder instance
|
|
236
|
-
*
|
|
237
|
-
* @example
|
|
238
|
-
* const builder = new QueryBuilder(client)
|
|
239
|
-
* builder.withPayload(true)
|
|
240
|
-
*/
|
|
241
|
-
withPayload(withPayload?: boolean): this;
|
|
242
|
-
/**
|
|
243
|
-
* Sets the limit for the query
|
|
244
|
-
* @param limit - The number of entities to return
|
|
245
|
-
* @returns The QueryBuilder instance
|
|
246
|
-
*
|
|
247
|
-
* @example
|
|
248
|
-
* const builder = new QueryBuilder(client)
|
|
249
|
-
* builder.limit(10)
|
|
250
|
-
*/
|
|
251
|
-
limit(limit: number): this;
|
|
252
|
-
/**
|
|
253
|
-
* Sets the cursor for the query - it is advances setting which rather shouldn't be used manually but it is provided from query result if limit is used (pagination).
|
|
254
|
-
* @param cursor - The cursor to set which tells to RPC Query server where to start or continue the query.
|
|
255
|
-
* @returns The QueryBuilder instance
|
|
256
|
-
*
|
|
257
|
-
* @example
|
|
258
|
-
* const builder = new QueryBuilder(client)
|
|
259
|
-
* builder.offset(10)
|
|
260
|
-
*/
|
|
261
|
-
cursor(cursor: string): this;
|
|
262
|
-
/**
|
|
263
|
-
* Sets the validAtBlock for the query which tells at which block height the state we are intested.
|
|
264
|
-
* If not set, the latest block is used.
|
|
265
|
-
* @param validAtBlock - The block number to set
|
|
266
|
-
* @returns The QueryBuilder instance
|
|
267
|
-
*
|
|
268
|
-
* @example
|
|
269
|
-
* const builder = new QueryBuilder(client)
|
|
270
|
-
* builder.validAtBlock(10000)
|
|
271
|
-
*/
|
|
272
|
-
validAtBlock(validAtBlock: bigint): this;
|
|
273
|
-
/**
|
|
274
|
-
* Sets the predicates for the query limiting the results. It can be a single predicate or an array of predicates combined with 'and'.
|
|
275
|
-
* Predicates can be nested using 'or' and 'and' predicates.
|
|
276
|
-
* @param predicates - The predicates to set
|
|
277
|
-
* @returns The QueryBuilder instance
|
|
278
|
-
*
|
|
279
|
-
* @example
|
|
280
|
-
* const builder = new QueryBuilder(client)
|
|
281
|
-
* builder.where(eq("name", "John"))
|
|
282
|
-
* builder.where([eq("name", "John"), eq("age", 30)])
|
|
283
|
-
* builder.where([eq("name", "John"), or([eq("age", 30), eq("age", 31)])])
|
|
284
|
-
* builder.where([eq("name", "John"), and([eq("age", 30), eq("age", 31)])])
|
|
285
|
-
* builder.where([eq("name", "John"), or([eq("age", 30), and([eq("age", 31), eq("age", 32)])])])
|
|
286
|
-
* builder.where([eq("name", "John"), and([eq("age", 30), or([eq("age", 31), eq("age", 32)])])])
|
|
287
|
-
* builder.where([eq("name", "John"), and([eq("age", 30), or([eq("age", 31), and([eq("age", 32), eq("age", 33)])])])])
|
|
288
|
-
*/
|
|
289
|
-
where(predicates: Predicate[] | Predicate): this;
|
|
290
|
-
/**
|
|
291
|
-
* Fetches the entities from the query. Re
|
|
292
|
-
* It will return a QueryResult instance which can be used to fetch the next and previous pages.
|
|
293
|
-
* @returns The QueryResult instance {@link QueryResult}
|
|
294
|
-
*
|
|
295
|
-
* @example
|
|
296
|
-
* const builder = new QueryBuilder(client)
|
|
297
|
-
* const result = await builder.where(eq("name", "John")).fetch()
|
|
298
|
-
* // result = { entities: [Entity, Entity, Entity], next: async () => QueryResult, previous: async () => QueryResult }
|
|
299
|
-
*/
|
|
300
|
-
fetch(): Promise<QueryResult>;
|
|
301
|
-
/**
|
|
302
|
-
* Counts the entities from the query.
|
|
303
|
-
* @returns The number of entities
|
|
304
|
-
*
|
|
305
|
-
* @example
|
|
306
|
-
* const builder = new QueryBuilder(client)
|
|
307
|
-
* const result = await builder.where(eq("name", "John")).count()
|
|
308
|
-
* // result = 10
|
|
309
|
-
*/
|
|
310
|
-
count(): Promise<number>;
|
|
311
|
-
}
|
|
312
|
-
//#endregion
|
|
313
|
-
export { Predicate as a, and as c, gte as d, lt as f, or as g, not as h, QueryResult as i, eq as l, neq as m, asc as n, PredicateContainerType as o, lte as p, desc as r, PredicateType as s, QueryBuilder as t, gt as u };
|
|
314
|
-
//# sourceMappingURL=queryBuilder-BGz98Y1C.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"queryBuilder-BGz98Y1C.d.ts","names":[],"sources":["../src/query/predicate.ts","../src/query/queryResult.ts","../src/query/queryBuilder.ts"],"sourcesContent":[],"mappings":";;;;KAAY,aAAA;KACA,sBAAA;KAEA,SAAA;QAEA;EALA,GAAA,EAAA,MAAA;EACA,KAAA,EAAA,MAAA,GAAA,MAAA;AAEZ,CAAA,GAAY;EAEA,IAAA,EAKA,sBALA;EAKA,UAAA,EACM,SADN,EAAA;CACM;;AAclB;AAeA;AAcA;AAcA;AAcA;AAcA;AAcA;AAcA;AAaA;;iBAhHgB,EAAA,aAAe,cAAc;;AClB7C;;;;;;;;;;ACCK,iBFgCW,GAAA,CEhCK,UAAA,EFgCW,SEhCX,EAAA,CAAA,EFgCyB,SEhCzB;AAerB;AAiBA;AAaA;;;;;;;;AAmPa,iBFlPG,EAAA,CEkPH,GAAA,EAAA,MAAA,EAAA,KAAA,EAAA,MAAA,GAAA,MAAA,CAAA,EFlP4C,SEkP5C;;;;;;;;;;;iBFpOG,GAAA,uCAA0C;;;;;;;;;;;iBAc1C,EAAA,uCAAyC;;;;;;;;;;;iBAczC,GAA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