@metamask-previews/multichain-account-service 0.4.0-preview-7dfc3145 → 0.5.0-preview-f108d6a
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 +10 -3
- package/dist/MultichainAccountService.cjs +1 -26
- package/dist/MultichainAccountService.cjs.map +1 -1
- package/dist/MultichainAccountService.d.cts +2 -10
- package/dist/MultichainAccountService.d.cts.map +1 -1
- package/dist/MultichainAccountService.d.mts +2 -10
- package/dist/MultichainAccountService.d.mts.map +1 -1
- package/dist/MultichainAccountService.mjs +1 -26
- package/dist/MultichainAccountService.mjs.map +1 -1
- package/dist/providers/SnapAccountProvider.cjs +1 -5
- package/dist/providers/SnapAccountProvider.cjs.map +1 -1
- package/dist/providers/SnapAccountProvider.d.cts +0 -1
- package/dist/providers/SnapAccountProvider.d.cts.map +1 -1
- package/dist/providers/SnapAccountProvider.d.mts +0 -1
- package/dist/providers/SnapAccountProvider.d.mts.map +1 -1
- package/dist/providers/SnapAccountProvider.mjs +0 -3
- package/dist/providers/SnapAccountProvider.mjs.map +1 -1
- package/dist/providers/SolAccountProvider.cjs.map +1 -1
- package/dist/providers/SolAccountProvider.d.cts +1 -1
- package/dist/providers/SolAccountProvider.d.cts.map +1 -1
- package/dist/providers/SolAccountProvider.d.mts +1 -1
- package/dist/providers/SolAccountProvider.d.mts.map +1 -1
- package/dist/providers/SolAccountProvider.mjs.map +1 -1
- package/dist/providers/index.cjs +0 -1
- package/dist/providers/index.cjs.map +1 -1
- package/dist/providers/index.d.cts +0 -1
- package/dist/providers/index.d.cts.map +1 -1
- package/dist/providers/index.d.mts +0 -1
- package/dist/providers/index.d.mts.map +1 -1
- package/dist/providers/index.mjs +0 -1
- package/dist/providers/index.mjs.map +1 -1
- package/dist/tests/providers.cjs +0 -1
- package/dist/tests/providers.cjs.map +1 -1
- package/dist/tests/providers.d.cts +0 -1
- package/dist/tests/providers.d.cts.map +1 -1
- package/dist/tests/providers.d.mts +0 -1
- package/dist/tests/providers.d.mts.map +1 -1
- package/dist/tests/providers.mjs +0 -1
- package/dist/tests/providers.mjs.map +1 -1
- package/dist/types.cjs.map +1 -1
- package/dist/types.d.cts +1 -5
- package/dist/types.d.cts.map +1 -1
- package/dist/types.d.mts +1 -5
- package/dist/types.d.mts.map +1 -1
- package/dist/types.mjs.map +1 -1
- package/package.json +6 -6
- package/dist/providers/ProviderWrapper.cjs +0 -102
- package/dist/providers/ProviderWrapper.cjs.map +0 -1
- package/dist/providers/ProviderWrapper.d.cts +0 -69
- package/dist/providers/ProviderWrapper.d.cts.map +0 -1
- package/dist/providers/ProviderWrapper.d.mts +0 -69
- package/dist/providers/ProviderWrapper.d.mts.map +0 -1
- package/dist/providers/ProviderWrapper.mjs +0 -97
- package/dist/providers/ProviderWrapper.mjs.map +0 -1
package/dist/providers/index.cjs
CHANGED
|
@@ -16,7 +16,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./BaseAccountProvider.cjs"), exports);
|
|
18
18
|
__exportStar(require("./SnapAccountProvider.cjs"), exports);
|
|
19
|
-
__exportStar(require("./ProviderWrapper.cjs"), exports);
|
|
20
19
|
// Concrete providers:
|
|
21
20
|
__exportStar(require("./SolAccountProvider.cjs"), exports);
|
|
22
21
|
__exportStar(require("./EvmAccountProvider.cjs"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../src/providers/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4DAAsC;AACtC,4DAAsC;
|
|
1
|
+
{"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../src/providers/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4DAAsC;AACtC,4DAAsC;AAEtC,sBAAsB;AACtB,2DAAqC;AACrC,2DAAqC","sourcesContent":["export * from './BaseAccountProvider';\nexport * from './SnapAccountProvider';\n\n// Concrete providers:\nexport * from './SolAccountProvider';\nexport * from './EvmAccountProvider';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../src/providers/index.ts"],"names":[],"mappings":"AAAA,0CAAsC;AACtC,0CAAsC;
|
|
1
|
+
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../src/providers/index.ts"],"names":[],"mappings":"AAAA,0CAAsC;AACtC,0CAAsC;AAGtC,yCAAqC;AACrC,yCAAqC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/providers/index.ts"],"names":[],"mappings":"AAAA,0CAAsC;AACtC,0CAAsC;
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/providers/index.ts"],"names":[],"mappings":"AAAA,0CAAsC;AACtC,0CAAsC;AAGtC,yCAAqC;AACrC,yCAAqC"}
|
package/dist/providers/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/providers/index.ts"],"names":[],"mappings":"AAAA,0CAAsC;AACtC,0CAAsC;
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/providers/index.ts"],"names":[],"mappings":"AAAA,0CAAsC;AACtC,0CAAsC;AAEtC,sBAAsB;AACtB,yCAAqC;AACrC,yCAAqC","sourcesContent":["export * from './BaseAccountProvider';\nexport * from './SnapAccountProvider';\n\n// Concrete providers:\nexport * from './SolAccountProvider';\nexport * from './EvmAccountProvider';\n"]}
|
package/dist/tests/providers.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"providers.cjs","sourceRoot":"","sources":["../../src/tests/providers.ts"],"names":[],"mappings":";AAAA,wCAAwC;;;AAGxC,uDAAuD;
|
|
1
|
+
{"version":3,"file":"providers.cjs","sourceRoot":"","sources":["../../src/tests/providers.ts"],"names":[],"mappings":";AAAA,wCAAwC;;;AAGxC,uDAAuD;AAWvD,SAAgB,uBAAuB,CACrC,WAA6B,EAAE;IAE/B,OAAO;QACL,QAAQ;QACR,UAAU,EAAE,IAAI,CAAC,EAAE,EAAE;QACrB,WAAW,EAAE,IAAI,CAAC,EAAE,EAAE;QACtB,cAAc,EAAE,IAAI,CAAC,EAAE,EAAE;QACzB,yBAAyB,EAAE,IAAI,CAAC,EAAE,EAAE;KACrC,CAAC;AACJ,CAAC;AAVD,0DAUC;AAED,SAAgB,oBAAoB,CAAC,EACnC,QAAQ,EACR,KAAK,GAAG,uBAAuB,EAAE,EACjC,MAAM,GAAG,GAAG,EAAE,CAAC,IAAI,GAKpB;IACC,8DAA8D;IAC9D,eAAe;IACf,KAAK,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAE1B,MAAM,WAAW,GAAG,GAAG,EAAE,CACvB,KAAK,CAAC,QAAQ,CAAC,MAAM,CACnB,CAAC,OAAO,EAAE,EAAE,CAAC,IAAA,4BAAc,EAAC,OAAO,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,CACxD,CAAC;IAEJ,KAAK,CAAC,WAAW,CAAC,kBAAkB,CAAC,WAAW,CAAC,CAAC;IAClD,KAAK,CAAC,UAAU,CAAC,kBAAkB,CACjC,CAAC,EAAsC,EAAE,EAAE;IACzC,6BAA6B;IAC7B,WAAW,EAAE,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,CAAC,CACrD,CAAC;IAEF,OAAO,KAAK,CAAC;AACf,CAAC;AA1BD,oDA0BC","sourcesContent":["/* eslint-disable jsdoc/require-jsdoc */\n\nimport type { Bip44Account } from '@metamask/account-api';\nimport { isBip44Account } from '@metamask/account-api';\nimport type { KeyringAccount } from '@metamask/keyring-api';\n\nexport type MockAccountProvider = {\n accounts: KeyringAccount[];\n getAccount: jest.Mock;\n getAccounts: jest.Mock;\n createAccounts: jest.Mock;\n discoverAndCreateAccounts: jest.Mock;\n};\n\nexport function makeMockAccountProvider(\n accounts: KeyringAccount[] = [],\n): MockAccountProvider {\n return {\n accounts,\n getAccount: jest.fn(),\n getAccounts: jest.fn(),\n createAccounts: jest.fn(),\n discoverAndCreateAccounts: jest.fn(),\n };\n}\n\nexport function setupAccountProvider({\n accounts,\n mocks = makeMockAccountProvider(),\n filter = () => true,\n}: {\n mocks?: MockAccountProvider;\n accounts: KeyringAccount[];\n filter?: (account: KeyringAccount) => boolean;\n}): MockAccountProvider {\n // You can mock this and all other mocks will re-use that list\n // of accounts.\n mocks.accounts = accounts;\n\n const getAccounts = () =>\n mocks.accounts.filter(\n (account) => isBip44Account(account) && filter(account),\n );\n\n mocks.getAccounts.mockImplementation(getAccounts);\n mocks.getAccount.mockImplementation(\n (id: Bip44Account<KeyringAccount>['id']) =>\n // Assuming this never fails.\n getAccounts().find((account) => account.id === id),\n );\n\n return mocks;\n}\n"]}
|
|
@@ -6,7 +6,6 @@ export type MockAccountProvider = {
|
|
|
6
6
|
getAccounts: jest.Mock;
|
|
7
7
|
createAccounts: jest.Mock;
|
|
8
8
|
discoverAndCreateAccounts: jest.Mock;
|
|
9
|
-
isAccountCompatible?: jest.Mock;
|
|
10
9
|
};
|
|
11
10
|
export declare function makeMockAccountProvider(accounts?: KeyringAccount[]): MockAccountProvider;
|
|
12
11
|
export declare function setupAccountProvider({ accounts, mocks, filter, }: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"providers.d.cts","sourceRoot":"","sources":["../../src/tests/providers.ts"],"names":[],"mappings":";AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,8BAA8B;AAE5D,MAAM,MAAM,mBAAmB,GAAG;IAChC,QAAQ,EAAE,cAAc,EAAE,CAAC;IAC3B,UAAU,EAAE,IAAI,CAAC,IAAI,CAAC;IACtB,WAAW,EAAE,IAAI,CAAC,IAAI,CAAC;IACvB,cAAc,EAAE,IAAI,CAAC,IAAI,CAAC;IAC1B,yBAAyB,EAAE,IAAI,CAAC,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"providers.d.cts","sourceRoot":"","sources":["../../src/tests/providers.ts"],"names":[],"mappings":";AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,8BAA8B;AAE5D,MAAM,MAAM,mBAAmB,GAAG;IAChC,QAAQ,EAAE,cAAc,EAAE,CAAC;IAC3B,UAAU,EAAE,IAAI,CAAC,IAAI,CAAC;IACtB,WAAW,EAAE,IAAI,CAAC,IAAI,CAAC;IACvB,cAAc,EAAE,IAAI,CAAC,IAAI,CAAC;IAC1B,yBAAyB,EAAE,IAAI,CAAC,IAAI,CAAC;CACtC,CAAC;AAEF,wBAAgB,uBAAuB,CACrC,QAAQ,GAAE,cAAc,EAAO,GAC9B,mBAAmB,CAQrB;AAED,wBAAgB,oBAAoB,CAAC,EACnC,QAAQ,EACR,KAAiC,EACjC,MAAmB,GACpB,EAAE;IACD,KAAK,CAAC,EAAE,mBAAmB,CAAC;IAC5B,QAAQ,EAAE,cAAc,EAAE,CAAC;IAC3B,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,OAAO,CAAC;CAC/C,GAAG,mBAAmB,CAkBtB"}
|
|
@@ -6,7 +6,6 @@ export type MockAccountProvider = {
|
|
|
6
6
|
getAccounts: jest.Mock;
|
|
7
7
|
createAccounts: jest.Mock;
|
|
8
8
|
discoverAndCreateAccounts: jest.Mock;
|
|
9
|
-
isAccountCompatible?: jest.Mock;
|
|
10
9
|
};
|
|
11
10
|
export declare function makeMockAccountProvider(accounts?: KeyringAccount[]): MockAccountProvider;
|
|
12
11
|
export declare function setupAccountProvider({ accounts, mocks, filter, }: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"providers.d.mts","sourceRoot":"","sources":["../../src/tests/providers.ts"],"names":[],"mappings":";AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,8BAA8B;AAE5D,MAAM,MAAM,mBAAmB,GAAG;IAChC,QAAQ,EAAE,cAAc,EAAE,CAAC;IAC3B,UAAU,EAAE,IAAI,CAAC,IAAI,CAAC;IACtB,WAAW,EAAE,IAAI,CAAC,IAAI,CAAC;IACvB,cAAc,EAAE,IAAI,CAAC,IAAI,CAAC;IAC1B,yBAAyB,EAAE,IAAI,CAAC,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"providers.d.mts","sourceRoot":"","sources":["../../src/tests/providers.ts"],"names":[],"mappings":";AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,8BAA8B;AAE5D,MAAM,MAAM,mBAAmB,GAAG;IAChC,QAAQ,EAAE,cAAc,EAAE,CAAC;IAC3B,UAAU,EAAE,IAAI,CAAC,IAAI,CAAC;IACtB,WAAW,EAAE,IAAI,CAAC,IAAI,CAAC;IACvB,cAAc,EAAE,IAAI,CAAC,IAAI,CAAC;IAC1B,yBAAyB,EAAE,IAAI,CAAC,IAAI,CAAC;CACtC,CAAC;AAEF,wBAAgB,uBAAuB,CACrC,QAAQ,GAAE,cAAc,EAAO,GAC9B,mBAAmB,CAQrB;AAED,wBAAgB,oBAAoB,CAAC,EACnC,QAAQ,EACR,KAAiC,EACjC,MAAmB,GACpB,EAAE;IACD,KAAK,CAAC,EAAE,mBAAmB,CAAC;IAC5B,QAAQ,EAAE,cAAc,EAAE,CAAC;IAC3B,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,OAAO,CAAC;CAC/C,GAAG,mBAAmB,CAkBtB"}
|
package/dist/tests/providers.mjs
CHANGED
|
@@ -7,7 +7,6 @@ export function makeMockAccountProvider(accounts = []) {
|
|
|
7
7
|
getAccounts: jest.fn(),
|
|
8
8
|
createAccounts: jest.fn(),
|
|
9
9
|
discoverAndCreateAccounts: jest.fn(),
|
|
10
|
-
isAccountCompatible: jest.fn(),
|
|
11
10
|
};
|
|
12
11
|
}
|
|
13
12
|
export function setupAccountProvider({ accounts, mocks = makeMockAccountProvider(), filter = () => true, }) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"providers.mjs","sourceRoot":"","sources":["../../src/tests/providers.ts"],"names":[],"mappings":"AAAA,wCAAwC;AAGxC,OAAO,EAAE,cAAc,EAAE,8BAA8B;
|
|
1
|
+
{"version":3,"file":"providers.mjs","sourceRoot":"","sources":["../../src/tests/providers.ts"],"names":[],"mappings":"AAAA,wCAAwC;AAGxC,OAAO,EAAE,cAAc,EAAE,8BAA8B;AAWvD,MAAM,UAAU,uBAAuB,CACrC,WAA6B,EAAE;IAE/B,OAAO;QACL,QAAQ;QACR,UAAU,EAAE,IAAI,CAAC,EAAE,EAAE;QACrB,WAAW,EAAE,IAAI,CAAC,EAAE,EAAE;QACtB,cAAc,EAAE,IAAI,CAAC,EAAE,EAAE;QACzB,yBAAyB,EAAE,IAAI,CAAC,EAAE,EAAE;KACrC,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,oBAAoB,CAAC,EACnC,QAAQ,EACR,KAAK,GAAG,uBAAuB,EAAE,EACjC,MAAM,GAAG,GAAG,EAAE,CAAC,IAAI,GAKpB;IACC,8DAA8D;IAC9D,eAAe;IACf,KAAK,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAE1B,MAAM,WAAW,GAAG,GAAG,EAAE,CACvB,KAAK,CAAC,QAAQ,CAAC,MAAM,CACnB,CAAC,OAAO,EAAE,EAAE,CAAC,cAAc,CAAC,OAAO,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,CACxD,CAAC;IAEJ,KAAK,CAAC,WAAW,CAAC,kBAAkB,CAAC,WAAW,CAAC,CAAC;IAClD,KAAK,CAAC,UAAU,CAAC,kBAAkB,CACjC,CAAC,EAAsC,EAAE,EAAE;IACzC,6BAA6B;IAC7B,WAAW,EAAE,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,CAAC,CACrD,CAAC;IAEF,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["/* eslint-disable jsdoc/require-jsdoc */\n\nimport type { Bip44Account } from '@metamask/account-api';\nimport { isBip44Account } from '@metamask/account-api';\nimport type { KeyringAccount } from '@metamask/keyring-api';\n\nexport type MockAccountProvider = {\n accounts: KeyringAccount[];\n getAccount: jest.Mock;\n getAccounts: jest.Mock;\n createAccounts: jest.Mock;\n discoverAndCreateAccounts: jest.Mock;\n};\n\nexport function makeMockAccountProvider(\n accounts: KeyringAccount[] = [],\n): MockAccountProvider {\n return {\n accounts,\n getAccount: jest.fn(),\n getAccounts: jest.fn(),\n createAccounts: jest.fn(),\n discoverAndCreateAccounts: jest.fn(),\n };\n}\n\nexport function setupAccountProvider({\n accounts,\n mocks = makeMockAccountProvider(),\n filter = () => true,\n}: {\n mocks?: MockAccountProvider;\n accounts: KeyringAccount[];\n filter?: (account: KeyringAccount) => boolean;\n}): MockAccountProvider {\n // You can mock this and all other mocks will re-use that list\n // of accounts.\n mocks.accounts = accounts;\n\n const getAccounts = () =>\n mocks.accounts.filter(\n (account) => isBip44Account(account) && filter(account),\n );\n\n mocks.getAccounts.mockImplementation(getAccounts);\n mocks.getAccount.mockImplementation(\n (id: Bip44Account<KeyringAccount>['id']) =>\n // Assuming this never fails.\n getAccounts().find((account) => account.id === id),\n );\n\n return mocks;\n}\n"]}
|
package/dist/types.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.cjs","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"","sourcesContent":["import type {\n AccountsControllerAccountAddedEvent,\n AccountsControllerAccountRemovedEvent,\n AccountsControllerGetAccountAction,\n AccountsControllerGetAccountByAddressAction,\n AccountsControllerListMultichainAccountsAction,\n} from '@metamask/accounts-controller';\nimport type { RestrictedMessenger } from '@metamask/base-controller';\nimport type {\n KeyringControllerGetStateAction,\n KeyringControllerStateChangeEvent,\n KeyringControllerWithKeyringAction,\n} from '@metamask/keyring-controller';\nimport type { HandleSnapRequest as SnapControllerHandleSnapRequestAction } from '@metamask/snaps-controllers';\n\nimport type {\n MultichainAccountService,\n serviceName,\n} from './MultichainAccountService';\n\nexport type MultichainAccountServiceGetMultichainAccountGroupAction = {\n type: `${typeof serviceName}:getMultichainAccountGroup`;\n handler: MultichainAccountService['getMultichainAccountGroup'];\n};\n\nexport type MultichainAccountServiceGetMultichainAccountGroupsAction = {\n type: `${typeof serviceName}:getMultichainAccountGroups`;\n handler: MultichainAccountService['getMultichainAccountGroups'];\n};\n\nexport type MultichainAccountServiceGetMultichainAccountWalletAction = {\n type: `${typeof serviceName}:getMultichainAccountWallet`;\n handler: MultichainAccountService['getMultichainAccountWallet'];\n};\n\nexport type MultichainAccountServiceGetMultichainAccountWalletsAction = {\n type: `${typeof serviceName}:getMultichainAccountWallets`;\n handler: MultichainAccountService['getMultichainAccountWallets'];\n};\n\nexport type MultichainAccountServiceCreateNextMultichainAccountGroupAction = {\n type: `${typeof serviceName}:createNextMultichainAccountGroup`;\n handler: MultichainAccountService['createNextMultichainAccountGroup'];\n};\n\nexport type MultichainAccountServiceCreateMultichainAccountGroupAction = {\n type: `${typeof serviceName}:createMultichainAccountGroup`;\n handler: MultichainAccountService['createMultichainAccountGroup'];\n};\n\nexport type
|
|
1
|
+
{"version":3,"file":"types.cjs","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"","sourcesContent":["import type {\n AccountsControllerAccountAddedEvent,\n AccountsControllerAccountRemovedEvent,\n AccountsControllerGetAccountAction,\n AccountsControllerGetAccountByAddressAction,\n AccountsControllerListMultichainAccountsAction,\n} from '@metamask/accounts-controller';\nimport type { RestrictedMessenger } from '@metamask/base-controller';\nimport type {\n KeyringControllerGetStateAction,\n KeyringControllerStateChangeEvent,\n KeyringControllerWithKeyringAction,\n} from '@metamask/keyring-controller';\nimport type { HandleSnapRequest as SnapControllerHandleSnapRequestAction } from '@metamask/snaps-controllers';\n\nimport type {\n MultichainAccountService,\n serviceName,\n} from './MultichainAccountService';\n\nexport type MultichainAccountServiceGetMultichainAccountGroupAction = {\n type: `${typeof serviceName}:getMultichainAccountGroup`;\n handler: MultichainAccountService['getMultichainAccountGroup'];\n};\n\nexport type MultichainAccountServiceGetMultichainAccountGroupsAction = {\n type: `${typeof serviceName}:getMultichainAccountGroups`;\n handler: MultichainAccountService['getMultichainAccountGroups'];\n};\n\nexport type MultichainAccountServiceGetMultichainAccountWalletAction = {\n type: `${typeof serviceName}:getMultichainAccountWallet`;\n handler: MultichainAccountService['getMultichainAccountWallet'];\n};\n\nexport type MultichainAccountServiceGetMultichainAccountWalletsAction = {\n type: `${typeof serviceName}:getMultichainAccountWallets`;\n handler: MultichainAccountService['getMultichainAccountWallets'];\n};\n\nexport type MultichainAccountServiceCreateNextMultichainAccountGroupAction = {\n type: `${typeof serviceName}:createNextMultichainAccountGroup`;\n handler: MultichainAccountService['createNextMultichainAccountGroup'];\n};\n\nexport type MultichainAccountServiceCreateMultichainAccountGroupAction = {\n type: `${typeof serviceName}:createMultichainAccountGroup`;\n handler: MultichainAccountService['createMultichainAccountGroup'];\n};\n\nexport type MultichainAccountServiceAlignWalletAction = {\n type: `${typeof serviceName}:alignWallet`;\n handler: MultichainAccountService['alignWallet'];\n};\n\nexport type MultichainAccountServiceAlignWalletsAction = {\n type: `${typeof serviceName}:alignWallets`;\n handler: MultichainAccountService['alignWallets'];\n};\n\n/**\n * All actions that {@link MultichainAccountService} registers so that other\n * modules can call them.\n */\nexport type MultichainAccountServiceActions =\n | MultichainAccountServiceGetMultichainAccountGroupAction\n | MultichainAccountServiceGetMultichainAccountGroupsAction\n | MultichainAccountServiceGetMultichainAccountWalletAction\n | MultichainAccountServiceGetMultichainAccountWalletsAction\n | MultichainAccountServiceCreateNextMultichainAccountGroupAction\n | MultichainAccountServiceCreateMultichainAccountGroupAction\n | MultichainAccountServiceAlignWalletAction\n | MultichainAccountServiceAlignWalletsAction;\n\n/**\n * All events that {@link MultichainAccountService} publishes so that other modules\n * can subscribe to them.\n */\nexport type MultichainAccountServiceEvents = never;\n\n/**\n * All actions registered by other modules that {@link MultichainAccountService}\n * calls.\n */\nexport type AllowedActions =\n | AccountsControllerListMultichainAccountsAction\n | AccountsControllerGetAccountAction\n | AccountsControllerGetAccountByAddressAction\n | SnapControllerHandleSnapRequestAction\n | KeyringControllerWithKeyringAction\n | KeyringControllerGetStateAction;\n\n/**\n * All events published by other modules that {@link MultichainAccountService}\n * subscribes to.\n */\nexport type AllowedEvents =\n | KeyringControllerStateChangeEvent\n | AccountsControllerAccountAddedEvent\n | AccountsControllerAccountRemovedEvent;\n\n/**\n * The messenger restricted to actions and events that\n * {@link MultichainAccountService} needs to access.\n */\nexport type MultichainAccountServiceMessenger = RestrictedMessenger<\n 'MultichainAccountService',\n MultichainAccountServiceActions | AllowedActions,\n MultichainAccountServiceEvents | AllowedEvents,\n AllowedActions['type'],\n AllowedEvents['type']\n>;\n"]}
|
package/dist/types.d.cts
CHANGED
|
@@ -27,10 +27,6 @@ export type MultichainAccountServiceCreateMultichainAccountGroupAction = {
|
|
|
27
27
|
type: `${typeof serviceName}:createMultichainAccountGroup`;
|
|
28
28
|
handler: MultichainAccountService['createMultichainAccountGroup'];
|
|
29
29
|
};
|
|
30
|
-
export type MultichainAccountServiceSetBasicFunctionalityAction = {
|
|
31
|
-
type: `${typeof serviceName}:setBasicFunctionality`;
|
|
32
|
-
handler: MultichainAccountService['setBasicFunctionality'];
|
|
33
|
-
};
|
|
34
30
|
export type MultichainAccountServiceAlignWalletAction = {
|
|
35
31
|
type: `${typeof serviceName}:alignWallet`;
|
|
36
32
|
handler: MultichainAccountService['alignWallet'];
|
|
@@ -43,7 +39,7 @@ export type MultichainAccountServiceAlignWalletsAction = {
|
|
|
43
39
|
* All actions that {@link MultichainAccountService} registers so that other
|
|
44
40
|
* modules can call them.
|
|
45
41
|
*/
|
|
46
|
-
export type MultichainAccountServiceActions = MultichainAccountServiceGetMultichainAccountGroupAction | MultichainAccountServiceGetMultichainAccountGroupsAction | MultichainAccountServiceGetMultichainAccountWalletAction | MultichainAccountServiceGetMultichainAccountWalletsAction | MultichainAccountServiceCreateNextMultichainAccountGroupAction | MultichainAccountServiceCreateMultichainAccountGroupAction |
|
|
42
|
+
export type MultichainAccountServiceActions = MultichainAccountServiceGetMultichainAccountGroupAction | MultichainAccountServiceGetMultichainAccountGroupsAction | MultichainAccountServiceGetMultichainAccountWalletAction | MultichainAccountServiceGetMultichainAccountWalletsAction | MultichainAccountServiceCreateNextMultichainAccountGroupAction | MultichainAccountServiceCreateMultichainAccountGroupAction | MultichainAccountServiceAlignWalletAction | MultichainAccountServiceAlignWalletsAction;
|
|
47
43
|
/**
|
|
48
44
|
* All events that {@link MultichainAccountService} publishes so that other modules
|
|
49
45
|
* can subscribe to them.
|
package/dist/types.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.cts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,mCAAmC,EACnC,qCAAqC,EACrC,kCAAkC,EAClC,2CAA2C,EAC3C,8CAA8C,EAC/C,sCAAsC;AACvC,OAAO,KAAK,EAAE,mBAAmB,EAAE,kCAAkC;AACrE,OAAO,KAAK,EACV,+BAA+B,EAC/B,iCAAiC,EACjC,kCAAkC,EACnC,qCAAqC;AACtC,OAAO,KAAK,EAAE,iBAAiB,IAAI,qCAAqC,EAAE,oCAAoC;AAE9G,OAAO,KAAK,EACV,wBAAwB,EACxB,WAAW,EACZ,uCAAmC;AAEpC,MAAM,MAAM,uDAAuD,GAAG;IACpE,IAAI,EAAE,GAAG,OAAO,WAAW,4BAA4B,CAAC;IACxD,OAAO,EAAE,wBAAwB,CAAC,2BAA2B,CAAC,CAAC;CAChE,CAAC;AAEF,MAAM,MAAM,wDAAwD,GAAG;IACrE,IAAI,EAAE,GAAG,OAAO,WAAW,6BAA6B,CAAC;IACzD,OAAO,EAAE,wBAAwB,CAAC,4BAA4B,CAAC,CAAC;CACjE,CAAC;AAEF,MAAM,MAAM,wDAAwD,GAAG;IACrE,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kCAAkC,GAClC,2CAA2C,GAC3C,qCAAqC,GACrC,kCAAkC,GAClC,+BAA+B,CAAC;AAEpC;;;GAGG;AACH,MAAM,MAAM,aAAa,GACrB,iCAAiC,GACjC,mCAAmC,GACnC,qCAAqC,CAAC;AAE1C;;;GAGG;AACH,MAAM,MAAM,iCAAiC,GAAG,mBAAmB,CACjE,0BAA0B,EAC1B,+BAA+B,GAAG,cAAc,EAChD,8BAA8B,GAAG,aAAa,EAC9C,cAAc,CAAC,MAAM,CAAC,EACtB,aAAa,CAAC,MAAM,CAAC,CACtB,CAAC"}
|
package/dist/types.d.mts
CHANGED
|
@@ -27,10 +27,6 @@ export type MultichainAccountServiceCreateMultichainAccountGroupAction = {
|
|
|
27
27
|
type: `${typeof serviceName}:createMultichainAccountGroup`;
|
|
28
28
|
handler: MultichainAccountService['createMultichainAccountGroup'];
|
|
29
29
|
};
|
|
30
|
-
export type MultichainAccountServiceSetBasicFunctionalityAction = {
|
|
31
|
-
type: `${typeof serviceName}:setBasicFunctionality`;
|
|
32
|
-
handler: MultichainAccountService['setBasicFunctionality'];
|
|
33
|
-
};
|
|
34
30
|
export type MultichainAccountServiceAlignWalletAction = {
|
|
35
31
|
type: `${typeof serviceName}:alignWallet`;
|
|
36
32
|
handler: MultichainAccountService['alignWallet'];
|
|
@@ -43,7 +39,7 @@ export type MultichainAccountServiceAlignWalletsAction = {
|
|
|
43
39
|
* All actions that {@link MultichainAccountService} registers so that other
|
|
44
40
|
* modules can call them.
|
|
45
41
|
*/
|
|
46
|
-
export type MultichainAccountServiceActions = MultichainAccountServiceGetMultichainAccountGroupAction | MultichainAccountServiceGetMultichainAccountGroupsAction | MultichainAccountServiceGetMultichainAccountWalletAction | MultichainAccountServiceGetMultichainAccountWalletsAction | MultichainAccountServiceCreateNextMultichainAccountGroupAction | MultichainAccountServiceCreateMultichainAccountGroupAction |
|
|
42
|
+
export type MultichainAccountServiceActions = MultichainAccountServiceGetMultichainAccountGroupAction | MultichainAccountServiceGetMultichainAccountGroupsAction | MultichainAccountServiceGetMultichainAccountWalletAction | MultichainAccountServiceGetMultichainAccountWalletsAction | MultichainAccountServiceCreateNextMultichainAccountGroupAction | MultichainAccountServiceCreateMultichainAccountGroupAction | MultichainAccountServiceAlignWalletAction | MultichainAccountServiceAlignWalletsAction;
|
|
47
43
|
/**
|
|
48
44
|
* All events that {@link MultichainAccountService} publishes so that other modules
|
|
49
45
|
* can subscribe to them.
|
package/dist/types.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.mts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,mCAAmC,EACnC,qCAAqC,EACrC,kCAAkC,EAClC,2CAA2C,EAC3C,8CAA8C,EAC/C,sCAAsC;AACvC,OAAO,KAAK,EAAE,mBAAmB,EAAE,kCAAkC;AACrE,OAAO,KAAK,EACV,+BAA+B,EAC/B,iCAAiC,EACjC,kCAAkC,EACnC,qCAAqC;AACtC,OAAO,KAAK,EAAE,iBAAiB,IAAI,qCAAqC,EAAE,oCAAoC;AAE9G,OAAO,KAAK,EACV,wBAAwB,EACxB,WAAW,EACZ,uCAAmC;AAEpC,MAAM,MAAM,uDAAuD,GAAG;IACpE,IAAI,EAAE,GAAG,OAAO,WAAW,4BAA4B,CAAC;IACxD,OAAO,EAAE,wBAAwB,CAAC,2BAA2B,CAAC,CAAC;CAChE,CAAC;AAEF,MAAM,MAAM,wDAAwD,GAAG;IACrE,IAAI,EAAE,GAAG,OAAO,WAAW,6BAA6B,CAAC;IACzD,OAAO,EAAE,wBAAwB,CAAC,4BAA4B,CAAC,CAAC;CACjE,CAAC;AAEF,MAAM,MAAM,wDAAwD,GAAG;IACrE,IAAI,EAAE,GAAG,OAAO,WAAW,6BAA6B,CAAC;IACzD,OAAO,EAAE,wBAAwB,CAAC,4BAA4B,CAAC,CAAC;CACjE,CAAC;AAEF,MAAM,MAAM,yDAAyD,GAAG;IACtE,IAAI,EAAE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C;AAE1C;;;GAGG;AACH,MAAM,MAAM,iCAAiC,GAAG,mBAAmB,CACjE,0BAA0B,EAC1B,+BAA+B,GAAG,cAAc,EAChD,8BAA8B,GAAG,aAAa,EAC9C,cAAc,CAAC,MAAM,CAAC,EACtB,aAAa,CAAC,MAAM,CAAC,CACtB,CAAC"}
|
package/dist/types.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.mjs","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"","sourcesContent":["import type {\n AccountsControllerAccountAddedEvent,\n AccountsControllerAccountRemovedEvent,\n AccountsControllerGetAccountAction,\n AccountsControllerGetAccountByAddressAction,\n AccountsControllerListMultichainAccountsAction,\n} from '@metamask/accounts-controller';\nimport type { RestrictedMessenger } from '@metamask/base-controller';\nimport type {\n KeyringControllerGetStateAction,\n KeyringControllerStateChangeEvent,\n KeyringControllerWithKeyringAction,\n} from '@metamask/keyring-controller';\nimport type { HandleSnapRequest as SnapControllerHandleSnapRequestAction } from '@metamask/snaps-controllers';\n\nimport type {\n MultichainAccountService,\n serviceName,\n} from './MultichainAccountService';\n\nexport type MultichainAccountServiceGetMultichainAccountGroupAction = {\n type: `${typeof serviceName}:getMultichainAccountGroup`;\n handler: MultichainAccountService['getMultichainAccountGroup'];\n};\n\nexport type MultichainAccountServiceGetMultichainAccountGroupsAction = {\n type: `${typeof serviceName}:getMultichainAccountGroups`;\n handler: MultichainAccountService['getMultichainAccountGroups'];\n};\n\nexport type MultichainAccountServiceGetMultichainAccountWalletAction = {\n type: `${typeof serviceName}:getMultichainAccountWallet`;\n handler: MultichainAccountService['getMultichainAccountWallet'];\n};\n\nexport type MultichainAccountServiceGetMultichainAccountWalletsAction = {\n type: `${typeof serviceName}:getMultichainAccountWallets`;\n handler: MultichainAccountService['getMultichainAccountWallets'];\n};\n\nexport type MultichainAccountServiceCreateNextMultichainAccountGroupAction = {\n type: `${typeof serviceName}:createNextMultichainAccountGroup`;\n handler: MultichainAccountService['createNextMultichainAccountGroup'];\n};\n\nexport type MultichainAccountServiceCreateMultichainAccountGroupAction = {\n type: `${typeof serviceName}:createMultichainAccountGroup`;\n handler: MultichainAccountService['createMultichainAccountGroup'];\n};\n\nexport type
|
|
1
|
+
{"version":3,"file":"types.mjs","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"","sourcesContent":["import type {\n AccountsControllerAccountAddedEvent,\n AccountsControllerAccountRemovedEvent,\n AccountsControllerGetAccountAction,\n AccountsControllerGetAccountByAddressAction,\n AccountsControllerListMultichainAccountsAction,\n} from '@metamask/accounts-controller';\nimport type { RestrictedMessenger } from '@metamask/base-controller';\nimport type {\n KeyringControllerGetStateAction,\n KeyringControllerStateChangeEvent,\n KeyringControllerWithKeyringAction,\n} from '@metamask/keyring-controller';\nimport type { HandleSnapRequest as SnapControllerHandleSnapRequestAction } from '@metamask/snaps-controllers';\n\nimport type {\n MultichainAccountService,\n serviceName,\n} from './MultichainAccountService';\n\nexport type MultichainAccountServiceGetMultichainAccountGroupAction = {\n type: `${typeof serviceName}:getMultichainAccountGroup`;\n handler: MultichainAccountService['getMultichainAccountGroup'];\n};\n\nexport type MultichainAccountServiceGetMultichainAccountGroupsAction = {\n type: `${typeof serviceName}:getMultichainAccountGroups`;\n handler: MultichainAccountService['getMultichainAccountGroups'];\n};\n\nexport type MultichainAccountServiceGetMultichainAccountWalletAction = {\n type: `${typeof serviceName}:getMultichainAccountWallet`;\n handler: MultichainAccountService['getMultichainAccountWallet'];\n};\n\nexport type MultichainAccountServiceGetMultichainAccountWalletsAction = {\n type: `${typeof serviceName}:getMultichainAccountWallets`;\n handler: MultichainAccountService['getMultichainAccountWallets'];\n};\n\nexport type MultichainAccountServiceCreateNextMultichainAccountGroupAction = {\n type: `${typeof serviceName}:createNextMultichainAccountGroup`;\n handler: MultichainAccountService['createNextMultichainAccountGroup'];\n};\n\nexport type MultichainAccountServiceCreateMultichainAccountGroupAction = {\n type: `${typeof serviceName}:createMultichainAccountGroup`;\n handler: MultichainAccountService['createMultichainAccountGroup'];\n};\n\nexport type MultichainAccountServiceAlignWalletAction = {\n type: `${typeof serviceName}:alignWallet`;\n handler: MultichainAccountService['alignWallet'];\n};\n\nexport type MultichainAccountServiceAlignWalletsAction = {\n type: `${typeof serviceName}:alignWallets`;\n handler: MultichainAccountService['alignWallets'];\n};\n\n/**\n * All actions that {@link MultichainAccountService} registers so that other\n * modules can call them.\n */\nexport type MultichainAccountServiceActions =\n | MultichainAccountServiceGetMultichainAccountGroupAction\n | MultichainAccountServiceGetMultichainAccountGroupsAction\n | MultichainAccountServiceGetMultichainAccountWalletAction\n | MultichainAccountServiceGetMultichainAccountWalletsAction\n | MultichainAccountServiceCreateNextMultichainAccountGroupAction\n | MultichainAccountServiceCreateMultichainAccountGroupAction\n | MultichainAccountServiceAlignWalletAction\n | MultichainAccountServiceAlignWalletsAction;\n\n/**\n * All events that {@link MultichainAccountService} publishes so that other modules\n * can subscribe to them.\n */\nexport type MultichainAccountServiceEvents = never;\n\n/**\n * All actions registered by other modules that {@link MultichainAccountService}\n * calls.\n */\nexport type AllowedActions =\n | AccountsControllerListMultichainAccountsAction\n | AccountsControllerGetAccountAction\n | AccountsControllerGetAccountByAddressAction\n | SnapControllerHandleSnapRequestAction\n | KeyringControllerWithKeyringAction\n | KeyringControllerGetStateAction;\n\n/**\n * All events published by other modules that {@link MultichainAccountService}\n * subscribes to.\n */\nexport type AllowedEvents =\n | KeyringControllerStateChangeEvent\n | AccountsControllerAccountAddedEvent\n | AccountsControllerAccountRemovedEvent;\n\n/**\n * The messenger restricted to actions and events that\n * {@link MultichainAccountService} needs to access.\n */\nexport type MultichainAccountServiceMessenger = RestrictedMessenger<\n 'MultichainAccountService',\n MultichainAccountServiceActions | AllowedActions,\n MultichainAccountServiceEvents | AllowedEvents,\n AllowedActions['type'],\n AllowedEvents['type']\n>;\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@metamask-previews/multichain-account-service",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0-preview-f108d6a",
|
|
4
4
|
"description": "Service to manage multichain accounts",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"MetaMask",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"test:watch": "NODE_OPTIONS=--experimental-vm-modules jest --watch"
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@metamask/base-controller": "^8.
|
|
50
|
+
"@metamask/base-controller": "^8.2.0",
|
|
51
51
|
"@metamask/eth-snap-keyring": "^16.1.0",
|
|
52
52
|
"@metamask/keyring-api": "^20.1.0",
|
|
53
53
|
"@metamask/keyring-internal-api": "^8.1.0",
|
|
@@ -59,9 +59,9 @@
|
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
61
|
"@metamask/account-api": "^0.9.0",
|
|
62
|
-
"@metamask/accounts-controller": "^
|
|
62
|
+
"@metamask/accounts-controller": "^33.0.0",
|
|
63
63
|
"@metamask/auto-changelog": "^3.4.4",
|
|
64
|
-
"@metamask/keyring-controller": "^
|
|
64
|
+
"@metamask/keyring-controller": "^23.0.0",
|
|
65
65
|
"@metamask/providers": "^22.1.0",
|
|
66
66
|
"@metamask/snaps-controllers": "^14.0.1",
|
|
67
67
|
"@types/jest": "^27.4.1",
|
|
@@ -77,8 +77,8 @@
|
|
|
77
77
|
},
|
|
78
78
|
"peerDependencies": {
|
|
79
79
|
"@metamask/account-api": "^0.9.0",
|
|
80
|
-
"@metamask/accounts-controller": "^
|
|
81
|
-
"@metamask/keyring-controller": "^
|
|
80
|
+
"@metamask/accounts-controller": "^33.0.0",
|
|
81
|
+
"@metamask/keyring-controller": "^23.0.0",
|
|
82
82
|
"@metamask/providers": "^22.0.0",
|
|
83
83
|
"@metamask/snaps-controllers": "^14.0.0",
|
|
84
84
|
"webextension-polyfill": "^0.10.0 || ^0.11.0 || ^0.12.0"
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isProviderWrapper = exports.ProviderWrapper = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* A simple wrapper that adds disable functionality to any AccountProvider.
|
|
6
|
-
* When disabled, the provider will not create new accounts and return empty results.
|
|
7
|
-
*/
|
|
8
|
-
class ProviderWrapper {
|
|
9
|
-
constructor(provider) {
|
|
10
|
-
this.isDisabled = false;
|
|
11
|
-
this.provider = provider;
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Set the disabled state for this provider.
|
|
15
|
-
*
|
|
16
|
-
* @param disabled - Whether the provider should be disabled.
|
|
17
|
-
*/
|
|
18
|
-
setDisabled(disabled) {
|
|
19
|
-
this.isDisabled = disabled;
|
|
20
|
-
console.log(`Provider ${this.provider.constructor.name} ${disabled ? 'disabled' : 'enabled'}`);
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Get accounts, returns empty array when disabled.
|
|
24
|
-
*
|
|
25
|
-
* @returns Array of accounts, or empty array if disabled.
|
|
26
|
-
*/
|
|
27
|
-
getAccounts() {
|
|
28
|
-
if (this.isDisabled) {
|
|
29
|
-
return [];
|
|
30
|
-
}
|
|
31
|
-
return this.provider.getAccounts();
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* Get account by ID, throws error when disabled.
|
|
35
|
-
*
|
|
36
|
-
* @param id - The account ID to retrieve.
|
|
37
|
-
* @returns The account with the specified ID, or undefined if not found.
|
|
38
|
-
*/
|
|
39
|
-
getAccount(id) {
|
|
40
|
-
if (this.isDisabled) {
|
|
41
|
-
throw new Error(`Provider ${this.provider.constructor.name} is disabled`);
|
|
42
|
-
}
|
|
43
|
-
return this.provider.getAccount(id);
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* Create accounts, returns empty array when disabled.
|
|
47
|
-
*
|
|
48
|
-
* @param options - Account creation options.
|
|
49
|
-
* @param options.entropySource - The entropy source to use.
|
|
50
|
-
* @param options.groupIndex - The group index to use.
|
|
51
|
-
* @returns Promise resolving to created accounts, or empty array if disabled.
|
|
52
|
-
*/
|
|
53
|
-
async createAccounts(options) {
|
|
54
|
-
if (this.isDisabled) {
|
|
55
|
-
console.log(`Provider ${this.provider.constructor.name} is disabled - skipping account creation`);
|
|
56
|
-
return [];
|
|
57
|
-
}
|
|
58
|
-
return this.provider.createAccounts(options);
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* Discover and create accounts, returns empty array when disabled.
|
|
62
|
-
*
|
|
63
|
-
* @param options - Account discovery options.
|
|
64
|
-
* @param options.entropySource - The entropy source to use.
|
|
65
|
-
* @param options.groupIndex - The group index to use.
|
|
66
|
-
* @returns Promise resolving to discovered accounts, or empty array if disabled.
|
|
67
|
-
*/
|
|
68
|
-
async discoverAndCreateAccounts(options) {
|
|
69
|
-
if (this.isDisabled) {
|
|
70
|
-
console.log(`Provider ${this.provider.constructor.name} is disabled - skipping account discovery`);
|
|
71
|
-
return [];
|
|
72
|
-
}
|
|
73
|
-
return this.provider.discoverAndCreateAccounts(options);
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* Check if account is compatible.
|
|
77
|
-
*
|
|
78
|
-
* @param account - The account to check.
|
|
79
|
-
* @returns True if the account is compatible.
|
|
80
|
-
*/
|
|
81
|
-
isAccountCompatible(account) {
|
|
82
|
-
// Check if the provider has the method (from BaseAccountProvider)
|
|
83
|
-
if ('isAccountCompatible' in this.provider &&
|
|
84
|
-
typeof this.provider.isAccountCompatible === 'function') {
|
|
85
|
-
return this.provider.isAccountCompatible(account);
|
|
86
|
-
}
|
|
87
|
-
// Fallback: return true if the method doesn't exist
|
|
88
|
-
return true;
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
exports.ProviderWrapper = ProviderWrapper;
|
|
92
|
-
/**
|
|
93
|
-
* Simple type guard to check if a provider is wrapped.
|
|
94
|
-
*
|
|
95
|
-
* @param provider - The provider to check.
|
|
96
|
-
* @returns True if the provider is a ProviderWrapper.
|
|
97
|
-
*/
|
|
98
|
-
function isProviderWrapper(provider) {
|
|
99
|
-
return provider instanceof ProviderWrapper;
|
|
100
|
-
}
|
|
101
|
-
exports.isProviderWrapper = isProviderWrapper;
|
|
102
|
-
//# sourceMappingURL=ProviderWrapper.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ProviderWrapper.cjs","sourceRoot":"","sources":["../../src/providers/ProviderWrapper.ts"],"names":[],"mappings":";;;AAGA;;;GAGG;AACH,MAAa,eAAe;IAO1B,YAAY,QAAuD;QAJ3D,eAAU,GAAY,KAAK,CAAC;QAKlC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;IAED;;;;OAIG;IACH,WAAW,CAAC,QAAiB;QAC3B,IAAI,CAAC,UAAU,GAAG,QAAQ,CAAC;QAC3B,OAAO,CAAC,GAAG,CACT,YAAY,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,IAAI,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,EAAE,CAClF,CAAC;IACJ,CAAC;IAED;;;;OAIG;IACH,WAAW;QACT,IAAI,IAAI,CAAC,UAAU,EAAE;YACnB,OAAO,EAAE,CAAC;SACX;QACD,OAAO,IAAI,CAAC,QAAQ,CAAC,WAAW,EAAE,CAAC;IACrC,CAAC;IAED;;;;;OAKG;IACH,UAAU,CACR,EAAsC;QAEtC,IAAI,IAAI,CAAC,UAAU,EAAE;YACnB,MAAM,IAAI,KAAK,CAAC,YAAY,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,cAAc,CAAC,CAAC;SAC3E;QACD,OAAO,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;IACtC,CAAC;IAED;;;;;;;OAOG;IACH,KAAK,CAAC,cAAc,CAAC,OAGpB;QACC,IAAI,IAAI,CAAC,UAAU,EAAE;YACnB,OAAO,CAAC,GAAG,CACT,YAAY,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,0CAA0C,CACrF,CAAC;YACF,OAAO,EAAE,CAAC;SACX;QACD,OAAO,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;IAC/C,CAAC;IAED;;;;;;;OAOG;IACH,KAAK,CAAC,yBAAyB,CAAC,OAG/B;QACC,IAAI,IAAI,CAAC,UAAU,EAAE;YACnB,OAAO,CAAC,GAAG,CACT,YAAY,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,2CAA2C,CACtF,CAAC;YACF,OAAO,EAAE,CAAC;SACX;QACD,OAAO,IAAI,CAAC,QAAQ,CAAC,yBAAyB,CAAC,OAAO,CAAC,CAAC;IAC1D,CAAC;IAED;;;;;OAKG;IACH,mBAAmB,CAAC,OAAqC;QACvD,kEAAkE;QAClE,IACE,qBAAqB,IAAI,IAAI,CAAC,QAAQ;YACtC,OAAO,IAAI,CAAC,QAAQ,CAAC,mBAAmB,KAAK,UAAU,EACvD;YACA,OAAO,IAAI,CAAC,QAAQ,CAAC,mBAAmB,CAAC,OAAO,CAAC,CAAC;SACnD;QACD,oDAAoD;QACpD,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AA7GD,0CA6GC;AAED;;;;;GAKG;AACH,SAAgB,iBAAiB,CAC/B,QAAyE;IAEzE,OAAO,QAAQ,YAAY,eAAe,CAAC;AAC7C,CAAC;AAJD,8CAIC","sourcesContent":["import type { AccountProvider, Bip44Account } from '@metamask/account-api';\nimport type { EntropySourceId, KeyringAccount } from '@metamask/keyring-api';\n\n/**\n * A simple wrapper that adds disable functionality to any AccountProvider.\n * When disabled, the provider will not create new accounts and return empty results.\n */\nexport class ProviderWrapper\n implements AccountProvider<Bip44Account<KeyringAccount>>\n{\n private isDisabled: boolean = false;\n\n private readonly provider: AccountProvider<Bip44Account<KeyringAccount>>;\n\n constructor(provider: AccountProvider<Bip44Account<KeyringAccount>>) {\n this.provider = provider;\n }\n\n /**\n * Set the disabled state for this provider.\n *\n * @param disabled - Whether the provider should be disabled.\n */\n setDisabled(disabled: boolean): void {\n this.isDisabled = disabled;\n console.log(\n `Provider ${this.provider.constructor.name} ${disabled ? 'disabled' : 'enabled'}`,\n );\n }\n\n /**\n * Get accounts, returns empty array when disabled.\n *\n * @returns Array of accounts, or empty array if disabled.\n */\n getAccounts(): Bip44Account<KeyringAccount>[] {\n if (this.isDisabled) {\n return [];\n }\n return this.provider.getAccounts();\n }\n\n /**\n * Get account by ID, throws error when disabled.\n *\n * @param id - The account ID to retrieve.\n * @returns The account with the specified ID, or undefined if not found.\n */\n getAccount(\n id: Bip44Account<KeyringAccount>['id'],\n ): Bip44Account<KeyringAccount> | undefined {\n if (this.isDisabled) {\n throw new Error(`Provider ${this.provider.constructor.name} is disabled`);\n }\n return this.provider.getAccount(id);\n }\n\n /**\n * Create accounts, returns empty array when disabled.\n *\n * @param options - Account creation options.\n * @param options.entropySource - The entropy source to use.\n * @param options.groupIndex - The group index to use.\n * @returns Promise resolving to created accounts, or empty array if disabled.\n */\n async createAccounts(options: {\n entropySource: EntropySourceId;\n groupIndex: number;\n }): Promise<Bip44Account<KeyringAccount>[]> {\n if (this.isDisabled) {\n console.log(\n `Provider ${this.provider.constructor.name} is disabled - skipping account creation`,\n );\n return [];\n }\n return this.provider.createAccounts(options);\n }\n\n /**\n * Discover and create accounts, returns empty array when disabled.\n *\n * @param options - Account discovery options.\n * @param options.entropySource - The entropy source to use.\n * @param options.groupIndex - The group index to use.\n * @returns Promise resolving to discovered accounts, or empty array if disabled.\n */\n async discoverAndCreateAccounts(options: {\n entropySource: EntropySourceId;\n groupIndex: number;\n }): Promise<Bip44Account<KeyringAccount>[]> {\n if (this.isDisabled) {\n console.log(\n `Provider ${this.provider.constructor.name} is disabled - skipping account discovery`,\n );\n return [];\n }\n return this.provider.discoverAndCreateAccounts(options);\n }\n\n /**\n * Check if account is compatible.\n *\n * @param account - The account to check.\n * @returns True if the account is compatible.\n */\n isAccountCompatible(account: Bip44Account<KeyringAccount>): boolean {\n // Check if the provider has the method (from BaseAccountProvider)\n if (\n 'isAccountCompatible' in this.provider &&\n typeof this.provider.isAccountCompatible === 'function'\n ) {\n return this.provider.isAccountCompatible(account);\n }\n // Fallback: return true if the method doesn't exist\n return true;\n }\n}\n\n/**\n * Simple type guard to check if a provider is wrapped.\n *\n * @param provider - The provider to check.\n * @returns True if the provider is a ProviderWrapper.\n */\nexport function isProviderWrapper(\n provider: AccountProvider<Bip44Account<KeyringAccount>> | ProviderWrapper,\n): provider is ProviderWrapper {\n return provider instanceof ProviderWrapper;\n}\n"]}
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import type { AccountProvider, Bip44Account } from "@metamask/account-api";
|
|
2
|
-
import type { EntropySourceId, KeyringAccount } from "@metamask/keyring-api";
|
|
3
|
-
/**
|
|
4
|
-
* A simple wrapper that adds disable functionality to any AccountProvider.
|
|
5
|
-
* When disabled, the provider will not create new accounts and return empty results.
|
|
6
|
-
*/
|
|
7
|
-
export declare class ProviderWrapper implements AccountProvider<Bip44Account<KeyringAccount>> {
|
|
8
|
-
private isDisabled;
|
|
9
|
-
private readonly provider;
|
|
10
|
-
constructor(provider: AccountProvider<Bip44Account<KeyringAccount>>);
|
|
11
|
-
/**
|
|
12
|
-
* Set the disabled state for this provider.
|
|
13
|
-
*
|
|
14
|
-
* @param disabled - Whether the provider should be disabled.
|
|
15
|
-
*/
|
|
16
|
-
setDisabled(disabled: boolean): void;
|
|
17
|
-
/**
|
|
18
|
-
* Get accounts, returns empty array when disabled.
|
|
19
|
-
*
|
|
20
|
-
* @returns Array of accounts, or empty array if disabled.
|
|
21
|
-
*/
|
|
22
|
-
getAccounts(): Bip44Account<KeyringAccount>[];
|
|
23
|
-
/**
|
|
24
|
-
* Get account by ID, throws error when disabled.
|
|
25
|
-
*
|
|
26
|
-
* @param id - The account ID to retrieve.
|
|
27
|
-
* @returns The account with the specified ID, or undefined if not found.
|
|
28
|
-
*/
|
|
29
|
-
getAccount(id: Bip44Account<KeyringAccount>['id']): Bip44Account<KeyringAccount> | undefined;
|
|
30
|
-
/**
|
|
31
|
-
* Create accounts, returns empty array when disabled.
|
|
32
|
-
*
|
|
33
|
-
* @param options - Account creation options.
|
|
34
|
-
* @param options.entropySource - The entropy source to use.
|
|
35
|
-
* @param options.groupIndex - The group index to use.
|
|
36
|
-
* @returns Promise resolving to created accounts, or empty array if disabled.
|
|
37
|
-
*/
|
|
38
|
-
createAccounts(options: {
|
|
39
|
-
entropySource: EntropySourceId;
|
|
40
|
-
groupIndex: number;
|
|
41
|
-
}): Promise<Bip44Account<KeyringAccount>[]>;
|
|
42
|
-
/**
|
|
43
|
-
* Discover and create accounts, returns empty array when disabled.
|
|
44
|
-
*
|
|
45
|
-
* @param options - Account discovery options.
|
|
46
|
-
* @param options.entropySource - The entropy source to use.
|
|
47
|
-
* @param options.groupIndex - The group index to use.
|
|
48
|
-
* @returns Promise resolving to discovered accounts, or empty array if disabled.
|
|
49
|
-
*/
|
|
50
|
-
discoverAndCreateAccounts(options: {
|
|
51
|
-
entropySource: EntropySourceId;
|
|
52
|
-
groupIndex: number;
|
|
53
|
-
}): Promise<Bip44Account<KeyringAccount>[]>;
|
|
54
|
-
/**
|
|
55
|
-
* Check if account is compatible.
|
|
56
|
-
*
|
|
57
|
-
* @param account - The account to check.
|
|
58
|
-
* @returns True if the account is compatible.
|
|
59
|
-
*/
|
|
60
|
-
isAccountCompatible(account: Bip44Account<KeyringAccount>): boolean;
|
|
61
|
-
}
|
|
62
|
-
/**
|
|
63
|
-
* Simple type guard to check if a provider is wrapped.
|
|
64
|
-
*
|
|
65
|
-
* @param provider - The provider to check.
|
|
66
|
-
* @returns True if the provider is a ProviderWrapper.
|
|
67
|
-
*/
|
|
68
|
-
export declare function isProviderWrapper(provider: AccountProvider<Bip44Account<KeyringAccount>> | ProviderWrapper): provider is ProviderWrapper;
|
|
69
|
-
//# source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E,eAAe,CAAC,YAAY,CAAC,cAAc,CAAC,CAAC,GAAG,eAAe,GACxE,QAAQ,IAAI,eAAe,CAE7B"}
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import type { AccountProvider, Bip44Account } from "@metamask/account-api";
|
|
2
|
-
import type { EntropySourceId, KeyringAccount } from "@metamask/keyring-api";
|
|
3
|
-
/**
|
|
4
|
-
* A simple wrapper that adds disable functionality to any AccountProvider.
|
|
5
|
-
* When disabled, the provider will not create new accounts and return empty results.
|
|
6
|
-
*/
|
|
7
|
-
export declare class ProviderWrapper implements AccountProvider<Bip44Account<KeyringAccount>> {
|
|
8
|
-
private isDisabled;
|
|
9
|
-
private readonly provider;
|
|
10
|
-
constructor(provider: AccountProvider<Bip44Account<KeyringAccount>>);
|
|
11
|
-
/**
|
|
12
|
-
* Set the disabled state for this provider.
|
|
13
|
-
*
|
|
14
|
-
* @param disabled - Whether the provider should be disabled.
|
|
15
|
-
*/
|
|
16
|
-
setDisabled(disabled: boolean): void;
|
|
17
|
-
/**
|
|
18
|
-
* Get accounts, returns empty array when disabled.
|
|
19
|
-
*
|
|
20
|
-
* @returns Array of accounts, or empty array if disabled.
|
|
21
|
-
*/
|
|
22
|
-
getAccounts(): Bip44Account<KeyringAccount>[];
|
|
23
|
-
/**
|
|
24
|
-
* Get account by ID, throws error when disabled.
|
|
25
|
-
*
|
|
26
|
-
* @param id - The account ID to retrieve.
|
|
27
|
-
* @returns The account with the specified ID, or undefined if not found.
|
|
28
|
-
*/
|
|
29
|
-
getAccount(id: Bip44Account<KeyringAccount>['id']): Bip44Account<KeyringAccount> | undefined;
|
|
30
|
-
/**
|
|
31
|
-
* Create accounts, returns empty array when disabled.
|
|
32
|
-
*
|
|
33
|
-
* @param options - Account creation options.
|
|
34
|
-
* @param options.entropySource - The entropy source to use.
|
|
35
|
-
* @param options.groupIndex - The group index to use.
|
|
36
|
-
* @returns Promise resolving to created accounts, or empty array if disabled.
|
|
37
|
-
*/
|
|
38
|
-
createAccounts(options: {
|
|
39
|
-
entropySource: EntropySourceId;
|
|
40
|
-
groupIndex: number;
|
|
41
|
-
}): Promise<Bip44Account<KeyringAccount>[]>;
|
|
42
|
-
/**
|
|
43
|
-
* Discover and create accounts, returns empty array when disabled.
|
|
44
|
-
*
|
|
45
|
-
* @param options - Account discovery options.
|
|
46
|
-
* @param options.entropySource - The entropy source to use.
|
|
47
|
-
* @param options.groupIndex - The group index to use.
|
|
48
|
-
* @returns Promise resolving to discovered accounts, or empty array if disabled.
|
|
49
|
-
*/
|
|
50
|
-
discoverAndCreateAccounts(options: {
|
|
51
|
-
entropySource: EntropySourceId;
|
|
52
|
-
groupIndex: number;
|
|
53
|
-
}): Promise<Bip44Account<KeyringAccount>[]>;
|
|
54
|
-
/**
|
|
55
|
-
* Check if account is compatible.
|
|
56
|
-
*
|
|
57
|
-
* @param account - The account to check.
|
|
58
|
-
* @returns True if the account is compatible.
|
|
59
|
-
*/
|
|
60
|
-
isAccountCompatible(account: Bip44Account<KeyringAccount>): boolean;
|
|
61
|
-
}
|
|
62
|
-
/**
|
|
63
|
-
* Simple type guard to check if a provider is wrapped.
|
|
64
|
-
*
|
|
65
|
-
* @param provider - The provider to check.
|
|
66
|
-
* @returns True if the provider is a ProviderWrapper.
|
|
67
|
-
*/
|
|
68
|
-
export declare function isProviderWrapper(provider: AccountProvider<Bip44Account<KeyringAccount>> | ProviderWrapper): provider is ProviderWrapper;
|
|
69
|
-
//# sourceMappingURL=ProviderWrapper.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ProviderWrapper.d.mts","sourceRoot":"","sources":["../../src/providers/ProviderWrapper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,8BAA8B;AAC3E,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,8BAA8B;AAE7E;;;GAGG;AACH,qBAAa,eACX,YAAW,eAAe,CAAC,YAAY,CAAC,cAAc,CAA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