@xyo-network/account-model 6.0.9 → 6.1.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 (38) hide show
  1. package/README.md +3 -1
  2. package/package.json +7 -13
  3. package/dist/browser/Account.d.ts +0 -46
  4. package/dist/browser/Account.d.ts.map +0 -1
  5. package/dist/browser/Algorithm.d.ts +0 -5
  6. package/dist/browser/Algorithm.d.ts.map +0 -1
  7. package/dist/browser/Jwt/constants.d.ts +0 -14
  8. package/dist/browser/Jwt/constants.d.ts.map +0 -1
  9. package/dist/browser/Jwt/index.d.ts +0 -3
  10. package/dist/browser/Jwt/index.d.ts.map +0 -1
  11. package/dist/browser/Jwt/types.d.ts +0 -56
  12. package/dist/browser/Jwt/types.d.ts.map +0 -1
  13. package/dist/browser/VerifierRegistry.d.ts +0 -6
  14. package/dist/browser/VerifierRegistry.d.ts.map +0 -1
  15. package/dist/browser/addressTo20Bytes.d.ts +0 -2
  16. package/dist/browser/addressTo20Bytes.d.ts.map +0 -1
  17. package/dist/browser/index.d.ts +0 -6
  18. package/dist/browser/index.d.ts.map +0 -1
  19. package/dist/browser/index.mjs +0 -100
  20. package/dist/browser/index.mjs.map +0 -7
  21. package/dist/node/Account.d.ts +0 -46
  22. package/dist/node/Account.d.ts.map +0 -1
  23. package/dist/node/Algorithm.d.ts +0 -5
  24. package/dist/node/Algorithm.d.ts.map +0 -1
  25. package/dist/node/Jwt/constants.d.ts +0 -14
  26. package/dist/node/Jwt/constants.d.ts.map +0 -1
  27. package/dist/node/Jwt/index.d.ts +0 -3
  28. package/dist/node/Jwt/index.d.ts.map +0 -1
  29. package/dist/node/Jwt/types.d.ts +0 -56
  30. package/dist/node/Jwt/types.d.ts.map +0 -1
  31. package/dist/node/VerifierRegistry.d.ts +0 -6
  32. package/dist/node/VerifierRegistry.d.ts.map +0 -1
  33. package/dist/node/addressTo20Bytes.d.ts +0 -2
  34. package/dist/node/addressTo20Bytes.d.ts.map +0 -1
  35. package/dist/node/index.d.ts +0 -6
  36. package/dist/node/index.d.ts.map +0 -1
  37. package/dist/node/index.mjs +0 -100
  38. package/dist/node/index.mjs.map +0 -7
package/README.md CHANGED
@@ -38,10 +38,12 @@ bun add {{name}}
38
38
 
39
39
  See the [LICENSE](LICENSE) file for license rights and limitations (LGPL-3.0-only).
40
40
 
41
+ ## Credits
41
42
 
43
+ [Made with 🔥 and ❄️ by XYO Foundation](https://xyo.network)
42
44
 
43
- [logo]: https://cdn.xy.company/img/brand/XYO_full_colored.png
44
45
  [npm-badge]: https://img.shields.io/npm/v/@xyo-network/account-model.svg
45
46
  [npm-link]: https://www.npmjs.com/package/@xyo-network/account-model
46
47
  [license-badge]: https://img.shields.io/npm/l/@xyo-network/account-model.svg
47
48
  [license-link]: https://github.com/xylabs/sdk-js/blob/main/LICENSE
49
+ [logo]: https://cdn.xy.company/img/brand/XYO_full_colored.png
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xyo-network/account-model",
3
- "version": "6.0.9",
3
+ "version": "6.1.0",
4
4
  "description": "Primary SDK for using XYO Protocol 2.0",
5
5
  "homepage": "https://xyo.network",
6
6
  "bugs": {
@@ -34,22 +34,19 @@
34
34
  "README.md"
35
35
  ],
36
36
  "dependencies": {
37
- "@xyo-network/address": "~6.0.9",
38
- "@xyo-network/key-model": "~6.0.9",
39
- "@xyo-network/previous-hash-store-model": "~6.0.9"
37
+ "@xyo-network/address": "~6.1.0",
38
+ "@xyo-network/key-model": "~6.1.0",
39
+ "@xyo-network/previous-hash-store-model": "~6.1.0"
40
40
  },
41
41
  "devDependencies": {
42
42
  "@opentelemetry/api": "^1.9.1",
43
43
  "@opentelemetry/sdk-trace-base": "^2.7.1",
44
44
  "@scure/base": "~2.2.0",
45
- "@xylabs/sdk-js": "^6.0.8",
46
- "@xylabs/toolchain": "~8.1.16",
47
- "@xylabs/tsconfig": "~8.1.16",
45
+ "@xylabs/sdk-js": "^6.1.0",
46
+ "@xylabs/toolchain": "~8.1.20",
47
+ "@xylabs/tsconfig": "~8.1.20",
48
48
  "async-mutex": "^0.5.0",
49
- "bn.js": "^5.2.3",
50
- "buffer": "^6.0.3",
51
49
  "eslint": "^10.4.1",
52
- "ethers": "^6.16.0",
53
50
  "typescript": "~6.0.3",
54
51
  "zod": "^4.4.3"
55
52
  },
@@ -59,9 +56,6 @@
59
56
  "@scure/base": "~2.2",
60
57
  "@xylabs/sdk-js": "^6.0",
61
58
  "async-mutex": "^0.5",
62
- "bn.js": "^5.2",
63
- "buffer": "^6.0",
64
- "ethers": "^6.16",
65
59
  "zod": "^4.4"
66
60
  },
67
61
  "engines": {
@@ -1,46 +0,0 @@
1
- import type { Hash } from '@xylabs/sdk-js';
2
- import type { XyoAddress } from '@xyo-network/address';
3
- import type { PrivateKeyInstance, PublicKeyInstance } from '@xyo-network/key-model';
4
- import type { PreviousHashStore } from '@xyo-network/previous-hash-store-model';
5
- import type { AccountAlgorithm } from './Algorithm.ts';
6
- import type { SignJwtOptions, SignJwtResult } from './Jwt/types.ts';
7
- export declare const ethMessagePrefix = "\u0019Ethereum Signed Message:\n";
8
- export interface PhraseInitializationConfig {
9
- phrase: string;
10
- }
11
- export interface PrivateKeyInitializationConfig {
12
- privateKey: ArrayBufferLike;
13
- }
14
- export interface MnemonicInitializationConfig {
15
- mnemonic: string;
16
- path?: string;
17
- }
18
- export interface AccountOptions {
19
- previousHash?: ArrayBufferLike;
20
- }
21
- export type InitializationConfig = PhraseInitializationConfig | PrivateKeyInitializationConfig | MnemonicInitializationConfig;
22
- export type AccountConfig = InitializationConfig & AccountOptions;
23
- export declare const isPhraseInitializationConfig: (value: unknown) => value is PhraseInitializationConfig;
24
- export declare const isPrivateKeyInitializationConfig: (value: unknown) => value is PrivateKeyInitializationConfig;
25
- export declare const isMnemonicInitializationConfig: (value: unknown) => value is MnemonicInitializationConfig;
26
- export declare const isInitializationConfig: (value: unknown) => value is InitializationConfig;
27
- export interface AccountInstance {
28
- readonly address: XyoAddress;
29
- readonly addressBytes: ArrayBufferLike;
30
- readonly algorithm: AccountAlgorithm;
31
- previousHash: Hash | undefined;
32
- previousHashBytes: ArrayBufferLike | undefined;
33
- readonly private?: PrivateKeyInstance;
34
- readonly public?: PublicKeyInstance;
35
- sign: (hash: ArrayBufferLike, previousHash?: ArrayBufferLike) => Promise<[ArrayBufferLike, Hash?]>;
36
- signJwt: (options: SignJwtOptions) => Promise<SignJwtResult>;
37
- verify: (msg: ArrayBufferLike, signature: ArrayBufferLike) => Promise<boolean>;
38
- }
39
- export declare const isAccountInstance: (account: unknown) => account is AccountInstance;
40
- export interface AccountStatic<T extends AccountInstance = AccountInstance, C extends AccountConfig = AccountConfig> {
41
- previousHashStore?: PreviousHashStore;
42
- create(options?: C): Promise<T>;
43
- fromPrivateKey(key: ArrayBufferLike | bigint | string): Promise<AccountInstance>;
44
- random(): Promise<AccountInstance>;
45
- }
46
- //# sourceMappingURL=Account.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Account.d.ts","sourceRoot":"","sources":["../../src/Account.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAA;AAE1C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACtD,OAAO,KAAK,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AACnF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAA;AAE/E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AACtD,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAEnE,eAAO,MAAM,gBAAgB,qCAAqC,CAAA;AAElE,MAAM,WAAW,0BAA0B;IACzC,MAAM,EAAE,MAAM,CAAA;CACf;AACD,MAAM,WAAW,8BAA8B;IAC7C,UAAU,EAAE,eAAe,CAAA;CAC5B;AACD,MAAM,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,OAAO,CAAC,OAAO,CAAC,CAAA;CAC/E;AAED,eAAO,MAAM,iBAAiB,GAAI,SAAS,OAAO,KAAG,OAAO,IAAI,eAG/D,CAAA;AAED,MAAM,WAAW,aAAa,CAAC,CAAC,SAAS,eAAe,GAAG,eAAe,EAAE,CAAC,SAAS,aAAa,GAAG,aAAa;IACjH,iBAAiB,CAAC,EAAE,iBAAiB,CAAA;IACrC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAA;IAC/B,cAAc,CAAC,GAAG,EAAE,eAAe,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC,CAAA;IAChF,MAAM,IAAI,OAAO,CAAC,eAAe,CAAC,CAAA;CACnC"}
@@ -1,5 +0,0 @@
1
- export type AccountAlgorithm = 'secp256k1' | 'ml-dsa-65';
2
- export declare const AccountAlgorithmHrp: Partial<Record<AccountAlgorithm, string>>;
3
- export declare function hrpForAlgorithm(algorithm: AccountAlgorithm): string | undefined;
4
- export declare function algorithmFromAddress(address: string): AccountAlgorithm;
5
- //# sourceMappingURL=Algorithm.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Algorithm.d.ts","sourceRoot":"","sources":["../../src/Algorithm.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,gBAAgB,GAAG,WAAW,GAAG,WAAW,CAAA;AAUxD,eAAO,MAAM,mBAAmB,EAAE,OAAO,CAAC,MAAM,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAA2C,CAAA;AAMrH,wBAAgB,eAAe,CAAC,SAAS,EAAE,gBAAgB,GAAG,MAAM,GAAG,SAAS,CAE/E;AAED,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,gBAAgB,CAStE"}
@@ -1,14 +0,0 @@
1
- import { Enum } from '@xylabs/sdk-js';
2
- export declare const JwtAlg: Enum<{
3
- ES256K: "ES256K";
4
- }>;
5
- export type JwtAlg = Enum<typeof JwtAlg>;
6
- export declare const JwtTyp: Enum<{
7
- JWT: "JWT";
8
- }>;
9
- export type JwtTyp = Enum<typeof JwtTyp>;
10
- export declare const JwtSchema: Enum<{
11
- Signin: "network.xyo.auth.signin";
12
- }>;
13
- export type JwtSchema = Enum<typeof JwtSchema>;
14
- //# sourceMappingURL=constants.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/Jwt/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAA;AAErC,eAAO,MAAM,MAAM;;EAAsC,CAAA;AACzD,MAAM,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,MAAM,CAAC,CAAA;AAExC,eAAO,MAAM,MAAM;;EAAgC,CAAA;AACnD,MAAM,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,MAAM,CAAC,CAAA;AAExC,eAAO,MAAM,SAAS;;EAAuD,CAAA;AAC7E,MAAM,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,SAAS,CAAC,CAAA"}
@@ -1,3 +0,0 @@
1
- export * from './constants.ts';
2
- export * from './types.ts';
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Jwt/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAA;AAC9B,cAAc,YAAY,CAAA"}
@@ -1,56 +0,0 @@
1
- export interface JwtHeader {
2
- alg: string;
3
- kid: string;
4
- pub: string;
5
- typ: string;
6
- }
7
- export interface JwtClaims {
8
- aud: string;
9
- exp: number;
10
- iat: number;
11
- iss: string;
12
- nbf?: number;
13
- nonce?: string;
14
- }
15
- export interface JwtPayload extends JwtClaims {
16
- [key: string]: unknown;
17
- schema: string;
18
- }
19
- export interface JwtParts {
20
- header: JwtHeader;
21
- headerB64: string;
22
- payload: JwtPayload;
23
- payloadB64: string;
24
- signature: Uint8Array;
25
- signatureB64: string;
26
- }
27
- export interface SignJwtOptions {
28
- audience: string;
29
- claims?: Record<string, unknown>;
30
- exp?: number;
31
- now?: number;
32
- schema?: string;
33
- ttl?: number;
34
- }
35
- export interface SignJwtResult {
36
- header: JwtHeader;
37
- payload: JwtPayload;
38
- token: string;
39
- }
40
- export interface VerifyJwtOptions {
41
- audience?: string;
42
- now?: number;
43
- }
44
- export interface VerifyJwtSuccess {
45
- header: JwtHeader;
46
- ok: true;
47
- payload: JwtPayload;
48
- }
49
- export interface VerifyJwtFailure {
50
- header?: JwtHeader;
51
- ok: false;
52
- payload?: JwtPayload;
53
- reasons: string[];
54
- }
55
- export type VerifyJwtResult = VerifyJwtSuccess | VerifyJwtFailure;
56
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/Jwt/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,SAAS;IACxB,GAAG,EAAE,MAAM,CAAA;IACX,GAAG,EAAE,MAAM,CAAA;IACX,GAAG,EAAE,MAAM,CAAA;IACX,GAAG,EAAE,MAAM,CAAA;CACZ;AAED,MAAM,WAAW,SAAS;IACxB,GAAG,EAAE,MAAM,CAAA;IACX,GAAG,EAAE,MAAM,CAAA;IACX,GAAG,EAAE,MAAM,CAAA;IACX,GAAG,EAAE,MAAM,CAAA;IACX,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,MAAM,WAAW,UAAW,SAAQ,SAAS;IAC3C,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;IACtB,MAAM,EAAE,MAAM,CAAA;CACf;AAED,MAAM,WAAW,QAAQ;IACvB,MAAM,EAAE,SAAS,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IACjB,OAAO,EAAE,UAAU,CAAA;IACnB,UAAU,EAAE,MAAM,CAAA;IAClB,SAAS,EAAE,UAAU,CAAA;IACrB,YAAY,EAAE,MAAM,CAAA;CACrB;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAChC,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,GAAG,CAAC,EAAE,MAAM,CAAA;CACb;AAED,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,SAAS,CAAA;IACjB,OAAO,EAAE,UAAU,CAAA;IACnB,KAAK,EAAE,MAAM,CAAA;CACd;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,GAAG,CAAC,EAAE,MAAM,CAAA;CACb;AAED,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,SAAS,CAAA;IACjB,EAAE,EAAE,IAAI,CAAA;IACR,OAAO,EAAE,UAAU,CAAA;CACpB;AAED,MAAM,WAAW,gBAAgB;IAC/B,MAAM,CAAC,EAAE,SAAS,CAAA;IAClB,EAAE,EAAE,KAAK,CAAA;IACT,OAAO,CAAC,EAAE,UAAU,CAAA;IACpB,OAAO,EAAE,MAAM,EAAE,CAAA;CAClB;AAED,MAAM,MAAM,eAAe,GAAG,gBAAgB,GAAG,gBAAgB,CAAA"}
@@ -1,6 +0,0 @@
1
- import type { AccountAlgorithm } from './Algorithm.ts';
2
- export type VerifySignatureFn = (address: string, hash: ArrayBufferLike, signature: ArrayBufferLike) => Promise<boolean>;
3
- export declare function registerVerifier(algorithm: AccountAlgorithm, fn: VerifySignatureFn): void;
4
- export declare function getVerifier(algorithm: AccountAlgorithm): VerifySignatureFn | undefined;
5
- export declare function verifySignature(address: string, hash: ArrayBufferLike, signature: ArrayBufferLike): Promise<boolean>;
6
- //# sourceMappingURL=VerifierRegistry.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"VerifierRegistry.d.ts","sourceRoot":"","sources":["../../src/VerifierRegistry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAGtD,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,eAAe,EAAE,SAAS,EAAE,eAAe,KAAK,OAAO,CAAC,OAAO,CAAC,CAAA;AAIxH,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,gBAAgB,EAAE,EAAE,EAAE,iBAAiB,GAAG,IAAI,CAEzF;AAED,wBAAgB,WAAW,CAAC,SAAS,EAAE,gBAAgB,GAAG,iBAAiB,GAAG,SAAS,CAEtF;AAED,wBAAsB,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,eAAe,EAAE,SAAS,EAAE,eAAe,GAAG,OAAO,CAAC,OAAO,CAAC,CAO1H"}
@@ -1,2 +0,0 @@
1
- export declare function addressTo20Bytes(address: string): ArrayBufferLike;
2
- //# sourceMappingURL=addressTo20Bytes.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"addressTo20Bytes.d.ts","sourceRoot":"","sources":["../../src/addressTo20Bytes.ts"],"names":[],"mappings":"AAGA,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,eAAe,CAIjE"}
@@ -1,6 +0,0 @@
1
- export * from './Account.ts';
2
- export * from './addressTo20Bytes.ts';
3
- export * from './Algorithm.ts';
4
- export * from './Jwt/index.ts';
5
- export * from './VerifierRegistry.ts';
6
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,uBAAuB,CAAA;AACrC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,uBAAuB,CAAA"}
@@ -1,100 +0,0 @@
1
- // src/Account.ts
2
- import { isArrayBuffer } from "@xylabs/sdk-js";
3
- var ethMessagePrefix = "Ethereum Signed Message:\n";
4
- var isPhraseInitializationConfig = (value) => {
5
- if (typeof value === "object" && value !== null) {
6
- return typeof value.phrase === "string";
7
- }
8
- return false;
9
- };
10
- var isPrivateKeyInitializationConfig = (value) => {
11
- if (typeof value === "object" && value !== null) {
12
- return isArrayBuffer(value.privateKey);
13
- }
14
- return false;
15
- };
16
- var isMnemonicInitializationConfig = (value) => {
17
- if (typeof value === "object" && value !== null) {
18
- return typeof value.mnemonic === "string" && typeof (value.path ?? "") === "string";
19
- }
20
- return false;
21
- };
22
- var isInitializationConfig = (value) => {
23
- return isPhraseInitializationConfig(value) || isPrivateKeyInitializationConfig(value) || isMnemonicInitializationConfig(value);
24
- };
25
- var isAccountInstance = (account) => {
26
- if (typeof account !== "object" || account === null) return false;
27
- return typeof account.address === "string";
28
- };
29
-
30
- // src/addressTo20Bytes.ts
31
- import { toUint8Array } from "@xylabs/sdk-js";
32
- import { tryDecodeQuantAddress } from "@xyo-network/address";
33
- function addressTo20Bytes(address) {
34
- const decoded = tryDecodeQuantAddress(address);
35
- return decoded === void 0 ? toUint8Array(address, 20).buffer : decoded.bytes.buffer;
36
- }
37
-
38
- // src/Algorithm.ts
39
- import { tryDecodeQuantAddress as tryDecodeQuantAddress2 } from "@xyo-network/address";
40
- var AlgorithmHrpEntries = [
41
- ["ml-dsa-65", "qm65"]
42
- ];
43
- var AccountAlgorithmHrp = Object.fromEntries(AlgorithmHrpEntries);
44
- var HrpToAlgorithm = Object.fromEntries(
45
- AlgorithmHrpEntries.map(([algorithm, hrp]) => [hrp, algorithm])
46
- );
47
- function hrpForAlgorithm(algorithm) {
48
- return AccountAlgorithmHrp[algorithm];
49
- }
50
- function algorithmFromAddress(address) {
51
- const decoded = tryDecodeQuantAddress2(address);
52
- if (decoded === void 0) return "secp256k1";
53
- const algorithm = HrpToAlgorithm[decoded.hrp];
54
- if (algorithm === void 0) {
55
- throw new Error(`Unknown address algorithm HRP [${decoded.hrp}]`);
56
- }
57
- return algorithm;
58
- }
59
-
60
- // src/Jwt/constants.ts
61
- import { Enum } from "@xylabs/sdk-js";
62
- var JwtAlg = Enum({ ES256K: "ES256K" });
63
- var JwtTyp = Enum({ JWT: "JWT" });
64
- var JwtSchema = Enum({ Signin: "network.xyo.auth.signin" });
65
-
66
- // src/VerifierRegistry.ts
67
- var registry = {};
68
- function registerVerifier(algorithm, fn) {
69
- registry[algorithm] = fn;
70
- }
71
- function getVerifier(algorithm) {
72
- return registry[algorithm];
73
- }
74
- async function verifySignature(address, hash, signature) {
75
- const algorithm = algorithmFromAddress(address);
76
- const fn = registry[algorithm];
77
- if (!fn) {
78
- throw new Error(`No verifier registered for algorithm [${algorithm}]. Did you import the account package?`);
79
- }
80
- return await fn(address, hash, signature);
81
- }
82
- export {
83
- AccountAlgorithmHrp,
84
- JwtAlg,
85
- JwtSchema,
86
- JwtTyp,
87
- addressTo20Bytes,
88
- algorithmFromAddress,
89
- ethMessagePrefix,
90
- getVerifier,
91
- hrpForAlgorithm,
92
- isAccountInstance,
93
- isInitializationConfig,
94
- isMnemonicInitializationConfig,
95
- isPhraseInitializationConfig,
96
- isPrivateKeyInitializationConfig,
97
- registerVerifier,
98
- verifySignature
99
- };
100
- //# sourceMappingURL=index.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/Account.ts", "../../src/addressTo20Bytes.ts", "../../src/Algorithm.ts", "../../src/Jwt/constants.ts", "../../src/VerifierRegistry.ts"],
4
- "sourcesContent": ["import type { Hash } from '@xylabs/sdk-js'\nimport { isArrayBuffer } from '@xylabs/sdk-js'\nimport type { XyoAddress } from '@xyo-network/address'\nimport type { PrivateKeyInstance, PublicKeyInstance } from '@xyo-network/key-model'\nimport type { PreviousHashStore } from '@xyo-network/previous-hash-store-model'\n\nimport type { AccountAlgorithm } from './Algorithm.ts'\nimport type { SignJwtOptions, SignJwtResult } from './Jwt/types.ts'\n\nexport const ethMessagePrefix = '\\u0019Ethereum Signed Message:\\n'\n\nexport interface PhraseInitializationConfig {\n phrase: string\n}\nexport interface PrivateKeyInitializationConfig {\n privateKey: ArrayBufferLike\n}\nexport interface MnemonicInitializationConfig {\n mnemonic: string\n path?: string\n}\nexport interface AccountOptions {\n previousHash?: ArrayBufferLike\n}\n\nexport type InitializationConfig = PhraseInitializationConfig | PrivateKeyInitializationConfig | MnemonicInitializationConfig\n\nexport type AccountConfig = InitializationConfig & AccountOptions\n\nexport const isPhraseInitializationConfig = (value: unknown): value is PhraseInitializationConfig => {\n if (typeof value === 'object' && value !== null) {\n return typeof (value as PhraseInitializationConfig).phrase === 'string'\n }\n return false\n}\n\nexport const isPrivateKeyInitializationConfig = (value: unknown): value is PrivateKeyInitializationConfig => {\n if (typeof value === 'object' && value !== null) {\n return isArrayBuffer((value as PrivateKeyInitializationConfig).privateKey)\n }\n return false\n}\n\nexport const isMnemonicInitializationConfig = (value: unknown): value is MnemonicInitializationConfig => {\n if (typeof value === 'object' && value !== null) {\n return (\n typeof (value as MnemonicInitializationConfig).mnemonic === 'string' && typeof ((value as MnemonicInitializationConfig).path ?? '') === 'string'\n )\n }\n return false\n}\n\nexport const isInitializationConfig = (value: unknown): value is InitializationConfig => {\n return isPhraseInitializationConfig(value) || isPrivateKeyInitializationConfig(value) || isMnemonicInitializationConfig(value)\n}\n\nexport interface AccountInstance {\n readonly address: XyoAddress\n readonly addressBytes: ArrayBufferLike\n readonly algorithm: AccountAlgorithm\n previousHash: Hash | undefined\n previousHashBytes: ArrayBufferLike | undefined\n readonly private?: PrivateKeyInstance\n readonly public?: PublicKeyInstance\n sign: (hash: ArrayBufferLike, previousHash?: ArrayBufferLike) => Promise<[ArrayBufferLike, Hash?]>\n signJwt: (options: SignJwtOptions) => Promise<SignJwtResult>\n verify: (msg: ArrayBufferLike, signature: ArrayBufferLike) => Promise<boolean>\n}\n\nexport const isAccountInstance = (account: unknown): account is AccountInstance => {\n if (typeof account !== 'object' || account === null) return false\n return typeof (account as { address?: unknown }).address === 'string'\n}\n\nexport interface AccountStatic<T extends AccountInstance = AccountInstance, C extends AccountConfig = AccountConfig> {\n previousHashStore?: PreviousHashStore\n create(options?: C): Promise<T>\n fromPrivateKey(key: ArrayBufferLike | bigint | string): Promise<AccountInstance>\n random(): Promise<AccountInstance>\n}\n", "import { toUint8Array } from '@xylabs/sdk-js'\nimport { tryDecodeQuantAddress } from '@xyo-network/address'\n\nexport function addressTo20Bytes(address: string): ArrayBufferLike {\n const decoded = tryDecodeQuantAddress(address)\n // Quantum (bech32m) address \u2192 its decoded 20-byte payload; otherwise a legacy bare 40-hex address.\n return decoded === undefined ? toUint8Array(address, 20).buffer : decoded.bytes.buffer\n}\n", "import { tryDecodeQuantAddress } from '@xyo-network/address'\n\nexport type AccountAlgorithm = 'secp256k1' | 'ml-dsa-65'\n\n// Single source of truth binding each quantum algorithm to its bech32m HRP (Human-Readable Part).\n// The HRP is what the address prefix communicates: 'qm65' = ML-DSA-65. secp256k1 has no HRP \u2014 its\n// addresses are legacy bare 40-hex strings. To add an algorithm: add a tuple here and register its\n// verifier (see VerifierRegistry).\nconst AlgorithmHrpEntries = [\n ['ml-dsa-65', 'qm65'],\n] as const satisfies readonly (readonly [AccountAlgorithm, string])[]\n\nexport const AccountAlgorithmHrp: Partial<Record<AccountAlgorithm, string>> = Object.fromEntries(AlgorithmHrpEntries)\n\nconst HrpToAlgorithm: Readonly<Record<string, AccountAlgorithm>> = Object.fromEntries(\n AlgorithmHrpEntries.map(([algorithm, hrp]) => [hrp, algorithm]),\n)\n\nexport function hrpForAlgorithm(algorithm: AccountAlgorithm): string | undefined {\n return AccountAlgorithmHrp[algorithm]\n}\n\nexport function algorithmFromAddress(address: string): AccountAlgorithm {\n const decoded = tryDecodeQuantAddress(address)\n // Not a bech32m quantum address \u2192 legacy secp256k1 bare-hex address.\n if (decoded === undefined) return 'secp256k1'\n const algorithm = HrpToAlgorithm[decoded.hrp]\n if (algorithm === undefined) {\n throw new Error(`Unknown address algorithm HRP [${decoded.hrp}]`)\n }\n return algorithm\n}\n", "import { Enum } from '@xylabs/sdk-js'\n\nexport const JwtAlg = Enum({ ES256K: 'ES256K' } as const)\nexport type JwtAlg = Enum<typeof JwtAlg>\n\nexport const JwtTyp = Enum({ JWT: 'JWT' } as const)\nexport type JwtTyp = Enum<typeof JwtTyp>\n\nexport const JwtSchema = Enum({ Signin: 'network.xyo.auth.signin' } as const)\nexport type JwtSchema = Enum<typeof JwtSchema>\n", "import type { AccountAlgorithm } from './Algorithm.ts'\nimport { algorithmFromAddress } from './Algorithm.ts'\n\nexport type VerifySignatureFn = (address: string, hash: ArrayBufferLike, signature: ArrayBufferLike) => Promise<boolean>\n\nconst registry: Partial<Record<AccountAlgorithm, VerifySignatureFn>> = {}\n\nexport function registerVerifier(algorithm: AccountAlgorithm, fn: VerifySignatureFn): void {\n registry[algorithm] = fn\n}\n\nexport function getVerifier(algorithm: AccountAlgorithm): VerifySignatureFn | undefined {\n return registry[algorithm]\n}\n\nexport async function verifySignature(address: string, hash: ArrayBufferLike, signature: ArrayBufferLike): Promise<boolean> {\n const algorithm = algorithmFromAddress(address)\n const fn = registry[algorithm]\n if (!fn) {\n throw new Error(`No verifier registered for algorithm [${algorithm}]. Did you import the account package?`)\n }\n return await fn(address, hash, signature)\n}\n"],
5
- "mappings": ";AACA,SAAS,qBAAqB;AAQvB,IAAM,mBAAmB;AAoBzB,IAAM,+BAA+B,CAAC,UAAwD;AACnG,MAAI,OAAO,UAAU,YAAY,UAAU,MAAM;AAC/C,WAAO,OAAQ,MAAqC,WAAW;AAAA,EACjE;AACA,SAAO;AACT;AAEO,IAAM,mCAAmC,CAAC,UAA4D;AAC3G,MAAI,OAAO,UAAU,YAAY,UAAU,MAAM;AAC/C,WAAO,cAAe,MAAyC,UAAU;AAAA,EAC3E;AACA,SAAO;AACT;AAEO,IAAM,iCAAiC,CAAC,UAA0D;AACvG,MAAI,OAAO,UAAU,YAAY,UAAU,MAAM;AAC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AM,WAAiE,CAAC;AAEjE,SAAS,iBAAiB,WAA6B,IAA6B;AACzF,WAAS,SAAS,IAAI;AACxB;AAEO,SAAS,YAAY,WAA4D;AACtF,SAAO,SAAS,SAAS;AAC3B;AAEA,eAAsB,gBAAgB,SAAiB,MAAuB,WAA8C;AAC1H,QAAM,YAAY,qBAAqB,OAAO;AAC9C,QAAM,KAAK,SAAS,SAAS;AAC7B,MAAI,CAAC,IAAI;AACP,UAAM,IAAI,MAAM,yCAAyC,SAAS,wCAAwC;AAAA,EAC5G;AACA,SAAO,MAAM,GAAG,SAAS,MAAM,SAAS;AAC1C;",
6
- "names": ["tryDecodeQuantAddress"]
7
- }
@@ -1,46 +0,0 @@
1
- import type { Hash } from '@xylabs/sdk-js';
2
- import type { XyoAddress } from '@xyo-network/address';
3
- import type { PrivateKeyInstance, PublicKeyInstance } from '@xyo-network/key-model';
4
- import type { PreviousHashStore } from '@xyo-network/previous-hash-store-model';
5
- import type { AccountAlgorithm } from './Algorithm.ts';
6
- import type { SignJwtOptions, SignJwtResult } from './Jwt/types.ts';
7
- export declare const ethMessagePrefix = "\u0019Ethereum Signed Message:\n";
8
- export interface PhraseInitializationConfig {
9
- phrase: string;
10
- }
11
- export interface PrivateKeyInitializationConfig {
12
- privateKey: ArrayBufferLike;
13
- }
14
- export interface MnemonicInitializationConfig {
15
- mnemonic: string;
16
- path?: string;
17
- }
18
- export interface AccountOptions {
19
- previousHash?: ArrayBufferLike;
20
- }
21
- export type InitializationConfig = PhraseInitializationConfig | PrivateKeyInitializationConfig | MnemonicInitializationConfig;
22
- export type AccountConfig = InitializationConfig & AccountOptions;
23
- export declare const isPhraseInitializationConfig: (value: unknown) => value is PhraseInitializationConfig;
24
- export declare const isPrivateKeyInitializationConfig: (value: unknown) => value is PrivateKeyInitializationConfig;
25
- export declare const isMnemonicInitializationConfig: (value: unknown) => value is MnemonicInitializationConfig;
26
- export declare const isInitializationConfig: (value: unknown) => value is InitializationConfig;
27
- export interface AccountInstance {
28
- readonly address: XyoAddress;
29
- readonly addressBytes: ArrayBufferLike;
30
- readonly algorithm: AccountAlgorithm;
31
- previousHash: Hash | undefined;
32
- previousHashBytes: ArrayBufferLike | undefined;
33
- readonly private?: PrivateKeyInstance;
34
- readonly public?: PublicKeyInstance;
35
- sign: (hash: ArrayBufferLike, previousHash?: ArrayBufferLike) => Promise<[ArrayBufferLike, Hash?]>;
36
- signJwt: (options: SignJwtOptions) => Promise<SignJwtResult>;
37
- verify: (msg: ArrayBufferLike, signature: ArrayBufferLike) => Promise<boolean>;
38
- }
39
- export declare const isAccountInstance: (account: unknown) => account is AccountInstance;
40
- export interface AccountStatic<T extends AccountInstance = AccountInstance, C extends AccountConfig = AccountConfig> {
41
- previousHashStore?: PreviousHashStore;
42
- create(options?: C): Promise<T>;
43
- fromPrivateKey(key: ArrayBufferLike | bigint | string): Promise<AccountInstance>;
44
- random(): Promise<AccountInstance>;
45
- }
46
- //# sourceMappingURL=Account.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Account.d.ts","sourceRoot":"","sources":["../../src/Account.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAA;AAE1C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACtD,OAAO,KAAK,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AACnF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAA;AAE/E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AACtD,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAEnE,eAAO,MAAM,gBAAgB,qCAAqC,CAAA;AAElE,MAAM,WAAW,0BAA0B;IACzC,MAAM,EAAE,MAAM,CAAA;CACf;AACD,MAAM,WAAW,8BAA8B;IAC7C,UAAU,EAAE,eAAe,CAAA;CAC5B;AACD,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,KAAK,OAAO,CAAC,OAAO,CAAC,CAAA;CAC/E;AAED,eAAO,MAAM,iBAAiB,GAAI,SAAS,OAAO,KAAG,OAAO,IAAI,eAG/D,CAAA;AAED,MAAM,WAAW,aAAa,CAAC,CAAC,SAAS,eAAe,GAAG,eAAe,EAAE,CAAC,SAAS,aAAa,GAAG,aAAa;IACjH,iBAAiB,CAAC,EAAE,iBAAiB,CAAA;IACrC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAA;IAC/B,cAAc,CAAC,GAAG,EAAE,eAAe,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC,CAAA;IAChF,MAAM,IAAI,OAAO,CAAC,eAAe,CAAC,CAAA;CACnC"}
@@ -1,5 +0,0 @@
1
- export type AccountAlgorithm = 'secp256k1' | 'ml-dsa-65';
2
- export declare const AccountAlgorithmHrp: Partial<Record<AccountAlgorithm, string>>;
3
- export declare function hrpForAlgorithm(algorithm: AccountAlgorithm): string | undefined;
4
- export declare function algorithmFromAddress(address: string): AccountAlgorithm;
5
- //# sourceMappingURL=Algorithm.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Algorithm.d.ts","sourceRoot":"","sources":["../../src/Algorithm.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,gBAAgB,GAAG,WAAW,GAAG,WAAW,CAAA;AAUxD,eAAO,MAAM,mBAAmB,EAAE,OAAO,CAAC,MAAM,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAA2C,CAAA;AAMrH,wBAAgB,eAAe,CAAC,SAAS,EAAE,gBAAgB,GAAG,MAAM,GAAG,SAAS,CAE/E;AAED,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,gBAAgB,CAStE"}
@@ -1,14 +0,0 @@
1
- import { Enum } from '@xylabs/sdk-js';
2
- export declare const JwtAlg: Enum<{
3
- ES256K: "ES256K";
4
- }>;
5
- export type JwtAlg = Enum<typeof JwtAlg>;
6
- export declare const JwtTyp: Enum<{
7
- JWT: "JWT";
8
- }>;
9
- export type JwtTyp = Enum<typeof JwtTyp>;
10
- export declare const JwtSchema: Enum<{
11
- Signin: "network.xyo.auth.signin";
12
- }>;
13
- export type JwtSchema = Enum<typeof JwtSchema>;
14
- //# sourceMappingURL=constants.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/Jwt/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAA;AAErC,eAAO,MAAM,MAAM;;EAAsC,CAAA;AACzD,MAAM,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,MAAM,CAAC,CAAA;AAExC,eAAO,MAAM,MAAM;;EAAgC,CAAA;AACnD,MAAM,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,MAAM,CAAC,CAAA;AAExC,eAAO,MAAM,SAAS;;EAAuD,CAAA;AAC7E,MAAM,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,SAAS,CAAC,CAAA"}
@@ -1,3 +0,0 @@
1
- export * from './constants.ts';
2
- export * from './types.ts';
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Jwt/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAA;AAC9B,cAAc,YAAY,CAAA"}
@@ -1,56 +0,0 @@
1
- export interface JwtHeader {
2
- alg: string;
3
- kid: string;
4
- pub: string;
5
- typ: string;
6
- }
7
- export interface JwtClaims {
8
- aud: string;
9
- exp: number;
10
- iat: number;
11
- iss: string;
12
- nbf?: number;
13
- nonce?: string;
14
- }
15
- export interface JwtPayload extends JwtClaims {
16
- [key: string]: unknown;
17
- schema: string;
18
- }
19
- export interface JwtParts {
20
- header: JwtHeader;
21
- headerB64: string;
22
- payload: JwtPayload;
23
- payloadB64: string;
24
- signature: Uint8Array;
25
- signatureB64: string;
26
- }
27
- export interface SignJwtOptions {
28
- audience: string;
29
- claims?: Record<string, unknown>;
30
- exp?: number;
31
- now?: number;
32
- schema?: string;
33
- ttl?: number;
34
- }
35
- export interface SignJwtResult {
36
- header: JwtHeader;
37
- payload: JwtPayload;
38
- token: string;
39
- }
40
- export interface VerifyJwtOptions {
41
- audience?: string;
42
- now?: number;
43
- }
44
- export interface VerifyJwtSuccess {
45
- header: JwtHeader;
46
- ok: true;
47
- payload: JwtPayload;
48
- }
49
- export interface VerifyJwtFailure {
50
- header?: JwtHeader;
51
- ok: false;
52
- payload?: JwtPayload;
53
- reasons: string[];
54
- }
55
- export type VerifyJwtResult = VerifyJwtSuccess | VerifyJwtFailure;
56
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/Jwt/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,SAAS;IACxB,GAAG,EAAE,MAAM,CAAA;IACX,GAAG,EAAE,MAAM,CAAA;IACX,GAAG,EAAE,MAAM,CAAA;IACX,GAAG,EAAE,MAAM,CAAA;CACZ;AAED,MAAM,WAAW,SAAS;IACxB,GAAG,EAAE,MAAM,CAAA;IACX,GAAG,EAAE,MAAM,CAAA;IACX,GAAG,EAAE,MAAM,CAAA;IACX,GAAG,EAAE,MAAM,CAAA;IACX,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,MAAM,WAAW,UAAW,SAAQ,SAAS;IAC3C,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;IACtB,MAAM,EAAE,MAAM,CAAA;CACf;AAED,MAAM,WAAW,QAAQ;IACvB,MAAM,EAAE,SAAS,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IACjB,OAAO,EAAE,UAAU,CAAA;IACnB,UAAU,EAAE,MAAM,CAAA;IAClB,SAAS,EAAE,UAAU,CAAA;IACrB,YAAY,EAAE,MAAM,CAAA;CACrB;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAChC,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,GAAG,CAAC,EAAE,MAAM,CAAA;CACb;AAED,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,SAAS,CAAA;IACjB,OAAO,EAAE,UAAU,CAAA;IACnB,KAAK,EAAE,MAAM,CAAA;CACd;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,GAAG,CAAC,EAAE,MAAM,CAAA;CACb;AAED,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,SAAS,CAAA;IACjB,EAAE,EAAE,IAAI,CAAA;IACR,OAAO,EAAE,UAAU,CAAA;CACpB;AAED,MAAM,WAAW,gBAAgB;IAC/B,MAAM,CAAC,EAAE,SAAS,CAAA;IAClB,EAAE,EAAE,KAAK,CAAA;IACT,OAAO,CAAC,EAAE,UAAU,CAAA;IACpB,OAAO,EAAE,MAAM,EAAE,CAAA;CAClB;AAED,MAAM,MAAM,eAAe,GAAG,gBAAgB,GAAG,gBAAgB,CAAA"}
@@ -1,6 +0,0 @@
1
- import type { AccountAlgorithm } from './Algorithm.ts';
2
- export type VerifySignatureFn = (address: string, hash: ArrayBufferLike, signature: ArrayBufferLike) => Promise<boolean>;
3
- export declare function registerVerifier(algorithm: AccountAlgorithm, fn: VerifySignatureFn): void;
4
- export declare function getVerifier(algorithm: AccountAlgorithm): VerifySignatureFn | undefined;
5
- export declare function verifySignature(address: string, hash: ArrayBufferLike, signature: ArrayBufferLike): Promise<boolean>;
6
- //# sourceMappingURL=VerifierRegistry.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"VerifierRegistry.d.ts","sourceRoot":"","sources":["../../src/VerifierRegistry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAGtD,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,eAAe,EAAE,SAAS,EAAE,eAAe,KAAK,OAAO,CAAC,OAAO,CAAC,CAAA;AAIxH,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,gBAAgB,EAAE,EAAE,EAAE,iBAAiB,GAAG,IAAI,CAEzF;AAED,wBAAgB,WAAW,CAAC,SAAS,EAAE,gBAAgB,GAAG,iBAAiB,GAAG,SAAS,CAEtF;AAED,wBAAsB,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,eAAe,EAAE,SAAS,EAAE,eAAe,GAAG,OAAO,CAAC,OAAO,CAAC,CAO1H"}
@@ -1,2 +0,0 @@
1
- export declare function addressTo20Bytes(address: string): ArrayBufferLike;
2
- //# sourceMappingURL=addressTo20Bytes.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"addressTo20Bytes.d.ts","sourceRoot":"","sources":["../../src/addressTo20Bytes.ts"],"names":[],"mappings":"AAGA,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,eAAe,CAIjE"}
@@ -1,6 +0,0 @@
1
- export * from './Account.ts';
2
- export * from './addressTo20Bytes.ts';
3
- export * from './Algorithm.ts';
4
- export * from './Jwt/index.ts';
5
- export * from './VerifierRegistry.ts';
6
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,uBAAuB,CAAA;AACrC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,uBAAuB,CAAA"}
@@ -1,100 +0,0 @@
1
- // src/Account.ts
2
- import { isArrayBuffer } from "@xylabs/sdk-js";
3
- var ethMessagePrefix = "Ethereum Signed Message:\n";
4
- var isPhraseInitializationConfig = (value) => {
5
- if (typeof value === "object" && value !== null) {
6
- return typeof value.phrase === "string";
7
- }
8
- return false;
9
- };
10
- var isPrivateKeyInitializationConfig = (value) => {
11
- if (typeof value === "object" && value !== null) {
12
- return isArrayBuffer(value.privateKey);
13
- }
14
- return false;
15
- };
16
- var isMnemonicInitializationConfig = (value) => {
17
- if (typeof value === "object" && value !== null) {
18
- return typeof value.mnemonic === "string" && typeof (value.path ?? "") === "string";
19
- }
20
- return false;
21
- };
22
- var isInitializationConfig = (value) => {
23
- return isPhraseInitializationConfig(value) || isPrivateKeyInitializationConfig(value) || isMnemonicInitializationConfig(value);
24
- };
25
- var isAccountInstance = (account) => {
26
- if (typeof account !== "object" || account === null) return false;
27
- return typeof account.address === "string";
28
- };
29
-
30
- // src/addressTo20Bytes.ts
31
- import { toUint8Array } from "@xylabs/sdk-js";
32
- import { tryDecodeQuantAddress } from "@xyo-network/address";
33
- function addressTo20Bytes(address) {
34
- const decoded = tryDecodeQuantAddress(address);
35
- return decoded === void 0 ? toUint8Array(address, 20).buffer : decoded.bytes.buffer;
36
- }
37
-
38
- // src/Algorithm.ts
39
- import { tryDecodeQuantAddress as tryDecodeQuantAddress2 } from "@xyo-network/address";
40
- var AlgorithmHrpEntries = [
41
- ["ml-dsa-65", "qm65"]
42
- ];
43
- var AccountAlgorithmHrp = Object.fromEntries(AlgorithmHrpEntries);
44
- var HrpToAlgorithm = Object.fromEntries(
45
- AlgorithmHrpEntries.map(([algorithm, hrp]) => [hrp, algorithm])
46
- );
47
- function hrpForAlgorithm(algorithm) {
48
- return AccountAlgorithmHrp[algorithm];
49
- }
50
- function algorithmFromAddress(address) {
51
- const decoded = tryDecodeQuantAddress2(address);
52
- if (decoded === void 0) return "secp256k1";
53
- const algorithm = HrpToAlgorithm[decoded.hrp];
54
- if (algorithm === void 0) {
55
- throw new Error(`Unknown address algorithm HRP [${decoded.hrp}]`);
56
- }
57
- return algorithm;
58
- }
59
-
60
- // src/Jwt/constants.ts
61
- import { Enum } from "@xylabs/sdk-js";
62
- var JwtAlg = Enum({ ES256K: "ES256K" });
63
- var JwtTyp = Enum({ JWT: "JWT" });
64
- var JwtSchema = Enum({ Signin: "network.xyo.auth.signin" });
65
-
66
- // src/VerifierRegistry.ts
67
- var registry = {};
68
- function registerVerifier(algorithm, fn) {
69
- registry[algorithm] = fn;
70
- }
71
- function getVerifier(algorithm) {
72
- return registry[algorithm];
73
- }
74
- async function verifySignature(address, hash, signature) {
75
- const algorithm = algorithmFromAddress(address);
76
- const fn = registry[algorithm];
77
- if (!fn) {
78
- throw new Error(`No verifier registered for algorithm [${algorithm}]. Did you import the account package?`);
79
- }
80
- return await fn(address, hash, signature);
81
- }
82
- export {
83
- AccountAlgorithmHrp,
84
- JwtAlg,
85
- JwtSchema,
86
- JwtTyp,
87
- addressTo20Bytes,
88
- algorithmFromAddress,
89
- ethMessagePrefix,
90
- getVerifier,
91
- hrpForAlgorithm,
92
- isAccountInstance,
93
- isInitializationConfig,
94
- isMnemonicInitializationConfig,
95
- isPhraseInitializationConfig,
96
- isPrivateKeyInitializationConfig,
97
- registerVerifier,
98
- verifySignature
99
- };
100
- //# sourceMappingURL=index.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/Account.ts", "../../src/addressTo20Bytes.ts", "../../src/Algorithm.ts", "../../src/Jwt/constants.ts", "../../src/VerifierRegistry.ts"],
4
- "sourcesContent": ["import type { Hash } from '@xylabs/sdk-js'\nimport { isArrayBuffer } from '@xylabs/sdk-js'\nimport type { XyoAddress } from '@xyo-network/address'\nimport type { PrivateKeyInstance, PublicKeyInstance } from '@xyo-network/key-model'\nimport type { PreviousHashStore } from '@xyo-network/previous-hash-store-model'\n\nimport type { AccountAlgorithm } from './Algorithm.ts'\nimport type { SignJwtOptions, SignJwtResult } from './Jwt/types.ts'\n\nexport const ethMessagePrefix = '\\u0019Ethereum Signed Message:\\n'\n\nexport interface PhraseInitializationConfig {\n phrase: string\n}\nexport interface PrivateKeyInitializationConfig {\n privateKey: ArrayBufferLike\n}\nexport interface MnemonicInitializationConfig {\n mnemonic: string\n path?: string\n}\nexport interface AccountOptions {\n previousHash?: ArrayBufferLike\n}\n\nexport type InitializationConfig = PhraseInitializationConfig | PrivateKeyInitializationConfig | MnemonicInitializationConfig\n\nexport type AccountConfig = InitializationConfig & AccountOptions\n\nexport const isPhraseInitializationConfig = (value: unknown): value is PhraseInitializationConfig => {\n if (typeof value === 'object' && value !== null) {\n return typeof (value as PhraseInitializationConfig).phrase === 'string'\n }\n return false\n}\n\nexport const isPrivateKeyInitializationConfig = (value: unknown): value is PrivateKeyInitializationConfig => {\n if (typeof value === 'object' && value !== null) {\n return isArrayBuffer((value as PrivateKeyInitializationConfig).privateKey)\n }\n return false\n}\n\nexport const isMnemonicInitializationConfig = (value: unknown): value is MnemonicInitializationConfig => {\n if (typeof value === 'object' && value !== null) {\n return (\n typeof (value as MnemonicInitializationConfig).mnemonic === 'string' && typeof ((value as MnemonicInitializationConfig).path ?? '') === 'string'\n )\n }\n return false\n}\n\nexport const isInitializationConfig = (value: unknown): value is InitializationConfig => {\n return isPhraseInitializationConfig(value) || isPrivateKeyInitializationConfig(value) || isMnemonicInitializationConfig(value)\n}\n\nexport interface AccountInstance {\n readonly address: XyoAddress\n readonly addressBytes: ArrayBufferLike\n readonly algorithm: AccountAlgorithm\n previousHash: Hash | undefined\n previousHashBytes: ArrayBufferLike | undefined\n readonly private?: PrivateKeyInstance\n readonly public?: PublicKeyInstance\n sign: (hash: ArrayBufferLike, previousHash?: ArrayBufferLike) => Promise<[ArrayBufferLike, Hash?]>\n signJwt: (options: SignJwtOptions) => Promise<SignJwtResult>\n verify: (msg: ArrayBufferLike, signature: ArrayBufferLike) => Promise<boolean>\n}\n\nexport const isAccountInstance = (account: unknown): account is AccountInstance => {\n if (typeof account !== 'object' || account === null) return false\n return typeof (account as { address?: unknown }).address === 'string'\n}\n\nexport interface AccountStatic<T extends AccountInstance = AccountInstance, C extends AccountConfig = AccountConfig> {\n previousHashStore?: PreviousHashStore\n create(options?: C): Promise<T>\n fromPrivateKey(key: ArrayBufferLike | bigint | string): Promise<AccountInstance>\n random(): Promise<AccountInstance>\n}\n", "import { toUint8Array } from '@xylabs/sdk-js'\nimport { tryDecodeQuantAddress } from '@xyo-network/address'\n\nexport function addressTo20Bytes(address: string): ArrayBufferLike {\n const decoded = tryDecodeQuantAddress(address)\n // Quantum (bech32m) address \u2192 its decoded 20-byte payload; otherwise a legacy bare 40-hex address.\n return decoded === undefined ? toUint8Array(address, 20).buffer : decoded.bytes.buffer\n}\n", "import { tryDecodeQuantAddress } from '@xyo-network/address'\n\nexport type AccountAlgorithm = 'secp256k1' | 'ml-dsa-65'\n\n// Single source of truth binding each quantum algorithm to its bech32m HRP (Human-Readable Part).\n// The HRP is what the address prefix communicates: 'qm65' = ML-DSA-65. secp256k1 has no HRP \u2014 its\n// addresses are legacy bare 40-hex strings. To add an algorithm: add a tuple here and register its\n// verifier (see VerifierRegistry).\nconst AlgorithmHrpEntries = [\n ['ml-dsa-65', 'qm65'],\n] as const satisfies readonly (readonly [AccountAlgorithm, string])[]\n\nexport const AccountAlgorithmHrp: Partial<Record<AccountAlgorithm, string>> = Object.fromEntries(AlgorithmHrpEntries)\n\nconst HrpToAlgorithm: Readonly<Record<string, AccountAlgorithm>> = Object.fromEntries(\n AlgorithmHrpEntries.map(([algorithm, hrp]) => [hrp, algorithm]),\n)\n\nexport function hrpForAlgorithm(algorithm: AccountAlgorithm): string | undefined {\n return AccountAlgorithmHrp[algorithm]\n}\n\nexport function algorithmFromAddress(address: string): AccountAlgorithm {\n const decoded = tryDecodeQuantAddress(address)\n // Not a bech32m quantum address \u2192 legacy secp256k1 bare-hex address.\n if (decoded === undefined) return 'secp256k1'\n const algorithm = HrpToAlgorithm[decoded.hrp]\n if (algorithm === undefined) {\n throw new Error(`Unknown address algorithm HRP [${decoded.hrp}]`)\n }\n return algorithm\n}\n", "import { Enum } from '@xylabs/sdk-js'\n\nexport const JwtAlg = Enum({ ES256K: 'ES256K' } as const)\nexport type JwtAlg = Enum<typeof JwtAlg>\n\nexport const JwtTyp = Enum({ JWT: 'JWT' } as const)\nexport type JwtTyp = Enum<typeof JwtTyp>\n\nexport const JwtSchema = Enum({ Signin: 'network.xyo.auth.signin' } as const)\nexport type JwtSchema = Enum<typeof JwtSchema>\n", "import type { AccountAlgorithm } from './Algorithm.ts'\nimport { algorithmFromAddress } from './Algorithm.ts'\n\nexport type VerifySignatureFn = (address: string, hash: ArrayBufferLike, signature: ArrayBufferLike) => Promise<boolean>\n\nconst registry: Partial<Record<AccountAlgorithm, VerifySignatureFn>> = {}\n\nexport function registerVerifier(algorithm: AccountAlgorithm, fn: VerifySignatureFn): void {\n registry[algorithm] = fn\n}\n\nexport function getVerifier(algorithm: AccountAlgorithm): VerifySignatureFn | undefined {\n return registry[algorithm]\n}\n\nexport async function verifySignature(address: string, hash: ArrayBufferLike, signature: ArrayBufferLike): Promise<boolean> {\n const algorithm = algorithmFromAddress(address)\n const fn = registry[algorithm]\n if (!fn) {\n throw new Error(`No verifier registered for algorithm [${algorithm}]. Did you import the account package?`)\n }\n return await fn(address, hash, signature)\n}\n"],
5
- "mappings": ";AACA,SAAS,qBAAqB;AAQvB,IAAM,mBAAmB;AAoBzB,IAAM,+BAA+B,CAAC,UAAwD;AACnG,MAAI,OAAO,UAAU,YAAY,UAAU,MAAM;AAC/C,WAAO,OAAQ,MAAqC,WAAW;AAAA,EACjE;AACA,SAAO;AACT;AAEO,IAAM,mCAAmC,CAAC,UAA4D;AAC3G,MAAI,OAAO,UAAU,YAAY,UAAU,MAAM;AAC/C,WAAO,cAAe,MAAyC,UAAU;AAAA,EAC3E;AACA,SAAO;AACT;AAEO,IAAM,iCAAiC,CAAC,UAA0D;AACvG,MAAI,OAAO,UAAU,YAAY,UAAU,MAA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