@red-isbe/isbe-service-did-registry 1.0.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 (51) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +129 -0
  3. package/dist/index.d.ts +26 -0
  4. package/dist/index.d.ts.map +1 -0
  5. package/dist/index.js +26 -0
  6. package/dist/index.js.map +1 -0
  7. package/dist/src/ServiceDidRegistryContext.d.ts +40 -0
  8. package/dist/src/ServiceDidRegistryContext.d.ts.map +1 -0
  9. package/dist/src/ServiceDidRegistryContext.js +42 -0
  10. package/dist/src/ServiceDidRegistryContext.js.map +1 -0
  11. package/dist/src/ServiceDidRegistryQueries.d.ts +127 -0
  12. package/dist/src/ServiceDidRegistryQueries.d.ts.map +1 -0
  13. package/dist/src/ServiceDidRegistryQueries.js +226 -0
  14. package/dist/src/ServiceDidRegistryQueries.js.map +1 -0
  15. package/dist/src/ServiceDidRegistryTransactions.d.ts +90 -0
  16. package/dist/src/ServiceDidRegistryTransactions.d.ts.map +1 -0
  17. package/dist/src/ServiceDidRegistryTransactions.js +134 -0
  18. package/dist/src/ServiceDidRegistryTransactions.js.map +1 -0
  19. package/dist/src/ServiceDidTransactionExecutor.d.ts +31 -0
  20. package/dist/src/ServiceDidTransactionExecutor.d.ts.map +1 -0
  21. package/dist/src/ServiceDidTransactionExecutor.js +37 -0
  22. package/dist/src/ServiceDidTransactionExecutor.js.map +1 -0
  23. package/dist/src/abi/IServiceDidRegistry.abi.d.ts +578 -0
  24. package/dist/src/abi/IServiceDidRegistry.abi.d.ts.map +1 -0
  25. package/dist/src/abi/IServiceDidRegistry.abi.js +741 -0
  26. package/dist/src/abi/IServiceDidRegistry.abi.js.map +1 -0
  27. package/dist/src/serviceDid.types.d.ts +78 -0
  28. package/dist/src/serviceDid.types.d.ts.map +1 -0
  29. package/dist/src/serviceDid.types.js +16 -0
  30. package/dist/src/serviceDid.types.js.map +1 -0
  31. package/dist/src/types.d.ts +35 -0
  32. package/dist/src/types.d.ts.map +1 -0
  33. package/dist/src/types.js +16 -0
  34. package/dist/src/types.js.map +1 -0
  35. package/dist/src/utils/blockchain.utils.d.ts +49 -0
  36. package/dist/src/utils/blockchain.utils.d.ts.map +1 -0
  37. package/dist/src/utils/blockchain.utils.js +102 -0
  38. package/dist/src/utils/blockchain.utils.js.map +1 -0
  39. package/dist/src/utils/did.utils.d.ts +20 -0
  40. package/dist/src/utils/did.utils.d.ts.map +1 -0
  41. package/dist/src/utils/did.utils.js +57 -0
  42. package/dist/src/utils/did.utils.js.map +1 -0
  43. package/dist/src/utils/serviceDid.utils.d.ts +71 -0
  44. package/dist/src/utils/serviceDid.utils.d.ts.map +1 -0
  45. package/dist/src/utils/serviceDid.utils.js +142 -0
  46. package/dist/src/utils/serviceDid.utils.js.map +1 -0
  47. package/dist/src/utils/serviceDocument.utils.d.ts +61 -0
  48. package/dist/src/utils/serviceDocument.utils.d.ts.map +1 -0
  49. package/dist/src/utils/serviceDocument.utils.js +101 -0
  50. package/dist/src/utils/serviceDocument.utils.js.map +1 -0
  51. package/package.json +45 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IServiceDidRegistry.abi.js","sourceRoot":"","sources":["../../../src/abi/IServiceDidRegistry.abi.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;EAcE;AAEF;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC;QACE,QAAQ,EAAE;YACR;gBACE,cAAc,EAAE,SAAS;gBACzB,MAAM,EAAE,WAAW;gBACnB,MAAM,EAAE,SAAS;aAClB;SACF;QACD,MAAM,EAAE,eAAe;QACvB,MAAM,EAAE,OAAO;KAChB;IACD;QACE,QAAQ,EAAE;YACR;gBACE,cAAc,EAAE,SAAS;gBACzB,MAAM,EAAE,YAAY;gBACpB,MAAM,EAAE,SAAS;aAClB;SACF;QACD,MAAM,EAAE,yBAAyB;QACjC,MAAM,EAAE,OAAO;KAChB;IACD;QACE,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cAAc;QACtB,SAAS,EAAE;YACT;gBACE,cAAc,EAAE,MAAM;gBACtB,MAAM,EAAE,SAAS;gBACjB,MAAM,EAAE,MAAM;aACf;SACF;QACD,iBAAiB,EAAE,YAAY;QAC/B,MAAM,EAAE,UAAU;KACnB;IACD;QACE,QAAQ,EAAE;YACR;gBACE,cAAc,EAAE,SAAS;gBACzB,MAAM,EAAE,YAAY;gBACpB,MAAM,EAAE,SAAS;aAClB;YACD;gBACE,cAAc,EAAE,QAAQ;gBACxB,MAAM,EAAE,UAAU;gBAClB,MAAM,EAAE,QAAQ;aACjB;SACF;QACD,MAAM,EAAE,uBAAuB;QAC/B,SAAS,EAAE;YACT;gBACE,cAAc,EAAE,MAAM;gBACtB,MAAM,EAAE,SAAS;gBACjB,MAAM,EAAE,MAAM;aACf;SACF;QACD,iBAAiB,EAAE,YAAY;QAC/B,MAAM,EAAE,UAAU;KACnB;CACO,CAAC"}
@@ -0,0 +1,78 @@
1
+ /**
2
+ * Copyright (c) 2025 Comunidad de Madrid & Alastria
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ *
7
+ * You may obtain a copy of the License at
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ /**
17
+ * A service identity as the contract stores it, with numbers rendered as strings
18
+ * to match the shape the rest of this library returns.
19
+ *
20
+ * The signing key is held as its `x` and `y` coordinates rather than as an address,
21
+ * because a resolver needs them to emit a verification method on either curve — an
22
+ * address is a truncated hash and cannot be inverted back into them.
23
+ * `signingKeyAddress` is derived, not stored on-chain.
24
+ */
25
+ export type ServiceDidRecord = {
26
+ /** did:isbe:svc:<network>:<controller-segment>:<nonce> */
27
+ serviceDid: string;
28
+ /** did:isbe:<network>:<controller-segment> */
29
+ controllerDid: string;
30
+ /** `x` coordinate of the signing public key, 32-byte hex */
31
+ pubKeyX: string;
32
+ /** `y` coordinate of the signing public key, 32-byte hex */
33
+ pubKeyY: string;
34
+ /**
35
+ * Address derived from the coordinates. Only meaningful when `ellipticType` is the
36
+ * curve the network operates on: for a key on any other curve no account can
37
+ * transact with it, and a DID Document must not carry it as `blockchainAccountId`.
38
+ */
39
+ signingKeyAddress: string;
40
+ /** keccak256 of the human-readable label, whose text lives off-chain */
41
+ labelHash: string;
42
+ /** Unix timestamp of expiry; "0" means it never expires */
43
+ expiresAt: string;
44
+ /** 1 = secp256k1, 2 = P-256 */
45
+ ellipticType: number;
46
+ /** Monotonic counter of the controller at registration, starting at 1 */
47
+ nonce: string;
48
+ deactivated: boolean;
49
+ exists: boolean;
50
+ registeredAt: string;
51
+ updatedAt: string;
52
+ };
53
+ /** Page of service identities, matching the shape of the registry's other getters. */
54
+ export type GetServiceDidsByControllerResult = {
55
+ items: ServiceDidRecord[];
56
+ total: string;
57
+ howMany: string;
58
+ prev: string;
59
+ next: string;
60
+ };
61
+ /** The parts a service DID string is built from. */
62
+ export type ServiceDidParts = {
63
+ /** Network discriminator, e.g. "uc" for Case */
64
+ network: string;
65
+ /** Parent organisational DID, rebuilt as did:isbe:<network>:<segment> */
66
+ controllerDid: string;
67
+ /** Monotonic counter, as it appears in the DID string */
68
+ nonce: bigint;
69
+ };
70
+ /**
71
+ * Why a service identity resolves as no longer valid.
72
+ *
73
+ * Kept apart from a plain boolean so a resolver can report the reason, and so the
74
+ * cascade case is distinguishable: the service itself may be perfectly well-formed
75
+ * and still not resolve, because its parent stopped being operative.
76
+ */
77
+ export type ServiceDidInactiveReason = "deactivated" | "expired" | "controller-inactive";
78
+ //# sourceMappingURL=serviceDid.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"serviceDid.types.d.ts","sourceRoot":"","sources":["../../src/serviceDid.types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;EAcE;AAEF;;;;;;;;GAQG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B,0DAA0D;IAC1D,UAAU,EAAE,MAAM,CAAC;IACnB,8CAA8C;IAC9C,aAAa,EAAE,MAAM,CAAC;IACtB,4DAA4D;IAC5D,OAAO,EAAE,MAAM,CAAC;IAChB,4DAA4D;IAC5D,OAAO,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,iBAAiB,EAAE,MAAM,CAAC;IAC1B,wEAAwE;IACxE,SAAS,EAAE,MAAM,CAAC;IAClB,2DAA2D;IAC3D,SAAS,EAAE,MAAM,CAAC;IAClB,+BAA+B;IAC/B,YAAY,EAAE,MAAM,CAAC;IACrB,yEAAyE;IACzE,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,OAAO,CAAC;IACrB,MAAM,EAAE,OAAO,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,sFAAsF;AACtF,MAAM,MAAM,gCAAgC,GAAG;IAC7C,KAAK,EAAE,gBAAgB,EAAE,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,oDAAoD;AACpD,MAAM,MAAM,eAAe,GAAG;IAC5B,gDAAgD;IAChD,OAAO,EAAE,MAAM,CAAC;IAChB,yEAAyE;IACzE,aAAa,EAAE,MAAM,CAAC;IACtB,yDAAyD;IACzD,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,wBAAwB,GAChC,aAAa,GACb,SAAS,GACT,qBAAqB,CAAC"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Copyright (c) 2025 Comunidad de Madrid & Alastria
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ *
7
+ * You may obtain a copy of the License at
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ //# sourceMappingURL=serviceDid.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"serviceDid.types.js","sourceRoot":"","sources":["../../src/serviceDid.types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;EAcE"}
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Copyright (c) 2025 Comunidad de Madrid & Alastria
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ *
7
+ * You may obtain a copy of the License at
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ /**
17
+ * A DID Document as DID Core defines it, kept structurally identical to the type
18
+ * `@red-isbe/did-isbe-registry` returns so that a resolver can treat the documents of
19
+ * both registries interchangeably.
20
+ */
21
+ export type DidW3CDocument = {
22
+ "@context": string[];
23
+ id: string;
24
+ controller?: string[];
25
+ verificationMethod: any[];
26
+ authentication?: string[];
27
+ assertionMethod?: string[];
28
+ capabilityInvocation?: string[];
29
+ capabilityDelegation?: string[];
30
+ keyAgreement?: string[];
31
+ alsoKnownAs?: string[];
32
+ /** Extension members, such as the free-form fields of a service document. */
33
+ [extension: string]: unknown;
34
+ };
35
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;EAcE;AAEF;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,kBAAkB,EAAE,GAAG,EAAE,CAAC;IAC1B,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAC3B,oBAAoB,CAAC,EAAE,MAAM,EAAE,CAAC;IAChC,oBAAoB,CAAC,EAAE,MAAM,EAAE,CAAC;IAChC,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,6EAA6E;IAC7E,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC;CAC9B,CAAC"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Copyright (c) 2025 Comunidad de Madrid & Alastria
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ *
7
+ * You may obtain a copy of the License at
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;EAcE"}
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Copyright (c) 2025 Comunidad de Madrid & Alastria
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ *
7
+ * You may obtain a copy of the License at
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ /**
17
+ * Transaction plumbing, ported from `@red-isbe/did-isbe-registry`
18
+ * (`utils/blockchain.utils.ts` and `BlockchainTransactionExecutor`).
19
+ *
20
+ * The shape of the unsigned transaction is deliberately identical to the one the
21
+ * organisational registry returns, so client code that already signs those keeps working
22
+ * against this package without a single change.
23
+ */
24
+ import { Contract, JsonRpcProvider } from "ethers";
25
+ /**
26
+ * Builds an unsigned transaction for a contract call.
27
+ *
28
+ * `from` is used only to look up that account's nonce; it authorises nothing. Who may
29
+ * perform the call is decided on-chain, from the signature, once the caller signs.
30
+ */
31
+ export declare function buildRawTransaction(contract: Contract, method: string, args: any[], provider: JsonRpcProvider, from: string): Promise<object>;
32
+ /**
33
+ * Broadcasts a signed transaction, refusing any whose recipient is not this registry.
34
+ *
35
+ * That check is the only thing standing between a relay endpoint and an open transaction
36
+ * pump: without it, anyone could use a deployment of this library to broadcast arbitrary
37
+ * transactions to the network.
38
+ */
39
+ export declare function sendSignedTransaction(signedRawTransaction: string, provider: JsonRpcProvider, contract: Contract): Promise<string>;
40
+ /**
41
+ * Waits for a receipt, returning `null` when the timeout elapses.
42
+ *
43
+ * A timeout is not a failure: the transaction was accepted and is on its way, so the
44
+ * caller should poll rather than resend. Any other error is a real one and is thrown.
45
+ */
46
+ export declare function waitForReceipt(tx_hash: string, timeout: number, provider: JsonRpcProvider): Promise<any | null>;
47
+ /** Normalises an uncompressed public key to the 64-byte form the registry stores. */
48
+ export declare function validateAndNormalizeHexPublicKey(hex: string): string;
49
+ //# sourceMappingURL=blockchain.utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"blockchain.utils.d.ts","sourceRoot":"","sources":["../../../src/utils/blockchain.utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;EAcE;AAEF;;;;;;;GAOG;AAEH,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAe,MAAM,QAAQ,CAAC;AAEhE;;;;;GAKG;AACH,wBAAsB,mBAAmB,CACvC,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,GAAG,EAAE,EACX,QAAQ,EAAE,eAAe,EACzB,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,MAAM,CAAC,CAwBjB;AAED;;;;;;GAMG;AACH,wBAAsB,qBAAqB,CACzC,oBAAoB,EAAE,MAAM,EAC5B,QAAQ,EAAE,eAAe,EACzB,QAAQ,EAAE,QAAQ,GACjB,OAAO,CAAC,MAAM,CAAC,CAajB;AAED;;;;;GAKG;AACH,wBAAsB,cAAc,CAClC,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,eAAe,GACxB,OAAO,CAAC,GAAG,GAAG,IAAI,CAAC,CAmBrB;AAED,qFAAqF;AACrF,wBAAgB,gCAAgC,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAapE"}
@@ -0,0 +1,102 @@
1
+ /**
2
+ * Copyright (c) 2025 Comunidad de Madrid & Alastria
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ *
7
+ * You may obtain a copy of the License at
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ /**
17
+ * Transaction plumbing, ported from `@red-isbe/did-isbe-registry`
18
+ * (`utils/blockchain.utils.ts` and `BlockchainTransactionExecutor`).
19
+ *
20
+ * The shape of the unsigned transaction is deliberately identical to the one the
21
+ * organisational registry returns, so client code that already signs those keeps working
22
+ * against this package without a single change.
23
+ */
24
+ import { Contract, JsonRpcProvider, Transaction } from "ethers";
25
+ /**
26
+ * Builds an unsigned transaction for a contract call.
27
+ *
28
+ * `from` is used only to look up that account's nonce; it authorises nothing. Who may
29
+ * perform the call is decided on-chain, from the signature, once the caller signs.
30
+ */
31
+ export async function buildRawTransaction(contract, method, args, provider, from) {
32
+ const iface = contract.interface;
33
+ const data = iface.encodeFunctionData(method, args);
34
+ const to = await contract.getAddress();
35
+ // Estimated with `from`, so a call the sender is not authorised to make fails here
36
+ // rather than silently falling back to a fixed limit and reverting once mined.
37
+ const gasEstimate = await provider
38
+ .estimateGas({ to, data, from })
39
+ .catch(() => BigInt(5000000));
40
+ const chain = await provider.getNetwork();
41
+ const nonceInt = await provider.getTransactionCount(from, "pending");
42
+ return {
43
+ to,
44
+ data,
45
+ gasLimit: `0x${BigInt(gasEstimate).toString(16)}`,
46
+ gasPrice: `0x${BigInt(4000).toString(16)}`,
47
+ chainId: `0x${BigInt(chain.chainId).toString(16)}`,
48
+ nonce: `0x${BigInt(nonceInt).toString(16)}`,
49
+ value: "0x0",
50
+ from,
51
+ };
52
+ }
53
+ /**
54
+ * Broadcasts a signed transaction, refusing any whose recipient is not this registry.
55
+ *
56
+ * That check is the only thing standing between a relay endpoint and an open transaction
57
+ * pump: without it, anyone could use a deployment of this library to broadcast arbitrary
58
+ * transactions to the network.
59
+ */
60
+ export async function sendSignedTransaction(signedRawTransaction, provider, contract) {
61
+ const decodedTx = Transaction.from(signedRawTransaction);
62
+ const contractAddress = await contract.getAddress();
63
+ if (decodedTx.to?.toLowerCase() !== contractAddress.toLowerCase()) {
64
+ throw new Error(`Transaction was not sent because the recipient (${decodedTx.to}) does not match the contract (${contractAddress}).`);
65
+ }
66
+ const txResponse = await provider.broadcastTransaction(signedRawTransaction);
67
+ return txResponse.hash;
68
+ }
69
+ /**
70
+ * Waits for a receipt, returning `null` when the timeout elapses.
71
+ *
72
+ * A timeout is not a failure: the transaction was accepted and is on its way, so the
73
+ * caller should poll rather than resend. Any other error is a real one and is thrown.
74
+ */
75
+ export async function waitForReceipt(tx_hash, timeout, provider) {
76
+ const tx = await provider.getTransaction(tx_hash);
77
+ if (!tx) {
78
+ throw new Error(`Transaction not found for hash ${tx_hash}`);
79
+ }
80
+ try {
81
+ return await tx.wait(1, timeout);
82
+ }
83
+ catch (error) {
84
+ if (error?.code === "TIMEOUT" ||
85
+ (error instanceof Error && /timeout/i.test(error.message))) {
86
+ return null;
87
+ }
88
+ throw new Error(`Transaction error ${tx_hash}: ${error}`);
89
+ }
90
+ }
91
+ /** Normalises an uncompressed public key to the 64-byte form the registry stores. */
92
+ export function validateAndNormalizeHexPublicKey(hex) {
93
+ const cleanHex = hex.replace(/^0x/, "");
94
+ if (cleanHex.length !== 130) {
95
+ throw new Error(`Invalid publicKey HEX: length ${cleanHex.length}`);
96
+ }
97
+ if (!cleanHex.startsWith("04")) {
98
+ throw new Error("Invalid publicKey HEX: it must start with '04' for uncompressed format");
99
+ }
100
+ return "0x" + cleanHex.slice(2); // drops the leading 0x04 marker
101
+ }
102
+ //# sourceMappingURL=blockchain.utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"blockchain.utils.js","sourceRoot":"","sources":["../../../src/utils/blockchain.utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;EAcE;AAEF;;;;;;;GAOG;AAEH,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAEhE;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACvC,QAAkB,EAClB,MAAc,EACd,IAAW,EACX,QAAyB,EACzB,IAAY;IAEZ,MAAM,KAAK,GAAG,QAAQ,CAAC,SAAS,CAAC;IACjC,MAAM,IAAI,GAAG,KAAK,CAAC,kBAAkB,CAAC,MAAM,EAAE,IAAI,CAAC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,KAAK,CACb,wEAAwE,CACzE,CAAC;IACJ,CAAC;IAED,OAAO,IAAI,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,gCAAgC;AACnE,CAAC"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Copyright (c) 2025 Comunidad de Madrid & Alastria
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ *
7
+ * You may obtain a copy of the License at
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ /** Converts the method-specific identifier of a DID into its bytes32 representation. */
17
+ export declare function didToHex(did: string): string;
18
+ /** Rebuilds the readable DID from its bytes32 form and a network discriminator. */
19
+ export declare function hexToDid(bytes32Hex: string, method: string): string;
20
+ //# sourceMappingURL=did.utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"did.utils.d.ts","sourceRoot":"","sources":["../../../src/utils/did.utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;EAcE;AAgBF,wFAAwF;AACxF,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAiB5C;AAED,mFAAmF;AACnF,wBAAgB,QAAQ,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAWnE"}
@@ -0,0 +1,57 @@
1
+ /**
2
+ * Copyright (c) 2025 Comunidad de Madrid & Alastria
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ *
7
+ * You may obtain a copy of the License at
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ /**
17
+ * Encoding of an organisational `did:isbe` identifier, ported verbatim from
18
+ * `@red-isbe/did-isbe-registry` (`utils/conversion.utils.ts`).
19
+ *
20
+ * This is the one piece of duplication the split of this package leaves behind, and it is
21
+ * the dangerous kind: the same DID must always produce the same 32 bytes here and there,
22
+ * or a service registered through one package becomes unresolvable through the other, with
23
+ * nothing failing loudly. The behaviour is therefore pinned by fixed vectors taken from
24
+ * the chain rather than computed by these functions — see `did.utils.test.ts`. Any change
25
+ * here has to be made in both packages, or in neither.
26
+ */
27
+ import { base58btc } from "multiformats/bases/base58";
28
+ /** Converts the method-specific identifier of a DID into its bytes32 representation. */
29
+ export function didToHex(did) {
30
+ if (!did)
31
+ throw new Error("The 'did' parameter is required");
32
+ did = didFromDidUrl(did);
33
+ const methodSpecificId = did.split(":").pop();
34
+ const buffer = Buffer.from(base58btc.decode(methodSpecificId));
35
+ // 20 bytes (160 bits), so it fits in a bytes32 (256 bits) with room to spare.
36
+ if (buffer.length !== 20)
37
+ throw new Error(`The DID method-specific identifier must represent exactly 20 bytes (currently ${buffer.length} bytes)`);
38
+ // Right-padded with zeros to reach 32 bytes.
39
+ const bytes32Buffer = Buffer.concat([buffer, Buffer.alloc(12, 0)]);
40
+ return "0x" + bytes32Buffer.toString("hex");
41
+ }
42
+ /** Rebuilds the readable DID from its bytes32 form and a network discriminator. */
43
+ export function hexToDid(bytes32Hex, method) {
44
+ if (!bytes32Hex || !/^0x[0-9a-fA-F]{64}$/.test(bytes32Hex))
45
+ throw new Error("The 'bytes32Hex' parameter must be a 32-byte hexadecimal string (64 hex characters)");
46
+ const buffer = Buffer.from(bytes32Hex.slice(2), "hex");
47
+ const methodSpecificIdBuffer = buffer.slice(0, 20);
48
+ const methodSpecificId = base58btc.encode(methodSpecificIdBuffer);
49
+ return `did:isbe:${method}:${methodSpecificId}`;
50
+ }
51
+ /** Strips the fragment and the query from a DID URL, leaving the bare DID. */
52
+ function didFromDidUrl(didUrl) {
53
+ if (!didUrl)
54
+ throw new Error("The 'didUrl' parameter is required");
55
+ return didUrl.split("#")[0].split("?")[0];
56
+ }
57
+ //# sourceMappingURL=did.utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"did.utils.js","sourceRoot":"","sources":["../../../src/utils/did.utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;EAcE;AAEF;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAEtD,wFAAwF;AACxF,MAAM,UAAU,QAAQ,CAAC,GAAW;IAClC,IAAI,CAAC,GAAG;QAAE,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAC;IAE7D,GAAG,GAAG,aAAa,CAAC,GAAG,CAAC,CAAC;IACzB,MAAM,gBAAgB,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAG,CAAC;IAC/C,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC,CAAC;IAE/D,8EAA8E;IAC9E,IAAI,MAAM,CAAC,MAAM,KAAK,EAAE;QACtB,MAAM,IAAI,KAAK,CACb,iFAAiF,MAAM,CAAC,MAAM,SAAS,CACxG,CAAC;IAEJ,6CAA6C;IAC7C,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IAEnE,OAAO,IAAI,GAAG,aAAa,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AAC9C,CAAC;AAED,mFAAmF;AACnF,MAAM,UAAU,QAAQ,CAAC,UAAkB,EAAE,MAAc;IACzD,IAAI,CAAC,UAAU,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,UAAU,CAAC;QACxD,MAAM,IAAI,KAAK,CACb,qFAAqF,CACtF,CAAC;IAEJ,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;IACvD,MAAM,sBAAsB,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IACnD,MAAM,gBAAgB,GAAG,SAAS,CAAC,MAAM,CAAC,sBAAsB,CAAC,CAAC;IAElE,OAAO,YAAY,MAAM,IAAI,gBAAgB,EAAE,CAAC;AAClD,CAAC;AAED,8EAA8E;AAC9E,SAAS,aAAa,CAAC,MAAc;IACnC,IAAI,CAAC,MAAM;QAAE,MAAM,IAAI,KAAK,CAAC,oCAAoC,CAAC,CAAC;IAEnE,OAAO,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAE,CAAC;AAC9C,CAAC"}
@@ -0,0 +1,71 @@
1
+ /**
2
+ * Copyright (c) 2025 Comunidad de Madrid & Alastria
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ *
7
+ * You may obtain a copy of the License at
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import type { ServiceDidParts } from "../serviceDid.types.js";
17
+ /**
18
+ * Derives the on-chain identifier of a service identity.
19
+ *
20
+ * Mirrors `ServiceDidRegistryInternal._computeServiceDid` exactly. The encoding is
21
+ * `abi.encode`, NOT `solidityPacked`: `abi.encode` pads the nonce to 32 bytes, and a
22
+ * packed encoding produces a different digest. Getting this wrong does not break any
23
+ * transaction — it breaks resolution, silently, which is far worse.
24
+ *
25
+ * @param controllerDidHex Parent DID as bytes32 hex
26
+ * @param nonce Monotonic counter of the controller, starting at 1
27
+ */
28
+ export declare function computeServiceDidHex(controllerDidHex: string, nonce: bigint | number): string;
29
+ /**
30
+ * Builds the readable identifier of a service identity.
31
+ *
32
+ * The parent's own segment is carried verbatim, which is what lets a reader recover
33
+ * the controlling DID from the service DID alone, with no lookup. A digest of the
34
+ * parent would not be reversible.
35
+ *
36
+ * @param controllerDid Parent DID, as did:isbe:<network>:<segment>
37
+ * @param nonce Monotonic counter of the controller
38
+ */
39
+ export declare function buildServiceDid(controllerDid: string, nonce: bigint | number): string;
40
+ /**
41
+ * Recovers the parent DID and the nonce from a service DID string.
42
+ *
43
+ * Entirely local: no network call. This is the direction that matters for resolution,
44
+ * and the reason the identifier carries the parent's segment rather than a digest.
45
+ *
46
+ * Note the asymmetry — the reverse is not possible. A service identifier is a full
47
+ * keccak digest, so the DID string cannot be recovered from it without reading the
48
+ * record from the chain to learn its controller and nonce.
49
+ */
50
+ export declare function parseServiceDid(serviceDid: string): ServiceDidParts;
51
+ /**
52
+ * Resolves a service DID string to the identifier the contract stores.
53
+ *
54
+ * Local: parses the string, converts the parent DID to bytes32 and derives the digest.
55
+ */
56
+ export declare function serviceDidToHex(serviceDid: string): string;
57
+ /**
58
+ * Derives the address of a signing key from its coordinates.
59
+ *
60
+ * Reproduces the derivation the organisational registry applies to its own keys —
61
+ * keccak256 of the 64 coordinate bytes, truncated to 20 — so both registries agree on
62
+ * the address of a given key.
63
+ *
64
+ * Returned checksummed, so it compares equal to what ethers hands back from a contract
65
+ * call or from a wallet. A lowercase form would be the same address and still fail a
66
+ * naive equality check.
67
+ */
68
+ export declare function signingKeyAddress(pubKeyX: string, pubKeyY: string): string;
69
+ /** Reassembles the two coordinates into the 65-byte uncompressed encoding. */
70
+ export declare function toUncompressedPublicKey(pubKeyX: string, pubKeyY: string): string;
71
+ //# sourceMappingURL=serviceDid.utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"serviceDid.utils.d.ts","sourceRoot":"","sources":["../../../src/utils/serviceDid.utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;EAcE;AAIF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAK9D;;;;;;;;;;GAUG;AACH,wBAAgB,oBAAoB,CAClC,gBAAgB,EAAE,MAAM,EACxB,KAAK,EAAE,MAAM,GAAG,MAAM,GACrB,MAAM,CAiBR;AAED;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAC7B,aAAa,EAAE,MAAM,EACrB,KAAK,EAAE,MAAM,GAAG,MAAM,GACrB,MAAM,CAGR;AAED;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,eAAe,CAiCnE;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAG1D;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAK1E;AAED,8EAA8E;AAC9E,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,GACd,MAAM,CAER"}