@miden-sdk/miden-wallet-adapter-base 0.16.0 → 0.16.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (116) hide show
  1. package/AGENTS.md +77 -0
  2. package/dist/adapter.js.map +1 -1
  3. package/dist/errors.js.map +1 -1
  4. package/dist/helpers.js.map +1 -1
  5. package/dist/index.js.map +1 -1
  6. package/dist/signer.js.map +1 -1
  7. package/dist/transaction.js.map +1 -1
  8. package/dist/types.js.map +1 -1
  9. package/package.json +9 -3
  10. package/skills/wallet-adapter-integration/SKILL.md +335 -0
  11. package/__tests__/adapter.test.ts +0 -82
  12. package/__tests__/errors.test.ts +0 -100
  13. package/__tests__/helpers.test.ts +0 -39
  14. package/__tests__/signer.test.ts +0 -20
  15. package/__tests__/transaction.test.ts +0 -166
  16. package/adapter.ts +0 -146
  17. package/dist/__tests__/adapter.test.d.ts +0 -1
  18. package/dist/__tests__/adapter.test.js +0 -66
  19. package/dist/__tests__/adapter.test.js.map +0 -1
  20. package/dist/__tests__/errors.test.d.ts +0 -1
  21. package/dist/__tests__/errors.test.js +0 -70
  22. package/dist/__tests__/errors.test.js.map +0 -1
  23. package/dist/__tests__/helpers.test.d.ts +0 -1
  24. package/dist/__tests__/helpers.test.js +0 -35
  25. package/dist/__tests__/helpers.test.js.map +0 -1
  26. package/dist/__tests__/signer.test.d.ts +0 -1
  27. package/dist/__tests__/signer.test.js +0 -18
  28. package/dist/__tests__/signer.test.js.map +0 -1
  29. package/dist/__tests__/transaction.test.d.ts +0 -1
  30. package/dist/__tests__/transaction.test.js +0 -113
  31. package/dist/__tests__/transaction.test.js.map +0 -1
  32. package/dist/vitest.config.d.ts +0 -2
  33. package/dist/vitest.config.js +0 -8
  34. package/dist/vitest.config.js.map +0 -1
  35. package/docs/@miden-sdk/namespaces/EventEmitter/README.md +0 -24
  36. package/docs/@miden-sdk/namespaces/EventEmitter/interfaces/EventEmitterStatic.md +0 -17
  37. package/docs/@miden-sdk/namespaces/EventEmitter/interfaces/ListenerFn.md +0 -25
  38. package/docs/@miden-sdk/namespaces/EventEmitter/type-aliases/ArgumentMap.md +0 -15
  39. package/docs/@miden-sdk/namespaces/EventEmitter/type-aliases/EventArgs.md +0 -19
  40. package/docs/@miden-sdk/namespaces/EventEmitter/type-aliases/EventListener.md +0 -19
  41. package/docs/@miden-sdk/namespaces/EventEmitter/type-aliases/EventNames.md +0 -15
  42. package/docs/@miden-sdk/namespaces/EventEmitter/type-aliases/ValidEventTypes.md +0 -17
  43. package/docs/@miden-sdk/namespaces/EventEmitter/variables/EventEmitter.md +0 -9
  44. package/docs/README.md +0 -88
  45. package/docs/classes/BaseMessageSignerWalletAdapter.md +0 -755
  46. package/docs/classes/BaseSignerWalletAdapter.md +0 -579
  47. package/docs/classes/BaseWalletAdapter.md +0 -535
  48. package/docs/classes/ConsumeTransaction.md +0 -93
  49. package/docs/classes/CustomTransaction.md +0 -93
  50. package/docs/classes/EventEmitter.md +0 -305
  51. package/docs/classes/SendTransaction.md +0 -107
  52. package/docs/classes/Transaction.md +0 -151
  53. package/docs/classes/WalletAccountError.md +0 -223
  54. package/docs/classes/WalletAddressError.md +0 -223
  55. package/docs/classes/WalletConfigError.md +0 -223
  56. package/docs/classes/WalletConnectionError.md +0 -223
  57. package/docs/classes/WalletDecryptionError.md +0 -223
  58. package/docs/classes/WalletDecryptionNotAllowedError.md +0 -223
  59. package/docs/classes/WalletDisconnectedError.md +0 -223
  60. package/docs/classes/WalletDisconnectionError.md +0 -223
  61. package/docs/classes/WalletError.md +0 -244
  62. package/docs/classes/WalletKeypairError.md +0 -223
  63. package/docs/classes/WalletLoadError.md +0 -223
  64. package/docs/classes/WalletNotConnectedError.md +0 -223
  65. package/docs/classes/WalletNotReadyError.md +0 -223
  66. package/docs/classes/WalletNotSelectedError.md +0 -223
  67. package/docs/classes/WalletPrivateDataPermissionError.md +0 -223
  68. package/docs/classes/WalletRecordsError.md +0 -223
  69. package/docs/classes/WalletSendTransactionError.md +0 -223
  70. package/docs/classes/WalletSignMessageError.md +0 -223
  71. package/docs/classes/WalletSignTransactionError.md +0 -223
  72. package/docs/classes/WalletTimeoutError.md +0 -223
  73. package/docs/classes/WalletTransactionError.md +0 -223
  74. package/docs/classes/WalletWindowBlockedError.md +0 -223
  75. package/docs/classes/WalletWindowClosedError.md +0 -223
  76. package/docs/enumerations/AllowedPrivateData.md +0 -37
  77. package/docs/enumerations/PrivateDataPermission.md +0 -19
  78. package/docs/enumerations/TransactionType.md +0 -25
  79. package/docs/enumerations/WalletAdapterNetwork.md +0 -19
  80. package/docs/enumerations/WalletReadyState.md +0 -49
  81. package/docs/functions/b64ToU8.md +0 -19
  82. package/docs/functions/scopePollingDetectionStrategy.md +0 -19
  83. package/docs/functions/u8ToB64.md +0 -19
  84. package/docs/interfaces/Asset.md +0 -19
  85. package/docs/interfaces/IFailedTransactionOutput.md +0 -13
  86. package/docs/interfaces/MessageSignerWalletAdapterProps.md +0 -293
  87. package/docs/interfaces/MidenConsumeTransaction.md +0 -37
  88. package/docs/interfaces/MidenCustomTransaction.md +0 -37
  89. package/docs/interfaces/MidenSendTransaction.md +0 -43
  90. package/docs/interfaces/MidenTransaction.md +0 -19
  91. package/docs/interfaces/SignerWalletAdapterProps.md +0 -149
  92. package/docs/interfaces/TransactionOutput.md +0 -19
  93. package/docs/interfaces/WalletAdapterEvents.md +0 -69
  94. package/docs/interfaces/WalletAdapterProps.md +0 -106
  95. package/docs/interfaces/WalletTransactionSuccessOutput.md +0 -19
  96. package/docs/type-aliases/Adapter.md +0 -9
  97. package/docs/type-aliases/FungibleAssetDetails.md +0 -21
  98. package/docs/type-aliases/InputNoteDetails.md +0 -45
  99. package/docs/type-aliases/MessageSignerWalletAdapter.md +0 -15
  100. package/docs/type-aliases/NoteTypeString.md +0 -9
  101. package/docs/type-aliases/SignKind.md +0 -9
  102. package/docs/type-aliases/SignerWalletAdapter.md +0 -15
  103. package/docs/type-aliases/SupportedTransactionVersions.md +0 -9
  104. package/docs/type-aliases/TransactionOrVersionedTransaction.md +0 -15
  105. package/docs/type-aliases/TransactionPayload.md +0 -9
  106. package/docs/type-aliases/WalletAdapter.md +0 -15
  107. package/docs/type-aliases/WalletName.md +0 -21
  108. package/docs/type-aliases/WalletTransactionOutput.md +0 -9
  109. package/errors.ts +0 -97
  110. package/helpers.ts +0 -28
  111. package/index.ts +0 -6
  112. package/signer.ts +0 -84
  113. package/transaction.ts +0 -178
  114. package/tsconfig.json +0 -15
  115. package/types.ts +0 -93
  116. package/vitest.config.ts +0 -8
@@ -1,100 +0,0 @@
1
- import { describe, it, expect } from "vitest";
2
- import {
3
- WalletError,
4
- WalletNotReadyError,
5
- WalletLoadError,
6
- WalletConfigError,
7
- WalletConnectionError,
8
- WalletNotSelectedError,
9
- WalletDisconnectedError,
10
- WalletDisconnectionError,
11
- WalletAccountError,
12
- WalletAddressError,
13
- WalletKeypairError,
14
- WalletNotConnectedError,
15
- WalletSendTransactionError,
16
- WalletSignMessageError,
17
- WalletSignTransactionError,
18
- WalletTimeoutError,
19
- WalletWindowBlockedError,
20
- WalletWindowClosedError,
21
- WalletDecryptionNotAllowedError,
22
- WalletPrivateDataPermissionError,
23
- WalletDecryptionError,
24
- WalletRecordsError,
25
- WalletTransactionError,
26
- } from "../errors";
27
-
28
- const errorClasses = [
29
- { Class: WalletNotReadyError, name: "WalletNotReadyError" },
30
- { Class: WalletLoadError, name: "WalletLoadError" },
31
- { Class: WalletConfigError, name: "WalletConfigError" },
32
- { Class: WalletConnectionError, name: "WalletConnectionError" },
33
- { Class: WalletNotSelectedError, name: "WalletNotSelectedError" },
34
- { Class: WalletDisconnectedError, name: "WalletDisconnectedError" },
35
- { Class: WalletDisconnectionError, name: "WalletDisconnectionError" },
36
- { Class: WalletAccountError, name: "WalletAccountError" },
37
- { Class: WalletAddressError, name: "WalletAddressError" },
38
- { Class: WalletKeypairError, name: "WalletKeypairError" },
39
- { Class: WalletNotConnectedError, name: "WalletNotConnectedError" },
40
- { Class: WalletSendTransactionError, name: "WalletSendTransactionError" },
41
- { Class: WalletSignMessageError, name: "WalletSignMessageError" },
42
- { Class: WalletSignTransactionError, name: "WalletSignTransactionError" },
43
- { Class: WalletTimeoutError, name: "WalletTimeoutError" },
44
- { Class: WalletWindowBlockedError, name: "WalletWindowBlockedError" },
45
- { Class: WalletWindowClosedError, name: "WalletWindowClosedError" },
46
- {
47
- Class: WalletDecryptionNotAllowedError,
48
- name: "WalletDecryptionNotAllowedError",
49
- },
50
- {
51
- Class: WalletPrivateDataPermissionError,
52
- name: "WalletPrivateDataPermissionError",
53
- },
54
- { Class: WalletDecryptionError, name: "WalletDecryptionError" },
55
- { Class: WalletRecordsError, name: "WalletRecordsError" },
56
- { Class: WalletTransactionError, name: "WalletTransactionError" },
57
- ] as const;
58
-
59
- describe("WalletError", () => {
60
- it("extends Error", () => {
61
- const err = new WalletError("test message");
62
- expect(err).toBeInstanceOf(Error);
63
- expect(err).toBeInstanceOf(WalletError);
64
- });
65
-
66
- it("sets message property", () => {
67
- const err = new WalletError("my message");
68
- expect(err.message).toBe("my message");
69
- });
70
-
71
- it("stores inner error", () => {
72
- const inner = new Error("inner");
73
- const err = new WalletError("outer", inner);
74
- expect(err.error).toBe(inner);
75
- });
76
- });
77
-
78
- describe("error subclasses", () => {
79
- for (const { Class, name } of errorClasses) {
80
- describe(name, () => {
81
- it("extends WalletError and Error", () => {
82
- const err = new Class();
83
- expect(err).toBeInstanceOf(WalletError);
84
- expect(err).toBeInstanceOf(Error);
85
- });
86
-
87
- it("has correct name property", () => {
88
- const err = new Class();
89
- expect(err.name).toBe(name);
90
- });
91
-
92
- it("stores inner error", () => {
93
- const inner = new Error("cause");
94
- const err = new Class("msg", inner);
95
- expect(err.error).toBe(inner);
96
- expect(err.message).toBe("msg");
97
- });
98
- });
99
- }
100
- });
@@ -1,39 +0,0 @@
1
- import { describe, it, expect } from "vitest";
2
- import { u8ToB64, b64ToU8 } from "../helpers";
3
-
4
- describe("u8ToB64", () => {
5
- it("encodes a known value correctly", () => {
6
- const bytes = new Uint8Array([72, 101, 108, 108, 111]); // "Hello"
7
- expect(u8ToB64(bytes)).toBe("SGVsbG8=");
8
- });
9
-
10
- it("encodes an empty array", () => {
11
- expect(u8ToB64(new Uint8Array([]))).toBe("");
12
- });
13
- });
14
-
15
- describe("b64ToU8", () => {
16
- it("decodes a known value correctly", () => {
17
- const result = b64ToU8("SGVsbG8=");
18
- expect(result).toEqual(new Uint8Array([72, 101, 108, 108, 111]));
19
- });
20
-
21
- it("decodes an empty string", () => {
22
- expect(b64ToU8("")).toEqual(new Uint8Array([]));
23
- });
24
- });
25
-
26
- describe("roundtrip", () => {
27
- it("encode then decode returns original bytes", () => {
28
- const original = new Uint8Array([0, 1, 127, 128, 255]);
29
- const decoded = b64ToU8(u8ToB64(original));
30
- expect(decoded).toEqual(original);
31
- });
32
-
33
- it("handles a large array (256 bytes)", () => {
34
- const original = new Uint8Array(256);
35
- for (let i = 0; i < 256; i++) original[i] = i;
36
- const decoded = b64ToU8(u8ToB64(original));
37
- expect(decoded).toEqual(original);
38
- });
39
- });
@@ -1,20 +0,0 @@
1
- import { describe, it, expect } from "vitest";
2
- import type { GuardianInfo } from "../types";
3
-
4
- describe("GuardianInfo", () => {
5
- it("has the agreed shape", () => {
6
- const g: GuardianInfo = {
7
- isGuardianAccount: false,
8
- guardianEndpoint: null,
9
- guardianProvider: null,
10
- guardianSyncStatus: null,
11
- };
12
-
13
- expect(Object.keys(g).sort()).toEqual([
14
- "guardianEndpoint",
15
- "guardianProvider",
16
- "guardianSyncStatus",
17
- "isGuardianAccount",
18
- ]);
19
- });
20
- });
@@ -1,166 +0,0 @@
1
- import { describe, it, expect, vi } from "vitest";
2
- import {
3
- SendTransaction,
4
- ConsumeTransaction,
5
- CustomTransaction,
6
- Transaction,
7
- TransactionType,
8
- } from "../transaction";
9
- import { u8ToB64 } from "../helpers";
10
-
11
- describe("TransactionType enum", () => {
12
- it("has correct values", () => {
13
- expect(TransactionType.Send).toBe("send");
14
- expect(TransactionType.Consume).toBe("consume");
15
- expect(TransactionType.Custom).toBe("custom");
16
- });
17
- });
18
-
19
- describe("SendTransaction", () => {
20
- it("sets all fields correctly", () => {
21
- const tx = new SendTransaction(
22
- "sender-addr",
23
- "recipient-addr",
24
- "faucet-123",
25
- "public",
26
- 1000
27
- );
28
- expect(tx.senderAddress).toBe("sender-addr");
29
- expect(tx.recipientAddress).toBe("recipient-addr");
30
- expect(tx.faucetId).toBe("faucet-123");
31
- expect(tx.noteType).toBe("public");
32
- expect(tx.amount).toBe(1000);
33
- expect(tx.recallBlocks).toBeUndefined();
34
- });
35
-
36
- it("sets optional recallBlocks", () => {
37
- const tx = new SendTransaction(
38
- "sender",
39
- "recipient",
40
- "faucet",
41
- "private",
42
- 500,
43
- 10
44
- );
45
- expect(tx.recallBlocks).toBe(10);
46
- });
47
- });
48
-
49
- describe("ConsumeTransaction", () => {
50
- it("sets fields correctly", () => {
51
- const tx = new ConsumeTransaction("faucet-1", "note-1", "public", 100);
52
- expect(tx.faucetId).toBe("faucet-1");
53
- expect(tx.noteId).toBe("note-1");
54
- expect(tx.noteType).toBe("public");
55
- expect(tx.amount).toBe(100);
56
- expect(tx.noteBytes).toBeUndefined();
57
- });
58
-
59
- it("converts noteBytes Uint8Array to base64", () => {
60
- const bytes = new Uint8Array([1, 2, 3]);
61
- const tx = new ConsumeTransaction("faucet", "note", "private", 50, bytes);
62
- expect(tx.noteBytes).toBe(u8ToB64(bytes));
63
- });
64
-
65
- it("leaves noteBytes undefined when not provided", () => {
66
- const tx = new ConsumeTransaction("faucet", "note", "public", 50);
67
- expect(tx.noteBytes).toBeUndefined();
68
- });
69
- });
70
-
71
- describe("CustomTransaction", () => {
72
- it("serializes transactionRequest to base64", () => {
73
- const mockBytes = new Uint8Array([10, 20, 30]);
74
- const mockRequest = {
75
- serialize: vi.fn().mockReturnValue(mockBytes),
76
- } as any;
77
-
78
- const tx = new CustomTransaction("addr", "recipient", mockRequest);
79
- expect(mockRequest.serialize).toHaveBeenCalled();
80
- expect(tx.transactionRequest).toBe(u8ToB64(mockBytes));
81
- expect(tx.address).toBe("addr");
82
- expect(tx.recipientAddress).toBe("recipient");
83
- });
84
-
85
- it("sets optional inputNoteIds", () => {
86
- const mockRequest = {
87
- serialize: vi.fn().mockReturnValue(new Uint8Array([1])),
88
- } as any;
89
- const tx = new CustomTransaction("addr", "recipient", mockRequest, [
90
- "id1",
91
- "id2",
92
- ]);
93
- expect(tx.inputNoteIds).toEqual(["id1", "id2"]);
94
- });
95
-
96
- it("converts importNotes from Uint8Array[] to base64 strings", () => {
97
- const mockRequest = {
98
- serialize: vi.fn().mockReturnValue(new Uint8Array([1])),
99
- } as any;
100
- const noteBytes = [new Uint8Array([4, 5]), new Uint8Array([6, 7])];
101
- const tx = new CustomTransaction(
102
- "addr",
103
- "recipient",
104
- mockRequest,
105
- ["id1"],
106
- noteBytes
107
- );
108
- expect(tx.importNotes).toEqual([
109
- u8ToB64(noteBytes[0]),
110
- u8ToB64(noteBytes[1]),
111
- ]);
112
- });
113
-
114
- it("leaves optional fields undefined when not provided", () => {
115
- const mockRequest = {
116
- serialize: vi.fn().mockReturnValue(new Uint8Array([1])),
117
- } as any;
118
- const tx = new CustomTransaction("addr", "recipient", mockRequest);
119
- expect(tx.inputNoteIds).toBeUndefined();
120
- expect(tx.importNotes).toBeUndefined();
121
- });
122
- });
123
-
124
- describe("Transaction factory", () => {
125
- it("createSendTransaction returns correct type and payload", () => {
126
- const tx = Transaction.createSendTransaction(
127
- "sender",
128
- "recipient",
129
- "faucet",
130
- "public",
131
- 100
132
- );
133
- expect(tx.type).toBe(TransactionType.Send);
134
- expect(tx.payload).toBeInstanceOf(SendTransaction);
135
- const payload = tx.payload as SendTransaction;
136
- expect(payload.senderAddress).toBe("sender");
137
- expect(payload.amount).toBe(100);
138
- });
139
-
140
- it("createConsumeTransaction returns correct type and payload", () => {
141
- const tx = Transaction.createConsumeTransaction(
142
- "faucet",
143
- "note-id",
144
- "private",
145
- 200
146
- );
147
- expect(tx.type).toBe(TransactionType.Consume);
148
- expect(tx.payload).toBeInstanceOf(ConsumeTransaction);
149
- const payload = tx.payload as ConsumeTransaction;
150
- expect(payload.faucetId).toBe("faucet");
151
- expect(payload.noteId).toBe("note-id");
152
- });
153
-
154
- it("createCustomTransaction returns correct type and payload", () => {
155
- const mockRequest = {
156
- serialize: vi.fn().mockReturnValue(new Uint8Array([1, 2])),
157
- } as any;
158
- const tx = Transaction.createCustomTransaction(
159
- "addr",
160
- "recipient",
161
- mockRequest
162
- );
163
- expect(tx.type).toBe(TransactionType.Custom);
164
- expect(tx.payload).toBeInstanceOf(CustomTransaction);
165
- });
166
- });
package/adapter.ts DELETED
@@ -1,146 +0,0 @@
1
- import EventEmitter from "eventemitter3";
2
- import type { WalletError } from "./errors";
3
- import type {
4
- AllowedPrivateData,
5
- PrivateDataPermission,
6
- SupportedTransactionVersions,
7
- WalletAdapterNetwork,
8
- } from "./types";
9
-
10
- export { EventEmitter };
11
-
12
- export interface WalletAdapterEvents {
13
- connect(address: string, allowedPrivateData?: AllowedPrivateData): void;
14
- disconnect(): void;
15
- error(error: WalletError): void;
16
- readyStateChange(readyState: WalletReadyState): void;
17
- }
18
-
19
- // WalletName is a nominal type that wallet adapters should use, e.g. `'MyCryptoWallet' as WalletName<'MyCryptoWallet'>`
20
- // https://medium.com/@KevinBGreene/surviving-the-typescript-ecosystem-branding-and-type-tagging-6cf6e516523d
21
- export type WalletName<T extends string = string> = T & {
22
- __brand__: "WalletName";
23
- };
24
-
25
- export interface WalletAdapterProps<Name extends string = string> {
26
- name: WalletName<Name>;
27
- url: string;
28
- icon: string;
29
- readyState: WalletReadyState;
30
- address: string | null;
31
- publicKey: Uint8Array | null;
32
- connecting: boolean;
33
- connected: boolean;
34
- supportedTransactionVersions: SupportedTransactionVersions;
35
-
36
- connect(
37
- privateDataPermission: PrivateDataPermission,
38
- network: WalletAdapterNetwork,
39
- allowedPrivateData?: AllowedPrivateData
40
- ): Promise<void>;
41
- disconnect(): Promise<void>;
42
- }
43
-
44
- export type WalletAdapter<Name extends string = string> =
45
- WalletAdapterProps<Name> & EventEmitter<WalletAdapterEvents>;
46
-
47
- /**
48
- * A wallet's readiness describes a series of states that the wallet can be in,
49
- * depending on what kind of wallet it is. An installable wallet (eg. a browser
50
- * extension like Phantom) might be `Installed` if we've found the Phantom API
51
- * in the global scope, or `NotDetected` otherwise. A loadable, zero-install
52
- * runtime (eg. Torus Wallet) might simply signal that it's `Loadable`. Use this
53
- * metadata to personalize the wallet list for each user (eg. to show their
54
- * installed wallets first).
55
- */
56
- export enum WalletReadyState {
57
- /**
58
- * User-installable wallets can typically be detected by scanning for an API
59
- * that they've injected into the global context. If such an API is present,
60
- * we consider the wallet to have been installed.
61
- */
62
- Installed = "Installed",
63
- NotDetected = "NotDetected",
64
- /**
65
- * Loadable wallets are always available to you. Since you can load them at
66
- * any time, it's meaningless to say that they have been detected.
67
- */
68
- Loadable = "Loadable",
69
- /**
70
- * If a wallet is not supported on a given platform (eg. server-rendering, or
71
- * mobile) then it will stay in the `Unsupported` state.
72
- */
73
- Unsupported = "Unsupported",
74
- }
75
-
76
- export abstract class BaseWalletAdapter<Name extends string = string>
77
- extends EventEmitter<WalletAdapterEvents>
78
- implements WalletAdapter<Name>
79
- {
80
- abstract name: WalletName<Name>;
81
- abstract url: string;
82
- abstract icon: string;
83
- abstract readyState: WalletReadyState;
84
- abstract address: string | null;
85
- abstract publicKey: Uint8Array | null;
86
- abstract connecting: boolean;
87
- abstract supportedTransactionVersions: SupportedTransactionVersions;
88
-
89
- get connected() {
90
- return !!this.address;
91
- }
92
-
93
- abstract connect(
94
- privateDataPermission: PrivateDataPermission,
95
- network: WalletAdapterNetwork,
96
- allowedPrivateData?: AllowedPrivateData
97
- ): Promise<void>;
98
- abstract disconnect(): Promise<void>;
99
- }
100
-
101
- export function scopePollingDetectionStrategy(detect: () => boolean): void {
102
- // Early return when server-side rendering
103
- if (typeof window === "undefined" || typeof document === "undefined") return;
104
-
105
- const disposers: (() => void)[] = [];
106
-
107
- function detectAndDispose() {
108
- const detected = detect();
109
- if (detected) {
110
- for (const dispose of disposers) {
111
- dispose();
112
- }
113
- }
114
- }
115
-
116
- // Strategy #1: Try detecting every second.
117
- const interval =
118
- // TODO: #334 Replace with idle callback strategy.
119
- setInterval(detectAndDispose, 1000);
120
- disposers.push(() => clearInterval(interval));
121
-
122
- // Strategy #2: Detect as soon as the DOM becomes 'ready'/'interactive'.
123
- if (
124
- // Implies that `DOMContentLoaded` has not yet fired.
125
- document.readyState === "loading"
126
- ) {
127
- document.addEventListener("DOMContentLoaded", detectAndDispose, {
128
- once: true,
129
- });
130
- disposers.push(() =>
131
- document.removeEventListener("DOMContentLoaded", detectAndDispose)
132
- );
133
- }
134
-
135
- // Strategy #3: Detect after the `window` has fully loaded.
136
- if (
137
- // If the `complete` state has been reached, we're too late.
138
- document.readyState !== "complete"
139
- ) {
140
- window.addEventListener("load", detectAndDispose, { once: true });
141
- disposers.push(() => window.removeEventListener("load", detectAndDispose));
142
- }
143
-
144
- // Strategy #4: Detect synchronously, now.
145
- detectAndDispose();
146
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,66 +0,0 @@
1
- import { describe, it, expect, vi, beforeEach, afterEach } from "vitest";
2
- import { WalletReadyState, BaseWalletAdapter, scopePollingDetectionStrategy, } from "../adapter";
3
- describe("WalletReadyState enum", () => {
4
- it("has correct values", () => {
5
- expect(WalletReadyState.Installed).toBe("Installed");
6
- expect(WalletReadyState.NotDetected).toBe("NotDetected");
7
- expect(WalletReadyState.Loadable).toBe("Loadable");
8
- expect(WalletReadyState.Unsupported).toBe("Unsupported");
9
- });
10
- });
11
- describe("BaseWalletAdapter", () => {
12
- // Concrete subclass for testing
13
- class TestAdapter extends BaseWalletAdapter {
14
- name = "Test";
15
- url = "https://test.com";
16
- icon = "icon";
17
- readyState = WalletReadyState.Installed;
18
- address = null;
19
- publicKey = null;
20
- connecting = false;
21
- supportedTransactionVersions = null;
22
- async connect() { }
23
- async disconnect() { }
24
- }
25
- it("connected returns true when address is set", () => {
26
- const adapter = new TestAdapter();
27
- adapter.address = "0xabc";
28
- expect(adapter.connected).toBe(true);
29
- });
30
- it("connected returns false when address is null", () => {
31
- const adapter = new TestAdapter();
32
- expect(adapter.connected).toBe(false);
33
- });
34
- });
35
- describe("scopePollingDetectionStrategy", () => {
36
- beforeEach(() => {
37
- vi.useFakeTimers();
38
- });
39
- afterEach(() => {
40
- vi.useRealTimers();
41
- });
42
- it("calls detect immediately and cleans up on detection", () => {
43
- const detect = vi.fn().mockReturnValue(true);
44
- scopePollingDetectionStrategy(detect);
45
- expect(detect).toHaveBeenCalled();
46
- });
47
- it("sets up polling interval when not immediately detected", () => {
48
- let callCount = 0;
49
- const detect = vi.fn(() => {
50
- callCount++;
51
- return callCount >= 3;
52
- });
53
- scopePollingDetectionStrategy(detect);
54
- // First call is immediate (returns false)
55
- expect(detect).toHaveBeenCalledTimes(1);
56
- // Advance timer to trigger interval
57
- vi.advanceTimersByTime(1000);
58
- expect(detect).toHaveBeenCalledTimes(2);
59
- vi.advanceTimersByTime(1000);
60
- expect(detect).toHaveBeenCalledTimes(3);
61
- // After detection (callCount >= 3), interval should be cleared
62
- vi.advanceTimersByTime(1000);
63
- expect(detect).toHaveBeenCalledTimes(3);
64
- });
65
- });
66
- //# sourceMappingURL=adapter.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"adapter.test.js","sourceRoot":"","sources":["../../__tests__/adapter.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACzE,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,6BAA6B,GAC9B,MAAM,YAAY,CAAC;AAEpB,QAAQ,CAAC,uBAAuB,EAAE,GAAG,EAAE;IACrC,EAAE,CAAC,oBAAoB,EAAE,GAAG,EAAE;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,CAAC,CAAC;IAC1C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -1 +0,0 @@
1
- export {};
@@ -1,70 +0,0 @@
1
- import { describe, it, expect } from "vitest";
2
- import { WalletError, WalletNotReadyError, WalletLoadError, WalletConfigError, WalletConnectionError, WalletNotSelectedError, WalletDisconnectedError, WalletDisconnectionError, WalletAccountError, WalletAddressError, WalletKeypairError, WalletNotConnectedError, WalletSendTransactionError, WalletSignMessageError, WalletSignTransactionError, WalletTimeoutError, WalletWindowBlockedError, WalletWindowClosedError, WalletDecryptionNotAllowedError, WalletPrivateDataPermissionError, WalletDecryptionError, WalletRecordsError, WalletTransactionError, } from "../errors";
3
- const errorClasses = [
4
- { Class: WalletNotReadyError, name: "WalletNotReadyError" },
5
- { Class: WalletLoadError, name: "WalletLoadError" },
6
- { Class: WalletConfigError, name: "WalletConfigError" },
7
- { Class: WalletConnectionError, name: "WalletConnectionError" },
8
- { Class: WalletNotSelectedError, name: "WalletNotSelectedError" },
9
- { Class: WalletDisconnectedError, name: "WalletDisconnectedError" },
10
- { Class: WalletDisconnectionError, name: "WalletDisconnectionError" },
11
- { Class: WalletAccountError, name: "WalletAccountError" },
12
- { Class: WalletAddressError, name: "WalletAddressError" },
13
- { Class: WalletKeypairError, name: "WalletKeypairError" },
14
- { Class: WalletNotConnectedError, name: "WalletNotConnectedError" },
15
- { Class: WalletSendTransactionError, name: "WalletSendTransactionError" },
16
- { Class: WalletSignMessageError, name: "WalletSignMessageError" },
17
- { Class: WalletSignTransactionError, name: "WalletSignTransactionError" },
18
- { Class: WalletTimeoutError, name: "WalletTimeoutError" },
19
- { Class: WalletWindowBlockedError, name: "WalletWindowBlockedError" },
20
- { Class: WalletWindowClosedError, name: "WalletWindowClosedError" },
21
- {
22
- Class: WalletDecryptionNotAllowedError,
23
- name: "WalletDecryptionNotAllowedError",
24
- },
25
- {
26
- Class: WalletPrivateDataPermissionError,
27
- name: "WalletPrivateDataPermissionError",
28
- },
29
- { Class: WalletDecryptionError, name: "WalletDecryptionError" },
30
- { Class: WalletRecordsError, name: "WalletRecordsError" },
31
- { Class: WalletTransactionError, name: "WalletTransactionError" },
32
- ];
33
- describe("WalletError", () => {
34
- it("extends Error", () => {
35
- const err = new WalletError("test message");
36
- expect(err).toBeInstanceOf(Error);
37
- expect(err).toBeInstanceOf(WalletError);
38
- });
39
- it("sets message property", () => {
40
- const err = new WalletError("my message");
41
- expect(err.message).toBe("my message");
42
- });
43
- it("stores inner error", () => {
44
- const inner = new Error("inner");
45
- const err = new WalletError("outer", inner);
46
- expect(err.error).toBe(inner);
47
- });
48
- });
49
- describe("error subclasses", () => {
50
- for (const { Class, name } of errorClasses) {
51
- describe(name, () => {
52
- it("extends WalletError and Error", () => {
53
- const err = new Class();
54
- expect(err).toBeInstanceOf(WalletError);
55
- expect(err).toBeInstanceOf(Error);
56
- });
57
- it("has correct name property", () => {
58
- const err = new Class();
59
- expect(err.name).toBe(name);
60
- });
61
- it("stores inner error", () => {
62
- const inner = new Error("cause");
63
- const err = new Class("msg", inner);
64
- expect(err.error).toBe(inner);
65
- expect(err.message).toBe("msg");
66
- });
67
- });
68
- }
69
- });
70
- //# sourceMappingURL=errors.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"errors.test.js","sourceRoot":"","sources":["../../__tests__/errors.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EACL,WAAW,EACX,mBAAmB,EACnB,eAAe,EACf,iBAAiB,EACjB,qBAAqB,EACrB,sBAAsB,EACtB,uBAAuB,EACvB,wBAAwB,EACxB,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,uBAAuB,EACvB,0BAA0B,EAC1B,sBAAsB,EACtB,0BAA0B,EAC1B,kBAAkB,EAClB,wBAAwB,EACxB,uBAAuB,EACvB,+BAA+B,EAC/B,gCAAgC,EAChC,qBAAqB,EACrB,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AC,IAAI,EAAE,GAAG,EAAE;YAClB,EAAE,CAAC,+BAA+B,EAAE,GAAG,EAAE;gBACvC,MAAM,GAAG,GAAG,IAAI,KAAK,EAAE,CAAC;gBACxB,MAAM,CAAC,GAAG,CAAC,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC;gBACxC,MAAM,CAAC,GAAG,CAAC,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;YACpC,CAAC,CAAC,CAAC;YAEH,EAAE,CAAC,2BAA2B,EAAE,GAAG,EAAE;gBACnC,MAAM,GAAG,GAAG,IAAI,KAAK,EAAE,CAAC;gBACxB,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAC9B,CAAC,CAAC,CAAC;YAEH,EAAE,CAAC,oBAAoB,EAAE,GAAG,EAAE;gBAC5B,MAAM,KAAK,GAAG,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC;gBACjC,MAAM,GAAG,GAAG,IAAI,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;gBACpC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;gBAC9B,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YAClC,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;AACH,CAAC,CAAC,CAAC"}
@@ -1 +0,0 @@
1
- export {};
@@ -1,35 +0,0 @@
1
- import { describe, it, expect } from "vitest";
2
- import { u8ToB64, b64ToU8 } from "../helpers";
3
- describe("u8ToB64", () => {
4
- it("encodes a known value correctly", () => {
5
- const bytes = new Uint8Array([72, 101, 108, 108, 111]); // "Hello"
6
- expect(u8ToB64(bytes)).toBe("SGVsbG8=");
7
- });
8
- it("encodes an empty array", () => {
9
- expect(u8ToB64(new Uint8Array([]))).toBe("");
10
- });
11
- });
12
- describe("b64ToU8", () => {
13
- it("decodes a known value correctly", () => {
14
- const result = b64ToU8("SGVsbG8=");
15
- expect(result).toEqual(new Uint8Array([72, 101, 108, 108, 111]));
16
- });
17
- it("decodes an empty string", () => {
18
- expect(b64ToU8("")).toEqual(new Uint8Array([]));
19
- });
20
- });
21
- describe("roundtrip", () => {
22
- it("encode then decode returns original bytes", () => {
23
- const original = new Uint8Array([0, 1, 127, 128, 255]);
24
- const decoded = b64ToU8(u8ToB64(original));
25
- expect(decoded).toEqual(original);
26
- });
27
- it("handles a large array (256 bytes)", () => {
28
- const original = new Uint8Array(256);
29
- for (let i = 0; i < 256; i++)
30
- original[i] = i;
31
- const decoded = b64ToU8(u8ToB64(original));
32
- expect(decoded).toEqual(original);
33
- });
34
- });
35
- //# sourceMappingURL=helpers.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"helpers.test.js","sourceRoot":"","sources":["../../__tests__/helpers.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAE9C,QAAQ,CAAC,SAAS,EAAE,GAAG,EAAE;IACvB,EAAE,CAAC,iCAAiC,EAAE,GAAG,EAAE;QACzC,MAAM,KAAK,GAAG,IAAI,UAAU,CAAC,CAAC,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,UAAU;QAClE,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAC1C,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,wBAAwB,EAAE,GAAG,EAAE;QAChC,MAAM,CAAC,OAAO,CAAC,IAAI,UAAU,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC/C,CAAC,CAAC,CAAC;AACL,CAAC,CAA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