thirdweb 5.105.21 → 5.105.23
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/cjs/extensions/erc1155/read/getOwnedNFTs.js +1 -0
- package/dist/cjs/extensions/erc1155/read/getOwnedNFTs.js.map +1 -1
- package/dist/cjs/extensions/erc721/read/getOwnedNFTs.js +1 -0
- package/dist/cjs/extensions/erc721/read/getOwnedNFTs.js.map +1 -1
- package/dist/cjs/insight/get-nfts.js +3 -3
- package/dist/cjs/insight/get-nfts.js.map +1 -1
- package/dist/cjs/insight/get-tokens.js +3 -2
- package/dist/cjs/insight/get-tokens.js.map +1 -1
- package/dist/cjs/react/web/wallets/shared/WalletConnectConnection.js +7 -33
- package/dist/cjs/react/web/wallets/shared/WalletConnectConnection.js.map +1 -1
- package/dist/cjs/transaction/actions/estimate-gas.js +3 -24
- package/dist/cjs/transaction/actions/estimate-gas.js.map +1 -1
- package/dist/cjs/utils/web/isMobile.js +0 -2
- package/dist/cjs/utils/web/isMobile.js.map +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/wallets/coinbase/coinbase-web.js +56 -0
- package/dist/cjs/wallets/coinbase/coinbase-web.js.map +1 -1
- package/dist/cjs/wallets/create-wallet.js +21 -4
- package/dist/cjs/wallets/create-wallet.js.map +1 -1
- package/dist/cjs/wallets/eip5792/get-calls-status.js +40 -63
- package/dist/cjs/wallets/eip5792/get-calls-status.js.map +1 -1
- package/dist/cjs/wallets/eip5792/get-capabilities.js +14 -49
- package/dist/cjs/wallets/eip5792/get-capabilities.js.map +1 -1
- package/dist/cjs/wallets/eip5792/send-calls.js +34 -48
- package/dist/cjs/wallets/eip5792/send-calls.js.map +1 -1
- package/dist/cjs/wallets/in-app/core/{eip5972 → eip5792}/in-app-wallet-calls.js +1 -5
- package/dist/cjs/wallets/in-app/core/eip5792/in-app-wallet-calls.js.map +1 -0
- package/dist/cjs/wallets/in-app/core/eip7702/minimal-account.js +650 -5
- package/dist/cjs/wallets/in-app/core/eip7702/minimal-account.js.map +1 -1
- package/dist/cjs/wallets/in-app/core/wallet/enclave-wallet.js +32 -1
- package/dist/cjs/wallets/in-app/core/wallet/enclave-wallet.js.map +1 -1
- package/dist/cjs/wallets/injected/index.js +55 -0
- package/dist/cjs/wallets/injected/index.js.map +1 -1
- package/dist/cjs/wallets/smart/index.js +61 -0
- package/dist/cjs/wallets/smart/index.js.map +1 -1
- package/dist/cjs/wallets/wallet-connect/controller.js +27 -25
- package/dist/cjs/wallets/wallet-connect/controller.js.map +1 -1
- package/dist/esm/extensions/erc1155/read/getOwnedNFTs.js +1 -0
- package/dist/esm/extensions/erc1155/read/getOwnedNFTs.js.map +1 -1
- package/dist/esm/extensions/erc721/read/getOwnedNFTs.js +1 -0
- package/dist/esm/extensions/erc721/read/getOwnedNFTs.js.map +1 -1
- package/dist/esm/insight/get-nfts.js +3 -3
- package/dist/esm/insight/get-nfts.js.map +1 -1
- package/dist/esm/insight/get-tokens.js +3 -2
- package/dist/esm/insight/get-tokens.js.map +1 -1
- package/dist/esm/react/web/wallets/shared/WalletConnectConnection.js +8 -34
- package/dist/esm/react/web/wallets/shared/WalletConnectConnection.js.map +1 -1
- package/dist/esm/transaction/actions/estimate-gas.js +3 -24
- package/dist/esm/transaction/actions/estimate-gas.js.map +1 -1
- package/dist/esm/utils/web/isMobile.js +2 -2
- package/dist/esm/utils/web/isMobile.js.map +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/esm/wallets/coinbase/coinbase-web.js +56 -0
- package/dist/esm/wallets/coinbase/coinbase-web.js.map +1 -1
- package/dist/esm/wallets/create-wallet.js +21 -4
- package/dist/esm/wallets/create-wallet.js.map +1 -1
- package/dist/esm/wallets/eip5792/get-calls-status.js +39 -63
- package/dist/esm/wallets/eip5792/get-calls-status.js.map +1 -1
- package/dist/esm/wallets/eip5792/get-capabilities.js +13 -49
- package/dist/esm/wallets/eip5792/get-capabilities.js.map +1 -1
- package/dist/esm/wallets/eip5792/send-calls.js +33 -48
- package/dist/esm/wallets/eip5792/send-calls.js.map +1 -1
- package/dist/esm/wallets/in-app/core/{eip5972 → eip5792}/in-app-wallet-calls.js +1 -5
- package/dist/esm/wallets/in-app/core/eip5792/in-app-wallet-calls.js.map +1 -0
- package/dist/esm/wallets/in-app/core/eip7702/minimal-account.js +650 -5
- package/dist/esm/wallets/in-app/core/eip7702/minimal-account.js.map +1 -1
- package/dist/esm/wallets/in-app/core/wallet/enclave-wallet.js +32 -1
- package/dist/esm/wallets/in-app/core/wallet/enclave-wallet.js.map +1 -1
- package/dist/esm/wallets/injected/index.js +56 -1
- package/dist/esm/wallets/injected/index.js.map +1 -1
- package/dist/esm/wallets/smart/index.js +61 -0
- package/dist/esm/wallets/smart/index.js.map +1 -1
- package/dist/esm/wallets/wallet-connect/controller.js +27 -25
- package/dist/esm/wallets/wallet-connect/controller.js.map +1 -1
- package/dist/types/bridge/Webhook.d.ts +2 -2
- package/dist/types/insight/get-nfts.d.ts +1 -0
- package/dist/types/insight/get-nfts.d.ts.map +1 -1
- package/dist/types/insight/get-tokens.d.ts +1 -0
- package/dist/types/insight/get-tokens.d.ts.map +1 -1
- package/dist/types/react/core/hooks/wallets/useWaitForCallsReceipt.d.ts +1 -1
- package/dist/types/react/core/utils/storage.d.ts +1 -1
- package/dist/types/react/web/utils/storage.d.ts +1 -1
- package/dist/types/react/web/wallets/shared/WalletConnectConnection.d.ts.map +1 -1
- package/dist/types/transaction/actions/estimate-gas.d.ts.map +1 -1
- package/dist/types/utils/web/isMobile.d.ts +0 -8
- package/dist/types/utils/web/isMobile.d.ts.map +1 -1
- package/dist/types/version.d.ts +1 -1
- package/dist/types/wallets/coinbase/coinbase-web.d.ts.map +1 -1
- package/dist/types/wallets/create-wallet.d.ts.map +1 -1
- package/dist/types/wallets/eip5792/get-calls-status.d.ts +2 -1
- package/dist/types/wallets/eip5792/get-calls-status.d.ts.map +1 -1
- package/dist/types/wallets/eip5792/get-capabilities.d.ts +1 -0
- package/dist/types/wallets/eip5792/get-capabilities.d.ts.map +1 -1
- package/dist/types/wallets/eip5792/send-calls.d.ts +6 -1
- package/dist/types/wallets/eip5792/send-calls.d.ts.map +1 -1
- package/dist/types/wallets/in-app/core/{eip5972 → eip5792}/in-app-wallet-calls.d.ts +3 -2
- package/dist/types/wallets/in-app/core/eip5792/in-app-wallet-calls.d.ts.map +1 -0
- package/dist/types/wallets/in-app/core/eip7702/minimal-account.d.ts.map +1 -1
- package/dist/types/wallets/in-app/core/wallet/enclave-wallet.d.ts.map +1 -1
- package/dist/types/wallets/injected/index.d.ts.map +1 -1
- package/dist/types/wallets/interfaces/wallet.d.ts +22 -0
- package/dist/types/wallets/interfaces/wallet.d.ts.map +1 -1
- package/dist/types/wallets/smart/index.d.ts.map +1 -1
- package/dist/types/wallets/wallet-connect/controller.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/extensions/erc1155/read/getOwnedNFTs.ts +1 -0
- package/src/extensions/erc721/read/getOwnedNFTs.ts +1 -0
- package/src/insight/get-nfts.ts +4 -3
- package/src/insight/get-tokens.ts +4 -2
- package/src/react/web/wallets/shared/WalletConnectConnection.tsx +11 -46
- package/src/transaction/actions/estimate-gas.ts +14 -42
- package/src/utils/web/isMobile.ts +2 -2
- package/src/version.ts +1 -1
- package/src/wallets/coinbase/coinbase-web.ts +66 -0
- package/src/wallets/create-wallet.ts +53 -31
- package/src/wallets/eip5792/get-calls-status.test.ts +156 -146
- package/src/wallets/eip5792/get-calls-status.ts +44 -73
- package/src/wallets/eip5792/get-capabilities.test.ts +216 -205
- package/src/wallets/eip5792/get-capabilities.ts +23 -64
- package/src/wallets/eip5792/send-calls.test.ts +183 -189
- package/src/wallets/eip5792/send-calls.ts +53 -71
- package/src/wallets/in-app/core/{eip5972 → eip5792}/in-app-wallet-calls.ts +4 -8
- package/src/wallets/in-app/core/eip7702/minimal-account.ts +666 -5
- package/src/wallets/in-app/core/wallet/enclave-wallet.ts +36 -1
- package/src/wallets/injected/index.ts +63 -0
- package/src/wallets/interfaces/wallet.ts +31 -0
- package/src/wallets/smart/index.ts +69 -1
- package/src/wallets/wallet-connect/controller.ts +28 -25
- package/dist/cjs/wallets/in-app/core/eip5972/in-app-wallet-calls.js.map +0 -1
- package/dist/cjs/wallets/in-app/core/eip5972/in-app-wallet-capabilities.js +0 -41
- package/dist/cjs/wallets/in-app/core/eip5972/in-app-wallet-capabilities.js.map +0 -1
- package/dist/cjs/wallets/smart/lib/smart-wallet-capabilities.js +0 -30
- package/dist/cjs/wallets/smart/lib/smart-wallet-capabilities.js.map +0 -1
- package/dist/esm/wallets/in-app/core/eip5972/in-app-wallet-calls.js.map +0 -1
- package/dist/esm/wallets/in-app/core/eip5972/in-app-wallet-capabilities.js +0 -38
- package/dist/esm/wallets/in-app/core/eip5972/in-app-wallet-capabilities.js.map +0 -1
- package/dist/esm/wallets/smart/lib/smart-wallet-capabilities.js +0 -27
- package/dist/esm/wallets/smart/lib/smart-wallet-capabilities.js.map +0 -1
- package/dist/types/wallets/in-app/core/eip5972/in-app-wallet-calls.d.ts.map +0 -1
- package/dist/types/wallets/in-app/core/eip5972/in-app-wallet-capabilities.d.ts +0 -20
- package/dist/types/wallets/in-app/core/eip5972/in-app-wallet-capabilities.d.ts.map +0 -1
- package/dist/types/wallets/smart/lib/smart-wallet-capabilities.d.ts +0 -20
- package/dist/types/wallets/smart/lib/smart-wallet-capabilities.d.ts.map +0 -1
- package/src/wallets/in-app/core/eip5972/in-app-wallet-capabilities.ts +0 -47
- package/src/wallets/smart/lib/smart-wallet-capabilities.ts +0 -32
|
@@ -179,7 +179,7 @@ export class EnclaveWallet implements IWebWallet {
|
|
|
179
179
|
storage,
|
|
180
180
|
});
|
|
181
181
|
};
|
|
182
|
-
|
|
182
|
+
const account: Account = {
|
|
183
183
|
address: getAddress(address),
|
|
184
184
|
async sendTransaction(tx) {
|
|
185
185
|
const rpcRequest = getRpcClient({
|
|
@@ -264,7 +264,42 @@ export class EnclaveWallet implements IWebWallet {
|
|
|
264
264
|
|
|
265
265
|
return signature as Hex;
|
|
266
266
|
},
|
|
267
|
+
sendCalls: async (options) => {
|
|
268
|
+
const { inAppWalletSendCalls } = await import(
|
|
269
|
+
"../eip5792/in-app-wallet-calls.js"
|
|
270
|
+
);
|
|
271
|
+
const firstCall = options.calls[0];
|
|
272
|
+
if (!firstCall) {
|
|
273
|
+
throw new Error("No calls to send");
|
|
274
|
+
}
|
|
275
|
+
const client = firstCall.client;
|
|
276
|
+
const chain = firstCall.chain || options.chain;
|
|
277
|
+
const id = await inAppWalletSendCalls({
|
|
278
|
+
account: account,
|
|
279
|
+
calls: options.calls,
|
|
280
|
+
});
|
|
281
|
+
return { chain, client, id };
|
|
282
|
+
},
|
|
283
|
+
getCallsStatus: async (options) => {
|
|
284
|
+
const { inAppWalletGetCallsStatus } = await import(
|
|
285
|
+
"../eip5792/in-app-wallet-calls.js"
|
|
286
|
+
);
|
|
287
|
+
return inAppWalletGetCallsStatus(options);
|
|
288
|
+
},
|
|
289
|
+
getCapabilities: async (options) => {
|
|
290
|
+
return {
|
|
291
|
+
[options.chainId ?? 1]: {
|
|
292
|
+
atomic: {
|
|
293
|
+
status: "unsupported",
|
|
294
|
+
},
|
|
295
|
+
paymasterService: {
|
|
296
|
+
supported: false,
|
|
297
|
+
},
|
|
298
|
+
},
|
|
299
|
+
};
|
|
300
|
+
},
|
|
267
301
|
};
|
|
302
|
+
return account;
|
|
268
303
|
}
|
|
269
304
|
}
|
|
270
305
|
|
|
@@ -3,6 +3,7 @@ import {
|
|
|
3
3
|
getTypesForEIP712Domain,
|
|
4
4
|
type SignTypedDataParameters,
|
|
5
5
|
serializeTypedData,
|
|
6
|
+
stringify,
|
|
6
7
|
validateTypedData,
|
|
7
8
|
} from "viem";
|
|
8
9
|
import { isInsufficientFundsError } from "../../analytics/track/helpers.js";
|
|
@@ -22,6 +23,10 @@ import {
|
|
|
22
23
|
} from "../../utils/encoding/hex.js";
|
|
23
24
|
import { parseTypedData } from "../../utils/signatures/helpers/parse-typed-data.js";
|
|
24
25
|
import type { InjectedSupportedWalletIds } from "../__generated__/wallet-ids.js";
|
|
26
|
+
import { toGetCallsStatusResponse } from "../eip5792/get-calls-status.js";
|
|
27
|
+
import { toGetCapabilitiesResult } from "../eip5792/get-capabilities.js";
|
|
28
|
+
import { toProviderCallParams } from "../eip5792/send-calls.js";
|
|
29
|
+
import type { GetCallsStatusRawResponse } from "../eip5792/types.js";
|
|
25
30
|
import type { Account, SendTransactionOption } from "../interfaces/wallet.js";
|
|
26
31
|
import type { DisconnectFn, SwitchChainFn } from "../types.js";
|
|
27
32
|
import { getValidPublicRPCUrl } from "../utils/chains.js";
|
|
@@ -300,6 +305,64 @@ function createAccount({
|
|
|
300
305
|
);
|
|
301
306
|
return result;
|
|
302
307
|
},
|
|
308
|
+
async sendCalls(options) {
|
|
309
|
+
try {
|
|
310
|
+
const { callParams, chain } = await toProviderCallParams(
|
|
311
|
+
options,
|
|
312
|
+
account,
|
|
313
|
+
);
|
|
314
|
+
const callId = await provider.request({
|
|
315
|
+
method: "wallet_sendCalls",
|
|
316
|
+
params: callParams,
|
|
317
|
+
});
|
|
318
|
+
if (callId && typeof callId === "object" && "id" in callId) {
|
|
319
|
+
return { chain, client, id: callId.id };
|
|
320
|
+
}
|
|
321
|
+
return { chain, client, id: callId };
|
|
322
|
+
} catch (error) {
|
|
323
|
+
if (/unsupport|not support/i.test((error as Error).message)) {
|
|
324
|
+
throw new Error(
|
|
325
|
+
`${id} errored calling wallet_sendCalls, with error: ${error instanceof Error ? error.message : stringify(error)}`,
|
|
326
|
+
);
|
|
327
|
+
}
|
|
328
|
+
throw error;
|
|
329
|
+
}
|
|
330
|
+
},
|
|
331
|
+
async getCallsStatus(options) {
|
|
332
|
+
try {
|
|
333
|
+
const rawResponse = (await provider.request({
|
|
334
|
+
method: "wallet_getCallsStatus",
|
|
335
|
+
params: [options.id],
|
|
336
|
+
})) as GetCallsStatusRawResponse;
|
|
337
|
+
return toGetCallsStatusResponse(rawResponse);
|
|
338
|
+
} catch (error) {
|
|
339
|
+
if (/unsupport|not support/i.test((error as Error).message)) {
|
|
340
|
+
throw new Error(
|
|
341
|
+
`${id} does not support wallet_getCallsStatus, reach out to them directly to request EIP-5792 support.`,
|
|
342
|
+
);
|
|
343
|
+
}
|
|
344
|
+
throw error;
|
|
345
|
+
}
|
|
346
|
+
},
|
|
347
|
+
async getCapabilities(options) {
|
|
348
|
+
const chainId = options.chainId;
|
|
349
|
+
try {
|
|
350
|
+
const result = await provider.request({
|
|
351
|
+
method: "wallet_getCapabilities",
|
|
352
|
+
params: [getAddress(account.address)],
|
|
353
|
+
});
|
|
354
|
+
return toGetCapabilitiesResult(result, chainId);
|
|
355
|
+
} catch (error: unknown) {
|
|
356
|
+
if (
|
|
357
|
+
/unsupport|not support|not available/i.test((error as Error).message)
|
|
358
|
+
) {
|
|
359
|
+
return {
|
|
360
|
+
message: `${id} does not support wallet_getCapabilities, reach out to them directly to request EIP-5792 support.`,
|
|
361
|
+
};
|
|
362
|
+
}
|
|
363
|
+
throw error;
|
|
364
|
+
}
|
|
365
|
+
},
|
|
303
366
|
};
|
|
304
367
|
|
|
305
368
|
return account;
|
|
@@ -2,6 +2,7 @@ import type { Address } from "abitype";
|
|
|
2
2
|
import type * as ox__TypedData from "ox/TypedData";
|
|
3
3
|
import type { Hex, SignableMessage } from "viem";
|
|
4
4
|
import type { Chain } from "../../chains/types.js";
|
|
5
|
+
import type { ThirdwebClient } from "../../client/client.js";
|
|
5
6
|
import type {
|
|
6
7
|
AuthorizationRequest,
|
|
7
8
|
SignedAuthorization,
|
|
@@ -12,6 +13,15 @@ import type {
|
|
|
12
13
|
} from "../../transaction/prepare-transaction.js";
|
|
13
14
|
import type { SerializableTransaction } from "../../transaction/serialize-transaction.js";
|
|
14
15
|
import type { SendTransactionResult } from "../../transaction/types.js";
|
|
16
|
+
import type { GetCapabilitiesResult } from "../eip5792/get-capabilities.js";
|
|
17
|
+
import type {
|
|
18
|
+
SendCallsOptions,
|
|
19
|
+
SendCallsResult,
|
|
20
|
+
} from "../eip5792/send-calls.js";
|
|
21
|
+
import type {
|
|
22
|
+
GetCallsStatusResponse,
|
|
23
|
+
WalletSendCallsId,
|
|
24
|
+
} from "../eip5792/types.js";
|
|
15
25
|
import type { WalletEmitter } from "../wallet-emitter.js";
|
|
16
26
|
import type {
|
|
17
27
|
CreateWalletArgs,
|
|
@@ -300,4 +310,25 @@ export type Account = {
|
|
|
300
310
|
* ```
|
|
301
311
|
*/
|
|
302
312
|
watchAsset?: (asset: WatchAssetParams) => Promise<boolean>;
|
|
313
|
+
|
|
314
|
+
/**
|
|
315
|
+
* EIP-5792: Send the given array of calls via the wallet provider
|
|
316
|
+
*/
|
|
317
|
+
sendCalls?: (
|
|
318
|
+
calls: Omit<SendCallsOptions, "wallet">,
|
|
319
|
+
) => Promise<Omit<SendCallsResult, "wallet">>;
|
|
320
|
+
/**
|
|
321
|
+
* EIP-5792: Get the status of the given call bundle
|
|
322
|
+
*/
|
|
323
|
+
getCallsStatus?: (options: {
|
|
324
|
+
id: WalletSendCallsId;
|
|
325
|
+
chain: Chain;
|
|
326
|
+
client: ThirdwebClient;
|
|
327
|
+
}) => Promise<GetCallsStatusResponse>;
|
|
328
|
+
/**
|
|
329
|
+
* EIP-5792: Get the capabilities of the wallet
|
|
330
|
+
*/
|
|
331
|
+
getCapabilities?: (options: {
|
|
332
|
+
chainId?: number;
|
|
333
|
+
}) => Promise<GetCapabilitiesResult>;
|
|
303
334
|
};
|
|
@@ -226,7 +226,7 @@ async function createSmartAccount(
|
|
|
226
226
|
);
|
|
227
227
|
}
|
|
228
228
|
}
|
|
229
|
-
|
|
229
|
+
const sponsorGas = options.sponsorGas;
|
|
230
230
|
let accountContract = options.accountContract;
|
|
231
231
|
const account: Account = {
|
|
232
232
|
address: getAddress(accountContract.address),
|
|
@@ -366,6 +366,40 @@ async function createSmartAccount(
|
|
|
366
366
|
typedData,
|
|
367
367
|
});
|
|
368
368
|
},
|
|
369
|
+
sendCalls: async (options) => {
|
|
370
|
+
const { inAppWalletSendCalls } = await import(
|
|
371
|
+
"../in-app/core/eip5792/in-app-wallet-calls.js"
|
|
372
|
+
);
|
|
373
|
+
const firstCall = options.calls[0];
|
|
374
|
+
if (!firstCall) {
|
|
375
|
+
throw new Error("No calls to send");
|
|
376
|
+
}
|
|
377
|
+
const client = firstCall.client;
|
|
378
|
+
const chain = firstCall.chain || options.chain;
|
|
379
|
+
const id = await inAppWalletSendCalls({
|
|
380
|
+
account: account,
|
|
381
|
+
calls: options.calls,
|
|
382
|
+
});
|
|
383
|
+
return { chain, client, id };
|
|
384
|
+
},
|
|
385
|
+
getCallsStatus: async (options) => {
|
|
386
|
+
const { inAppWalletGetCallsStatus } = await import(
|
|
387
|
+
"../in-app/core/eip5792/in-app-wallet-calls.js"
|
|
388
|
+
);
|
|
389
|
+
return inAppWalletGetCallsStatus(options);
|
|
390
|
+
},
|
|
391
|
+
getCapabilities: async (options) => {
|
|
392
|
+
return {
|
|
393
|
+
[options.chainId ?? 1]: {
|
|
394
|
+
atomic: {
|
|
395
|
+
status: "supported",
|
|
396
|
+
},
|
|
397
|
+
paymasterService: {
|
|
398
|
+
supported: sponsorGas ?? false,
|
|
399
|
+
},
|
|
400
|
+
},
|
|
401
|
+
};
|
|
402
|
+
},
|
|
369
403
|
};
|
|
370
404
|
return account;
|
|
371
405
|
}
|
|
@@ -509,6 +543,40 @@ function createZkSyncAccount(args: {
|
|
|
509
543
|
const typedData = parseTypedData(_typedData);
|
|
510
544
|
return connectionOptions.personalAccount.signTypedData(typedData);
|
|
511
545
|
},
|
|
546
|
+
sendCalls: async (options) => {
|
|
547
|
+
const { inAppWalletSendCalls } = await import(
|
|
548
|
+
"../in-app/core/eip5792/in-app-wallet-calls.js"
|
|
549
|
+
);
|
|
550
|
+
const firstCall = options.calls[0];
|
|
551
|
+
if (!firstCall) {
|
|
552
|
+
throw new Error("No calls to send");
|
|
553
|
+
}
|
|
554
|
+
const client = firstCall.client;
|
|
555
|
+
const chain = firstCall.chain || options.chain;
|
|
556
|
+
const id = await inAppWalletSendCalls({
|
|
557
|
+
account: account,
|
|
558
|
+
calls: options.calls,
|
|
559
|
+
});
|
|
560
|
+
return { chain, client, id };
|
|
561
|
+
},
|
|
562
|
+
getCallsStatus: async (options) => {
|
|
563
|
+
const { inAppWalletGetCallsStatus } = await import(
|
|
564
|
+
"../in-app/core/eip5792/in-app-wallet-calls.js"
|
|
565
|
+
);
|
|
566
|
+
return inAppWalletGetCallsStatus(options);
|
|
567
|
+
},
|
|
568
|
+
getCapabilities: async (options) => {
|
|
569
|
+
return {
|
|
570
|
+
[options.chainId ?? 1]: {
|
|
571
|
+
atomic: {
|
|
572
|
+
status: "unsupported",
|
|
573
|
+
},
|
|
574
|
+
paymasterService: {
|
|
575
|
+
supported: args.sponsorGas ?? false,
|
|
576
|
+
},
|
|
577
|
+
},
|
|
578
|
+
};
|
|
579
|
+
},
|
|
512
580
|
};
|
|
513
581
|
return account;
|
|
514
582
|
}
|
|
@@ -123,30 +123,28 @@ export async function connectWC(
|
|
|
123
123
|
optionalChains: optionalChains,
|
|
124
124
|
});
|
|
125
125
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
rpcMap,
|
|
146
|
-
},
|
|
126
|
+
// For UniversalProvider, we need to connect with namespaces
|
|
127
|
+
await provider.connect({
|
|
128
|
+
...(wcOptions?.pairingTopic
|
|
129
|
+
? { pairingTopic: wcOptions?.pairingTopic }
|
|
130
|
+
: {}),
|
|
131
|
+
namespaces: {
|
|
132
|
+
[NAMESPACE]: {
|
|
133
|
+
chains: chainsToRequest,
|
|
134
|
+
events: ["chainChanged", "accountsChanged"],
|
|
135
|
+
methods: [
|
|
136
|
+
"eth_sendTransaction",
|
|
137
|
+
"eth_signTransaction",
|
|
138
|
+
"eth_sign",
|
|
139
|
+
"personal_sign",
|
|
140
|
+
"eth_signTypedData",
|
|
141
|
+
"wallet_switchEthereumChain",
|
|
142
|
+
"wallet_addEthereumChain",
|
|
143
|
+
],
|
|
144
|
+
rpcMap,
|
|
147
145
|
},
|
|
148
|
-
}
|
|
149
|
-
}
|
|
146
|
+
},
|
|
147
|
+
});
|
|
150
148
|
|
|
151
149
|
setRequestedChainsIds(
|
|
152
150
|
chainsToRequest.map((x) => Number(x.split(":")[1])),
|
|
@@ -223,9 +221,14 @@ export async function autoConnectWC(
|
|
|
223
221
|
sessionHandler,
|
|
224
222
|
);
|
|
225
223
|
|
|
224
|
+
if (!provider.session) {
|
|
225
|
+
await provider.disconnect();
|
|
226
|
+
throw new Error("No wallet connect session found on provider.");
|
|
227
|
+
}
|
|
228
|
+
|
|
226
229
|
// For UniversalProvider, get accounts from enable() method
|
|
227
|
-
const
|
|
228
|
-
const address =
|
|
230
|
+
const namespaceAccounts = provider.session?.namespaces?.[NAMESPACE]?.accounts;
|
|
231
|
+
const address = namespaceAccounts?.[0]?.split(":")[2];
|
|
229
232
|
|
|
230
233
|
if (!address) {
|
|
231
234
|
throw new Error("No accounts found on provider.");
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"in-app-wallet-calls.js","sourceRoot":"","sources":["../../../../../../src/wallets/in-app/core/eip5972/in-app-wallet-calls.ts"],"names":[],"mappings":";;AAoBA,oDA4BC;AAKD,8DAmDC;AAvGD,uGAAiG;AACjG,mDAAsD;AACtD,qHAA4G;AAC5G,yGAAiG;AACjG,6DAA0D;AAE1D,2DAA6D;AAQ7D,MAAM,qBAAqB,GAAG,IAAI,eAAM,CAAQ,IAAI,CAAC,CAAC;AAEtD;;GAEG;AACI,KAAK,UAAU,oBAAoB,CAAC,IAG1C;IACC,MAAM,EAAE,OAAO,EAAE,K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
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.inAppWalletGetCapabilities = inAppWalletGetCapabilities;
|
|
4
|
-
/**
|
|
5
|
-
* @internal
|
|
6
|
-
*/
|
|
7
|
-
function inAppWalletGetCapabilities(args) {
|
|
8
|
-
const { wallet } = args;
|
|
9
|
-
const chain = wallet.getChain();
|
|
10
|
-
if (chain === undefined) {
|
|
11
|
-
return {
|
|
12
|
-
message: `Can't get capabilities, no active chain found for wallet: ${wallet.id}`,
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
const account = wallet.getAccount();
|
|
16
|
-
const config = wallet.getConfig();
|
|
17
|
-
const sponsorGas = config?.smartAccount && "sponsorGas" in config.smartAccount
|
|
18
|
-
? config.smartAccount.sponsorGas
|
|
19
|
-
: config?.executionMode
|
|
20
|
-
? config.executionMode.mode === "EIP4337" &&
|
|
21
|
-
config.executionMode.smartAccount &&
|
|
22
|
-
"sponsorGas" in config.executionMode.smartAccount
|
|
23
|
-
? config.executionMode.smartAccount.sponsorGas
|
|
24
|
-
: config.executionMode.mode === "EIP7702"
|
|
25
|
-
? config.executionMode.sponsorGas
|
|
26
|
-
: false
|
|
27
|
-
: false;
|
|
28
|
-
return {
|
|
29
|
-
[chain.id]: {
|
|
30
|
-
atomic: {
|
|
31
|
-
status: account?.sendBatchTransaction !== undefined
|
|
32
|
-
? "supported"
|
|
33
|
-
: "unsupported",
|
|
34
|
-
},
|
|
35
|
-
paymasterService: {
|
|
36
|
-
supported: sponsorGas,
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
//# sourceMappingURL=in-app-wallet-capabilities.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"in-app-wallet-capabilities.js","sourceRoot":"","sources":["../../../../../../src/wallets/in-app/core/eip5972/in-app-wallet-capabilities.ts"],"names":[],"mappings":";;AAKA,gEAyCC;AA5CD;;GAEG;AACH,SAAgB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{ value: true });
|
|
3
|
-
exports.smartWalletGetCapabilities = smartWalletGetCapabilities;
|
|
4
|
-
/**
|
|
5
|
-
* @internal
|
|
6
|
-
*/
|
|
7
|
-
function smartWalletGetCapabilities(args) {
|
|
8
|
-
const { wallet } = args;
|
|
9
|
-
const chain = wallet.getChain();
|
|
10
|
-
if (chain === undefined) {
|
|
11
|
-
return {
|
|
12
|
-
message: `Can't get capabilities, no active chain found for wallet: ${wallet.id}`,
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
const account = wallet.getAccount();
|
|
16
|
-
const config = wallet.getConfig() ?? {};
|
|
17
|
-
return {
|
|
18
|
-
[chain.id]: {
|
|
19
|
-
atomic: {
|
|
20
|
-
status: account?.sendBatchTransaction !== undefined
|
|
21
|
-
? "supported"
|
|
22
|
-
: "unsupported",
|
|
23
|
-
},
|
|
24
|
-
paymasterService: {
|
|
25
|
-
supported: "sponsorGas" in config ? config.sponsorGas : false,
|
|
26
|
-
},
|
|
27
|
-
},
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
//# sourceMappingURL=smart-wallet-capabilities.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"smart-wallet-capabilities.js","sourceRoot":"","sources":["../../../../../src/wallets/smart/lib/smart-wallet-capabilities.ts"],"names":[],"mappings":";;AAKA,gEA0BC;AA7BD;;GAEG;AACH,SAAgB,0BAA0B,CAAC,IAAwB;IACjE,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IAExB,MAAM,KAAK,GAAG,MAAM,CAAC,QAAQ,EAAE,CAAC;IAChC,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,OAAO;YACL,OAAO,EAAE,6DAA6D,MAAM,CAAC,EAAE,EAAE;SAClF,CAAC;IACJ,CAAC;IAED,MAAM,OAAO,GAAG,MAAM,CAAC,UAAU,EAAE,CAAC;IAEpC,MAAM,MAAM,GAAG,MAAM,CAAC,SAAS,EAAE,IAAI,EAAE,CAAC;IACxC,OAAO;QACL,CAAC,KAAK,CAAC,EAAE,CAAC,EAAE;YACV,MAAM,EAAE;gBACN,MAAM,EACJ,OAAO,EAAE,oBAAoB,KAAK,SAAS;oBACzC,CAAC,CAAC,WAAW;oBACb,CAAC,CAAC,aAAa;aACpB;YACD,gBAAgB,EAAE;gBAChB,SAAS,EAAE,YAAY,IAAI,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK;aAC9D;SACF;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"in-app-wallet-calls.js","sourceRoot":"","sources":["../../../../../../src/wallets/in-app/core/eip5972/in-app-wallet-calls.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,yBAAyB,EAAE,MAAM,sDAAsD,CAAC;AACjG,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,yBAAyB,EAAE,MAAM,iEAAiE,CAAC;AAC5G,OAAO,EAAE,oBAAoB,EAAE,MAAM,2DAA2D,CAAC;AACjG,OAAO,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAC;AAE1D,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAQ7D,MAAM,qBAAqB,GAAG,IAAI,MAAM,CAAQ,IAAI,CAAC,CAAC;AAEtD;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB,CAAC,IAG1C;IACC,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC;IAEhC,MAAM,MAAM,GAAU,EAAE,CAAC;IACzB,MAAM,EAAE,GAAG,cAAc,CAAC,EAAE,CAAC,CAAC;IAC9B,qBAAqB,CAAC,GAAG,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;IACtC,IAAI,OAAO,CAAC,oBAAoB,EAAE,CAAC;QACjC,MAAM,OAAO,GAAG,MAAM,oBAAoB,CAAC;YACzC,OAAO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EAAE,CAAC;SACzC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;QAClB,SAAS,EAAE,OAAO,CAAC,SAAS;QAC5B,WAAW,EAAE,OAAO,CAAC,WAAW;QAChC,OAAO,EAAE,OAAO,CAAC,OAAO;QACxB,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YAC7B,OAAO,EAAE,CAAC,CAAC,OAAO;YAClB,IAAI,EAAE,CAAC,CAAC,IAAI;YACZ,MAAM,EAAE,CAAC,CAAC,MAAM;SACjB,CAAC,CAAC;QACH,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,eAAe,EAAE,OAAO,CAAC,eAAe;KACzC,CAAC,CAAC;SACF,KAAK,CAAC,GAAG,EAAE;QACV,MAAM,GAAG,SAAS,CAAC;QACnB,OAAO,IAAI,CAAC,CAAC,sDAAsD;IACrE,CAAC,CAAC,CACL,CACF,CAAC;IAEJ,OAAO;QACL,MAAM,EAAE,KAAK;QACb,OAAO,EAAE,KAAK,CAAC,EAAE;QACjB,EAAE;QACF,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,IAAI,CAAC;QAC5C,MAAM;QACN,UAAU,EAAE,GAAG;QACf,OAAO,EAAE,OAAO;KACjB,CAAC;AACJ,CAAC"}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @internal
|
|
3
|
-
*/
|
|
4
|
-
export function inAppWalletGetCapabilities(args) {
|
|
5
|
-
const { wallet } = args;
|
|
6
|
-
const chain = wallet.getChain();
|
|
7
|
-
if (chain === undefined) {
|
|
8
|
-
return {
|
|
9
|
-
message: `Can't get capabilities, no active chain found for wallet: ${wallet.id}`,
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
const account = wallet.getAccount();
|
|
13
|
-
const config = wallet.getConfig();
|
|
14
|
-
const sponsorGas = config?.smartAccount && "sponsorGas" in config.smartAccount
|
|
15
|
-
? config.smartAccount.sponsorGas
|
|
16
|
-
: config?.executionMode
|
|
17
|
-
? config.executionMode.mode === "EIP4337" &&
|
|
18
|
-
config.executionMode.smartAccount &&
|
|
19
|
-
"sponsorGas" in config.executionMode.smartAccount
|
|
20
|
-
? config.executionMode.smartAccount.sponsorGas
|
|
21
|
-
: config.executionMode.mode === "EIP7702"
|
|
22
|
-
? config.executionMode.sponsorGas
|
|
23
|
-
: false
|
|
24
|
-
: false;
|
|
25
|
-
return {
|
|
26
|
-
[chain.id]: {
|
|
27
|
-
atomic: {
|
|
28
|
-
status: account?.sendBatchTransaction !== undefined
|
|
29
|
-
? "supported"
|
|
30
|
-
: "unsupported",
|
|
31
|
-
},
|
|
32
|
-
paymasterService: {
|
|
33
|
-
supported: sponsorGas,
|
|
34
|
-
},
|
|
35
|
-
},
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
//# sourceMappingURL=in-app-wallet-capabilities.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"in-app-wallet-capabilities.js","sourceRoot":"","sources":["../../../../../../src/wallets/in-app/core/eip5972/in-app-wallet-capabilities.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,UAAU,0BAA0B,CAAC,IAE1C;IACC,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IAExB,MAAM,KAAK,GAAG,MAAM,CAAC,QAAQ,EAAE,CAAC;IAChC,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,OAAO;YACL,OAAO,EAAE,6DAA6D,MAAM,CAAC,EAAE,EAAE;SAClF,CAAC;IACJ,CAAC;IAED,MAAM,OAAO,GAAG,MAAM,CAAC,UAAU,EAAE,CAAC;IAEpC,MAAM,MAAM,GAAG,MAAM,CAAC,SAAS,EAAE,CAAC;IAClC,MAAM,UAAU,GACd,MAAM,EAAE,YAAY,IAAI,YAAY,IAAI,MAAM,CAAC,YAAY;QACzD,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC,UAAU;QAChC,CAAC,CAAC,MAAM,EAAE,aAAa;YACrB,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,IAAI,KAAK,SAAS;gBACvC,MAAM,CAAC,aAAa,CAAC,YAAY;gBACjC,YAAY,IAAI,MAAM,CAAC,aAAa,CAAC,YAAY;gBACjD,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,YAAY,CAAC,UAAU;gBAC9C,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,IAAI,KAAK,SAAS;oBACvC,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,UAAU;oBACjC,CAAC,CAAC,KAAK;YACX,CAAC,CAAC,KAAK,CAAC;IAEd,OAAO;QACL,CAAC,KAAK,CAAC,EAAE,CAAC,EAAE;YACV,MAAM,EAAE;gBACN,MAAM,EACJ,OAAO,EAAE,oBAAoB,KAAK,SAAS;oBACzC,CAAC,CAAC,WAAW;oBACb,CAAC,CAAC,aAAa;aACpB;YACD,gBAAgB,EAAE;gBAChB,SAAS,EAAE,UAAU;aACtB;SACF;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @internal
|
|
3
|
-
*/
|
|
4
|
-
export function smartWalletGetCapabilities(args) {
|
|
5
|
-
const { wallet } = args;
|
|
6
|
-
const chain = wallet.getChain();
|
|
7
|
-
if (chain === undefined) {
|
|
8
|
-
return {
|
|
9
|
-
message: `Can't get capabilities, no active chain found for wallet: ${wallet.id}`,
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
const account = wallet.getAccount();
|
|
13
|
-
const config = wallet.getConfig() ?? {};
|
|
14
|
-
return {
|
|
15
|
-
[chain.id]: {
|
|
16
|
-
atomic: {
|
|
17
|
-
status: account?.sendBatchTransaction !== undefined
|
|
18
|
-
? "supported"
|
|
19
|
-
: "unsupported",
|
|
20
|
-
},
|
|
21
|
-
paymasterService: {
|
|
22
|
-
supported: "sponsorGas" in config ? config.sponsorGas : false,
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
//# sourceMappingURL=smart-wallet-capabilities.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"smart-wallet-capabilities.js","sourceRoot":"","sources":["../../../../../src/wallets/smart/lib/smart-wallet-capabilities.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,UAAU,0BAA0B,CAAC,IAAwB;IACjE,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IAExB,MAAM,KAAK,GAAG,MAAM,CAAC,QAAQ,EAAE,CAAC;IAChC,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,OAAO;YACL,OAAO,EAAE,6DAA6D,MAAM,CAAC,EAAE,EAAE;SAClF,CAAC;IACJ,CAAC;IAED,MAAM,OAAO,GAAG,MAAM,CAAC,UAAU,EAAE,CAAC;IAEpC,MAAM,MAAM,GAAG,MAAM,CAAC,SAAS,EAAE,IAAI,EAAE,CAAC;IACxC,OAAO;QACL,CAAC,KAAK,CAAC,EAAE,CAAC,EAAE;YACV,MAAM,EAAE;gBACN,MAAM,EACJ,OAAO,EAAE,oBAAoB,KAAK,SAAS;oBACzC,CAAC,CAAC,WAAW;oBACb,CAAC,CAAC,aAAa;aACpB;YACD,gBAAgB,EAAE;gBAChB,SAAS,EAAE,YAAY,IAAI,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK;aAC9D;SACF;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"in-app-wallet-calls.d.ts","sourceRoot":"","sources":["../../../../../../src/wallets/in-app/core/eip5972/in-app-wallet-calls.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAQnE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AACvE,OAAO,KAAK,EACV,sBAAsB,EAEvB,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AAIrE;;GAEG;AACH,wBAAsB,oBAAoB,CAAC,IAAI,EAAE;IAC/C,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,gBAAgB,EAAE,CAAC;CAC3B,GAAG,OAAO,CAAC,MAAM,CAAC,CAyBlB;AAED;;GAEG;AACH,wBAAsB,yBAAyB,CAAC,IAAI,EAAE;IACpD,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,cAAc,CAAC;IACvB,EAAE,EAAE,MAAM,CAAC;CACZ,GAAG,OAAO,CAAC,sBAAsB,CAAC,CA+ClC"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { Wallet } from "../../../interfaces/wallet.js";
|
|
2
|
-
/**
|
|
3
|
-
* @internal
|
|
4
|
-
*/
|
|
5
|
-
export declare function inAppWalletGetCapabilities(args: {
|
|
6
|
-
wallet: Wallet<"inApp" | "embedded">;
|
|
7
|
-
}): {
|
|
8
|
-
message: string;
|
|
9
|
-
} | {
|
|
10
|
-
[x: number]: {
|
|
11
|
-
atomic: {
|
|
12
|
-
status: string;
|
|
13
|
-
};
|
|
14
|
-
paymasterService: {
|
|
15
|
-
supported: boolean | undefined;
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
message?: undefined;
|
|
19
|
-
};
|
|
20
|
-
//# sourceMappingURL=in-app-wallet-capabilities.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"in-app-wallet-capabilities.d.ts","sourceRoot":"","sources":["../../../../../../src/wallets/in-app/core/eip5972/in-app-wallet-capabilities.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AAE5D;;GAEG;AACH,wBAAgB,0BAA0B,CAAC,IAAI,EAAE;IAC/C,MAAM,EAAE,MAAM,CAAC,OAAO,GAAG,UAAU,CAAC,CAAC;CACtC;;;;;;;;;;;;EAuCA"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { Wallet } from "../../interfaces/wallet.js";
|
|
2
|
-
/**
|
|
3
|
-
* @internal
|
|
4
|
-
*/
|
|
5
|
-
export declare function smartWalletGetCapabilities(args: {
|
|
6
|
-
wallet: Wallet;
|
|
7
|
-
}): {
|
|
8
|
-
message: string;
|
|
9
|
-
} | {
|
|
10
|
-
[x: number]: {
|
|
11
|
-
atomic: {
|
|
12
|
-
status: string;
|
|
13
|
-
};
|
|
14
|
-
paymasterService: {
|
|
15
|
-
supported: boolean;
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
message?: undefined;
|
|
19
|
-
};
|
|
20
|
-
//# sourceMappingURL=smart-wallet-capabilities.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"smart-wallet-capabilities.d.ts","sourceRoot":"","sources":["../../../../../src/wallets/smart/lib/smart-wallet-capabilities.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAEzD;;GAEG;AACH,wBAAgB,0BAA0B,CAAC,IAAI,EAAE;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE;;;;;;;;;;;;EA0BlE"}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import type { Wallet } from "../../../interfaces/wallet.js";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @internal
|
|
5
|
-
*/
|
|
6
|
-
export function inAppWalletGetCapabilities(args: {
|
|
7
|
-
wallet: Wallet<"inApp" | "embedded">;
|
|
8
|
-
}) {
|
|
9
|
-
const { wallet } = args;
|
|
10
|
-
|
|
11
|
-
const chain = wallet.getChain();
|
|
12
|
-
if (chain === undefined) {
|
|
13
|
-
return {
|
|
14
|
-
message: `Can't get capabilities, no active chain found for wallet: ${wallet.id}`,
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
const account = wallet.getAccount();
|
|
19
|
-
|
|
20
|
-
const config = wallet.getConfig();
|
|
21
|
-
const sponsorGas =
|
|
22
|
-
config?.smartAccount && "sponsorGas" in config.smartAccount
|
|
23
|
-
? config.smartAccount.sponsorGas
|
|
24
|
-
: config?.executionMode
|
|
25
|
-
? config.executionMode.mode === "EIP4337" &&
|
|
26
|
-
config.executionMode.smartAccount &&
|
|
27
|
-
"sponsorGas" in config.executionMode.smartAccount
|
|
28
|
-
? config.executionMode.smartAccount.sponsorGas
|
|
29
|
-
: config.executionMode.mode === "EIP7702"
|
|
30
|
-
? config.executionMode.sponsorGas
|
|
31
|
-
: false
|
|
32
|
-
: false;
|
|
33
|
-
|
|
34
|
-
return {
|
|
35
|
-
[chain.id]: {
|
|
36
|
-
atomic: {
|
|
37
|
-
status:
|
|
38
|
-
account?.sendBatchTransaction !== undefined
|
|
39
|
-
? "supported"
|
|
40
|
-
: "unsupported",
|
|
41
|
-
},
|
|
42
|
-
paymasterService: {
|
|
43
|
-
supported: sponsorGas,
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
|
-
};
|
|
47
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import type { Wallet } from "../../interfaces/wallet.js";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @internal
|
|
5
|
-
*/
|
|
6
|
-
export function smartWalletGetCapabilities(args: { wallet: Wallet }) {
|
|
7
|
-
const { wallet } = args;
|
|
8
|
-
|
|
9
|
-
const chain = wallet.getChain();
|
|
10
|
-
if (chain === undefined) {
|
|
11
|
-
return {
|
|
12
|
-
message: `Can't get capabilities, no active chain found for wallet: ${wallet.id}`,
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
const account = wallet.getAccount();
|
|
17
|
-
|
|
18
|
-
const config = wallet.getConfig() ?? {};
|
|
19
|
-
return {
|
|
20
|
-
[chain.id]: {
|
|
21
|
-
atomic: {
|
|
22
|
-
status:
|
|
23
|
-
account?.sendBatchTransaction !== undefined
|
|
24
|
-
? "supported"
|
|
25
|
-
: "unsupported",
|
|
26
|
-
},
|
|
27
|
-
paymasterService: {
|
|
28
|
-
supported: "sponsorGas" in config ? config.sponsorGas : false,
|
|
29
|
-
},
|
|
30
|
-
},
|
|
31
|
-
};
|
|
32
|
-
}
|