@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
package/lib/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/swap.js
ADDED
package/lib/swap.js.map
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,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IACnC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAChC,KAAK,EAAE,SAAS,CAAC;IACjB,GAAG,EAAE,OAAO,CAAC;IACb,QAAQ,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF;;GAEG;AACH,oBAAY,gBAAgB,GAAG;IAC7B,MAAM;IACN,MAAM;IACN,MAAM,GAAG,IAAI,GAAG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AAM,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":""}
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
import type { BigNumber } from "bignumber.js";
|
|
2
|
+
import type { CryptoCurrency, TokenCurrency, Unit } from "@ledgerhq/types-cryptoassets";
|
|
3
|
+
import type { OperationRaw, Operation } from "./operation";
|
|
4
|
+
import type { DerivationMode } from "./derivation";
|
|
5
|
+
import type { SwapOperation, SwapOperationRaw } from "./swap";
|
|
6
|
+
import type { NFT, NFTRaw } from "./nft";
|
|
7
|
+
export declare type GranularityId = "HOUR" | "DAY" | "WEEK";
|
|
8
|
+
export declare type BalanceHistoryCache = Record<GranularityId, BalanceHistoryDataCache>;
|
|
9
|
+
export declare type BalanceHistoryDataCache = {
|
|
10
|
+
latestDate: number | null | undefined;
|
|
11
|
+
balances: number[];
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* A token belongs to an Account and share the parent account address
|
|
15
|
+
*/
|
|
16
|
+
export declare type TokenAccount = {
|
|
17
|
+
type: "TokenAccount";
|
|
18
|
+
id: string;
|
|
19
|
+
parentId: string;
|
|
20
|
+
token: TokenCurrency;
|
|
21
|
+
balance: BigNumber;
|
|
22
|
+
spendableBalance: BigNumber;
|
|
23
|
+
compoundBalance?: BigNumber;
|
|
24
|
+
creationDate: Date;
|
|
25
|
+
operationsCount: number;
|
|
26
|
+
operations: Operation[];
|
|
27
|
+
pendingOperations: Operation[];
|
|
28
|
+
starred: boolean;
|
|
29
|
+
balanceHistoryCache: BalanceHistoryCache;
|
|
30
|
+
swapHistory: SwapOperation[];
|
|
31
|
+
approvals?: Array<{
|
|
32
|
+
sender: string;
|
|
33
|
+
value: string;
|
|
34
|
+
}>;
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* A child account belongs to an Account but has its own address.
|
|
38
|
+
*/
|
|
39
|
+
export declare type ChildAccount = {
|
|
40
|
+
type: "ChildAccount";
|
|
41
|
+
id: string;
|
|
42
|
+
name: string;
|
|
43
|
+
starred: boolean;
|
|
44
|
+
parentId: string;
|
|
45
|
+
currency: CryptoCurrency;
|
|
46
|
+
address: string;
|
|
47
|
+
balance: BigNumber;
|
|
48
|
+
creationDate: Date;
|
|
49
|
+
operationsCount: number;
|
|
50
|
+
operations: Operation[];
|
|
51
|
+
pendingOperations: Operation[];
|
|
52
|
+
balanceHistoryCache: BalanceHistoryCache;
|
|
53
|
+
swapHistory: SwapOperation[];
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
*
|
|
57
|
+
*/
|
|
58
|
+
export declare type Address = {
|
|
59
|
+
address: string;
|
|
60
|
+
derivationPath: string;
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* Account type is the main level account of a blockchain currency.
|
|
64
|
+
* Each family maybe need an extra field, to solve this, you can have some subtyping like this:
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
export type BitcoinAccount = Account & { bitcoinResources: BitcoinResources }
|
|
68
|
+
|
|
69
|
+
and all parts where we would need it, we would need to cast,
|
|
70
|
+
|
|
71
|
+
const bitcoinAccount = account as BitcoinAccount;
|
|
72
|
+
|
|
73
|
+
and that BitcoinAccount type would be part of a coin integration family specific indeed.
|
|
74
|
+
*/
|
|
75
|
+
export declare type Account = {
|
|
76
|
+
type: "Account";
|
|
77
|
+
id: string;
|
|
78
|
+
seedIdentifier: string;
|
|
79
|
+
xpub?: string;
|
|
80
|
+
derivationMode: DerivationMode;
|
|
81
|
+
index: number;
|
|
82
|
+
freshAddress: string;
|
|
83
|
+
freshAddressPath: string;
|
|
84
|
+
freshAddresses: Address[];
|
|
85
|
+
name: string;
|
|
86
|
+
starred: boolean;
|
|
87
|
+
used: boolean;
|
|
88
|
+
balance: BigNumber;
|
|
89
|
+
spendableBalance: BigNumber;
|
|
90
|
+
creationDate: Date;
|
|
91
|
+
blockHeight: number;
|
|
92
|
+
currency: CryptoCurrency;
|
|
93
|
+
unit: Unit;
|
|
94
|
+
operationsCount: number;
|
|
95
|
+
operations: Operation[];
|
|
96
|
+
pendingOperations: Operation[];
|
|
97
|
+
lastSyncDate: Date;
|
|
98
|
+
subAccounts?: SubAccount[];
|
|
99
|
+
balanceHistoryCache: BalanceHistoryCache;
|
|
100
|
+
swapHistory: SwapOperation[];
|
|
101
|
+
syncHash?: string;
|
|
102
|
+
nfts?: NFT[];
|
|
103
|
+
};
|
|
104
|
+
/**
|
|
105
|
+
* super type that is either a token or a child account
|
|
106
|
+
*/
|
|
107
|
+
export declare type SubAccount = TokenAccount | ChildAccount;
|
|
108
|
+
/**
|
|
109
|
+
* One of the Account type
|
|
110
|
+
*/
|
|
111
|
+
export declare type AccountLike = Account | SubAccount;
|
|
112
|
+
/**
|
|
113
|
+
* an array of AccountLikes
|
|
114
|
+
*/
|
|
115
|
+
export declare type AccountLikeArray = AccountLike[] | TokenAccount[] | ChildAccount[] | Account[];
|
|
116
|
+
/**
|
|
117
|
+
*
|
|
118
|
+
*/
|
|
119
|
+
export declare type TokenAccountRaw = {
|
|
120
|
+
type: "TokenAccountRaw";
|
|
121
|
+
id: string;
|
|
122
|
+
starred?: boolean;
|
|
123
|
+
parentId: string;
|
|
124
|
+
tokenId: string;
|
|
125
|
+
creationDate?: string;
|
|
126
|
+
operationsCount?: number;
|
|
127
|
+
operations: OperationRaw[];
|
|
128
|
+
pendingOperations: OperationRaw[];
|
|
129
|
+
balance: string;
|
|
130
|
+
spendableBalance?: string;
|
|
131
|
+
compoundBalance?: string;
|
|
132
|
+
balanceHistoryCache?: BalanceHistoryCache;
|
|
133
|
+
swapHistory?: SwapOperationRaw[];
|
|
134
|
+
approvals?: Array<{
|
|
135
|
+
sender: string;
|
|
136
|
+
value: string;
|
|
137
|
+
}>;
|
|
138
|
+
};
|
|
139
|
+
/**
|
|
140
|
+
*
|
|
141
|
+
*/
|
|
142
|
+
export declare type ChildAccountRaw = {
|
|
143
|
+
type: "ChildAccountRaw";
|
|
144
|
+
id: string;
|
|
145
|
+
name: string;
|
|
146
|
+
starred?: boolean;
|
|
147
|
+
parentId: string;
|
|
148
|
+
currencyId: string;
|
|
149
|
+
address: string;
|
|
150
|
+
creationDate?: string;
|
|
151
|
+
operationsCount?: number;
|
|
152
|
+
operations: OperationRaw[];
|
|
153
|
+
pendingOperations: OperationRaw[];
|
|
154
|
+
balance: string;
|
|
155
|
+
balanceHistoryCache?: BalanceHistoryCache;
|
|
156
|
+
swapHistory?: SwapOperationRaw[];
|
|
157
|
+
};
|
|
158
|
+
/**
|
|
159
|
+
*
|
|
160
|
+
*/
|
|
161
|
+
export declare type AccountRaw = {
|
|
162
|
+
id: string;
|
|
163
|
+
seedIdentifier: string;
|
|
164
|
+
xpub?: string;
|
|
165
|
+
derivationMode: DerivationMode;
|
|
166
|
+
index: number;
|
|
167
|
+
freshAddress: string;
|
|
168
|
+
freshAddressPath: string;
|
|
169
|
+
freshAddresses: Address[];
|
|
170
|
+
name: string;
|
|
171
|
+
starred?: boolean;
|
|
172
|
+
used?: boolean;
|
|
173
|
+
balance: string;
|
|
174
|
+
spendableBalance?: string;
|
|
175
|
+
blockHeight: number;
|
|
176
|
+
creationDate?: string;
|
|
177
|
+
operationsCount?: number;
|
|
178
|
+
currencyId: string;
|
|
179
|
+
operations: OperationRaw[];
|
|
180
|
+
pendingOperations: OperationRaw[];
|
|
181
|
+
unitMagnitude: number;
|
|
182
|
+
lastSyncDate: string;
|
|
183
|
+
endpointConfig?: string | null | undefined;
|
|
184
|
+
subAccounts?: SubAccountRaw[];
|
|
185
|
+
balanceHistoryCache?: BalanceHistoryCache;
|
|
186
|
+
swapHistory?: SwapOperationRaw[];
|
|
187
|
+
syncHash?: string;
|
|
188
|
+
nfts?: NFTRaw[];
|
|
189
|
+
};
|
|
190
|
+
/**
|
|
191
|
+
*
|
|
192
|
+
*/
|
|
193
|
+
export declare type SubAccountRaw = TokenAccountRaw | ChildAccountRaw;
|
|
194
|
+
/**
|
|
195
|
+
*
|
|
196
|
+
*/
|
|
197
|
+
export declare type AccountRawLike = AccountRaw | SubAccountRaw;
|
|
198
|
+
//# sourceMappingURL=account.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"account.d.ts","sourceRoot":"","sources":["../src/account.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EACV,cAAc,EACd,aAAa,EACb,IAAI,EACL,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC3D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,KAAK,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AAC9D,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAGzC,oBAAY,aAAa,GAAG,MAAM,GAAG,KAAK,GAAG,MAAM,CAAC;AAKpD,oBAAY,mBAAmB,GAAG,MAAM,CACtC,aAAa,EACb,uBAAuB,CACxB,CAAC;AAOF,oBAAY,uBAAuB,GAAG;IACpC,UAAU,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IACtC,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB,CAAC;AAE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c,EAAE,MAAM,CAAC;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,cAAc,CAAC;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,MAAM,CAAC;IACrB,gBAAgB,EAAE,MAAM,CAAC;IACzB,cAAc,EAAE,OAAO,EAAE,CAAC;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,eAAe,CAAC,EAAE,MAAM,CAAC;IAGzB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,YAAY,EAAE,CAAC;IAC3B,iBAAiB,EAAE,YAAY,EAAE,CAAC;IAClC,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAC3C,WAAW,CAAC,EAAE,aAAa,EAAE,CAAC;IAC9B,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;IAC1C,WAAW,CAAC,EAAE,gBAAgB,EAAE,CAAC;IACjC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;CACjB,CAAC;AACF;;GAEG;AACH,oBAAY,aAAa,GAAG,eAAe,GAAG,eAAe,CAAC;AAC9D;;GAEG;AACH,oBAAY,cAAc,GAAG,UAAU,GAAG,aAAa,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"account.js","sourceRoot":"","sources":["../src/account.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { BigNumber } from "bignumber.js";
|
|
2
|
+
import type { Observable } from "rxjs";
|
|
3
|
+
import type { CryptoCurrency } from "@ledgerhq/types-cryptoassets";
|
|
4
|
+
import type { AccountLike, Account, AccountRaw } from "./account";
|
|
5
|
+
import type { TransactionStatus, SignOperationEvent, SignedOperation } from "./transaction";
|
|
6
|
+
import type { Operation } from "./operation";
|
|
7
|
+
import type { DerivationMode } from "./derivation";
|
|
8
|
+
import type { SyncConfig } from "./pagination";
|
|
9
|
+
/**
|
|
10
|
+
*
|
|
11
|
+
*/
|
|
12
|
+
export declare type ScanAccountEvent = {
|
|
13
|
+
type: "discovered";
|
|
14
|
+
account: Account;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* more events will come in the future
|
|
18
|
+
*/
|
|
19
|
+
export declare type ScanAccountEventRaw = {
|
|
20
|
+
type: "discovered";
|
|
21
|
+
account: AccountRaw;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* unique identifier of a device. it will depends on the underlying implementation.
|
|
25
|
+
*/
|
|
26
|
+
export declare type DeviceId = string;
|
|
27
|
+
/**
|
|
28
|
+
*
|
|
29
|
+
*/
|
|
30
|
+
export declare type PreloadStrategy = Partial<{
|
|
31
|
+
preloadMaxAge: number;
|
|
32
|
+
}>;
|
|
33
|
+
/**
|
|
34
|
+
*
|
|
35
|
+
*/
|
|
36
|
+
export declare type BroadcastArg0 = {
|
|
37
|
+
account: Account;
|
|
38
|
+
signedOperation: SignedOperation;
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
*
|
|
42
|
+
*/
|
|
43
|
+
export declare type SignOperationArg0<T> = {
|
|
44
|
+
account: Account;
|
|
45
|
+
transaction: T;
|
|
46
|
+
deviceId: DeviceId;
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
*
|
|
50
|
+
*/
|
|
51
|
+
export declare type SignOperationFnSignature<T> = (arg0: SignOperationArg0<T>) => Observable<SignOperationEvent>;
|
|
52
|
+
export declare type BroadcastFnSignature = (arg0: BroadcastArg0) => Promise<Operation>;
|
|
53
|
+
/**
|
|
54
|
+
*
|
|
55
|
+
*/
|
|
56
|
+
export interface CurrencyBridge {
|
|
57
|
+
preload(currency: CryptoCurrency): Promise<Record<string, any>>;
|
|
58
|
+
hydrate(data: unknown, currency: CryptoCurrency): void;
|
|
59
|
+
scanAccounts(arg0: {
|
|
60
|
+
currency: CryptoCurrency;
|
|
61
|
+
deviceId: DeviceId;
|
|
62
|
+
scheme?: DerivationMode | null | undefined;
|
|
63
|
+
syncConfig: SyncConfig;
|
|
64
|
+
preferredNewAccountScheme?: DerivationMode;
|
|
65
|
+
}): Observable<ScanAccountEvent>;
|
|
66
|
+
getPreloadStrategy?: (currency: CryptoCurrency) => PreloadStrategy;
|
|
67
|
+
}
|
|
68
|
+
export interface AccountBridge<T> {
|
|
69
|
+
sync(initialAccount: Account, syncConfig: SyncConfig): Observable<(arg0: Account) => Account>;
|
|
70
|
+
receive(account: Account, arg1: {
|
|
71
|
+
verify?: boolean;
|
|
72
|
+
deviceId: string;
|
|
73
|
+
subAccountId?: string;
|
|
74
|
+
freshAddressIndex?: number;
|
|
75
|
+
}): Observable<{
|
|
76
|
+
address: string;
|
|
77
|
+
path: string;
|
|
78
|
+
}>;
|
|
79
|
+
createTransaction(account: Account): T;
|
|
80
|
+
updateTransaction(t: T, patch: Partial<T>): T;
|
|
81
|
+
prepareTransaction(account: Account, transaction: T): Promise<T>;
|
|
82
|
+
getTransactionStatus(account: Account, transaction: T): Promise<TransactionStatus>;
|
|
83
|
+
estimateMaxSpendable(arg0: {
|
|
84
|
+
account: AccountLike;
|
|
85
|
+
parentAccount?: Account | null | undefined;
|
|
86
|
+
transaction?: T | null | undefined;
|
|
87
|
+
}): Promise<BigNumber>;
|
|
88
|
+
signOperation: SignOperationFnSignature<T>;
|
|
89
|
+
broadcast: BroadcastFnSignature;
|
|
90
|
+
}
|
|
91
|
+
//# sourceMappingURL=bridge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":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,GAAG,CAAC,CAAC;IACvC,iBAAiB,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IAI9C,kBAAkB,CAAC,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IAEjE,oBAAoB,CAClB,OAAO,EAAE,OAAO,EAChB,WAAW,EAAE,CAAC,GACb,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAQ9B,oBAAoB,CAAC,IAAI,EAAE;QACzB,OAAO,EAAE,WAAW,CAAC;QACrB,aAAa,CAAC,EAAE,OAAO,GAAG,IAAI,GAAG,SAAS,CAAC;QAC3C,WAAW,CAAC,EAAE,CAAC,GAAG,IAAI,GAAG,SAAS,CAAC;KACpC,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;IAIvB,aAAa,EAAE,wBAAwB,CAAC,CAAC,CAAC,CAAC;IAG3C,SAAS,EAAE,oBAAoB,CAAC;CACjC"}
|
package/lib-es/bridge.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bridge.js","sourceRoot":"","sources":["../src/bridge.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"derivation.d.ts","sourceRoot":"","sources":["../src/derivation.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,oBAAY,cAAc,GAAG,MAAM,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"derivation.js","sourceRoot":"","sources":["../src/derivation.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from "./derivation";
|
|
2
|
+
export * from "./account";
|
|
3
|
+
export * from "./operation";
|
|
4
|
+
export * from "./portfolio";
|
|
5
|
+
export * from "./transaction";
|
|
6
|
+
export * from "./bridge";
|
|
7
|
+
export * from "./pagination";
|
|
8
|
+
export * from "./nft";
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,OAAO,CAAC"}
|
package/lib-es/index.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from "./derivation";
|
|
2
|
+
export * from "./account";
|
|
3
|
+
export * from "./operation";
|
|
4
|
+
export * from "./portfolio";
|
|
5
|
+
export * from "./transaction";
|
|
6
|
+
export * from "./bridge";
|
|
7
|
+
export * from "./pagination";
|
|
8
|
+
export * from "./nft";
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,OAAO,CAAC"}
|
package/lib-es/nft.d.ts
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type BigNumber from "bignumber.js";
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
*/
|
|
5
|
+
export declare type NFTStandards = "ERC721" | "ERC1155";
|
|
6
|
+
/**
|
|
7
|
+
*
|
|
8
|
+
*/
|
|
9
|
+
export declare type NFT = {
|
|
10
|
+
id: string;
|
|
11
|
+
tokenId: string;
|
|
12
|
+
amount: BigNumber;
|
|
13
|
+
collection: {
|
|
14
|
+
contract: string;
|
|
15
|
+
standard: NFTStandards | string;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
*
|
|
20
|
+
*/
|
|
21
|
+
export declare type NFTRaw = Omit<NFT, "amount"> & {
|
|
22
|
+
amount: string;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
*
|
|
26
|
+
*/
|
|
27
|
+
export declare type NFTMetadataLinksProviders = "opensea" | "rarible" | "etherscan";
|
|
28
|
+
/**
|
|
29
|
+
*
|
|
30
|
+
*/
|
|
31
|
+
export declare type NFTMetadataResponse = {
|
|
32
|
+
status: 200 | 404 | 500;
|
|
33
|
+
result?: {
|
|
34
|
+
contract: string;
|
|
35
|
+
tokenId: string;
|
|
36
|
+
tokenName: string | null;
|
|
37
|
+
nftName: string | null;
|
|
38
|
+
media: string | null;
|
|
39
|
+
description: string | null;
|
|
40
|
+
properties: Array<Record<"key" | "value", string>>;
|
|
41
|
+
links: Record<NFTMetadataLinksProviders, string>;
|
|
42
|
+
} | null;
|
|
43
|
+
};
|
|
44
|
+
//# sourceMappingURL=nft.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nft.d.ts","sourceRoot":"","sources":["../src/nft.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,cAAc,CAAC;AAE1C;;GAEG;AACH,oBAAY,YAAY,GAAG,QAAQ,GAAG,SAAS,CAAC;AAEhD;;GAEG;AACH,oBAAY,GAAG,GAAG;IAEhB,EAAE,EAAE,MAAM,CAAC;IAEX,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,SAAS,CAAC;IAClB,UAAU,EAAE;QAGV,QAAQ,EAAE,MAAM,CAAC;QAEjB,QAAQ,EAAE,YAAY,GAAG,MAAM,CAAC;KACjC,CAAC;CACH,CAAC;AAEF;;GAEG;AACH,oBAAY,MAAM,GAAG,IAAI,CAAC,GAAG,EAAE,QAAQ,CAAC,GAAG;IACzC,MAAM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