@ledgerhq/wallet-api-simulator 0.4.0 → 0.5.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/lib/test.d.ts +2 -0
- package/lib/test.d.ts.map +1 -0
- package/lib/test.js +20 -0
- package/lib-es/test.d.ts +2 -0
- package/lib-es/test.d.ts.map +1 -0
- package/lib-es/test.js +18 -0
- package/package.json +4 -4
package/lib/test.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test.d.ts","sourceRoot":"","sources":["../src/test.ts"],"names":[],"mappings":""}
|
package/lib/test.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const WalletAPIClient_1 = require("@ledgerhq/wallet-api-client/lib/WalletAPIClient");
|
|
4
|
+
const wallet_api_core_1 = require("@ledgerhq/wallet-api-core");
|
|
5
|
+
const transport_1 = require("./transport");
|
|
6
|
+
async function main() {
|
|
7
|
+
const transport = (0, transport_1.getSimulatorTransport)("standard");
|
|
8
|
+
const client = new WalletAPIClient_1.WalletAPIClient(transport);
|
|
9
|
+
const accounts = await client.listAccounts({ currencyIds: ["ethereum"] });
|
|
10
|
+
const currencies = await client.listCurrencies({ currencyIds: ["ethereum"] });
|
|
11
|
+
const tx = await client.signTransactionAndBroadcast("account-eth-1", (0, wallet_api_core_1.deserializeTransaction)({
|
|
12
|
+
family: "ethereum",
|
|
13
|
+
amount: "12",
|
|
14
|
+
recipient: "0xananas",
|
|
15
|
+
}));
|
|
16
|
+
console.log({ accounts, currencies, tx });
|
|
17
|
+
}
|
|
18
|
+
main()
|
|
19
|
+
.then(() => console.log("done"))
|
|
20
|
+
.catch((err) => console.log(err));
|
package/lib-es/test.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test.d.ts","sourceRoot":"","sources":["../src/test.ts"],"names":[],"mappings":""}
|
package/lib-es/test.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { WalletAPIClient } from "@ledgerhq/wallet-api-client/lib/WalletAPIClient";
|
|
2
|
+
import { deserializeTransaction } from "@ledgerhq/wallet-api-core";
|
|
3
|
+
import { getSimulatorTransport } from "./transport";
|
|
4
|
+
async function main() {
|
|
5
|
+
const transport = getSimulatorTransport("standard");
|
|
6
|
+
const client = new WalletAPIClient(transport);
|
|
7
|
+
const accounts = await client.listAccounts({ currencyIds: ["ethereum"] });
|
|
8
|
+
const currencies = await client.listCurrencies({ currencyIds: ["ethereum"] });
|
|
9
|
+
const tx = await client.signTransactionAndBroadcast("account-eth-1", deserializeTransaction({
|
|
10
|
+
family: "ethereum",
|
|
11
|
+
amount: "12",
|
|
12
|
+
recipient: "0xananas",
|
|
13
|
+
}));
|
|
14
|
+
console.log({ accounts, currencies, tx });
|
|
15
|
+
}
|
|
16
|
+
main()
|
|
17
|
+
.then(() => console.log("done"))
|
|
18
|
+
.catch((err) => console.log(err));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ledgerhq/wallet-api-simulator",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "lib-es/index.js",
|
|
@@ -17,9 +17,9 @@
|
|
|
17
17
|
"typescript": "^4.8.4"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@ledgerhq/wallet-api-client": "0.
|
|
21
|
-
"@ledgerhq/wallet-api-core": "0.
|
|
22
|
-
"@ledgerhq/wallet-api-server": "0.
|
|
20
|
+
"@ledgerhq/wallet-api-client": "0.5.0",
|
|
21
|
+
"@ledgerhq/wallet-api-core": "0.5.0",
|
|
22
|
+
"@ledgerhq/wallet-api-server": "0.5.0",
|
|
23
23
|
"rxjs": "^7.5.7",
|
|
24
24
|
"ws": "^8.10.0"
|
|
25
25
|
},
|