@ledgerhq/live-common 27.0.1-next.0 → 27.1.0-next.2
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/lib/account/serialization.d.ts +2 -0
- package/lib/account/serialization.d.ts.map +1 -1
- package/lib/account/serialization.js +23 -8
- package/lib/account/serialization.js.map +1 -1
- package/lib/api/explorerConfig/index.js +1 -1
- package/lib/api/explorerConfig/index.js.map +1 -1
- package/lib/apps/support.d.ts.map +1 -1
- package/lib/apps/support.js +1 -0
- package/lib/apps/support.js.map +1 -1
- package/lib/families/celo/api/hubble.d.ts +6 -1
- package/lib/families/celo/api/hubble.d.ts.map +1 -1
- package/lib/families/celo/api/hubble.js +135 -13
- package/lib/families/celo/api/hubble.js.map +1 -1
- package/lib/families/celo/api/index.d.ts +1 -1
- package/lib/families/celo/api/index.d.ts.map +1 -1
- package/lib/families/celo/api/index.js +2 -1
- package/lib/families/celo/api/index.js.map +1 -1
- package/lib/families/celo/api/sdk.d.ts +22 -0
- package/lib/families/celo/api/sdk.d.ts.map +1 -1
- package/lib/families/celo/api/sdk.js +168 -1
- package/lib/families/celo/api/sdk.js.map +1 -1
- package/lib/families/celo/bridge/js.d.ts.map +1 -1
- package/lib/families/celo/bridge/js.js +4 -42
- package/lib/families/celo/bridge/js.js.map +1 -1
- package/lib/families/celo/cli-transaction.d.ts +12 -2
- package/lib/families/celo/cli-transaction.d.ts.map +1 -1
- package/lib/families/celo/cli-transaction.js +38 -4
- package/lib/families/celo/cli-transaction.js.map +1 -1
- package/lib/families/celo/datasets/celo.scanAccounts.1.d.ts +1 -0
- package/lib/families/celo/datasets/celo.scanAccounts.1.d.ts.map +1 -1
- package/lib/families/celo/datasets/celo.scanAccounts.1.js +298 -2
- package/lib/families/celo/datasets/celo.scanAccounts.1.js.map +1 -1
- package/lib/families/celo/errors.d.ts +2 -0
- package/lib/families/celo/errors.d.ts.map +1 -0
- package/lib/families/celo/errors.js +6 -0
- package/lib/families/celo/errors.js.map +1 -0
- package/lib/families/celo/js-buildTransaction.d.ts +2 -3
- package/lib/families/celo/js-buildTransaction.d.ts.map +1 -1
- package/lib/families/celo/js-buildTransaction.js +194 -19
- package/lib/families/celo/js-buildTransaction.js.map +1 -1
- package/lib/families/celo/js-createTransaction.d.ts.map +1 -1
- package/lib/families/celo/js-createTransaction.js +3 -1
- package/lib/families/celo/js-createTransaction.js.map +1 -1
- package/lib/families/celo/js-estimateMaxSpendable.d.ts.map +1 -1
- package/lib/families/celo/js-estimateMaxSpendable.js.map +1 -1
- package/lib/families/celo/js-getFeesForTransaction.d.ts +2 -3
- package/lib/families/celo/js-getFeesForTransaction.d.ts.map +1 -1
- package/lib/families/celo/js-getFeesForTransaction.js +137 -10
- package/lib/families/celo/js-getFeesForTransaction.js.map +1 -1
- package/lib/families/celo/js-getTransactionStatus.d.ts +2 -3
- package/lib/families/celo/js-getTransactionStatus.d.ts.map +1 -1
- package/lib/families/celo/js-getTransactionStatus.js +97 -41
- package/lib/families/celo/js-getTransactionStatus.js.map +1 -1
- package/lib/families/celo/js-prepareTransaction.d.ts +2 -3
- package/lib/families/celo/js-prepareTransaction.d.ts.map +1 -1
- package/lib/families/celo/js-prepareTransaction.js +8 -3
- package/lib/families/celo/js-prepareTransaction.js.map +1 -1
- package/lib/families/celo/js-signOperation.d.ts.map +1 -1
- package/lib/families/celo/js-signOperation.js +17 -3
- package/lib/families/celo/js-signOperation.js.map +1 -1
- package/lib/families/celo/js-synchronisation.d.ts.map +1 -1
- package/lib/families/celo/js-synchronisation.js +51 -6
- package/lib/families/celo/js-synchronisation.js.map +1 -1
- package/lib/families/celo/logic.d.ts +21 -0
- package/lib/families/celo/logic.d.ts.map +1 -0
- package/lib/families/celo/logic.js +132 -0
- package/lib/families/celo/logic.js.map +1 -0
- package/lib/families/celo/preload.d.ts +10 -0
- package/lib/families/celo/preload.d.ts.map +1 -0
- package/lib/families/celo/preload.js +118 -0
- package/lib/families/celo/preload.js.map +1 -0
- package/lib/families/celo/react.d.ts +4 -0
- package/lib/families/celo/react.d.ts.map +1 -0
- package/lib/families/celo/react.js +47 -0
- package/lib/families/celo/react.js.map +1 -0
- package/lib/families/celo/serialization.d.ts +4 -0
- package/lib/families/celo/serialization.d.ts.map +1 -0
- package/lib/families/celo/serialization.js +55 -0
- package/lib/families/celo/serialization.js.map +1 -0
- package/lib/families/celo/specs/createActivateVoteMutation.d.ts +4 -0
- package/lib/families/celo/specs/createActivateVoteMutation.d.ts.map +1 -0
- package/lib/families/celo/specs/createActivateVoteMutation.js +38 -0
- package/lib/families/celo/specs/createActivateVoteMutation.js.map +1 -0
- package/lib/families/celo/specs/createLockMutation.d.ts +4 -0
- package/lib/families/celo/specs/createLockMutation.d.ts.map +1 -0
- package/lib/families/celo/specs/createLockMutation.js +40 -0
- package/lib/families/celo/specs/createLockMutation.js.map +1 -0
- package/lib/families/celo/specs/createRegisterAccountMutation.d.ts +4 -0
- package/lib/families/celo/specs/createRegisterAccountMutation.d.ts.map +1 -0
- package/lib/families/celo/specs/createRegisterAccountMutation.js +31 -0
- package/lib/families/celo/specs/createRegisterAccountMutation.js.map +1 -0
- package/lib/families/celo/specs/createRevokeVoteMutation.d.ts +4 -0
- package/lib/families/celo/specs/createRevokeVoteMutation.d.ts.map +1 -0
- package/lib/families/celo/specs/createRevokeVoteMutation.js +39 -0
- package/lib/families/celo/specs/createRevokeVoteMutation.js.map +1 -0
- package/lib/families/celo/specs/createSendMutation.d.ts +5 -0
- package/lib/families/celo/specs/createSendMutation.d.ts.map +1 -0
- package/lib/families/celo/specs/createSendMutation.js +44 -0
- package/lib/families/celo/specs/createSendMutation.js.map +1 -0
- package/lib/families/celo/specs/createUnlockMutation.d.ts +4 -0
- package/lib/families/celo/specs/createUnlockMutation.d.ts.map +1 -0
- package/lib/families/celo/specs/createUnlockMutation.js +37 -0
- package/lib/families/celo/specs/createUnlockMutation.js.map +1 -0
- package/lib/families/celo/specs/createVoteMutation.d.ts +4 -0
- package/lib/families/celo/specs/createVoteMutation.d.ts.map +1 -0
- package/lib/families/celo/specs/createVoteMutation.js +51 -0
- package/lib/families/celo/specs/createVoteMutation.js.map +1 -0
- package/lib/families/celo/specs/createWithdrawMutation.d.ts +4 -0
- package/lib/families/celo/specs/createWithdrawMutation.d.ts.map +1 -0
- package/lib/families/celo/specs/createWithdrawMutation.js +36 -0
- package/lib/families/celo/specs/createWithdrawMutation.js.map +1 -0
- package/lib/families/celo/specs/index.d.ts +9 -0
- package/lib/families/celo/specs/index.d.ts.map +1 -0
- package/lib/families/celo/specs/index.js +25 -0
- package/lib/families/celo/specs/index.js.map +1 -0
- package/lib/families/celo/specs.d.ts +1 -1
- package/lib/families/celo/specs.d.ts.map +1 -1
- package/lib/families/celo/specs.js +20 -37
- package/lib/families/celo/specs.js.map +1 -1
- package/lib/families/celo/speculos-deviceActions.d.ts.map +1 -1
- package/lib/families/celo/speculos-deviceActions.js +22 -0
- package/lib/families/celo/speculos-deviceActions.js.map +1 -1
- package/lib/families/celo/transaction.d.ts.map +1 -1
- package/lib/families/celo/transaction.js +8 -6
- package/lib/families/celo/transaction.js.map +1 -1
- package/lib/families/celo/types.d.ts +102 -1
- package/lib/families/celo/types.d.ts.map +1 -1
- package/lib/families/celo/validators.d.ts +3 -0
- package/lib/families/celo/validators.d.ts.map +1 -0
- package/lib/families/celo/validators.js +6 -0
- package/lib/families/celo/validators.js.map +1 -0
- package/lib/families/cosmos/banner.d.ts +10 -0
- package/lib/families/cosmos/banner.d.ts.map +1 -0
- package/lib/families/cosmos/banner.js +133 -0
- package/lib/families/cosmos/banner.js.map +1 -0
- package/lib/families/cosmos/banner.test.d.ts +2 -0
- package/lib/families/cosmos/banner.test.d.ts.map +1 -0
- package/lib/families/cosmos/banner.test.js +233 -0
- package/lib/families/cosmos/banner.test.js.map +1 -0
- package/lib/families/solana/api/chain/instruction/token/types.d.ts +2 -2
- package/lib/generated/cli-transaction.d.ts +12 -2
- package/lib/generated/cli-transaction.d.ts.map +1 -1
- package/lib/operation.d.ts.map +1 -1
- package/lib/operation.js +6 -0
- package/lib/operation.js.map +1 -1
- package/lib/reconciliation.d.ts.map +1 -1
- package/lib/reconciliation.js +11 -0
- package/lib/reconciliation.js.map +1 -1
- package/package.json +3 -4
- package/src/account/serialization.ts +22 -2
- package/src/api/explorerConfig/index.ts +1 -1
- package/src/apps/support.ts +1 -0
- package/src/families/celo/__snapshots__/bridge.integration.test.ts.snap +134 -857
- package/src/families/celo/api/hubble.ts +113 -16
- package/src/families/celo/api/index.ts +1 -1
- package/src/families/celo/api/sdk.ts +88 -0
- package/src/families/celo/bridge/js.ts +2 -3
- package/src/families/celo/cli-transaction.ts +46 -2
- package/src/families/celo/datasets/celo.scanAccounts.1.ts +365 -5
- package/src/families/celo/errors.ts +5 -0
- package/src/families/celo/js-buildTransaction.ts +173 -20
- package/src/families/celo/js-createTransaction.ts +2 -0
- package/src/families/celo/js-estimateMaxSpendable.ts +2 -2
- package/src/families/celo/js-getFeesForTransaction.ts +118 -19
- package/src/families/celo/js-getTransactionStatus.ts +72 -17
- package/src/families/celo/js-prepareTransaction.ts +13 -7
- package/src/families/celo/js-signOperation.ts +22 -5
- package/src/families/celo/js-synchronisation.ts +32 -0
- package/src/families/celo/logic.ts +184 -0
- package/src/families/celo/preload.ts +78 -0
- package/src/families/celo/react.ts +35 -0
- package/src/families/celo/serialization.ts +61 -0
- package/src/families/celo/specs/createActivateVoteMutation.ts +44 -0
- package/src/families/celo/specs/createLockMutation.ts +46 -0
- package/src/families/celo/specs/createRegisterAccountMutation.ts +34 -0
- package/src/families/celo/specs/createRevokeVoteMutation.ts +43 -0
- package/src/families/celo/specs/createSendMutation.ts +44 -0
- package/src/families/celo/specs/createUnlockMutation.ts +44 -0
- package/src/families/celo/specs/createVoteMutation.ts +67 -0
- package/src/families/celo/specs/createWithdrawMutation.ts +44 -0
- package/src/families/celo/specs/index.ts +8 -0
- package/src/families/celo/specs.ts +32 -34
- package/src/families/celo/speculos-deviceActions.ts +21 -2
- package/src/families/celo/transaction.ts +12 -4
- package/src/families/celo/types.ts +113 -0
- package/src/families/celo/validators.ts +2 -0
- package/src/families/cosmos/banner.test.ts +160 -0
- package/src/families/cosmos/banner.ts +87 -0
- package/src/operation.ts +6 -0
- package/src/reconciliation.ts +22 -0
|
@@ -1,13 +1,114 @@
|
|
|
1
|
-
import type { TransactionCommon, TransactionCommonRaw, TransactionStatusCommon, TransactionStatusCommonRaw } from "@ledgerhq/types-live";
|
|
1
|
+
import type { Account, AccountRaw, TransactionCommon, TransactionCommonRaw, TransactionStatusCommon, TransactionStatusCommonRaw } from "@ledgerhq/types-live";
|
|
2
2
|
import { BigNumber } from "bignumber.js";
|
|
3
|
+
export declare type CeloOperationMode = "send" | "lock" | "unlock" | "withdraw" | "vote" | "revoke" | "activate" | "register";
|
|
4
|
+
export declare type CeloVoteType = "pending" | "active";
|
|
5
|
+
export declare type CeloVoteStatus = CeloVoteType | "awaitingActivation";
|
|
6
|
+
export declare type CeloPendingWithdrawal = {
|
|
7
|
+
value: BigNumber;
|
|
8
|
+
time: BigNumber;
|
|
9
|
+
index: number;
|
|
10
|
+
};
|
|
11
|
+
export declare type CeloPendingWithdrawalRaw = {
|
|
12
|
+
value: string;
|
|
13
|
+
time: string;
|
|
14
|
+
index: string;
|
|
15
|
+
};
|
|
16
|
+
export declare type CeloResources = {
|
|
17
|
+
registrationStatus: boolean;
|
|
18
|
+
lockedBalance: BigNumber;
|
|
19
|
+
nonvotingLockedBalance: BigNumber;
|
|
20
|
+
pendingWithdrawals: CeloPendingWithdrawal[] | null | undefined;
|
|
21
|
+
votes: CeloVote[] | null | undefined;
|
|
22
|
+
electionAddress: string | null | undefined;
|
|
23
|
+
lockedGoldAddress: string | null | undefined;
|
|
24
|
+
maxNumGroupsVotedFor: BigNumber;
|
|
25
|
+
};
|
|
26
|
+
export declare type CeloResourcesRaw = {
|
|
27
|
+
registrationStatus: boolean;
|
|
28
|
+
lockedBalance: string;
|
|
29
|
+
nonvotingLockedBalance: string;
|
|
30
|
+
pendingWithdrawals: CeloPendingWithdrawalRaw[] | null | undefined;
|
|
31
|
+
votes: CeloVoteRaw[] | null | undefined;
|
|
32
|
+
electionAddress: string | null | undefined;
|
|
33
|
+
lockedGoldAddress: string | null | undefined;
|
|
34
|
+
maxNumGroupsVotedFor: string;
|
|
35
|
+
};
|
|
3
36
|
export declare type Transaction = TransactionCommon & {
|
|
4
37
|
family: "celo";
|
|
5
38
|
fees: BigNumber | null | undefined;
|
|
39
|
+
mode: CeloOperationMode;
|
|
40
|
+
index: number | null | undefined;
|
|
6
41
|
};
|
|
7
42
|
export declare type TransactionRaw = TransactionCommonRaw & {
|
|
8
43
|
family: "celo";
|
|
9
44
|
fees: string | null | undefined;
|
|
45
|
+
mode: CeloOperationMode;
|
|
46
|
+
index: number | null | undefined;
|
|
47
|
+
};
|
|
48
|
+
export declare type CeloValidatorGroup = {
|
|
49
|
+
address: string;
|
|
50
|
+
name: string;
|
|
51
|
+
votes: BigNumber;
|
|
52
|
+
};
|
|
53
|
+
export declare type CeloVote = {
|
|
54
|
+
validatorGroup: string;
|
|
55
|
+
amount: BigNumber;
|
|
56
|
+
activatable: boolean;
|
|
57
|
+
revokable: boolean;
|
|
58
|
+
type: CeloVoteType;
|
|
59
|
+
index: number;
|
|
60
|
+
};
|
|
61
|
+
export declare type CeloVoteRaw = {
|
|
62
|
+
validatorGroup: string;
|
|
63
|
+
amount: string;
|
|
64
|
+
activatable: boolean;
|
|
65
|
+
revokable: boolean;
|
|
66
|
+
type: CeloVoteType;
|
|
67
|
+
index: number;
|
|
68
|
+
};
|
|
69
|
+
export declare type FigmentIndexerTransaction = {
|
|
70
|
+
id: number;
|
|
71
|
+
height: number;
|
|
72
|
+
time: string;
|
|
73
|
+
transaction_hash: string;
|
|
74
|
+
address: string;
|
|
75
|
+
amount: number;
|
|
76
|
+
kind: string;
|
|
77
|
+
data?: {
|
|
78
|
+
Raw?: {
|
|
79
|
+
data: string;
|
|
80
|
+
topics: Array<string>;
|
|
81
|
+
address: string;
|
|
82
|
+
removed: boolean;
|
|
83
|
+
logIndex: string;
|
|
84
|
+
blockHash: string;
|
|
85
|
+
blockNumber: string;
|
|
86
|
+
transactionHash: string;
|
|
87
|
+
transactionIndex: string;
|
|
88
|
+
};
|
|
89
|
+
gas: number;
|
|
90
|
+
Account?: string;
|
|
91
|
+
Group?: string;
|
|
92
|
+
success?: boolean;
|
|
93
|
+
from?: string;
|
|
94
|
+
to?: string;
|
|
95
|
+
gas_used: number;
|
|
96
|
+
gas_price: number;
|
|
97
|
+
};
|
|
98
|
+
};
|
|
99
|
+
export declare type CeloPreloadData = {
|
|
100
|
+
validatorGroups: CeloValidatorGroup[];
|
|
10
101
|
};
|
|
11
102
|
export declare type TransactionStatus = TransactionStatusCommon;
|
|
12
103
|
export declare type TransactionStatusRaw = TransactionStatusCommonRaw;
|
|
104
|
+
export declare type CeloAccount = Account & {
|
|
105
|
+
celoResources: CeloResources;
|
|
106
|
+
};
|
|
107
|
+
export declare type CeloAccountRaw = AccountRaw & {
|
|
108
|
+
celoResources: CeloResourcesRaw;
|
|
109
|
+
};
|
|
110
|
+
export declare type PendingStakingOperationAmounts = {
|
|
111
|
+
vote: BigNumber;
|
|
112
|
+
lock: BigNumber;
|
|
113
|
+
};
|
|
13
114
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/families/celo/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EACjB,oBAAoB,EACpB,uBAAuB,EACvB,0BAA0B,EAC3B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,oBAAY,WAAW,GAAG,iBAAiB,GAAG;IAC5C,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,SAAS,GAAG,IAAI,GAAG,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sour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AA;CAAE,CAAC;AAE9E,oBAAY,8BAA8B,GAAG;IAC3C,IAAI,EAAE,SAAS,CAAC;IAChB,IAAI,EAAE,SAAS,CAAC;CACjB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validators.d.ts","sourceRoot":"","sources":["../../../src/families/celo/validators.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,EAAE,kBAAkB,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validators.js","sourceRoot":"","sources":["../../../src/families/celo/validators.ts"],"names":[],"mappings":";;;AAAA,6BAA2C;AAClC,6BADA,wBAAkB,CACA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { CosmosAccount, CosmosValidatorItem } from "./types";
|
|
2
|
+
interface AccountBannerState {
|
|
3
|
+
display: boolean;
|
|
4
|
+
redelegate: boolean;
|
|
5
|
+
validatorSrcAddress: string;
|
|
6
|
+
ledgerValidator: CosmosValidatorItem | undefined;
|
|
7
|
+
}
|
|
8
|
+
export declare function getAccountBannerState(account: CosmosAccount): Promise<AccountBannerState>;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=banner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"banner.d.ts","sourceRoot":"","sources":["../../../src/families/cosmos/banner.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAElE,UAAU,kBAAkB;IAC1B,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,OAAO,CAAC;IACpB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,eAAe,EAAE,mBAAmB,GAAG,SAAS,CAAC;CAClD;AAED,wBAAsB,qBAAqB,CACzC,OAAO,EAAE,aAAa,GACrB,OAAO,CAAC,kBAAkB,CAAC,CAwE7B"}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (_) try {
|
|
18
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
39
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
40
|
+
if (!m) return o;
|
|
41
|
+
var i = m.call(o), r, ar = [], e;
|
|
42
|
+
try {
|
|
43
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
44
|
+
}
|
|
45
|
+
catch (error) { e = { error: error }; }
|
|
46
|
+
finally {
|
|
47
|
+
try {
|
|
48
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
49
|
+
}
|
|
50
|
+
finally { if (e) throw e.error; }
|
|
51
|
+
}
|
|
52
|
+
return ar;
|
|
53
|
+
};
|
|
54
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
55
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
56
|
+
if (ar || !(i in from)) {
|
|
57
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
58
|
+
ar[i] = from[i];
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
62
|
+
};
|
|
63
|
+
exports.__esModule = true;
|
|
64
|
+
exports.getAccountBannerState = void 0;
|
|
65
|
+
var preloadedData_1 = require("./preloadedData");
|
|
66
|
+
var bridge_1 = require("../../bridge");
|
|
67
|
+
var utils_1 = require("./utils");
|
|
68
|
+
function getAccountBannerState(account) {
|
|
69
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
70
|
+
var cosmosResources, delegationAddresses, redelegationAddresses, validatorAdresses, validators, ledgerValidator, worstValidator, _loop_1, i, redelegate, validatorSrcAddress, display, maxSpendable;
|
|
71
|
+
return __generator(this, function (_a) {
|
|
72
|
+
switch (_a.label) {
|
|
73
|
+
case 0:
|
|
74
|
+
cosmosResources = account.cosmosResources
|
|
75
|
+
? account.cosmosResources
|
|
76
|
+
: { delegations: [], redelegations: [] };
|
|
77
|
+
delegationAddresses = cosmosResources.delegations.map(function (delegation) {
|
|
78
|
+
return delegation.validatorAddress;
|
|
79
|
+
});
|
|
80
|
+
redelegationAddresses = cosmosResources.redelegations.map(function (redelegation) {
|
|
81
|
+
return redelegation.validatorDstAddress;
|
|
82
|
+
});
|
|
83
|
+
validatorAdresses = __spreadArray(__spreadArray([], __read(delegationAddresses), false), __read(redelegationAddresses), false);
|
|
84
|
+
validators = (0, preloadedData_1.getCurrentCosmosPreloadData)().validators;
|
|
85
|
+
ledgerValidator = validators.find(function (validator) { return validator.validatorAddress === utils_1.LEDGER_VALIDATOR_ADDRESS; });
|
|
86
|
+
worstValidator = ledgerValidator;
|
|
87
|
+
_loop_1 = function (i) {
|
|
88
|
+
var validatorAdress = validatorAdresses[i];
|
|
89
|
+
var validator = validators.find(function (validator) { return validator.validatorAddress === validatorAdress; });
|
|
90
|
+
if (worstValidator &&
|
|
91
|
+
validator &&
|
|
92
|
+
worstValidator.commission < validator.commission) {
|
|
93
|
+
worstValidator = validator;
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
for (i = 0; i < validatorAdresses.length; i++) {
|
|
97
|
+
_loop_1(i);
|
|
98
|
+
}
|
|
99
|
+
redelegate = false;
|
|
100
|
+
validatorSrcAddress = "";
|
|
101
|
+
display = false;
|
|
102
|
+
if (!worstValidator) return [3 /*break*/, 3];
|
|
103
|
+
if (!((worstValidator === null || worstValidator === void 0 ? void 0 : worstValidator.validatorAddress) === (ledgerValidator === null || ledgerValidator === void 0 ? void 0 : ledgerValidator.validatorAddress))) return [3 /*break*/, 2];
|
|
104
|
+
return [4 /*yield*/, (0, bridge_1.getAccountBridge)(account, undefined).estimateMaxSpendable({
|
|
105
|
+
account: account,
|
|
106
|
+
parentAccount: undefined,
|
|
107
|
+
transaction: undefined
|
|
108
|
+
})];
|
|
109
|
+
case 1:
|
|
110
|
+
maxSpendable = _a.sent();
|
|
111
|
+
if (maxSpendable.gt(0)) {
|
|
112
|
+
// Delegate remaining ATOM (not staked)
|
|
113
|
+
display = true;
|
|
114
|
+
}
|
|
115
|
+
return [3 /*break*/, 3];
|
|
116
|
+
case 2:
|
|
117
|
+
// Redelegate to the worst validator
|
|
118
|
+
display = true;
|
|
119
|
+
redelegate = true;
|
|
120
|
+
validatorSrcAddress = worstValidator.validatorAddress;
|
|
121
|
+
_a.label = 3;
|
|
122
|
+
case 3: return [2 /*return*/, {
|
|
123
|
+
display: display,
|
|
124
|
+
redelegate: redelegate,
|
|
125
|
+
validatorSrcAddress: validatorSrcAddress,
|
|
126
|
+
ledgerValidator: ledgerValidator
|
|
127
|
+
}];
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
exports.getAccountBannerState = getAccountBannerState;
|
|
133
|
+
//# sourceMappingURL=banner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"banner.js","sourceRoot":"","sources":["../../../src/families/cosmos/banner.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iDAA8D;AAC9D,uCAAgD;AAChD,iCAAmD;AAUnD,SAAsB,qBAAqB,CACzC,OAAsB;;;;;;oBAGhB,eAAe,GAAG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Ad,wBAAc;yBAEd,CAAA,CAAA,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAE,gBAAgB,OAAK,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,gBAAgB,CAAA,CAAA,EAAtE,wBAAsE;oBAGjD,qBAAM,IAAA,yBAAgB,EACzC,OAAO,EACP,SAAS,CACV,CAAC,oBAAoB,CAAC;4BACrB,OAAO,SAAA;4BACP,aAAa,EAAE,SAAS;4BACxB,WAAW,EAAE,SAAS;yBACvB,CAAC,EAAA;;oBAPI,YAAY,GAAG,SAOnB;oBACF,IAAI,YAAY,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE;wBACtB,uCAAuC;wBACvC,OAAO,GAAG,IAAI,CAAC;qBAChB;;;oBAED,oCAAoC;oBACpC,OAAO,GAAG,IAAI,CAAC;oBACf,UAAU,GAAG,IAAI,CAAC;oBAClB,mBAAmB,GAAG,cAAc,CAAC,gBAAgB,CAAC;;wBAI1D,sBAAO;wBACL,OAAO,SAAA;wBACP,UAAU,YAAA;wBACV,mBAAmB,qBAAA;wBACnB,eAAe,iBAAA;qBAChB,EAAC;;;;CACH;AA1ED,sDA0EC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"banner.test.d.ts","sourceRoot":"","sources":["../../../src/families/cosmos/banner.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
28
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
29
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
30
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
31
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
35
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
36
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
37
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
38
|
+
function step(op) {
|
|
39
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
40
|
+
while (_) try {
|
|
41
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
42
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
43
|
+
switch (op[0]) {
|
|
44
|
+
case 0: case 1: t = op; break;
|
|
45
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
46
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
47
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
48
|
+
default:
|
|
49
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
50
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
51
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
52
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
53
|
+
if (t[2]) _.ops.pop();
|
|
54
|
+
_.trys.pop(); continue;
|
|
55
|
+
}
|
|
56
|
+
op = body.call(thisArg, _);
|
|
57
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
58
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
62
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
63
|
+
};
|
|
64
|
+
exports.__esModule = true;
|
|
65
|
+
var banner_1 = require("./banner");
|
|
66
|
+
var preloadedData = __importStar(require("./preloadedData"));
|
|
67
|
+
var bridge = __importStar(require("../../bridge"));
|
|
68
|
+
var preloadedData_mock_1 = __importDefault(require("./preloadedData.mock"));
|
|
69
|
+
var utils_1 = require("./utils");
|
|
70
|
+
var bignumber_js_1 = require("bignumber.js");
|
|
71
|
+
var ledgerValidator = preloadedData_mock_1["default"].validators.find(function (x) { return x.validatorAddress === utils_1.LEDGER_VALIDATOR_ADDRESS; });
|
|
72
|
+
var expensiveValidator = preloadedData_mock_1["default"].validators.find(function (x) {
|
|
73
|
+
return x.validatorAddress ===
|
|
74
|
+
"cosmosvaloper1qs8tnw2t8l6amtzvdemnnsq9dzk0ag0z52uzay";
|
|
75
|
+
});
|
|
76
|
+
var cheapValidator = preloadedData_mock_1["default"].validators.find(function (x) {
|
|
77
|
+
return x.validatorAddress ===
|
|
78
|
+
"cosmosvaloper1qaa9zej9a0ge3ugpx3pxyx602lxh3ztqgfnp42";
|
|
79
|
+
});
|
|
80
|
+
var account = {
|
|
81
|
+
type: "Account",
|
|
82
|
+
id: "js:2:cosmos:cosmos1f9y7wdychcdhwvyrhff3zvs3gy3qxcu2th4g8u:",
|
|
83
|
+
starred: false,
|
|
84
|
+
used: false,
|
|
85
|
+
seedIdentifier: "02d4c121ce2bb160ebf39aa0be0050b4d553e18872985ac3a4e21904fd1442defe",
|
|
86
|
+
derivationMode: "",
|
|
87
|
+
index: 1,
|
|
88
|
+
freshAddress: "cosmos1f9y7wdychcdhwvyrhff3zvs3gy3qxcu2th4g8u",
|
|
89
|
+
freshAddressPath: "44'/118'/1'/0/0",
|
|
90
|
+
name: "Cosmos 2 - Nano X Static Account",
|
|
91
|
+
freshAddresses: [],
|
|
92
|
+
blockHeight: 5417472,
|
|
93
|
+
creationDate: new Date("2022-08-02T16:09:08.906Z"),
|
|
94
|
+
balance: new bignumber_js_1.BigNumber("200250"),
|
|
95
|
+
spendableBalance: new bignumber_js_1.BigNumber("200250"),
|
|
96
|
+
operations: [],
|
|
97
|
+
operationsCount: 1,
|
|
98
|
+
pendingOperations: [],
|
|
99
|
+
unit: { name: "Atom", code: "ATOM", magnitude: 6 },
|
|
100
|
+
currency: {
|
|
101
|
+
type: "CryptoCurrency",
|
|
102
|
+
id: "cosmos",
|
|
103
|
+
coinType: 118,
|
|
104
|
+
name: "Cosmos",
|
|
105
|
+
managerAppName: "Cosmos",
|
|
106
|
+
ticker: "ATOM",
|
|
107
|
+
scheme: "cosmos",
|
|
108
|
+
color: "#16192f",
|
|
109
|
+
family: "cosmos",
|
|
110
|
+
units: [
|
|
111
|
+
{ name: "Atom", code: "ATOM", magnitude: 6 },
|
|
112
|
+
{ name: "microAtom", code: "uatom", magnitude: 0 },
|
|
113
|
+
],
|
|
114
|
+
explorerViews: [
|
|
115
|
+
{
|
|
116
|
+
tx: "https://www.mintscan.io/cosmos/txs/$hash",
|
|
117
|
+
address: "https://www.mintscan.io/cosmos/validators/$address"
|
|
118
|
+
},
|
|
119
|
+
]
|
|
120
|
+
},
|
|
121
|
+
lastSyncDate: new Date("2022-08-02T16:11:47.343Z"),
|
|
122
|
+
swapHistory: [],
|
|
123
|
+
balanceHistoryCache: {
|
|
124
|
+
HOUR: { balances: [0, 393248, 393248], latestDate: 1661162400000 },
|
|
125
|
+
DAY: { balances: [0, 393248], latestDate: 1661122800000 },
|
|
126
|
+
WEEK: { balances: [0, 393248], latestDate: 1661036400000 }
|
|
127
|
+
},
|
|
128
|
+
xpub: "cosmos1f9y7wdychcdhwvyrhff3zvs3gy3qxcu2th4g8u",
|
|
129
|
+
cosmosResources: {
|
|
130
|
+
delegations: [
|
|
131
|
+
{
|
|
132
|
+
amount: new bignumber_js_1.BigNumber("50000"),
|
|
133
|
+
status: "bonded",
|
|
134
|
+
pendingRewards: new bignumber_js_1.BigNumber("112"),
|
|
135
|
+
validatorAddress: "cosmosvaloper1c4k24jzduc365kywrsvf5ujz4ya6mwympnc4en"
|
|
136
|
+
},
|
|
137
|
+
],
|
|
138
|
+
redelegations: [],
|
|
139
|
+
unbondings: [],
|
|
140
|
+
delegatedBalance: new bignumber_js_1.BigNumber("0"),
|
|
141
|
+
pendingRewardsBalance: new bignumber_js_1.BigNumber("0"),
|
|
142
|
+
unbondingBalance: new bignumber_js_1.BigNumber("0"),
|
|
143
|
+
withdrawAddress: ""
|
|
144
|
+
}
|
|
145
|
+
};
|
|
146
|
+
var validators = [expensiveValidator, cheapValidator, ledgerValidator];
|
|
147
|
+
describe("cosmos/banner", function () {
|
|
148
|
+
describe("useCosmosFormattedDelegations", function () {
|
|
149
|
+
afterEach(function () {
|
|
150
|
+
jest.restoreAllMocks();
|
|
151
|
+
});
|
|
152
|
+
it("should not display the banner", function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
153
|
+
var result;
|
|
154
|
+
return __generator(this, function (_a) {
|
|
155
|
+
switch (_a.label) {
|
|
156
|
+
case 0:
|
|
157
|
+
jest
|
|
158
|
+
.spyOn(preloadedData, "getCurrentCosmosPreloadData")
|
|
159
|
+
.mockReturnValue({ validators: validators });
|
|
160
|
+
jest.spyOn(bridge, "getAccountBridge").mockReturnValue({
|
|
161
|
+
estimateMaxSpendable: function () { return Promise.resolve(new bignumber_js_1.BigNumber(0)); }
|
|
162
|
+
});
|
|
163
|
+
return [4 /*yield*/, (0, banner_1.getAccountBannerState)(account)];
|
|
164
|
+
case 1:
|
|
165
|
+
result = _a.sent();
|
|
166
|
+
expect(1 + 1).toBe(2);
|
|
167
|
+
expect(result).toStrictEqual({
|
|
168
|
+
display: false,
|
|
169
|
+
redelegate: false,
|
|
170
|
+
validatorSrcAddress: "",
|
|
171
|
+
ledgerValidator: ledgerValidator
|
|
172
|
+
});
|
|
173
|
+
return [2 /*return*/];
|
|
174
|
+
}
|
|
175
|
+
});
|
|
176
|
+
}); });
|
|
177
|
+
it("should return display delegate mode", function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
178
|
+
var result;
|
|
179
|
+
return __generator(this, function (_a) {
|
|
180
|
+
switch (_a.label) {
|
|
181
|
+
case 0:
|
|
182
|
+
jest
|
|
183
|
+
.spyOn(preloadedData, "getCurrentCosmosPreloadData")
|
|
184
|
+
.mockReturnValue({ validators: validators });
|
|
185
|
+
jest.spyOn(bridge, "getAccountBridge").mockReturnValue({
|
|
186
|
+
estimateMaxSpendable: function () { return Promise.resolve(new bignumber_js_1.BigNumber(5000)); }
|
|
187
|
+
});
|
|
188
|
+
return [4 /*yield*/, (0, banner_1.getAccountBannerState)(account)];
|
|
189
|
+
case 1:
|
|
190
|
+
result = _a.sent();
|
|
191
|
+
expect(result).toStrictEqual({
|
|
192
|
+
display: true,
|
|
193
|
+
redelegate: false,
|
|
194
|
+
validatorSrcAddress: "",
|
|
195
|
+
ledgerValidator: ledgerValidator
|
|
196
|
+
});
|
|
197
|
+
return [2 /*return*/];
|
|
198
|
+
}
|
|
199
|
+
});
|
|
200
|
+
}); });
|
|
201
|
+
it("should return display redelegate mode", function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
202
|
+
var result;
|
|
203
|
+
return __generator(this, function (_a) {
|
|
204
|
+
switch (_a.label) {
|
|
205
|
+
case 0:
|
|
206
|
+
jest
|
|
207
|
+
.spyOn(preloadedData, "getCurrentCosmosPreloadData")
|
|
208
|
+
.mockReturnValue({ validators: validators });
|
|
209
|
+
jest.spyOn(bridge, "getAccountBridge").mockReturnValue({
|
|
210
|
+
estimateMaxSpendable: function () { return Promise.resolve(new bignumber_js_1.BigNumber(5000)); }
|
|
211
|
+
});
|
|
212
|
+
account.cosmosResources.redelegations.push({
|
|
213
|
+
validatorSrcAddress: "xxxx",
|
|
214
|
+
validatorDstAddress: expensiveValidator === null || expensiveValidator === void 0 ? void 0 : expensiveValidator.validatorAddress,
|
|
215
|
+
amount: new bignumber_js_1.BigNumber(1000),
|
|
216
|
+
completionDate: new Date()
|
|
217
|
+
});
|
|
218
|
+
return [4 /*yield*/, (0, banner_1.getAccountBannerState)(account)];
|
|
219
|
+
case 1:
|
|
220
|
+
result = _a.sent();
|
|
221
|
+
expect(result).toStrictEqual({
|
|
222
|
+
display: true,
|
|
223
|
+
redelegate: true,
|
|
224
|
+
validatorSrcAddress: expensiveValidator === null || expensiveValidator === void 0 ? void 0 : expensiveValidator.validatorAddress,
|
|
225
|
+
ledgerValidator: ledgerValidator
|
|
226
|
+
});
|
|
227
|
+
return [2 /*return*/];
|
|
228
|
+
}
|
|
229
|
+
});
|
|
230
|
+
}); });
|
|
231
|
+
});
|
|
232
|
+
});
|
|
233
|
+
//# sourceMappingURL=banner.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"banner.test.js","sourceRoot":"","sources":["../../../src/families/cosmos/banner.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mCAAiD;AACjD,6DAAiD;AACjD,mDAAuC;AAEvC,4EAAwC;AACxC,iCAAmD;AACnD,6CAAyC;AAEzC,IAAM,eAAe,GAAoC,+BAAI,CAAC,UAAU,CAAC,IAAI,CAC3E,UAAC,CAAC,IAAK,OAAA,CAAC,CAAC,gBAAgB,KAAK,gCAAwB,EAA/C,CAA+C,CACvD,CAAC;AACF,IAAM,kBAAkB,GACtB,+BAAI,CAAC,UAAU,CAAC,IAAI,CAClB,UAAC,CAAC;IACA,OAAA,CAAC,CAAC,gBAAgB;QAClB,sDAAsD;AADtD,CACsD,CACzD,CAAC;AACJ,IAAM,cAAc,GAAoC,+BAAI,CAAC,UAAU,CAAC,IAAI,CAC1E,UAAC,CAAC;IACA,OAAA,CAAC,CAAC,gBAAgB;QAClB,sDAAsD;AADtD,CACsD,CACzD,CAAC;AAEF,IAAM,OAAO,GAAkB;IAC7B,IAAI,EAAE,SAAS;IACf,EAAE,EAAE,4DAA4D;IAChE,OAAO,EAAE,KAAK;IACd,IAAI,EAAE,KAAK;IACX,cAAc,EACZ,oEAAoE;IACtE,cAAc,EAAE,EAAE;IAClB,KAAK,EAAE,CAAC;IACR,YAAY,EAAE,+CAA+C;IAC7D,gBAAgB,EAAE,iBAAiB;IACnC,IAAI,EAAE,kCAAkC;IACxC,cAAc,EAAE,EAAE;IAClB,WAAW,EAAE,OAAO;IACpB,YAAY,EAAE,IAAI,IAAI,CAAC,0BAA0B,CAAC;IAClD,OAAO,EAAE,IAAI,wBAAS,CAAC,QAAQ,CAAC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MAAM,EAAE,IAAI,wBAAS,CAAC,IAAI,CAAC;4BAC3B,cAAc,EAAE,IAAI,IAAI,EAAE;yBAC3B,CAAC,CAAC;wBACY,qBAAM,IAAA,8BAAqB,EAAC,OAAO,CAAC,EAAA;;wBAA7C,MAAM,GAAG,SAAoC;wBACnD,MAAM,CAAC,MAAM,CAAC,CAAC,aAAa,CAAC;4BAC3B,OAAO,EAAE,IAAI;4BACb,UAAU,EAAE,IAAI;4BAChB,mBAAmB,EAAE,kBAAkB,aAAlB,kBAAkB,uBAAlB,kBAAkB,CAAE,gBAAgB;4BACzD,eAAe,iBAAA;yBAChB,CAAC,CAAC;;;;aACJ,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -58,15 +58,15 @@ export declare const TransferChecked: import("superstruct").Struct<{
|
|
|
58
58
|
}>;
|
|
59
59
|
}>;
|
|
60
60
|
export declare type TokenInstructionType = Infer<typeof TokenInstructionType>;
|
|
61
|
-
export declare const TokenInstructionType: import("superstruct").Struct<"transfer" | "initializeAccount" | "freezeAccount" | "closeAccount" | "initializeMint" | "initializeMultisig" | "approve" | "
|
|
61
|
+
export declare const TokenInstructionType: import("superstruct").Struct<"transfer" | "revoke" | "initializeAccount" | "freezeAccount" | "closeAccount" | "initializeMint" | "initializeMultisig" | "approve" | "setAuthority" | "mintTo" | "burn" | "thawAccount" | "transfer2" | "approve2" | "mintTo2" | "burn2" | "transferChecked" | "approveChecked" | "mintToChecked" | "burnChecked", {
|
|
62
62
|
transfer: "transfer";
|
|
63
|
+
revoke: "revoke";
|
|
63
64
|
initializeAccount: "initializeAccount";
|
|
64
65
|
freezeAccount: "freezeAccount";
|
|
65
66
|
closeAccount: "closeAccount";
|
|
66
67
|
initializeMint: "initializeMint";
|
|
67
68
|
initializeMultisig: "initializeMultisig";
|
|
68
69
|
approve: "approve";
|
|
69
|
-
revoke: "revoke";
|
|
70
70
|
setAuthority: "setAuthority";
|
|
71
71
|
mintTo: "mintTo";
|
|
72
72
|
burn: "burn";
|
|
@@ -60,13 +60,23 @@ declare const _default: {
|
|
|
60
60
|
}[], opts: Record<string, any>) => import("../families/cardano/types").Transaction[];
|
|
61
61
|
};
|
|
62
62
|
celo: {
|
|
63
|
-
options:
|
|
63
|
+
options: {
|
|
64
|
+
name: string;
|
|
65
|
+
type: StringConstructor;
|
|
66
|
+
desc: string;
|
|
67
|
+
}[];
|
|
64
68
|
inferAccounts: (account: import("@ledgerhq/types-live").Account) => import("@ledgerhq/types-live").AccountLikeArray;
|
|
65
69
|
inferTransactions: (transactions: {
|
|
66
70
|
account: import("@ledgerhq/types-live").AccountLike;
|
|
67
71
|
transaction: import("../families/celo/types").Transaction;
|
|
68
72
|
mainAccount: import("@ledgerhq/types-live").Account;
|
|
69
|
-
}[]) => import("../families/celo/types").Transaction[];
|
|
73
|
+
}[], opts: Record<string, any>) => import("../families/celo/types").Transaction[];
|
|
74
|
+
commands: {
|
|
75
|
+
celoValidatorGroups: {
|
|
76
|
+
args: never[];
|
|
77
|
+
job: () => import("rxjs").Observable<string>;
|
|
78
|
+
};
|
|
79
|
+
};
|
|
70
80
|
};
|
|
71
81
|
cosmos: {
|
|
72
82
|
options: ({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli-transaction.d.ts","sourceRoot":"","sources":["../../src/generated/cli-transaction.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cli-transaction.d.ts","sourceRoot":"","sources":["../../src/generated/cli-transaction.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkBA,wBAkBE"}
|
package/lib/operation.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operation.d.ts","sourceRoot":"","sources":["../src/operation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,OAAO,EACP,WAAW,EAEX,SAAS,EACV,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAgBzC,wBAAgB,sBAAsB,CACpC,EAAE,UAAU,EAAE,iBAAiB,EAAE,EAAE,WAAW,EAC9C,WAAW,EAAE,MAAM,GAClB,SAAS,GAAG,IAAI,GAAG,SAAS,CAyC9B;AAED,wBAAgB,iBAAiB,CAC/B,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,GACX,MAAM,CAER;AAED,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,MAAM,GAAG;IAC7C,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd,CAOA;AAED,wBAAgB,oBAAoB,CAClC,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,GAAG,MAAM,GACrB,MAAM,CAER;AAED,wBAAgB,oBAAoB,CAAC,EAAE,EAAE,MAAM,GAAG;IAChD,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf,CAQA;AAED,wBAAgB,sBAAsB,CACpC,SAAS,EAAE,SAAS,EACpB,IAAI,EAAE,MAAM,GACX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,CAmBb;AAED,wBAAgB,wBAAwB,CAAC,EAAE,EAAE,SAAS,GAAG,SAAS,CAyCjE;AAED,wBAAgB,qCAAqC,CACnD,EAAE,EAAE,SAAS,GACZ,SAAS,CAKX;AAED,eAAO,MAAM,8BAA8B,cAC9B,SAAS,WACX,OAAO,KACf,MAC0E,CAAC;AAE9E,eAAO,MAAM,yCAAyC,cACzC,SAAS,WACX,OAAO,KACf,MAGK,CAAC;AAET,eAAO,MAAM,oBAAoB,cACpB,SAAS,WACX,OAAO,mBACC,MAAM,KACtB,OAGQ,CAAC"}
|
package/lib/operation.js
CHANGED
|
@@ -137,6 +137,7 @@ function getOperationAmountNumber(op) {
|
|
|
137
137
|
case "REWARD":
|
|
138
138
|
case "REWARD_PAYOUT":
|
|
139
139
|
case "SUPPLY":
|
|
140
|
+
case "WITHDRAW":
|
|
140
141
|
return op.value;
|
|
141
142
|
case "OUT":
|
|
142
143
|
case "REVEAL":
|
|
@@ -149,6 +150,7 @@ function getOperationAmountNumber(op) {
|
|
|
149
150
|
case "OPT_OUT":
|
|
150
151
|
case "REDEEM":
|
|
151
152
|
case "SLASH":
|
|
153
|
+
case "LOCK":
|
|
152
154
|
return op.value.negated();
|
|
153
155
|
case "FREEZE":
|
|
154
156
|
case "UNFREEZE":
|
|
@@ -159,6 +161,10 @@ function getOperationAmountNumber(op) {
|
|
|
159
161
|
case "SET_CONTROLLER":
|
|
160
162
|
case "NOMINATE":
|
|
161
163
|
case "CHILL":
|
|
164
|
+
case "REVOKE":
|
|
165
|
+
case "APPROVE":
|
|
166
|
+
case "ACTIVATE":
|
|
167
|
+
case "UNLOCK":
|
|
162
168
|
return op.fee.negated();
|
|
163
169
|
default:
|
|
164
170
|
return new bignumber_js_1.BigNumber(0);
|