@ledgerhq/ledger-wallet-provider-evm 0.0.0-develop-20260916004725
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/dist/EvmBlockchainProvider.d.ts +38 -0
- package/dist/EvmBlockchainProvider.d.ts.map +1 -0
- package/dist/EvmWalletProvider.d.ts +18 -0
- package/dist/EvmWalletProvider.d.ts.map +1 -0
- package/dist/LedgerEIP1193Provider.d.ts +90 -0
- package/dist/LedgerEIP1193Provider.d.ts.map +1 -0
- package/dist/device-action/SignPersonalMessageFlowDeviceAction.d.ts +14 -0
- package/dist/device-action/SignPersonalMessageFlowDeviceAction.d.ts.map +1 -0
- package/dist/device-action/SignPersonalMessageFlowDeviceActionTypes.d.ts +33 -0
- package/dist/device-action/SignPersonalMessageFlowDeviceActionTypes.d.ts.map +1 -0
- package/dist/device-action/__tests__/SignPersonalMessageFlowDeviceAction.mock.d.ts +12 -0
- package/dist/device-action/__tests__/SignPersonalMessageFlowDeviceAction.mock.d.ts.map +1 -0
- package/dist/device-action/__tests__/SignPersonalMessageFlowDeviceAction.utils.d.ts +9 -0
- package/dist/device-action/__tests__/SignPersonalMessageFlowDeviceAction.utils.d.ts.map +1 -0
- package/dist/di/evmProviderModule.d.ts +9 -0
- package/dist/di/evmProviderModule.d.ts.map +1 -0
- package/dist/di/evmProviderModuleTypes.d.ts +15 -0
- package/dist/di/evmProviderModuleTypes.d.ts.map +1 -0
- package/dist/gas-fee/DefaultGasFeeEstimationService.d.ts +15 -0
- package/dist/gas-fee/DefaultGasFeeEstimationService.d.ts.map +1 -0
- package/dist/gas-fee/GasFeeEstimationService.d.ts +6 -0
- package/dist/gas-fee/GasFeeEstimationService.d.ts.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1924 -0
- package/dist/model/EIPTypes.d.ts +105 -0
- package/dist/model/EIPTypes.d.ts.map +1 -0
- package/dist/model/EvmSignedResult.d.ts +14 -0
- package/dist/model/EvmSignedResult.d.ts.map +1 -0
- package/dist/model/GetAddress.d.ts +5 -0
- package/dist/model/GetAddress.d.ts.map +1 -0
- package/dist/model/SignPersonalMessageParams.d.ts +3 -0
- package/dist/model/SignPersonalMessageParams.d.ts.map +1 -0
- package/dist/model/SignRawTransactionParams.d.ts +7 -0
- package/dist/model/SignRawTransactionParams.d.ts.map +1 -0
- package/dist/model/SignTransactionParams.d.ts +19 -0
- package/dist/model/SignTransactionParams.d.ts.map +1 -0
- package/dist/model/SignTypedMessageParams.d.ts +4 -0
- package/dist/model/SignTypedMessageParams.d.ts.map +1 -0
- package/dist/transaction/TransactionHelper.d.ts +8 -0
- package/dist/transaction/TransactionHelper.d.ts.map +1 -0
- package/dist/use-case/BroadcastTransaction.d.ts +13 -0
- package/dist/use-case/BroadcastTransaction.d.ts.map +1 -0
- package/dist/use-case/BuildContextModule.d.ts +11 -0
- package/dist/use-case/BuildContextModule.d.ts.map +1 -0
- package/dist/use-case/BuildEthSigner.d.ts +15 -0
- package/dist/use-case/BuildEthSigner.d.ts.map +1 -0
- package/dist/use-case/SignPersonalMessageUseCase.d.ts +16 -0
- package/dist/use-case/SignPersonalMessageUseCase.d.ts.map +1 -0
- package/dist/use-case/SignRawTransaction.d.ts +19 -0
- package/dist/use-case/SignRawTransaction.d.ts.map +1 -0
- package/dist/use-case/SignTransaction.d.ts +17 -0
- package/dist/use-case/SignTransaction.d.ts.map +1 -0
- package/dist/use-case/SignTypedData.d.ts +17 -0
- package/dist/use-case/SignTypedData.d.ts.map +1 -0
- package/dist/utils/chainUtils.d.ts +10 -0
- package/dist/utils/chainUtils.d.ts.map +1 -0
- package/dist/utils/derivationUtils.d.ts +3 -0
- package/dist/utils/derivationUtils.d.ts.map +1 -0
- package/dist/utils/isBlockingRequestMethod.d.ts +2 -0
- package/dist/utils/isBlockingRequestMethod.d.ts.map +1 -0
- package/dist/utils/resolveRpcRoute.d.ts +20 -0
- package/dist/utils/resolveRpcRoute.d.ts.map +1 -0
- package/dist/utils/supportedChains.d.ts +15 -0
- package/dist/utils/supportedChains.d.ts.map +1 -0
- package/dist/utils/supportedRpcMethods.d.ts +17 -0
- package/dist/utils/supportedRpcMethods.d.ts.map +1 -0
- package/package.json +44 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright 2024-present Ledger
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { BlockchainConfig, BlockchainProvider, BlockchainProviderFactory, CoreFacade, CurrencyDescriptor, ProviderAccount } from '@ledgerhq/ledger-wallet-provider-core';
|
|
2
|
+
import { EVM_FAMILY } from './utils/chainUtils';
|
|
3
|
+
/**
|
|
4
|
+
* EVM {@link BlockchainProvider}: entry point for the EVM family.
|
|
5
|
+
*
|
|
6
|
+
* Owns a self-contained Inversify container that binds the host
|
|
7
|
+
* {@link CoreFacade} and the per-provider {@link BlockchainConfig} as constants,
|
|
8
|
+
* then wires every EVM sign-flow collaborator on top of them. Nothing outside
|
|
9
|
+
* this package is required, which keeps the module a candidate for extraction.
|
|
10
|
+
*/
|
|
11
|
+
export declare class EvmBlockchainProvider implements BlockchainProvider<typeof EVM_FAMILY> {
|
|
12
|
+
private readonly core;
|
|
13
|
+
readonly dappConfig: BlockchainConfig;
|
|
14
|
+
readonly family: BlockchainFamily;
|
|
15
|
+
private readonly container;
|
|
16
|
+
private eip1193Provider?;
|
|
17
|
+
private walletProvider?;
|
|
18
|
+
constructor(core: CoreFacade, dappConfig: BlockchainConfig);
|
|
19
|
+
injectWalletProviders(): void;
|
|
20
|
+
disconnect(): Promise<void>;
|
|
21
|
+
setSelectedAccount(account: ProviderAccount | undefined): void;
|
|
22
|
+
setNetwork(chainId: number): void;
|
|
23
|
+
describeCurrency(currencyId: string): CurrencyDescriptor | undefined;
|
|
24
|
+
describeNetwork(networkId: string): CurrencyDescriptor | undefined;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Pre-built factory for EVM. Pass directly into
|
|
28
|
+
* `blockchainProviderFactories` on {@link LedgerButtonCore} options.
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```ts
|
|
32
|
+
* initializeLedgerProvider({
|
|
33
|
+
* blockchainProviderFactories: [evmBlockchainProviderFactory],
|
|
34
|
+
* });
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
export declare const evmBlockchainProviderFactory: BlockchainProviderFactory<typeof EVM_FAMILY>;
|
|
38
|
+
//# sourceMappingURL=EvmBlockchainProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EvmBlockchainProvider.d.ts","sourceRoot":"","sources":["../src/EvmBlockchainProvider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAC;AAC9E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAChF,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,uCAAuC,CAAC;AACvF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uCAAuC,CAAC;AACxE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAChF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AAW7E,OAAO,EAGL,UAAU,EACX,MAAM,oBAAoB,CAAC;AAI5B;;;;;;;GAOG;AACH,qBAAa,qBAAsB,YAAW,kBAAkB,CAC9D,OAAO,UAAU,CAClB;IAQG,OAAO,CAAC,QAAQ,CAAC,IAAI;aACL,UAAU,EAAE,gBAAgB;IAR9C,SAAgB,MAAM,mBAAc;IAEpC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAY;IACtC,OAAO,CAAC,eAAe,CAAC,CAAwB;IAChD,OAAO,CAAC,cAAc,CAAC,CAAoB;gBAGxB,IAAI,EAAE,UAAU,EACjB,UAAU,EAAE,gBAAgB;IAY9C,qBAAqB,IAAI,IAAI;IAuBvB,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAIjC,kBAAkB,CAAC,OAAO,EAAE,eAAe,GAAG,SAAS,GAAG,IAAI;IAI9D,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAIjC,gBAAgB,CAAC,UAAU,EAAE,MAAM,GAAG,kBAAkB,GAAG,SAAS;IAIpE,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,kBAAkB,GAAG,SAAS;CAGnE;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,4BAA4B,EAAE,yBAAyB,CAClE,OAAO,UAAU,CAKlB,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { BlockchainFamily, WalletProvider } from '@ledgerhq/ledger-wallet-provider-core';
|
|
2
|
+
import { EIP1193Provider } from './model/EIPTypes';
|
|
3
|
+
/**
|
|
4
|
+
* EVM {@link WalletProvider}: handles EIP-6963 discovery (announce +
|
|
5
|
+
* `requestProvider` listener) and returns a teardown.
|
|
6
|
+
*
|
|
7
|
+
* Wraps the {@link EIP1193Provider} instance created by
|
|
8
|
+
* {@link EvmBlockchainProvider} and announces it to dApps.
|
|
9
|
+
*/
|
|
10
|
+
export declare class EvmWalletProvider implements WalletProvider {
|
|
11
|
+
private readonly eip1193Provider;
|
|
12
|
+
readonly family: BlockchainFamily;
|
|
13
|
+
constructor(eip1193Provider: EIP1193Provider);
|
|
14
|
+
init(): () => void;
|
|
15
|
+
private resolveIcon;
|
|
16
|
+
private generateUuid;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=EvmWalletProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EvmWalletProvider.d.ts","sourceRoot":"","sources":["../src/EvmWalletProvider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAChB,cAAc,EACf,MAAM,uCAAuC,CAAC;AAE/C,OAAO,KAAK,EAAE,eAAe,EAAuB,MAAM,kBAAkB,CAAC;AAQ7E;;;;;;GAMG;AACH,qBAAa,iBAAkB,YAAW,cAAc;IAG1C,OAAO,CAAC,QAAQ,CAAC,eAAe;IAF5C,SAAgB,MAAM,EAAE,gBAAgB,CAAc;gBAEzB,eAAe,EAAE,eAAe;IAE7D,IAAI,IAAI,MAAM,IAAI;IAwBlB,OAAO,CAAC,WAAW;IAQnB,OAAO,CAAC,YAAY;CAWrB"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { CoreFacade, BlockchainFamily, ProviderAccount, BlockchainRpcMethods } from '@ledgerhq/ledger-wallet-provider-core';
|
|
2
|
+
import { EIP1193Provider, ProviderEvent, RequestArguments, RpcMethods } from './model/EIPTypes';
|
|
3
|
+
import { SignPersonalMessageUseCase } from './use-case/SignPersonalMessageUseCase';
|
|
4
|
+
import { SignRawTransaction } from './use-case/SignRawTransaction';
|
|
5
|
+
import { SignTransaction } from './use-case/SignTransaction';
|
|
6
|
+
import { SignTypedData } from './use-case/SignTypedData';
|
|
7
|
+
/** Lazily resolves the per-dApp RPC routing config (may be undefined). */
|
|
8
|
+
export type RpcMethodsLoader = () => Promise<BlockchainRpcMethods | undefined>;
|
|
9
|
+
/**
|
|
10
|
+
* EVM-owned collaborators the provider needs to run the complete sign flow
|
|
11
|
+
* internally. Supplied as plain constructor arguments (no DI decorators) by
|
|
12
|
+
* {@link EvmBlockchainProvider}, which is built by the EVM factory.
|
|
13
|
+
*/
|
|
14
|
+
export type LedgerEIP1193ProviderDeps = {
|
|
15
|
+
signTransaction: SignTransaction;
|
|
16
|
+
signRawTransaction: SignRawTransaction;
|
|
17
|
+
signTypedData: SignTypedData;
|
|
18
|
+
signPersonalMessage: SignPersonalMessageUseCase;
|
|
19
|
+
};
|
|
20
|
+
export declare class LedgerEIP1193Provider extends EventTarget implements EIP1193Provider {
|
|
21
|
+
private readonly host;
|
|
22
|
+
private readonly deps;
|
|
23
|
+
private readonly loadRpcMethods?;
|
|
24
|
+
readonly family: BlockchainFamily;
|
|
25
|
+
private _isConnected;
|
|
26
|
+
private _selectedAccount;
|
|
27
|
+
private _selectedChainId;
|
|
28
|
+
private _id;
|
|
29
|
+
isLedgerButton: boolean;
|
|
30
|
+
private _inFlight;
|
|
31
|
+
private _rpcMethods?;
|
|
32
|
+
private _rpcMethodsLoaded;
|
|
33
|
+
private _listeners;
|
|
34
|
+
constructor(host: CoreFacade, deps: LedgerEIP1193ProviderDeps, loadRpcMethods?: RpcMethodsLoader | undefined);
|
|
35
|
+
request({ method, params }: RequestArguments): Promise<any>;
|
|
36
|
+
on<TEvent extends keyof ProviderEvent>(eventName: TEvent, listener: (args: ProviderEvent[TEvent]) => void): this;
|
|
37
|
+
removeListener<TEvent extends keyof ProviderEvent>(eventName: TEvent, listener: (args: ProviderEvent[TEvent]) => void): this;
|
|
38
|
+
isConnected(): boolean;
|
|
39
|
+
connect(): Promise<void>;
|
|
40
|
+
disconnect(code?: number, // NOTE: Code here must follow the [CloseEvent.code](https://developer.mozilla.org/en-US/docs/Web/API/CloseEvent#Status_codes) convention
|
|
41
|
+
message?: string, data?: unknown): Promise<void>;
|
|
42
|
+
private clearConnectionState;
|
|
43
|
+
private dispatchDisconnectEvent;
|
|
44
|
+
/**
|
|
45
|
+
* Core pushes the freshly selected account (or `undefined` on disconnect).
|
|
46
|
+
* Emits EIP-1193 `accountsChanged` for switches made directly in the UI.
|
|
47
|
+
*/
|
|
48
|
+
setSelectedAccount(account: ProviderAccount | undefined): void;
|
|
49
|
+
/** Core pushes the active chain id. Emits EIP-1193 `chainChanged`. */
|
|
50
|
+
setNetwork(chainId: number): void;
|
|
51
|
+
private setSelectedChainId;
|
|
52
|
+
private handleAccounts;
|
|
53
|
+
private handleRequestAccounts;
|
|
54
|
+
private handleSignTransaction;
|
|
55
|
+
private handleSignTypedData;
|
|
56
|
+
private handleSignPersonalMessage;
|
|
57
|
+
/**
|
|
58
|
+
* Runs the complete EVM sign flow internally: emits a {@link WalletNavigationIntent}
|
|
59
|
+
* so the UI can render and drive the flow (retry / finish), runs the matching
|
|
60
|
+
* sign use-case, and resolves the dApp-facing promise with the signed result.
|
|
61
|
+
*
|
|
62
|
+
* The promise stays pending across UI retries and only settles when the
|
|
63
|
+
* use-case emits `success` (resolve) or the user closes the modal (reject with
|
|
64
|
+
* a `ModalClosedError`). Each emitted status is forwarded to the UI through
|
|
65
|
+
* the intent's `status$` stream and to broadcasted-transaction tracking.
|
|
66
|
+
*/
|
|
67
|
+
private handleBlockchainRequest;
|
|
68
|
+
private handleSwitchChainId;
|
|
69
|
+
private handleChainId;
|
|
70
|
+
private assertReadyToSign;
|
|
71
|
+
handlers: {
|
|
72
|
+
readonly eth_accounts: (_: unknown, _method: RpcMethods) => Promise<string[]>;
|
|
73
|
+
readonly eth_requestAccounts: (_: unknown, _method: RpcMethods) => Promise<string[]>;
|
|
74
|
+
readonly eth_chainId: (_: unknown) => Promise<string>;
|
|
75
|
+
readonly eth_sendTransaction: (params: unknown[], method: RpcMethods) => Promise<string>;
|
|
76
|
+
readonly eth_signTransaction: (params: unknown[], method: RpcMethods) => Promise<string>;
|
|
77
|
+
readonly eth_signRawTransaction: (params: unknown[], method: RpcMethods) => Promise<string>;
|
|
78
|
+
readonly eth_sign: (params: unknown[], method: RpcMethods) => Promise<string>;
|
|
79
|
+
readonly personal_sign: (params: unknown[], method: RpcMethods) => Promise<string>;
|
|
80
|
+
readonly eth_sendRawTransaction: (params: unknown[], method: RpcMethods) => Promise<string>;
|
|
81
|
+
readonly eth_signTypedData: (params: unknown[], method: RpcMethods) => Promise<string>;
|
|
82
|
+
readonly eth_signTypedData_v4: (params: unknown[], method: RpcMethods) => Promise<string>;
|
|
83
|
+
readonly wallet_switchEthereumChain: (params: unknown[], _method: RpcMethods) => Promise<null>;
|
|
84
|
+
};
|
|
85
|
+
/** Lazily load (once) and cache the per-dApp RPC routing config. */
|
|
86
|
+
private ensureRpcMethods;
|
|
87
|
+
private executeRequest;
|
|
88
|
+
private createError;
|
|
89
|
+
}
|
|
90
|
+
//# sourceMappingURL=LedgerEIP1193Provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LedgerEIP1193Provider.d.ts","sourceRoot":"","sources":["../src/LedgerEIP1193Provider.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { DeviceActionStateMachine, InternalApi, XStateDeviceAction } from '@ledgerhq/device-management-kit';
|
|
2
|
+
import { SignPersonalMessageFlowDAError, SignPersonalMessageFlowDAInput, SignPersonalMessageFlowDAIntermediateValue, SignPersonalMessageFlowDAInternalState, SignPersonalMessageFlowDAOutput } from './SignPersonalMessageFlowDeviceActionTypes';
|
|
3
|
+
export declare class SignPersonalMessageFlowDeviceAction extends XStateDeviceAction<SignPersonalMessageFlowDAOutput, SignPersonalMessageFlowDAInput, SignPersonalMessageFlowDAError, SignPersonalMessageFlowDAIntermediateValue, SignPersonalMessageFlowDAInternalState> {
|
|
4
|
+
makeStateMachine(internalApi: InternalApi): DeviceActionStateMachine<SignPersonalMessageFlowDAOutput, SignPersonalMessageFlowDAInput, SignPersonalMessageFlowDAError, SignPersonalMessageFlowDAIntermediateValue, SignPersonalMessageFlowDAInternalState>;
|
|
5
|
+
private updateIntermediateValue;
|
|
6
|
+
private addOpenAppResultToInternalState;
|
|
7
|
+
private addGetAddressResultToInternalState;
|
|
8
|
+
private addSignResultToInternalState;
|
|
9
|
+
private verifyAddressMatch;
|
|
10
|
+
private normalizeRejectionError;
|
|
11
|
+
private buildOutput;
|
|
12
|
+
private buildSignFlowStatus;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=SignPersonalMessageFlowDeviceAction.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SignPersonalMessageFlowDeviceAction.d.ts","sourceRoot":"","sources":["../../src/device-action/SignPersonalMessageFlowDeviceAction.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,wBAAwB,EAC7B,KAAK,WAAW,EAKhB,kBAAkB,EACnB,MAAM,iCAAiC,CAAC;AAiBzC,OAAO,EACL,KAAK,8BAA8B,EACnC,KAAK,8BAA8B,EACnC,KAAK,0CAA0C,EAC/C,KAAK,sCAAsC,EAC3C,KAAK,+BAA+B,EAErC,MAAM,4CAA4C,CAAC;AAQpD,qBAAa,mCAAoC,SAAQ,kBAAkB,CACzE,+BAA+B,EAC/B,8BAA8B,EAC9B,8BAA8B,EAC9B,0CAA0C,EAC1C,sCAAsC,CACvC;IACC,gBAAgB,CACd,WAAW,EAAE,WAAW,GACvB,wBAAwB,CACzB,+BAA+B,EAC/B,8BAA8B,EAC9B,8BAA8B,EAC9B,0CAA0C,EAC1C,sCAAsC,CACvC;IAqRD,OAAO,CAAC,uBAAuB;IAe/B,OAAO,CAAC,+BAA+B;IAiBvC,OAAO,CAAC,kCAAkC;IAe1C,OAAO,CAAC,4BAA4B;IA6BpC,OAAO,CAAC,kBAAkB;IAkB1B,OAAO,CAAC,uBAAuB;IAe/B,OAAO,CAAC,WAAW;IAQnB,OAAO,CAAC,mBAAmB;CAkB5B"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { ContextModule } from '@ledgerhq/context-module';
|
|
2
|
+
import { DmkError, OpenAppWithDependenciesDAError, OpenAppWithDependenciesDAInput, UnknownDAError, UserInteractionRequired } from '@ledgerhq/device-management-kit';
|
|
3
|
+
import { GetAddressDAError, SignPersonalMessageDAError } from '@ledgerhq/device-signer-kit-ethereum';
|
|
4
|
+
import { IncorrectSeedError, UserRejectedTransactionError, SignFlowStatus, SignType } from '@ledgerhq/ledger-wallet-provider-core';
|
|
5
|
+
export declare enum SignPersonalMessageFlowDAStep {
|
|
6
|
+
OPEN_APP = "open-app",
|
|
7
|
+
GET_ADDRESS = "get-address",
|
|
8
|
+
VERIFY_ADDRESS = "verify-address",
|
|
9
|
+
SIGN = "sign"
|
|
10
|
+
}
|
|
11
|
+
export type SignPersonalMessageFlowDAOutput = {
|
|
12
|
+
readonly signature: string;
|
|
13
|
+
};
|
|
14
|
+
export type SignPersonalMessageFlowDAInput = {
|
|
15
|
+
readonly signType: SignType;
|
|
16
|
+
readonly derivationPath: string;
|
|
17
|
+
readonly message: string | Uint8Array;
|
|
18
|
+
readonly expectedAddress: string;
|
|
19
|
+
readonly openAppInput: OpenAppWithDependenciesDAInput;
|
|
20
|
+
readonly contextModule: ContextModule;
|
|
21
|
+
};
|
|
22
|
+
export type SignPersonalMessageFlowDAError = OpenAppWithDependenciesDAError | GetAddressDAError | SignPersonalMessageDAError | IncorrectSeedError | UserRejectedTransactionError | UnknownDAError;
|
|
23
|
+
export type SignPersonalMessageFlowDAIntermediateValue = {
|
|
24
|
+
readonly requiredUserInteraction: UserInteractionRequired;
|
|
25
|
+
readonly step: SignPersonalMessageFlowDAStep;
|
|
26
|
+
readonly signFlowStatus: SignFlowStatus;
|
|
27
|
+
};
|
|
28
|
+
export type SignPersonalMessageFlowDAInternalState = {
|
|
29
|
+
readonly error: (SignPersonalMessageFlowDAError & DmkError) | null;
|
|
30
|
+
readonly address: string | null;
|
|
31
|
+
readonly signature: string | null;
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=SignPersonalMessageFlowDeviceActionTypes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SignPersonalMessageFlowDeviceActionTypes.d.ts","sourceRoot":"","sources":["../../src/device-action/SignPersonalMessageFlowDeviceActionTypes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,KAAK,EACV,QAAQ,EACR,8BAA8B,EAC9B,8BAA8B,EAC9B,cAAc,EACd,uBAAuB,EACxB,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EACV,iBAAiB,EACjB,0BAA0B,EAC3B,MAAM,sCAAsC,CAAC;AAC9C,OAAO,KAAK,EACV,kBAAkB,EAClB,4BAA4B,EAC7B,MAAM,uCAAuC,CAAC;AAC/C,OAAO,KAAK,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,uCAAuC,CAAC;AAEtF,oBAAY,6BAA6B;IACvC,QAAQ,aAAa;IACrB,WAAW,gBAAgB;IAC3B,cAAc,mBAAmB;IACjC,IAAI,SAAS;CACd;AAED,MAAM,MAAM,+BAA+B,GAAG;IAC5C,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B,CAAC;AAEF,MAAM,MAAM,8BAA8B,GAAG;IAC3C,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC5B,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,UAAU,CAAC;IACtC,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,YAAY,EAAE,8BAA8B,CAAC;IACtD,QAAQ,CAAC,aAAa,EAAE,aAAa,CAAC;CACvC,CAAC;AAEF,MAAM,MAAM,8BAA8B,GACtC,8BAA8B,GAC9B,iBAAiB,GACjB,0BAA0B,GAC1B,kBAAkB,GAClB,4BAA4B,GAC5B,cAAc,CAAC;AAEnB,MAAM,MAAM,0CAA0C,GAAG;IACvD,QAAQ,CAAC,uBAAuB,EAAE,uBAAuB,CAAC;IAC1D,QAAQ,CAAC,IAAI,EAAE,6BAA6B,CAAC;IAC7C,QAAQ,CAAC,cAAc,EAAE,cAAc,CAAC;CACzC,CAAC;AAEF,MAAM,MAAM,sCAAsC,GAAG;IACnD,QAAQ,CAAC,KAAK,EAAE,CAAC,8BAA8B,GAAG,QAAQ,CAAC,GAAG,IAAI,CAAC;IACnE,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CACnC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { InternalApi } from '@ledgerhq/device-management-kit';
|
|
2
|
+
import { Signature } from '@ledgerhq/device-signer-kit-ethereum';
|
|
3
|
+
import { SignPersonalMessageFlowDAInput } from '../SignPersonalMessageFlowDeviceActionTypes';
|
|
4
|
+
export declare function makeInternalApiMock(): InternalApi;
|
|
5
|
+
export declare const VALID_SIGNATURE: Signature;
|
|
6
|
+
export declare const VALID_SIGNATURE_HEX = "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1c";
|
|
7
|
+
export declare const DEFAULT_ADDRESS = "0xabc123";
|
|
8
|
+
export declare const DEFAULT_INPUT: SignPersonalMessageFlowDAInput;
|
|
9
|
+
export declare function setupOpenAppMock(error?: unknown): void;
|
|
10
|
+
export declare function setupGetAddressMock(address?: string, error?: unknown): void;
|
|
11
|
+
export declare function setupSignMessageMock(signature?: Signature, error?: unknown): void;
|
|
12
|
+
//# sourceMappingURL=SignPersonalMessageFlowDeviceAction.mock.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SignPersonalMessageFlowDeviceAction.mock.d.ts","sourceRoot":"","sources":["../../../src/device-action/__tests__/SignPersonalMessageFlowDeviceAction.mock.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,WAAW,EAGjB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAEL,KAAK,SAAS,EAEf,MAAM,sCAAsC,CAAC;AAK9C,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,6CAA6C,CAAC;AAElG,wBAAgB,mBAAmB,IAAI,WAAW,CAmBjD;AAED,eAAO,MAAM,eAAe,EAAE,SAI7B,CAAC;AAEF,eAAO,MAAM,mBAAmB,yIACwG,CAAC;AAEzI,eAAO,MAAM,eAAe,aAAa,CAAC;AAE1C,eAAO,MAAM,aAAa,EAAE,8BAO3B,CAAC;AAEF,wBAAgB,gBAAgB,CAAC,KAAK,CAAC,EAAE,OAAO,GAAG,IAAI,CAoBtD;AAED,wBAAgB,mBAAmB,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO,GAAG,IAAI,CAsB3E;AAED,wBAAgB,oBAAoB,CAClC,SAAS,CAAC,EAAE,SAAS,EACrB,KAAK,CAAC,EAAE,OAAO,GACd,IAAI,CAuBN"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { DeviceActionState } from '@ledgerhq/device-management-kit';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { SignPersonalMessageFlowDAError, SignPersonalMessageFlowDAIntermediateValue, SignPersonalMessageFlowDAOutput } from '../SignPersonalMessageFlowDeviceActionTypes';
|
|
4
|
+
export type SignPersonalMessageFlowDAState = DeviceActionState<SignPersonalMessageFlowDAOutput, SignPersonalMessageFlowDAError, SignPersonalMessageFlowDAIntermediateValue>;
|
|
5
|
+
export declare const executeUntilStep: <T>(targetStep: number, o: Observable<T>) => Promise<{
|
|
6
|
+
steps: T[];
|
|
7
|
+
error?: Error;
|
|
8
|
+
}>;
|
|
9
|
+
//# sourceMappingURL=SignPersonalMessageFlowDeviceAction.utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SignPersonalMessageFlowDeviceAction.utils.d.ts","sourceRoot":"","sources":["../../../src/device-action/__tests__/SignPersonalMessageFlowDeviceAction.utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACzE,OAAO,EAAE,KAAK,UAAU,EAAqB,MAAM,MAAM,CAAC;AAE1D,OAAO,KAAK,EACV,8BAA8B,EAC9B,0CAA0C,EAC1C,+BAA+B,EAChC,MAAM,6CAA6C,CAAC;AAErD,MAAM,MAAM,8BAA8B,GAAG,iBAAiB,CAC5D,+BAA+B,EAC/B,8BAA8B,EAC9B,0CAA0C,CAC3C,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAU,CAAC,EACtC,YAAY,MAAM,EAClB,GAAG,UAAU,CAAC,CAAC,CAAC,KACf,OAAO,CAAC;IAAE,KAAK,EAAE,CAAC,EAAE,CAAC;IAAC,KAAK,CAAC,EAAE,KAAK,CAAA;CAAE,CAyBpC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ContainerModule } from 'inversify';
|
|
2
|
+
/**
|
|
3
|
+
* Local Inversify module for the EVM provider. Loaded into the per-provider
|
|
4
|
+
* container owned by {@link EvmBlockchainProvider}, on top of the
|
|
5
|
+
* {@link evmProviderModuleTypes.CoreFacade} and
|
|
6
|
+
* {@link evmProviderModuleTypes.BlockchainConfig} constants bound there.
|
|
7
|
+
*/
|
|
8
|
+
export declare function evmProviderModule(): ContainerModule;
|
|
9
|
+
//# sourceMappingURL=evmProviderModule.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"evmProviderModule.d.ts","sourceRoot":"","sources":["../../src/di/evmProviderModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAa5C;;;;;GAKG;AACH,wBAAgB,iBAAiB,oBAwBhC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare const evmProviderModuleTypes: {
|
|
2
|
+
/** The host CoreFacade, bound per-instance in the EVM local container. */
|
|
3
|
+
readonly CoreFacade: symbol;
|
|
4
|
+
/** The per-provider BlockchainConfig, bound per-instance in the container. */
|
|
5
|
+
readonly BlockchainConfig: symbol;
|
|
6
|
+
readonly SignTransactionUseCase: symbol;
|
|
7
|
+
readonly SignRawTransactionUseCase: symbol;
|
|
8
|
+
readonly SignTypedDataUseCase: symbol;
|
|
9
|
+
readonly SignPersonalMessageUseCase: symbol;
|
|
10
|
+
readonly BroadcastTransactionUseCase: symbol;
|
|
11
|
+
readonly BuildContextModuleUseCase: symbol;
|
|
12
|
+
readonly BuildEthSignerUseCase: symbol;
|
|
13
|
+
readonly GasFeeEstimationService: symbol;
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=evmProviderModuleTypes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"evmProviderModuleTypes.d.ts","sourceRoot":"","sources":["../../src/di/evmProviderModuleTypes.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,sBAAsB;IACjC,0EAA0E;;IAE1E,8EAA8E;;;;;;;;;;CAUtE,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { CoreFacade, ProviderGasFeeEstimation, ProviderTransactionInfo } from '@ledgerhq/ledger-wallet-provider-core';
|
|
2
|
+
import { GasFeeEstimationService } from './GasFeeEstimationService';
|
|
3
|
+
export declare class DefaultGasFeeEstimationService implements GasFeeEstimationService {
|
|
4
|
+
private readonly core;
|
|
5
|
+
constructor(core: CoreFacade);
|
|
6
|
+
getNonceForTx(tx: ProviderTransactionInfo): Promise<string>;
|
|
7
|
+
getFeesForTransaction(tx: ProviderTransactionInfo): Promise<ProviderGasFeeEstimation>;
|
|
8
|
+
private blockchainFor;
|
|
9
|
+
private getFeesFromRpc;
|
|
10
|
+
getMaxPriorityFeePerGas(tx: ProviderTransactionInfo): Promise<number>;
|
|
11
|
+
getBaseFeePerGas(tx: ProviderTransactionInfo): Promise<number>;
|
|
12
|
+
estimateGas(tx: ProviderTransactionInfo): Promise<number>;
|
|
13
|
+
getNonce(tx: ProviderTransactionInfo): Promise<string | undefined>;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=DefaultGasFeeEstimationService.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DefaultGasFeeEstimationService.d.ts","sourceRoot":"","sources":["../../src/gas-fee/DefaultGasFeeEstimationService.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uCAAuC,CAAC;AAExE,OAAO,KAAK,EACV,wBAAwB,EACxB,uBAAuB,EACxB,MAAM,uCAAuC,CAAC;AAK/C,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAEpE,qBACa,8BAA+B,YAAW,uBAAuB;IAG1E,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE,UAAU;IAG7B,aAAa,CAAC,EAAE,EAAE,uBAAuB,GAAG,OAAO,CAAC,MAAM,CAAC;IAS3D,qBAAqB,CACzB,EAAE,EAAE,uBAAuB,GAC1B,OAAO,CAAC,wBAAwB,CAAC;IAiBpC,OAAO,CAAC,aAAa;YAIP,cAAc;IAqBtB,uBAAuB,CAAC,EAAE,EAAE,uBAAuB,GAAG,OAAO,CAAC,MAAM,CAAC;IAoBrE,gBAAgB,CAAC,EAAE,EAAE,uBAAuB,GAAG,OAAO,CAAC,MAAM,CAAC;IAqB9D,WAAW,CAAC,EAAE,EAAE,uBAAuB,GAAG,OAAO,CAAC,MAAM,CAAC;IAuBzD,QAAQ,CAAC,EAAE,EAAE,uBAAuB,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;CAsBzE"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ProviderGasFeeEstimation, ProviderTransactionInfo } from '@ledgerhq/ledger-wallet-provider-core';
|
|
2
|
+
export interface GasFeeEstimationService {
|
|
3
|
+
getFeesForTransaction(tx: ProviderTransactionInfo): Promise<ProviderGasFeeEstimation>;
|
|
4
|
+
getNonceForTx(tx: ProviderTransactionInfo): Promise<string>;
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=GasFeeEstimationService.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GasFeeEstimationService.d.ts","sourceRoot":"","sources":["../../src/gas-fee/GasFeeEstimationService.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,wBAAwB,EACxB,uBAAuB,EACxB,MAAM,uCAAuC,CAAC;AAE/C,MAAM,WAAW,uBAAuB;IACtC,qBAAqB,CACnB,EAAE,EAAE,uBAAuB,GAC1B,OAAO,CAAC,wBAAwB,CAAC,CAAC;IACrC,aAAa,CAAC,EAAE,EAAE,uBAAuB,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CAC7D"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { evmBlockchainProviderFactory } from './EvmBlockchainProvider';
|
|
2
|
+
export { LedgerEIP1193Provider } from './LedgerEIP1193Provider';
|
|
3
|
+
export * from './model/EIPTypes';
|
|
4
|
+
export type { EvmSignedResult } from './model/EvmSignedResult';
|
|
5
|
+
export { type GetAddressDAState, isGetAddressResult } from './model/GetAddress';
|
|
6
|
+
export { isSignPersonalMessageParams, type SignPersonalMessageParams, } from './model/SignPersonalMessageParams';
|
|
7
|
+
export { isSignRawTransactionParams, type SignRawTransactionParams, } from './model/SignRawTransactionParams';
|
|
8
|
+
export { isSignTransactionParams, type SignTransactionParams, type Transaction, } from './model/SignTransactionParams';
|
|
9
|
+
export { isSignTypedMessageParams, type SignTypedMessageParams, } from './model/SignTypedMessageParams';
|
|
10
|
+
export { isBlockingRequestMethod } from './utils/isBlockingRequestMethod';
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,yBAAyB,CAAC;AACvE,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,cAAc,kBAAkB,CAAC;AACjC,YAAY,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,KAAK,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAChF,OAAO,EACL,2BAA2B,EAC3B,KAAK,yBAAyB,GAC/B,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EACL,0BAA0B,EAC1B,KAAK,wBAAwB,GAC9B,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACL,uBAAuB,EACvB,KAAK,qBAAqB,EAC1B,KAAK,WAAW,GACjB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,wBAAwB,EACxB,KAAK,sBAAsB,GAC5B,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC"}
|