|
1 | 1 | import { Signers as CoreSigners, Relayer, State } from '@0xsequence/wallet-core'
|
2 |
| -import { Config, Constants, Context, Extensions, Network, Payload, SessionConfig } from '@0xsequence/wallet-primitives' |
| 2 | +import { |
| 3 | + Attestation, |
| 4 | + Config, |
| 5 | + Constants, |
| 6 | + Context, |
| 7 | + Extensions, |
| 8 | + Network, |
| 9 | + Payload, |
| 10 | + SessionConfig, |
| 11 | + Signature as SequenceSignature, |
| 12 | +} from '@0xsequence/wallet-primitives' |
3 | 13 | import { Address } from 'ox'
|
4 | 14 | import * as Db from '../dbs/index.js'
|
5 | 15 | import * as Identity from '../identity/index.js'
|
6 | 16 | import { Devices } from './devices.js'
|
7 | 17 | import {
|
8 |
| - Handler, |
9 |
| - DevicesHandler, |
10 |
| - PasskeysHandler, |
11 | 18 | AuthCodePkceHandler,
|
| 19 | + DevicesHandler, |
| 20 | + Handler, |
12 | 21 | MnemonicHandler,
|
13 | 22 | OtpHandler,
|
| 23 | + PasskeysHandler, |
14 | 24 | } from './handlers/index.js'
|
| 25 | +import { Janitor } from './janitor.js' |
15 | 26 | import { Logger } from './logger.js'
|
16 |
| -import { Sessions } from './sessions.js' |
| 27 | +import { AuthorizeImplicitSessionArgs, Sessions } from './sessions.js' |
17 | 28 | import { Signatures } from './signatures.js'
|
18 | 29 | import { Signers } from './signers.js'
|
19 | 30 | import { Transactions } from './transactions.js'
|
20 | 31 | import { BaseSignatureRequest, SignatureRequest, Wallet } from './types/index.js'
|
21 |
| -import { Transaction, TransactionRequest } from './types/transaction-request.js' |
22 |
| -import { CompleteRedirectArgs, LoginArgs, SignupArgs, StartSignUpWithRedirectArgs, Wallets } from './wallets.js' |
23 | 32 | import { Kinds } from './types/signer.js'
|
| 33 | +import { Transaction, TransactionRequest } from './types/transaction-request.js' |
24 | 34 | import { WalletSelectionUiHandler } from './types/wallet.js'
|
25 |
| -import { Janitor } from './janitor.js' |
| 35 | +import { CompleteRedirectArgs, LoginArgs, SignupArgs, StartSignUpWithRedirectArgs, Wallets } from './wallets.js' |
26 | 36 |
|
27 | 37 | export type ManagerOptions = {
|
28 | 38 | verbose?: boolean
|
@@ -329,6 +339,10 @@ export class Manager {
|
329 | 339 | return this.shared.modules.wallets.unregisterWalletSelector(handler)
|
330 | 340 | }
|
331 | 341 |
|
| 342 | + public async getConfiguration(wallet: Address.Address) { |
| 343 | + return this.shared.modules.wallets.getConfiguration({ wallet }) |
| 344 | + } |
| 345 | + |
332 | 346 | // Signatures
|
333 | 347 |
|
334 | 348 | public async listSignatureRequests(): Promise<SignatureRequest[]> {
|
@@ -416,8 +430,19 @@ export class Manager {
|
416 | 430 | return this.shared.modules.sessions.getSessionTopology(walletAddress)
|
417 | 431 | }
|
418 | 432 |
|
419 |
| - public async addImplicitSession(walletAddress: Address.Address, sessionAddress: Address.Address) { |
420 |
| - return this.shared.modules.sessions.addImplicitSession(walletAddress, sessionAddress) |
| 433 | + public async prepareAuthorizeImplicitSession( |
| 434 | + walletAddress: Address.Address, |
| 435 | + sessionAddress: Address.Address, |
| 436 | + args: AuthorizeImplicitSessionArgs, |
| 437 | + ): Promise<string> { |
| 438 | + return this.shared.modules.sessions.prepareAuthorizeImplicitSession(walletAddress, sessionAddress, args) |
| 439 | + } |
| 440 | + |
| 441 | + public async completeAuthorizeImplicitSession(requestId: string): Promise<{ |
| 442 | + attestation: Attestation.Attestation |
| 443 | + signature: SequenceSignature.RSY |
| 444 | + }> { |
| 445 | + return this.shared.modules.sessions.completeAuthorizeImplicitSession(requestId) |
421 | 446 | }
|
422 | 447 |
|
423 | 448 | public async addExplicitSession(
|
@@ -448,8 +473,4 @@ export class Manager {
|
448 | 473 | console.log('Completing session update:', requestId)
|
449 | 474 | return this.shared.modules.sessions.completeSessionUpdate(sigRequest.wallet, requestId)
|
450 | 475 | }
|
451 |
| - |
452 |
| - public async getConfiguration(wallet: Address.Address) { |
453 |
| - return this.shared.modules.wallets.getConfiguration({ wallet }) |
454 |
| - } |
455 | 476 | }
|
0 commit comments