@totochain/client 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (158) hide show
  1. package/README.md +52 -28
  2. package/_cjs/accounts/substrateSigner.js +4 -1
  3. package/_cjs/actions/attestation/attest.d.cts +14 -9
  4. package/_cjs/actions/attestation/attest.js +6 -6
  5. package/_cjs/actions/attestation/index.d.cts +1 -1
  6. package/_cjs/actions/index.d.cts +1 -1
  7. package/_cjs/actions/index.js +1 -1
  8. package/_cjs/actions/{fractionalNft → puzzlePieces}/getCollectionsCount.js +1 -1
  9. package/_cjs/actions/{fractionalNft → puzzlePieces}/getItemsCount.js +1 -1
  10. package/_cjs/actions/{fractionalNft → puzzlePieces}/getOwner.js +1 -1
  11. package/_cjs/actions/puzzlePieces/getPendingWildcards.d.cts +8 -0
  12. package/_cjs/actions/puzzlePieces/getPendingWildcards.js +9 -0
  13. package/_cjs/actions/puzzlePieces/getTotalPuzzlePiecesMinted.d.cts +7 -0
  14. package/_cjs/actions/puzzlePieces/getTotalPuzzlePiecesMinted.js +8 -0
  15. package/_cjs/actions/{fractionalNft → puzzlePieces}/getWildcardCollectionId.js +1 -1
  16. package/_cjs/actions/{fractionalNft → puzzlePieces}/getWildcardDistributionMap.js +1 -1
  17. package/_cjs/actions/{fractionalNft → puzzlePieces}/getWildcardThreshold.js +1 -1
  18. package/_cjs/actions/{fractionalNft → puzzlePieces}/index.d.cts +5 -5
  19. package/_cjs/actions/{fractionalNft → puzzlePieces}/index.js +5 -5
  20. package/_cjs/actions/puzzlePieces/types.d.cts +5 -0
  21. package/_cjs/actions/rewardPool/index.d.cts +0 -4
  22. package/_cjs/actions/rewardPool/index.js +1 -5
  23. package/_cjs/client/compatibility.d.cts +16 -0
  24. package/_cjs/client/compatibility.js +60 -0
  25. package/_cjs/client/createClient.d.cts +2 -0
  26. package/_cjs/client/createClient.js +11 -0
  27. package/_cjs/crypto/index.d.cts +0 -2
  28. package/_cjs/crypto/index.js +1 -4
  29. package/_cjs/did/didUri.d.cts +11 -0
  30. package/_cjs/did/didUri.js +14 -0
  31. package/_cjs/index.d.cts +7 -4
  32. package/_cjs/index.js +9 -4
  33. package/_cjs/plugins/index.d.cts +2 -2
  34. package/_cjs/plugins/index.js +3 -3
  35. package/_cjs/plugins/{fractionalNft.d.cts → puzzlePieces.d.cts} +7 -10
  36. package/_cjs/plugins/{fractionalNft.js → puzzlePieces.js} +6 -6
  37. package/_cjs/plugins/rewardPool.d.cts +0 -5
  38. package/_cjs/plugins/rewardPool.js +0 -2
  39. package/_cjs/rpc/call.js +17 -1
  40. package/_cjs/rpc/definitions.js +49 -65
  41. package/_cjs/rpc/types.js +8 -12
  42. package/_esm/accounts/substrateSigner.js +5 -2
  43. package/_esm/actions/attestation/attest.js +6 -6
  44. package/_esm/actions/index.js +1 -1
  45. package/_esm/actions/{fractionalNft → puzzlePieces}/getCollectionsCount.js +1 -1
  46. package/_esm/actions/{fractionalNft → puzzlePieces}/getItemsCount.js +1 -1
  47. package/_esm/actions/{fractionalNft → puzzlePieces}/getOwner.js +1 -1
  48. package/_esm/actions/puzzlePieces/getPendingWildcards.js +6 -0
  49. package/_esm/actions/puzzlePieces/getTotalPuzzlePiecesMinted.js +5 -0
  50. package/_esm/actions/{fractionalNft → puzzlePieces}/getWildcardCollectionId.js +1 -1
  51. package/_esm/actions/{fractionalNft → puzzlePieces}/getWildcardDistributionMap.js +1 -1
  52. package/_esm/actions/{fractionalNft → puzzlePieces}/getWildcardThreshold.js +1 -1
  53. package/_esm/actions/{fractionalNft → puzzlePieces}/index.js +2 -2
  54. package/_esm/actions/rewardPool/index.js +0 -2
  55. package/_esm/client/compatibility.js +55 -0
  56. package/_esm/client/createClient.js +11 -0
  57. package/_esm/crypto/index.js +0 -1
  58. package/_esm/did/didUri.js +11 -0
  59. package/_esm/index.js +4 -2
  60. package/_esm/plugins/index.js +1 -1
  61. package/_esm/plugins/{fractionalNft.js → puzzlePieces.js} +5 -5
  62. package/_esm/plugins/rewardPool.js +1 -3
  63. package/_esm/rpc/call.js +17 -1
  64. package/_esm/rpc/definitions.js +49 -65
  65. package/_esm/rpc/types.js +8 -12
  66. package/_types/accounts/substrateSigner.d.ts.map +1 -1
  67. package/_types/actions/attestation/attest.d.ts +14 -9
  68. package/_types/actions/attestation/attest.d.ts.map +1 -1
  69. package/_types/actions/attestation/index.d.ts +1 -1
  70. package/_types/actions/attestation/index.d.ts.map +1 -1
  71. package/_types/actions/index.d.ts +1 -1
  72. package/_types/actions/index.d.ts.map +1 -1
  73. package/_types/actions/puzzlePieces/getCollectionsCount.d.ts.map +1 -0
  74. package/_types/actions/puzzlePieces/getItemsCount.d.ts.map +1 -0
  75. package/_types/actions/puzzlePieces/getOwner.d.ts.map +1 -0
  76. package/_types/actions/puzzlePieces/getPendingWildcards.d.ts +8 -0
  77. package/_types/actions/puzzlePieces/getPendingWildcards.d.ts.map +1 -0
  78. package/_types/actions/puzzlePieces/getTotalPuzzlePiecesMinted.d.ts +7 -0
  79. package/_types/actions/puzzlePieces/getTotalPuzzlePiecesMinted.d.ts.map +1 -0
  80. package/_types/actions/puzzlePieces/getWildcardCollectionId.d.ts.map +1 -0
  81. package/_types/actions/puzzlePieces/getWildcardDistributionMap.d.ts.map +1 -0
  82. package/_types/actions/puzzlePieces/getWildcardThreshold.d.ts.map +1 -0
  83. package/_types/actions/{fractionalNft → puzzlePieces}/index.d.ts +5 -5
  84. package/_types/actions/puzzlePieces/index.d.ts.map +1 -0
  85. package/_types/actions/puzzlePieces/types.d.ts +5 -0
  86. package/_types/actions/puzzlePieces/types.d.ts.map +1 -0
  87. package/_types/actions/rewardPool/index.d.ts +0 -4
  88. package/_types/actions/rewardPool/index.d.ts.map +1 -1
  89. package/_types/client/compatibility.d.ts +16 -0
  90. package/_types/client/compatibility.d.ts.map +1 -0
  91. package/_types/client/createClient.d.ts +2 -0
  92. package/_types/client/createClient.d.ts.map +1 -1
  93. package/_types/crypto/index.d.ts +0 -2
  94. package/_types/crypto/index.d.ts.map +1 -1
  95. package/_types/did/didUri.d.ts +11 -0
  96. package/_types/did/didUri.d.ts.map +1 -0
  97. package/_types/index.d.ts +7 -4
  98. package/_types/index.d.ts.map +1 -1
  99. package/_types/plugins/index.d.ts +2 -2
  100. package/_types/plugins/index.d.ts.map +1 -1
  101. package/_types/plugins/{fractionalNft.d.ts → puzzlePieces.d.ts} +7 -10
  102. package/_types/plugins/puzzlePieces.d.ts.map +1 -0
  103. package/_types/plugins/rewardPool.d.ts +0 -5
  104. package/_types/plugins/rewardPool.d.ts.map +1 -1
  105. package/_types/rpc/call.d.ts.map +1 -1
  106. package/_types/rpc/definitions.d.ts.map +1 -1
  107. package/_types/rpc/types.d.ts.map +1 -1
  108. package/package.json +1 -1
  109. package/_cjs/actions/fractionalNft/getNftInfo.d.cts +0 -9
  110. package/_cjs/actions/fractionalNft/getNftInfo.js +0 -12
  111. package/_cjs/actions/fractionalNft/getTotalFnftsMinted.d.cts +0 -7
  112. package/_cjs/actions/fractionalNft/getTotalFnftsMinted.js +0 -8
  113. package/_cjs/actions/fractionalNft/types.d.cts +0 -10
  114. package/_cjs/actions/rewardPool/getCollectionIds.d.cts +0 -7
  115. package/_cjs/actions/rewardPool/getCollectionIds.js +0 -8
  116. package/_cjs/actions/rewardPool/getItemIds.d.cts +0 -8
  117. package/_cjs/actions/rewardPool/getItemIds.js +0 -8
  118. package/_cjs/crypto/claimHash.d.cts +0 -23
  119. package/_cjs/crypto/claimHash.js +0 -38
  120. package/_esm/actions/fractionalNft/getNftInfo.js +0 -9
  121. package/_esm/actions/fractionalNft/getTotalFnftsMinted.js +0 -5
  122. package/_esm/actions/rewardPool/getCollectionIds.js +0 -5
  123. package/_esm/actions/rewardPool/getItemIds.js +0 -5
  124. package/_esm/crypto/claimHash.js +0 -34
  125. package/_types/actions/fractionalNft/getCollectionsCount.d.ts.map +0 -1
  126. package/_types/actions/fractionalNft/getItemsCount.d.ts.map +0 -1
  127. package/_types/actions/fractionalNft/getNftInfo.d.ts +0 -9
  128. package/_types/actions/fractionalNft/getNftInfo.d.ts.map +0 -1
  129. package/_types/actions/fractionalNft/getOwner.d.ts.map +0 -1
  130. package/_types/actions/fractionalNft/getTotalFnftsMinted.d.ts +0 -7
  131. package/_types/actions/fractionalNft/getTotalFnftsMinted.d.ts.map +0 -1
  132. package/_types/actions/fractionalNft/getWildcardCollectionId.d.ts.map +0 -1
  133. package/_types/actions/fractionalNft/getWildcardDistributionMap.d.ts.map +0 -1
  134. package/_types/actions/fractionalNft/getWildcardThreshold.d.ts.map +0 -1
  135. package/_types/actions/fractionalNft/index.d.ts.map +0 -1
  136. package/_types/actions/fractionalNft/types.d.ts +0 -10
  137. package/_types/actions/fractionalNft/types.d.ts.map +0 -1
  138. package/_types/actions/rewardPool/getCollectionIds.d.ts +0 -7
  139. package/_types/actions/rewardPool/getCollectionIds.d.ts.map +0 -1
  140. package/_types/actions/rewardPool/getItemIds.d.ts +0 -8
  141. package/_types/actions/rewardPool/getItemIds.d.ts.map +0 -1
  142. package/_types/crypto/claimHash.d.ts +0 -23
  143. package/_types/crypto/claimHash.d.ts.map +0 -1
  144. package/_types/plugins/fractionalNft.d.ts.map +0 -1
  145. /package/_cjs/actions/{fractionalNft → puzzlePieces}/getCollectionsCount.d.cts +0 -0
  146. /package/_cjs/actions/{fractionalNft → puzzlePieces}/getItemsCount.d.cts +0 -0
  147. /package/_cjs/actions/{fractionalNft → puzzlePieces}/getOwner.d.cts +0 -0
  148. /package/_cjs/actions/{fractionalNft → puzzlePieces}/getWildcardCollectionId.d.cts +0 -0
  149. /package/_cjs/actions/{fractionalNft → puzzlePieces}/getWildcardDistributionMap.d.cts +0 -0
  150. /package/_cjs/actions/{fractionalNft → puzzlePieces}/getWildcardThreshold.d.cts +0 -0
  151. /package/_cjs/actions/{fractionalNft → puzzlePieces}/types.js +0 -0
  152. /package/_esm/actions/{fractionalNft → puzzlePieces}/types.js +0 -0
  153. /package/_types/actions/{fractionalNft → puzzlePieces}/getCollectionsCount.d.ts +0 -0
  154. /package/_types/actions/{fractionalNft → puzzlePieces}/getItemsCount.d.ts +0 -0
  155. /package/_types/actions/{fractionalNft → puzzlePieces}/getOwner.d.ts +0 -0
  156. /package/_types/actions/{fractionalNft → puzzlePieces}/getWildcardCollectionId.d.ts +0 -0
  157. /package/_types/actions/{fractionalNft → puzzlePieces}/getWildcardDistributionMap.d.ts +0 -0
  158. /package/_types/actions/{fractionalNft → puzzlePieces}/getWildcardThreshold.d.ts +0 -0
package/README.md CHANGED
@@ -57,21 +57,36 @@ to the actions, so the three cannot diverge.
57
57
  Use `createClientFromApi` instead of `createClient` when you already manage your own
58
58
  `ApiPromise`.
59
59
 
60
+ ## Node compatibility
61
+
62
+ `createClient` checks the node when it connects: the runtime name, the arguments of every
63
+ call the actions build, and every custom RPC. A mismatch logs one warning that lists each
64
+ problem.
65
+
66
+ ```ts
67
+ await createClient({ url, compatibility: 'strict' }); // throw IncompatibleNodeError instead
68
+ await createClient({ url, compatibility: 'off' }); // skip the check
69
+ checkCompatibility(api); // the same check on your own ApiPromise; [] when it matches
70
+ ```
71
+
72
+ The check cannot see a reordered or retyped RPC parameter or a changed RPC result: the node
73
+ does not publish those.
74
+
60
75
  ## Coverage
61
76
 
62
- All 57 custom RPC methods, across the chain's nine RPC-exposing pallets, plus the DID
77
+ All 55 custom RPC methods, across the chain's nine RPC-exposing pallets, plus the DID
63
78
  and attestation extrinsics.
64
79
 
65
80
  | Pallet | Methods | Plugin |
66
81
  | ---------------------- | ------- | ---------------------------- |
67
82
  | potential | 11 | `potentialPlugin` |
68
83
  | activity-tracker | 8 | `activityTrackerPlugin` |
69
- | fractional-nft | 8 | `fractionalNftPlugin` |
84
+ | puzzle-pieces | 8 | `puzzlePiecesPlugin` |
70
85
  | validator-manager | 8 | `validatorManagerPlugin` |
71
86
  | referral | 7 | `referralPlugin` |
72
87
  | handshake | 5 | `handshakePlugin` |
73
88
  | reputation-voting | 4 | `reputationVotingPlugin` |
74
- | reward-pool | 4 | `rewardPoolPlugin` |
89
+ | reward-pool | 2 | `rewardPoolPlugin` |
75
90
  | tech-committee-manager | 2 | `techCommitteeManagerPlugin` |
76
91
 
77
92
  Each plugin is optional. Import the bare actions instead and you pay only for what you
@@ -80,17 +95,13 @@ pass them yourself if you build the `ApiPromise`.
80
95
 
81
96
  ## DID and attestation
82
97
 
83
- An attestation records that a provider vouches for a claim about a subject. The chain
84
- stores only hashes, so the client derives both.
98
+ An attestation records that a provider verified a claim of one CType for a subject. The
99
+ chain keys it by subject and CType hash and stores nothing derived from the claim's
100
+ value, not even a hash: the provider checks the value off chain, and anyone who needs
101
+ the value gets it from the provider.
85
102
 
86
103
  ```ts
87
- import {
88
- account,
89
- deriveClaimHash,
90
- didUri,
91
- REGISTERED_CTYPES,
92
- submitAndWait,
93
- } from '@totochain/client';
104
+ import { account, REGISTERED_CTYPES, submitAndWait } from '@totochain/client';
94
105
  import { attest, createDid } from '@totochain/client/actions';
95
106
 
96
107
  const provider = account('AttestationProvider');
@@ -100,23 +111,34 @@ await submitAndWait(client, { extrinsic: createDid(client), signer: subject });
100
111
 
101
112
  const email = REGISTERED_CTYPES.find((c) => c.title === 'Email' && !c.deprecated)!;
102
113
 
103
- // The key must be the property the CType declares — it is part of the hash preimage.
104
- const claimHash = deriveClaimHash({
105
- ctypeHash: email.hash,
106
- subject: didUri(subject.address),
107
- contents: { email: 'alice@example.com' },
108
- });
109
-
110
114
  await submitAndWait(client, {
111
- extrinsic: attest(client, {
112
- claimHash,
113
- ctypeHash: email.hash,
114
- subject: subject.address,
115
- }),
115
+ extrinsic: attest(client, { subject: subject.address, ctypeHash: email.hash }),
116
116
  signer: provider,
117
117
  });
118
118
  ```
119
119
 
120
+ `revokeAttestation` and `removeAttestation` also take the `issuanceId` of the attestation
121
+ they mean to act on. The chain never reuses an issuance id, so a stale or retried call
122
+ fails with `IssuanceMismatch` rather than reach a later re-attestation of the same
123
+ subject and CType:
124
+
125
+ ```ts
126
+ import { removeAttestation } from '@totochain/client/actions';
127
+
128
+ const record = await client.api.query.attestation.attestations(subject.address, email.hash);
129
+ if (record.isSome) {
130
+ const { issuanceId } = record.unwrap();
131
+ await submitAndWait(client, {
132
+ extrinsic: removeAttestation(client, {
133
+ subject: subject.address,
134
+ ctypeHash: email.hash,
135
+ issuanceId: issuanceId.toBigInt(),
136
+ }),
137
+ signer: provider,
138
+ });
139
+ }
140
+ ```
141
+
120
142
  `submitAndWait` resolves once the extrinsic is in a block and succeeded, rejecting on
121
143
  a module error, on a status that means it will never be included, on a failed call
122
144
  inside a `utility.batch`, and on the provider dropping the subscription. It takes a
@@ -147,10 +169,12 @@ try {
147
169
  }
148
170
  ```
149
171
 
150
- Both derivations are consensus-relevant. `ctypeHash` reproduces all 11 registered
151
- CTypes, and `deriveClaimHash` matches what the chain's own tests expect — a change to
152
- either makes every previously issued attestation unfindable. `REGISTERED_CTYPES`
153
- carries the registered schemas, deprecated ones included, so old attestations resolve.
172
+ `ctypeHash` is consensus-relevant. It reproduces all 11 registered CTypes, and the CType
173
+ hash is half of an attestation's key, so a change to it makes every previously issued
174
+ attestation unfindable. `REGISTERED_CTYPES` carries the registered schemas, deprecated
175
+ ones included, so old attestations resolve. Read one back with
176
+ `client.api.query.attestation.attestations(subject, ctypeHash)`, an `Option` of
177
+ `{ attester, revoked, createdAt, issuanceId }`.
154
178
 
155
179
  ## Pagination
156
180
 
@@ -30,7 +30,10 @@ function toSubstrateSigner(api, signer) {
30
30
  const extrinsic = api.registry.createType('ExtrinsicPayload', payload, {
31
31
  version: payload.version,
32
32
  });
33
- const digest = (0, util_crypto_1.keccakAsU8a)(extrinsic.toU8a({ method: true }));
33
+ // A payload longer than 256 bytes is signed as its blake2_256 hash, which is what the
34
+ // chain checks the signature against.
35
+ const encoded = extrinsic.toU8a({ method: true });
36
+ const digest = (0, util_crypto_1.keccakAsU8a)(encoded.length > 256 ? (0, util_crypto_1.blake2AsU8a)(encoded) : encoded);
34
37
  return { id: 0, signature: (0, util_1.u8aToHex)(normalise(await signer.signDigest(digest))) };
35
38
  },
36
39
  async signRaw(raw) {
@@ -1,16 +1,21 @@
1
1
  import type { Client } from '../../client/types.cjs';
2
2
  import type { Address, Hash } from '../../types/index.cjs';
3
3
  import type { Extrinsic } from '../did/createDid.cjs';
4
+ /** The pair that identifies an attestation: the chain holds at most one per subject and CType. */
4
5
  export interface AttestParameters {
5
- claimHash: Hash;
6
- ctypeHash: Hash;
7
6
  subject: Address;
7
+ ctypeHash: Hash;
8
+ }
9
+ /**
10
+ * One issuance of an attestation. The chain never reuses an issuance id, so revoking or removing
11
+ * by it cannot reach a later re-attestation of the same subject and CType: the call fails with
12
+ * `IssuanceMismatch` instead. Read the id from `api.query.attestation.attestations(subject,
13
+ * ctypeHash)` (`issuanceId`) or from the `AttestationCreated` event.
14
+ */
15
+ export interface AttestationIssuanceParameters extends AttestParameters {
16
+ issuanceId: bigint;
8
17
  }
9
- export declare function attest(client: Client, { claimHash, ctypeHash, subject }: AttestParameters): Extrinsic;
10
- export declare function revokeAttestation(client: Client, { claimHash }: {
11
- claimHash: Hash;
12
- }): Extrinsic;
13
- export declare function removeAttestation(client: Client, { claimHash }: {
14
- claimHash: Hash;
15
- }): Extrinsic;
18
+ export declare function attest(client: Client, { subject, ctypeHash }: AttestParameters): Extrinsic;
19
+ export declare function revokeAttestation(client: Client, { subject, ctypeHash, issuanceId }: AttestationIssuanceParameters): Extrinsic;
20
+ export declare function removeAttestation(client: Client, { subject, ctypeHash, issuanceId }: AttestationIssuanceParameters): Extrinsic;
16
21
  //# sourceMappingURL=attest.d.ts.map
@@ -3,12 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.attest = attest;
4
4
  exports.revokeAttestation = revokeAttestation;
5
5
  exports.removeAttestation = removeAttestation;
6
- function attest(client, { claimHash, ctypeHash, subject }) {
7
- return client.api.tx['attestation']['add'](claimHash, ctypeHash, null, subject);
6
+ function attest(client, { subject, ctypeHash }) {
7
+ return client.api.tx['attestation']['add'](subject, ctypeHash);
8
8
  }
9
- function revokeAttestation(client, { claimHash }) {
10
- return client.api.tx['attestation']['revoke'](claimHash, null);
9
+ function revokeAttestation(client, { subject, ctypeHash, issuanceId }) {
10
+ return client.api.tx['attestation']['revoke'](subject, ctypeHash, issuanceId);
11
11
  }
12
- function removeAttestation(client, { claimHash }) {
13
- return client.api.tx['attestation']['remove'](claimHash, null);
12
+ function removeAttestation(client, { subject, ctypeHash, issuanceId }) {
13
+ return client.api.tx['attestation']['remove'](subject, ctypeHash, issuanceId);
14
14
  }
@@ -1,3 +1,3 @@
1
1
  export { attest, removeAttestation, revokeAttestation } from './attest.cjs';
2
- export type { AttestParameters } from './attest.cjs';
2
+ export type { AttestParameters, AttestationIssuanceParameters } from './attest.cjs';
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1,9 +1,9 @@
1
1
  export * from './activityTracker/index.cjs';
2
2
  export * from './attestation/index.cjs';
3
3
  export * from './did/index.cjs';
4
- export * from './fractionalNft/index.cjs';
5
4
  export * from './handshake/index.cjs';
6
5
  export * from './potential/index.cjs';
6
+ export * from './puzzlePieces/index.cjs';
7
7
  export * from './referral/index.cjs';
8
8
  export * from './reputationVoting/index.cjs';
9
9
  export * from './rewardPool/index.cjs';
@@ -18,9 +18,9 @@ exports.submitAndWait = exports.SubscriptionFailedError = exports.SubmitTimeoutE
18
18
  __exportStar(require("./activityTracker/index.js"), exports);
19
19
  __exportStar(require("./attestation/index.js"), exports);
20
20
  __exportStar(require("./did/index.js"), exports);
21
- __exportStar(require("./fractionalNft/index.js"), exports);
22
21
  __exportStar(require("./handshake/index.js"), exports);
23
22
  __exportStar(require("./potential/index.js"), exports);
23
+ __exportStar(require("./puzzlePieces/index.js"), exports);
24
24
  __exportStar(require("./referral/index.js"), exports);
25
25
  __exportStar(require("./reputationVoting/index.js"), exports);
26
26
  __exportStar(require("./rewardPool/index.js"), exports);
@@ -3,6 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getCollectionsCount = getCollectionsCount;
4
4
  const call_js_1 = require("../../rpc/call.js");
5
5
  async function getCollectionsCount(client, { at } = {}) {
6
- const result = await (0, call_js_1.callRpc)(client, 'fractionalNft', 'collectionsCount', at);
6
+ const result = await (0, call_js_1.callRpc)(client, 'puzzlePieces', 'collectionsCount', at);
7
7
  return result.toNumber();
8
8
  }
@@ -3,6 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getItemsCount = getItemsCount;
4
4
  const call_js_1 = require("../../rpc/call.js");
5
5
  async function getItemsCount(client, { collectionId, at }) {
6
- const result = await (0, call_js_1.callRpc)(client, 'fractionalNft', 'itemsCount', collectionId, at);
6
+ const result = await (0, call_js_1.callRpc)(client, 'puzzlePieces', 'itemsCount', collectionId, at);
7
7
  return result.toNumber();
8
8
  }
@@ -3,6 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getOwner = getOwner;
4
4
  const call_js_1 = require("../../rpc/call.js");
5
5
  async function getOwner(client, { collectionId, itemId, at }) {
6
- const result = await (0, call_js_1.callRpc)(client, 'fractionalNft', 'owner', collectionId, itemId, at);
6
+ const result = await (0, call_js_1.callRpc)(client, 'puzzlePieces', 'owner', collectionId, itemId, at);
7
7
  return result.isSome ? result.unwrap().toString() : null;
8
8
  }
@@ -0,0 +1,8 @@
1
+ import type { Client } from '../../client/types.cjs';
2
+ import type { BlockHash } from '../../types/index.cjs';
3
+ export interface GetPendingWildcardsParameters {
4
+ at?: BlockHash;
5
+ }
6
+ /** Wildcards owed but not yet minted into the distribution map. */
7
+ export declare function getPendingWildcards(client: Client, { at }?: GetPendingWildcardsParameters): Promise<number>;
8
+ //# sourceMappingURL=getPendingWildcards.d.ts.map
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getPendingWildcards = getPendingWildcards;
4
+ const call_js_1 = require("../../rpc/call.js");
5
+ /** Wildcards owed but not yet minted into the distribution map. */
6
+ async function getPendingWildcards(client, { at } = {}) {
7
+ const result = await (0, call_js_1.callRpc)(client, 'puzzlePieces', 'pendingWildcards', at);
8
+ return result.toNumber();
9
+ }
@@ -0,0 +1,7 @@
1
+ import type { Client } from '../../client/types.cjs';
2
+ import type { BlockHash } from '../../types/index.cjs';
3
+ export interface GetTotalPuzzlePiecesMintedParameters {
4
+ at?: BlockHash;
5
+ }
6
+ export declare function getTotalPuzzlePiecesMinted(client: Client, { at }?: GetTotalPuzzlePiecesMintedParameters): Promise<number | null>;
7
+ //# sourceMappingURL=getTotalPuzzlePiecesMinted.d.ts.map
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getTotalPuzzlePiecesMinted = getTotalPuzzlePiecesMinted;
4
+ const call_js_1 = require("../../rpc/call.js");
5
+ async function getTotalPuzzlePiecesMinted(client, { at } = {}) {
6
+ const result = await (0, call_js_1.callRpc)(client, 'puzzlePieces', 'totalPuzzlePiecesMinted', at);
7
+ return result.isSome ? result.unwrap().toNumber() : null;
8
+ }
@@ -3,6 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getWildcardCollectionId = getWildcardCollectionId;
4
4
  const call_js_1 = require("../../rpc/call.js");
5
5
  async function getWildcardCollectionId(client, { at } = {}) {
6
- const result = await (0, call_js_1.callRpc)(client, 'fractionalNft', 'wildcardCollectionId', at);
6
+ const result = await (0, call_js_1.callRpc)(client, 'puzzlePieces', 'wildcardCollectionId', at);
7
7
  return result.isSome ? result.unwrap().toNumber() : null;
8
8
  }
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getWildcardDistributionMap = getWildcardDistributionMap;
4
4
  const call_js_1 = require("../../rpc/call.js");
5
5
  async function getWildcardDistributionMap(client, { at } = {}) {
6
- const result = await (0, call_js_1.callRpc)(client, 'fractionalNft', 'wildcardDistributionMap', at);
6
+ const result = await (0, call_js_1.callRpc)(client, 'puzzlePieces', 'wildcardDistributionMap', at);
7
7
  const pairs = result.toJSON();
8
8
  return pairs.map(([blockNumber, itemId]) => ({ blockNumber, itemId }));
9
9
  }
@@ -3,6 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getWildcardThreshold = getWildcardThreshold;
4
4
  const call_js_1 = require("../../rpc/call.js");
5
5
  async function getWildcardThreshold(client, { at } = {}) {
6
- const result = await (0, call_js_1.callRpc)(client, 'fractionalNft', 'wildcardThreshold', at);
6
+ const result = await (0, call_js_1.callRpc)(client, 'puzzlePieces', 'wildcardThreshold', at);
7
7
  return result.isSome ? result.unwrap().toNumber() : null;
8
8
  }
@@ -1,17 +1,17 @@
1
1
  export { getCollectionsCount } from './getCollectionsCount.cjs';
2
2
  export { getItemsCount } from './getItemsCount.cjs';
3
- export { getNftInfo } from './getNftInfo.cjs';
4
3
  export { getOwner } from './getOwner.cjs';
5
- export { getTotalFnftsMinted } from './getTotalFnftsMinted.cjs';
4
+ export { getPendingWildcards } from './getPendingWildcards.cjs';
5
+ export { getTotalPuzzlePiecesMinted } from './getTotalPuzzlePiecesMinted.cjs';
6
6
  export { getWildcardCollectionId } from './getWildcardCollectionId.cjs';
7
7
  export { getWildcardDistributionMap } from './getWildcardDistributionMap.cjs';
8
8
  export { getWildcardThreshold } from './getWildcardThreshold.cjs';
9
- export type { NftInfo, WildcardDistribution } from './types.cjs';
9
+ export type { WildcardDistribution } from './types.cjs';
10
10
  export type { GetCollectionsCountParameters } from './getCollectionsCount.cjs';
11
11
  export type { GetItemsCountParameters } from './getItemsCount.cjs';
12
- export type { GetNftInfoParameters } from './getNftInfo.cjs';
13
12
  export type { GetOwnerParameters } from './getOwner.cjs';
14
- export type { GetTotalFnftsMintedParameters } from './getTotalFnftsMinted.cjs';
13
+ export type { GetPendingWildcardsParameters } from './getPendingWildcards.cjs';
14
+ export type { GetTotalPuzzlePiecesMintedParameters } from './getTotalPuzzlePiecesMinted.cjs';
15
15
  export type { GetWildcardCollectionIdParameters } from './getWildcardCollectionId.cjs';
16
16
  export type { GetWildcardDistributionMapParameters } from './getWildcardDistributionMap.cjs';
17
17
  export type { GetWildcardThresholdParameters } from './getWildcardThreshold.cjs';
@@ -1,16 +1,16 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getWildcardThreshold = exports.getWildcardDistributionMap = exports.getWildcardCollectionId = exports.getTotalFnftsMinted = exports.getOwner = exports.getNftInfo = exports.getItemsCount = exports.getCollectionsCount = void 0;
3
+ exports.getWildcardThreshold = exports.getWildcardDistributionMap = exports.getWildcardCollectionId = exports.getTotalPuzzlePiecesMinted = exports.getPendingWildcards = exports.getOwner = exports.getItemsCount = exports.getCollectionsCount = void 0;
4
4
  var getCollectionsCount_js_1 = require("./getCollectionsCount.js");
5
5
  Object.defineProperty(exports, "getCollectionsCount", { enumerable: true, get: function () { return getCollectionsCount_js_1.getCollectionsCount; } });
6
6
  var getItemsCount_js_1 = require("./getItemsCount.js");
7
7
  Object.defineProperty(exports, "getItemsCount", { enumerable: true, get: function () { return getItemsCount_js_1.getItemsCount; } });
8
- var getNftInfo_js_1 = require("./getNftInfo.js");
9
- Object.defineProperty(exports, "getNftInfo", { enumerable: true, get: function () { return getNftInfo_js_1.getNftInfo; } });
10
8
  var getOwner_js_1 = require("./getOwner.js");
11
9
  Object.defineProperty(exports, "getOwner", { enumerable: true, get: function () { return getOwner_js_1.getOwner; } });
12
- var getTotalFnftsMinted_js_1 = require("./getTotalFnftsMinted.js");
13
- Object.defineProperty(exports, "getTotalFnftsMinted", { enumerable: true, get: function () { return getTotalFnftsMinted_js_1.getTotalFnftsMinted; } });
10
+ var getPendingWildcards_js_1 = require("./getPendingWildcards.js");
11
+ Object.defineProperty(exports, "getPendingWildcards", { enumerable: true, get: function () { return getPendingWildcards_js_1.getPendingWildcards; } });
12
+ var getTotalPuzzlePiecesMinted_js_1 = require("./getTotalPuzzlePiecesMinted.js");
13
+ Object.defineProperty(exports, "getTotalPuzzlePiecesMinted", { enumerable: true, get: function () { return getTotalPuzzlePiecesMinted_js_1.getTotalPuzzlePiecesMinted; } });
14
14
  var getWildcardCollectionId_js_1 = require("./getWildcardCollectionId.js");
15
15
  Object.defineProperty(exports, "getWildcardCollectionId", { enumerable: true, get: function () { return getWildcardCollectionId_js_1.getWildcardCollectionId; } });
16
16
  var getWildcardDistributionMap_js_1 = require("./getWildcardDistributionMap.js");
@@ -0,0 +1,5 @@
1
+ export interface WildcardDistribution {
2
+ blockNumber: number;
3
+ itemId: number;
4
+ }
5
+ //# sourceMappingURL=types.d.ts.map
@@ -1,9 +1,5 @@
1
- export { getCollectionIds } from './getCollectionIds.cjs';
2
- export { getItemIds } from './getItemIds.cjs';
3
1
  export { getRewardPoolAccount } from './getRewardPoolAccount.cjs';
4
2
  export { getRewardPoolBalance } from './getRewardPoolBalance.cjs';
5
- export type { GetCollectionIdsParameters } from './getCollectionIds.cjs';
6
- export type { GetItemIdsParameters } from './getItemIds.cjs';
7
3
  export type { GetRewardPoolAccountParameters } from './getRewardPoolAccount.cjs';
8
4
  export type { GetRewardPoolBalanceParameters } from './getRewardPoolBalance.cjs';
9
5
  //# sourceMappingURL=index.d.ts.map
@@ -1,10 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getRewardPoolBalance = exports.getRewardPoolAccount = exports.getItemIds = exports.getCollectionIds = void 0;
4
- var getCollectionIds_js_1 = require("./getCollectionIds.js");
5
- Object.defineProperty(exports, "getCollectionIds", { enumerable: true, get: function () { return getCollectionIds_js_1.getCollectionIds; } });
6
- var getItemIds_js_1 = require("./getItemIds.js");
7
- Object.defineProperty(exports, "getItemIds", { enumerable: true, get: function () { return getItemIds_js_1.getItemIds; } });
3
+ exports.getRewardPoolBalance = exports.getRewardPoolAccount = void 0;
8
4
  var getRewardPoolAccount_js_1 = require("./getRewardPoolAccount.js");
9
5
  Object.defineProperty(exports, "getRewardPoolAccount", { enumerable: true, get: function () { return getRewardPoolAccount_js_1.getRewardPoolAccount; } });
10
6
  var getRewardPoolBalance_js_1 = require("./getRewardPoolBalance.js");
@@ -0,0 +1,16 @@
1
+ import type { ApiPromise } from '@polkadot/api';
2
+ /** The runtime this client is written against. */
3
+ export declare const SPEC_NAME = "totochain";
4
+ /** Every call an action builds, with the arguments it passes, as the node's metadata lists them. */
5
+ export declare const EXPECTED_CALLS: Readonly<Record<string, string>>;
6
+ /** Thrown by `createClient` in strict mode when the node does not match this client. */
7
+ export declare class IncompatibleNodeError extends Error {
8
+ readonly problems: readonly string[];
9
+ constructor(problems: readonly string[]);
10
+ }
11
+ /**
12
+ * Lists every way the connected node differs from what this client sends: the runtime, the
13
+ * calls the actions build and the custom RPCs. Empty when they match.
14
+ */
15
+ export declare function checkCompatibility(api: ApiPromise): string[];
16
+ //# sourceMappingURL=compatibility.d.ts.map
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.IncompatibleNodeError = exports.EXPECTED_CALLS = exports.SPEC_NAME = void 0;
4
+ exports.checkCompatibility = checkCompatibility;
5
+ const definitions_js_1 = require("../rpc/definitions.js");
6
+ /** The runtime this client is written against. */
7
+ exports.SPEC_NAME = 'totochain';
8
+ /** Every call an action builds, with the arguments it passes, as the node's metadata lists them. */
9
+ exports.EXPECTED_CALLS = {
10
+ 'attestation.add': 'subject: AccountId20, ctypeHash: H256',
11
+ 'attestation.remove': 'subject: AccountId20, ctypeHash: H256, issuanceId: u64',
12
+ 'attestation.revoke': 'subject: AccountId20, ctypeHash: H256, issuanceId: u64',
13
+ 'did.createDidFor': 'subject: AccountId20',
14
+ 'did.createFromAccount': '',
15
+ };
16
+ /** Thrown by `createClient` in strict mode when the node does not match this client. */
17
+ class IncompatibleNodeError extends Error {
18
+ problems;
19
+ constructor(problems) {
20
+ super(`The node does not match @totochain/client:\n- ${problems.join('\n- ')}`);
21
+ this.name = 'IncompatibleNodeError';
22
+ this.problems = problems;
23
+ }
24
+ }
25
+ exports.IncompatibleNodeError = IncompatibleNodeError;
26
+ /**
27
+ * Lists every way the connected node differs from what this client sends: the runtime, the
28
+ * calls the actions build and the custom RPCs. Empty when they match.
29
+ */
30
+ function checkCompatibility(api) {
31
+ const problems = [];
32
+ const specName = api.runtimeVersion.specName.toString();
33
+ if (specName !== exports.SPEC_NAME) {
34
+ problems.push(`runtime is ${specName}, expected ${exports.SPEC_NAME}`);
35
+ }
36
+ for (const [call, expected] of Object.entries(exports.EXPECTED_CALLS)) {
37
+ const [section, method] = call.split('.');
38
+ const fn = api.tx[section]?.[method];
39
+ if (!fn) {
40
+ problems.push(`call ${call} is missing`);
41
+ continue;
42
+ }
43
+ const actual = fn.meta.args
44
+ .map((arg) => `${arg.name.toString()}: ${arg.type.toString()}`)
45
+ .join(', ');
46
+ if (actual !== expected) {
47
+ problems.push(`call ${call} takes (${actual}), the client sends (${expected})`);
48
+ }
49
+ }
50
+ // polkadot-js removes every RPC the node does not list in `rpc_methods`.
51
+ const rpc = api.rpc;
52
+ for (const [section, methods] of Object.entries(definitions_js_1.RPC_DEFINITIONS)) {
53
+ for (const method of Object.keys(methods)) {
54
+ if (typeof rpc[section]?.[method] !== 'function') {
55
+ problems.push(`RPC ${section}_${method} is missing`);
56
+ }
57
+ }
58
+ }
59
+ return problems;
60
+ }
@@ -3,6 +3,8 @@ import type { Client, Plugin } from './types.cjs';
3
3
  export interface CreateClientOptions {
4
4
  url: string;
5
5
  timeoutMs?: number;
6
+ /** When the node does not match this client: log a warning (default), throw, or skip the check. */
7
+ compatibility?: 'warn' | 'strict' | 'off';
6
8
  }
7
9
  export declare function createClientFromApi(api: ApiPromise): Client;
8
10
  export declare function createClient(options: CreateClientOptions): Promise<Client>;
@@ -5,6 +5,7 @@ exports.createClient = createClient;
5
5
  const api_1 = require("@polkadot/api");
6
6
  const definitions_js_1 = require("../rpc/definitions.js");
7
7
  const types_js_1 = require("../rpc/types.js");
8
+ const compatibility_js_1 = require("./compatibility.js");
8
9
  function createClientFromApi(api) {
9
10
  const client = {
10
11
  api,
@@ -21,5 +22,15 @@ async function createClient(options) {
21
22
  rpc: definitions_js_1.RPC_DEFINITIONS,
22
23
  types: types_js_1.CHAIN_TYPES,
23
24
  });
25
+ const mode = options.compatibility ?? 'warn';
26
+ const problems = mode === 'off' ? [] : (0, compatibility_js_1.checkCompatibility)(api);
27
+ if (problems.length > 0) {
28
+ const error = new compatibility_js_1.IncompatibleNodeError(problems);
29
+ if (mode === 'strict') {
30
+ await api.disconnect();
31
+ throw error;
32
+ }
33
+ console.warn(error.message);
34
+ }
24
35
  return createClientFromApi(api);
25
36
  }
@@ -1,5 +1,3 @@
1
1
  export { canonicalCTypeBytes, ctypeHash } from './ctypeHash.cjs';
2
- export { deriveClaimHash, didUri } from './claimHash.cjs';
3
2
  export type { CTypeSchema } from './ctypeHash.cjs';
4
- export type { DeriveClaimHashParameters, DidUri } from './claimHash.cjs';
5
3
  //# sourceMappingURL=index.d.ts.map
@@ -1,9 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.didUri = exports.deriveClaimHash = exports.ctypeHash = exports.canonicalCTypeBytes = void 0;
3
+ exports.ctypeHash = exports.canonicalCTypeBytes = void 0;
4
4
  var ctypeHash_js_1 = require("./ctypeHash.js");
5
5
  Object.defineProperty(exports, "canonicalCTypeBytes", { enumerable: true, get: function () { return ctypeHash_js_1.canonicalCTypeBytes; } });
6
6
  Object.defineProperty(exports, "ctypeHash", { enumerable: true, get: function () { return ctypeHash_js_1.ctypeHash; } });
7
- var claimHash_js_1 = require("./claimHash.js");
8
- Object.defineProperty(exports, "deriveClaimHash", { enumerable: true, get: function () { return claimHash_js_1.deriveClaimHash; } });
9
- Object.defineProperty(exports, "didUri", { enumerable: true, get: function () { return claimHash_js_1.didUri; } });
@@ -0,0 +1,11 @@
1
+ export type DidUri = `did:toto:${string}`;
2
+ /**
3
+ * Renders an address as its DID URI: `did:toto:` followed by the address without its `0x`.
4
+ *
5
+ * The address is passed through verbatim, case included. Nothing hashes the string and the chain
6
+ * never sees it — the DID and attestation pallets identify the account by its typed H160 — so the
7
+ * case carries no meaning, and two URIs for one account can differ in case alone. Lowercase the
8
+ * address first if you compare URIs as strings; `pallet_did::did_uri` renders lowercase.
9
+ */
10
+ export declare function didUri(address: `0x${string}`): DidUri;
11
+ //# sourceMappingURL=didUri.d.ts.map
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.didUri = didUri;
4
+ /**
5
+ * Renders an address as its DID URI: `did:toto:` followed by the address without its `0x`.
6
+ *
7
+ * The address is passed through verbatim, case included. Nothing hashes the string and the chain
8
+ * never sees it — the DID and attestation pallets identify the account by its typed H160 — so the
9
+ * case carries no meaning, and two URIs for one account can differ in case alone. Lowercase the
10
+ * address first if you compare URIs as strings; `pallet_did::did_uri` renders lowercase.
11
+ */
12
+ function didUri(address) {
13
+ return `did:toto:${address.slice(2)}`;
14
+ }
package/_cjs/index.d.cts CHANGED
@@ -1,15 +1,18 @@
1
1
  export { createClient, createClientFromApi } from './client/createClient.cjs';
2
2
  export type { CreateClientOptions } from './client/createClient.cjs';
3
+ export { checkCompatibility, EXPECTED_CALLS, IncompatibleNodeError, SPEC_NAME, } from './client/compatibility.cjs';
3
4
  export type { Client, Plugin } from './client/types.cjs';
4
- export { activityTrackerPlugin, fractionalNftPlugin, handshakePlugin, potentialPlugin, referralPlugin, reputationVotingPlugin, rewardPoolPlugin, techCommitteeManagerPlugin, validatorManagerPlugin, } from './plugins/index.cjs';
5
- export type { ActivityTrackerCapability, FractionalNftCapability, HandshakeCapability, PotentialCapability, ReferralCapability, ReputationVotingCapability, RewardPoolCapability, TechCommitteeManagerCapability, ValidatorManagerCapability, } from './plugins/index.cjs';
5
+ export { activityTrackerPlugin, handshakePlugin, potentialPlugin, puzzlePiecesPlugin, referralPlugin, reputationVotingPlugin, rewardPoolPlugin, techCommitteeManagerPlugin, validatorManagerPlugin, } from './plugins/index.cjs';
6
+ export type { ActivityTrackerCapability, HandshakeCapability, PotentialCapability, PuzzlePiecesCapability, ReferralCapability, ReputationVotingCapability, RewardPoolCapability, TechCommitteeManagerCapability, ValidatorManagerCapability, } from './plugins/index.cjs';
6
7
  export { RPC_DEFINITIONS } from './rpc/definitions.cjs';
7
8
  export { CHAIN_TYPES } from './rpc/types.cjs';
8
9
  export { TOTOCHAIN_DEFINITIONS, typesBundle } from './rpc/bundle.cjs';
9
10
  export type { Address, BlockHash, Pagination, PaginatedResponse } from './types/index.cjs';
10
11
  export { DEFAULT_PAGE_SIZE, MAX_PAGE_SIZE } from './types/index.cjs';
11
- export { canonicalCTypeBytes, ctypeHash, deriveClaimHash, didUri } from './crypto/index.cjs';
12
- export type { CTypeSchema, DidUri } from './crypto/index.cjs';
12
+ export { canonicalCTypeBytes, ctypeHash } from './crypto/index.cjs';
13
+ export type { CTypeSchema } from './crypto/index.cjs';
14
+ export { didUri } from './did/didUri.cjs';
15
+ export type { DidUri } from './did/didUri.cjs';
13
16
  export { REGISTERED_CTYPES } from './ctypes/index.cjs';
14
17
  export type { RegisteredCType } from './ctypes/index.cjs';
15
18
  export { DispatchFailedError, isDispatchFailure, NotIncludedError, SubmitTimeoutError, SubscriptionFailedError, submitAndWait, } from './actions/submitAndWait.cjs';
package/_cjs/index.js CHANGED
@@ -1,14 +1,19 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.WELL_KNOWN_ACCOUNTS = exports.VALIDATOR_ACCOUNTS = exports.DEV_ACCOUNTS = exports.toSubstrateSigner = exports.stash = exports.isValidAddress = exports.generateMnemonic = exports.generateAccount = exports.fromPrivateKey = exports.fromMnemonic = exports.deriveAddress = exports.createKeyring = exports.addressOf = exports.account = exports.defineChain = exports.totochainTestnet = exports.totochainLocal = exports.totochainDev = exports.totochain = exports.submitAndWait = exports.SubscriptionFailedError = exports.SubmitTimeoutError = exports.NotIncludedError = exports.isDispatchFailure = exports.DispatchFailedError = exports.REGISTERED_CTYPES = exports.didUri = exports.deriveClaimHash = exports.ctypeHash = exports.canonicalCTypeBytes = exports.MAX_PAGE_SIZE = exports.DEFAULT_PAGE_SIZE = exports.typesBundle = exports.TOTOCHAIN_DEFINITIONS = exports.CHAIN_TYPES = exports.RPC_DEFINITIONS = exports.validatorManagerPlugin = exports.techCommitteeManagerPlugin = exports.rewardPoolPlugin = exports.reputationVotingPlugin = exports.referralPlugin = exports.potentialPlugin = exports.handshakePlugin = exports.fractionalNftPlugin = exports.activityTrackerPlugin = exports.createClientFromApi = exports.createClient = void 0;
3
+ exports.WELL_KNOWN_ACCOUNTS = exports.VALIDATOR_ACCOUNTS = exports.DEV_ACCOUNTS = exports.toSubstrateSigner = exports.stash = exports.isValidAddress = exports.generateMnemonic = exports.generateAccount = exports.fromPrivateKey = exports.fromMnemonic = exports.deriveAddress = exports.createKeyring = exports.addressOf = exports.account = exports.defineChain = exports.totochainTestnet = exports.totochainLocal = exports.totochainDev = exports.totochain = exports.submitAndWait = exports.SubscriptionFailedError = exports.SubmitTimeoutError = exports.NotIncludedError = exports.isDispatchFailure = exports.DispatchFailedError = exports.REGISTERED_CTYPES = exports.didUri = exports.ctypeHash = exports.canonicalCTypeBytes = exports.MAX_PAGE_SIZE = exports.DEFAULT_PAGE_SIZE = exports.typesBundle = exports.TOTOCHAIN_DEFINITIONS = exports.CHAIN_TYPES = exports.RPC_DEFINITIONS = exports.validatorManagerPlugin = exports.techCommitteeManagerPlugin = exports.rewardPoolPlugin = exports.reputationVotingPlugin = exports.referralPlugin = exports.puzzlePiecesPlugin = exports.potentialPlugin = exports.handshakePlugin = exports.activityTrackerPlugin = exports.SPEC_NAME = exports.IncompatibleNodeError = exports.EXPECTED_CALLS = exports.checkCompatibility = exports.createClientFromApi = exports.createClient = void 0;
4
4
  var createClient_js_1 = require("./client/createClient.js");
5
5
  Object.defineProperty(exports, "createClient", { enumerable: true, get: function () { return createClient_js_1.createClient; } });
6
6
  Object.defineProperty(exports, "createClientFromApi", { enumerable: true, get: function () { return createClient_js_1.createClientFromApi; } });
7
+ var compatibility_js_1 = require("./client/compatibility.js");
8
+ Object.defineProperty(exports, "checkCompatibility", { enumerable: true, get: function () { return compatibility_js_1.checkCompatibility; } });
9
+ Object.defineProperty(exports, "EXPECTED_CALLS", { enumerable: true, get: function () { return compatibility_js_1.EXPECTED_CALLS; } });
10
+ Object.defineProperty(exports, "IncompatibleNodeError", { enumerable: true, get: function () { return compatibility_js_1.IncompatibleNodeError; } });
11
+ Object.defineProperty(exports, "SPEC_NAME", { enumerable: true, get: function () { return compatibility_js_1.SPEC_NAME; } });
7
12
  var index_js_1 = require("./plugins/index.js");
8
13
  Object.defineProperty(exports, "activityTrackerPlugin", { enumerable: true, get: function () { return index_js_1.activityTrackerPlugin; } });
9
- Object.defineProperty(exports, "fractionalNftPlugin", { enumerable: true, get: function () { return index_js_1.fractionalNftPlugin; } });
10
14
  Object.defineProperty(exports, "handshakePlugin", { enumerable: true, get: function () { return index_js_1.handshakePlugin; } });
11
15
  Object.defineProperty(exports, "potentialPlugin", { enumerable: true, get: function () { return index_js_1.potentialPlugin; } });
16
+ Object.defineProperty(exports, "puzzlePiecesPlugin", { enumerable: true, get: function () { return index_js_1.puzzlePiecesPlugin; } });
12
17
  Object.defineProperty(exports, "referralPlugin", { enumerable: true, get: function () { return index_js_1.referralPlugin; } });
13
18
  Object.defineProperty(exports, "reputationVotingPlugin", { enumerable: true, get: function () { return index_js_1.reputationVotingPlugin; } });
14
19
  Object.defineProperty(exports, "rewardPoolPlugin", { enumerable: true, get: function () { return index_js_1.rewardPoolPlugin; } });
@@ -27,8 +32,8 @@ Object.defineProperty(exports, "MAX_PAGE_SIZE", { enumerable: true, get: functio
27
32
  var index_js_3 = require("./crypto/index.js");
28
33
  Object.defineProperty(exports, "canonicalCTypeBytes", { enumerable: true, get: function () { return index_js_3.canonicalCTypeBytes; } });
29
34
  Object.defineProperty(exports, "ctypeHash", { enumerable: true, get: function () { return index_js_3.ctypeHash; } });
30
- Object.defineProperty(exports, "deriveClaimHash", { enumerable: true, get: function () { return index_js_3.deriveClaimHash; } });
31
- Object.defineProperty(exports, "didUri", { enumerable: true, get: function () { return index_js_3.didUri; } });
35
+ var didUri_js_1 = require("./did/didUri.js");
36
+ Object.defineProperty(exports, "didUri", { enumerable: true, get: function () { return didUri_js_1.didUri; } });
32
37
  var index_js_4 = require("./ctypes/index.js");
33
38
  Object.defineProperty(exports, "REGISTERED_CTYPES", { enumerable: true, get: function () { return index_js_4.REGISTERED_CTYPES; } });
34
39
  var submitAndWait_js_1 = require("./actions/submitAndWait.js");