@solana/client 0.2.3 → 1.0.0-rc.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/index.browser.cjs +440 -376
- package/dist/index.browser.cjs.map +1 -1
- package/dist/index.browser.mjs +438 -377
- package/dist/index.browser.mjs.map +1 -1
- package/dist/index.native.mjs +438 -377
- package/dist/index.native.mjs.map +1 -1
- package/dist/index.node.cjs +440 -376
- package/dist/index.node.cjs.map +1 -1
- package/dist/index.node.mjs +438 -377
- package/dist/index.node.mjs.map +1 -1
- package/dist/server/index.node.cjs +15 -2
- package/dist/server/index.node.cjs.map +1 -1
- package/dist/server/index.node.mjs +15 -2
- package/dist/server/index.node.mjs.map +1 -1
- package/dist/types/client/createClient.d.ts.map +1 -1
- package/dist/types/client/defaultClient.d.ts +26 -0
- package/dist/types/client/defaultClient.d.ts.map +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/types.d.ts +6 -2
- package/dist/types/types.d.ts.map +1 -1
- package/dist/types/utils/cluster.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.browser.mjs
CHANGED
|
@@ -281,6 +281,69 @@ function subscribeSolanaState(client, listener) {
|
|
|
281
281
|
}
|
|
282
282
|
__name(subscribeSolanaState, "subscribeSolanaState");
|
|
283
283
|
|
|
284
|
+
// src/utils/cluster.ts
|
|
285
|
+
function ensureHttpProtocol(endpoint) {
|
|
286
|
+
if (endpoint.startsWith("http://") || endpoint.startsWith("https://") || endpoint.startsWith("ws://") || endpoint.startsWith("wss://")) {
|
|
287
|
+
return endpoint;
|
|
288
|
+
}
|
|
289
|
+
return `https://${endpoint}`;
|
|
290
|
+
}
|
|
291
|
+
__name(ensureHttpProtocol, "ensureHttpProtocol");
|
|
292
|
+
var MONIKER_ENDPOINTS = {
|
|
293
|
+
devnet: {
|
|
294
|
+
endpoint: "https://api.devnet.solana.com",
|
|
295
|
+
websocketEndpoint: "wss://api.devnet.solana.com"
|
|
296
|
+
},
|
|
297
|
+
localhost: {
|
|
298
|
+
endpoint: "http://127.0.0.1:8899",
|
|
299
|
+
websocketEndpoint: "ws://127.0.0.1:8900"
|
|
300
|
+
},
|
|
301
|
+
localnet: {
|
|
302
|
+
endpoint: "http://127.0.0.1:8899",
|
|
303
|
+
websocketEndpoint: "ws://127.0.0.1:8900"
|
|
304
|
+
},
|
|
305
|
+
"mainnet-beta": {
|
|
306
|
+
endpoint: "https://api.mainnet-beta.solana.com",
|
|
307
|
+
websocketEndpoint: "wss://api.mainnet-beta.solana.com"
|
|
308
|
+
},
|
|
309
|
+
mainnet: {
|
|
310
|
+
endpoint: "https://api.mainnet-beta.solana.com",
|
|
311
|
+
websocketEndpoint: "wss://api.mainnet-beta.solana.com"
|
|
312
|
+
},
|
|
313
|
+
testnet: {
|
|
314
|
+
endpoint: "https://api.testnet.solana.com",
|
|
315
|
+
websocketEndpoint: "wss://api.testnet.solana.com"
|
|
316
|
+
}
|
|
317
|
+
};
|
|
318
|
+
function inferWebsocketEndpoint(endpoint) {
|
|
319
|
+
if (endpoint.startsWith("https://")) {
|
|
320
|
+
return endpoint.replace("https://", "wss://");
|
|
321
|
+
}
|
|
322
|
+
if (endpoint.startsWith("http://")) {
|
|
323
|
+
return endpoint.replace("http://", "ws://");
|
|
324
|
+
}
|
|
325
|
+
if (endpoint.startsWith("ws://") || endpoint.startsWith("wss://")) {
|
|
326
|
+
return endpoint;
|
|
327
|
+
}
|
|
328
|
+
return endpoint;
|
|
329
|
+
}
|
|
330
|
+
__name(inferWebsocketEndpoint, "inferWebsocketEndpoint");
|
|
331
|
+
function resolveCluster(config) {
|
|
332
|
+
const moniker = config.moniker ?? (config.endpoint ? "custom" : "devnet");
|
|
333
|
+
const mapped = moniker === "custom" ? void 0 : MONIKER_ENDPOINTS[moniker];
|
|
334
|
+
const endpoint = ensureHttpProtocol(config.endpoint ?? mapped?.endpoint);
|
|
335
|
+
const rawWebsocket = config.websocketEndpoint ? ensureHttpProtocol(config.websocketEndpoint) : void 0;
|
|
336
|
+
const websocketEndpoint = inferWebsocketEndpoint(
|
|
337
|
+
rawWebsocket ?? mapped?.websocketEndpoint ?? endpoint
|
|
338
|
+
);
|
|
339
|
+
return {
|
|
340
|
+
endpoint,
|
|
341
|
+
moniker,
|
|
342
|
+
websocketEndpoint
|
|
343
|
+
};
|
|
344
|
+
}
|
|
345
|
+
__name(resolveCluster, "resolveCluster");
|
|
346
|
+
|
|
284
347
|
// src/wallet/registry.ts
|
|
285
348
|
function createWalletRegistry(connectors) {
|
|
286
349
|
const byId = /* @__PURE__ */ new Map();
|
|
@@ -2129,18 +2192,22 @@ __name(createWatchers, "createWatchers");
|
|
|
2129
2192
|
// src/client/createClient.ts
|
|
2130
2193
|
function createClient(config) {
|
|
2131
2194
|
const hydratedConfig = config.initialState ? applySerializableState(config, config.initialState) : config;
|
|
2195
|
+
const resolvedCluster = resolveCluster({
|
|
2196
|
+
endpoint: hydratedConfig.rpc ?? hydratedConfig.endpoint,
|
|
2197
|
+
moniker: hydratedConfig.cluster,
|
|
2198
|
+
websocketEndpoint: hydratedConfig.websocket ?? hydratedConfig.websocketEndpoint
|
|
2199
|
+
});
|
|
2132
2200
|
const commitment = hydratedConfig.commitment ?? "confirmed";
|
|
2133
|
-
const websocketEndpoint = hydratedConfig.websocketEndpoint ?? hydratedConfig.endpoint;
|
|
2134
2201
|
const initialState = createInitialClientState({
|
|
2135
2202
|
commitment,
|
|
2136
|
-
endpoint:
|
|
2137
|
-
websocketEndpoint
|
|
2203
|
+
endpoint: resolvedCluster.endpoint,
|
|
2204
|
+
websocketEndpoint: resolvedCluster.websocketEndpoint
|
|
2138
2205
|
});
|
|
2139
2206
|
const store = config.createStore ? config.createStore(initialState) : createClientStore(initialState);
|
|
2140
2207
|
const rpcClient = hydratedConfig.rpcClient ?? createSolanaRpcClient({
|
|
2141
2208
|
commitment,
|
|
2142
|
-
endpoint:
|
|
2143
|
-
websocketEndpoint
|
|
2209
|
+
endpoint: resolvedCluster.endpoint,
|
|
2210
|
+
websocketEndpoint: resolvedCluster.websocketEndpoint
|
|
2144
2211
|
});
|
|
2145
2212
|
const runtime = {
|
|
2146
2213
|
rpc: rpcClient.rpc,
|
|
@@ -2159,7 +2226,10 @@ function createClient(config) {
|
|
|
2159
2226
|
},
|
|
2160
2227
|
lastUpdatedAt: now()
|
|
2161
2228
|
}));
|
|
2162
|
-
actions.setCluster(
|
|
2229
|
+
actions.setCluster(resolvedCluster.endpoint, {
|
|
2230
|
+
commitment,
|
|
2231
|
+
websocketEndpoint: resolvedCluster.websocketEndpoint
|
|
2232
|
+
}).catch(
|
|
2163
2233
|
(error) => logger({
|
|
2164
2234
|
data: formatError(error),
|
|
2165
2235
|
level: "error",
|
|
@@ -2197,104 +2267,382 @@ function createClient(config) {
|
|
|
2197
2267
|
};
|
|
2198
2268
|
}
|
|
2199
2269
|
__name(createClient, "createClient");
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2270
|
+
var base58Decoder = getBase58Decoder();
|
|
2271
|
+
var transactionDecoder = getTransactionDecoder();
|
|
2272
|
+
var transactionEncoder = getTransactionEncoder();
|
|
2273
|
+
function deriveConnectorId(wallet) {
|
|
2274
|
+
const kebab = wallet.name.toLowerCase().replace(/[^a-z0-9]+/g, "-");
|
|
2275
|
+
return `wallet-standard:${kebab}`;
|
|
2204
2276
|
}
|
|
2205
|
-
__name(
|
|
2206
|
-
function
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2277
|
+
__name(deriveConnectorId, "deriveConnectorId");
|
|
2278
|
+
function getPrimaryAccount(accounts) {
|
|
2279
|
+
const primary = accounts[0];
|
|
2280
|
+
if (!primary) {
|
|
2281
|
+
throw new Error("Wallet returned no accounts.");
|
|
2282
|
+
}
|
|
2283
|
+
return primary;
|
|
2212
2284
|
}
|
|
2213
|
-
__name(
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
const authority = input.authority ?? resolveDefault?.();
|
|
2218
|
-
if (!authority) {
|
|
2219
|
-
throw new Error("Connect a wallet or supply an `authority` before sending SOL transfers.");
|
|
2285
|
+
__name(getPrimaryAccount, "getPrimaryAccount");
|
|
2286
|
+
function mapCommitment(commitment) {
|
|
2287
|
+
if (commitment === "processed" || commitment === "confirmed" || commitment === "finalized") {
|
|
2288
|
+
return commitment;
|
|
2220
2289
|
}
|
|
2290
|
+
return void 0;
|
|
2291
|
+
}
|
|
2292
|
+
__name(mapCommitment, "mapCommitment");
|
|
2293
|
+
function toSessionAccount(walletAccount) {
|
|
2221
2294
|
return {
|
|
2222
|
-
|
|
2223
|
-
|
|
2295
|
+
address: address(walletAccount.address),
|
|
2296
|
+
label: walletAccount.label,
|
|
2297
|
+
publicKey: new Uint8Array(walletAccount.publicKey)
|
|
2224
2298
|
};
|
|
2225
2299
|
}
|
|
2226
|
-
__name(
|
|
2227
|
-
function
|
|
2228
|
-
const
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
}
|
|
2237
|
-
__name(notify, "notify");
|
|
2238
|
-
function setState(next) {
|
|
2239
|
-
state = next;
|
|
2240
|
-
notify();
|
|
2300
|
+
__name(toSessionAccount, "toSessionAccount");
|
|
2301
|
+
function getChain(account) {
|
|
2302
|
+
const [preferred] = account.chains ?? [];
|
|
2303
|
+
return preferred;
|
|
2304
|
+
}
|
|
2305
|
+
__name(getChain, "getChain");
|
|
2306
|
+
async function disconnectWallet2(wallet) {
|
|
2307
|
+
const disconnectFeature = wallet.features[StandardDisconnect];
|
|
2308
|
+
if (disconnectFeature) {
|
|
2309
|
+
await disconnectFeature.disconnect();
|
|
2241
2310
|
}
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2311
|
+
}
|
|
2312
|
+
__name(disconnectWallet2, "disconnectWallet");
|
|
2313
|
+
function createWalletStandardConnector(wallet, options = {}) {
|
|
2314
|
+
const metadata = {
|
|
2315
|
+
canAutoConnect: options.canAutoConnect ?? Boolean(wallet.features[StandardConnect]),
|
|
2316
|
+
icon: options.icon ?? wallet.icon,
|
|
2317
|
+
id: options.id ?? deriveConnectorId(wallet),
|
|
2318
|
+
kind: options.kind ?? "wallet-standard",
|
|
2319
|
+
name: options.name ?? wallet.name,
|
|
2320
|
+
ready: typeof window !== "undefined"
|
|
2321
|
+
};
|
|
2322
|
+
async function connect(connectionOptions = {}) {
|
|
2323
|
+
const connectFeature = wallet.features[StandardConnect];
|
|
2324
|
+
const shouldConnectSilently = Boolean(connectionOptions.autoConnect);
|
|
2325
|
+
let walletAccounts = wallet.accounts;
|
|
2326
|
+
if (connectFeature) {
|
|
2327
|
+
const { accounts } = await connectFeature.connect({
|
|
2328
|
+
silent: shouldConnectSilently || void 0
|
|
2329
|
+
});
|
|
2330
|
+
if (accounts.length) {
|
|
2331
|
+
walletAccounts = accounts;
|
|
2332
|
+
}
|
|
2253
2333
|
}
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2334
|
+
const primaryAccount = getPrimaryAccount(walletAccounts);
|
|
2335
|
+
const sessionAccount = toSessionAccount(primaryAccount);
|
|
2336
|
+
const signMessageFeature = wallet.features[SolanaSignMessage];
|
|
2337
|
+
const signTransactionFeature = wallet.features[SolanaSignTransaction];
|
|
2338
|
+
const signAndSendFeature = wallet.features[SolanaSignAndSendTransaction];
|
|
2339
|
+
const resolvedChain = options.defaultChain ?? getChain(primaryAccount);
|
|
2340
|
+
const signMessage = signMessageFeature ? async (message) => {
|
|
2341
|
+
const [output] = await signMessageFeature.signMessage({
|
|
2342
|
+
account: primaryAccount,
|
|
2343
|
+
message
|
|
2344
|
+
});
|
|
2345
|
+
return output.signature;
|
|
2346
|
+
} : void 0;
|
|
2347
|
+
const signTransaction = signTransactionFeature ? async (transaction) => {
|
|
2348
|
+
const wireBytes = new Uint8Array(transactionEncoder.encode(transaction));
|
|
2349
|
+
const request = resolvedChain ? {
|
|
2350
|
+
account: primaryAccount,
|
|
2351
|
+
chain: resolvedChain,
|
|
2352
|
+
transaction: wireBytes
|
|
2353
|
+
} : {
|
|
2354
|
+
account: primaryAccount,
|
|
2355
|
+
transaction: wireBytes
|
|
2356
|
+
};
|
|
2357
|
+
const [output] = await signTransactionFeature.signTransaction(request);
|
|
2358
|
+
return transactionDecoder.decode(output.signedTransaction);
|
|
2359
|
+
} : void 0;
|
|
2360
|
+
const sendTransaction2 = signAndSendFeature ? async (transaction, config) => {
|
|
2361
|
+
const wireBytes = new Uint8Array(transactionEncoder.encode(transaction));
|
|
2362
|
+
const chain = options.defaultChain ?? getChain(primaryAccount) ?? "solana:mainnet-beta";
|
|
2363
|
+
const [output] = await signAndSendFeature.signAndSendTransaction({
|
|
2364
|
+
account: primaryAccount,
|
|
2365
|
+
chain,
|
|
2366
|
+
options: {
|
|
2367
|
+
commitment: mapCommitment(config?.commitment)
|
|
2368
|
+
},
|
|
2369
|
+
transaction: wireBytes
|
|
2370
|
+
});
|
|
2371
|
+
return base58Decoder.decode(output.signature);
|
|
2372
|
+
} : void 0;
|
|
2373
|
+
async function disconnectSession() {
|
|
2374
|
+
await disconnectWallet2(wallet);
|
|
2375
|
+
}
|
|
2376
|
+
__name(disconnectSession, "disconnectSession");
|
|
2377
|
+
return {
|
|
2378
|
+
account: sessionAccount,
|
|
2379
|
+
connector: metadata,
|
|
2380
|
+
disconnect: disconnectSession,
|
|
2381
|
+
sendTransaction: sendTransaction2,
|
|
2382
|
+
signMessage,
|
|
2383
|
+
signTransaction
|
|
2260
2384
|
};
|
|
2261
2385
|
}
|
|
2262
|
-
__name(
|
|
2263
|
-
function
|
|
2264
|
-
|
|
2265
|
-
}
|
|
2266
|
-
__name(reset, "reset");
|
|
2267
|
-
return {
|
|
2268
|
-
getHelper: /* @__PURE__ */ __name(() => helper, "getHelper"),
|
|
2269
|
-
getState: /* @__PURE__ */ __name(() => state, "getState"),
|
|
2270
|
-
reset,
|
|
2271
|
-
send,
|
|
2272
|
-
subscribe
|
|
2273
|
-
};
|
|
2274
|
-
}
|
|
2275
|
-
__name(createSolTransferController, "createSolTransferController");
|
|
2276
|
-
|
|
2277
|
-
// src/controllers/splTransferController.ts
|
|
2278
|
-
function ensureTransferConfig(input, resolveAuthority, resolveSourceOwner) {
|
|
2279
|
-
const authority = input.authority ?? resolveAuthority?.();
|
|
2280
|
-
if (!authority) {
|
|
2281
|
-
throw new Error("Connect a wallet or supply an `authority` before sending SPL tokens.");
|
|
2386
|
+
__name(connect, "connect");
|
|
2387
|
+
async function disconnect() {
|
|
2388
|
+
await disconnectWallet2(wallet);
|
|
2282
2389
|
}
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2390
|
+
__name(disconnect, "disconnect");
|
|
2391
|
+
function isSupported() {
|
|
2392
|
+
return typeof window !== "undefined";
|
|
2286
2393
|
}
|
|
2394
|
+
__name(isSupported, "isSupported");
|
|
2287
2395
|
return {
|
|
2288
|
-
...
|
|
2289
|
-
|
|
2290
|
-
|
|
2396
|
+
...metadata,
|
|
2397
|
+
connect,
|
|
2398
|
+
disconnect,
|
|
2399
|
+
isSupported
|
|
2291
2400
|
};
|
|
2292
2401
|
}
|
|
2293
|
-
__name(
|
|
2294
|
-
function
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2402
|
+
__name(createWalletStandardConnector, "createWalletStandardConnector");
|
|
2403
|
+
function mapWalletToConnector(wallet, overrides) {
|
|
2404
|
+
return createWalletStandardConnector(wallet, overrides?.(wallet));
|
|
2405
|
+
}
|
|
2406
|
+
__name(mapWalletToConnector, "mapWalletToConnector");
|
|
2407
|
+
function getWalletStandardConnectors(options = {}) {
|
|
2408
|
+
const { get } = getWallets();
|
|
2409
|
+
const connectors = get().map((wallet) => mapWalletToConnector(wallet, options.overrides));
|
|
2410
|
+
const seen = /* @__PURE__ */ new Set();
|
|
2411
|
+
return connectors.filter((connector) => {
|
|
2412
|
+
if (seen.has(connector.id)) {
|
|
2413
|
+
return false;
|
|
2414
|
+
}
|
|
2415
|
+
seen.add(connector.id);
|
|
2416
|
+
return true;
|
|
2417
|
+
});
|
|
2418
|
+
}
|
|
2419
|
+
__name(getWalletStandardConnectors, "getWalletStandardConnectors");
|
|
2420
|
+
function watchWalletStandardConnectors(onChange, options = {}) {
|
|
2421
|
+
const { get, on } = getWallets();
|
|
2422
|
+
const emit = /* @__PURE__ */ __name(() => {
|
|
2423
|
+
const connectors = get().map((wallet) => mapWalletToConnector(wallet, options.overrides));
|
|
2424
|
+
const seen = /* @__PURE__ */ new Set();
|
|
2425
|
+
const deduplicated = connectors.filter((connector) => {
|
|
2426
|
+
if (seen.has(connector.id)) {
|
|
2427
|
+
return false;
|
|
2428
|
+
}
|
|
2429
|
+
seen.add(connector.id);
|
|
2430
|
+
return true;
|
|
2431
|
+
});
|
|
2432
|
+
onChange(deduplicated);
|
|
2433
|
+
}, "emit");
|
|
2434
|
+
emit();
|
|
2435
|
+
const offRegister = on("register", emit);
|
|
2436
|
+
const offUnregister = on("unregister", emit);
|
|
2437
|
+
return () => {
|
|
2438
|
+
offRegister();
|
|
2439
|
+
offUnregister();
|
|
2440
|
+
};
|
|
2441
|
+
}
|
|
2442
|
+
__name(watchWalletStandardConnectors, "watchWalletStandardConnectors");
|
|
2443
|
+
|
|
2444
|
+
// src/wallet/connectors.ts
|
|
2445
|
+
function autoDiscover(options = {}) {
|
|
2446
|
+
const { get } = getWallets();
|
|
2447
|
+
const wallets = get().filter((wallet) => options.filter ? options.filter(wallet) : true);
|
|
2448
|
+
const connectors = wallets.map((wallet) => createWalletStandardConnector(wallet, options.overrides?.(wallet)));
|
|
2449
|
+
const seen = /* @__PURE__ */ new Set();
|
|
2450
|
+
return connectors.filter((connector) => {
|
|
2451
|
+
if (seen.has(connector.id)) return false;
|
|
2452
|
+
seen.add(connector.id);
|
|
2453
|
+
return true;
|
|
2454
|
+
});
|
|
2455
|
+
}
|
|
2456
|
+
__name(autoDiscover, "autoDiscover");
|
|
2457
|
+
function injected(options) {
|
|
2458
|
+
const connector = {
|
|
2459
|
+
canAutoConnect: true,
|
|
2460
|
+
id: "wallet-standard:injected",
|
|
2461
|
+
kind: "wallet-standard",
|
|
2462
|
+
name: "Injected Wallet",
|
|
2463
|
+
ready: typeof window !== "undefined",
|
|
2464
|
+
async connect() {
|
|
2465
|
+
const wallets = getWallets().get();
|
|
2466
|
+
const first = wallets.find((wallet) => StandardConnect in wallet.features);
|
|
2467
|
+
if (!first) {
|
|
2468
|
+
throw new Error("No Wallet Standard wallets available.");
|
|
2469
|
+
}
|
|
2470
|
+
return createWalletStandardConnector(first, options).connect();
|
|
2471
|
+
},
|
|
2472
|
+
async disconnect() {
|
|
2473
|
+
},
|
|
2474
|
+
isSupported() {
|
|
2475
|
+
return typeof window !== "undefined";
|
|
2476
|
+
}
|
|
2477
|
+
};
|
|
2478
|
+
return connector;
|
|
2479
|
+
}
|
|
2480
|
+
__name(injected, "injected");
|
|
2481
|
+
function filterByName(name) {
|
|
2482
|
+
const lower = name.toLowerCase();
|
|
2483
|
+
return (wallet) => wallet.name.toLowerCase().includes(lower);
|
|
2484
|
+
}
|
|
2485
|
+
__name(filterByName, "filterByName");
|
|
2486
|
+
function phantom(options) {
|
|
2487
|
+
return autoDiscover({
|
|
2488
|
+
filter: filterByName("phantom"),
|
|
2489
|
+
overrides: /* @__PURE__ */ __name(() => ({ ...options, id: "wallet-standard:phantom" }), "overrides")
|
|
2490
|
+
});
|
|
2491
|
+
}
|
|
2492
|
+
__name(phantom, "phantom");
|
|
2493
|
+
function solflare(options) {
|
|
2494
|
+
return autoDiscover({
|
|
2495
|
+
filter: filterByName("solflare"),
|
|
2496
|
+
overrides: /* @__PURE__ */ __name(() => ({ ...options, id: "wallet-standard:solflare" }), "overrides")
|
|
2497
|
+
});
|
|
2498
|
+
}
|
|
2499
|
+
__name(solflare, "solflare");
|
|
2500
|
+
function backpack(options) {
|
|
2501
|
+
return autoDiscover({
|
|
2502
|
+
filter: filterByName("backpack"),
|
|
2503
|
+
overrides: /* @__PURE__ */ __name(() => ({ ...options, id: "wallet-standard:backpack" }), "overrides")
|
|
2504
|
+
});
|
|
2505
|
+
}
|
|
2506
|
+
__name(backpack, "backpack");
|
|
2507
|
+
|
|
2508
|
+
// src/client/defaultClient.ts
|
|
2509
|
+
function defaultWalletConnectors() {
|
|
2510
|
+
return [...phantom(), ...solflare(), ...backpack(), ...autoDiscover()];
|
|
2511
|
+
}
|
|
2512
|
+
__name(defaultWalletConnectors, "defaultWalletConnectors");
|
|
2513
|
+
function normalizeUrl(value) {
|
|
2514
|
+
if (!value) return void 0;
|
|
2515
|
+
const trimmed = value.trim();
|
|
2516
|
+
return trimmed.length ? trimmed : void 0;
|
|
2517
|
+
}
|
|
2518
|
+
__name(normalizeUrl, "normalizeUrl");
|
|
2519
|
+
function resolveClientConfig(config = {}) {
|
|
2520
|
+
const {
|
|
2521
|
+
cluster,
|
|
2522
|
+
endpoint: endpointOverride,
|
|
2523
|
+
rpc,
|
|
2524
|
+
websocket,
|
|
2525
|
+
websocketEndpoint,
|
|
2526
|
+
walletConnectors,
|
|
2527
|
+
...passthrough
|
|
2528
|
+
} = config;
|
|
2529
|
+
const resolvedEndpoint = normalizeUrl(rpc) ?? normalizeUrl(endpointOverride) ?? normalizeUrl(config.endpoint);
|
|
2530
|
+
const resolvedCluster = resolveCluster({
|
|
2531
|
+
endpoint: resolvedEndpoint,
|
|
2532
|
+
moniker: cluster ?? void 0,
|
|
2533
|
+
websocketEndpoint: normalizeUrl(websocket ?? websocketEndpoint)
|
|
2534
|
+
});
|
|
2535
|
+
const resolvedConnectors = walletConnectors === void 0 || walletConnectors === "default" ? defaultWalletConnectors() : walletConnectors;
|
|
2536
|
+
return {
|
|
2537
|
+
...passthrough,
|
|
2538
|
+
endpoint: resolvedCluster.endpoint,
|
|
2539
|
+
websocketEndpoint: resolvedCluster.websocketEndpoint,
|
|
2540
|
+
walletConnectors: resolvedConnectors
|
|
2541
|
+
};
|
|
2542
|
+
}
|
|
2543
|
+
__name(resolveClientConfig, "resolveClientConfig");
|
|
2544
|
+
function createDefaultClient(config = {}) {
|
|
2545
|
+
return createClient(resolveClientConfig(config));
|
|
2546
|
+
}
|
|
2547
|
+
__name(createDefaultClient, "createDefaultClient");
|
|
2548
|
+
|
|
2549
|
+
// src/state/asyncState.ts
|
|
2550
|
+
function createInitialAsyncState() {
|
|
2551
|
+
return { status: "idle" };
|
|
2552
|
+
}
|
|
2553
|
+
__name(createInitialAsyncState, "createInitialAsyncState");
|
|
2554
|
+
function createAsyncState(status, payload = {}) {
|
|
2555
|
+
return {
|
|
2556
|
+
data: payload.data,
|
|
2557
|
+
error: payload.error,
|
|
2558
|
+
status
|
|
2559
|
+
};
|
|
2560
|
+
}
|
|
2561
|
+
__name(createAsyncState, "createAsyncState");
|
|
2562
|
+
|
|
2563
|
+
// src/controllers/solTransferController.ts
|
|
2564
|
+
function ensureAuthority(input, resolveDefault) {
|
|
2565
|
+
const authority = input.authority ?? resolveDefault?.();
|
|
2566
|
+
if (!authority) {
|
|
2567
|
+
throw new Error("Connect a wallet or supply an `authority` before sending SOL transfers.");
|
|
2568
|
+
}
|
|
2569
|
+
return {
|
|
2570
|
+
...input,
|
|
2571
|
+
authority
|
|
2572
|
+
};
|
|
2573
|
+
}
|
|
2574
|
+
__name(ensureAuthority, "ensureAuthority");
|
|
2575
|
+
function createSolTransferController(config) {
|
|
2576
|
+
const listeners = /* @__PURE__ */ new Set();
|
|
2577
|
+
const helper = config.helper;
|
|
2578
|
+
const authorityProvider = config.authorityProvider;
|
|
2579
|
+
let state = createInitialAsyncState();
|
|
2580
|
+
function notify() {
|
|
2581
|
+
for (const listener of listeners) {
|
|
2582
|
+
listener();
|
|
2583
|
+
}
|
|
2584
|
+
}
|
|
2585
|
+
__name(notify, "notify");
|
|
2586
|
+
function setState(next) {
|
|
2587
|
+
state = next;
|
|
2588
|
+
notify();
|
|
2589
|
+
}
|
|
2590
|
+
__name(setState, "setState");
|
|
2591
|
+
async function send(config2, options) {
|
|
2592
|
+
const request = ensureAuthority(config2, authorityProvider);
|
|
2593
|
+
setState(createAsyncState("loading"));
|
|
2594
|
+
try {
|
|
2595
|
+
const signature4 = await helper.sendTransfer(request, options);
|
|
2596
|
+
setState(createAsyncState("success", { data: signature4 }));
|
|
2597
|
+
return signature4;
|
|
2598
|
+
} catch (error) {
|
|
2599
|
+
setState(createAsyncState("error", { error }));
|
|
2600
|
+
throw error;
|
|
2601
|
+
}
|
|
2602
|
+
}
|
|
2603
|
+
__name(send, "send");
|
|
2604
|
+
function subscribe(listener) {
|
|
2605
|
+
listeners.add(listener);
|
|
2606
|
+
return () => {
|
|
2607
|
+
listeners.delete(listener);
|
|
2608
|
+
};
|
|
2609
|
+
}
|
|
2610
|
+
__name(subscribe, "subscribe");
|
|
2611
|
+
function reset() {
|
|
2612
|
+
setState(createInitialAsyncState());
|
|
2613
|
+
}
|
|
2614
|
+
__name(reset, "reset");
|
|
2615
|
+
return {
|
|
2616
|
+
getHelper: /* @__PURE__ */ __name(() => helper, "getHelper"),
|
|
2617
|
+
getState: /* @__PURE__ */ __name(() => state, "getState"),
|
|
2618
|
+
reset,
|
|
2619
|
+
send,
|
|
2620
|
+
subscribe
|
|
2621
|
+
};
|
|
2622
|
+
}
|
|
2623
|
+
__name(createSolTransferController, "createSolTransferController");
|
|
2624
|
+
|
|
2625
|
+
// src/controllers/splTransferController.ts
|
|
2626
|
+
function ensureTransferConfig(input, resolveAuthority, resolveSourceOwner) {
|
|
2627
|
+
const authority = input.authority ?? resolveAuthority?.();
|
|
2628
|
+
if (!authority) {
|
|
2629
|
+
throw new Error("Connect a wallet or supply an `authority` before sending SPL tokens.");
|
|
2630
|
+
}
|
|
2631
|
+
const sourceOwner = input.sourceOwner ?? resolveSourceOwner?.();
|
|
2632
|
+
if (!sourceOwner) {
|
|
2633
|
+
throw new Error("Unable to resolve a source owner for the SPL token transfer.");
|
|
2634
|
+
}
|
|
2635
|
+
return {
|
|
2636
|
+
...input,
|
|
2637
|
+
authority,
|
|
2638
|
+
sourceOwner
|
|
2639
|
+
};
|
|
2640
|
+
}
|
|
2641
|
+
__name(ensureTransferConfig, "ensureTransferConfig");
|
|
2642
|
+
function createSplTransferController(config) {
|
|
2643
|
+
const helper = config.helper;
|
|
2644
|
+
const authorityProvider = config.authorityProvider;
|
|
2645
|
+
const sourceOwnerProvider = config.sourceOwnerProvider;
|
|
2298
2646
|
const listeners = /* @__PURE__ */ new Set();
|
|
2299
2647
|
let state = createInitialAsyncState();
|
|
2300
2648
|
function notify() {
|
|
@@ -2675,56 +3023,6 @@ function toAddressString(addressLike) {
|
|
|
2675
3023
|
}
|
|
2676
3024
|
__name(toAddressString, "toAddressString");
|
|
2677
3025
|
|
|
2678
|
-
// src/utils/cluster.ts
|
|
2679
|
-
var MONIKER_ENDPOINTS = {
|
|
2680
|
-
devnet: {
|
|
2681
|
-
endpoint: "https://api.devnet.solana.com",
|
|
2682
|
-
websocketEndpoint: "wss://api.devnet.solana.com"
|
|
2683
|
-
},
|
|
2684
|
-
localhost: {
|
|
2685
|
-
endpoint: "http://127.0.0.1:8899",
|
|
2686
|
-
websocketEndpoint: "ws://127.0.0.1:8900"
|
|
2687
|
-
},
|
|
2688
|
-
localnet: {
|
|
2689
|
-
endpoint: "http://127.0.0.1:8899",
|
|
2690
|
-
websocketEndpoint: "ws://127.0.0.1:8900"
|
|
2691
|
-
},
|
|
2692
|
-
"mainnet-beta": {
|
|
2693
|
-
endpoint: "https://api.mainnet-beta.solana.com",
|
|
2694
|
-
websocketEndpoint: "wss://api.mainnet-beta.solana.com"
|
|
2695
|
-
},
|
|
2696
|
-
mainnet: {
|
|
2697
|
-
endpoint: "https://api.mainnet-beta.solana.com",
|
|
2698
|
-
websocketEndpoint: "wss://api.mainnet-beta.solana.com"
|
|
2699
|
-
},
|
|
2700
|
-
testnet: {
|
|
2701
|
-
endpoint: "https://api.testnet.solana.com",
|
|
2702
|
-
websocketEndpoint: "wss://api.testnet.solana.com"
|
|
2703
|
-
}
|
|
2704
|
-
};
|
|
2705
|
-
function inferWebsocketEndpoint(endpoint) {
|
|
2706
|
-
if (endpoint.startsWith("https://")) {
|
|
2707
|
-
return endpoint.replace("https://", "wss://");
|
|
2708
|
-
}
|
|
2709
|
-
if (endpoint.startsWith("http://")) {
|
|
2710
|
-
return endpoint.replace("http://", "ws://");
|
|
2711
|
-
}
|
|
2712
|
-
return endpoint;
|
|
2713
|
-
}
|
|
2714
|
-
__name(inferWebsocketEndpoint, "inferWebsocketEndpoint");
|
|
2715
|
-
function resolveCluster(config) {
|
|
2716
|
-
const moniker = config.moniker ?? (config.endpoint ? "custom" : "devnet");
|
|
2717
|
-
const mapped = moniker === "custom" ? void 0 : MONIKER_ENDPOINTS[moniker];
|
|
2718
|
-
const endpoint = config.endpoint ?? mapped?.endpoint;
|
|
2719
|
-
const websocketEndpoint = config.websocketEndpoint ?? mapped?.websocketEndpoint ?? inferWebsocketEndpoint(endpoint);
|
|
2720
|
-
return {
|
|
2721
|
-
endpoint,
|
|
2722
|
-
moniker,
|
|
2723
|
-
websocketEndpoint
|
|
2724
|
-
};
|
|
2725
|
-
}
|
|
2726
|
-
__name(resolveCluster, "resolveCluster");
|
|
2727
|
-
|
|
2728
3026
|
// src/utils/stableStringify.ts
|
|
2729
3027
|
function stableStringify(value) {
|
|
2730
3028
|
const result = JSON.stringify(value, (_key, candidate) => {
|
|
@@ -2739,244 +3037,7 @@ function stableStringify(value) {
|
|
|
2739
3037
|
return result ?? "undefined";
|
|
2740
3038
|
}
|
|
2741
3039
|
__name(stableStringify, "stableStringify");
|
|
2742
|
-
var base58Decoder = getBase58Decoder();
|
|
2743
|
-
var transactionDecoder = getTransactionDecoder();
|
|
2744
|
-
var transactionEncoder = getTransactionEncoder();
|
|
2745
|
-
function deriveConnectorId(wallet) {
|
|
2746
|
-
const kebab = wallet.name.toLowerCase().replace(/[^a-z0-9]+/g, "-");
|
|
2747
|
-
return `wallet-standard:${kebab}`;
|
|
2748
|
-
}
|
|
2749
|
-
__name(deriveConnectorId, "deriveConnectorId");
|
|
2750
|
-
function getPrimaryAccount(accounts) {
|
|
2751
|
-
const primary = accounts[0];
|
|
2752
|
-
if (!primary) {
|
|
2753
|
-
throw new Error("Wallet returned no accounts.");
|
|
2754
|
-
}
|
|
2755
|
-
return primary;
|
|
2756
|
-
}
|
|
2757
|
-
__name(getPrimaryAccount, "getPrimaryAccount");
|
|
2758
|
-
function mapCommitment(commitment) {
|
|
2759
|
-
if (commitment === "processed" || commitment === "confirmed" || commitment === "finalized") {
|
|
2760
|
-
return commitment;
|
|
2761
|
-
}
|
|
2762
|
-
return void 0;
|
|
2763
|
-
}
|
|
2764
|
-
__name(mapCommitment, "mapCommitment");
|
|
2765
|
-
function toSessionAccount(walletAccount) {
|
|
2766
|
-
return {
|
|
2767
|
-
address: address(walletAccount.address),
|
|
2768
|
-
label: walletAccount.label,
|
|
2769
|
-
publicKey: new Uint8Array(walletAccount.publicKey)
|
|
2770
|
-
};
|
|
2771
|
-
}
|
|
2772
|
-
__name(toSessionAccount, "toSessionAccount");
|
|
2773
|
-
function getChain(account) {
|
|
2774
|
-
const [preferred] = account.chains ?? [];
|
|
2775
|
-
return preferred;
|
|
2776
|
-
}
|
|
2777
|
-
__name(getChain, "getChain");
|
|
2778
|
-
async function disconnectWallet2(wallet) {
|
|
2779
|
-
const disconnectFeature = wallet.features[StandardDisconnect];
|
|
2780
|
-
if (disconnectFeature) {
|
|
2781
|
-
await disconnectFeature.disconnect();
|
|
2782
|
-
}
|
|
2783
|
-
}
|
|
2784
|
-
__name(disconnectWallet2, "disconnectWallet");
|
|
2785
|
-
function createWalletStandardConnector(wallet, options = {}) {
|
|
2786
|
-
const metadata = {
|
|
2787
|
-
canAutoConnect: options.canAutoConnect ?? Boolean(wallet.features[StandardConnect]),
|
|
2788
|
-
icon: options.icon ?? wallet.icon,
|
|
2789
|
-
id: options.id ?? deriveConnectorId(wallet),
|
|
2790
|
-
kind: options.kind ?? "wallet-standard",
|
|
2791
|
-
name: options.name ?? wallet.name,
|
|
2792
|
-
ready: typeof window !== "undefined"
|
|
2793
|
-
};
|
|
2794
|
-
async function connect(connectionOptions = {}) {
|
|
2795
|
-
const connectFeature = wallet.features[StandardConnect];
|
|
2796
|
-
const shouldConnectSilently = Boolean(connectionOptions.autoConnect);
|
|
2797
|
-
let walletAccounts = wallet.accounts;
|
|
2798
|
-
if (connectFeature) {
|
|
2799
|
-
const { accounts } = await connectFeature.connect({
|
|
2800
|
-
silent: shouldConnectSilently || void 0
|
|
2801
|
-
});
|
|
2802
|
-
if (accounts.length) {
|
|
2803
|
-
walletAccounts = accounts;
|
|
2804
|
-
}
|
|
2805
|
-
}
|
|
2806
|
-
const primaryAccount = getPrimaryAccount(walletAccounts);
|
|
2807
|
-
const sessionAccount = toSessionAccount(primaryAccount);
|
|
2808
|
-
const signMessageFeature = wallet.features[SolanaSignMessage];
|
|
2809
|
-
const signTransactionFeature = wallet.features[SolanaSignTransaction];
|
|
2810
|
-
const signAndSendFeature = wallet.features[SolanaSignAndSendTransaction];
|
|
2811
|
-
const resolvedChain = options.defaultChain ?? getChain(primaryAccount);
|
|
2812
|
-
const signMessage = signMessageFeature ? async (message) => {
|
|
2813
|
-
const [output] = await signMessageFeature.signMessage({
|
|
2814
|
-
account: primaryAccount,
|
|
2815
|
-
message
|
|
2816
|
-
});
|
|
2817
|
-
return output.signature;
|
|
2818
|
-
} : void 0;
|
|
2819
|
-
const signTransaction = signTransactionFeature ? async (transaction) => {
|
|
2820
|
-
const wireBytes = new Uint8Array(transactionEncoder.encode(transaction));
|
|
2821
|
-
const request = resolvedChain ? {
|
|
2822
|
-
account: primaryAccount,
|
|
2823
|
-
chain: resolvedChain,
|
|
2824
|
-
transaction: wireBytes
|
|
2825
|
-
} : {
|
|
2826
|
-
account: primaryAccount,
|
|
2827
|
-
transaction: wireBytes
|
|
2828
|
-
};
|
|
2829
|
-
const [output] = await signTransactionFeature.signTransaction(request);
|
|
2830
|
-
return transactionDecoder.decode(output.signedTransaction);
|
|
2831
|
-
} : void 0;
|
|
2832
|
-
const sendTransaction2 = signAndSendFeature ? async (transaction, config) => {
|
|
2833
|
-
const wireBytes = new Uint8Array(transactionEncoder.encode(transaction));
|
|
2834
|
-
const chain = options.defaultChain ?? getChain(primaryAccount) ?? "solana:mainnet-beta";
|
|
2835
|
-
const [output] = await signAndSendFeature.signAndSendTransaction({
|
|
2836
|
-
account: primaryAccount,
|
|
2837
|
-
chain,
|
|
2838
|
-
options: {
|
|
2839
|
-
commitment: mapCommitment(config?.commitment)
|
|
2840
|
-
},
|
|
2841
|
-
transaction: wireBytes
|
|
2842
|
-
});
|
|
2843
|
-
return base58Decoder.decode(output.signature);
|
|
2844
|
-
} : void 0;
|
|
2845
|
-
async function disconnectSession() {
|
|
2846
|
-
await disconnectWallet2(wallet);
|
|
2847
|
-
}
|
|
2848
|
-
__name(disconnectSession, "disconnectSession");
|
|
2849
|
-
return {
|
|
2850
|
-
account: sessionAccount,
|
|
2851
|
-
connector: metadata,
|
|
2852
|
-
disconnect: disconnectSession,
|
|
2853
|
-
sendTransaction: sendTransaction2,
|
|
2854
|
-
signMessage,
|
|
2855
|
-
signTransaction
|
|
2856
|
-
};
|
|
2857
|
-
}
|
|
2858
|
-
__name(connect, "connect");
|
|
2859
|
-
async function disconnect() {
|
|
2860
|
-
await disconnectWallet2(wallet);
|
|
2861
|
-
}
|
|
2862
|
-
__name(disconnect, "disconnect");
|
|
2863
|
-
function isSupported() {
|
|
2864
|
-
return typeof window !== "undefined";
|
|
2865
|
-
}
|
|
2866
|
-
__name(isSupported, "isSupported");
|
|
2867
|
-
return {
|
|
2868
|
-
...metadata,
|
|
2869
|
-
connect,
|
|
2870
|
-
disconnect,
|
|
2871
|
-
isSupported
|
|
2872
|
-
};
|
|
2873
|
-
}
|
|
2874
|
-
__name(createWalletStandardConnector, "createWalletStandardConnector");
|
|
2875
|
-
function mapWalletToConnector(wallet, overrides) {
|
|
2876
|
-
return createWalletStandardConnector(wallet, overrides?.(wallet));
|
|
2877
|
-
}
|
|
2878
|
-
__name(mapWalletToConnector, "mapWalletToConnector");
|
|
2879
|
-
function getWalletStandardConnectors(options = {}) {
|
|
2880
|
-
const { get } = getWallets();
|
|
2881
|
-
const connectors = get().map((wallet) => mapWalletToConnector(wallet, options.overrides));
|
|
2882
|
-
const seen = /* @__PURE__ */ new Set();
|
|
2883
|
-
return connectors.filter((connector) => {
|
|
2884
|
-
if (seen.has(connector.id)) {
|
|
2885
|
-
return false;
|
|
2886
|
-
}
|
|
2887
|
-
seen.add(connector.id);
|
|
2888
|
-
return true;
|
|
2889
|
-
});
|
|
2890
|
-
}
|
|
2891
|
-
__name(getWalletStandardConnectors, "getWalletStandardConnectors");
|
|
2892
|
-
function watchWalletStandardConnectors(onChange, options = {}) {
|
|
2893
|
-
const { get, on } = getWallets();
|
|
2894
|
-
const emit = /* @__PURE__ */ __name(() => {
|
|
2895
|
-
const connectors = get().map((wallet) => mapWalletToConnector(wallet, options.overrides));
|
|
2896
|
-
const seen = /* @__PURE__ */ new Set();
|
|
2897
|
-
const deduplicated = connectors.filter((connector) => {
|
|
2898
|
-
if (seen.has(connector.id)) {
|
|
2899
|
-
return false;
|
|
2900
|
-
}
|
|
2901
|
-
seen.add(connector.id);
|
|
2902
|
-
return true;
|
|
2903
|
-
});
|
|
2904
|
-
onChange(deduplicated);
|
|
2905
|
-
}, "emit");
|
|
2906
|
-
emit();
|
|
2907
|
-
const offRegister = on("register", emit);
|
|
2908
|
-
const offUnregister = on("unregister", emit);
|
|
2909
|
-
return () => {
|
|
2910
|
-
offRegister();
|
|
2911
|
-
offUnregister();
|
|
2912
|
-
};
|
|
2913
|
-
}
|
|
2914
|
-
__name(watchWalletStandardConnectors, "watchWalletStandardConnectors");
|
|
2915
|
-
|
|
2916
|
-
// src/wallet/connectors.ts
|
|
2917
|
-
function autoDiscover(options = {}) {
|
|
2918
|
-
const { get } = getWallets();
|
|
2919
|
-
const wallets = get().filter((wallet) => options.filter ? options.filter(wallet) : true);
|
|
2920
|
-
const connectors = wallets.map((wallet) => createWalletStandardConnector(wallet, options.overrides?.(wallet)));
|
|
2921
|
-
const seen = /* @__PURE__ */ new Set();
|
|
2922
|
-
return connectors.filter((connector) => {
|
|
2923
|
-
if (seen.has(connector.id)) return false;
|
|
2924
|
-
seen.add(connector.id);
|
|
2925
|
-
return true;
|
|
2926
|
-
});
|
|
2927
|
-
}
|
|
2928
|
-
__name(autoDiscover, "autoDiscover");
|
|
2929
|
-
function injected(options) {
|
|
2930
|
-
const connector = {
|
|
2931
|
-
canAutoConnect: true,
|
|
2932
|
-
id: "wallet-standard:injected",
|
|
2933
|
-
kind: "wallet-standard",
|
|
2934
|
-
name: "Injected Wallet",
|
|
2935
|
-
ready: typeof window !== "undefined",
|
|
2936
|
-
async connect() {
|
|
2937
|
-
const wallets = getWallets().get();
|
|
2938
|
-
const first = wallets.find((wallet) => StandardConnect in wallet.features);
|
|
2939
|
-
if (!first) {
|
|
2940
|
-
throw new Error("No Wallet Standard wallets available.");
|
|
2941
|
-
}
|
|
2942
|
-
return createWalletStandardConnector(first, options).connect();
|
|
2943
|
-
},
|
|
2944
|
-
async disconnect() {
|
|
2945
|
-
},
|
|
2946
|
-
isSupported() {
|
|
2947
|
-
return typeof window !== "undefined";
|
|
2948
|
-
}
|
|
2949
|
-
};
|
|
2950
|
-
return connector;
|
|
2951
|
-
}
|
|
2952
|
-
__name(injected, "injected");
|
|
2953
|
-
function filterByName(name) {
|
|
2954
|
-
const lower = name.toLowerCase();
|
|
2955
|
-
return (wallet) => wallet.name.toLowerCase().includes(lower);
|
|
2956
|
-
}
|
|
2957
|
-
__name(filterByName, "filterByName");
|
|
2958
|
-
function phantom(options) {
|
|
2959
|
-
return autoDiscover({
|
|
2960
|
-
filter: filterByName("phantom"),
|
|
2961
|
-
overrides: /* @__PURE__ */ __name(() => ({ ...options, id: "wallet-standard:phantom" }), "overrides")
|
|
2962
|
-
});
|
|
2963
|
-
}
|
|
2964
|
-
__name(phantom, "phantom");
|
|
2965
|
-
function solflare(options) {
|
|
2966
|
-
return autoDiscover({
|
|
2967
|
-
filter: filterByName("solflare"),
|
|
2968
|
-
overrides: /* @__PURE__ */ __name(() => ({ ...options, id: "wallet-standard:solflare" }), "overrides")
|
|
2969
|
-
});
|
|
2970
|
-
}
|
|
2971
|
-
__name(solflare, "solflare");
|
|
2972
|
-
function backpack(options) {
|
|
2973
|
-
return autoDiscover({
|
|
2974
|
-
filter: filterByName("backpack"),
|
|
2975
|
-
overrides: /* @__PURE__ */ __name(() => ({ ...options, id: "wallet-standard:backpack" }), "overrides")
|
|
2976
|
-
});
|
|
2977
|
-
}
|
|
2978
|
-
__name(backpack, "backpack");
|
|
2979
3040
|
|
|
2980
|
-
export { LAMPORTS_PER_SOL, SIGNATURE_STATUS_TIMEOUT_MS, applyRatio, applySerializableState, assertDecimals, assertNonNegative, autoDiscover, backpack, bigintFromJson, bigintToJson, checkedAdd, checkedDivide, checkedMultiply, checkedSubtract, confirmationMeetsCommitment, connectWallet, createAsyncState, createClient, createClientStore, createDefaultClientStore, createInitialAsyncState, createInitialClientState, createRatio, createSolTransferController, createSolTransferHelper, createSolanaRpcClient, createSplTokenHelper, createSplTransferController, createTokenAmount, createTransactionHelper, createTransactionPoolController, createTransactionRecipe, createWalletRegistry, createWalletStandardConnector, deriveConfirmationStatus, deserializeSolanaState, disconnectWallet, fetchAccount, fetchBalance, getInitialSerializableState, getWalletStandardConnectors, injected, insertReferenceKey, insertReferenceKeys, lamports, lamportsFromJson, lamportsFromSol, lamportsMath, lamportsToJson, lamportsToSolString, normalizeSignature, phantom, pow10, prepareTransaction, requestAirdrop, resolveCluster, sendTransaction, serializeSolanaState, setCluster, solflare, stableStringify, subscribeSolanaState, toAddress2 as toAddress, toAddressString, toBigint2 as toBigint, transactionToBase64, transactionToBase64WithSigners, watchWalletStandardConnectors };
|
|
3041
|
+
export { LAMPORTS_PER_SOL, SIGNATURE_STATUS_TIMEOUT_MS, applyRatio, applySerializableState, assertDecimals, assertNonNegative, autoDiscover, backpack, bigintFromJson, bigintToJson, checkedAdd, checkedDivide, checkedMultiply, checkedSubtract, confirmationMeetsCommitment, connectWallet, createAsyncState, createClient, createClientStore, createDefaultClient, createDefaultClientStore, createInitialAsyncState, createInitialClientState, createRatio, createSolTransferController, createSolTransferHelper, createSolanaRpcClient, createSplTokenHelper, createSplTransferController, createTokenAmount, createTransactionHelper, createTransactionPoolController, createTransactionRecipe, createWalletRegistry, createWalletStandardConnector, defaultWalletConnectors, deriveConfirmationStatus, deserializeSolanaState, disconnectWallet, fetchAccount, fetchBalance, getInitialSerializableState, getWalletStandardConnectors, injected, insertReferenceKey, insertReferenceKeys, lamports, lamportsFromJson, lamportsFromSol, lamportsMath, lamportsToJson, lamportsToSolString, normalizeSignature, phantom, pow10, prepareTransaction, requestAirdrop, resolveClientConfig, resolveCluster, sendTransaction, serializeSolanaState, setCluster, solflare, stableStringify, subscribeSolanaState, toAddress2 as toAddress, toAddressString, toBigint2 as toBigint, transactionToBase64, transactionToBase64WithSigners, watchWalletStandardConnectors };
|
|
2981
3042
|
//# sourceMappingURL=index.browser.mjs.map
|
|
2982
3043
|
//# sourceMappingURL=index.browser.mjs.map
|