@arkiv-network/sdk 0.4.5 → 0.5.0-dev.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/dist/chains/index.cjs +5 -88
- package/dist/chains/index.d.cts +33 -33
- package/dist/chains/index.d.ts +33 -33
- package/dist/chains/index.d.ts.map +1 -1
- package/dist/chains/index.js +2 -85
- package/dist/chains-BDsOtN2a.js +107 -0
- package/dist/chains-BDsOtN2a.js.map +1 -0
- package/dist/chains-XCO31x6G.cjs +124 -0
- package/dist/chunk-pbleEpgJ.cjs +44 -0
- 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 +57 -15
- package/dist/index.d.cts +3 -362
- package/dist/index.d.ts +3 -362
- package/dist/index.js +49 -11
- package/dist/index.js.map +1 -1
- package/dist/payload-BI2NXPDf.d.ts +6 -0
- package/dist/payload-BI2NXPDf.d.ts.map +1 -0
- package/dist/payload-D3fyOBWn.d.cts +6 -0
- package/dist/payload-D3fyOBWn.d.cts.map +1 -0
- package/dist/payload-DKBYYjeA.js +18 -0
- package/dist/payload-DKBYYjeA.js.map +1 -0
- package/dist/payload-eB1a8vZH.cjs +41 -0
- 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-DVs4ZIyZ.js → queryBuilder-DNUwJvf0.js} +4 -9
- package/dist/queryBuilder-DNUwJvf0.js.map +1 -0
- package/dist/{queryBuilder-Cn5JJRMM.cjs → queryBuilder-KrdIUVZv.cjs} +4 -43
- package/dist/types/index.cjs +1 -1
- package/dist/types/index.d.cts +3 -2
- package/dist/types/index.d.ts +3 -2
- package/dist/types/index.js +1 -1
- package/dist/utils/index.cjs +4 -15
- package/dist/utils/index.d.cts +1 -4
- package/dist/utils/index.d.cts.map +1 -1
- package/dist/utils/index.d.ts +1 -4
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +1 -11
- package/dist/utils/index.js.map +1 -1
- package/package.json +8 -5
- package/src/actions/public/query.ts +49 -2
- package/src/actions/public/subscribeEntityEvents.ts +3 -3
- package/src/clients/createPublicClient.ts +1 -1
- package/src/clients/createWalletClient.ts +2 -2
- package/src/clients/decorators/arkivPublic.ts +42 -7
- package/src/clients/decorators/arkivWallet.ts +21 -15
- package/src/index.ts +10 -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/chains.test.ts +97 -0
- package/src/utils/chains.ts +19 -0
- package/src/utils/compression.ts +1 -1
- package/dist/chains/index.js.map +0 -1
- package/dist/consts-BV9DVKgE.cjs +0 -18
- package/dist/consts-CHtLBwGd.js +0 -7
- package/dist/consts-CHtLBwGd.js.map +0 -1
- package/dist/entity-BNSCqNpu.d.cts +0 -254
- package/dist/entity-BNSCqNpu.d.cts.map +0 -1
- package/dist/entity-CWj4qVCX.d.ts +0 -254
- package/dist/entity-CWj4qVCX.d.ts.map +0 -1
- package/dist/index.d.cts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/queryBuilder-CXcMv0Uc.d.ts +0 -314
- package/dist/queryBuilder-CXcMv0Uc.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-DVs4ZIyZ.js.map +0 -1
- /package/dist/{types-CBTc19th.cjs → types-H-TSmRpm.js} +0 -0
- /package/dist/{types-Cv8NMtbo.js → types-o3zWarRp.cjs} +0 -0
package/src/types/index.ts
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
export type { GetBlockTimingReturnType } from "../actions/public/getBlockTiming"
|
|
2
|
+
export type {
|
|
3
|
+
QueryOptions,
|
|
4
|
+
QueryOptionsIncludeData,
|
|
5
|
+
QueryOptionsOrderBy,
|
|
6
|
+
} from "../actions/public/query"
|
|
1
7
|
export type {
|
|
2
8
|
ChangeOwnershipParameters,
|
|
3
9
|
ChangeOwnershipReturnType,
|
|
@@ -12,6 +18,20 @@ export type {
|
|
|
12
18
|
export type { UpdateEntityParameters, UpdateEntityReturnType } from "../actions/wallet/updateEntity"
|
|
13
19
|
export type { Attribute } from "./attributes"
|
|
14
20
|
export type { Entity } from "./entity"
|
|
21
|
+
export type {
|
|
22
|
+
OnEntityCreatedEvent,
|
|
23
|
+
OnEntityDeletedEvent,
|
|
24
|
+
OnEntityExpiredEvent,
|
|
25
|
+
OnEntityExpiresInExtendedEvent,
|
|
26
|
+
OnEntityOwnerChangedEvent,
|
|
27
|
+
OnEntityUpdatedEvent,
|
|
28
|
+
} from "./events"
|
|
15
29
|
export type { MimeType } from "./mimeTypes"
|
|
16
|
-
export type {
|
|
30
|
+
export type {
|
|
31
|
+
ArkivRpcSchema,
|
|
32
|
+
RpcEntity,
|
|
33
|
+
RpcIncludeData,
|
|
34
|
+
RpcOrderByAttribute,
|
|
35
|
+
RpcQueryOptions,
|
|
36
|
+
} from "./rpcSchema"
|
|
17
37
|
export type { TxParams } from "./txParams"
|
package/src/types/rpcSchema.ts
CHANGED
|
@@ -30,16 +30,16 @@ export type RpcQueryOptions = {
|
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
export type RpcIncludeData = {
|
|
33
|
-
key
|
|
34
|
-
attributes
|
|
35
|
-
payload
|
|
36
|
-
contentType
|
|
37
|
-
expiration
|
|
38
|
-
owner
|
|
39
|
-
createdAtBlock
|
|
40
|
-
lastModifiedAtBlock
|
|
41
|
-
transactionIndexInBlock
|
|
42
|
-
operationIndexInTransaction
|
|
33
|
+
key?: boolean
|
|
34
|
+
attributes?: boolean
|
|
35
|
+
payload?: boolean
|
|
36
|
+
contentType?: boolean
|
|
37
|
+
expiration?: boolean
|
|
38
|
+
owner?: boolean
|
|
39
|
+
createdAtBlock?: boolean
|
|
40
|
+
lastModifiedAtBlock?: boolean
|
|
41
|
+
transactionIndexInBlock?: boolean
|
|
42
|
+
operationIndexInTransaction?: boolean
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
export type ArkivRpcSchema = [
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { describe, expect, test } from "bun:test"
|
|
2
|
+
import { kaolin, localhost, marketplace, mendoza } from "../chains"
|
|
3
|
+
import { chainFromName } from "./chains"
|
|
4
|
+
|
|
5
|
+
describe("chainFromName", () => {
|
|
6
|
+
describe("valid chain names", () => {
|
|
7
|
+
test("returns kaolin chain for 'kaolin'", () => {
|
|
8
|
+
const chain = chainFromName("kaolin")
|
|
9
|
+
expect(chain).toBe(kaolin)
|
|
10
|
+
expect(chain.id).toBe(60138453025)
|
|
11
|
+
expect(chain.name).toBe("Kaolin")
|
|
12
|
+
})
|
|
13
|
+
|
|
14
|
+
test("returns mendoza chain for 'mendoza'", () => {
|
|
15
|
+
const chain = chainFromName("mendoza")
|
|
16
|
+
expect(chain).toBe(mendoza)
|
|
17
|
+
expect(chain.id).toBe(60138453056)
|
|
18
|
+
expect(chain.name).toBe("Mendoza")
|
|
19
|
+
})
|
|
20
|
+
|
|
21
|
+
test("returns localhost chain for 'localhost'", () => {
|
|
22
|
+
const chain = chainFromName("localhost")
|
|
23
|
+
expect(chain).toBe(localhost)
|
|
24
|
+
expect(chain.id).toBe(1337)
|
|
25
|
+
expect(chain.name).toBe("Localhost")
|
|
26
|
+
})
|
|
27
|
+
|
|
28
|
+
test("returns marketplace chain for 'marketplace'", () => {
|
|
29
|
+
const chain = chainFromName("marketplace")
|
|
30
|
+
expect(chain).toBe(marketplace)
|
|
31
|
+
expect(chain.id).toBe(60138453027)
|
|
32
|
+
expect(chain.name).toBe("Marketplace")
|
|
33
|
+
})
|
|
34
|
+
})
|
|
35
|
+
|
|
36
|
+
describe("case insensitivity", () => {
|
|
37
|
+
test("handles uppercase chain names", () => {
|
|
38
|
+
expect(chainFromName("KAOLIN")).toBe(kaolin)
|
|
39
|
+
expect(chainFromName("MENDOZA")).toBe(mendoza)
|
|
40
|
+
expect(chainFromName("LOCALHOST")).toBe(localhost)
|
|
41
|
+
expect(chainFromName("MARKETPLACE")).toBe(marketplace)
|
|
42
|
+
})
|
|
43
|
+
|
|
44
|
+
test("handles mixed case chain names", () => {
|
|
45
|
+
expect(chainFromName("Kaolin")).toBe(kaolin)
|
|
46
|
+
expect(chainFromName("Mendoza")).toBe(mendoza)
|
|
47
|
+
expect(chainFromName("Localhost")).toBe(localhost)
|
|
48
|
+
expect(chainFromName("Marketplace")).toBe(marketplace)
|
|
49
|
+
expect(chainFromName("kAoLiN")).toBe(kaolin)
|
|
50
|
+
expect(chainFromName("MeNdOzA")).toBe(mendoza)
|
|
51
|
+
})
|
|
52
|
+
})
|
|
53
|
+
|
|
54
|
+
describe("error handling", () => {
|
|
55
|
+
test("throws error for unknown chain name", () => {
|
|
56
|
+
expect(() => chainFromName("unknown")).toThrow("Unknown chain: unknown")
|
|
57
|
+
})
|
|
58
|
+
|
|
59
|
+
test("throws error for empty string", () => {
|
|
60
|
+
expect(() => chainFromName("")).toThrow("Unknown chain: ")
|
|
61
|
+
})
|
|
62
|
+
|
|
63
|
+
test("throws error for chain name with whitespace", () => {
|
|
64
|
+
expect(() => chainFromName("kaolin ")).toThrow("Unknown chain: kaolin ")
|
|
65
|
+
expect(() => chainFromName(" kaolin")).toThrow("Unknown chain: kaolin")
|
|
66
|
+
})
|
|
67
|
+
|
|
68
|
+
test("throws error for similar but incorrect chain names", () => {
|
|
69
|
+
expect(() => chainFromName("kaolinn")).toThrow("Unknown chain: kaolinn")
|
|
70
|
+
expect(() => chainFromName("mendoz")).toThrow("Unknown chain: mendoz")
|
|
71
|
+
expect(() => chainFromName("local")).toThrow("Unknown chain: local")
|
|
72
|
+
})
|
|
73
|
+
})
|
|
74
|
+
|
|
75
|
+
describe("chain properties", () => {
|
|
76
|
+
test("returned chain has required viem Chain properties", () => {
|
|
77
|
+
const chain = chainFromName("kaolin")
|
|
78
|
+
|
|
79
|
+
expect(chain).toHaveProperty("id")
|
|
80
|
+
expect(chain).toHaveProperty("name")
|
|
81
|
+
expect(chain).toHaveProperty("network")
|
|
82
|
+
expect(chain).toHaveProperty("nativeCurrency")
|
|
83
|
+
expect(chain).toHaveProperty("rpcUrls")
|
|
84
|
+
expect(typeof chain.id).toBe("number")
|
|
85
|
+
expect(typeof chain.name).toBe("string")
|
|
86
|
+
})
|
|
87
|
+
|
|
88
|
+
test("returned chain has rpcUrls configured", () => {
|
|
89
|
+
const chain = chainFromName("mendoza")
|
|
90
|
+
|
|
91
|
+
expect(chain.rpcUrls).toBeDefined()
|
|
92
|
+
expect(chain.rpcUrls.default).toBeDefined()
|
|
93
|
+
expect(chain.rpcUrls.default.http).toBeInstanceOf(Array)
|
|
94
|
+
expect(chain.rpcUrls.default.http.length).toBeGreaterThan(0)
|
|
95
|
+
})
|
|
96
|
+
})
|
|
97
|
+
})
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Chain } from "viem"
|
|
2
|
+
import * as chains from "../chains"
|
|
3
|
+
|
|
4
|
+
// Create a lookup map from all exported chains
|
|
5
|
+
const chainMap = new Map(Object.entries(chains).map(([key, value]) => [key.toLowerCase(), value]))
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Get a chain from its name
|
|
9
|
+
* @param name - The name of the chain, case insensitive
|
|
10
|
+
* @returns The chain
|
|
11
|
+
* @throws An error if the chain is not found
|
|
12
|
+
*/
|
|
13
|
+
export function chainFromName(name: string): Chain {
|
|
14
|
+
const chain = chainMap.get(name.toLowerCase())
|
|
15
|
+
if (!chain) {
|
|
16
|
+
throw new Error(`Unknown chain: ${name}`)
|
|
17
|
+
}
|
|
18
|
+
return chain as Chain
|
|
19
|
+
}
|
package/src/utils/compression.ts
CHANGED
|
@@ -32,7 +32,7 @@ async function getBrotli(): Promise<BrotliWasmType | null> {
|
|
|
32
32
|
|
|
33
33
|
try {
|
|
34
34
|
const brotliModule = await import("brotli-wasm")
|
|
35
|
-
brotli = brotliModule.default
|
|
35
|
+
brotli = (brotliModule.default ? await brotliModule.default : brotliModule) as BrotliWasmType
|
|
36
36
|
} catch (error) {
|
|
37
37
|
console.error("Error importing brotli-wasm", error)
|
|
38
38
|
return null
|
package/dist/chains/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../src/chains/kaolin.ts","../../src/chains/localhost.ts","../../src/chains/marketplace.ts","../../src/chains/mendoza.ts"],"sourcesContent":["import { defineChain } from \"viem\"\n\nexport const kaolin = defineChain({\n id: 60138453025,\n name: \"Kaolin\",\n network: \"kaolin\",\n nativeCurrency: {\n name: \"Ethereum\",\n symbol: \"ETH\",\n decimals: 18,\n },\n rpcUrls: {\n default: {\n http: [\"https://kaolin.hoodi.arkiv.network/rpc\"],\n webSocket: [\"wss://kaolin.hoodi.arkiv.network/rpc/ws\"],\n },\n },\n blockExplorers: {\n default: {\n name: \"Kaolin Arkiv Explorer\",\n url: \"https://explorer.kaolin.hoodi.arkiv.network\",\n apiUrl: \"https://explorer.kaolin.hoodi.arkiv.network/api\",\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","import { defineChain } from \"viem\"\n\nexport const marketplace = defineChain({\n id: 60138453027,\n name: \"Marketplace\",\n network: \"marketplace\",\n nativeCurrency: {\n name: \"Ethereum\",\n symbol: \"ETH\",\n decimals: 18,\n },\n rpcUrls: {\n default: {\n http: [\"https://marketplace.hoodi.arkiv.network/rpc\"],\n webSocket: [\"wss://marketplace.hoodi.arkiv.network/rpc/ws\"],\n },\n },\n blockExplorers: {\n default: {\n name: \"Marketplace Arkiv Explorer\",\n url: \"https://explorer.marketplace.hoodi.arkiv.network\",\n apiUrl: \"https://explorer.marketplace.hoodi.arkiv.network/api\",\n },\n },\n testnet: true,\n})\n","import { defineChain } from \"viem\"\n\nexport const mendoza = defineChain({\n id: 60138453056,\n name: \"Mendoza\",\n network: \"mendoza\",\n nativeCurrency: {\n name: \"Ethereum\",\n symbol: \"ETH\",\n decimals: 18,\n },\n rpcUrls: {\n default: {\n http: [\"https://mendoza.hoodi.arkiv.network/rpc\"],\n webSocket: [\"wss://mendoza.hoodi.arkiv.network/rpc/ws\"],\n },\n },\n blockExplorers: {\n default: {\n name: \"Mendoza Arkiv Explorer\",\n url: \"https://explorer.mendoza.hoodi.arkiv.network\",\n apiUrl: \"https://explorer.mendoza.hoodi.arkiv.network/api\",\n },\n },\n testnet: true,\n})\n"],"mappings":";;;AAEA,MAAa,SAAS,YAAY;CAChC,IAAI;CACJ,MAAM;CACN,SAAS;CACT,gBAAgB;EACd,MAAM;EACN,QAAQ;EACR,UAAU;EACX;CACD,SAAS,EACP,SAAS;EACP,MAAM,CAAC,yCAAyC;EAChD,WAAW,CAAC,0CAA0C;EACvD,EACF;CACD,gBAAgB,EACd,SAAS;EACP,MAAM;EACN,KAAK;EACL,QAAQ;EACT,EACF;CACD,SAAS;CACV,CAAC;;;;ACvBF,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;;;;ACXF,MAAa,cAAc,YAAY;CACrC,IAAI;CACJ,MAAM;CACN,SAAS;CACT,gBAAgB;EACd,MAAM;EACN,QAAQ;EACR,UAAU;EACX;CACD,SAAS,EACP,SAAS;EACP,MAAM,CAAC,8CAA8C;EACrD,WAAW,CAAC,+CAA+C;EAC5D,EACF;CACD,gBAAgB,EACd,SAAS;EACP,MAAM;EACN,KAAK;EACL,QAAQ;EACT,EACF;CACD,SAAS;CACV,CAAC;;;;ACvBF,MAAa,UAAU,YAAY;CACjC,IAAI;CACJ,MAAM;CACN,SAAS;CACT,gBAAgB;EACd,MAAM;EACN,QAAQ;EACR,UAAU;EACX;CACD,SAAS,EACP,SAAS;EACP,MAAM,CAAC,0CAA0C;EACjD,WAAW,CAAC,2CAA2C;EACxD,EACF;CACD,gBAAgB,EACd,SAAS;EACP,MAAM;EACN,KAAK;EACL,QAAQ;EACT,EACF;CACD,SAAS;CACV,CAAC"}
|
package/dist/consts-BV9DVKgE.cjs
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
//#region src/consts.ts
|
|
3
|
-
const ARKIV_ADDRESS = "0x00000000000000000000000000000061726b6976";
|
|
4
|
-
const BLOCK_TIME = 2;
|
|
5
|
-
|
|
6
|
-
//#endregion
|
|
7
|
-
Object.defineProperty(exports, 'ARKIV_ADDRESS', {
|
|
8
|
-
enumerable: true,
|
|
9
|
-
get: function () {
|
|
10
|
-
return ARKIV_ADDRESS;
|
|
11
|
-
}
|
|
12
|
-
});
|
|
13
|
-
Object.defineProperty(exports, 'BLOCK_TIME', {
|
|
14
|
-
enumerable: true,
|
|
15
|
-
get: function () {
|
|
16
|
-
return BLOCK_TIME;
|
|
17
|
-
}
|
|
18
|
-
});
|
package/dist/consts-CHtLBwGd.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"consts-CHtLBwGd.js","names":[],"sources":["../src/consts.ts"],"sourcesContent":["export const ARKIV_ADDRESS = \"0x00000000000000000000000000000061726b6976\" as `0x${string}`\nexport const BLOCK_TIME = 2 // 2 seconds\n"],"mappings":";AAAA,MAAa,gBAAgB;AAC7B,MAAa,aAAa"}
|
|
@@ -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-BNSCqNpu.d.cts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"entity-BNSCqNpu.d.cts","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;EAAoB,IAAA,EAAA,QAAA,GAAA,SAAA;EACT,IAAA,EAAA,OAAA;CAAsB;AAC7B,KDgBR,eAAA,GChBQ;EAAwB,OAAA,CAAA,EAAA,MAAA;EACjC,WAAA,CAAA,EDiBK,cCjBL;EAAW,OAAA,CAAA,EDkBV,mBClBU,EAAA;EAAO,cAAA,CAAA,EAAA,MAAA;EAAkB,MAAA,CAAA,EAAA,MAAA;CAA3C;AAAM,KDuBE,cAAA,GCvBF;;;;ECIE,WAAA,EAAA,OAAA;EAUA,UAAA,EAAA,OAAA;;;;ECPA,uBAAA,EAAsB,OAAA;EACvB,2BAAA,EAAA,OAAA;CACG;AACC,KH0BH,cAAA,GG1BG,CAAQ;EASX,MAAA,EAAA,aAAsB;8CHoBc;;UAEpC;IIrCA,WAAA,EAAA,MAAsB;IAStB,MAAA,EAAA,MAAA;;;ECRA,MAAA,EAAA,sBAAsB;EAUtB,UAAA,CAAA,EAAA,EAAA;;;;ICPA,QAAA,EAAA,MAAA;EACC,CAAA;AACF,CAAA,EACG;EACC,MAAA,EAAA,sBAAA;EAAQ,UAAA,CAAA,EAAA,EAAA;EASX,UAAA,EAAA,MAAA;;;;KL1BA,8BACQ,YAAY,yBA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