@dynamic-labs-sdk/aleo 1.0.0 → 1.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.
- package/dist/exports/walletStandard.d.ts +5 -0
- package/dist/exports/walletStandard.d.ts.map +1 -0
- package/dist/getNetworkByChainId-BUqTAdJz.cjs +115 -0
- package/dist/getNetworkByChainId-BUqTAdJz.cjs.map +1 -0
- package/dist/getNetworkByChainId-BaSjULzX.esm.js +68 -0
- package/dist/getNetworkByChainId-BaSjULzX.esm.js.map +1 -0
- package/dist/index.cjs +10 -73
- package/dist/index.cjs.map +1 -1
- package/dist/index.esm.js +1 -64
- package/dist/index.esm.js.map +1 -1
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/dist/utils/bytesToHex/bytesToHex.d.ts +15 -0
- package/dist/utils/bytesToHex/bytesToHex.d.ts.map +1 -0
- package/dist/utils/bytesToHex/index.d.ts +2 -0
- package/dist/utils/bytesToHex/index.d.ts.map +1 -0
- package/dist/walletStandard/AleoStandardWallet.types.d.ts +80 -0
- package/dist/walletStandard/AleoStandardWallet.types.d.ts.map +1 -0
- package/dist/walletStandard/addAleoWalletStandardExtension/addAleoWalletStandardExtension.d.ts +18 -0
- package/dist/walletStandard/addAleoWalletStandardExtension/addAleoWalletStandardExtension.d.ts.map +1 -0
- package/dist/walletStandard/addAleoWalletStandardExtension/index.d.ts +2 -0
- package/dist/walletStandard/addAleoWalletStandardExtension/index.d.ts.map +1 -0
- package/dist/walletStandard/aleoStandardWalletWindowKeys.d.ts +14 -0
- package/dist/walletStandard/aleoStandardWalletWindowKeys.d.ts.map +1 -0
- package/dist/walletStandard/utils/aleoChainForChainId/aleoChainForChainId.d.ts +20 -0
- package/dist/walletStandard/utils/aleoChainForChainId/aleoChainForChainId.d.ts.map +1 -0
- package/dist/walletStandard/utils/aleoChainForChainId/index.d.ts +2 -0
- package/dist/walletStandard/utils/aleoChainForChainId/index.d.ts.map +1 -0
- package/dist/walletStandard/utils/chainIdForAleoChain/chainIdForAleoChain.d.ts +21 -0
- package/dist/walletStandard/utils/chainIdForAleoChain/chainIdForAleoChain.d.ts.map +1 -0
- package/dist/walletStandard/utils/chainIdForAleoChain/index.d.ts +2 -0
- package/dist/walletStandard/utils/chainIdForAleoChain/index.d.ts.map +1 -0
- package/dist/walletStandard/utils/createWalletProviderFromAleoStandardWallet/createWalletProviderFromAleoStandardWallet.d.ts +17 -0
- package/dist/walletStandard/utils/createWalletProviderFromAleoStandardWallet/createWalletProviderFromAleoStandardWallet.d.ts.map +1 -0
- package/dist/walletStandard/utils/createWalletProviderFromAleoStandardWallet/index.d.ts +2 -0
- package/dist/walletStandard/utils/createWalletProviderFromAleoStandardWallet/index.d.ts.map +1 -0
- package/dist/walletStandard/utils/isAleoStandardWallet/index.d.ts +2 -0
- package/dist/walletStandard/utils/isAleoStandardWallet/index.d.ts.map +1 -0
- package/dist/walletStandard/utils/isAleoStandardWallet/isAleoStandardWallet.d.ts +15 -0
- package/dist/walletStandard/utils/isAleoStandardWallet/isAleoStandardWallet.d.ts.map +1 -0
- package/dist/walletStandard/utils/normalizeAleoStandardWalletAccount/index.d.ts +2 -0
- package/dist/walletStandard/utils/normalizeAleoStandardWalletAccount/index.d.ts.map +1 -0
- package/dist/walletStandard/utils/normalizeAleoStandardWalletAccount/normalizeAleoStandardWalletAccount.d.ts +22 -0
- package/dist/walletStandard/utils/normalizeAleoStandardWalletAccount/normalizeAleoStandardWalletAccount.d.ts.map +1 -0
- package/dist/walletStandard.cjs +412 -0
- package/dist/walletStandard.cjs.map +1 -0
- package/dist/walletStandard.esm.js +409 -0
- package/dist/walletStandard.esm.js.map +1 -0
- package/package.json +9 -4
|
@@ -0,0 +1,412 @@
|
|
|
1
|
+
const require_getNetworkByChainId = require('./getNetworkByChainId-BUqTAdJz.cjs');
|
|
2
|
+
let _dynamic_labs_sdk_assert_package_version = require("@dynamic-labs-sdk/assert-package-version");
|
|
3
|
+
let _dynamic_labs_sdk_client = require("@dynamic-labs-sdk/client");
|
|
4
|
+
let _provablehq_aleo_types = require("@provablehq/aleo-types");
|
|
5
|
+
let _dynamic_labs_sdk_client_core = require("@dynamic-labs-sdk/client/core");
|
|
6
|
+
let _dynamic_labs_sdk_api_core = require("@dynamic-labs/sdk-api-core");
|
|
7
|
+
let _provablehq_aleo_wallet_standard = require("@provablehq/aleo-wallet-standard");
|
|
8
|
+
|
|
9
|
+
//#region src/utils/formatMicrocreditsAsCredits/formatMicrocreditsAsCredits.ts
|
|
10
|
+
const MICROCREDITS_PER_CREDIT_BIGINT = BigInt(require_getNetworkByChainId.MICROCREDITS_PER_CREDIT);
|
|
11
|
+
const MICROCREDIT_DECIMAL_DIGITS = String(require_getNetworkByChainId.MICROCREDITS_PER_CREDIT).length - 1;
|
|
12
|
+
/**
|
|
13
|
+
* Bounded trailing-zero strip. `padStart` produces a fractional string
|
|
14
|
+
* of exactly `MICROCREDIT_DECIMAL_DIGITS` characters, so the quantifier
|
|
15
|
+
* upper bound matches the maximum possible run of trailing zeros —
|
|
16
|
+
* keeps the regex linear and avoids the unbounded-quantifier hotspot.
|
|
17
|
+
*/
|
|
18
|
+
const TRAILING_ZEROS_PATTERN = /0{1,6}$/;
|
|
19
|
+
/**
|
|
20
|
+
* Format microcredits (bigint) as a decimal credits string without
|
|
21
|
+
* losing precision for balances beyond `Number.MAX_SAFE_INTEGER`.
|
|
22
|
+
*
|
|
23
|
+
* The integer credits portion and the microcredits remainder are
|
|
24
|
+
* computed in the bigint domain, then the remainder is zero-padded to
|
|
25
|
+
* six digits and trailing fractional zeros are trimmed. Whole-credit
|
|
26
|
+
* balances render without a redundant `.000000` suffix.
|
|
27
|
+
*
|
|
28
|
+
* @not-instrumented
|
|
29
|
+
*/
|
|
30
|
+
const formatMicrocreditsAsCredits = (microcredits) => {
|
|
31
|
+
const credits = microcredits / MICROCREDITS_PER_CREDIT_BIGINT;
|
|
32
|
+
const fractional = (microcredits % MICROCREDITS_PER_CREDIT_BIGINT).toString().padStart(MICROCREDIT_DECIMAL_DIGITS, "0").replace(TRAILING_ZEROS_PATTERN, "");
|
|
33
|
+
return fractional.length > 0 ? `${credits}.${fractional}` : `${credits}`;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
//#endregion
|
|
37
|
+
//#region src/utils/parseAleoMicrocreditsLiteral/parseAleoMicrocreditsLiteral.ts
|
|
38
|
+
const U64_PRIVATE_SUFFIX = "u64.private";
|
|
39
|
+
const U64_SUFFIX = "u64";
|
|
40
|
+
/**
|
|
41
|
+
* Parse an Aleo VM mapping plaintext literal into microcredits.
|
|
42
|
+
*
|
|
43
|
+
* Accepts the shapes the Aleo `account` mapping endpoint actually
|
|
44
|
+
* emits — e.g. `1500000u64.private`, `1_500_000u64`, or a bare integer
|
|
45
|
+
* wrapped in JSON quotes. Strips the trailing `u64` / `u64.private`
|
|
46
|
+
* type suffix, surrounding quotes, and the cosmetic `_` group
|
|
47
|
+
* separators Aleo plaintext literals allow.
|
|
48
|
+
*
|
|
49
|
+
* Returns `0n` for empty input and for any payload that doesn't parse
|
|
50
|
+
* as an integer. `BigInt()` throws `SyntaxError` on anything that
|
|
51
|
+
* isn't a parseable integer — a corrupted RPC response, a mid-flight
|
|
52
|
+
* truncation, or an upstream API change could deliver such a payload,
|
|
53
|
+
* and we'd rather show a zero balance than crash the network-provider
|
|
54
|
+
* machinery with an unhandled rejection.
|
|
55
|
+
*
|
|
56
|
+
* @not-instrumented
|
|
57
|
+
*/
|
|
58
|
+
const parseAleoMicrocreditsLiteral = (raw) => {
|
|
59
|
+
let cleaned = raw.trim();
|
|
60
|
+
if (cleaned.startsWith("\"") && cleaned.endsWith("\"")) cleaned = cleaned.slice(1, -1);
|
|
61
|
+
if (cleaned.endsWith(U64_PRIVATE_SUFFIX)) cleaned = cleaned.slice(0, -11);
|
|
62
|
+
else if (cleaned.endsWith(U64_SUFFIX)) cleaned = cleaned.slice(0, -3);
|
|
63
|
+
cleaned = cleaned.split("_").join("").trim();
|
|
64
|
+
if (!cleaned) return BigInt(0);
|
|
65
|
+
try {
|
|
66
|
+
return BigInt(cleaned);
|
|
67
|
+
} catch {
|
|
68
|
+
return BigInt(0);
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
//#endregion
|
|
73
|
+
//#region src/utils/fetchAleoBalance/fetchAleoBalance.ts
|
|
74
|
+
/**
|
|
75
|
+
* Aleo addresses are bech32-encoded — lowercase alphanumerics only — so we
|
|
76
|
+
* can validate strictly. Refusing anything else before it reaches the URL
|
|
77
|
+
* keeps `/`, `?`, `#`, `..`, etc. out of the request path (SSRF / path
|
|
78
|
+
* injection defence).
|
|
79
|
+
*/
|
|
80
|
+
const ALEO_ADDRESS_PATTERN = /^aleo1[a-z0-9]{1,62}$/;
|
|
81
|
+
/**
|
|
82
|
+
* Fetches the public credits balance for an Aleo address by querying the
|
|
83
|
+
* `account` mapping on `credits.aleo` via the network's HTTP RPC. Returns
|
|
84
|
+
* the balance as a credits string (private records are not visible here —
|
|
85
|
+
* they live on the wallet and require a connected adapter to enumerate).
|
|
86
|
+
*
|
|
87
|
+
* Returns `null` when the address is malformed or no RPC URL is
|
|
88
|
+
* configured; returns `'0'` for any other failure mode (non-OK status,
|
|
89
|
+
* empty body, `null` mapping, unparseable payload). This keeps the
|
|
90
|
+
* function fail-soft for the network-provider machinery, which surfaces
|
|
91
|
+
* the result directly to the UI.
|
|
92
|
+
*
|
|
93
|
+
* @not-instrumented
|
|
94
|
+
*/
|
|
95
|
+
const fetchAleoBalance = async ({ address, networkData }) => {
|
|
96
|
+
if (!ALEO_ADDRESS_PATTERN.test(address)) return null;
|
|
97
|
+
const baseUrl = networkData.rpcUrls.http[0];
|
|
98
|
+
if (!baseUrl) return null;
|
|
99
|
+
const base = baseUrl.endsWith("/") ? baseUrl : `${baseUrl}/`;
|
|
100
|
+
const url = new URL(`program/credits.aleo/mapping/account/${encodeURIComponent(address)}`, base);
|
|
101
|
+
const response = await fetch(url.toString());
|
|
102
|
+
if (!response.ok) return "0";
|
|
103
|
+
const text = await response.text();
|
|
104
|
+
if (!text || text === "null") return "0";
|
|
105
|
+
const microcredits = parseAleoMicrocreditsLiteral(text);
|
|
106
|
+
if (microcredits <= BigInt(0)) return "0";
|
|
107
|
+
return formatMicrocreditsAsCredits(microcredits);
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
//#endregion
|
|
111
|
+
//#region src/utils/createAleoNetworkProvider/createAleoNetworkProvider.ts
|
|
112
|
+
/**
|
|
113
|
+
* Build an `AleoNetworkProvider` bound to a specific `NetworkData`
|
|
114
|
+
* (mainnet vs. testnet — anything the SDK config exposes). The provider
|
|
115
|
+
* exposes a `getBalance({ address })` that proxies to
|
|
116
|
+
* `fetchAleoBalance` over the configured RPC, returning public credits
|
|
117
|
+
* only (private records require a connected wallet adapter).
|
|
118
|
+
*
|
|
119
|
+
* Called by `registerAleoNetworkProviderBuilder` — not invoked directly.
|
|
120
|
+
*
|
|
121
|
+
* @not-instrumented
|
|
122
|
+
*/
|
|
123
|
+
const createAleoNetworkProvider = (networkData) => ({
|
|
124
|
+
...(0, _dynamic_labs_sdk_client_core.createBaseNetworkProvider)("ALEO", networkData),
|
|
125
|
+
getBalance: async ({ address }) => ({ balance: await fetchAleoBalance({
|
|
126
|
+
address,
|
|
127
|
+
networkData
|
|
128
|
+
}) })
|
|
129
|
+
});
|
|
130
|
+
|
|
131
|
+
//#endregion
|
|
132
|
+
//#region src/registerAleoNetworkProviderBuilder/registerAleoNetworkProviderBuilder.ts
|
|
133
|
+
/**
|
|
134
|
+
* Register the Aleo network-provider builder on a Dynamic client.
|
|
135
|
+
*
|
|
136
|
+
* Wires `createAleoNetworkProvider` into the client's network-provider
|
|
137
|
+
* builder registry under the `'ALEO'` chain key, which is how the SDK's
|
|
138
|
+
* network machinery materializes a per-network provider on demand.
|
|
139
|
+
* Idempotent — a second call is a no-op once the builder is registered.
|
|
140
|
+
*
|
|
141
|
+
* Internal: called by the Aleo extension entry points
|
|
142
|
+
* (`addAleoWalletStandardExtension`, `addAleoWalletAdaptersExtension`,
|
|
143
|
+
* `addAleoExtension`). Not exported from the package's public surface.
|
|
144
|
+
*
|
|
145
|
+
* @not-instrumented
|
|
146
|
+
*/
|
|
147
|
+
const registerAleoNetworkProviderBuilder = (client) => {
|
|
148
|
+
const networkProviderBuilderRegistry = (0, _dynamic_labs_sdk_client_core.getNetworkProviderBuilderRegistry)(client);
|
|
149
|
+
if (networkProviderBuilderRegistry.get().get("ALEO")) return;
|
|
150
|
+
networkProviderBuilderRegistry.register({
|
|
151
|
+
builder: createAleoNetworkProvider,
|
|
152
|
+
chain: "ALEO"
|
|
153
|
+
});
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
//#endregion
|
|
157
|
+
//#region src/walletStandard/aleoStandardWalletWindowKeys.ts
|
|
158
|
+
/**
|
|
159
|
+
* The `window` keys at which known Aleo Wallet Standard wallets inject
|
|
160
|
+
* themselves. Scanned by `addAleoWalletStandardExtension` to discover
|
|
161
|
+
* available wallets — analogous to EVM's hardcoded `'ethereum'` path in
|
|
162
|
+
* `getEvmInjectedProviders`, or Tron's hardcoded adapter constructors
|
|
163
|
+
* in `addTronWalletAdaptersExtension`.
|
|
164
|
+
*
|
|
165
|
+
* As new wallets adopt `@provablehq/aleo-wallet-standard`, add their
|
|
166
|
+
* injection key here. Wallets that use the legacy adapter API
|
|
167
|
+
* (`@provablehq/aleo-wallet-adaptor-core` — Leo, Puzzle, Fox, etc.) are
|
|
168
|
+
* registered through `addAleoWalletAdaptersExtension` instead.
|
|
169
|
+
*/
|
|
170
|
+
const ALEO_STANDARD_WALLET_WINDOW_KEYS = ["shield"];
|
|
171
|
+
|
|
172
|
+
//#endregion
|
|
173
|
+
//#region src/utils/bytesToHex/bytesToHex.ts
|
|
174
|
+
/**
|
|
175
|
+
* Encode a `Uint8Array` as a lowercase hex string with no separator.
|
|
176
|
+
* Used to render Aleo signature bytes for the `signMessage` provider
|
|
177
|
+
* surface (which yields a hex `signature: string` per the Dynamic
|
|
178
|
+
* `WalletProvider` contract) and any other place we need a stable
|
|
179
|
+
* compact bytes-to-text encoding.
|
|
180
|
+
*
|
|
181
|
+
* @not-instrumented
|
|
182
|
+
*/
|
|
183
|
+
const bytesToHex = ({ bytes }) => Array.from(bytes, (b) => b.toString(16).padStart(2, "0")).join("");
|
|
184
|
+
|
|
185
|
+
//#endregion
|
|
186
|
+
//#region src/walletStandard/utils/aleoChainForChainId/aleoChainForChainId.ts
|
|
187
|
+
/**
|
|
188
|
+
* Inverse of `chainIdForAleoChain` — resolve the Aleo Wallet Standard
|
|
189
|
+
* chain string for a Dynamic numeric chain id. Used by the
|
|
190
|
+
* walletStandard provider's `switchActiveNetwork` to translate the
|
|
191
|
+
* SDK's stringly-typed chain id into the wallet's expected `AleoChain`
|
|
192
|
+
* value.
|
|
193
|
+
*
|
|
194
|
+
* @not-instrumented
|
|
195
|
+
*/
|
|
196
|
+
const aleoChainForChainId = ({ networkId }) => Number(networkId) === require_getNetworkByChainId.ALEO_MAINNET_NETWORK_ID ? _provablehq_aleo_wallet_standard.ALEO_CHAINS.MAINNET : _provablehq_aleo_wallet_standard.ALEO_CHAINS.TESTNET;
|
|
197
|
+
|
|
198
|
+
//#endregion
|
|
199
|
+
//#region src/walletStandard/utils/chainIdForAleoChain/chainIdForAleoChain.ts
|
|
200
|
+
/**
|
|
201
|
+
* Resolve the Dynamic numeric chain id for an Aleo Wallet Standard chain
|
|
202
|
+
* string. `undefined` is treated as MAINNET to match
|
|
203
|
+
* `createWalletProviderFromAleoStandardWallet`'s `connect()` default —
|
|
204
|
+
* otherwise the SDK would report a different network than the one the
|
|
205
|
+
* wallet was actually connected to.
|
|
206
|
+
*
|
|
207
|
+
* @not-instrumented
|
|
208
|
+
*/
|
|
209
|
+
const chainIdForAleoChain = ({ chain }) => {
|
|
210
|
+
if (chain === _provablehq_aleo_wallet_standard.ALEO_CHAINS.MAINNET || chain === void 0) return String(require_getNetworkByChainId.ALEO_NETWORK_TO_ID_MAP[_provablehq_aleo_types.Network.MAINNET]);
|
|
211
|
+
return String(require_getNetworkByChainId.ALEO_NETWORK_TO_ID_MAP[_provablehq_aleo_types.Network.TESTNET]);
|
|
212
|
+
};
|
|
213
|
+
|
|
214
|
+
//#endregion
|
|
215
|
+
//#region src/walletStandard/utils/normalizeAleoStandardWalletAccount/normalizeAleoStandardWalletAccount.ts
|
|
216
|
+
/**
|
|
217
|
+
* Reduce either string-form or object-form Aleo Wallet Standard
|
|
218
|
+
* account entries to the bare address string the Dynamic SDK works
|
|
219
|
+
* with.
|
|
220
|
+
*
|
|
221
|
+
* @not-instrumented
|
|
222
|
+
*/
|
|
223
|
+
const normalizeAleoStandardWalletAccount = ({ account }) => typeof account === "string" ? account : account.address;
|
|
224
|
+
|
|
225
|
+
//#endregion
|
|
226
|
+
//#region src/walletStandard/utils/createWalletProviderFromAleoStandardWallet/createWalletProviderFromAleoStandardWallet.ts
|
|
227
|
+
/**
|
|
228
|
+
* Translate an Aleo StandardWallet (feature-map API) into a Dynamic
|
|
229
|
+
* `WalletProvider`. Unsupported features fall through as undefined methods
|
|
230
|
+
* on the returned provider — callers should guard accordingly.
|
|
231
|
+
*
|
|
232
|
+
* @not-instrumented
|
|
233
|
+
*/
|
|
234
|
+
const createWalletProviderFromAleoStandardWallet = ({ dynamicClient, walletStandardWallet }) => {
|
|
235
|
+
const chain = "ALEO";
|
|
236
|
+
const displayName = walletStandardWallet.name;
|
|
237
|
+
const metadata = {
|
|
238
|
+
displayName,
|
|
239
|
+
icon: walletStandardWallet.icon ?? ""
|
|
240
|
+
};
|
|
241
|
+
const walletProviderType = _dynamic_labs_sdk_api_core.WalletProviderEnum.BrowserExtension;
|
|
242
|
+
const key = (0, _dynamic_labs_sdk_client_core.formatWalletProviderKey)({
|
|
243
|
+
chain,
|
|
244
|
+
displayName,
|
|
245
|
+
walletProviderType
|
|
246
|
+
});
|
|
247
|
+
const connect = async () => {
|
|
248
|
+
const connectFeature = walletStandardWallet.features[_provablehq_aleo_wallet_standard.WalletFeatureName.CONNECT];
|
|
249
|
+
if (!connectFeature?.available) throw new require_getNetworkByChainId.AleoFeatureUnsupportedError({
|
|
250
|
+
featureName: "connect",
|
|
251
|
+
walletName: displayName
|
|
252
|
+
});
|
|
253
|
+
const chainsFeature = walletStandardWallet.features[_provablehq_aleo_wallet_standard.WalletFeatureName.CHAINS];
|
|
254
|
+
const initialChain = chainsFeature?.available && chainsFeature.chains[0] ? chainsFeature.chains[0] : _provablehq_aleo_wallet_standard.ALEO_CHAINS.MAINNET;
|
|
255
|
+
await connectFeature.connect(initialChain, _provablehq_aleo_wallet_standard.WalletDecryptPermission.UponRequest);
|
|
256
|
+
const accountsFeature = walletStandardWallet.features[_provablehq_aleo_wallet_standard.WalletFeatureName.ACCOUNTS];
|
|
257
|
+
return { addresses: (accountsFeature?.available ? await accountsFeature.getAccounts() : []).map((account) => ({ address: normalizeAleoStandardWalletAccount({ account }) })) };
|
|
258
|
+
};
|
|
259
|
+
const destroy = async () => {
|
|
260
|
+
const connectFeature = walletStandardWallet.features[_provablehq_aleo_wallet_standard.WalletFeatureName.CONNECT];
|
|
261
|
+
if (!connectFeature?.available) return;
|
|
262
|
+
try {
|
|
263
|
+
await connectFeature.disconnect();
|
|
264
|
+
} catch {}
|
|
265
|
+
};
|
|
266
|
+
const getActiveNetworkId = async () => {
|
|
267
|
+
const chainsFeature = walletStandardWallet.features[_provablehq_aleo_wallet_standard.WalletFeatureName.CHAINS];
|
|
268
|
+
return { networkId: chainIdForAleoChain({ chain: chainsFeature?.available ? chainsFeature.chains[0] : void 0 }) };
|
|
269
|
+
};
|
|
270
|
+
const getConnectedAddresses = async () => {
|
|
271
|
+
const accountsFeature = walletStandardWallet.features[_provablehq_aleo_wallet_standard.WalletFeatureName.ACCOUNTS];
|
|
272
|
+
if (!accountsFeature?.available) return { addresses: [] };
|
|
273
|
+
return { addresses: (await accountsFeature.getAccounts()).map((account) => normalizeAleoStandardWalletAccount({ account })) };
|
|
274
|
+
};
|
|
275
|
+
const signMessage = async ({ message, walletAccount }) => {
|
|
276
|
+
(0, _dynamic_labs_sdk_client_core.assertDefined)(walletAccount, "Wallet account not found");
|
|
277
|
+
await (0, _dynamic_labs_sdk_client.assertWalletAccountSigningAvailability)({ walletAccount }, dynamicClient);
|
|
278
|
+
const signFeature = walletStandardWallet.features[_provablehq_aleo_wallet_standard.WalletFeatureName.SIGN];
|
|
279
|
+
if (!signFeature?.available) throw new require_getNetworkByChainId.AleoFeatureUnsupportedError({
|
|
280
|
+
featureName: "signMessage",
|
|
281
|
+
walletName: displayName
|
|
282
|
+
});
|
|
283
|
+
return { signature: bytesToHex({ bytes: await signFeature.signMessage(new TextEncoder().encode(message)) }) };
|
|
284
|
+
};
|
|
285
|
+
const switchActiveNetwork = async ({ networkId }) => {
|
|
286
|
+
const switchFeature = walletStandardWallet.features[_provablehq_aleo_wallet_standard.WalletFeatureName.SWITCH_NETWORK];
|
|
287
|
+
if (!switchFeature?.available) throw new require_getNetworkByChainId.AleoFeatureUnsupportedError({
|
|
288
|
+
featureName: "switchNetwork",
|
|
289
|
+
walletName: displayName
|
|
290
|
+
});
|
|
291
|
+
const network = aleoChainForChainId({ networkId }) === _provablehq_aleo_wallet_standard.ALEO_CHAINS.MAINNET ? _provablehq_aleo_types.Network.MAINNET : _provablehq_aleo_types.Network.TESTNET;
|
|
292
|
+
await switchFeature.switchNetwork(network);
|
|
293
|
+
};
|
|
294
|
+
const requestTransaction = async ({ transaction, walletAccount }) => {
|
|
295
|
+
(0, _dynamic_labs_sdk_client_core.assertDefined)(walletAccount, "Wallet account not found");
|
|
296
|
+
await (0, _dynamic_labs_sdk_client.assertWalletAccountSigningAvailability)({ walletAccount }, dynamicClient);
|
|
297
|
+
const executeFeature = walletStandardWallet.features[_provablehq_aleo_wallet_standard.WalletFeatureName.EXECUTE];
|
|
298
|
+
if (!executeFeature?.available) throw new require_getNetworkByChainId.AleoFeatureUnsupportedError({
|
|
299
|
+
featureName: "executeTransaction",
|
|
300
|
+
walletName: displayName
|
|
301
|
+
});
|
|
302
|
+
const aleoTransaction = transaction;
|
|
303
|
+
const [transition] = aleoTransaction.transitions;
|
|
304
|
+
(0, _dynamic_labs_sdk_client_core.assertDefined)(transition, "Transaction must have at least one transition");
|
|
305
|
+
const { transactionId } = await executeFeature.executeTransaction({
|
|
306
|
+
fee: aleoTransaction.fee,
|
|
307
|
+
function: transition.functionName,
|
|
308
|
+
inputs: transition.inputs,
|
|
309
|
+
privateFee: aleoTransaction.feePrivate,
|
|
310
|
+
program: transition.program
|
|
311
|
+
});
|
|
312
|
+
return { transactionId };
|
|
313
|
+
};
|
|
314
|
+
const decrypt = async ({ ciphertext, options, walletAccount }) => {
|
|
315
|
+
(0, _dynamic_labs_sdk_client_core.assertDefined)(walletAccount, "Wallet account not found");
|
|
316
|
+
const decryptFeature = walletStandardWallet.features[_provablehq_aleo_wallet_standard.WalletFeatureName.DECRYPT];
|
|
317
|
+
if (!decryptFeature?.available) throw new require_getNetworkByChainId.AleoFeatureUnsupportedError({
|
|
318
|
+
featureName: "decrypt",
|
|
319
|
+
walletName: displayName
|
|
320
|
+
});
|
|
321
|
+
return { plaintext: await decryptFeature.decrypt(ciphertext, options?.tpk, options?.programId, options?.functionName, options?.index) };
|
|
322
|
+
};
|
|
323
|
+
const requestRecords = async ({ program, options, walletAccount }) => {
|
|
324
|
+
(0, _dynamic_labs_sdk_client_core.assertDefined)(walletAccount, "Wallet account not found");
|
|
325
|
+
const recordsFeature = walletStandardWallet.features[_provablehq_aleo_wallet_standard.WalletFeatureName.REQUEST_RECORDS];
|
|
326
|
+
if (!recordsFeature?.available) throw new require_getNetworkByChainId.AleoFeatureUnsupportedError({
|
|
327
|
+
featureName: "requestRecords",
|
|
328
|
+
walletName: displayName
|
|
329
|
+
});
|
|
330
|
+
return { records: await recordsFeature.requestRecords(program, options?.plaintext ?? false) };
|
|
331
|
+
};
|
|
332
|
+
return {
|
|
333
|
+
chain,
|
|
334
|
+
connect,
|
|
335
|
+
decrypt,
|
|
336
|
+
destroy,
|
|
337
|
+
getActiveNetworkId,
|
|
338
|
+
getConnectedAddresses,
|
|
339
|
+
groupKey: (0, _dynamic_labs_sdk_client_core.formatWalletProviderGroupKey)(displayName),
|
|
340
|
+
key,
|
|
341
|
+
metadata,
|
|
342
|
+
requestRecords,
|
|
343
|
+
requestTransaction,
|
|
344
|
+
signMessage,
|
|
345
|
+
switchActiveNetwork,
|
|
346
|
+
walletProviderType
|
|
347
|
+
};
|
|
348
|
+
};
|
|
349
|
+
|
|
350
|
+
//#endregion
|
|
351
|
+
//#region src/walletStandard/utils/isAleoStandardWallet/isAleoStandardWallet.ts
|
|
352
|
+
/**
|
|
353
|
+
* Type guard for an Aleo Wallet Standard wallet injected on the page —
|
|
354
|
+
* checks the minimum shape we need (an object with a `features` map)
|
|
355
|
+
* before we hand it to `createWalletProviderFromAleoStandardWallet`.
|
|
356
|
+
*
|
|
357
|
+
* Used to filter the candidate list returned by
|
|
358
|
+
* `getAllProvidersFromWindow` (which can return anything sitting at the
|
|
359
|
+
* configured window key, including the wallet's own `.providers`
|
|
360
|
+
* sibling for EIP-5749-style multi-wallet injections).
|
|
361
|
+
*
|
|
362
|
+
* @not-instrumented
|
|
363
|
+
*/
|
|
364
|
+
const isAleoStandardWallet = (value) => typeof value === "object" && value !== null && "features" in value && typeof value.features === "object";
|
|
365
|
+
|
|
366
|
+
//#endregion
|
|
367
|
+
//#region src/walletStandard/addAleoWalletStandardExtension/addAleoWalletStandardExtension.ts
|
|
368
|
+
const ALEO_WALLET_STANDARD_EXTENSION_KEY = "aleoWalletStandard";
|
|
369
|
+
/**
|
|
370
|
+
* Adds the Aleo Wallet Standard extension to the Dynamic client.
|
|
371
|
+
*
|
|
372
|
+
* Scans `window` at each of the known Aleo Wallet Standard injection
|
|
373
|
+
* keys (see `ALEO_STANDARD_WALLET_WINDOW_KEYS`) via the shared
|
|
374
|
+
* `getAllProvidersFromWindow` helper, wraps every found wallet as a
|
|
375
|
+
* Dynamic `WalletProvider`, and registers it. The caller doesn't
|
|
376
|
+
* enumerate wallets — same shape as EVM's
|
|
377
|
+
* `addEvmWindowInjectedExtension` and Tron's
|
|
378
|
+
* `addTronWalletAdaptersExtension`.
|
|
379
|
+
*
|
|
380
|
+
* @param [client] - The Dynamic client instance. Only required when
|
|
381
|
+
* using multiple Dynamic clients.
|
|
382
|
+
* @not-instrumented
|
|
383
|
+
*/
|
|
384
|
+
const addAleoWalletStandardExtension = (client = (0, _dynamic_labs_sdk_client_core.getDefaultClient)()) => {
|
|
385
|
+
if ((0, _dynamic_labs_sdk_client_core.hasExtension)({ extensionKey: ALEO_WALLET_STANDARD_EXTENSION_KEY }, client)) return;
|
|
386
|
+
(0, _dynamic_labs_sdk_client_core.registerExtension)({ extensionKey: ALEO_WALLET_STANDARD_EXTENSION_KEY }, client);
|
|
387
|
+
registerAleoNetworkProviderBuilder(client);
|
|
388
|
+
const walletProviderRegistry = (0, _dynamic_labs_sdk_client_core.getWalletProviderRegistry)(client);
|
|
389
|
+
ALEO_STANDARD_WALLET_WINDOW_KEYS.forEach((windowKey) => {
|
|
390
|
+
(0, _dynamic_labs_sdk_client_core.getAllProvidersFromWindow)(windowKey).filter(isAleoStandardWallet).forEach((walletStandardWallet) => {
|
|
391
|
+
const walletProvider = createWalletProviderFromAleoStandardWallet({
|
|
392
|
+
dynamicClient: client,
|
|
393
|
+
walletStandardWallet
|
|
394
|
+
});
|
|
395
|
+
walletProviderRegistry.register({
|
|
396
|
+
priority: _dynamic_labs_sdk_client_core.WalletProviderPriority.WINDOW_INJECT,
|
|
397
|
+
walletProvider
|
|
398
|
+
});
|
|
399
|
+
});
|
|
400
|
+
});
|
|
401
|
+
};
|
|
402
|
+
|
|
403
|
+
//#endregion
|
|
404
|
+
//#region src/exports/walletStandard.ts
|
|
405
|
+
(0, _dynamic_labs_sdk_assert_package_version.assertPackageVersion)(require_getNetworkByChainId.name, require_getNetworkByChainId.version);
|
|
406
|
+
|
|
407
|
+
//#endregion
|
|
408
|
+
exports.ALEO_STANDARD_WALLET_WINDOW_KEYS = ALEO_STANDARD_WALLET_WINDOW_KEYS;
|
|
409
|
+
exports.ALEO_WALLET_STANDARD_EXTENSION_KEY = ALEO_WALLET_STANDARD_EXTENSION_KEY;
|
|
410
|
+
exports.addAleoWalletStandardExtension = addAleoWalletStandardExtension;
|
|
411
|
+
exports.createWalletProviderFromAleoStandardWallet = createWalletProviderFromAleoStandardWallet;
|
|
412
|
+
//# sourceMappingURL=walletStandard.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"walletStandard.cjs","names":["MICROCREDITS_PER_CREDIT","ALEO_STANDARD_WALLET_WINDOW_KEYS: readonly string[]","ALEO_MAINNET_NETWORK_ID","ALEO_CHAINS","ALEO_CHAINS","ALEO_NETWORK_TO_ID_MAP","Network","chain: Chain","metadata: WalletProviderMetadata","WalletProviderEnum","connect: AleoWalletProvider['connect']","WalletFeatureName","AleoFeatureUnsupportedError","initialChain: AleoChain","ALEO_CHAINS","WalletDecryptPermission","destroy: AleoWalletProvider['destroy']","getActiveNetworkId: AleoWalletProvider['getActiveNetworkId']","getConnectedAddresses: AleoWalletProvider['getConnectedAddresses']","signMessage: AleoWalletProvider['signMessage']","switchActiveNetwork: AleoWalletProvider['switchActiveNetwork']","network: Network","Network","requestTransaction: AleoWalletProvider['requestTransaction']","aleoTransaction: AleoTransaction","decrypt: AleoWalletProvider['decrypt']","requestRecords: AleoWalletProvider['requestRecords']","WalletProviderPriority","packageName","packageVersion"],"sources":["../src/utils/formatMicrocreditsAsCredits/formatMicrocreditsAsCredits.ts","../src/utils/parseAleoMicrocreditsLiteral/parseAleoMicrocreditsLiteral.ts","../src/utils/fetchAleoBalance/fetchAleoBalance.ts","../src/utils/createAleoNetworkProvider/createAleoNetworkProvider.ts","../src/registerAleoNetworkProviderBuilder/registerAleoNetworkProviderBuilder.ts","../src/walletStandard/aleoStandardWalletWindowKeys.ts","../src/utils/bytesToHex/bytesToHex.ts","../src/walletStandard/utils/aleoChainForChainId/aleoChainForChainId.ts","../src/walletStandard/utils/chainIdForAleoChain/chainIdForAleoChain.ts","../src/walletStandard/utils/normalizeAleoStandardWalletAccount/normalizeAleoStandardWalletAccount.ts","../src/walletStandard/utils/createWalletProviderFromAleoStandardWallet/createWalletProviderFromAleoStandardWallet.ts","../src/walletStandard/utils/isAleoStandardWallet/isAleoStandardWallet.ts","../src/walletStandard/addAleoWalletStandardExtension/addAleoWalletStandardExtension.ts","../src/exports/walletStandard.ts"],"sourcesContent":["import { MICROCREDITS_PER_CREDIT } from '../constants';\n\nconst MICROCREDITS_PER_CREDIT_BIGINT = BigInt(MICROCREDITS_PER_CREDIT);\nconst MICROCREDIT_DECIMAL_DIGITS = String(MICROCREDITS_PER_CREDIT).length - 1;\n\n/**\n * Bounded trailing-zero strip. `padStart` produces a fractional string\n * of exactly `MICROCREDIT_DECIMAL_DIGITS` characters, so the quantifier\n * upper bound matches the maximum possible run of trailing zeros —\n * keeps the regex linear and avoids the unbounded-quantifier hotspot.\n */\nconst TRAILING_ZEROS_PATTERN = /0{1,6}$/;\n\n/**\n * Format microcredits (bigint) as a decimal credits string without\n * losing precision for balances beyond `Number.MAX_SAFE_INTEGER`.\n *\n * The integer credits portion and the microcredits remainder are\n * computed in the bigint domain, then the remainder is zero-padded to\n * six digits and trailing fractional zeros are trimmed. Whole-credit\n * balances render without a redundant `.000000` suffix.\n *\n * @not-instrumented\n */\n// eslint-disable-next-line custom-rules/require-single-object-param -- single bigint arg; named-arg ceremony would not improve clarity\nexport const formatMicrocreditsAsCredits = (microcredits: bigint): string => {\n const credits = microcredits / MICROCREDITS_PER_CREDIT_BIGINT;\n const remainder = microcredits % MICROCREDITS_PER_CREDIT_BIGINT;\n const fractional = remainder\n .toString()\n .padStart(MICROCREDIT_DECIMAL_DIGITS, '0')\n .replace(TRAILING_ZEROS_PATTERN, '');\n return fractional.length > 0 ? `${credits}.${fractional}` : `${credits}`;\n};\n","const U64_PRIVATE_SUFFIX = 'u64.private';\nconst U64_SUFFIX = 'u64';\n\n/**\n * Parse an Aleo VM mapping plaintext literal into microcredits.\n *\n * Accepts the shapes the Aleo `account` mapping endpoint actually\n * emits — e.g. `1500000u64.private`, `1_500_000u64`, or a bare integer\n * wrapped in JSON quotes. Strips the trailing `u64` / `u64.private`\n * type suffix, surrounding quotes, and the cosmetic `_` group\n * separators Aleo plaintext literals allow.\n *\n * Returns `0n` for empty input and for any payload that doesn't parse\n * as an integer. `BigInt()` throws `SyntaxError` on anything that\n * isn't a parseable integer — a corrupted RPC response, a mid-flight\n * truncation, or an upstream API change could deliver such a payload,\n * and we'd rather show a zero balance than crash the network-provider\n * machinery with an unhandled rejection.\n *\n * @not-instrumented\n */\n// eslint-disable-next-line custom-rules/require-single-object-param -- single string arg; named-arg ceremony would not improve clarity\nexport const parseAleoMicrocreditsLiteral = (raw: string): bigint => {\n let cleaned = raw.trim();\n if (cleaned.startsWith('\"') && cleaned.endsWith('\"')) {\n cleaned = cleaned.slice(1, -1);\n }\n if (cleaned.endsWith(U64_PRIVATE_SUFFIX)) {\n cleaned = cleaned.slice(0, -U64_PRIVATE_SUFFIX.length);\n } else if (cleaned.endsWith(U64_SUFFIX)) {\n cleaned = cleaned.slice(0, -U64_SUFFIX.length);\n }\n cleaned = cleaned.split('_').join('').trim();\n if (!cleaned) return BigInt(0);\n try {\n return BigInt(cleaned);\n } catch {\n return BigInt(0);\n }\n};\n","import type { NetworkData } from '@dynamic-labs-sdk/client';\n\nimport { formatMicrocreditsAsCredits } from '../formatMicrocreditsAsCredits';\nimport { parseAleoMicrocreditsLiteral } from '../parseAleoMicrocreditsLiteral';\n\ntype FetchAleoBalanceParams = {\n address: string;\n networkData: NetworkData;\n};\n\n/**\n * Aleo addresses are bech32-encoded — lowercase alphanumerics only — so we\n * can validate strictly. Refusing anything else before it reaches the URL\n * keeps `/`, `?`, `#`, `..`, etc. out of the request path (SSRF / path\n * injection defence).\n */\nconst ALEO_ADDRESS_PATTERN = /^aleo1[a-z0-9]{1,62}$/;\n\n/**\n * Fetches the public credits balance for an Aleo address by querying the\n * `account` mapping on `credits.aleo` via the network's HTTP RPC. Returns\n * the balance as a credits string (private records are not visible here —\n * they live on the wallet and require a connected adapter to enumerate).\n *\n * Returns `null` when the address is malformed or no RPC URL is\n * configured; returns `'0'` for any other failure mode (non-OK status,\n * empty body, `null` mapping, unparseable payload). This keeps the\n * function fail-soft for the network-provider machinery, which surfaces\n * the result directly to the UI.\n *\n * @not-instrumented\n */\nexport const fetchAleoBalance = async ({\n address,\n networkData,\n}: FetchAleoBalanceParams): Promise<string | null> => {\n if (!ALEO_ADDRESS_PATTERN.test(address)) {\n return null;\n }\n\n const baseUrl = networkData.rpcUrls.http[0];\n if (!baseUrl) {\n return null;\n }\n\n const base = baseUrl.endsWith('/') ? baseUrl : `${baseUrl}/`;\n const url = new URL(\n `program/credits.aleo/mapping/account/${encodeURIComponent(address)}`,\n base\n );\n const response = await fetch(url.toString());\n if (!response.ok) {\n return '0';\n }\n\n const text = await response.text();\n if (!text || text === 'null') {\n return '0';\n }\n\n const microcredits = parseAleoMicrocreditsLiteral(text);\n if (microcredits <= BigInt(0)) {\n return '0';\n }\n\n return formatMicrocreditsAsCredits(microcredits);\n};\n","import type { NetworkData } from '@dynamic-labs-sdk/client';\nimport { createBaseNetworkProvider } from '@dynamic-labs-sdk/client/core';\n\nimport type { AleoNetworkProvider } from '../../AleoNetworkProvider.types';\nimport { fetchAleoBalance } from '../fetchAleoBalance';\n\n/**\n * Build an `AleoNetworkProvider` bound to a specific `NetworkData`\n * (mainnet vs. testnet — anything the SDK config exposes). The provider\n * exposes a `getBalance({ address })` that proxies to\n * `fetchAleoBalance` over the configured RPC, returning public credits\n * only (private records require a connected wallet adapter).\n *\n * Called by `registerAleoNetworkProviderBuilder` — not invoked directly.\n *\n * @not-instrumented\n */\n \nexport const createAleoNetworkProvider = (\n networkData: NetworkData\n): AleoNetworkProvider => ({\n ...createBaseNetworkProvider('ALEO', networkData),\n getBalance: async ({ address }) => ({\n balance: await fetchAleoBalance({\n address,\n networkData,\n }),\n }),\n});\n","import type { DynamicClient } from '@dynamic-labs-sdk/client';\nimport { getNetworkProviderBuilderRegistry } from '@dynamic-labs-sdk/client/core';\n\nimport { createAleoNetworkProvider } from '../utils/createAleoNetworkProvider';\n\n/**\n * Register the Aleo network-provider builder on a Dynamic client.\n *\n * Wires `createAleoNetworkProvider` into the client's network-provider\n * builder registry under the `'ALEO'` chain key, which is how the SDK's\n * network machinery materializes a per-network provider on demand.\n * Idempotent — a second call is a no-op once the builder is registered.\n *\n * Internal: called by the Aleo extension entry points\n * (`addAleoWalletStandardExtension`, `addAleoWalletAdaptersExtension`,\n * `addAleoExtension`). Not exported from the package's public surface.\n *\n * @not-instrumented\n */\nexport const registerAleoNetworkProviderBuilder = (\n client: DynamicClient\n): void => {\n const networkProviderBuilderRegistry =\n getNetworkProviderBuilderRegistry(client);\n\n if (networkProviderBuilderRegistry.get().get('ALEO')) {\n return;\n }\n\n networkProviderBuilderRegistry.register({\n builder: createAleoNetworkProvider,\n chain: 'ALEO',\n });\n};\n","/**\n * The `window` keys at which known Aleo Wallet Standard wallets inject\n * themselves. Scanned by `addAleoWalletStandardExtension` to discover\n * available wallets — analogous to EVM's hardcoded `'ethereum'` path in\n * `getEvmInjectedProviders`, or Tron's hardcoded adapter constructors\n * in `addTronWalletAdaptersExtension`.\n *\n * As new wallets adopt `@provablehq/aleo-wallet-standard`, add their\n * injection key here. Wallets that use the legacy adapter API\n * (`@provablehq/aleo-wallet-adaptor-core` — Leo, Puzzle, Fox, etc.) are\n * registered through `addAleoWalletAdaptersExtension` instead.\n */\nexport const ALEO_STANDARD_WALLET_WINDOW_KEYS: readonly string[] = ['shield'];\n","type BytesToHexParams = {\n bytes: Uint8Array;\n};\n\n/**\n * Encode a `Uint8Array` as a lowercase hex string with no separator.\n * Used to render Aleo signature bytes for the `signMessage` provider\n * surface (which yields a hex `signature: string` per the Dynamic\n * `WalletProvider` contract) and any other place we need a stable\n * compact bytes-to-text encoding.\n *\n * @not-instrumented\n */\nexport const bytesToHex = ({ bytes }: BytesToHexParams): string =>\n Array.from(bytes, (b) => b.toString(16).padStart(2, '0')).join('');\n","import {\n ALEO_CHAINS,\n type AleoChain,\n} from '@provablehq/aleo-wallet-standard';\n\nimport { ALEO_MAINNET_NETWORK_ID } from '../../../utils/constants';\n\ntype AleoChainForChainIdParams = {\n /**\n * The Dynamic numeric chain id, as a string. `'0'` is mainnet;\n * anything else is treated as testnet.\n */\n networkId: string;\n};\n\n/**\n * Inverse of `chainIdForAleoChain` — resolve the Aleo Wallet Standard\n * chain string for a Dynamic numeric chain id. Used by the\n * walletStandard provider's `switchActiveNetwork` to translate the\n * SDK's stringly-typed chain id into the wallet's expected `AleoChain`\n * value.\n *\n * @not-instrumented\n */\nexport const aleoChainForChainId = ({\n networkId,\n}: AleoChainForChainIdParams): AleoChain =>\n Number(networkId) === ALEO_MAINNET_NETWORK_ID\n ? (ALEO_CHAINS.MAINNET as AleoChain)\n : (ALEO_CHAINS.TESTNET as AleoChain);\n","import { Network } from '@provablehq/aleo-types';\nimport {\n ALEO_CHAINS,\n type AleoChain,\n} from '@provablehq/aleo-wallet-standard';\n\nimport { ALEO_NETWORK_TO_ID_MAP } from '../../../utils/getNetworkByChainId';\n\ntype ChainIdForAleoChainParams = {\n /**\n * The Aleo Wallet Standard `AleoChain` string (`'aleo:mainnet'` /\n * `'aleo:testnet'`), or `undefined` when the wallet exposed no\n * CHAINS feature.\n */\n chain: AleoChain | undefined;\n};\n\n/**\n * Resolve the Dynamic numeric chain id for an Aleo Wallet Standard chain\n * string. `undefined` is treated as MAINNET to match\n * `createWalletProviderFromAleoStandardWallet`'s `connect()` default —\n * otherwise the SDK would report a different network than the one the\n * wallet was actually connected to.\n *\n * @not-instrumented\n */\nexport const chainIdForAleoChain = ({\n chain,\n}: ChainIdForAleoChainParams): string => {\n if (chain === ALEO_CHAINS.MAINNET || chain === undefined) {\n return String(ALEO_NETWORK_TO_ID_MAP[Network.MAINNET]);\n }\n return String(ALEO_NETWORK_TO_ID_MAP[Network.TESTNET]);\n};\n","type NormalizeAleoStandardWalletAccountParams = {\n /**\n * An Aleo Wallet Standard account entry as returned by\n * `wallet.features['standard:accounts'].getAccounts()`. Wallets may\n * emit either a plain address string (older drafts of the spec) or a\n * `{ address: string }` object (current spec) — this normalizer\n * accepts both.\n */\n account: { address: string } | string;\n};\n\n/**\n * Reduce either string-form or object-form Aleo Wallet Standard\n * account entries to the bare address string the Dynamic SDK works\n * with.\n *\n * @not-instrumented\n */\nexport const normalizeAleoStandardWalletAccount = ({\n account,\n}: NormalizeAleoStandardWalletAccountParams): string =>\n typeof account === 'string' ? account : account.address;\n","import {\n type Chain,\n type DynamicClient,\n type WalletProviderMetadata,\n assertWalletAccountSigningAvailability,\n} from '@dynamic-labs-sdk/client';\nimport {\n assertDefined,\n formatWalletProviderGroupKey,\n formatWalletProviderKey,\n} from '@dynamic-labs-sdk/client/core';\nimport { WalletProviderEnum } from '@dynamic-labs/sdk-api-core';\nimport { Network } from '@provablehq/aleo-types';\nimport {\n ALEO_CHAINS,\n type AleoChain,\n WalletDecryptPermission,\n WalletFeatureName,\n} from '@provablehq/aleo-wallet-standard';\n\nimport type {\n AleoTransaction,\n AleoWalletProvider,\n} from '../../../AleoWalletProvider.types';\nimport { AleoFeatureUnsupportedError } from '../../../errors/AleoFeatureUnsupportedError';\nimport { bytesToHex } from '../../../utils/bytesToHex';\nimport type { TypedStandardWallet } from '../../AleoStandardWallet.types';\nimport { aleoChainForChainId } from '../aleoChainForChainId';\nimport { chainIdForAleoChain } from '../chainIdForAleoChain';\nimport { normalizeAleoStandardWalletAccount } from '../normalizeAleoStandardWalletAccount';\n\ntype CreateWalletProviderFromAleoStandardWalletParams = {\n dynamicClient: DynamicClient;\n walletStandardWallet: TypedStandardWallet;\n};\n\n/**\n * Translate an Aleo StandardWallet (feature-map API) into a Dynamic\n * `WalletProvider`. Unsupported features fall through as undefined methods\n * on the returned provider — callers should guard accordingly.\n *\n * @not-instrumented\n */\nexport const createWalletProviderFromAleoStandardWallet = ({\n dynamicClient,\n walletStandardWallet,\n}: CreateWalletProviderFromAleoStandardWalletParams): AleoWalletProvider => {\n const chain: Chain = 'ALEO';\n\n const displayName = walletStandardWallet.name;\n\n const metadata: WalletProviderMetadata = {\n displayName,\n icon: walletStandardWallet.icon ?? '',\n };\n\n const walletProviderType = WalletProviderEnum.BrowserExtension;\n\n const key = formatWalletProviderKey({\n chain,\n displayName,\n walletProviderType,\n });\n\n const connect: AleoWalletProvider['connect'] = async () => {\n const connectFeature =\n walletStandardWallet.features[WalletFeatureName.CONNECT];\n if (!connectFeature?.available) {\n throw new AleoFeatureUnsupportedError({\n featureName: 'connect',\n walletName: displayName,\n });\n }\n\n const chainsFeature =\n walletStandardWallet.features[WalletFeatureName.CHAINS];\n const initialChain: AleoChain =\n chainsFeature?.available && chainsFeature.chains[0]\n ? chainsFeature.chains[0]\n : (ALEO_CHAINS.MAINNET as AleoChain);\n\n await connectFeature.connect(\n initialChain,\n WalletDecryptPermission.UponRequest\n );\n\n const accountsFeature =\n walletStandardWallet.features[WalletFeatureName.ACCOUNTS];\n const rawAccounts = accountsFeature?.available\n ? await accountsFeature.getAccounts()\n : [];\n\n return {\n addresses: rawAccounts.map((account) => ({\n address: normalizeAleoStandardWalletAccount({ account }),\n })),\n };\n };\n\n const destroy: AleoWalletProvider['destroy'] = async () => {\n const connectFeature =\n walletStandardWallet.features[WalletFeatureName.CONNECT];\n if (!connectFeature?.available) {\n return;\n }\n try {\n await connectFeature.disconnect();\n } catch {\n // Best-effort: the wallet may already be disconnected, or the\n // underlying call may fail for transient reasons. Per the\n // WalletProvider contract, `destroy` should not block teardown\n // on remote-signal errors.\n }\n };\n\n const getActiveNetworkId: AleoWalletProvider['getActiveNetworkId'] =\n async () => {\n const chainsFeature =\n walletStandardWallet.features[WalletFeatureName.CHAINS];\n const activeChain = chainsFeature?.available\n ? chainsFeature.chains[0]\n : undefined;\n return { networkId: chainIdForAleoChain({ chain: activeChain }) };\n };\n\n const getConnectedAddresses: AleoWalletProvider['getConnectedAddresses'] =\n async () => {\n const accountsFeature =\n walletStandardWallet.features[WalletFeatureName.ACCOUNTS];\n if (!accountsFeature?.available) {\n return { addresses: [] };\n }\n const accounts = await accountsFeature.getAccounts();\n return {\n addresses: accounts.map((account) =>\n normalizeAleoStandardWalletAccount({ account })\n ),\n };\n };\n\n const signMessage: AleoWalletProvider['signMessage'] = async ({\n message,\n walletAccount,\n }) => {\n assertDefined(walletAccount, 'Wallet account not found');\n await assertWalletAccountSigningAvailability(\n { walletAccount },\n dynamicClient\n );\n\n const signFeature =\n walletStandardWallet.features[WalletFeatureName.SIGN];\n if (!signFeature?.available) {\n throw new AleoFeatureUnsupportedError({\n featureName: 'signMessage',\n walletName: displayName,\n });\n }\n\n const signatureBytes = await signFeature.signMessage(\n new TextEncoder().encode(message)\n );\n return { signature: bytesToHex({ bytes: signatureBytes }) };\n };\n\n const switchActiveNetwork: AleoWalletProvider['switchActiveNetwork'] =\n async ({ networkId }) => {\n const switchFeature =\n walletStandardWallet.features[WalletFeatureName.SWITCH_NETWORK];\n if (!switchFeature?.available) {\n throw new AleoFeatureUnsupportedError({\n featureName: 'switchNetwork',\n walletName: displayName,\n });\n }\n\n const targetAleoChain = aleoChainForChainId({ networkId });\n const network: Network =\n targetAleoChain === ALEO_CHAINS.MAINNET\n ? Network.MAINNET\n : Network.TESTNET;\n await switchFeature.switchNetwork(network);\n };\n\n const requestTransaction: AleoWalletProvider['requestTransaction'] = async ({\n transaction,\n walletAccount,\n }) => {\n assertDefined(walletAccount, 'Wallet account not found');\n await assertWalletAccountSigningAvailability(\n { walletAccount },\n dynamicClient\n );\n\n const executeFeature =\n walletStandardWallet.features[WalletFeatureName.EXECUTE];\n if (!executeFeature?.available) {\n throw new AleoFeatureUnsupportedError({\n featureName: 'executeTransaction',\n walletName: displayName,\n });\n }\n\n const aleoTransaction: AleoTransaction = transaction;\n const [transition] = aleoTransaction.transitions;\n assertDefined(transition, 'Transaction must have at least one transition');\n\n const { transactionId } = await executeFeature.executeTransaction({\n fee: aleoTransaction.fee,\n function: transition.functionName,\n inputs: transition.inputs as string[],\n privateFee: aleoTransaction.feePrivate,\n program: transition.program,\n });\n\n return { transactionId };\n };\n\n const decrypt: AleoWalletProvider['decrypt'] = async ({\n ciphertext,\n options,\n walletAccount,\n }) => {\n assertDefined(walletAccount, 'Wallet account not found');\n\n const decryptFeature =\n walletStandardWallet.features[WalletFeatureName.DECRYPT];\n if (!decryptFeature?.available) {\n throw new AleoFeatureUnsupportedError({\n featureName: 'decrypt',\n walletName: displayName,\n });\n }\n\n const plaintext = await decryptFeature.decrypt(\n ciphertext,\n options?.tpk,\n options?.programId,\n options?.functionName,\n options?.index\n );\n return { plaintext };\n };\n\n const requestRecords: AleoWalletProvider['requestRecords'] = async ({\n program,\n options,\n walletAccount,\n }) => {\n assertDefined(walletAccount, 'Wallet account not found');\n\n const recordsFeature =\n walletStandardWallet.features[WalletFeatureName.REQUEST_RECORDS];\n if (!recordsFeature?.available) {\n throw new AleoFeatureUnsupportedError({\n featureName: 'requestRecords',\n walletName: displayName,\n });\n }\n\n const records = await recordsFeature.requestRecords(\n program,\n options?.plaintext ?? false\n );\n return { records };\n };\n\n return {\n chain,\n connect,\n decrypt,\n destroy,\n getActiveNetworkId,\n getConnectedAddresses,\n groupKey: formatWalletProviderGroupKey(displayName),\n key,\n metadata,\n requestRecords,\n requestTransaction,\n signMessage,\n switchActiveNetwork,\n walletProviderType,\n };\n};\n","import type { TypedStandardWallet } from '../../AleoStandardWallet.types';\n\n/**\n * Type guard for an Aleo Wallet Standard wallet injected on the page —\n * checks the minimum shape we need (an object with a `features` map)\n * before we hand it to `createWalletProviderFromAleoStandardWallet`.\n *\n * Used to filter the candidate list returned by\n * `getAllProvidersFromWindow` (which can return anything sitting at the\n * configured window key, including the wallet's own `.providers`\n * sibling for EIP-5749-style multi-wallet injections).\n *\n * @not-instrumented\n */\n \nexport const isAleoStandardWallet = (\n value: unknown\n): value is TypedStandardWallet =>\n typeof value === 'object' &&\n value !== null &&\n 'features' in value &&\n typeof (value as Record<string, unknown>).features === 'object';\n","import {\n WalletProviderPriority,\n getAllProvidersFromWindow,\n getDefaultClient,\n getWalletProviderRegistry,\n hasExtension,\n registerExtension,\n} from '@dynamic-labs-sdk/client/core';\n\nimport { registerAleoNetworkProviderBuilder } from '../../registerAleoNetworkProviderBuilder';\nimport { ALEO_STANDARD_WALLET_WINDOW_KEYS } from '../aleoStandardWalletWindowKeys';\nimport { createWalletProviderFromAleoStandardWallet } from '../utils/createWalletProviderFromAleoStandardWallet';\nimport { isAleoStandardWallet } from '../utils/isAleoStandardWallet';\n\nexport const ALEO_WALLET_STANDARD_EXTENSION_KEY = 'aleoWalletStandard';\n\n/**\n * Adds the Aleo Wallet Standard extension to the Dynamic client.\n *\n * Scans `window` at each of the known Aleo Wallet Standard injection\n * keys (see `ALEO_STANDARD_WALLET_WINDOW_KEYS`) via the shared\n * `getAllProvidersFromWindow` helper, wraps every found wallet as a\n * Dynamic `WalletProvider`, and registers it. The caller doesn't\n * enumerate wallets — same shape as EVM's\n * `addEvmWindowInjectedExtension` and Tron's\n * `addTronWalletAdaptersExtension`.\n *\n * @param [client] - The Dynamic client instance. Only required when\n * using multiple Dynamic clients.\n * @not-instrumented\n */\nexport const addAleoWalletStandardExtension = (\n client = getDefaultClient()\n): void => {\n if (\n hasExtension({ extensionKey: ALEO_WALLET_STANDARD_EXTENSION_KEY }, client)\n ) {\n return;\n }\n\n registerExtension(\n { extensionKey: ALEO_WALLET_STANDARD_EXTENSION_KEY },\n client\n );\n\n registerAleoNetworkProviderBuilder(client);\n\n const walletProviderRegistry = getWalletProviderRegistry(client);\n\n ALEO_STANDARD_WALLET_WINDOW_KEYS.forEach((windowKey) => {\n const candidates = getAllProvidersFromWindow<unknown>(windowKey);\n\n candidates.filter(isAleoStandardWallet).forEach((walletStandardWallet) => {\n const walletProvider = createWalletProviderFromAleoStandardWallet({\n dynamicClient: client,\n walletStandardWallet,\n });\n\n walletProviderRegistry.register({\n priority: WalletProviderPriority.WINDOW_INJECT,\n walletProvider,\n });\n });\n });\n};\n","import { assertPackageVersion } from '@dynamic-labs-sdk/assert-package-version';\n\nimport {\n name as packageName,\n version as packageVersion,\n} from '../../package.json';\nassertPackageVersion(packageName, packageVersion);\n\nexport {\n ALEO_WALLET_STANDARD_EXTENSION_KEY,\n addAleoWalletStandardExtension,\n} from '../walletStandard/addAleoWalletStandardExtension';\nexport { ALEO_STANDARD_WALLET_WINDOW_KEYS } from '../walletStandard/aleoStandardWalletWindowKeys';\nexport { createWalletProviderFromAleoStandardWallet } from '../walletStandard/utils/createWalletProviderFromAleoStandardWallet';\nexport type { TypedStandardWallet } from '../walletStandard/AleoStandardWallet.types';\n"],"mappings":";;;;;;;;;AAEA,MAAM,iCAAiC,OAAOA,oDAAwB;AACtE,MAAM,6BAA6B,OAAOA,oDAAwB,CAAC,SAAS;;;;;;;AAQ5E,MAAM,yBAAyB;;;;;;;;;;;;AAc/B,MAAa,+BAA+B,iBAAiC;CAC3E,MAAM,UAAU,eAAe;CAE/B,MAAM,cADY,eAAe,gCAE9B,UAAU,CACV,SAAS,4BAA4B,IAAI,CACzC,QAAQ,wBAAwB,GAAG;AACtC,QAAO,WAAW,SAAS,IAAI,GAAG,QAAQ,GAAG,eAAe,GAAG;;;;;AChCjE,MAAM,qBAAqB;AAC3B,MAAM,aAAa;;;;;;;;;;;;;;;;;;;AAqBnB,MAAa,gCAAgC,QAAwB;CACnE,IAAI,UAAU,IAAI,MAAM;AACxB,KAAI,QAAQ,WAAW,KAAI,IAAI,QAAQ,SAAS,KAAI,CAClD,WAAU,QAAQ,MAAM,GAAG,GAAG;AAEhC,KAAI,QAAQ,SAAS,mBAAmB,CACtC,WAAU,QAAQ,MAAM,GAAG,IAA2B;UAC7C,QAAQ,SAAS,WAAW,CACrC,WAAU,QAAQ,MAAM,GAAG,GAAmB;AAEhD,W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