@subwallet/extension-base 1.0.2-1b → 1.0.2-3
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 +31 -5
- package/background/KoniTypes.js +2 -1
- package/background/errors/TransactionError.js +4 -0
- package/background/types.d.ts +10 -5
- package/cjs/background/KoniTypes.js +2 -1
- package/cjs/background/errors/TransactionError.js +4 -0
- package/cjs/koni/api/dotsama/transfer.js +6 -12
- package/cjs/koni/api/nft/acala_nft/index.js +7 -10
- package/cjs/koni/api/nft/bit.country/index.js +7 -9
- package/cjs/koni/api/nft/evm_nft/index.js +2 -1
- package/cjs/koni/api/nft/karura_nft/index.js +7 -9
- package/cjs/koni/api/nft/rmrk_nft/index.js +4 -1
- package/cjs/koni/api/nft/statemine_nft/index.js +7 -9
- package/cjs/koni/api/nft/unique_nft/index.js +5 -6
- package/cjs/koni/api/nft/wasm_nft/index.js +2 -1
- package/cjs/koni/api/staking/bonding/relayChain.js +3 -0
- package/cjs/koni/background/cron.js +53 -46
- package/cjs/koni/background/handlers/Extension.js +292 -159
- package/cjs/koni/background/handlers/State.js +24 -14
- package/cjs/koni/background/handlers/Tabs.js +42 -16
- package/cjs/packageInfo.js +1 -1
- package/cjs/services/chain-service/handler/light-client/index.js +0 -2
- package/cjs/services/chain-service/index.js +53 -38
- package/cjs/services/history-service/index.js +3 -3
- package/cjs/services/history-service/subsquid-multi-chain-history.js +1 -1
- package/cjs/services/keyring-service/index.js +11 -13
- package/cjs/services/request-service/handler/AuthRequestHandler.js +7 -5
- package/cjs/services/request-service/handler/EvmRequestHandler.js +8 -12
- package/cjs/services/request-service/index.js +14 -5
- package/cjs/services/storage-service/DatabaseService.js +8 -5
- package/cjs/services/storage-service/db-stores/Nft.js +9 -4
- package/cjs/services/transaction-service/index.js +3 -1
- package/cjs/utils/address.js +10 -1
- package/cjs/utils/index.js +2 -1
- package/koni/api/dotsama/transfer.js +6 -12
- package/koni/api/nft/acala_nft/index.js +7 -9
- package/koni/api/nft/bit.country/index.js +7 -8
- package/koni/api/nft/evm_nft/index.js +2 -1
- package/koni/api/nft/index.d.ts +1 -1
- package/koni/api/nft/karura_nft/index.js +7 -8
- package/koni/api/nft/nft.d.ts +1 -1
- package/koni/api/nft/rmrk_nft/index.js +4 -1
- package/koni/api/nft/statemine_nft/index.js +7 -8
- package/koni/api/nft/unique_nft/index.js +5 -5
- package/koni/api/nft/wasm_nft/index.js +2 -1
- package/koni/api/staking/bonding/relayChain.js +3 -0
- package/koni/background/cron.js +53 -46
- package/koni/background/handlers/Extension.d.ts +6 -1
- package/koni/background/handlers/Extension.js +203 -73
- package/koni/background/handlers/State.d.ts +1 -1
- package/koni/background/handlers/State.js +26 -14
- package/koni/background/handlers/Tabs.js +42 -16
- package/package.json +13 -13
- package/packageInfo.js +1 -1
- package/services/chain-service/handler/light-client/index.d.ts +1 -17
- package/services/chain-service/handler/light-client/index.js +1 -1
- package/services/chain-service/index.d.ts +3 -2
- package/services/chain-service/index.js +47 -33
- package/services/chain-service/types.d.ts +1 -0
- package/services/history-service/index.d.ts +3 -1
- package/services/history-service/index.js +3 -3
- package/services/history-service/subsquid-multi-chain-history.js +1 -1
- package/services/keyring-service/index.d.ts +4 -2
- package/services/keyring-service/index.js +11 -13
- package/services/request-service/handler/AuthRequestHandler.d.ts +3 -1
- package/services/request-service/handler/AuthRequestHandler.js +7 -5
- package/services/request-service/handler/EvmRequestHandler.js +8 -12
- package/services/request-service/index.d.ts +3 -1
- package/services/request-service/index.js +14 -5
- package/services/storage-service/DatabaseService.d.ts +1 -1
- package/services/storage-service/DatabaseService.js +8 -5
- package/services/storage-service/db-stores/Nft.d.ts +2 -1
- package/services/storage-service/db-stores/Nft.js +9 -4
- package/services/transaction-service/index.js +3 -1
- package/utils/address.d.ts +3 -0
- package/utils/address.js +8 -1
- package/utils/index.d.ts +1 -1
- package/utils/index.js +1 -1
|
@@ -180,7 +180,6 @@ export default class TransactionService {
|
|
|
180
180
|
this.transactionSubject.next({
|
|
181
181
|
...transactions
|
|
182
182
|
});
|
|
183
|
-
console.log(transaction);
|
|
184
183
|
|
|
185
184
|
// Send transaction
|
|
186
185
|
return await this.sendTransaction(transaction);
|
|
@@ -585,6 +584,9 @@ export default class TransactionService {
|
|
|
585
584
|
payload.isToContract = isToContract;
|
|
586
585
|
payload.parseData = isToContract ? payload.data ? (await parseContractInput(payload.data || '', payload.to || '', chainInfo)).result : '' : payload.data || '';
|
|
587
586
|
}
|
|
587
|
+
if ('data' in payload && payload.data === undefined) {
|
|
588
|
+
delete payload.data;
|
|
589
|
+
}
|
|
588
590
|
|
|
589
591
|
// Set unique nonce to avoid transaction errors
|
|
590
592
|
if (!payload.nonce) {
|
package/utils/address.d.ts
CHANGED
|
@@ -1,2 +1,5 @@
|
|
|
1
|
+
import { AddressJson } from '@subwallet/extension-base/background/types';
|
|
2
|
+
import { SubjectInfo } from '@subwallet/ui-keyring/observable/types';
|
|
1
3
|
export declare const simpleAddress: (address: string) => string;
|
|
2
4
|
export declare function quickFormatAddressToCompare(address?: string): string | undefined;
|
|
5
|
+
export declare const convertSubjectInfoToAddresses: (subjectInfo: SubjectInfo) => AddressJson[];
|
package/utils/address.js
CHANGED
|
@@ -14,4 +14,11 @@ export function quickFormatAddressToCompare(address) {
|
|
|
14
14
|
return address;
|
|
15
15
|
}
|
|
16
16
|
return reformatAddress(address, 42).toLowerCase();
|
|
17
|
-
}
|
|
17
|
+
}
|
|
18
|
+
export const convertSubjectInfoToAddresses = subjectInfo => {
|
|
19
|
+
return Object.values(subjectInfo).map(info => ({
|
|
20
|
+
address: info.json.address,
|
|
21
|
+
type: info.type,
|
|
22
|
+
...info.json.meta
|
|
23
|
+
}));
|
|
24
|
+
};
|
package/utils/index.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ export declare const isDef: (x: any) => boolean;
|
|
|
8
8
|
export declare const nonEmptyArr: (x: any) => boolean;
|
|
9
9
|
export declare const isEmptyArray: (x: any) => boolean;
|
|
10
10
|
export declare function isAccountAll(address?: string): boolean;
|
|
11
|
-
export declare function reformatAddress(address: string, networkPrefix
|
|
11
|
+
export declare function reformatAddress(address: string, networkPrefix?: number, isEthereum?: boolean): string;
|
|
12
12
|
export declare function filterAddressByNetworkKey(addresses: string[], networkKey: string, isEthereum?: boolean): string[];
|
|
13
13
|
export declare function categoryAddresses(addresses: string[]): string[][];
|
|
14
14
|
export declare function categoryNetworks(networks: NetworkJson[]): string[][];
|
package/utils/index.js
CHANGED
|
@@ -13,7 +13,7 @@ export const isEmptyArray = x => !Array.isArray(x) || Array.isArray(x) && x.leng
|
|
|
13
13
|
export function isAccountAll(address) {
|
|
14
14
|
return address === ALL_ACCOUNT_KEY;
|
|
15
15
|
}
|
|
16
|
-
export function reformatAddress(address, networkPrefix, isEthereum = false) {
|
|
16
|
+
export function reformatAddress(address, networkPrefix = 42, isEthereum = false) {
|
|
17
17
|
try {
|
|
18
18
|
if (isEthereumAddress(address)) {
|
|
19
19
|
return address;
|