@ledgerhq/types-live 6.22.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/LICENSE +202 -0
- package/README.md +743 -0
- package/lib/account.d.ts +198 -0
- package/lib/account.d.ts.map +1 -0
- package/lib/account.js +3 -0
- package/lib/account.js.map +1 -0
- package/lib/bridge.d.ts +91 -0
- package/lib/bridge.d.ts.map +1 -0
- package/lib/bridge.js +3 -0
- package/lib/bridge.js.map +1 -0
- package/lib/derivation.d.ts +5 -0
- package/lib/derivation.d.ts.map +1 -0
- package/lib/derivation.js +3 -0
- package/lib/derivation.js.map +1 -0
- package/lib/index.d.ts +9 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +21 -0
- package/lib/index.js.map +1 -0
- package/lib/nft.d.ts +44 -0
- package/lib/nft.d.ts.map +1 -0
- package/lib/nft.js +3 -0
- package/lib/nft.js.map +1 -0
- package/lib/operation.d.ts +59 -0
- package/lib/operation.d.ts.map +1 -0
- package/lib/operation.js +3 -0
- package/lib/operation.js.map +1 -0
- package/lib/pagination.d.ts +18 -0
- package/lib/pagination.d.ts.map +1 -0
- package/lib/pagination.js +3 -0
- package/lib/pagination.js.map +1 -0
- package/lib/portfolio.d.ts +98 -0
- package/lib/portfolio.d.ts.map +1 -0
- package/lib/portfolio.js +3 -0
- package/lib/portfolio.js.map +1 -0
- package/lib/swap.d.ts +28 -0
- package/lib/swap.d.ts.map +1 -0
- package/lib/swap.js +3 -0
- package/lib/swap.js.map +1 -0
- package/lib/transaction.d.ts +157 -0
- package/lib/transaction.d.ts.map +1 -0
- package/lib/transaction.js +3 -0
- package/lib/transaction.js.map +1 -0
- package/lib-es/account.d.ts +198 -0
- package/lib-es/account.d.ts.map +1 -0
- package/lib-es/account.js +2 -0
- package/lib-es/account.js.map +1 -0
- package/lib-es/bridge.d.ts +91 -0
- package/lib-es/bridge.d.ts.map +1 -0
- package/lib-es/bridge.js +2 -0
- package/lib-es/bridge.js.map +1 -0
- package/lib-es/derivation.d.ts +5 -0
- package/lib-es/derivation.d.ts.map +1 -0
- package/lib-es/derivation.js +2 -0
- package/lib-es/derivation.js.map +1 -0
- package/lib-es/index.d.ts +9 -0
- package/lib-es/index.d.ts.map +1 -0
- package/lib-es/index.js +9 -0
- package/lib-es/index.js.map +1 -0
- package/lib-es/nft.d.ts +44 -0
- package/lib-es/nft.d.ts.map +1 -0
- package/lib-es/nft.js +2 -0
- package/lib-es/nft.js.map +1 -0
- package/lib-es/operation.d.ts +59 -0
- package/lib-es/operation.d.ts.map +1 -0
- package/lib-es/operation.js +2 -0
- package/lib-es/operation.js.map +1 -0
- package/lib-es/pagination.d.ts +18 -0
- package/lib-es/pagination.d.ts.map +1 -0
- package/lib-es/pagination.js +2 -0
- package/lib-es/pagination.js.map +1 -0
- package/lib-es/portfolio.d.ts +98 -0
- package/lib-es/portfolio.d.ts.map +1 -0
- package/lib-es/portfolio.js +2 -0
- package/lib-es/portfolio.js.map +1 -0
- package/lib-es/swap.d.ts +28 -0
- package/lib-es/swap.d.ts.map +1 -0
- package/lib-es/swap.js +2 -0
- package/lib-es/swap.js.map +1 -0
- package/lib-es/transaction.d.ts +157 -0
- package/lib-es/transaction.d.ts.map +1 -0
- package/lib-es/transaction.js +2 -0
- package/lib-es/transaction.js.map +1 -0
- package/package.json +35 -0
- package/src/account.ts +295 -0
- package/src/bridge.ts +149 -0
- package/src/derivation.ts +4 -0
- package/src/index.ts +8 -0
- package/src/nft.ts +53 -0
- package/src/operation.ts +130 -0
- package/src/pagination.ts +21 -0
- package/src/portfolio.ts +118 -0
- package/src/swap.ts +29 -0
- package/src/transaction.ts +188 -0
- package/tsconfig.json +7 -0
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { BigNumber } from "bignumber.js";
|
|
2
|
+
import { NFTStandards } from "./nft";
|
|
3
|
+
/**
|
|
4
|
+
*
|
|
5
|
+
*/
|
|
6
|
+
export declare type OperationType = "IN" | "OUT" | "NONE" | "CREATE" | "REVEAL" | "DELEGATE" | "UNDELEGATE" | "REDELEGATE" | "REWARD" | "FEES" | "FREEZE" | "UNFREEZE" | "VOTE" | "REWARD_PAYOUT" | "BOND" | "UNBOND" | "WITHDRAW_UNBONDED" | "SET_CONTROLLER" | "SLASH" | "NOMINATE" | "CHILL" | "SUPPLY" | "REDEEM" | "APPROVE" | "OPT_IN" | "OPT_OUT" | "NFT_IN" | "NFT_OUT";
|
|
7
|
+
/**
|
|
8
|
+
*
|
|
9
|
+
*/
|
|
10
|
+
export declare type Operation = {
|
|
11
|
+
id: string;
|
|
12
|
+
hash: string;
|
|
13
|
+
type: OperationType;
|
|
14
|
+
value: BigNumber;
|
|
15
|
+
fee: BigNumber;
|
|
16
|
+
senders: string[];
|
|
17
|
+
recipients: string[];
|
|
18
|
+
blockHeight: number | null | undefined;
|
|
19
|
+
blockHash: string | null | undefined;
|
|
20
|
+
transactionSequenceNumber?: number;
|
|
21
|
+
accountId: string;
|
|
22
|
+
standard?: NFTStandards | string;
|
|
23
|
+
operator?: string;
|
|
24
|
+
contract?: string;
|
|
25
|
+
tokenId?: string;
|
|
26
|
+
date: Date;
|
|
27
|
+
extra: Record<string, any>;
|
|
28
|
+
hasFailed?: boolean;
|
|
29
|
+
subOperations?: Operation[];
|
|
30
|
+
internalOperations?: Operation[];
|
|
31
|
+
nftOperations?: Operation[];
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
*
|
|
35
|
+
*/
|
|
36
|
+
export declare type OperationRaw = {
|
|
37
|
+
id: string;
|
|
38
|
+
hash: string;
|
|
39
|
+
type: OperationType;
|
|
40
|
+
value: string;
|
|
41
|
+
fee: string;
|
|
42
|
+
senders: string[];
|
|
43
|
+
recipients: string[];
|
|
44
|
+
blockHeight: number | null | undefined;
|
|
45
|
+
blockHash: string | null | undefined;
|
|
46
|
+
transactionSequenceNumber?: number;
|
|
47
|
+
accountId: string;
|
|
48
|
+
hasFailed?: boolean;
|
|
49
|
+
standard?: NFTStandards | string;
|
|
50
|
+
operator?: string;
|
|
51
|
+
contract?: string;
|
|
52
|
+
tokenId?: string;
|
|
53
|
+
date: string;
|
|
54
|
+
extra: Record<string, any>;
|
|
55
|
+
subOperations?: OperationRaw[];
|
|
56
|
+
internalOperations?: OperationRaw[];
|
|
57
|
+
nftOperations?: OperationRaw[];
|
|
58
|
+
};
|
|
59
|
+
//# sourceMappingURL=operation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operation.d.ts","sourceRoot":"","sources":["../src/operation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAErC;;GAEG;AACH,oBAAY,aAAa,GACrB,IAAI,GACJ,KAAK,GACL,MAAM,GACN,QAAQ,GACR,QAAQ,GAER,UAAU,GACV,YAAY,GACZ,YAAY,GACZ,QAAQ,GAER,MAAM,GACN,QAAQ,GACR,UAAU,GAEV,MAAM,GACN,eAAe,GACf,MAAM,GACN,QAAQ,GACR,mBAAmB,GACnB,gBAAgB,GAChB,OAAO,GACP,UAAU,GACV,OAAO,GAEP,QAAQ,GACR,QAAQ,GACR,SAAS,GAET,QAAQ,GACR,SAAS,GAET,QAAQ,GACR,SAAS,CAAC;AAEd;;GAEG;AACH,oBAAY,SAAS,GAAG;IAEtB,EAAE,EAAE,MAAM,CAAC;IAEX,IAAI,EAAE,MAAM,CAAC;IAKb,IAAI,EAAE,aAAa,CAAC;IAGpB,KAAK,EAAE,SAAS,CAAC;IAEjB,GAAG,EAAE,SAAS,CAAC;IAEf,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,UAAU,EAAE,MAAM,EAAE,CAAC;IAGrB,WAAW,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAEvC,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAErC,yBAAyB,CAAC,EAAE,MAAM,C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AAC;IAG/B,kBAAkB,CAAC,EAAE,YAAY,EAAE,CAAC;IAEpC,aAAa,CAAC,EAAE,YAAY,EAAE,CAAC;CAChC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operation.js","sourceRoot":"","sources":["../src/operation.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A pagination config holds the user's pagination state
|
|
3
|
+
* this is a state that usually should leave during the app lifecycle, but is not persisted
|
|
4
|
+
* it drives the number of operations to poll in accounts
|
|
5
|
+
* when a user paginate more, the number should accordingly be incremented
|
|
6
|
+
* The UI should manage scrolling ahead of time (e.g. if 30 ops is displayed and UI have pages of 20 ops, the UI can already request to poll 70 ops so it have 2 pages in advance)
|
|
7
|
+
* The UI must always do max() to keep the increasing the counter and not going back to lower value: that optim the sync to not recompute things too much
|
|
8
|
+
*/
|
|
9
|
+
export declare type PaginationConfig = {
|
|
10
|
+
operationsPerAccountId?: Record<string, number>;
|
|
11
|
+
operations?: number;
|
|
12
|
+
};
|
|
13
|
+
export declare type SyncConfig = {
|
|
14
|
+
paginationConfig: PaginationConfig;
|
|
15
|
+
withoutSynchronize?: boolean;
|
|
16
|
+
blacklistedTokenIds?: string[];
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=pagination.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pagination.d.ts","sourceRoot":"","sources":["../src/pagination.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,oBAAY,gBAAgB,GAAG;IAE7B,sBAAsB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAGhD,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AACF,oBAAY,UAAU,GAAG;IACvB,gBAAgB,EAAE,gBAAgB,CAAC;IAEnC,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAC;CAChC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pagination.js","sourceRoot":"","sources":["../src/pagination.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import type { BigNumber } from "bignumber.js";
|
|
2
|
+
import type { AccountLike, AccountLikeArray } from "./account";
|
|
3
|
+
import type { CryptoCurrency, TokenCurrency } from "@ledgerhq/types-cryptoassets";
|
|
4
|
+
/**
|
|
5
|
+
*
|
|
6
|
+
*/
|
|
7
|
+
export declare type BalanceHistoryData = {
|
|
8
|
+
date: Date;
|
|
9
|
+
value: BigNumber;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
*
|
|
13
|
+
*/
|
|
14
|
+
export declare type BalanceHistory = BalanceHistoryData[];
|
|
15
|
+
/**
|
|
16
|
+
*
|
|
17
|
+
*/
|
|
18
|
+
export declare type BalanceHistoryRaw = Array<[string, string]>;
|
|
19
|
+
/**
|
|
20
|
+
*
|
|
21
|
+
*/
|
|
22
|
+
export declare type BalanceHistoryWithCountervalue = Array<{
|
|
23
|
+
date: Date;
|
|
24
|
+
value: BigNumber;
|
|
25
|
+
countervalue: BigNumber;
|
|
26
|
+
}>;
|
|
27
|
+
/**
|
|
28
|
+
*
|
|
29
|
+
*/
|
|
30
|
+
export declare type ValueChange = {
|
|
31
|
+
percentage: BigNumber | null | undefined;
|
|
32
|
+
value: BigNumber;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
*
|
|
36
|
+
*/
|
|
37
|
+
export declare type AccountPortfolio = {
|
|
38
|
+
history: BalanceHistoryWithCountervalue;
|
|
39
|
+
countervalueAvailable: boolean;
|
|
40
|
+
countervalueReceiveSum: BigNumber;
|
|
41
|
+
countervalueSendSum: BigNumber;
|
|
42
|
+
cryptoChange: ValueChange;
|
|
43
|
+
countervalueChange: ValueChange;
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
*
|
|
47
|
+
*/
|
|
48
|
+
export declare type CurrencyPortfolio = {
|
|
49
|
+
history: BalanceHistoryWithCountervalue;
|
|
50
|
+
countervalueAvailable: boolean;
|
|
51
|
+
histories: BalanceHistoryWithCountervalue[];
|
|
52
|
+
accounts: AccountLikeArray;
|
|
53
|
+
cryptoChange: ValueChange;
|
|
54
|
+
countervalueChange: ValueChange;
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
*
|
|
58
|
+
*/
|
|
59
|
+
export declare type Portfolio = {
|
|
60
|
+
balanceHistory: BalanceHistory;
|
|
61
|
+
balanceAvailable: boolean;
|
|
62
|
+
availableAccounts: AccountLike[];
|
|
63
|
+
unavailableCurrencies: (CryptoCurrency | TokenCurrency)[];
|
|
64
|
+
accounts: AccountLike[];
|
|
65
|
+
range: PortfolioRange;
|
|
66
|
+
histories: BalanceHistoryWithCountervalue[];
|
|
67
|
+
countervalueReceiveSum: BigNumber;
|
|
68
|
+
countervalueSendSum: BigNumber;
|
|
69
|
+
countervalueChange: ValueChange;
|
|
70
|
+
};
|
|
71
|
+
/**
|
|
72
|
+
*
|
|
73
|
+
*/
|
|
74
|
+
export declare type PortfolioRangeConfig = {
|
|
75
|
+
count: number;
|
|
76
|
+
granularityId: "HOUR" | "DAY" | "WEEK";
|
|
77
|
+
startOf: (arg0: Date) => Date;
|
|
78
|
+
increment: number;
|
|
79
|
+
};
|
|
80
|
+
/**
|
|
81
|
+
*
|
|
82
|
+
*/
|
|
83
|
+
export declare type PortfolioRange = "year" | "month" | "week" | "day";
|
|
84
|
+
/**
|
|
85
|
+
*
|
|
86
|
+
*/
|
|
87
|
+
export declare type AssetsDistribution = {
|
|
88
|
+
isAvailable: boolean;
|
|
89
|
+
list: Array<{
|
|
90
|
+
currency: CryptoCurrency | TokenCurrency;
|
|
91
|
+
distribution: number;
|
|
92
|
+
amount: BigNumber;
|
|
93
|
+
countervalue: BigNumber;
|
|
94
|
+
}>;
|
|
95
|
+
showFirst: number;
|
|
96
|
+
sum: BigNumber;
|
|
97
|
+
};
|
|
98
|
+
//# sourceMappingURL=portfolio.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"portfolio.d.ts","sourceRoot":"","sources":["../src/portfolio.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC/D,OAAO,KAAK,EACV,cAAc,EACd,aAAa,EACd,MAAM,8BAA8B,CAAC;AAEtC;;GAEG;AACH,oBAAY,kBAAkB,GAAG;IAC/B,IAAI,EAAE,IAAI,CAAC;IACX,KAAK,EAAE,SAAS,CAAC;CAClB,CAAC;AACF;;GAEG;AACH,oBAAY,cAAc,GAAG,kBAAkB,EAAE,CAAC;AAClD;;GAEG;AACH,oBAAY,iBAAiB,GAAG,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;AAExD;;GAEG;AACH,oBAAY,8BAA8B,GAAG,KAAK,CAAC;IACjD,IAAI,EAAE,IAAI,CAAC;IACX,KAAK,EAAE,SAAS,CAAC;IACjB,YAAY,EAAE,SAAS,CAAC;CACzB,CAAC,CAAC;AAEH;;GAEG;AACH,oBAAY,WAAW,GAAG;IACxB,UAAU,EAAE,SAAS,GAAG,IAAI,GAAG,SAAS,CAAC;IAEzC,KAAK,EAAE,SAAS,CAAC;CAClB,CAAC;AAEF;;GAEG;AACH,oBAAY,gBAAgB,GAAG;IAC7B,OAAO,EAAE,8BAA8B,CAAC;IACxC,qBAAqB,EAAE,OAAO,CAAC;IAC/B,sBAAsB,EAAE,SAAS,CAAC;IAClC,mBAAmB,EAAE,SAAS,CAAC;IAC/B,YAAY,EAAE,WAAW,CAAC;IAE1B,kBAAkB,EAAE,WAAW,CAAC;CACjC,CAAC;AAEF;;GAEG;AACH,oBAAY,iBAAiB,GAAG;IAC9B,OAAO,EAAE,8BAA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AS,CAAC;CAChB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"portfolio.js","sourceRoot":"","sources":["../src/portfolio.ts"],"names":[],"mappings":""}
|
package/lib-es/swap.d.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { BigNumber } from "bignumber.js";
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
*/
|
|
5
|
+
export declare type SwapOperation = {
|
|
6
|
+
provider: string;
|
|
7
|
+
swapId: string;
|
|
8
|
+
status: string;
|
|
9
|
+
receiverAccountId: string;
|
|
10
|
+
tokenId?: string;
|
|
11
|
+
operationId: string;
|
|
12
|
+
fromAmount: BigNumber;
|
|
13
|
+
toAmount: BigNumber;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
*
|
|
17
|
+
*/
|
|
18
|
+
export declare type SwapOperationRaw = {
|
|
19
|
+
provider: string;
|
|
20
|
+
swapId: string;
|
|
21
|
+
status: string;
|
|
22
|
+
receiverAccountId: string;
|
|
23
|
+
tokenId?: string;
|
|
24
|
+
operationId: string;
|
|
25
|
+
fromAmount: string;
|
|
26
|
+
toAmount: string;
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=swap.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"swap.d.ts","sourceRoot":"","sources":["../src/swap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC;;GAEG;AACH,oBAAY,aAAa,GAAG;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,iBAAiB,EAAE,MAAM,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,SAAS,CAAC;IACtB,QAAQ,EAAE,SAAS,CAAC;CACrB,CAAC;AAEF;;GAEG;AACH,oBAAY,gBAAgB,GAAG;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,iBAAiB,EAAE,MAAM,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC"}
|
package/lib-es/swap.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"swap.js","sourceRoot":"","sources":["../src/swap.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import type { BigNumber } from "bignumber.js";
|
|
2
|
+
import type { Operation, OperationRaw } from "./operation";
|
|
3
|
+
import type { Unit } from "@ledgerhq/types-cryptoassets";
|
|
4
|
+
/**
|
|
5
|
+
*
|
|
6
|
+
*/
|
|
7
|
+
export declare type BitcoinInput = {
|
|
8
|
+
address: string | null | undefined;
|
|
9
|
+
value: BigNumber | null | undefined;
|
|
10
|
+
previousTxHash: string | null | undefined;
|
|
11
|
+
previousOutputIndex: number;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
*
|
|
15
|
+
*/
|
|
16
|
+
export declare type BitcoinInputRaw = [
|
|
17
|
+
string | null | undefined,
|
|
18
|
+
string | null | undefined,
|
|
19
|
+
string | null | undefined,
|
|
20
|
+
number
|
|
21
|
+
];
|
|
22
|
+
/**
|
|
23
|
+
*
|
|
24
|
+
*/
|
|
25
|
+
export declare type BitcoinOutput = {
|
|
26
|
+
hash: string;
|
|
27
|
+
outputIndex: number;
|
|
28
|
+
blockHeight: number | null | undefined;
|
|
29
|
+
address: string | null | undefined;
|
|
30
|
+
path: string | null | undefined;
|
|
31
|
+
value: BigNumber;
|
|
32
|
+
rbf: boolean;
|
|
33
|
+
isChange: boolean;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
*
|
|
37
|
+
*/
|
|
38
|
+
export declare type BitcoinOutputRaw = [
|
|
39
|
+
string,
|
|
40
|
+
number,
|
|
41
|
+
number | null | undefined,
|
|
42
|
+
string | null | undefined,
|
|
43
|
+
string | null | undefined,
|
|
44
|
+
string,
|
|
45
|
+
number,
|
|
46
|
+
number
|
|
47
|
+
];
|
|
48
|
+
/**
|
|
49
|
+
*
|
|
50
|
+
*/
|
|
51
|
+
export declare type SignedOperation = {
|
|
52
|
+
operation: Operation;
|
|
53
|
+
signature: string;
|
|
54
|
+
signatureRaw?: Record<string, any>;
|
|
55
|
+
expirationDate: Date | null | undefined;
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
*
|
|
59
|
+
*/
|
|
60
|
+
export declare type SignedOperationRaw = {
|
|
61
|
+
operation: OperationRaw;
|
|
62
|
+
signature: string;
|
|
63
|
+
signatureRaw?: Record<string, any>;
|
|
64
|
+
expirationDate: string | null | undefined;
|
|
65
|
+
};
|
|
66
|
+
/**
|
|
67
|
+
*
|
|
68
|
+
*/
|
|
69
|
+
export declare type SignOperationEvent = {
|
|
70
|
+
type: "device-streaming";
|
|
71
|
+
progress: number;
|
|
72
|
+
index: number;
|
|
73
|
+
total: number;
|
|
74
|
+
} | {
|
|
75
|
+
type: "device-signature-requested";
|
|
76
|
+
} | {
|
|
77
|
+
type: "device-signature-granted";
|
|
78
|
+
} | {
|
|
79
|
+
type: "signed";
|
|
80
|
+
signedOperation: SignedOperation;
|
|
81
|
+
};
|
|
82
|
+
/**
|
|
83
|
+
*
|
|
84
|
+
*/
|
|
85
|
+
export declare type SignOperationEventRaw = {
|
|
86
|
+
type: "device-streaming";
|
|
87
|
+
progress: number;
|
|
88
|
+
index: number;
|
|
89
|
+
total: number;
|
|
90
|
+
} | {
|
|
91
|
+
type: "device-signature-requested";
|
|
92
|
+
} | {
|
|
93
|
+
type: "device-signature-granted";
|
|
94
|
+
} | {
|
|
95
|
+
type: "signed";
|
|
96
|
+
signedOperation: SignedOperationRaw;
|
|
97
|
+
};
|
|
98
|
+
/**
|
|
99
|
+
* Transaction is a generic object that holds all state for all transactions
|
|
100
|
+
* there are generic fields and coin specific fields. That's why almost all fields are optionals
|
|
101
|
+
*/
|
|
102
|
+
export declare type TransactionCommon = {
|
|
103
|
+
amount: BigNumber;
|
|
104
|
+
recipient: string;
|
|
105
|
+
useAllAmount?: boolean;
|
|
106
|
+
subAccountId?: string | null | undefined;
|
|
107
|
+
feesStrategy?: "slow" | "medium" | "fast" | "custom" | null;
|
|
108
|
+
};
|
|
109
|
+
/**
|
|
110
|
+
*
|
|
111
|
+
*/
|
|
112
|
+
export declare type TransactionCommonRaw = {
|
|
113
|
+
amount: string;
|
|
114
|
+
recipient: string;
|
|
115
|
+
useAllAmount?: boolean;
|
|
116
|
+
subAccountId?: string | null | undefined;
|
|
117
|
+
feesStrategy?: "slow" | "medium" | "fast" | "custom" | null;
|
|
118
|
+
};
|
|
119
|
+
/**
|
|
120
|
+
* User can have 3 differents choice for their fee
|
|
121
|
+
* Most of the time mid is low * 1.25 and high is low * 1.5
|
|
122
|
+
* They are some exception as eth that got his own meter
|
|
123
|
+
*/
|
|
124
|
+
export declare type FeeStrategy = {
|
|
125
|
+
amount: BigNumber;
|
|
126
|
+
displayedAmount?: BigNumber;
|
|
127
|
+
label: string;
|
|
128
|
+
unit?: Unit;
|
|
129
|
+
};
|
|
130
|
+
/**
|
|
131
|
+
* TransactionStatus is a view of Transaction with general info to be used on the UI and status info.
|
|
132
|
+
*/
|
|
133
|
+
export declare type TransactionStatus = {
|
|
134
|
+
errors: Record<string, Error>;
|
|
135
|
+
warnings: Record<string, Error>;
|
|
136
|
+
estimatedFees: BigNumber;
|
|
137
|
+
amount: BigNumber;
|
|
138
|
+
totalSpent: BigNumber;
|
|
139
|
+
recipientIsReadOnly?: boolean;
|
|
140
|
+
txInputs?: BitcoinInput[];
|
|
141
|
+
txOutputs?: BitcoinOutput[];
|
|
142
|
+
};
|
|
143
|
+
/**
|
|
144
|
+
*
|
|
145
|
+
*/
|
|
146
|
+
export declare type TransactionStatusRaw = {
|
|
147
|
+
errors: Record<string, string>;
|
|
148
|
+
warnings: Record<string, string>;
|
|
149
|
+
estimatedFees: string;
|
|
150
|
+
amount: string;
|
|
151
|
+
totalSpent: string;
|
|
152
|
+
useAllAmount?: boolean;
|
|
153
|
+
recipientIsReadOnly?: boolean;
|
|
154
|
+
txInputs?: BitcoinInputRaw[];
|
|
155
|
+
txOutputs?: BitcoinOutputRaw[];
|
|
156
|
+
};
|
|
157
|
+
//# sourceMappingURL=transaction.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transaction.d.ts","sourceRoot":"","sources":["../src/transaction.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3D,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,8BAA8B,CAAC;AAEzD;;GAEG;AACH,oBAAY,YAAY,GAAG;IACzB,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IACnC,KAAK,EAAE,SAAS,GAAG,IAAI,GAAG,SAAS,CAAC;IACpC,cAAc,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAC1C,mBAAmB,EAAE,MAAM,CAAC;CAC7B,CAAC;AAEF;;GAEG;AACH,oBAAY,eAAe,GAAG;IAC5B,MAAM,GAAG,IAAI,GAAG,SAAS;IACzB,MAAM,GAAG,IAAI,GAAG,SAAS;IACzB,MAAM,GAAG,IAAI,GAAG,SAAS;IACzB,MAAM;CACP,CAAC;AAEF;;GAEG;AACH,oBAAY,aAAa,GAAG;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IACvC,O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AK,CAAC,CAAC;IAEhC,aAAa,EAAE,SAAS,CAAC;IAEzB,MAAM,EAAE,SAAS,CAAC;IAElB,UAAU,EAAE,SAAS,CAAC;IAEtB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,QAAQ,CAAC,EAAE,YAAY,EAAE,CAAC;IAC1B,SAAS,CAAC,EAAE,aAAa,EAAE,CAAC;CAC7B,CAAC;AACF;;GAEG;AACH,oBAAY,oBAAoB,GAAG;IACjC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,QAAQ,CAAC,EAAE,eAAe,EAAE,CAAC;IAC7B,SAAS,CAAC,EAAE,gBAAgB,EAAE,CAAC;CAChC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transaction.js","sourceRoot":"","sources":["../src/transaction.ts"],"names":[],"mappings":""}
|
package/package.json
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@ledgerhq/types-live",
|
|
3
|
+
"version": "6.22.0",
|
|
4
|
+
"description": "Ledger Live main types.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"Ledger"
|
|
7
|
+
],
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "https://github.com/LedgerHQ/ledgerjs"
|
|
11
|
+
},
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/LedgerHQ/ledgerjs/issues"
|
|
14
|
+
},
|
|
15
|
+
"homepage": "https://github.com/LedgerHQ/ledgerjs",
|
|
16
|
+
"publishConfig": {
|
|
17
|
+
"access": "public"
|
|
18
|
+
},
|
|
19
|
+
"main": "lib/index.js",
|
|
20
|
+
"module": "lib-es/index.js",
|
|
21
|
+
"types": "lib/index.d.ts",
|
|
22
|
+
"license": "Apache-2.0",
|
|
23
|
+
"dependencies": {
|
|
24
|
+
"@ledgerhq/types-cryptoassets": "^6.22.0",
|
|
25
|
+
"bignumber.js": "9",
|
|
26
|
+
"rxjs": "6"
|
|
27
|
+
},
|
|
28
|
+
"scripts": {
|
|
29
|
+
"clean": "bash ../../script/clean.sh",
|
|
30
|
+
"build": "bash ../../script/build.sh",
|
|
31
|
+
"watch": "bash ../../script/watch.sh",
|
|
32
|
+
"doc": "bash ../../script/doc.sh"
|
|
33
|
+
},
|
|
34
|
+
"gitHead": "df473b65fc3a869bc4cbb65de5b057272366f2da"
|
|
35
|
+
}
|