@ledgerhq/coin-hedera 1.1.0-nightly.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/.turbo/turbo-build.log +4 -0
- package/.unimportedrc.json +33 -0
- package/CHANGELOG.md +15 -0
- package/LICENSE.txt +21 -0
- package/jest.config.js +9 -0
- package/lib/api/mirror.d.ts +10 -0
- package/lib/api/mirror.d.ts.map +1 -0
- package/lib/api/mirror.js +135 -0
- package/lib/api/mirror.js.map +1 -0
- package/lib/api/network.d.ts +15 -0
- package/lib/api/network.d.ts.map +1 -0
- package/lib/api/network.js +63 -0
- package/lib/api/network.js.map +1 -0
- package/lib/bridge/broadcast.d.ts +4 -0
- package/lib/bridge/broadcast.d.ts.map +1 -0
- package/lib/bridge/broadcast.js +27 -0
- package/lib/bridge/broadcast.js.map +1 -0
- package/lib/bridge/buildOptimisticOperation.d.ts +7 -0
- package/lib/bridge/buildOptimisticOperation.d.ts.map +1 -0
- package/lib/bridge/buildOptimisticOperation.js +33 -0
- package/lib/bridge/buildOptimisticOperation.js.map +1 -0
- package/lib/bridge/createTransaction.d.ts +9 -0
- package/lib/bridge/createTransaction.d.ts.map +1 -0
- package/lib/bridge/createTransaction.js +20 -0
- package/lib/bridge/createTransaction.js.map +1 -0
- package/lib/bridge/estimateMaxSpendable.d.ts +4 -0
- package/lib/bridge/estimateMaxSpendable.d.ts.map +1 -0
- package/lib/bridge/estimateMaxSpendable.js +32 -0
- package/lib/bridge/estimateMaxSpendable.js.map +1 -0
- package/lib/bridge/getTransactionStatus.d.ts +4 -0
- package/lib/bridge/getTransactionStatus.d.ts.map +1 -0
- package/lib/bridge/getTransactionStatus.js +54 -0
- package/lib/bridge/getTransactionStatus.js.map +1 -0
- package/lib/bridge/index.d.ts +8 -0
- package/lib/bridge/index.d.ts.map +1 -0
- package/lib/bridge/index.js +55 -0
- package/lib/bridge/index.js.map +1 -0
- package/lib/bridge/js-estimateMaxSpendable.integration.test.d.ts +2 -0
- package/lib/bridge/js-estimateMaxSpendable.integration.test.d.ts.map +1 -0
- package/lib/bridge/js-estimateMaxSpendable.integration.test.js +72 -0
- package/lib/bridge/js-estimateMaxSpendable.integration.test.js.map +1 -0
- package/lib/bridge/js-transaction.test.d.ts +2 -0
- package/lib/bridge/js-transaction.test.d.ts.map +1 -0
- package/lib/bridge/js-transaction.test.js +88 -0
- package/lib/bridge/js-transaction.test.js.map +1 -0
- package/lib/bridge/prepareTransaction.d.ts +13 -0
- package/lib/bridge/prepareTransaction.d.ts.map +1 -0
- package/lib/bridge/prepareTransaction.js +31 -0
- package/lib/bridge/prepareTransaction.js.map +1 -0
- package/lib/bridge/receive.d.ts +6 -0
- package/lib/bridge/receive.d.ts.map +1 -0
- package/lib/bridge/receive.js +50 -0
- package/lib/bridge/receive.js.map +1 -0
- package/lib/bridge/signOperation.d.ts +5 -0
- package/lib/bridge/signOperation.d.ts.map +1 -0
- package/lib/bridge/signOperation.js +59 -0
- package/lib/bridge/signOperation.js.map +1 -0
- package/lib/bridge/synchronisation.d.ts +5 -0
- package/lib/bridge/synchronisation.d.ts.map +1 -0
- package/lib/bridge/synchronisation.js +77 -0
- package/lib/bridge/synchronisation.js.map +1 -0
- package/lib/bridge/transaction.test.d.ts +2 -0
- package/lib/bridge/transaction.test.d.ts.map +1 -0
- package/lib/bridge/transaction.test.js +78 -0
- package/lib/bridge/transaction.test.js.map +1 -0
- package/lib/bridge/utils.d.ts +14 -0
- package/lib/bridge/utils.d.ts.map +1 -0
- package/lib/bridge/utils.integration.test.d.ts +2 -0
- package/lib/bridge/utils.integration.test.d.ts.map +1 -0
- package/lib/bridge/utils.integration.test.js +95 -0
- package/lib/bridge/utils.integration.test.js.map +1 -0
- package/lib/bridge/utils.js +66 -0
- package/lib/bridge/utils.js.map +1 -0
- package/lib/deviceTransactionConfig.d.ts +11 -0
- package/lib/deviceTransactionConfig.d.ts.map +1 -0
- package/lib/deviceTransactionConfig.js +39 -0
- package/lib/deviceTransactionConfig.js.map +1 -0
- package/lib/errors.d.ts +4 -0
- package/lib/errors.d.ts.map +1 -0
- package/lib/errors.js +6 -0
- package/lib/errors.js.map +1 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +6 -0
- package/lib/index.js.map +1 -0
- package/lib/signer/getAddress.d.ts +6 -0
- package/lib/signer/getAddress.d.ts.map +1 -0
- package/lib/signer/getAddress.js +26 -0
- package/lib/signer/getAddress.js.map +1 -0
- package/lib/signer/index.d.ts +3 -0
- package/lib/signer/index.d.ts.map +1 -0
- package/lib/signer/index.js +8 -0
- package/lib/signer/index.js.map +1 -0
- package/lib/test/bot-specs.d.ts +7 -0
- package/lib/test/bot-specs.d.ts.map +1 -0
- package/lib/test/bot-specs.js +103 -0
- package/lib/test/bot-specs.js.map +1 -0
- package/lib/test/bridgeDatasetTest.d.ts +5 -0
- package/lib/test/bridgeDatasetTest.d.ts.map +1 -0
- package/lib/test/bridgeDatasetTest.js +104 -0
- package/lib/test/bridgeDatasetTest.js.map +1 -0
- package/lib/test/cli.d.ts +15 -0
- package/lib/test/cli.d.ts.map +1 -0
- package/lib/test/cli.js +27 -0
- package/lib/test/cli.js.map +1 -0
- package/lib/test/index.d.ts +6 -0
- package/lib/test/index.d.ts.map +1 -0
- package/lib/test/index.js +26 -0
- package/lib/test/index.js.map +1 -0
- package/lib/test/speculos-deviceActions.d.ts +4 -0
- package/lib/test/speculos-deviceActions.d.ts.map +1 -0
- package/lib/test/speculos-deviceActions.js +65 -0
- package/lib/test/speculos-deviceActions.js.map +1 -0
- package/lib/transaction.d.ts +15 -0
- package/lib/transaction.d.ts.map +1 -0
- package/lib/transaction.js +34 -0
- package/lib/transaction.js.map +1 -0
- package/lib/types/bridge.d.ts +24 -0
- package/lib/types/bridge.d.ts.map +1 -0
- package/lib/types/bridge.js +3 -0
- package/lib/types/bridge.js.map +1 -0
- package/lib/types/index.d.ts +3 -0
- package/lib/types/index.d.ts.map +1 -0
- package/lib/types/index.js +19 -0
- package/lib/types/index.js.map +1 -0
- package/lib/types/signer.d.ts +7 -0
- package/lib/types/signer.d.ts.map +1 -0
- package/lib/types/signer.js +3 -0
- package/lib/types/signer.js.map +1 -0
- package/lib-es/api/mirror.d.ts +10 -0
- package/lib-es/api/mirror.d.ts.map +1 -0
- package/lib-es/api/mirror.js +127 -0
- package/lib-es/api/mirror.js.map +1 -0
- package/lib-es/api/network.d.ts +15 -0
- package/lib-es/api/network.d.ts.map +1 -0
- package/lib-es/api/network.js +57 -0
- package/lib-es/api/network.js.map +1 -0
- package/lib-es/bridge/broadcast.d.ts +4 -0
- package/lib-es/bridge/broadcast.d.ts.map +1 -0
- package/lib-es/bridge/broadcast.js +23 -0
- package/lib-es/bridge/broadcast.js.map +1 -0
- package/lib-es/bridge/buildOptimisticOperation.d.ts +7 -0
- package/lib-es/bridge/buildOptimisticOperation.d.ts.map +1 -0
- package/lib-es/bridge/buildOptimisticOperation.js +29 -0
- package/lib-es/bridge/buildOptimisticOperation.js.map +1 -0
- package/lib-es/bridge/createTransaction.d.ts +9 -0
- package/lib-es/bridge/createTransaction.d.ts.map +1 -0
- package/lib-es/bridge/createTransaction.js +13 -0
- package/lib-es/bridge/createTransaction.js.map +1 -0
- package/lib-es/bridge/estimateMaxSpendable.d.ts +4 -0
- package/lib-es/bridge/estimateMaxSpendable.d.ts.map +1 -0
- package/lib-es/bridge/estimateMaxSpendable.js +25 -0
- package/lib-es/bridge/estimateMaxSpendable.js.map +1 -0
- package/lib-es/bridge/getTransactionStatus.d.ts +4 -0
- package/lib-es/bridge/getTransactionStatus.d.ts.map +1 -0
- package/lib-es/bridge/getTransactionStatus.js +50 -0
- package/lib-es/bridge/getTransactionStatus.js.map +1 -0
- package/lib-es/bridge/index.d.ts +8 -0
- package/lib-es/bridge/index.d.ts.map +1 -0
- package/lib-es/bridge/index.js +48 -0
- package/lib-es/bridge/index.js.map +1 -0
- package/lib-es/bridge/js-estimateMaxSpendable.integration.test.d.ts +2 -0
- package/lib-es/bridge/js-estimateMaxSpendable.integration.test.d.ts.map +1 -0
- package/lib-es/bridge/js-estimateMaxSpendable.integration.test.js +67 -0
- package/lib-es/bridge/js-estimateMaxSpendable.integration.test.js.map +1 -0
- package/lib-es/bridge/js-transaction.test.d.ts +2 -0
- package/lib-es/bridge/js-transaction.test.d.ts.map +1 -0
- package/lib-es/bridge/js-transaction.test.js +83 -0
- package/lib-es/bridge/js-transaction.test.js.map +1 -0
- package/lib-es/bridge/prepareTransaction.d.ts +13 -0
- package/lib-es/bridge/prepareTransaction.d.ts.map +1 -0
- package/lib-es/bridge/prepareTransaction.js +27 -0
- package/lib-es/bridge/prepareTransaction.js.map +1 -0
- package/lib-es/bridge/receive.d.ts +6 -0
- package/lib-es/bridge/receive.d.ts.map +1 -0
- package/lib-es/bridge/receive.js +46 -0
- package/lib-es/bridge/receive.js.map +1 -0
- package/lib-es/bridge/signOperation.d.ts +5 -0
- package/lib-es/bridge/signOperation.d.ts.map +1 -0
- package/lib-es/bridge/signOperation.js +55 -0
- package/lib-es/bridge/signOperation.js.map +1 -0
- package/lib-es/bridge/synchronisation.d.ts +5 -0
- package/lib-es/bridge/synchronisation.d.ts.map +1 -0
- package/lib-es/bridge/synchronisation.js +69 -0
- package/lib-es/bridge/synchronisation.js.map +1 -0
- package/lib-es/bridge/transaction.test.d.ts +2 -0
- package/lib-es/bridge/transaction.test.d.ts.map +1 -0
- package/lib-es/bridge/transaction.test.js +73 -0
- package/lib-es/bridge/transaction.test.js.map +1 -0
- package/lib-es/bridge/utils.d.ts +14 -0
- package/lib-es/bridge/utils.d.ts.map +1 -0
- package/lib-es/bridge/utils.integration.test.d.ts +2 -0
- package/lib-es/bridge/utils.integration.test.d.ts.map +1 -0
- package/lib-es/bridge/utils.integration.test.js +90 -0
- package/lib-es/bridge/utils.integration.test.js.map +1 -0
- package/lib-es/bridge/utils.js +57 -0
- package/lib-es/bridge/utils.js.map +1 -0
- package/lib-es/deviceTransactionConfig.d.ts +11 -0
- package/lib-es/deviceTransactionConfig.d.ts.map +1 -0
- package/lib-es/deviceTransactionConfig.js +37 -0
- package/lib-es/deviceTransactionConfig.js.map +1 -0
- package/lib-es/errors.d.ts +4 -0
- package/lib-es/errors.d.ts.map +1 -0
- package/lib-es/errors.js +3 -0
- package/lib-es/errors.js.map +1 -0
- package/lib-es/index.d.ts +2 -0
- package/lib-es/index.d.ts.map +1 -0
- package/lib-es/index.js +2 -0
- package/lib-es/index.js.map +1 -0
- package/lib-es/signer/getAddress.d.ts +6 -0
- package/lib-es/signer/getAddress.d.ts.map +1 -0
- package/lib-es/signer/getAddress.js +24 -0
- package/lib-es/signer/getAddress.js.map +1 -0
- package/lib-es/signer/index.d.ts +3 -0
- package/lib-es/signer/index.d.ts.map +1 -0
- package/lib-es/signer/index.js +3 -0
- package/lib-es/signer/index.js.map +1 -0
- package/lib-es/test/bot-specs.d.ts +7 -0
- package/lib-es/test/bot-specs.d.ts.map +1 -0
- package/lib-es/test/bot-specs.js +98 -0
- package/lib-es/test/bot-specs.js.map +1 -0
- package/lib-es/test/bridgeDatasetTest.d.ts +5 -0
- package/lib-es/test/bridgeDatasetTest.d.ts.map +1 -0
- package/lib-es/test/bridgeDatasetTest.js +101 -0
- package/lib-es/test/bridgeDatasetTest.js.map +1 -0
- package/lib-es/test/cli.d.ts +15 -0
- package/lib-es/test/cli.d.ts.map +1 -0
- package/lib-es/test/cli.js +21 -0
- package/lib-es/test/cli.js.map +1 -0
- package/lib-es/test/index.d.ts +6 -0
- package/lib-es/test/index.d.ts.map +1 -0
- package/lib-es/test/index.js +6 -0
- package/lib-es/test/index.js.map +1 -0
- package/lib-es/test/speculos-deviceActions.d.ts +4 -0
- package/lib-es/test/speculos-deviceActions.d.ts.map +1 -0
- package/lib-es/test/speculos-deviceActions.js +62 -0
- package/lib-es/test/speculos-deviceActions.js.map +1 -0
- package/lib-es/transaction.d.ts +15 -0
- package/lib-es/transaction.d.ts.map +1 -0
- package/lib-es/transaction.js +28 -0
- package/lib-es/transaction.js.map +1 -0
- package/lib-es/types/bridge.d.ts +24 -0
- package/lib-es/types/bridge.d.ts.map +1 -0
- package/lib-es/types/bridge.js +2 -0
- package/lib-es/types/bridge.js.map +1 -0
- package/lib-es/types/index.d.ts +3 -0
- package/lib-es/types/index.d.ts.map +1 -0
- package/lib-es/types/index.js +3 -0
- package/lib-es/types/index.js.map +1 -0
- package/lib-es/types/signer.d.ts +7 -0
- package/lib-es/types/signer.d.ts.map +1 -0
- package/lib-es/types/signer.js +2 -0
- package/lib-es/types/signer.js.map +1 -0
- package/package.json +112 -0
- package/src/api/mirror.ts +146 -0
- package/src/api/network.ts +76 -0
- package/src/bridge/broadcast.ts +20 -0
- package/src/bridge/buildOptimisticOperation.ts +29 -0
- package/src/bridge/createTransaction.ts +15 -0
- package/src/bridge/estimateMaxSpendable.ts +25 -0
- package/src/bridge/getTransactionStatus.ts +55 -0
- package/src/bridge/index.ts +60 -0
- package/src/bridge/js-estimateMaxSpendable.integration.test.ts +63 -0
- package/src/bridge/js-transaction.test.ts +84 -0
- package/src/bridge/prepareTransaction.ts +24 -0
- package/src/bridge/receive.ts +44 -0
- package/src/bridge/signOperation.ts +58 -0
- package/src/bridge/synchronisation.ts +82 -0
- package/src/bridge/transaction.test.ts +83 -0
- package/src/bridge/utils.integration.test.ts +94 -0
- package/src/bridge/utils.ts +61 -0
- package/src/deviceTransactionConfig.ts +53 -0
- package/src/errors.ts +3 -0
- package/src/index.ts +1 -0
- package/src/signer/getAddress.ts +21 -0
- package/src/signer/index.ts +3 -0
- package/src/test/bot-specs.ts +139 -0
- package/src/test/bridgeDatasetTest.ts +110 -0
- package/src/test/cli.ts +36 -0
- package/src/test/index.ts +6 -0
- package/src/test/speculos-deviceActions.ts +67 -0
- package/src/transaction.ts +49 -0
- package/src/types/bridge.ts +36 -0
- package/src/types/index.ts +2 -0
- package/src/types/signer.ts +7 -0
- package/tsconfig.json +14 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"entry": [
|
|
3
|
+
"src/account.ts",
|
|
4
|
+
"src/bridge/index.ts",
|
|
5
|
+
"src/test/cli.ts",
|
|
6
|
+
"src/deviceTransactionConfig.ts",
|
|
7
|
+
"src/errors.ts",
|
|
8
|
+
"src/hw-getAddress.ts",
|
|
9
|
+
"src/specs.ts",
|
|
10
|
+
"src/transaction.ts"
|
|
11
|
+
],
|
|
12
|
+
"ignorePatterns": [
|
|
13
|
+
"**/node_modules/**",
|
|
14
|
+
"**/*.fixture.ts",
|
|
15
|
+
"**/*.mock.ts",
|
|
16
|
+
"**/*.test.{js,jsx,ts,tsx}"
|
|
17
|
+
],
|
|
18
|
+
"ignoreUnresolved": [],
|
|
19
|
+
"ignoreUnimported": [
|
|
20
|
+
"src/index.ts",
|
|
21
|
+
"src/test/bot-specs.ts",
|
|
22
|
+
"src/test/bridgeDatasetTest.ts",
|
|
23
|
+
"src/test/cli.ts",
|
|
24
|
+
"src/test/index.ts",
|
|
25
|
+
"src/test/speculos-deviceActions.ts"
|
|
26
|
+
],
|
|
27
|
+
"ignoreUnused": [
|
|
28
|
+
"@ledgerhq/devices",
|
|
29
|
+
"expect",
|
|
30
|
+
"lodash",
|
|
31
|
+
"rxjs"
|
|
32
|
+
]
|
|
33
|
+
}
|
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# @ledgerhq/coin-hedera
|
|
2
|
+
|
|
3
|
+
## 1.1.0-nightly.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#8118](https://github.com/LedgerHQ/ledger-live/pull/8118) [`17d52ce`](https://github.com/LedgerHQ/ledger-live/commit/17d52ce37dd642a1d01aac2268e1b9623dc8a260) Thanks [@Wozacosta](https://github.com/Wozacosta)! - Creation of coin-hedera package
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [[`2013b0f`](https://github.com/LedgerHQ/ledger-live/commit/2013b0f23d7f5bccff58dfd93fd45333194b8ae0), [`2013b0f`](https://github.com/LedgerHQ/ledger-live/commit/2013b0f23d7f5bccff58dfd93fd45333194b8ae0), [`a40c525`](https://github.com/LedgerHQ/ledger-live/commit/a40c5256b80574aaaf17651d195832668b9796f5)]:
|
|
12
|
+
- @ledgerhq/coin-framework@0.19.0-nightly.3
|
|
13
|
+
- @ledgerhq/cryptoassets@13.7.0-nightly.4
|
|
14
|
+
- @ledgerhq/types-live@6.53.0-nightly.2
|
|
15
|
+
- @ledgerhq/live-countervalues@0.2.12-nightly.3
|
package/LICENSE.txt
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2017-present Ledger https://www.ledger.com/
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|
package/jest.config.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */
|
|
2
|
+
module.exports = {
|
|
3
|
+
collectCoverageFrom: ["src/**/*.ts"],
|
|
4
|
+
coverageDirectory: "coverage",
|
|
5
|
+
preset: "ts-jest",
|
|
6
|
+
testEnvironment: "node",
|
|
7
|
+
testPathIgnorePatterns: ["lib/", "lib-es/", ".integration.test.ts"],
|
|
8
|
+
modulePathIgnorePatterns: ["__tests__/fixtures"],
|
|
9
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { AccountId } from "@hashgraph/sdk";
|
|
2
|
+
import { Operation } from "@ledgerhq/types-live";
|
|
3
|
+
import BigNumber from "bignumber.js";
|
|
4
|
+
export interface Account {
|
|
5
|
+
accountId: AccountId;
|
|
6
|
+
balance: BigNumber;
|
|
7
|
+
}
|
|
8
|
+
export declare function getAccountsForPublicKey(publicKey: string): Promise<Account[]>;
|
|
9
|
+
export declare function getOperationsForAccount(ledgerAccountId: string, address: string, latestOperationTimestamp: string): Promise<Operation[]>;
|
|
10
|
+
//# sourceMappingURL=mirror.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mirror.d.ts","sourceRoot":"","sources":["../../src/api/mirror.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,OAAO,EAAE,SAAS,EAAiB,MAAM,sBAAsB,CAAC;AAChE,OAAO,SAAS,MAAM,cAAc,CAAC;AAerC,MAAM,WAAW,OAAO;IACtB,SAAS,EAAE,SAAS,CAAC;IACrB,OAAO,EAAE,SAAS,CAAC;CACpB;AAED,wBAAsB,uBAAuB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC,CAqBnF;AAcD,wBAAsB,uBAAuB,CAC3C,eAAe,EAAE,MAAM,EACvB,OAAO,EAAE,MAAM,EACf,wBAAwB,EAAE,MAAM,GAC/B,OAAO,CAAC,SAAS,EAAE,CAAC,CAmFtB"}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.getOperationsForAccount = exports.getAccountsForPublicKey = void 0;
|
|
16
|
+
const sdk_1 = require("@hashgraph/sdk");
|
|
17
|
+
const network_1 = __importDefault(require("@ledgerhq/live-network/network"));
|
|
18
|
+
const bignumber_js_1 = __importDefault(require("bignumber.js"));
|
|
19
|
+
const live_env_1 = require("@ledgerhq/live-env");
|
|
20
|
+
const operation_1 = require("@ledgerhq/coin-framework/operation");
|
|
21
|
+
const network_2 = require("./network");
|
|
22
|
+
const utils_1 = require("../bridge/utils");
|
|
23
|
+
const getMirrorApiUrl = () => (0, live_env_1.getEnv)("API_HEDERA_MIRROR");
|
|
24
|
+
const fetch = (path) => {
|
|
25
|
+
return (0, network_1.default)({
|
|
26
|
+
method: "GET",
|
|
27
|
+
url: `${getMirrorApiUrl()}${path}`,
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
function getAccountsForPublicKey(publicKey) {
|
|
31
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
32
|
+
let r;
|
|
33
|
+
try {
|
|
34
|
+
r = yield fetch(`/api/v1/accounts?account.publicKey=${publicKey}&balance=false`);
|
|
35
|
+
}
|
|
36
|
+
catch (e) {
|
|
37
|
+
if (e.name === "LedgerAPI4xx")
|
|
38
|
+
return [];
|
|
39
|
+
throw e;
|
|
40
|
+
}
|
|
41
|
+
const rawAccounts = r.data.accounts;
|
|
42
|
+
const accounts = [];
|
|
43
|
+
for (const raw of rawAccounts) {
|
|
44
|
+
const accountBalance = yield (0, network_2.getAccountBalance)(raw.account);
|
|
45
|
+
accounts.push({
|
|
46
|
+
accountId: sdk_1.AccountId.fromString(raw.account),
|
|
47
|
+
balance: accountBalance.balance,
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
return accounts;
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
exports.getAccountsForPublicKey = getAccountsForPublicKey;
|
|
54
|
+
function getOperationsForAccount(ledgerAccountId, address, latestOperationTimestamp) {
|
|
55
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
56
|
+
const operations = [];
|
|
57
|
+
let r = yield fetch(`/api/v1/transactions?account.id=${address}×tamp=gt:${latestOperationTimestamp}`);
|
|
58
|
+
const rawOperations = r.data.transactions;
|
|
59
|
+
while (r.data.links.next) {
|
|
60
|
+
r = yield fetch(r.data.links.next);
|
|
61
|
+
const newOperations = r.data.transactions;
|
|
62
|
+
rawOperations.push(...newOperations);
|
|
63
|
+
}
|
|
64
|
+
for (const raw of rawOperations) {
|
|
65
|
+
const { consensus_timestamp } = raw;
|
|
66
|
+
const timestamp = new Date(parseInt(consensus_timestamp.split(".")[0], 10) * 1000);
|
|
67
|
+
const senders = [];
|
|
68
|
+
const recipients = [];
|
|
69
|
+
const fee = new bignumber_js_1.default(raw.charged_tx_fee);
|
|
70
|
+
let value = new bignumber_js_1.default(0);
|
|
71
|
+
let type = "NONE";
|
|
72
|
+
for (let i = raw.transfers.length - 1; i >= 0; i--) {
|
|
73
|
+
const transfer = raw.transfers[i];
|
|
74
|
+
const amount = new bignumber_js_1.default(transfer.amount);
|
|
75
|
+
const account = sdk_1.AccountId.fromString(transfer.account);
|
|
76
|
+
if (transfer.account === address) {
|
|
77
|
+
if (amount.isNegative()) {
|
|
78
|
+
value = amount.abs();
|
|
79
|
+
type = "OUT";
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
value = amount;
|
|
83
|
+
type = "IN";
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
if (amount.isNegative()) {
|
|
87
|
+
senders.push(transfer.account);
|
|
88
|
+
}
|
|
89
|
+
else {
|
|
90
|
+
if (account.shard.eq(0) && account.realm.eq(0)) {
|
|
91
|
+
if (account.num.lt(100)) {
|
|
92
|
+
// account is a node, only add to list if we have none
|
|
93
|
+
if (recipients.length === 0) {
|
|
94
|
+
recipients.push(transfer.account);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
else if (account.num.lt(1000)) {
|
|
98
|
+
// account is a system account that is not a node
|
|
99
|
+
// do NOT add
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
recipients.push(transfer.account);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
else {
|
|
106
|
+
recipients.push(transfer.account);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
// NOTE: earlier addresses are the "fee" addresses
|
|
111
|
+
recipients.reverse();
|
|
112
|
+
senders.reverse();
|
|
113
|
+
const hash = (0, utils_1.base64ToUrlSafeBase64)(raw.transaction_hash);
|
|
114
|
+
operations.push({
|
|
115
|
+
value,
|
|
116
|
+
date: timestamp,
|
|
117
|
+
// NOTE: there are no "blocks" in hedera
|
|
118
|
+
// Set a value just so that it's considered confirmed according to isConfirmedOperation
|
|
119
|
+
blockHeight: 5,
|
|
120
|
+
blockHash: null,
|
|
121
|
+
extra: { consensusTimestamp: consensus_timestamp },
|
|
122
|
+
fee,
|
|
123
|
+
hash,
|
|
124
|
+
recipients,
|
|
125
|
+
senders,
|
|
126
|
+
accountId: ledgerAccountId,
|
|
127
|
+
id: (0, operation_1.encodeOperationId)(ledgerAccountId, hash, type),
|
|
128
|
+
type,
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
return operations;
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
exports.getOperationsForAccount = getOperationsForAccount;
|
|
135
|
+
//# sourceMappingURL=mirror.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mirror.js","sourceRoot":"","sources":["../../src/api/mirror.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,wCAA2C;AAC3C,6EAAqD;AAErD,gEAAqC;AACrC,iDAA4C;AAC5C,kEAAuE;AACvE,uCAA8C;AAC9C,2CAAwD;AAExD,MAAM,eAAe,GAAG,GAAW,EAAE,CAAC,IAAA,iBAAM,EAAC,mBAAmB,CAAC,CAAC;AAElE,MAAM,KAAK,GAAG,CAAC,IAAY,EAAE,EAAE;IAC7B,OAAO,IAAA,iBAAO,EAAC;QACb,MAAM,EAAE,KAAK;QACb,GAAG,EAAE,GAAG,eAAe,EAAE,GAAG,IAAI,EAAE;KACnC,CAAC,CAAC;AACL,CAAC,CAAC;AAOF,SAAsB,uBAAuB,CAAC,SAAiB;;QAC7D,IAAI,CAAC,CAAC;QACN,IAAI,CAAC;YACH,CAAC,GAAG,MAAM,KAAK,CAAC,sCAAsC,SAAS,gBAAgB,CAAC,CAAC;QACnF,CAAC;QAAC,OAAO,CAAM,EAAE,CAAC;YAChB,IAAI,CAAC,CAAC,IAAI,KAAK,cAAc;gBAAE,OAAO,EAAE,CAAC;YACzC,MAAM,CAAC,CAAC;QACV,CAAC;QACD,MAAM,WAAW,GAAG,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC;QACpC,MAAM,QAAQ,GAAc,EAAE,CAA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AAU,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;4BACpC,CAAC;wBACH,CAAC;6BAAM,IAAI,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;4BAChC,iDAAiD;4BACjD,aAAa;wBACf,CAAC;6BAAM,CAAC;4BACN,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;wBACpC,CAAC;oBACH,CAAC;yBAAM,CAAC;wBACN,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;oBACpC,CAAC;gBACH,CAAC;YACH,CAAC;YAED,kDAAkD;YAClD,UAAU,CAAC,OAAO,EAAE,CAAC;YACrB,OAAO,CAAC,OAAO,EAAE,CAAC;YAElB,MAAM,IAAI,GAAG,IAAA,6BAAqB,EAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;YAEzD,UAAU,CAAC,IAAI,CAAC;gBACd,KAAK;gBACL,IAAI,EAAE,SAAS;gBACf,wCAAwC;gBACxC,uFAAuF;gBACvF,WAAW,EAAE,CAAC;gBACd,SAAS,EAAE,IAAI;gBACf,KAAK,EAAE,EAAE,kBAAkB,EAAE,mBAAmB,EAAE;gBAClD,GAAG;gBACH,IAAI;gBACJ,UAAU;gBACV,OAAO;gBACP,SAAS,EAAE,eAAe;gBAC1B,EAAE,EAAE,IAAA,6BAAiB,EAAC,eAAe,EAAE,IAAI,EAAE,IAAI,CAAC;gBAClD,IAAI;aACL,CAAC,CAAC;QACL,CAAC;QAED,OAAO,UAAU,CAAC;IACpB,CAAC;CAAA;AAvFD,0DAuFC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import BigNumber from "bignumber.js";
|
|
2
|
+
import type { Transaction as HederaTransaction, TransactionResponse } from "@hashgraph/sdk";
|
|
3
|
+
import { TransferTransaction } from "@hashgraph/sdk";
|
|
4
|
+
import { Account } from "@ledgerhq/types-live";
|
|
5
|
+
import { Transaction } from "../types";
|
|
6
|
+
export declare function broadcastTransaction(transaction: HederaTransaction): Promise<TransactionResponse>;
|
|
7
|
+
export declare function buildUnsignedTransaction({ account, transaction, }: {
|
|
8
|
+
account: Account;
|
|
9
|
+
transaction: Transaction;
|
|
10
|
+
}): Promise<TransferTransaction>;
|
|
11
|
+
export interface AccountBalance {
|
|
12
|
+
balance: BigNumber;
|
|
13
|
+
}
|
|
14
|
+
export declare function getAccountBalance(address: string): Promise<AccountBalance>;
|
|
15
|
+
//# sourceMappingURL=network.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"network.d.ts","sourceRoot":"","sources":["../../src/api/network.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,cAAc,CAAC;AACrC,OAAO,KAAK,EAAE,WAAW,IAAI,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAC5F,OAAO,EAEL,mBAAmB,EAMpB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAE/C,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAEvC,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,iBAAiB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAEjG;AAED,wBAAsB,wBAAwB,CAAC,EAC7C,OAAO,EACP,WAAW,GACZ,EAAE;IACD,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,EAAE,WAAW,CAAC;CAC1B,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAW/B;AAED,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,SAAS,CAAC;CACpB;AAED,wBAAsB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,CAehF"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.getAccountBalance = exports.buildUnsignedTransaction = exports.broadcastTransaction = void 0;
|
|
13
|
+
const sdk_1 = require("@hashgraph/sdk");
|
|
14
|
+
const errors_1 = require("../errors");
|
|
15
|
+
function broadcastTransaction(transaction) {
|
|
16
|
+
return transaction.execute(getClient());
|
|
17
|
+
}
|
|
18
|
+
exports.broadcastTransaction = broadcastTransaction;
|
|
19
|
+
function buildUnsignedTransaction(_a) {
|
|
20
|
+
return __awaiter(this, arguments, void 0, function* ({ account, transaction, }) {
|
|
21
|
+
var _b;
|
|
22
|
+
const hbarAmount = sdk_1.Hbar.fromTinybars(transaction.amount);
|
|
23
|
+
const accountId = account.freshAddress;
|
|
24
|
+
return new sdk_1.TransferTransaction()
|
|
25
|
+
.setNodeAccountIds([new sdk_1.AccountId(3)])
|
|
26
|
+
.setTransactionId(sdk_1.TransactionId.generate(accountId))
|
|
27
|
+
.setTransactionMemo((_b = transaction.memo) !== null && _b !== void 0 ? _b : "")
|
|
28
|
+
.addHbarTransfer(accountId, hbarAmount.negated())
|
|
29
|
+
.addHbarTransfer(transaction.recipient, hbarAmount)
|
|
30
|
+
.freeze();
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
exports.buildUnsignedTransaction = buildUnsignedTransaction;
|
|
34
|
+
function getAccountBalance(address) {
|
|
35
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
36
|
+
const accountId = sdk_1.AccountId.fromString(address);
|
|
37
|
+
let accountBalance;
|
|
38
|
+
try {
|
|
39
|
+
accountBalance = yield new sdk_1.AccountBalanceQuery({
|
|
40
|
+
accountId,
|
|
41
|
+
}).execute(getBalanceClient());
|
|
42
|
+
}
|
|
43
|
+
catch (_a) {
|
|
44
|
+
throw new errors_1.HederaAddAccountError();
|
|
45
|
+
}
|
|
46
|
+
return {
|
|
47
|
+
balance: accountBalance.hbars.to(sdk_1.HbarUnit.Tinybar),
|
|
48
|
+
};
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
exports.getAccountBalance = getAccountBalance;
|
|
52
|
+
let _hederaClient = null;
|
|
53
|
+
let _hederaBalanceClient = null;
|
|
54
|
+
function getClient() {
|
|
55
|
+
_hederaClient !== null && _hederaClient !== void 0 ? _hederaClient : (_hederaClient = sdk_1.Client.forMainnet().setMaxNodesPerTransaction(1));
|
|
56
|
+
//_hederaClient.setNetwork({ mainnet: "https://hedera.coin.ledger.com" });
|
|
57
|
+
return _hederaClient;
|
|
58
|
+
}
|
|
59
|
+
function getBalanceClient() {
|
|
60
|
+
_hederaBalanceClient !== null && _hederaBalanceClient !== void 0 ? _hederaBalanceClient : (_hederaBalanceClient = sdk_1.Client.forMainnet());
|
|
61
|
+
return _hederaBalanceClient;
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=network.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"network.js","sourceRoot":"","sources":["../../src/api/network.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,wCAQwB;AAExB,sCAAkD;AAGlD,SAAgB,oBAAoB,CAAC,WAA8B;IACjE,OAAO,WAAW,CAAC,OAAO,CAAC,SAAS,EAAE,CAAC,CAAC;AAC1C,CAAC;AAFD,oDAEC;AAED,SAAsB,wBAAwB;yDAAC,EAC7C,OAAO,EACP,WAAW,GAIZ;;QACC,MAAM,UAAU,GAAG,UAAI,CAAC,YAAY,CAAC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AgB;IACvB,oBAAoB,aAApB,oBAAoB,cAApB,oBAAoB,IAApB,oBAAoB,GAAK,YAAM,CAAC,UAAU,EAAE,EAAC;IAE7C,OAAO,oBAAoB,CAAC;AAC9B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"broadcast.d.ts","sourceRoot":"","sources":["../../src/bridge/broadcast.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAGrD,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAGvC,eAAO,MAAM,SAAS,EAAE,aAAa,CAAC,WAAW,CAAC,CAAC,WAAW,CAY7D,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.broadcast = void 0;
|
|
13
|
+
const sdk_1 = require("@hashgraph/sdk");
|
|
14
|
+
const operation_1 = require("@ledgerhq/coin-framework/operation");
|
|
15
|
+
const utils_1 = require("./utils");
|
|
16
|
+
const network_1 = require("../api/network");
|
|
17
|
+
const broadcast = (_a) => __awaiter(void 0, [_a], void 0, function* ({ signedOperation }) {
|
|
18
|
+
const { signature, operation } = signedOperation;
|
|
19
|
+
// NOTE: expecting a serialized transaction to be signedOperation.signature (in hex)
|
|
20
|
+
const hederaTransaction = sdk_1.Transaction.fromBytes(Buffer.from(signature, "base64"));
|
|
21
|
+
const response = yield (0, network_1.broadcastTransaction)(hederaTransaction);
|
|
22
|
+
const base64Hash = Buffer.from(response.transactionHash).toString("base64");
|
|
23
|
+
const base64HashUrlSafe = (0, utils_1.base64ToUrlSafeBase64)(base64Hash);
|
|
24
|
+
return (0, operation_1.patchOperationWithHash)(operation, base64HashUrlSafe);
|
|
25
|
+
});
|
|
26
|
+
exports.broadcast = broadcast;
|
|
27
|
+
//# sourceMappingURL=broadcast.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"broadcast.js","sourceRoot":"","sources":["../../src/bridge/broadcast.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,wCAAqE;AAErE,kEAA4E;AAC5E,mCAAgD;AAEhD,4CAAsD;AAE/C,MAAM,SAAS,GAA4C,KAA4B,EAAE,4CAAvB,EAAE,eAAe,EAAE;IAC1F,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,GAAG,eAAe,CAAC;IAEjD,oFAAoF;IACpF,MAAM,iBAAiB,GAAG,iBAAoB,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC,CAAC;IAE3F,MAAM,QAAQ,GAAG,MAAM,IAAA,8BAAoB,EAAC,iBAAiB,CAAC,CAAC;IAE/D,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;IAC5E,MAAM,iBAAiB,GAAG,IAAA,6BAAqB,EAAC,UAAU,CAAC,CAAC;IAE5D,OAAO,IAAA,kCAAsB,EAAC,SAAS,EAAE,iBAAiB,CAAC,CAAC;AAC9D,CAAC,CAAA,CAAC;AAZW,QAAA,SAAS,aAYpB"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Account, Operation } from "@ledgerhq/types-live";
|
|
2
|
+
import { Transaction } from "../types";
|
|
3
|
+
export declare const buildOptimisticOperation: ({ account, transaction, }: {
|
|
4
|
+
account: Account;
|
|
5
|
+
transaction: Transaction;
|
|
6
|
+
}) => Promise<Operation>;
|
|
7
|
+
//# sourceMappingURL=buildOptimisticOperation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildOptimisticOperation.d.ts","sourceRoot":"","sources":["../../src/bridge/buildOptimisticOperation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAG1D,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAEvC,eAAO,MAAM,wBAAwB;aAI1B,OAAO;iBACH,WAAW;MACtB,QAAQ,SAAS,CAiBpB,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.buildOptimisticOperation = void 0;
|
|
13
|
+
const operation_1 = require("@ledgerhq/coin-framework/operation");
|
|
14
|
+
const utils_1 = require("./utils");
|
|
15
|
+
const buildOptimisticOperation = (_a) => __awaiter(void 0, [_a], void 0, function* ({ account, transaction, }) {
|
|
16
|
+
const operation = {
|
|
17
|
+
id: (0, operation_1.encodeOperationId)(account.id, "", "OUT"),
|
|
18
|
+
hash: "",
|
|
19
|
+
type: "OUT",
|
|
20
|
+
value: transaction.amount,
|
|
21
|
+
fee: yield (0, utils_1.getEstimatedFees)(account),
|
|
22
|
+
blockHash: null,
|
|
23
|
+
blockHeight: null,
|
|
24
|
+
senders: [account.freshAddress.toString()],
|
|
25
|
+
recipients: [transaction.recipient],
|
|
26
|
+
accountId: account.id,
|
|
27
|
+
date: new Date(),
|
|
28
|
+
extra: {},
|
|
29
|
+
};
|
|
30
|
+
return operation;
|
|
31
|
+
});
|
|
32
|
+
exports.buildOptimisticOperation = buildOptimisticOperation;
|
|
33
|
+
//# sourceMappingURL=buildOptimisticOperation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildOptimisticOperation.js","sourceRoot":"","sources":["../../src/bridge/buildOptimisticOperation.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,kEAAuE;AACvE,mCAA2C;AAGpC,MAAM,wBAAwB,GAAG,KAMjB,EAAE,4CANsB,EAC7C,OAAO,EACP,WAAW,GAIZ;IACC,MAAM,SAAS,GAAc;QAC3B,EAAE,EAAE,IAAA,6BAAiB,EAAC,OAAO,CAAC,EAAE,EAAE,EAAE,EAAE,KAAK,CAAC;QAC5C,IAAI,EAAE,EAAE;QACR,IAAI,EAAE,KAAK;QACX,KAAK,EAAE,WAAW,CAAC,MAAM;QACzB,GAAG,EAAE,MAAM,IAAA,wBAAgB,EAAC,OAAO,CAAC;QACpC,SAAS,EAAE,IAAI;QACf,WAAW,EAAE,IAAI;QACjB,OAAO,EAAE,CAAC,OAAO,CAAC,YAAY,CAAC,QAAQ,EAAE,CAAC;QAC1C,UAAU,EAAE,CAAC,WAAW,CAAC,SAAS,CAAC;QACnC,SAAS,EAAE,OAAO,CAAC,EAAE;QACrB,IAAI,EAAE,IAAI,IAAI,EAAE;QAChB,KAAK,EAAE,EAAE;KACV,CAAC;IAEF,OAAO,SAAS,CAAC;AACnB,CAAC,CAAA,CAAC;AAvBW,QAAA,wBAAwB,4BAuBnC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { AccountBridge } from "@ledgerhq/types-live";
|
|
2
|
+
import { Transaction } from "../types";
|
|
3
|
+
/**
|
|
4
|
+
* Creates an empty transaction.
|
|
5
|
+
*
|
|
6
|
+
* @returns {Transaction}
|
|
7
|
+
*/
|
|
8
|
+
export declare const createTransaction: AccountBridge<Transaction>["createTransaction"];
|
|
9
|
+
//# sourceMappingURL=createTransaction.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createTransaction.d.ts","sourceRoot":"","sources":["../../src/bridge/createTransaction.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAEvC;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,EAAE,aAAa,CAAC,WAAW,CAAC,CAAC,mBAAmB,CAK5E,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.createTransaction = void 0;
|
|
7
|
+
const bignumber_js_1 = __importDefault(require("bignumber.js"));
|
|
8
|
+
/**
|
|
9
|
+
* Creates an empty transaction.
|
|
10
|
+
*
|
|
11
|
+
* @returns {Transaction}
|
|
12
|
+
*/
|
|
13
|
+
const createTransaction = () => ({
|
|
14
|
+
family: "hedera",
|
|
15
|
+
amount: new bignumber_js_1.default(0),
|
|
16
|
+
recipient: "",
|
|
17
|
+
useAllAmount: false,
|
|
18
|
+
});
|
|
19
|
+
exports.createTransaction = createTransaction;
|
|
20
|
+
//# sourceMappingURL=createTransaction.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createTransaction.js","sourceRoot":"","sources":["../../src/bridge/createTransaction.ts"],"names":[],"mappings":";;;;;;AAAA,gEAAqC;AAIrC;;;;GAIG;AACI,MAAM,iBAAiB,GAAoD,GAAG,EAAE,CAAC,CAAC;IACvF,MAAM,EAAE,QAAQ;IAChB,MAAM,EAAE,IAAI,sBAAS,CAAC,CAAC,CAAC;IACxB,SAAS,EAAE,EAAE;IACb,YAAY,EAAE,KAAK;CACpB,CAAC,CAAC;AALU,QAAA,iBAAiB,qBAK3B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"estimateMaxSpendable.d.ts","sourceRoot":"","sources":["../../src/bridge/estimateMaxSpendable.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAE1D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAG5C,eAAO,MAAM,oBAAoB,EAAE,aAAa,CAAC,WAAW,CAAC,CAAC,sBAAsB,CAkBnF,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.estimateMaxSpendable = void 0;
|
|
16
|
+
const bignumber_js_1 = __importDefault(require("bignumber.js"));
|
|
17
|
+
const index_1 = require("@ledgerhq/coin-framework/account/index");
|
|
18
|
+
const utils_1 = require("./utils");
|
|
19
|
+
const estimateMaxSpendable = (_a) => __awaiter(void 0, [_a], void 0, function* ({ account, parentAccount, }) {
|
|
20
|
+
const balance = account.balance;
|
|
21
|
+
const mainAccount = (0, index_1.getMainAccount)(account, parentAccount);
|
|
22
|
+
const estimatedFees = yield (0, utils_1.getEstimatedFees)(mainAccount);
|
|
23
|
+
let maxSpendable = balance.minus(estimatedFees);
|
|
24
|
+
// set max spendable to 0 if negative
|
|
25
|
+
// for cases where the user's account balance is smaller than the estimated fee
|
|
26
|
+
if (maxSpendable.isLessThan(0)) {
|
|
27
|
+
maxSpendable = new bignumber_js_1.default(0);
|
|
28
|
+
}
|
|
29
|
+
return Promise.resolve(maxSpendable);
|
|
30
|
+
});
|
|
31
|
+
exports.estimateMaxSpendable = estimateMaxSpendable;
|
|
32
|
+
//# sourceMappingURL=estimateMaxSpendable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"estimateMaxSpendable.js","sourceRoot":"","sources":["../../src/bridge/estimateMaxSpendable.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,gEAAqC;AAErC,kEAAwE;AAExE,mCAA2C;AAEpC,MAAM,oBAAoB,GAAuD,KAGrF,EAAE,4CAH0F,EAC7F,OAAO,EACP,aAAa,GACd;IACC,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;IAEhC,MAAM,WAAW,GAAG,IAAA,sBAAc,EAAC,OAAO,EAAE,aAAa,CAAC,CAAC;IAC3D,MAAM,aAAa,GAAG,MAAM,IAAA,wBAAgB,EAAC,WAAW,CAAC,CAAC;IAE1D,IAAI,YAAY,GAAG,OAAO,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;IAEhD,qCAAqC;IACrC,+EAA+E;IAC/E,IAAI,YAAY,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC;QAC/B,YAAY,GAAG,IAAI,sBAAS,CAAC,CAAC,CAAC,CAAC;IAClC,CAAC;IAED,OAAO,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;AACvC,CAAC,CAAA,CAAC;AAlBW,QAAA,oBAAoB,wBAkB/B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getTransactionStatus.d.ts","sourceRoot":"","sources":["../../src/bridge/getTransactionStatus.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAE1D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAE5C,eAAO,MAAM,oBAAoB,EAAE,aAAa,CAAC,WAAW,CAAC,CAAC,sBAAsB,CA0CnF,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.getTransactionStatus = void 0;
|
|
13
|
+
const errors_1 = require("@ledgerhq/errors");
|
|
14
|
+
const sdk_1 = require("@hashgraph/sdk");
|
|
15
|
+
const utils_1 = require("./utils");
|
|
16
|
+
const getTransactionStatus = (account, transaction) => __awaiter(void 0, void 0, void 0, function* () {
|
|
17
|
+
const errors = {};
|
|
18
|
+
if (!transaction.recipient || transaction.recipient.length === 0) {
|
|
19
|
+
errors.recipient = new errors_1.RecipientRequired("");
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
if (account.freshAddress === transaction.recipient) {
|
|
23
|
+
errors.recipient = new errors_1.InvalidAddressBecauseDestinationIsAlsoSource("");
|
|
24
|
+
}
|
|
25
|
+
try {
|
|
26
|
+
sdk_1.AccountId.fromString(transaction.recipient);
|
|
27
|
+
}
|
|
28
|
+
catch (err) {
|
|
29
|
+
errors.recipient = new errors_1.InvalidAddress("", {
|
|
30
|
+
currencyName: account.currency.name,
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
const { amount, totalSpent } = yield (0, utils_1.calculateAmount)({
|
|
35
|
+
transaction,
|
|
36
|
+
account,
|
|
37
|
+
});
|
|
38
|
+
if (transaction.amount.eq(0) && !transaction.useAllAmount) {
|
|
39
|
+
errors.amount = new errors_1.AmountRequired();
|
|
40
|
+
}
|
|
41
|
+
else if (account.balance.isLessThan(totalSpent)) {
|
|
42
|
+
errors.amount = new errors_1.NotEnoughBalance("");
|
|
43
|
+
}
|
|
44
|
+
const estimatedFees = yield (0, utils_1.getEstimatedFees)(account);
|
|
45
|
+
return {
|
|
46
|
+
amount,
|
|
47
|
+
errors,
|
|
48
|
+
estimatedFees,
|
|
49
|
+
totalSpent,
|
|
50
|
+
warnings: {},
|
|
51
|
+
};
|
|
52
|
+
});
|
|
53
|
+
exports.getTransactionStatus = getTransactionStatus;
|
|
54
|
+
//# sourceMappingURL=getTransactionStatus.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getTransactionStatus.js","sourceRoot":"","sources":["../../src/bridge/getTransactionStatus.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAM0B;AAC1B,wCAA2C;AAE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AO;QACL,MAAM;QACN,MAAM;QACN,aAAa;QACb,UAAU;QACV,QAAQ,EAAE,EAAE;KACb,CAAC;AACJ,CAAC,CAAA,CAAC;AA1CW,QAAA,oBAAoB,wBA0C/B"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { SignerContext } from "@ledgerhq/coin-framework/signer";
|
|
2
|
+
import type { Account, AccountBridge, CurrencyBridge } from "@ledgerhq/types-live";
|
|
3
|
+
import type { Transaction, HederaSigner } from "../types";
|
|
4
|
+
export declare function createBridges(signerContext: SignerContext<HederaSigner>): {
|
|
5
|
+
currencyBridge: CurrencyBridge;
|
|
6
|
+
accountBridge: AccountBridge<Transaction, Account, import("@ledgerhq/types-live").TransactionStatusCommon, import("@ledgerhq/types-live").AccountRaw>;
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/bridge/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,KAAK,EAAE,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEnF,OAAO,KAAK,EAAE,WAAW,EAAqB,YAAY,EAAE,MAAM,UAAU,CAAC;AAgD7E,wBAAgB,aAAa,CAAC,aAAa,EAAE,aAAa,CAAC,YAAY,CAAC;;;EAKvE"}
|