@subwallet/extension-base 1.3.72-0 → 1.3.74-0
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/background/KoniTypes.d.ts +42 -5
- package/background/KoniTypes.js +14 -1
- package/cjs/background/KoniTypes.js +16 -2
- package/cjs/core/logic-validation/transfer.js +35 -57
- package/cjs/koni/background/handlers/Extension.js +599 -146
- package/cjs/koni/background/handlers/State.js +5 -6
- package/cjs/koni/background/handlers/Tabs.js +3 -2
- package/cjs/koni/background/subscription.js +2 -22
- package/cjs/packageInfo.js +1 -1
- package/cjs/services/balance-service/helpers/subscribe/substrate/index.js +0 -2
- package/cjs/services/chain-service/handler/SubstrateApi.js +6 -1
- package/cjs/services/chain-service/index.js +1 -0
- package/cjs/services/chain-service/utils/index.js +4 -0
- package/cjs/services/earning-service/handlers/native-staking/para-chain.js +17 -2
- package/cjs/services/event-service/index.js +1 -0
- package/cjs/services/fee-service/utils/index.js +4 -4
- package/cjs/services/inapp-notification-service/consts.js +4 -2
- package/cjs/services/inapp-notification-service/index.js +51 -6
- package/cjs/services/inapp-notification-service/interfaces.js +2 -0
- package/cjs/services/inapp-notification-service/utils/common.js +4 -0
- package/cjs/services/keyring-service/context/account-context.js +44 -0
- package/cjs/services/keyring-service/context/handlers/Multisig.js +186 -0
- package/cjs/services/keyring-service/context/state.js +12 -0
- package/cjs/services/multisig-service/index.js +627 -0
- package/cjs/services/multisig-service/utils.js +242 -0
- package/cjs/services/request-service/handler/SubstrateRequestHandler.js +25 -0
- package/cjs/services/request-service/index.js +5 -1
- package/cjs/services/storage-service/DatabaseService.js +5 -2
- package/cjs/services/storage-service/db-stores/InappNotification.js +20 -2
- package/cjs/services/substrate-proxy-service/index.js +22 -7
- package/cjs/services/transaction-service/helpers/index.js +8 -0
- package/cjs/services/transaction-service/index.js +348 -147
- package/cjs/services/transaction-service/types.js +18 -1
- package/cjs/types/account/info/keyring.js +5 -0
- package/cjs/types/account/info/proxy.js +1 -0
- package/cjs/types/multisig/index.js +14 -0
- package/cjs/types/transaction/error.js +9 -2
- package/cjs/utils/account/transform.js +28 -4
- package/cjs/utils/logger/Logger.js +294 -0
- package/cjs/utils/logger/index.js +42 -0
- package/cjs/utils/logger/types.js +1 -0
- package/core/logic-validation/transfer.d.ts +2 -2
- package/core/logic-validation/transfer.js +10 -32
- package/koni/background/handlers/Extension.d.ts +7 -0
- package/koni/background/handlers/Extension.js +498 -45
- package/koni/background/handlers/State.d.ts +2 -1
- package/koni/background/handlers/State.js +5 -6
- package/koni/background/handlers/Tabs.js +3 -2
- package/koni/background/subscription.js +2 -22
- package/package.json +43 -7
- package/packageInfo.js +1 -1
- package/services/balance-service/helpers/subscribe/substrate/index.js +0 -2
- package/services/chain-service/handler/SubstrateApi.js +7 -2
- package/services/chain-service/index.js +1 -0
- package/services/chain-service/types.d.ts +1 -1
- package/services/chain-service/utils/index.js +4 -0
- package/services/earning-service/handlers/native-staking/para-chain.js +17 -2
- package/services/event-service/index.d.ts +1 -0
- package/services/event-service/index.js +1 -0
- package/services/event-service/types.d.ts +1 -0
- package/services/fee-service/utils/index.js +4 -4
- package/services/inapp-notification-service/consts.d.ts +3 -1
- package/services/inapp-notification-service/consts.js +5 -3
- package/services/inapp-notification-service/index.d.ts +3 -2
- package/services/inapp-notification-service/index.js +51 -6
- package/services/inapp-notification-service/interfaces.d.ts +18 -2
- package/services/inapp-notification-service/interfaces.js +2 -0
- package/services/inapp-notification-service/utils/common.d.ts +1 -0
- package/services/inapp-notification-service/utils/common.js +3 -0
- package/services/keyring-service/context/account-context.d.ts +9 -1
- package/services/keyring-service/context/account-context.js +44 -0
- package/services/keyring-service/context/handlers/Multisig.d.ts +18 -0
- package/services/keyring-service/context/handlers/Multisig.js +180 -0
- package/services/keyring-service/context/state.d.ts +2 -0
- package/services/keyring-service/context/state.js +12 -0
- package/services/multisig-service/index.d.ts +245 -0
- package/services/multisig-service/index.js +620 -0
- package/services/multisig-service/utils.d.ts +95 -0
- package/services/multisig-service/utils.js +227 -0
- package/services/request-service/handler/SubstrateRequestHandler.d.ts +1 -0
- package/services/request-service/handler/SubstrateRequestHandler.js +25 -0
- package/services/request-service/index.d.ts +2 -1
- package/services/request-service/index.js +5 -1
- package/services/storage-service/DatabaseService.d.ts +3 -2
- package/services/storage-service/DatabaseService.js +5 -2
- package/services/storage-service/db-stores/InappNotification.d.ts +3 -2
- package/services/storage-service/db-stores/InappNotification.js +20 -2
- package/services/substrate-proxy-service/index.d.ts +4 -1
- package/services/substrate-proxy-service/index.js +22 -8
- package/services/transaction-service/helpers/index.js +8 -0
- package/services/transaction-service/index.d.ts +31 -0
- package/services/transaction-service/index.js +270 -69
- package/services/transaction-service/types.d.ts +28 -3
- package/services/transaction-service/types.js +12 -1
- package/types/account/info/keyring.d.ts +14 -1
- package/types/account/info/keyring.js +6 -0
- package/types/account/info/proxy.d.ts +1 -0
- package/types/account/info/proxy.js +1 -0
- package/types/multisig/index.d.ts +76 -0
- package/types/multisig/index.js +8 -0
- package/types/notification/index.d.ts +8 -0
- package/types/substrateProxyAccount/index.d.ts +26 -1
- package/types/transaction/error.d.ts +6 -1
- package/types/transaction/error.js +7 -1
- package/types/transaction/request.d.ts +0 -1
- package/types/yield/info/pallet.d.ts +1 -1
- package/utils/account/transform.js +28 -4
- package/utils/logger/Logger.d.ts +31 -0
- package/utils/logger/Logger.js +267 -0
- package/utils/logger/index.d.ts +15 -0
- package/utils/logger/index.js +29 -0
- package/utils/logger/types.d.ts +23 -0
- package/utils/logger/types.js +1 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ExtrinsicType } from '@subwallet/extension-base/background/KoniTypes';
|
|
2
2
|
import { AvailBridgeSourceChain } from '@subwallet/extension-base/services/inapp-notification-service/utils';
|
|
3
|
+
import { MultisigTxType } from '@subwallet/extension-base/services/multisig-service';
|
|
3
4
|
import { YieldPoolType } from '@subwallet/extension-base/types';
|
|
4
5
|
export interface _BaseNotificationInfo {
|
|
5
6
|
id: string;
|
|
@@ -30,6 +31,7 @@ export interface ActionTypeToMetadataMap {
|
|
|
30
31
|
[NotificationActionType.CLAIM_POLYGON_BRIDGE]: ClaimPolygonBridgeNotificationMetadata;
|
|
31
32
|
[NotificationActionType.SWAP]: ProcessNotificationMetadata;
|
|
32
33
|
[NotificationActionType.EARNING]: ProcessNotificationMetadata;
|
|
34
|
+
[NotificationActionType.MULTISIG_APPROVAL]: MultisigApprovalNotificationMetadata;
|
|
33
35
|
}
|
|
34
36
|
export interface SendReceiveNotificationMetadata {
|
|
35
37
|
chain: string;
|
|
@@ -76,6 +78,18 @@ export interface ClaimPolygonBridgeNotificationMetadata {
|
|
|
76
78
|
export interface ProcessNotificationMetadata {
|
|
77
79
|
processId: string;
|
|
78
80
|
}
|
|
81
|
+
export interface MultisigApprovalNotificationMetadata {
|
|
82
|
+
multisigKey: string;
|
|
83
|
+
multisigTxType: MultisigTxType;
|
|
84
|
+
chain: string;
|
|
85
|
+
multisigAddress: string;
|
|
86
|
+
extrinsicHash: string;
|
|
87
|
+
callHash: string;
|
|
88
|
+
blockHeight: number;
|
|
89
|
+
extrinsicIndex: number;
|
|
90
|
+
currentSigner: string;
|
|
91
|
+
approvals: string[];
|
|
92
|
+
}
|
|
79
93
|
export declare enum NotificationTimePeriod {
|
|
80
94
|
TODAY = "TODAY",
|
|
81
95
|
THIS_WEEK = "THIS_WEEK",
|
|
@@ -90,12 +104,14 @@ export declare enum NotificationActionType {
|
|
|
90
104
|
CLAIM_AVAIL_BRIDGE_ON_ETHEREUM = "CLAIM_AVAIL_BRIDGE_ON_ETHEREUM",
|
|
91
105
|
CLAIM_POLYGON_BRIDGE = "CLAIM_POLYGON_BRIDGE",
|
|
92
106
|
SWAP = "SWAP",
|
|
93
|
-
EARNING = "EARNING"
|
|
107
|
+
EARNING = "EARNING",
|
|
108
|
+
MULTISIG_APPROVAL = "MULTISIG_APPROVAL"
|
|
94
109
|
}
|
|
95
110
|
export declare enum NotificationTab {
|
|
96
111
|
ALL = "ALL",
|
|
97
112
|
UNREAD = "UNREAD",
|
|
98
|
-
READ = "READ"
|
|
113
|
+
READ = "READ",
|
|
114
|
+
MULTISIG = "MULTISIG"
|
|
99
115
|
}
|
|
100
116
|
export interface ShowNotificationPayload {
|
|
101
117
|
earningClaim: boolean;
|
|
@@ -24,10 +24,12 @@ export let NotificationActionType;
|
|
|
24
24
|
NotificationActionType["CLAIM_POLYGON_BRIDGE"] = "CLAIM_POLYGON_BRIDGE";
|
|
25
25
|
NotificationActionType["SWAP"] = "SWAP";
|
|
26
26
|
NotificationActionType["EARNING"] = "EARNING";
|
|
27
|
+
NotificationActionType["MULTISIG_APPROVAL"] = "MULTISIG_APPROVAL";
|
|
27
28
|
})(NotificationActionType || (NotificationActionType = {}));
|
|
28
29
|
export let NotificationTab;
|
|
29
30
|
(function (NotificationTab) {
|
|
30
31
|
NotificationTab["ALL"] = "ALL";
|
|
31
32
|
NotificationTab["UNREAD"] = "UNREAD";
|
|
32
33
|
NotificationTab["READ"] = "READ";
|
|
34
|
+
NotificationTab["MULTISIG"] = "MULTISIG";
|
|
33
35
|
})(NotificationTab || (NotificationTab = {}));
|
|
@@ -5,6 +5,7 @@ export declare function getWithdrawDescription(amount: string, symbol: string, s
|
|
|
5
5
|
export declare function getClaimDescription(amount: string, symbol: string): string;
|
|
6
6
|
export declare function getSendDescription(amount: string, symbol: string): string;
|
|
7
7
|
export declare function getReceiveDescription(amount: string, symbol: string): string;
|
|
8
|
+
export declare function getMultisigApprovalDescription(): string;
|
|
8
9
|
export declare function getIsTabRead(notificationTab: NotificationTab): boolean | undefined;
|
|
9
10
|
export declare function createWithdrawNotifications(unstakingInfos: UnstakingInfo[], tokenInfo: _ChainAsset, address: string, stakingSlug: string, stakingType: YieldPoolType): _BaseNotificationInfo[];
|
|
10
11
|
export declare function createClaimNotification(claimItemInfo: EarningRewardItem, tokenInfo: _ChainAsset): _BaseNotificationInfo;
|
|
@@ -24,6 +24,9 @@ export function getSendDescription(amount, symbol) {
|
|
|
24
24
|
export function getReceiveDescription(amount, symbol) {
|
|
25
25
|
return `You have just received ${amount} ${symbol}`;
|
|
26
26
|
}
|
|
27
|
+
export function getMultisigApprovalDescription() {
|
|
28
|
+
return 'A multisig transaction is waiting for your approval. Click to view details';
|
|
29
|
+
}
|
|
27
30
|
|
|
28
31
|
/* Description */
|
|
29
32
|
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { AccountExternalError, RequestAccountCreateExternalV2, RequestAccountCreateHardwareMultiple, RequestAccountCreateHardwareV2, RequestAccountCreateWithSecretKey, RequestAccountExportPrivateKey, RequestChangeMasterPassword, RequestMigratePassword, RequestMigrateSoloAccount, RequestMigrateUnifiedAndFetchEligibleSoloAccounts, RequestPingSession, ResponseAccountCreateWithSecretKey, ResponseAccountExportPrivateKey, ResponseChangeMasterPassword, ResponseMigratePassword } from '@subwallet/extension-base/background/KoniTypes';
|
|
1
|
+
import { AccountExternalError, AccountMultisigError, RequestAccountCreateExternalV2, RequestAccountCreateHardwareMultiple, RequestAccountCreateHardwareV2, RequestAccountCreateMultisig, RequestAccountCreateWithSecretKey, RequestAccountExportPrivateKey, RequestChangeMasterPassword, RequestMigratePassword, RequestMigrateSoloAccount, RequestMigrateUnifiedAndFetchEligibleSoloAccounts, RequestPingSession, ResponseAccountCreateWithSecretKey, ResponseAccountExportPrivateKey, ResponseChangeMasterPassword, ResponseMigratePassword } from '@subwallet/extension-base/background/KoniTypes';
|
|
2
2
|
import KoniState from '@subwallet/extension-base/koni/background/handlers/State';
|
|
3
3
|
import { KeyringService } from '@subwallet/extension-base/services/keyring-service';
|
|
4
4
|
import { AccountProxyMap, CurrentAccountInfo, RequestAccountBatchExportV2, RequestAccountCreateSuriV2, RequestAccountNameValidate, RequestAccountProxyEdit, RequestAccountProxyForget, RequestBatchJsonGetAccountInfo, RequestBatchRestoreV2, RequestChangeTonWalletContractVersion, RequestCheckPublicAndSecretKey, RequestDeriveCreateMultiple, RequestDeriveCreateV3, RequestDeriveValidateV2, RequestExportAccountProxyMnemonic, RequestGetAllTonWalletContractVersion, RequestGetDeriveAccounts, RequestGetDeriveSuggestion, RequestJsonGetAccountInfo, RequestJsonRestoreV2, RequestMnemonicCreateV2, RequestMnemonicValidateV2, RequestPrivateKeyValidateV2, ResponseAccountBatchExportV2, ResponseAccountCreateSuriV2, ResponseAccountNameValidate, ResponseBatchJsonGetAccountInfo, ResponseCheckPublicAndSecretKey, ResponseDeriveValidateV2, ResponseExportAccountProxyMnemonic, ResponseGetAllTonWalletContractVersion, ResponseGetDeriveAccounts, ResponseGetDeriveSuggestion, ResponseJsonGetAccountInfo, ResponseMnemonicCreateV2, ResponseMnemonicValidateV2, ResponsePrivateKeyValidateV2 } from '@subwallet/extension-base/types';
|
|
5
|
+
import { MultisigAccountInfo, RequestGetSignableAccountInfos, ResponseGetSignableAccountInfos } from '@subwallet/extension-base/types/multisig';
|
|
5
6
|
import { InjectedAccountWithMeta } from '@subwallet/extension-inject/types';
|
|
6
7
|
import { SubjectInfo } from '@subwallet/ui-keyring/observable/types';
|
|
7
8
|
export declare class AccountContext {
|
|
@@ -16,6 +17,7 @@ export declare class AccountContext {
|
|
|
16
17
|
private readonly modifyHandler;
|
|
17
18
|
private readonly secretHandler;
|
|
18
19
|
private readonly migrationHandler;
|
|
20
|
+
private readonly multisigHandler;
|
|
19
21
|
constructor(koniState: KoniState, parentService: KeyringService);
|
|
20
22
|
get pairs(): SubjectInfo;
|
|
21
23
|
get observable(): {
|
|
@@ -55,6 +57,8 @@ export declare class AccountContext {
|
|
|
55
57
|
accountsCreateSuriV2(request: RequestAccountCreateSuriV2): ResponseAccountCreateSuriV2;
|
|
56
58
|
exportAccountProxyMnemonic(request: RequestExportAccountProxyMnemonic): ResponseExportAccountProxyMnemonic;
|
|
57
59
|
accountsCreateExternalV2(request: RequestAccountCreateExternalV2): Promise<AccountExternalError[]>;
|
|
60
|
+
accountsCreateMultisig(request: RequestAccountCreateMultisig): Promise<AccountMultisigError[]>;
|
|
61
|
+
getSignableAccountInfos(request: RequestGetSignableAccountInfos): ResponseGetSignableAccountInfos;
|
|
58
62
|
privateKeyValidateV2(request: RequestPrivateKeyValidateV2): ResponsePrivateKeyValidateV2;
|
|
59
63
|
accountsCreateHardwareV2(request: RequestAccountCreateHardwareV2): Promise<boolean>;
|
|
60
64
|
accountsCreateHardwareMultiple(request: RequestAccountCreateHardwareMultiple): Promise<boolean>;
|
|
@@ -88,6 +92,10 @@ export declare class AccountContext {
|
|
|
88
92
|
migrateUnifiedAndFetchEligibleSoloAccounts(request: RequestMigrateUnifiedAndFetchEligibleSoloAccounts, setMigratingModeFn: () => void): Promise<import("@subwallet/extension-base/background/KoniTypes").ResponseMigrateUnifiedAndFetchEligibleSoloAccounts>;
|
|
89
93
|
migrateSoloAccount(request: RequestMigrateSoloAccount): import("@subwallet/extension-base/background/KoniTypes").ResponseMigrateSoloAccount;
|
|
90
94
|
pingSession(request: RequestPingSession): boolean;
|
|
95
|
+
getMultisigAccounts(): import("@subwallet/extension-base/types").AccountProxy[];
|
|
96
|
+
getMultisigAccountByAddress(address?: string): import("@subwallet/extension-base/types").AccountProxy | undefined;
|
|
97
|
+
getMultisigAccountInfoByAddress(address?: string): MultisigAccountInfo | undefined;
|
|
98
|
+
getMultisigAddresses(): string[];
|
|
91
99
|
removeNoneHardwareGenesisHash(): void;
|
|
92
100
|
updateMetadataForPair(): void;
|
|
93
101
|
resetWallet(): void;
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
|
|
4
4
|
import { AccountMigrationHandler } from '@subwallet/extension-base/services/keyring-service/context/handlers/Migration';
|
|
5
|
+
import { AccountMultisigHandler } from '@subwallet/extension-base/services/keyring-service/context/handlers/Multisig';
|
|
6
|
+
import { reformatAddress } from '@subwallet/extension-base/utils';
|
|
5
7
|
import { AccountDeriveHandler, AccountInjectHandler, AccountJsonHandler, AccountLedgerHandler, AccountMnemonicHandler, AccountModifyHandler, AccountSecretHandler } from "./handlers/index.js";
|
|
6
8
|
import { AccountState } from "./state.js";
|
|
7
9
|
export class AccountContext {
|
|
@@ -17,6 +19,7 @@ export class AccountContext {
|
|
|
17
19
|
this.modifyHandler = new AccountModifyHandler(this.parentService, this.state);
|
|
18
20
|
this.secretHandler = new AccountSecretHandler(this.parentService, this.state);
|
|
19
21
|
this.migrationHandler = new AccountMigrationHandler(this.parentService, this.state);
|
|
22
|
+
this.multisigHandler = new AccountMultisigHandler(this.parentService, this.state);
|
|
20
23
|
}
|
|
21
24
|
|
|
22
25
|
// TODO: Merge to value
|
|
@@ -139,6 +142,15 @@ export class AccountContext {
|
|
|
139
142
|
return this.secretHandler.accountsCreateExternalV2(request);
|
|
140
143
|
}
|
|
141
144
|
|
|
145
|
+
/* Multisig */
|
|
146
|
+
async accountsCreateMultisig(request) {
|
|
147
|
+
return this.multisigHandler.accountsCreateMultisig(request);
|
|
148
|
+
}
|
|
149
|
+
getSignableAccountInfos(request) {
|
|
150
|
+
const chainInfo = this.koniState.chainService.getChainInfoByKey(request.chain);
|
|
151
|
+
return this.multisigHandler.getSignableAccountInfos(request, chainInfo);
|
|
152
|
+
}
|
|
153
|
+
|
|
142
154
|
/* Import ethereum account with the private key */
|
|
143
155
|
privateKeyValidateV2(request) {
|
|
144
156
|
return this.secretHandler.privateKeyValidateV2(request);
|
|
@@ -254,6 +266,38 @@ export class AccountContext {
|
|
|
254
266
|
|
|
255
267
|
/* Migration */
|
|
256
268
|
|
|
269
|
+
/* Multisig */
|
|
270
|
+
|
|
271
|
+
getMultisigAccounts() {
|
|
272
|
+
return this.state.getMultisigAccounts();
|
|
273
|
+
}
|
|
274
|
+
getMultisigAccountByAddress(address) {
|
|
275
|
+
if (!address) {
|
|
276
|
+
return undefined;
|
|
277
|
+
}
|
|
278
|
+
const allMultisigAccounts = this.getMultisigAccounts();
|
|
279
|
+
return allMultisigAccounts.find(acc => acc.accounts[0].address === reformatAddress(address));
|
|
280
|
+
}
|
|
281
|
+
getMultisigAccountInfoByAddress(address) {
|
|
282
|
+
const accountProxy = this.getMultisigAccountByAddress(address);
|
|
283
|
+
if (!accountProxy) {
|
|
284
|
+
return undefined;
|
|
285
|
+
}
|
|
286
|
+
const threshold = accountProxy.accounts[0].threshold;
|
|
287
|
+
const signers = accountProxy.accounts[0].signers;
|
|
288
|
+
const multisigAddress = accountProxy.accounts[0].address;
|
|
289
|
+
return {
|
|
290
|
+
threshold,
|
|
291
|
+
signers,
|
|
292
|
+
multisigAddress
|
|
293
|
+
};
|
|
294
|
+
}
|
|
295
|
+
getMultisigAddresses() {
|
|
296
|
+
return this.state.getMultisigAddresses();
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
/* Multisig */
|
|
300
|
+
|
|
257
301
|
/* Others */
|
|
258
302
|
|
|
259
303
|
removeNoneHardwareGenesisHash() {
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { _ChainInfo } from '@subwallet/chain-list/types';
|
|
2
|
+
import { AccountMultisigError, RequestAccountCreateMultisig } from '@subwallet/extension-base/background/KoniTypes';
|
|
3
|
+
import { AccountBaseHandler } from '@subwallet/extension-base/services/keyring-service/context/handlers/Base';
|
|
4
|
+
import { RequestGetSignableAccountInfos, ResponseGetSignableAccountInfos } from '@subwallet/extension-base/types/multisig';
|
|
5
|
+
/**
|
|
6
|
+
* @class AccountMultisigHandler
|
|
7
|
+
* @extends AccountBaseHandler
|
|
8
|
+
* @description Handler for multisig account
|
|
9
|
+
* */
|
|
10
|
+
export declare class AccountMultisigHandler extends AccountBaseHandler {
|
|
11
|
+
private validateSigners;
|
|
12
|
+
accountsCreateMultisig(request: RequestAccountCreateMultisig): Promise<AccountMultisigError[]>;
|
|
13
|
+
/**
|
|
14
|
+
* Get 1-level signatories
|
|
15
|
+
* Ignore multisig accounts that are also signatories
|
|
16
|
+
*/
|
|
17
|
+
getSignableAccountInfos(request: RequestGetSignableAccountInfos, chainInfo: _ChainInfo): ResponseGetSignableAccountInfos;
|
|
18
|
+
}
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
// Copyright 2019-2022 @subwallet/extension-base
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
import { AccountMultisigErrorCode } from '@subwallet/extension-base/background/KoniTypes';
|
|
5
|
+
import { AccountBaseHandler } from '@subwallet/extension-base/services/keyring-service/context/handlers/Base';
|
|
6
|
+
import { AccountChainType } from '@subwallet/extension-base/types';
|
|
7
|
+
import { reformatAddress } from '@subwallet/extension-base/utils';
|
|
8
|
+
import { encodeAddress, isSubstrateAddress } from '@subwallet/keyring';
|
|
9
|
+
import { keyring } from '@subwallet/ui-keyring';
|
|
10
|
+
import { t } from 'i18next';
|
|
11
|
+
import { createKeyMulti } from '@polkadot/util-crypto';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* @class AccountMultisigHandler
|
|
15
|
+
* @extends AccountBaseHandler
|
|
16
|
+
* @description Handler for multisig account
|
|
17
|
+
* */
|
|
18
|
+
export class AccountMultisigHandler extends AccountBaseHandler {
|
|
19
|
+
validateSigners(signers, threshold) {
|
|
20
|
+
const errors = [];
|
|
21
|
+
if (!signers || signers.length === 0) {
|
|
22
|
+
errors.push({
|
|
23
|
+
code: AccountMultisigErrorCode.INVALID_FILLED_ADDRESS,
|
|
24
|
+
message: t('bg.ACCOUNT.services.keyring.handler.Multisig.signersRequired')
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
if (!signers || signers.length < 2) {
|
|
28
|
+
errors.push({
|
|
29
|
+
code: AccountMultisigErrorCode.INVALID_FILLED_ADDRESS,
|
|
30
|
+
message: t('bg.ACCOUNT.services.keyring.handler.Multisig.multipleSignersRequired')
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
if (!threshold || threshold < 2 || threshold > signers.length) {
|
|
34
|
+
errors.push({
|
|
35
|
+
code: AccountMultisigErrorCode.INVALID_FILLED_THRESHOLD,
|
|
36
|
+
message: t('bg.ACCOUNT.services.keyring.handler.Multisig.invalidThreshold')
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
for (const signer of signers) {
|
|
40
|
+
if (!signer || !isSubstrateAddress(signer)) {
|
|
41
|
+
errors.push({
|
|
42
|
+
code: AccountMultisigErrorCode.INVALID_FILLED_ADDRESS,
|
|
43
|
+
message: t('bg.ACCOUNT.services.keyring.handler.Multisig.mustBeSubstrateAddress')
|
|
44
|
+
});
|
|
45
|
+
break;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
const distinctAddress = new Set();
|
|
49
|
+
for (const signer of signers) {
|
|
50
|
+
const rAddress = reformatAddress(signer);
|
|
51
|
+
if (distinctAddress.has(rAddress)) {
|
|
52
|
+
errors.push({
|
|
53
|
+
code: AccountMultisigErrorCode.DUPLICATE_FILLED_ADDRESS,
|
|
54
|
+
message: t('bg.ACCOUNT.services.keyring.handler.Multisig.duplicateAddressFound')
|
|
55
|
+
});
|
|
56
|
+
break;
|
|
57
|
+
} else {
|
|
58
|
+
distinctAddress.add(rAddress);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return errors;
|
|
62
|
+
}
|
|
63
|
+
async accountsCreateMultisig(request) {
|
|
64
|
+
const {
|
|
65
|
+
name,
|
|
66
|
+
signers: _signer,
|
|
67
|
+
threshold
|
|
68
|
+
} = request;
|
|
69
|
+
|
|
70
|
+
// process signers
|
|
71
|
+
const signerError = this.validateSigners(_signer, threshold);
|
|
72
|
+
if (signerError.length > 0) {
|
|
73
|
+
return signerError;
|
|
74
|
+
}
|
|
75
|
+
const signers = _signer.map(address => reformatAddress(address));
|
|
76
|
+
const multisigKey = createKeyMulti(signers, threshold);
|
|
77
|
+
const multisigAddress = encodeAddress(multisigKey);
|
|
78
|
+
try {
|
|
79
|
+
try {
|
|
80
|
+
const exists = keyring.getPair(multisigAddress);
|
|
81
|
+
if ((exists === null || exists === void 0 ? void 0 : exists.address) === reformatAddress(multisigAddress)) {
|
|
82
|
+
var _exists$meta;
|
|
83
|
+
const existingName = ((_exists$meta = exists.meta) === null || _exists$meta === void 0 ? void 0 : _exists$meta.name) || 'Unknown';
|
|
84
|
+
return [{
|
|
85
|
+
code: AccountMultisigErrorCode.INVALID_ADDRESS,
|
|
86
|
+
message: t('bg.ACCOUNT.services.keyring.handler.Multisig.multisigAddressExists', {
|
|
87
|
+
replace: {
|
|
88
|
+
name: existingName
|
|
89
|
+
}
|
|
90
|
+
})
|
|
91
|
+
}];
|
|
92
|
+
}
|
|
93
|
+
} catch (e) {}
|
|
94
|
+
if (this.state.checkNameExists(name)) {
|
|
95
|
+
return [{
|
|
96
|
+
code: AccountMultisigErrorCode.INVALID_NAME,
|
|
97
|
+
message: t('bg.ACCOUNT.services.keyring.handler.Secret.accountNameAlreadyExists')
|
|
98
|
+
}];
|
|
99
|
+
}
|
|
100
|
+
const meta = {
|
|
101
|
+
name,
|
|
102
|
+
threshold,
|
|
103
|
+
signers,
|
|
104
|
+
isExternal: true,
|
|
105
|
+
isMultisig: true,
|
|
106
|
+
genesisHash: ''
|
|
107
|
+
};
|
|
108
|
+
const multisigPair = keyring.keyring.addFromAddress(multisigAddress, meta);
|
|
109
|
+
keyring.saveAccount(multisigPair);
|
|
110
|
+
const address = multisigPair.address;
|
|
111
|
+
const modifiedPairs = this.state.modifyPairs;
|
|
112
|
+
modifiedPairs[address] = {
|
|
113
|
+
migrated: true,
|
|
114
|
+
key: address
|
|
115
|
+
};
|
|
116
|
+
this.state.upsertModifyPairs(modifiedPairs);
|
|
117
|
+
await new Promise(resolve => {
|
|
118
|
+
this.state.saveCurrentAccountProxyId(address, () => {
|
|
119
|
+
this.state._addAddressToAuthList(address, true);
|
|
120
|
+
resolve();
|
|
121
|
+
});
|
|
122
|
+
});
|
|
123
|
+
return [];
|
|
124
|
+
} catch (e) {
|
|
125
|
+
return [{
|
|
126
|
+
code: AccountMultisigErrorCode.KEYRING_ERROR,
|
|
127
|
+
message: e.message
|
|
128
|
+
}];
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Get 1-level signatories
|
|
134
|
+
* Ignore multisig accounts that are also signatories
|
|
135
|
+
*/
|
|
136
|
+
getSignableAccountInfos(request, chainInfo) {
|
|
137
|
+
var _chainInfo$substrateI;
|
|
138
|
+
const {
|
|
139
|
+
extrinsicType,
|
|
140
|
+
multisigProxyId
|
|
141
|
+
} = request;
|
|
142
|
+
if (!((_chainInfo$substrateI = chainInfo.substrateInfo) !== null && _chainInfo$substrateI !== void 0 && _chainInfo$substrateI.supportMultisig)) {
|
|
143
|
+
return {
|
|
144
|
+
signableProxies: []
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
const allMultisigAccounts = this.state.getMultisigAccounts();
|
|
148
|
+
const allAccounts = this.state.accounts;
|
|
149
|
+
const targetMultisigAccount = allMultisigAccounts.find(acc => acc.id === multisigProxyId);
|
|
150
|
+
if (!targetMultisigAccount) {
|
|
151
|
+
return {
|
|
152
|
+
signableProxies: []
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
const signableAccountInfo = [];
|
|
156
|
+
const signers = targetMultisigAccount.accounts[0].signers;
|
|
157
|
+
const allMultisigAccountAddress = allMultisigAccounts.map(acc => acc.id);
|
|
158
|
+
for (const signer of signers) {
|
|
159
|
+
if (allMultisigAccountAddress.includes(signer)) {
|
|
160
|
+
continue;
|
|
161
|
+
}
|
|
162
|
+
const proxyId = this.state.belongUnifiedAccount(signer) || reformatAddress(signer);
|
|
163
|
+
const accountProxy = allAccounts[proxyId];
|
|
164
|
+
const substrateAccount = accountProxy === null || accountProxy === void 0 ? void 0 : accountProxy.accounts.find(acc => acc.chainType === AccountChainType.SUBSTRATE);
|
|
165
|
+
if (substrateAccount) {
|
|
166
|
+
// Check if the account can sign the extrinsic type
|
|
167
|
+
// Only support 1 level signatories
|
|
168
|
+
if (substrateAccount.transactionActions.includes(extrinsicType) && !substrateAccount.isMultisig) {
|
|
169
|
+
signableAccountInfo.push({
|
|
170
|
+
proxyId,
|
|
171
|
+
address: signer
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
return {
|
|
177
|
+
signableProxies: signableAccountInfo
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
}
|
|
@@ -524,6 +524,18 @@ export class AccountState {
|
|
|
524
524
|
* Account ref
|
|
525
525
|
* */
|
|
526
526
|
|
|
527
|
+
/* Multisig */
|
|
528
|
+
|
|
529
|
+
getMultisigAccounts() {
|
|
530
|
+
return Object.values(this.accounts).filter(acc => acc.accountType === AccountProxyType.MULTISIG);
|
|
531
|
+
}
|
|
532
|
+
getMultisigAddresses() {
|
|
533
|
+
const allAccounts = this.getMultisigAccounts();
|
|
534
|
+
return allAccounts.map(acc => acc.id);
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
/* Multisig */
|
|
538
|
+
|
|
527
539
|
/* Others */
|
|
528
540
|
|
|
529
541
|
removeNoneHardwareGenesisHash() {
|
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
import { ServiceStatus, StoppableServiceInterface } from '@subwallet/extension-base/services/base/types';
|
|
2
|
+
import { ChainService } from '@subwallet/extension-base/services/chain-service';
|
|
3
|
+
import { EventService } from '@subwallet/extension-base/services/event-service';
|
|
4
|
+
import { InappNotificationService } from '@subwallet/extension-base/services/inapp-notification-service';
|
|
5
|
+
import { KeyringService } from '@subwallet/extension-base/services/keyring-service';
|
|
6
|
+
import { DecodeCallDataResponse } from '@subwallet/extension-base/services/multisig-service/utils';
|
|
7
|
+
import { PromiseHandler } from '@subwallet/extension-base/utils';
|
|
8
|
+
import { BehaviorSubject } from 'rxjs';
|
|
9
|
+
import { EventItem, EventType } from '../event-service/types';
|
|
10
|
+
/**
|
|
11
|
+
* Interface representing a pending multisig extrinsic with the current signer context
|
|
12
|
+
*/
|
|
13
|
+
export interface PendingMultisigTx extends RawPendingMultisigTx {
|
|
14
|
+
/** ID of the pending multisig extrinsic */
|
|
15
|
+
id: string;
|
|
16
|
+
/** Address of the current signer viewing this extrinsic */
|
|
17
|
+
currentSigner: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Interface representing raw pending multisig extrinsic data from the chain
|
|
21
|
+
*/
|
|
22
|
+
export interface RawPendingMultisigTx {
|
|
23
|
+
/** Chain identifier where the extrinsic exists */
|
|
24
|
+
chain: string;
|
|
25
|
+
/** Multisig address */
|
|
26
|
+
multisigAddress: string;
|
|
27
|
+
/** Address of the account that deposited funds */
|
|
28
|
+
depositor: string;
|
|
29
|
+
/** Hash of the call data */
|
|
30
|
+
callHash: string;
|
|
31
|
+
/** Block height where the extrinsic was created */
|
|
32
|
+
blockHeight: number;
|
|
33
|
+
/** Extrinsic index in the block */
|
|
34
|
+
extrinsicIndex: number;
|
|
35
|
+
/** Amount deposited for the multisig */
|
|
36
|
+
depositAmount: number;
|
|
37
|
+
/** List of addresses that have approved the extrinsic */
|
|
38
|
+
approvals: string[];
|
|
39
|
+
/** Number of approval required */
|
|
40
|
+
threshold: number;
|
|
41
|
+
/** List of signer addresses for the multisig */
|
|
42
|
+
signerAddresses: string[];
|
|
43
|
+
/** Hash of the extrinsic */
|
|
44
|
+
extrinsicHash: string;
|
|
45
|
+
/** Timestamp when the extrinsic was created */
|
|
46
|
+
timestamp: number;
|
|
47
|
+
/** Type of multisig extrinsic */
|
|
48
|
+
multisigTxType: MultisigTxType;
|
|
49
|
+
/** Encoded call data */
|
|
50
|
+
callData?: string;
|
|
51
|
+
/** Decoded call data with method and arguments */
|
|
52
|
+
decodedCallData?: DecodeCallDataResponse;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Map of pending multisig extrinsics
|
|
56
|
+
* Key is created using genPendingMultisigTxKey function
|
|
57
|
+
*/
|
|
58
|
+
export declare type PendingMultisigTxMap = Record<string, PendingMultisigTx>;
|
|
59
|
+
/**
|
|
60
|
+
* Request interface for getting pending extrinsics
|
|
61
|
+
*/
|
|
62
|
+
export interface RequestGetPendingTxs {
|
|
63
|
+
/** Multisig address to query */
|
|
64
|
+
multisigAddress: string;
|
|
65
|
+
/** Optional chain identifier to filter by specific chain */
|
|
66
|
+
chain?: string;
|
|
67
|
+
}
|
|
68
|
+
export declare enum MultisigTxType {
|
|
69
|
+
/** Transfer extrinsic */
|
|
70
|
+
TRANSFER = "Transfer",
|
|
71
|
+
/** Transfer NFT extrinsic */
|
|
72
|
+
TRANSFER_NFT = "TransferNFT",
|
|
73
|
+
/** Staking-related extrinsic */
|
|
74
|
+
STAKING = "Staking",
|
|
75
|
+
/** Redeem extrinsic */
|
|
76
|
+
REDEEM = "Redeem",
|
|
77
|
+
/** Unstake extrinsic */
|
|
78
|
+
UNSTAKE = "Unstake",
|
|
79
|
+
/** Withdraw extrinsic */
|
|
80
|
+
WITHDRAW = "Withdraw",
|
|
81
|
+
/** Cancel unstake extrinsic */
|
|
82
|
+
CANCEL_UNSTAKE = "CancelUnstake",
|
|
83
|
+
/** Claim extrinsic */
|
|
84
|
+
CLAIM_REWARD = "ClaimReward",
|
|
85
|
+
/** Nominate extrinsic */
|
|
86
|
+
NOMINATE = "Nominate",
|
|
87
|
+
/** Lending extrinsic */
|
|
88
|
+
LENDING = "Lending",
|
|
89
|
+
/** Swap extrinsic */
|
|
90
|
+
SWAP = "Swap",
|
|
91
|
+
/** Set token pay fee extrinsic */
|
|
92
|
+
SET_TOKEN_PAY_FEE = "SetTokenPayFee",
|
|
93
|
+
/** Governance vote extrinsic */
|
|
94
|
+
GOV_VOTE = "govVote",
|
|
95
|
+
/** Governance remove vote extrinsic */
|
|
96
|
+
GOV_REMOVE_VOTE = "govRemoveVote",
|
|
97
|
+
/** Governance unlock vote extrinsic */
|
|
98
|
+
GOV_UNLOCK_VOTE = "govUnlockVote",
|
|
99
|
+
/** Proxy add extrinsic */
|
|
100
|
+
ADD_PROXY = "AddProxy",
|
|
101
|
+
/** Proxy remove extrinsic */
|
|
102
|
+
REMOVE_PROXY = "RemoveProxy",
|
|
103
|
+
/** Unknown extrinsic type */
|
|
104
|
+
UNKNOWN = "Unknown"
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Mapping of extrinsic categories to their corresponding pallet methods
|
|
108
|
+
* Used to categorize multisig extrinsics by their call method
|
|
109
|
+
*/
|
|
110
|
+
export declare const MULTISIG_TX_TYPE_MAP: Record<string, string[]>;
|
|
111
|
+
/**
|
|
112
|
+
* Service for managing multisig extrinsics
|
|
113
|
+
* Handles subscription to pending multisig extrinsics across supported chains
|
|
114
|
+
* and provides methods to query and monitor multisig extrinsic status
|
|
115
|
+
*/
|
|
116
|
+
export declare class MultisigService implements StoppableServiceInterface {
|
|
117
|
+
private readonly eventService;
|
|
118
|
+
private readonly chainService;
|
|
119
|
+
private readonly keyringService;
|
|
120
|
+
private readonly inappNotificationService;
|
|
121
|
+
status: ServiceStatus;
|
|
122
|
+
startPromiseHandler: PromiseHandler<void>;
|
|
123
|
+
stopPromiseHandler: PromiseHandler<void>;
|
|
124
|
+
/** BehaviorSubject that holds the current map of pending multisig extrinsics */
|
|
125
|
+
private readonly pendingMultisigTxSubject;
|
|
126
|
+
/** Function to unsubscribe from all active subscriptions */
|
|
127
|
+
private unsubscribes;
|
|
128
|
+
/** Promise to check if the subscription logic is currently running */
|
|
129
|
+
private subscribePromise;
|
|
130
|
+
/** Set to track notified transaction keys to avoid duplicate notifications */
|
|
131
|
+
private readonly notifiedTxKeys;
|
|
132
|
+
/**
|
|
133
|
+
* Creates an instance of MultisigService
|
|
134
|
+
* @param eventService - Service for handling application events
|
|
135
|
+
* @param chainService - Service for managing chain connections
|
|
136
|
+
* @param keyringService - Service for managing accounts and keyring
|
|
137
|
+
* @param inappNotificationService - Service for creating in-app notifications (optional)
|
|
138
|
+
*/
|
|
139
|
+
constructor(eventService: EventService, chainService: ChainService, keyringService: KeyringService, inappNotificationService: InappNotificationService);
|
|
140
|
+
/**
|
|
141
|
+
* Starts the multisig service
|
|
142
|
+
* Subscribes to pending multisig extrinsics for all multisig accounts
|
|
143
|
+
* @returns Promise that resolves when the service has started, or rejects on error
|
|
144
|
+
*/
|
|
145
|
+
start(): Promise<void>;
|
|
146
|
+
/**
|
|
147
|
+
* Stops the multisig service
|
|
148
|
+
* Unsubscribes from all active subscriptions
|
|
149
|
+
* @returns Promise that resolves when the service has stopped, or rejects on error
|
|
150
|
+
*/
|
|
151
|
+
stop(): Promise<void>;
|
|
152
|
+
/**
|
|
153
|
+
* Initializes the multisig service
|
|
154
|
+
* Waits for chain and account services to be ready, then sets up event listeners
|
|
155
|
+
* @returns Promise that resolves when initialization is complete
|
|
156
|
+
*/
|
|
157
|
+
init(): Promise<void>;
|
|
158
|
+
/**
|
|
159
|
+
* Waits for the service to start
|
|
160
|
+
* @returns Promise that resolves when the service has started
|
|
161
|
+
*/
|
|
162
|
+
waitForStarted(): Promise<void>;
|
|
163
|
+
/**
|
|
164
|
+
* Waits for the service to stop
|
|
165
|
+
* @returns Promise that resolves when the service has stopped
|
|
166
|
+
*/
|
|
167
|
+
waitForStopped(): Promise<void>;
|
|
168
|
+
/**
|
|
169
|
+
* Handles application events and reloads multisig extrinsics when needed
|
|
170
|
+
* Reloads when accounts are added/removed or when supported chain state is updated
|
|
171
|
+
* @param events - Array of event items
|
|
172
|
+
* @param eventTypes - Array of event types that occurred
|
|
173
|
+
*/
|
|
174
|
+
handleEvents(events: EventItem<EventType>[], eventTypes: EventType[]): void;
|
|
175
|
+
/**
|
|
176
|
+
* Subscribes to multisig changes for all multisig addresses across supported chains
|
|
177
|
+
* Clears old subscriptions before creating new ones to avoid duplicates
|
|
178
|
+
* @returns Promise that resolves when subscription setup is complete
|
|
179
|
+
*/
|
|
180
|
+
private runSubscribePendingMultisigTxs;
|
|
181
|
+
/**
|
|
182
|
+
* Subscribes to pending multisig extrinsics for a specific multisig address on a chain
|
|
183
|
+
* Fetches initial data and sets up a subscription for updates
|
|
184
|
+
* @param chain - Chain identifier
|
|
185
|
+
* @param multisigAddress - Multisig address to monitor
|
|
186
|
+
* @param signers - List of signer addresses for the multisig
|
|
187
|
+
* @param threshold - Number of approval required
|
|
188
|
+
* @param callback - Callback function called with updated pending extrinsics
|
|
189
|
+
* @returns Function to unsubscribe from the subscription
|
|
190
|
+
*/
|
|
191
|
+
private subscribePendingMultisigTxsPromise;
|
|
192
|
+
/**
|
|
193
|
+
* Wrapper function to subscribe to pending multisig extrinsics
|
|
194
|
+
* Returns an unsubscribe function that handles promise resolution
|
|
195
|
+
* @param chain - Chain identifier
|
|
196
|
+
* @param multisigAddress - Multisig address to monitor
|
|
197
|
+
* @param signers - List of signer addresses for the multisig
|
|
198
|
+
* @param threshold - Number of approval required
|
|
199
|
+
* @param callback - Callback function called with updated pending extrinsics
|
|
200
|
+
* @returns Function to unsubscribe from the subscription
|
|
201
|
+
*/
|
|
202
|
+
private subscribePendingMultisigTxs;
|
|
203
|
+
/**
|
|
204
|
+
* Unsubscribes from all active multisig extrinsic subscriptions
|
|
205
|
+
*/
|
|
206
|
+
private runUnsubscribePendingMultisigTxs;
|
|
207
|
+
/**
|
|
208
|
+
* Updates the multisig extrinsic map for a specific chain and multisig address
|
|
209
|
+
* Removes old extrinsics and adds new ones, then notifies all subscribers
|
|
210
|
+
* Creates notifications for new pending transactions that require approval
|
|
211
|
+
* @param multisigAddress - Multisig address
|
|
212
|
+
* @param chain - Chain identifier
|
|
213
|
+
* @param rawPendingTxs - Array of raw pending multisig extrinsics to update
|
|
214
|
+
*/
|
|
215
|
+
private updatePendingMultisigTxSubjectByChain;
|
|
216
|
+
/**
|
|
217
|
+
* Clears notifications for approved pending multisig transactions
|
|
218
|
+
* @private
|
|
219
|
+
* @param newTxMap - Map of current pending multisig transactions
|
|
220
|
+
* @param multisigAddress - Multisig address
|
|
221
|
+
* @param chain - ChainSlug of the multisig transactions
|
|
222
|
+
*/
|
|
223
|
+
private clearMultisigApprovalNotifications;
|
|
224
|
+
/**
|
|
225
|
+
* Creates notifications for pending multisig transactions that require approval
|
|
226
|
+
* @param pendingTxs - Array of pending multisig transactions that need approval
|
|
227
|
+
*/
|
|
228
|
+
private createMultisigApprovalNotifications;
|
|
229
|
+
/**
|
|
230
|
+
* Subscribes to changes in the pending multisig extrinsic map
|
|
231
|
+
* @returns BehaviorSubject that emits updates when the extrinsic map changes
|
|
232
|
+
*/
|
|
233
|
+
subscribePendingMultisigTxMap(): BehaviorSubject<PendingMultisigTxMap>;
|
|
234
|
+
/**
|
|
235
|
+
* Gets a snapshot of the current pending multisig extrinsic map
|
|
236
|
+
* @returns Copy of the current pending multisig extrinsic map
|
|
237
|
+
*/
|
|
238
|
+
getPendingMultisigTxMap(): PendingMultisigTxMap;
|
|
239
|
+
/**
|
|
240
|
+
* Gets pending extrinsics for a specific multisig address
|
|
241
|
+
* @param request - Request object containing the multisig address
|
|
242
|
+
* @returns Array of pending multisig extrinsics matching the criteria
|
|
243
|
+
*/
|
|
244
|
+
getPendingTxsForMultisigAddress(request: RequestGetPendingTxs): PendingMultisigTx[];
|
|
245
|
+
}
|