@shapeshiftoss/hdwallet-core 1.62.13 → 1.62.14
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/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/tron.d.ts +46 -0
- package/dist/tron.d.ts.map +1 -0
- package/dist/tron.js +40 -0
- package/dist/tron.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/utils.d.ts +1 -0
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +1 -0
- package/dist/utils.js.map +1 -1
- package/dist/wallet.d.ts +3 -0
- package/dist/wallet.d.ts.map +1 -1
- package/dist/wallet.js +8 -0
- package/dist/wallet.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,OAAO,CAAC;AACtB,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,OAAO,CAAC;AACtB,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -34,6 +34,7 @@ __exportStar(require("./terra"), exports);
|
|
|
34
34
|
__exportStar(require("./thorchain"), exports);
|
|
35
35
|
__exportStar(require("./solana"), exports);
|
|
36
36
|
__exportStar(require("./transport"), exports);
|
|
37
|
+
__exportStar(require("./tron"), exports);
|
|
37
38
|
__exportStar(require("./utils"), exports);
|
|
38
39
|
__exportStar(require("./utxoUtils"), exports);
|
|
39
40
|
__exportStar(require("./wallet"), exports);
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAwB;AACxB,4CAA0B;AAC1B,4CAA0B;AAC1B,2CAAyB;AACzB,4CAA0B;AAC1B,8CAA4B;AAC5B,wCAAsB;AACtB,6CAA2B;AAC3B,0CAAwB;AACxB,+CAA6B;AAC7B,yCAAuB;AACvB,4CAA0B;AAC1B,8CAA4B;AAC5B,6CAA2B;AAC3B,2CAAyB;AACzB,2CAAyB;AACzB,0CAAwB;AACxB,8CAA4B;AAC5B,2CAAyB;AACzB,8CAA4B;AAC5B,0CAAwB;AACxB,8CAA4B;AAC5B,2CAAyB"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAwB;AACxB,4CAA0B;AAC1B,4CAA0B;AAC1B,2CAAyB;AACzB,4CAA0B;AAC1B,8CAA4B;AAC5B,wCAAsB;AACtB,6CAA2B;AAC3B,0CAAwB;AACxB,+CAA6B;AAC7B,yCAAuB;AACvB,4CAA0B;AAC1B,8CAA4B;AAC5B,6CAA2B;AAC3B,2CAAyB;AACzB,2CAAyB;AACzB,0CAAwB;AACxB,8CAA4B;AAC5B,2CAAyB;AACzB,8CAA4B;AAC5B,yCAAuB;AACvB,0CAAwB;AACxB,8CAA4B;AAC5B,2CAAyB"}
|
package/dist/tron.d.ts
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { BIP32Path, HDWallet, HDWalletInfo, PathDescription } from "./wallet";
|
|
2
|
+
export interface TronGetAddress {
|
|
3
|
+
addressNList: BIP32Path;
|
|
4
|
+
showDisplay?: boolean;
|
|
5
|
+
pubKey?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface TronSignTx {
|
|
8
|
+
addressNList: BIP32Path;
|
|
9
|
+
/** Raw transaction data in hex format */
|
|
10
|
+
rawDataHex: string;
|
|
11
|
+
}
|
|
12
|
+
export interface TronSignedTx {
|
|
13
|
+
serialized: string;
|
|
14
|
+
signature: string;
|
|
15
|
+
}
|
|
16
|
+
export interface TronTxSignature {
|
|
17
|
+
signature: string;
|
|
18
|
+
}
|
|
19
|
+
export interface TronGetAccountPaths {
|
|
20
|
+
accountIdx: number;
|
|
21
|
+
}
|
|
22
|
+
export interface TronAccountPath {
|
|
23
|
+
addressNList: BIP32Path;
|
|
24
|
+
}
|
|
25
|
+
export interface TronWalletInfo extends HDWalletInfo {
|
|
26
|
+
readonly _supportsTronInfo: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Returns a list of bip32 paths for a given account index in preferred order
|
|
29
|
+
* from most to least preferred.
|
|
30
|
+
*/
|
|
31
|
+
tronGetAccountPaths(msg: TronGetAccountPaths): Array<TronAccountPath>;
|
|
32
|
+
/**
|
|
33
|
+
* Returns the "next" account path, if any.
|
|
34
|
+
*/
|
|
35
|
+
tronNextAccountPath(msg: TronAccountPath): TronAccountPath | undefined;
|
|
36
|
+
}
|
|
37
|
+
export interface TronWallet extends TronWalletInfo, HDWallet {
|
|
38
|
+
readonly _supportsTron: boolean;
|
|
39
|
+
tronGetAddress(msg: TronGetAddress): Promise<string | null>;
|
|
40
|
+
tronGetAddresses?(msgs: TronGetAddress[]): Promise<string[]>;
|
|
41
|
+
tronSignTx(msg: TronSignTx): Promise<TronSignedTx | null>;
|
|
42
|
+
tronSendTx?(msg: TronSignTx): Promise<TronTxSignature | null>;
|
|
43
|
+
}
|
|
44
|
+
export declare function tronDescribePath(path: BIP32Path): PathDescription;
|
|
45
|
+
export declare function tronGetAccountPaths(msg: TronGetAccountPaths): Array<TronAccountPath>;
|
|
46
|
+
//# sourceMappingURL=tron.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tron.d.ts","sourceRoot":"","sources":["../src/tron.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAE9E,MAAM,WAAW,cAAc;IAC7B,YAAY,EAAE,SAAS,CAAC;IACxB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,UAAU;IACzB,YAAY,EAAE,SAAS,CAAC;IACxB,yCAAy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1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.tronDescribePath = tronDescribePath;
|
|
4
|
+
exports.tronGetAccountPaths = tronGetAccountPaths;
|
|
5
|
+
const utils_1 = require("./utils");
|
|
6
|
+
function tronDescribePath(path) {
|
|
7
|
+
const pathStr = (0, utils_1.addressNListToBIP32)(path);
|
|
8
|
+
const unknown = {
|
|
9
|
+
verbose: pathStr,
|
|
10
|
+
coin: "Tron",
|
|
11
|
+
isKnown: false,
|
|
12
|
+
};
|
|
13
|
+
if (path.length != 5)
|
|
14
|
+
return unknown;
|
|
15
|
+
if (path[0] != 0x80000000 + 44)
|
|
16
|
+
return unknown;
|
|
17
|
+
if (path[1] != 0x80000000 + (0, utils_1.slip44ByCoin)("Tron"))
|
|
18
|
+
return unknown;
|
|
19
|
+
if ((path[2] & 0x80000000) >>> 0 !== 0x80000000)
|
|
20
|
+
return unknown;
|
|
21
|
+
if (path[3] !== 0)
|
|
22
|
+
return unknown;
|
|
23
|
+
if (path[4] !== 0)
|
|
24
|
+
return unknown;
|
|
25
|
+
const index = path[2] & 0x7fffffff;
|
|
26
|
+
return {
|
|
27
|
+
verbose: `Tron Account #${index}`,
|
|
28
|
+
accountIdx: index,
|
|
29
|
+
wholeAccount: true,
|
|
30
|
+
coin: "Tron",
|
|
31
|
+
isKnown: true,
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
// The standard BIP44 derivation path for Tron is: m/44'/195'/<account>'/0/0
|
|
35
|
+
// https://github.com/tronprotocol/tips/issues/102
|
|
36
|
+
function tronGetAccountPaths(msg) {
|
|
37
|
+
const slip44 = (0, utils_1.slip44ByCoin)("Tron");
|
|
38
|
+
return [{ addressNList: [0x80000000 + 44, 0x80000000 + slip44, 0x80000000 + msg.accountIdx, 0, 0] }];
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=tron.js.map
|
package/dist/tron.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1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