|
| 1 | +/* eslint-disable prettier/prettier */ |
1 | 2 | /* eslint-disable @typescript-eslint/restrict-plus-operands */ |
2 | 3 | /* eslint-disable @typescript-eslint/prefer-reduce-type-parameter */ |
3 | 4 | import type { |
@@ -33,6 +34,10 @@ import type { Signature } from '@solana/kit'; |
33 | 34 | import { address as asAddress, getAddressDecoder } from '@solana/kit'; |
34 | 35 | import { sortBy } from 'lodash'; |
35 | 36 |
|
| 37 | +import { |
| 38 | + asStrictKeyringAccount, |
| 39 | + type SolanaKeyringAccount, |
| 40 | +} from '../../../entities'; |
36 | 41 | import { type Network } from '../../constants/solana'; |
37 | 42 | import type { AssetsService } from '../../services/assets/AssetsService'; |
38 | 43 | import type { ConfirmationHandler } from '../../services/confirmation/ConfirmationHandler'; |
@@ -60,36 +65,6 @@ import { |
60 | 65 | SolanaKeyringRequestStruct, |
61 | 66 | } from './structs'; |
62 | 67 |
|
63 | | -/** |
64 | | - * We need to store the index of the KeyringAccount in the state because |
65 | | - * we want to be able to restore any account with a previously used index. |
66 | | - */ |
67 | | -export type SolanaKeyringAccount = { |
68 | | - entropySource: EntropySourceId; |
69 | | - derivationPath: `m/${string}`; |
70 | | - index: number; |
71 | | -} & KeyringAccount; |
72 | | - |
73 | | -/** |
74 | | - * Converts a Solana keyring account to its stricter form (required by the Keyring API). |
75 | | - * |
76 | | - * @param account - A Solana keyring account. |
77 | | - * @returns A strict keyring account (with no additional fields). |
78 | | - */ |
79 | | -export function asStrictKeyringAccount( |
80 | | - account: SolanaKeyringAccount, |
81 | | -): KeyringAccount { |
82 | | - const { type, id, address, options, methods, scopes } = account; |
83 | | - return { |
84 | | - type, |
85 | | - id, |
86 | | - address, |
87 | | - options, |
88 | | - methods, |
89 | | - scopes, |
90 | | - }; |
91 | | -} |
92 | | - |
93 | 68 | export class SolanaKeyring implements Keyring { |
94 | 69 | readonly #state: IStateManager<UnencryptedStateValue>; |
95 | 70 |
|
|
0 commit comments