@ledgerhq/wallet-api-acre-module 0.1.0 → 0.2.0-next.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/index.d.ts +1 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +22 -37
- package/lib/index.js.map +1 -1
- package/lib-es/index.d.ts +1 -0
- package/lib-es/index.d.ts.map +1 -1
- package/lib-es/index.js +22 -37
- package/lib-es/index.js.map +1 -1
- package/package.json +6 -5
package/lib/index.d.ts
CHANGED
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAE,YAAY,EAAwB,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC9F,OAAO,EACL,WAAW,EAGX,WAAW,EACX,kBAAkB,EAKnB,MAAM,SAAS,CAAC;AAEjB,cAAc,SAAS,CAAC;AAGxB,qBAAa,UAAW,SAAQ,YAAY;IAC1C;;;;;;;;;;OAUG;IACG,WAAW,CACf,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,WAAW,EACpB,cAAc,CAAC,EAAE,MAAM,EACvB,OAAO,CAAC,EAAE,WAAW,EACrB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAgBhC;;;;;;;;OAQG;IACG,eAAe,CACnB,SAAS,EAAE,MAAM,EACjB,WAAW,EAAE,WAAW,EACxB,OAAO,CAAC,EAAE,kBAAkB,EAC5B,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC7B,OAAO,CAAC,MAAM,CAAC;IAclB;;;;;;;;OAQG;IACG,2BAA2B,CAC/B,SAAS,EAAE,MAAM,EACjB,WAAW,EAAE,WAAW,EACxB,OAAO,CAAC,EAAE,kBAAkB,EAC5B,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC7B,OAAO,CAAC,MAAM,CAAC;CAanB"}
|
package/lib/index.js
CHANGED
|
@@ -13,15 +13,6 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
|
|
|
13
13
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
17
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
18
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
19
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
20
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
21
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
22
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
23
|
-
});
|
|
24
|
-
};
|
|
25
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
17
|
exports.AcreModule = void 0;
|
|
27
18
|
const wallet_api_client_1 = require("@ledgerhq/wallet-api-client");
|
|
@@ -39,17 +30,15 @@ class AcreModule extends wallet_api_client_1.CustomModule {
|
|
|
39
30
|
* @returns Message signed
|
|
40
31
|
* @throws {@link RpcError} if an error occured on server side
|
|
41
32
|
*/
|
|
42
|
-
messageSign(accountId, message, derivationPath, options, meta) {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
meta,
|
|
50
|
-
});
|
|
51
|
-
return Buffer.from(result.hexSignedMessage, "hex");
|
|
33
|
+
async messageSign(accountId, message, derivationPath, options, meta) {
|
|
34
|
+
const result = await this.request("custom.acre.messageSign", {
|
|
35
|
+
accountId,
|
|
36
|
+
message,
|
|
37
|
+
derivationPath,
|
|
38
|
+
options,
|
|
39
|
+
meta,
|
|
52
40
|
});
|
|
41
|
+
return Buffer.from(result.hexSignedMessage, "hex");
|
|
53
42
|
}
|
|
54
43
|
/**
|
|
55
44
|
* Let the user sign a transaction that won't be broadcasted by the connected wallet
|
|
@@ -60,16 +49,14 @@ class AcreModule extends wallet_api_client_1.CustomModule {
|
|
|
60
49
|
* @returns The raw signed transaction
|
|
61
50
|
* @throws {@link RpcError} if an error occured on server side
|
|
62
51
|
*/
|
|
63
|
-
transactionSign(accountId, transaction, options, meta) {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
meta,
|
|
70
|
-
});
|
|
71
|
-
return Buffer.from(result.signedTransactionHex, "hex");
|
|
52
|
+
async transactionSign(accountId, transaction, options, meta) {
|
|
53
|
+
const result = await this.request("custom.acre.transactionSign", {
|
|
54
|
+
accountId,
|
|
55
|
+
rawTransaction: (0, wallet_api_client_1.serializeTransaction)(transaction),
|
|
56
|
+
options,
|
|
57
|
+
meta,
|
|
72
58
|
});
|
|
59
|
+
return Buffer.from(result.signedTransactionHex, "hex");
|
|
73
60
|
}
|
|
74
61
|
/**
|
|
75
62
|
* Let the user sign and broadcast a transaction
|
|
@@ -80,16 +67,14 @@ class AcreModule extends wallet_api_client_1.CustomModule {
|
|
|
80
67
|
* @returns The transaction hash
|
|
81
68
|
* @throws {@link RpcError} if an error occured on server side
|
|
82
69
|
*/
|
|
83
|
-
transactionSignAndBroadcast(accountId, transaction, options, meta) {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
meta,
|
|
90
|
-
});
|
|
91
|
-
return result.transactionHash;
|
|
70
|
+
async transactionSignAndBroadcast(accountId, transaction, options, meta) {
|
|
71
|
+
const result = await this.request("custom.acre.transactionSignAndBroadcast", {
|
|
72
|
+
accountId,
|
|
73
|
+
rawTransaction: (0, wallet_api_client_1.serializeTransaction)(transaction),
|
|
74
|
+
options,
|
|
75
|
+
meta,
|
|
92
76
|
});
|
|
77
|
+
return result.transactionHash;
|
|
93
78
|
}
|
|
94
79
|
}
|
|
95
80
|
exports.AcreModule = AcreModule;
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,mEAA8F;AAa9F,0CAAwB;AAExB,wFAAwF;AACxF,MAAa,UAAW,SAAQ,gCAAY;IAC1C;;;;;;;;;;OAUG;IACH,KAAK,CAAC,WAAW,CACf,SAAiB,EACjB,OAAoB,EACpB,cAAuB,EACvB,OAAqB,EACrB,IAA8B;QAE9B,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,OAAO,CAC/B,yBAAyB,EACzB;YACE,SAAS;YACT,OAAO;YACP,cAAc;YACd,OAAO;YACP,IAAI;SACL,CACF,CAAC;QAEF,OAAO,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,gBAAgB,EAAE,KAAK,CAAC,CAAC;IACrD,CAAC;IAED;;;;;;;;OAQG;IACH,KAAK,CAAC,eAAe,CACnB,SAAiB,EACjB,WAAwB,EACxB,OAA4B,EAC5B,IAA8B;QAE9B,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,OAAO,CAC/B,6BAA6B,EAC7B;YACE,SAAS;YACT,cAAc,EAAE,IAAA,wCAAoB,EAAC,WAAW,CAAC;YACjD,OAAO;YACP,IAAI;SACL,CACF,CAAC;QAEF,OAAO,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,oBAAoB,EAAE,KAAK,CAAC,CAAC;IACzD,CAAC;IAED;;;;;;;;OAQG;IACH,KAAK,CAAC,2BAA2B,CAC/B,SAAiB,EACjB,WAAwB,EACxB,OAA4B,EAC5B,IAA8B;QAE9B,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,OAAO,CAG/B,yCAAyC,EAAE;YAC3C,SAAS;YACT,cAAc,EAAE,IAAA,wCAAoB,EAAC,WAAW,CAAC;YACjD,OAAO;YACP,IAAI;SACL,CAAC,CAAC;QAEH,OAAO,MAAM,CAAC,eAAe,CAAC;IAChC,CAAC;CACF;AAxFD,gCAwFC"}
|
package/lib-es/index.d.ts
CHANGED
package/lib-es/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAE,YAAY,EAAwB,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC9F,OAAO,EACL,WAAW,EAGX,WAAW,EACX,kBAAkB,EAKnB,MAAM,SAAS,CAAC;AAEjB,cAAc,SAAS,CAAC;AAGxB,qBAAa,UAAW,SAAQ,YAAY;IAC1C;;;;;;;;;;OAUG;IACG,WAAW,CACf,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,WAAW,EACpB,cAAc,CAAC,EAAE,MAAM,EACvB,OAAO,CAAC,EAAE,WAAW,EACrB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAgBhC;;;;;;;;OAQG;IACG,eAAe,CACnB,SAAS,EAAE,MAAM,EACjB,WAAW,EAAE,WAAW,EACxB,OAAO,CAAC,EAAE,kBAAkB,EAC5B,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC7B,OAAO,CAAC,MAAM,CAAC;IAclB;;;;;;;;OAQG;IACG,2BAA2B,CAC/B,SAAS,EAAE,MAAM,EACjB,WAAW,EAAE,WAAW,EACxB,OAAO,CAAC,EAAE,kBAAkB,EAC5B,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC7B,OAAO,CAAC,MAAM,CAAC;CAanB"}
|
package/lib-es/index.js
CHANGED
|
@@ -1,12 +1,3 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
1
|
import { CustomModule, serializeTransaction } from "@ledgerhq/wallet-api-client";
|
|
11
2
|
export * from "./types";
|
|
12
3
|
// TODO maybe find a better way to type the available custom requests with correct types
|
|
@@ -22,17 +13,15 @@ export class AcreModule extends CustomModule {
|
|
|
22
13
|
* @returns Message signed
|
|
23
14
|
* @throws {@link RpcError} if an error occured on server side
|
|
24
15
|
*/
|
|
25
|
-
messageSign(accountId, message, derivationPath, options, meta) {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
meta,
|
|
33
|
-
});
|
|
34
|
-
return Buffer.from(result.hexSignedMessage, "hex");
|
|
16
|
+
async messageSign(accountId, message, derivationPath, options, meta) {
|
|
17
|
+
const result = await this.request("custom.acre.messageSign", {
|
|
18
|
+
accountId,
|
|
19
|
+
message,
|
|
20
|
+
derivationPath,
|
|
21
|
+
options,
|
|
22
|
+
meta,
|
|
35
23
|
});
|
|
24
|
+
return Buffer.from(result.hexSignedMessage, "hex");
|
|
36
25
|
}
|
|
37
26
|
/**
|
|
38
27
|
* Let the user sign a transaction that won't be broadcasted by the connected wallet
|
|
@@ -43,16 +32,14 @@ export class AcreModule extends CustomModule {
|
|
|
43
32
|
* @returns The raw signed transaction
|
|
44
33
|
* @throws {@link RpcError} if an error occured on server side
|
|
45
34
|
*/
|
|
46
|
-
transactionSign(accountId, transaction, options, meta) {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
meta,
|
|
53
|
-
});
|
|
54
|
-
return Buffer.from(result.signedTransactionHex, "hex");
|
|
35
|
+
async transactionSign(accountId, transaction, options, meta) {
|
|
36
|
+
const result = await this.request("custom.acre.transactionSign", {
|
|
37
|
+
accountId,
|
|
38
|
+
rawTransaction: serializeTransaction(transaction),
|
|
39
|
+
options,
|
|
40
|
+
meta,
|
|
55
41
|
});
|
|
42
|
+
return Buffer.from(result.signedTransactionHex, "hex");
|
|
56
43
|
}
|
|
57
44
|
/**
|
|
58
45
|
* Let the user sign and broadcast a transaction
|
|
@@ -63,16 +50,14 @@ export class AcreModule extends CustomModule {
|
|
|
63
50
|
* @returns The transaction hash
|
|
64
51
|
* @throws {@link RpcError} if an error occured on server side
|
|
65
52
|
*/
|
|
66
|
-
transactionSignAndBroadcast(accountId, transaction, options, meta) {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
meta,
|
|
73
|
-
});
|
|
74
|
-
return result.transactionHash;
|
|
53
|
+
async transactionSignAndBroadcast(accountId, transaction, options, meta) {
|
|
54
|
+
const result = await this.request("custom.acre.transactionSignAndBroadcast", {
|
|
55
|
+
accountId,
|
|
56
|
+
rawTransaction: serializeTransaction(transaction),
|
|
57
|
+
options,
|
|
58
|
+
meta,
|
|
75
59
|
});
|
|
60
|
+
return result.transactionHash;
|
|
76
61
|
}
|
|
77
62
|
}
|
|
78
63
|
//# sourceMappingURL=index.js.map
|
package/lib-es/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,oBAAoB,EAAe,MAAM,6BAA6B,CAAC;AAa9F,cAAc,SAAS,CAAC;AAExB,wFAAwF;AACxF,MAAM,OAAO,UAAW,SAAQ,YAAY;IAC1C;;;;;;;;;;OAUG;IACH,KAAK,CAAC,WAAW,CACf,SAAiB,EACjB,OAAoB,EACpB,cAAuB,EACvB,OAAqB,EACrB,IAA8B;QAE9B,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,OAAO,CAC/B,yBAAyB,EACzB;YACE,SAAS;YACT,OAAO;YACP,cAAc;YACd,OAAO;YACP,IAAI;SACL,CACF,CAAC;QAEF,OAAO,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,gBAAgB,EAAE,KAAK,CAAC,CAAC;IACrD,CAAC;IAED;;;;;;;;OAQG;IACH,KAAK,CAAC,eAAe,CACnB,SAAiB,EACjB,WAAwB,EACxB,OAA4B,EAC5B,IAA8B;QAE9B,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,OAAO,CAC/B,6BAA6B,EAC7B;YACE,SAAS;YACT,cAAc,EAAE,oBAAoB,CAAC,WAAW,CAAC;YACjD,OAAO;YACP,IAAI;SACL,CACF,CAAC;QAEF,OAAO,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,oBAAoB,EAAE,KAAK,CAAC,CAAC;IACzD,CAAC;IAED;;;;;;;;OAQG;IACH,KAAK,CAAC,2BAA2B,CAC/B,SAAiB,EACjB,WAAwB,EACxB,OAA4B,EAC5B,IAA8B;QAE9B,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,OAAO,CAG/B,yCAAyC,EAAE;YAC3C,SAAS;YACT,cAAc,EAAE,oBAAoB,CAAC,WAAW,CAAC;YACjD,OAAO;YACP,IAAI;SACL,CAAC,CAAC;QAEH,OAAO,MAAM,CAAC,eAAe,CAAC;IAChC,CAAC;CACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ledgerhq/wallet-api-acre-module",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0-next.0",
|
|
4
4
|
"description": "Wallet-API ACRE Module for Ledger Live",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"keywords": [
|
|
@@ -25,17 +25,18 @@
|
|
|
25
25
|
"access": "public"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@ledgerhq/wallet-api-client": "^1.6.
|
|
29
|
-
"@ledgerhq/wallet-api-core": "^1.
|
|
28
|
+
"@ledgerhq/wallet-api-client": "^1.6.2",
|
|
29
|
+
"@ledgerhq/wallet-api-core": "^1.15.0"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@types/node": "^
|
|
32
|
+
"@types/node": "^22.10.10"
|
|
33
33
|
},
|
|
34
34
|
"scripts": {
|
|
35
35
|
"clean": "rimraf lib lib-es",
|
|
36
|
-
"build": "tsc && tsc -m
|
|
36
|
+
"build": "tsc && tsc -m esnext --moduleResolution bundler --outDir lib-es && node scripts/createModulePackage.mjs",
|
|
37
37
|
"prewatch": "pnpm build",
|
|
38
38
|
"watch": "tsc --watch",
|
|
39
|
+
"watch:es": "tsc --watch -m esnext --moduleResolution bundler --outDir lib-es",
|
|
39
40
|
"lint": "eslint ./src --no-error-on-unmatched-pattern --ext .ts,.tsx",
|
|
40
41
|
"lint:fix": "pnpm lint --fix"
|
|
41
42
|
}
|