accounts 0.7.0 → 0.7.2
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/CHANGELOG.md +16 -0
- package/dist/core/AccessKey.d.ts.map +1 -1
- package/dist/core/AccessKey.js +12 -26
- package/dist/core/AccessKey.js.map +1 -1
- package/dist/core/Account.d.ts +12 -0
- package/dist/core/Account.d.ts.map +1 -1
- package/dist/core/Account.js +24 -2
- package/dist/core/Account.js.map +1 -1
- package/dist/core/Adapter.d.ts +9 -0
- package/dist/core/Adapter.d.ts.map +1 -1
- package/dist/core/Provider.d.ts +1 -1
- package/dist/core/Provider.d.ts.map +1 -1
- package/dist/core/Provider.js +2 -2
- package/dist/core/Provider.js.map +1 -1
- package/dist/core/Schema.d.ts +54 -0
- package/dist/core/Schema.d.ts.map +1 -1
- package/dist/core/adapters/local.d.ts.map +1 -1
- package/dist/core/adapters/local.js +4 -2
- package/dist/core/adapters/local.js.map +1 -1
- package/dist/core/zod/rpc.d.ts +110 -0
- package/dist/core/zod/rpc.d.ts.map +1 -1
- package/dist/core/zod/rpc.js +16 -5
- package/dist/core/zod/rpc.js.map +1 -1
- package/dist/react-native/adapter.d.ts.map +1 -1
- package/dist/react-native/adapter.js +76 -21
- package/dist/react-native/adapter.js.map +1 -1
- package/dist/server/internal/handlers/codeAuth.d.ts +1 -1
- package/dist/server/internal/handlers/codeAuth.js +2 -2
- package/dist/server/internal/handlers/codeAuth.js.map +1 -1
- package/dist/server/internal/handlers/relay.d.ts +2 -1
- package/dist/server/internal/handlers/relay.d.ts.map +1 -1
- package/dist/server/internal/handlers/relay.js +8 -2
- package/dist/server/internal/handlers/relay.js.map +1 -1
- package/dist/wagmi/index.d.ts +38 -2
- package/dist/wagmi/index.d.ts.map +1 -1
- package/dist/wagmi/index.js +35 -2
- package/dist/wagmi/index.js.map +1 -1
- package/package.json +11 -7
- package/src/core/AccessKey.ts +13 -30
- package/src/core/Account.test.ts +145 -0
- package/src/core/Account.ts +34 -3
- package/src/core/Adapter.ts +11 -1
- package/src/core/Provider.test.ts +27 -19
- package/src/core/Provider.ts +3 -3
- package/src/core/adapters/local.ts +4 -2
- package/src/core/zod/rpc.ts +39 -4
- package/src/react-native/Provider.test.ts +115 -0
- package/src/react-native/adapter.ts +96 -22
- package/src/server/internal/handlers/codeAuth.ts +3 -3
- package/src/server/internal/handlers/relay.ts +9 -3
- package/src/wagmi/index.ts +38 -2
- package/dist/wagmi/Connector.d.ts +0 -130
- package/dist/wagmi/Connector.d.ts.map +0 -1
- package/dist/wagmi/Connector.js +0 -272
- package/dist/wagmi/Connector.js.map +0 -1
- package/src/wagmi/Connector.ts +0 -330
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
} from 'ox'
|
|
10
10
|
import { KeyAuthorization } from 'ox/tempo'
|
|
11
11
|
import { prepareTransactionRequest } from 'viem/actions'
|
|
12
|
-
import { Account as TempoAccount, Secp256k1 } from 'viem/tempo'
|
|
12
|
+
import { Actions, Account as TempoAccount, Secp256k1 } from 'viem/tempo'
|
|
13
13
|
|
|
14
14
|
import * as AccessKey from '../core/AccessKey.js'
|
|
15
15
|
import * as Adapter from '../core/Adapter.js'
|
|
@@ -28,27 +28,59 @@ export function reactNative(options: reactNative.Options): Adapter.Adapter {
|
|
|
28
28
|
async function loadManagedKey(
|
|
29
29
|
address: Adapter.authorizeAccessKey.ReturnType['rootAddress'],
|
|
30
30
|
parameters: loadManagedKey.Options = {},
|
|
31
|
-
): Promise<
|
|
31
|
+
): Promise<loadManagedKey.ReturnType | undefined> {
|
|
32
32
|
const { keyType } = parameters
|
|
33
33
|
const { secureStorage } = options
|
|
34
34
|
if (!secureStorage) return undefined
|
|
35
35
|
|
|
36
36
|
const { chainId } = store.getState()
|
|
37
|
-
const
|
|
38
|
-
|
|
37
|
+
const storageKeys = keyType
|
|
38
|
+
? [managedKeyStorageKey(address, chainId, keyType)]
|
|
39
|
+
: [
|
|
40
|
+
managedKeyStorageKey(address, chainId, 'secp256k1'),
|
|
41
|
+
managedKeyStorageKey(address, chainId, 'p256'),
|
|
42
|
+
managedKeyStorageKey(address, chainId),
|
|
43
|
+
]
|
|
44
|
+
let entry: ManagedKeyEntry | null = null
|
|
45
|
+
for (const storageKey of storageKeys) {
|
|
46
|
+
entry = await secureStorage.getItem<ManagedKeyEntry>(storageKey)
|
|
47
|
+
if (entry) break
|
|
48
|
+
}
|
|
39
49
|
if (!entry) return undefined
|
|
40
50
|
|
|
51
|
+
const account =
|
|
52
|
+
entry.keyType === 'p256'
|
|
53
|
+
? TempoAccount.fromP256(entry.key, { access: address })
|
|
54
|
+
: TempoAccount.fromSecp256k1(entry.key, { access: address })
|
|
55
|
+
const keyAddress = core_Address.fromPublicKey(PublicKey.from(account.publicKey))
|
|
41
56
|
const deserialized = KeyAuthorization.deserialize(entry.keyAuthorization)
|
|
42
57
|
if (!deserialized.signature) throw new Error('Managed access key is missing a signature.')
|
|
43
58
|
const keyAuthorization = deserialized as KeyAuthorization.Signed
|
|
44
|
-
AccessKey.save({
|
|
45
|
-
address,
|
|
46
|
-
keyAuthorization,
|
|
47
|
-
privateKey: entry.key,
|
|
48
|
-
store,
|
|
49
|
-
})
|
|
50
59
|
|
|
51
|
-
|
|
60
|
+
if (keyAuthorization.address.toLowerCase() === keyAddress.toLowerCase())
|
|
61
|
+
AccessKey.save({
|
|
62
|
+
address,
|
|
63
|
+
keyAuthorization,
|
|
64
|
+
privateKey: entry.key,
|
|
65
|
+
store,
|
|
66
|
+
})
|
|
67
|
+
else
|
|
68
|
+
store.setState((state) => ({
|
|
69
|
+
accessKeys: state.accessKeys.filter(
|
|
70
|
+
(accessKey) =>
|
|
71
|
+
accessKey.address.toLowerCase() !== keyAuthorization.address.toLowerCase(),
|
|
72
|
+
),
|
|
73
|
+
}))
|
|
74
|
+
|
|
75
|
+
return {
|
|
76
|
+
account,
|
|
77
|
+
expiry: entry.expiry,
|
|
78
|
+
key: entry.key,
|
|
79
|
+
keyAddress,
|
|
80
|
+
keyType: entry.keyType,
|
|
81
|
+
publicKey: account.publicKey,
|
|
82
|
+
storedAuthorization: keyAuthorization,
|
|
83
|
+
}
|
|
52
84
|
}
|
|
53
85
|
|
|
54
86
|
async function resolveManagedKey(
|
|
@@ -63,19 +95,14 @@ export function reactNative(options: reactNative.Options): Adapter.Adapter {
|
|
|
63
95
|
const entry = address
|
|
64
96
|
? await loadManagedKey(address, requestedKeyType ? { keyType: requestedKeyType } : {})
|
|
65
97
|
: undefined
|
|
66
|
-
if (entry)
|
|
67
|
-
const account =
|
|
68
|
-
entry.keyType === 'p256'
|
|
69
|
-
? TempoAccount.fromP256(entry.key, { access: address })
|
|
70
|
-
: TempoAccount.fromSecp256k1(entry.key, { access: address })
|
|
98
|
+
if (entry)
|
|
71
99
|
return {
|
|
72
|
-
account,
|
|
100
|
+
account: entry.account,
|
|
73
101
|
key: entry.key,
|
|
74
102
|
keyAddress: entry.keyAddress,
|
|
75
103
|
keyType: entry.keyType,
|
|
76
|
-
publicKey:
|
|
104
|
+
publicKey: entry.publicKey,
|
|
77
105
|
}
|
|
78
|
-
}
|
|
79
106
|
|
|
80
107
|
const nextKeyType = requestedKeyType === 'p256' ? 'p256' : 'secp256k1'
|
|
81
108
|
const key = nextKeyType === 'p256' ? P256.randomPrivateKey() : Secp256k1.randomPrivateKey()
|
|
@@ -124,6 +151,44 @@ export function reactNative(options: reactNative.Options): Adapter.Adapter {
|
|
|
124
151
|
await secureStorage.setItem(storageKey, entry)
|
|
125
152
|
}
|
|
126
153
|
|
|
154
|
+
async function isManagedKeyAuthorized(
|
|
155
|
+
address: Adapter.authorizeAccessKey.ReturnType['rootAddress'],
|
|
156
|
+
managedKey: loadManagedKey.ReturnType,
|
|
157
|
+
) {
|
|
158
|
+
try {
|
|
159
|
+
const metadata = await Actions.accessKey.getMetadata(getClient(), {
|
|
160
|
+
account: address,
|
|
161
|
+
accessKey: managedKey.keyAddress,
|
|
162
|
+
})
|
|
163
|
+
return (
|
|
164
|
+
metadata.address.toLowerCase() === managedKey.keyAddress.toLowerCase() &&
|
|
165
|
+
!metadata.isRevoked
|
|
166
|
+
)
|
|
167
|
+
} catch {
|
|
168
|
+
return false
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
async function reauthorizeManagedKey(
|
|
173
|
+
address: Adapter.authorizeAccessKey.ReturnType['rootAddress'],
|
|
174
|
+
managedKey: loadManagedKey.ReturnType,
|
|
175
|
+
) {
|
|
176
|
+
const result = await authorize({
|
|
177
|
+
account: address,
|
|
178
|
+
authorizeAccessKey: {
|
|
179
|
+
expiry: managedKey.expiry,
|
|
180
|
+
keyType: managedKey.keyType,
|
|
181
|
+
...(managedKey.storedAuthorization.limits
|
|
182
|
+
? { limits: managedKey.storedAuthorization.limits.map((limit) => ({ ...limit })) }
|
|
183
|
+
: {}),
|
|
184
|
+
publicKey: managedKey.publicKey,
|
|
185
|
+
},
|
|
186
|
+
method: 'wallet_authorizeAccessKey',
|
|
187
|
+
})
|
|
188
|
+
await saveManagedKey(address, managedKey, result.keyAuthorization)
|
|
189
|
+
return result.keyAuthorization
|
|
190
|
+
}
|
|
191
|
+
|
|
127
192
|
async function withManagedAccessKey<result>(
|
|
128
193
|
fn: (
|
|
129
194
|
account: TempoAccount.Account,
|
|
@@ -131,10 +196,14 @@ export function reactNative(options: reactNative.Options): Adapter.Adapter {
|
|
|
131
196
|
) => Promise<result>,
|
|
132
197
|
) {
|
|
133
198
|
const rootAddress = store.getState().accounts[store.getState().activeAccount]?.address
|
|
134
|
-
|
|
199
|
+
const managedKey = rootAddress ? await loadManagedKey(rootAddress) : undefined
|
|
200
|
+
|
|
201
|
+
const account = managedKey?.account ?? getAccount({ signable: true })
|
|
202
|
+
let keyAuthorization = AccessKey.getPending(account, { store })
|
|
203
|
+
if (rootAddress && managedKey && !keyAuthorization)
|
|
204
|
+
if (!(await isManagedKeyAuthorized(rootAddress, managedKey)))
|
|
205
|
+
keyAuthorization = await reauthorizeManagedKey(rootAddress, managedKey)
|
|
135
206
|
|
|
136
|
-
const account = getAccount({ signable: true })
|
|
137
|
-
const keyAuthorization = AccessKey.getPending(account, { store })
|
|
138
207
|
try {
|
|
139
208
|
const result = await fn(account, keyAuthorization ?? undefined)
|
|
140
209
|
AccessKey.removePending(account, { store })
|
|
@@ -371,6 +440,11 @@ declare namespace loadManagedKey {
|
|
|
371
440
|
type Options = {
|
|
372
441
|
keyType?: 'secp256k1' | 'p256' | undefined
|
|
373
442
|
}
|
|
443
|
+
|
|
444
|
+
type ReturnType = resolveManagedKey.ReturnType & {
|
|
445
|
+
expiry: number
|
|
446
|
+
storedAuthorization: KeyAuthorization.Signed
|
|
447
|
+
}
|
|
374
448
|
}
|
|
375
449
|
|
|
376
450
|
/** Entry shape persisted to secure storage for managed access keys. */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Chain, Client, Transport } from 'viem'
|
|
2
2
|
import { createClient, http } from 'viem'
|
|
3
|
-
import { tempo, tempoModerato } from 'viem/chains'
|
|
3
|
+
import { tempo, tempoDevnet, tempoModerato } from 'viem/chains'
|
|
4
4
|
import * as z from 'zod/mini'
|
|
5
5
|
|
|
6
6
|
import * as CliAuth from '../../CliAuth.js'
|
|
@@ -20,7 +20,7 @@ import { type Handler, from } from '../../Handler.js'
|
|
|
20
20
|
*/
|
|
21
21
|
export function codeAuth(options: codeAuth.Options = {}): Handler {
|
|
22
22
|
const {
|
|
23
|
-
chains = [tempo, tempoModerato],
|
|
23
|
+
chains = [tempo, tempoModerato, tempoDevnet],
|
|
24
24
|
now,
|
|
25
25
|
path = '/auth/pkce',
|
|
26
26
|
policy,
|
|
@@ -127,7 +127,7 @@ export declare namespace codeAuth {
|
|
|
127
127
|
/**
|
|
128
128
|
* Supported chains. The handler resolves the client based on chain IDs carried
|
|
129
129
|
* by device-code requests and key authorizations.
|
|
130
|
-
* @default [tempo, tempoModerato]
|
|
130
|
+
* @default [tempo, tempoModerato, tempoDevnet]
|
|
131
131
|
*/
|
|
132
132
|
chains?: readonly [Chain, ...Chain[]] | undefined
|
|
133
133
|
/** Time source used for TTL evaluation. */
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
} from 'viem'
|
|
16
16
|
import type { LocalAccount } from 'viem/accounts'
|
|
17
17
|
import { simulateCalls } from 'viem/actions'
|
|
18
|
-
import { tempo, tempoLocalnet, tempoMainnet, tempoModerato } from 'viem/chains'
|
|
18
|
+
import { tempo, tempoDevnet, tempoLocalnet, tempoMainnet, tempoModerato } from 'viem/chains'
|
|
19
19
|
import { Abis, Actions, Addresses, Capabilities, Transaction } from 'viem/tempo'
|
|
20
20
|
|
|
21
21
|
import * as ExecutionError from '../../../core/ExecutionError.js'
|
|
@@ -64,7 +64,7 @@ import * as Utils from './utils.js'
|
|
|
64
64
|
*/
|
|
65
65
|
export function relay(options: relay.Options = {}): Handler {
|
|
66
66
|
const {
|
|
67
|
-
chains = [tempo, tempoModerato],
|
|
67
|
+
chains = [tempo, tempoModerato, tempoDevnet],
|
|
68
68
|
onRequest,
|
|
69
69
|
path = '/',
|
|
70
70
|
resolveTokens = (chainId) =>
|
|
@@ -420,6 +420,12 @@ export namespace relay {
|
|
|
420
420
|
'0x20c0000000000000000000009e8d7eb59b783726', // USDC.e
|
|
421
421
|
'0x20c000000000000000000000d72572838bbee59c', // EURC.e
|
|
422
422
|
],
|
|
423
|
+
[tempoDevnet.id]: [
|
|
424
|
+
'0x20c0000000000000000000000000000000000000', // pathUSD
|
|
425
|
+
'0x20c0000000000000000000000000000000000001', // alphaUSD
|
|
426
|
+
'0x20c0000000000000000000000000000000000002', // betaUSD
|
|
427
|
+
'0x20c0000000000000000000000000000000000003', // thetaUSD
|
|
428
|
+
],
|
|
423
429
|
[tempoLocalnet.id]: [
|
|
424
430
|
'0x20c0000000000000000000000000000000000000', // pathUSD
|
|
425
431
|
'0x20c0000000000000000000000000000000000001', // alphaUSD
|
|
@@ -442,7 +448,7 @@ export namespace relay {
|
|
|
442
448
|
/**
|
|
443
449
|
* Supported chains. The handler resolves the client based on the
|
|
444
450
|
* `chainId` in the incoming transaction.
|
|
445
|
-
* @default [tempo, tempoModerato]
|
|
451
|
+
* @default [tempo, tempoModerato, tempoDevnet]
|
|
446
452
|
*/
|
|
447
453
|
chains?: readonly [Chain, ...Chain[]] | undefined
|
|
448
454
|
/**
|
package/src/wagmi/index.ts
CHANGED
|
@@ -1,2 +1,38 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import * as wagmi_tempo from '@wagmi/core/tempo'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Compatibility object for legacy `accounts/wagmi` `Connector.*` access.
|
|
5
|
+
*
|
|
6
|
+
* @deprecated Import named exports from `wagmi/tempo` or `@wagmi/core/tempo` instead. If you only need `tempoWallet`, you can also import it from `wagmi/connectors`.
|
|
7
|
+
*/
|
|
8
|
+
export const Connector = {
|
|
9
|
+
...wagmi_tempo,
|
|
10
|
+
dialog: wagmi_tempo.tempoWallet,
|
|
11
|
+
} as const
|
|
12
|
+
|
|
13
|
+
export {
|
|
14
|
+
/**
|
|
15
|
+
* Compatibility alias for the Tempo Wallet connector.
|
|
16
|
+
*
|
|
17
|
+
* @deprecated Import `tempoWallet` from `wagmi/connectors`, `wagmi/tempo`, or `@wagmi/core/tempo` instead.
|
|
18
|
+
*/
|
|
19
|
+
tempoWallet as dialog,
|
|
20
|
+
/**
|
|
21
|
+
* Compatibility alias for the Tempo `dangerous_secp256k1` connector.
|
|
22
|
+
*
|
|
23
|
+
* @deprecated Import `dangerous_secp256k1` from `wagmi/tempo` or `@wagmi/core/tempo` instead.
|
|
24
|
+
*/
|
|
25
|
+
dangerous_secp256k1,
|
|
26
|
+
/**
|
|
27
|
+
* Compatibility alias for the Tempo Wallet connector.
|
|
28
|
+
*
|
|
29
|
+
* @deprecated Import `tempoWallet` from `wagmi/connectors`, `wagmi/tempo`, or `@wagmi/core/tempo` instead.
|
|
30
|
+
*/
|
|
31
|
+
tempoWallet,
|
|
32
|
+
/**
|
|
33
|
+
* Compatibility alias for the Tempo `webAuthn` connector.
|
|
34
|
+
*
|
|
35
|
+
* @deprecated Import `webAuthn` from `wagmi/tempo` or `@wagmi/core/tempo` instead.
|
|
36
|
+
*/
|
|
37
|
+
webAuthn,
|
|
38
|
+
} from '@wagmi/core/tempo'
|
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
import { type Address } from 'viem';
|
|
2
|
-
import * as z from 'zod/mini';
|
|
3
|
-
import { dangerous_secp256k1 as dangerous_secp256k1_adapter } from '../core/adapters/dangerous_secp256k1.js';
|
|
4
|
-
import { dialog as core_dialog } from '../core/adapters/dialog.js';
|
|
5
|
-
import { webAuthn as webAuthn_adapter } from '../core/adapters/webAuthn.js';
|
|
6
|
-
import * as Provider from '../core/Provider.js';
|
|
7
|
-
import * as Rpc from '../core/zod/rpc.js';
|
|
8
|
-
/**
|
|
9
|
-
* Creates a wagmi connector backed by an accounts provider.
|
|
10
|
-
*/
|
|
11
|
-
export declare function setup(parameters?: setup.Parameters): import("@wagmi/core").CreateConnectorFn<Provider.Provider, {
|
|
12
|
-
connect<withCapabilities extends boolean = false>(parameters?: {
|
|
13
|
-
capabilities?: NonNullable<z.output<typeof Rpc.wallet_connect.capabilities.request>> | undefined;
|
|
14
|
-
chainId?: number | undefined;
|
|
15
|
-
isReconnecting?: boolean | undefined;
|
|
16
|
-
withCapabilities?: withCapabilities | boolean | undefined;
|
|
17
|
-
}): Promise<{
|
|
18
|
-
accounts: withCapabilities extends true ? readonly {
|
|
19
|
-
address: Address;
|
|
20
|
-
capabilities: z.output<typeof Rpc.wallet_connect.capabilities.result>;
|
|
21
|
-
}[] : readonly Address[];
|
|
22
|
-
chainId: number;
|
|
23
|
-
}>;
|
|
24
|
-
}, Record<string, unknown>>;
|
|
25
|
-
export declare namespace setup {
|
|
26
|
-
type Parameters = Provider.create.Options;
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Creates a wagmi connector backed by a WebAuthn adapter.
|
|
30
|
-
*
|
|
31
|
-
* @example
|
|
32
|
-
* ```ts
|
|
33
|
-
* import { createConfig, http } from 'wagmi'
|
|
34
|
-
* import { tempoModerato } from 'wagmi/chains'
|
|
35
|
-
* import { webAuthn } from 'accounts/wagmi'
|
|
36
|
-
*
|
|
37
|
-
* const config = createConfig({
|
|
38
|
-
* chains: [tempoModerato],
|
|
39
|
-
* connectors: [webAuthn()],
|
|
40
|
-
* transports: { [tempoModerato.id]: http() },
|
|
41
|
-
* })
|
|
42
|
-
* ```
|
|
43
|
-
*/
|
|
44
|
-
export declare function webAuthn(options?: webAuthn.Options): import("@wagmi/core").CreateConnectorFn<Provider.Provider, {
|
|
45
|
-
connect<withCapabilities extends boolean = false>(parameters?: {
|
|
46
|
-
capabilities?: NonNullable<z.output<typeof Rpc.wallet_connect.capabilities.request>> | undefined;
|
|
47
|
-
chainId?: number | undefined;
|
|
48
|
-
isReconnecting?: boolean | undefined;
|
|
49
|
-
withCapabilities?: withCapabilities | boolean | undefined;
|
|
50
|
-
}): Promise<{
|
|
51
|
-
accounts: withCapabilities extends true ? readonly {
|
|
52
|
-
address: Address;
|
|
53
|
-
capabilities: z.output<typeof Rpc.wallet_connect.capabilities.result>;
|
|
54
|
-
}[] : readonly Address[];
|
|
55
|
-
chainId: number;
|
|
56
|
-
}>;
|
|
57
|
-
}, Record<string, unknown>>;
|
|
58
|
-
export declare namespace webAuthn {
|
|
59
|
-
type Options = webAuthn_adapter.Options & Omit<setup.Parameters, 'adapter'>;
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* Creates a wagmi connector backed by a dialog adapter.
|
|
63
|
-
*
|
|
64
|
-
* @example
|
|
65
|
-
* ```ts
|
|
66
|
-
* import { createConfig, http } from 'wagmi'
|
|
67
|
-
* import { tempoModerato } from 'wagmi/chains'
|
|
68
|
-
* import { dialog } from 'accounts/wagmi'
|
|
69
|
-
*
|
|
70
|
-
* const config = createConfig({
|
|
71
|
-
* chains: [tempoModerato],
|
|
72
|
-
* connectors: [dialog()],
|
|
73
|
-
* transports: { [tempoModerato.id]: http() },
|
|
74
|
-
* })
|
|
75
|
-
* ```
|
|
76
|
-
*/
|
|
77
|
-
export declare function dialog(options?: dialog.Options): import("@wagmi/core").CreateConnectorFn<Provider.Provider, {
|
|
78
|
-
connect<withCapabilities extends boolean = false>(parameters?: {
|
|
79
|
-
capabilities?: NonNullable<z.output<typeof Rpc.wallet_connect.capabilities.request>> | undefined;
|
|
80
|
-
chainId?: number | undefined;
|
|
81
|
-
isReconnecting?: boolean | undefined;
|
|
82
|
-
withCapabilities?: withCapabilities | boolean | undefined;
|
|
83
|
-
}): Promise<{
|
|
84
|
-
accounts: withCapabilities extends true ? readonly {
|
|
85
|
-
address: Address;
|
|
86
|
-
capabilities: z.output<typeof Rpc.wallet_connect.capabilities.result>;
|
|
87
|
-
}[] : readonly Address[];
|
|
88
|
-
chainId: number;
|
|
89
|
-
}>;
|
|
90
|
-
}, Record<string, unknown>>;
|
|
91
|
-
export declare namespace dialog {
|
|
92
|
-
type Options = core_dialog.Options & Omit<setup.Parameters, 'adapter'>;
|
|
93
|
-
}
|
|
94
|
-
/**
|
|
95
|
-
* Creates a wagmi connector backed by a secp256k1 adapter.
|
|
96
|
-
*
|
|
97
|
-
* @deprecated Private keys are stored in plaintext via the provider's storage adapter.
|
|
98
|
-
* Use only for development, testing, or when the threat model allows it.
|
|
99
|
-
*
|
|
100
|
-
* @example
|
|
101
|
-
* ```ts
|
|
102
|
-
* import { createConfig, http } from 'wagmi'
|
|
103
|
-
* import { tempoModerato } from 'wagmi/chains'
|
|
104
|
-
* import { dangerous_secp256k1 } from 'accounts/wagmi'
|
|
105
|
-
*
|
|
106
|
-
* const config = createConfig({
|
|
107
|
-
* chains: [tempoModerato],
|
|
108
|
-
* connectors: [dangerous_secp256k1()],
|
|
109
|
-
* transports: { [tempoModerato.id]: http() },
|
|
110
|
-
* })
|
|
111
|
-
* ```
|
|
112
|
-
*/
|
|
113
|
-
export declare function dangerous_secp256k1(options?: dangerous_secp256k1.Options): import("@wagmi/core").CreateConnectorFn<Provider.Provider, {
|
|
114
|
-
connect<withCapabilities extends boolean = false>(parameters?: {
|
|
115
|
-
capabilities?: NonNullable<z.output<typeof Rpc.wallet_connect.capabilities.request>> | undefined;
|
|
116
|
-
chainId?: number | undefined;
|
|
117
|
-
isReconnecting?: boolean | undefined;
|
|
118
|
-
withCapabilities?: withCapabilities | boolean | undefined;
|
|
119
|
-
}): Promise<{
|
|
120
|
-
accounts: withCapabilities extends true ? readonly {
|
|
121
|
-
address: Address;
|
|
122
|
-
capabilities: z.output<typeof Rpc.wallet_connect.capabilities.result>;
|
|
123
|
-
}[] : readonly Address[];
|
|
124
|
-
chainId: number;
|
|
125
|
-
}>;
|
|
126
|
-
}, Record<string, unknown>>;
|
|
127
|
-
export declare namespace dangerous_secp256k1 {
|
|
128
|
-
type Options = dangerous_secp256k1_adapter.Options & Omit<setup.Parameters, 'adapter'>;
|
|
129
|
-
}
|
|
130
|
-
//# sourceMappingURL=Connector.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Connector.d.ts","sourceRoot":"","sources":["../../src/wagmi/Connector.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,OAAO,EAKb,MAAM,MAAM,CAAA;AACb,OAAO,KAAK,CAAC,MAAM,UAAU,CAAA;AAE7B,OAAO,EAAE,mBAAmB,IAAI,2BAA2B,EAAE,MAAM,yCAAyC,CAAA;AAC5G,OAAO,EAAE,MAAM,IAAI,WAAW,EAAE,MAAM,4BAA4B,CAAA;AAClE,OAAO,EAAE,QAAQ,IAAI,gBAAgB,EAAE,MAAM,8BAA8B,CAAA;AAC3E,OAAO,KAAK,QAAQ,MAAM,qBAAqB,CAAA;AAC/C,OAAO,KAAK,GAAG,MAAM,oBAAoB,CAAA;AAEzC;;GAEG;AACH,wBAAgB,KAAK,CAAC,UAAU,GAAE,KAAK,CAAC,UAAmC;YAE/D,gBAAgB,SAAS,OAAO,uBAAuB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