@pioneer-platform/pioneer-coins 9.2.1 → 9.2.2
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/coins.d.ts +2 -0
- package/lib/coins.js +17 -16
- package/lib/index.d.ts +0 -1
- package/lib/index.js +0 -1
- package/lib/paths.js +13 -13
- package/package.json +3 -16
- package/LICENSE +0 -674
- package/lib/pubkey.d.ts +0 -1
- package/lib/pubkey.js +0 -52
- package/yarn-error.log +0 -14600
package/lib/coins.d.ts
CHANGED
|
@@ -36,6 +36,7 @@ export declare const COIN_MAP: {
|
|
|
36
36
|
binance: string;
|
|
37
37
|
thorchain: string;
|
|
38
38
|
eos: string;
|
|
39
|
+
ripple: string;
|
|
39
40
|
fio: string;
|
|
40
41
|
};
|
|
41
42
|
export declare const COIN_MAP_LONG: {
|
|
@@ -61,6 +62,7 @@ export declare const COIN_MAP_LONG: {
|
|
|
61
62
|
MATIC: string;
|
|
62
63
|
BNB: string;
|
|
63
64
|
EOS: string;
|
|
65
|
+
XRP: string;
|
|
64
66
|
FIO: string;
|
|
65
67
|
};
|
|
66
68
|
export declare const COIN_MAP_LONG_XCHAIN: {
|
package/lib/coins.js
CHANGED
|
@@ -5,13 +5,12 @@ var TAG = " | coin tools | ";
|
|
|
5
5
|
var log = require('@pioneer-platform/loggerdog')();
|
|
6
6
|
// const bitcoin = require("bitcoinjs-lib");
|
|
7
7
|
// const ethUtils = require('ethereumjs-util');
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
// const ripemd160 = require("crypto-js/ripemd160")
|
|
9
|
+
// const CryptoJS = require("crypto-js")
|
|
10
|
+
// const sha256 = require("crypto-js/sha256")
|
|
11
|
+
// const bech32 = require(`bech32`)
|
|
12
12
|
//import BigNumber from 'bignumber.js'
|
|
13
13
|
var b58 = require('bs58check');
|
|
14
|
-
var getPaths = require('./paths').getPaths;
|
|
15
14
|
/*
|
|
16
15
|
Rango Blockchain naming conventions
|
|
17
16
|
bitcoin -> BTC
|
|
@@ -249,6 +248,7 @@ exports.COIN_MAP = {
|
|
|
249
248
|
binance: "BNB",
|
|
250
249
|
thorchain: "RUNE",
|
|
251
250
|
eos: "EOS",
|
|
251
|
+
ripple: "XRP",
|
|
252
252
|
fio: "FIO",
|
|
253
253
|
};
|
|
254
254
|
exports.COIN_MAP_LONG = {
|
|
@@ -274,6 +274,7 @@ exports.COIN_MAP_LONG = {
|
|
|
274
274
|
MATIC: "polygon",
|
|
275
275
|
BNB: "binance",
|
|
276
276
|
EOS: "eos",
|
|
277
|
+
XRP: "ripple",
|
|
277
278
|
FIO: "fio",
|
|
278
279
|
};
|
|
279
280
|
exports.COIN_MAP_LONG_XCHAIN = {
|
|
@@ -794,18 +795,18 @@ function getExplorerTxUrl(network, txid, testnet) {
|
|
|
794
795
|
}
|
|
795
796
|
}
|
|
796
797
|
exports.getExplorerTxUrl = getExplorerTxUrl;
|
|
797
|
-
function bech32ify(address, prefix) {
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
}
|
|
798
|
+
// function bech32ify(address:any, prefix:string) {
|
|
799
|
+
// const words = bech32.toWords(address)
|
|
800
|
+
// return bech32.encode(prefix, words)
|
|
801
|
+
// }
|
|
801
802
|
// NOTE: this only works with a compressed public key (33 bytes)
|
|
802
|
-
function createBech32Address(publicKey,
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
}
|
|
803
|
+
// function createBech32Address(publicKey:any,prefix:string) {
|
|
804
|
+
// const message = CryptoJS.enc.Hex.parse(publicKey.toString(`hex`))
|
|
805
|
+
// const hash = ripemd160(sha256(message)).toString()
|
|
806
|
+
// const address = Buffer.from(hash, `hex`)
|
|
807
|
+
// const cosmosAddress = bech32ify(address, prefix)
|
|
808
|
+
// return cosmosAddress
|
|
809
|
+
// }
|
|
809
810
|
// All known xpub formats
|
|
810
811
|
var prefixes = new Map([
|
|
811
812
|
['xpub', '0488b21e'],
|
package/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED
|
@@ -16,5 +16,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./paths"), exports);
|
|
18
18
|
__exportStar(require("./coins"), exports);
|
|
19
|
-
__exportStar(require("./pubkey"), exports);
|
|
20
19
|
__exportStar(require("./address"), exports);
|
package/lib/paths.js
CHANGED
|
@@ -39,7 +39,7 @@ function getPaths(blockchains, isTestnet) {
|
|
|
39
39
|
symbol: 'BTC',
|
|
40
40
|
symbolSwapKit: 'BTC',
|
|
41
41
|
network: 'bip122:000000000019d6689c085ae165831e93',
|
|
42
|
-
script_type: "p2wpkh",
|
|
42
|
+
script_type: "p2wpkh", //bech32
|
|
43
43
|
available_scripts_types: ['p2pkh', 'p2sh', 'p2wpkh', 'p2sh-p2wpkh'],
|
|
44
44
|
type: "zpub",
|
|
45
45
|
addressNList: [0x80000000 + 84, 0x80000000 + 1, 0x80000000 + 0],
|
|
@@ -72,7 +72,7 @@ function getPaths(blockchains, isTestnet) {
|
|
|
72
72
|
symbol: 'BTC',
|
|
73
73
|
symbolSwapKit: 'BTC',
|
|
74
74
|
network: 'bip122:000000000019d6689c085ae165831e93',
|
|
75
|
-
script_type: "p2wpkh",
|
|
75
|
+
script_type: "p2wpkh", //bech32
|
|
76
76
|
available_scripts_types: ['p2pkh', 'p2sh', 'p2wpkh', 'p2sh-p2wpkh'],
|
|
77
77
|
type: "zpub",
|
|
78
78
|
addressNList: [0x80000000 + 84, 0x80000000 + 0, 0x80000000 + 0],
|
|
@@ -94,7 +94,7 @@ function getPaths(blockchains, isTestnet) {
|
|
|
94
94
|
addressNList: [0x80000000 + 44, 0x80000000 + 60, 0x80000000 + 0],
|
|
95
95
|
addressNListMaster: [0x80000000 + 44, 0x80000000 + 60, 0x80000000 + 0, 0, 0],
|
|
96
96
|
curve: 'secp256k1',
|
|
97
|
-
showDisplay: false,
|
|
97
|
+
showDisplay: false, // Not supported by TrezorConnect or Ledger, but KeepKey should do it
|
|
98
98
|
blockchain: 'ethereum'
|
|
99
99
|
};
|
|
100
100
|
if (isTestnet)
|
|
@@ -113,7 +113,7 @@ function getPaths(blockchains, isTestnet) {
|
|
|
113
113
|
addressNList: [0x80000000 + 44, 0x80000000 + 60, 0x80000000 + 0],
|
|
114
114
|
addressNListMaster: [0x80000000 + 44, 0x80000000 + 60, 0x80000000 + 0, 0, 0],
|
|
115
115
|
curve: 'secp256k1',
|
|
116
|
-
showDisplay: false,
|
|
116
|
+
showDisplay: false, // Not supported by TrezorConnect or Ledger, but KeepKey should do it
|
|
117
117
|
blockchain: 'avalanche'
|
|
118
118
|
};
|
|
119
119
|
if (isTestnet)
|
|
@@ -128,7 +128,7 @@ function getPaths(blockchains, isTestnet) {
|
|
|
128
128
|
addressNListMaster: [0x80000000 + 44, 0x80000000 + 931, 0x80000000 + 0, 0, 0],
|
|
129
129
|
curve: 'secp256k1',
|
|
130
130
|
script_type: "thorchain",
|
|
131
|
-
showDisplay: false,
|
|
131
|
+
showDisplay: false, // Not supported by TrezorConnect or Ledger, but KeepKey should do it
|
|
132
132
|
blockchain: 'thorchain',
|
|
133
133
|
symbol: 'RUNE',
|
|
134
134
|
symbolSwapKit: 'RUNE',
|
|
@@ -147,7 +147,7 @@ function getPaths(blockchains, isTestnet) {
|
|
|
147
147
|
addressNListMaster: [0x80000000 + 44, 0x80000000 + 931, 0x80000000 + 0, 0, 0],
|
|
148
148
|
curve: 'secp256k1',
|
|
149
149
|
script_type: "secret",
|
|
150
|
-
showDisplay: false,
|
|
150
|
+
showDisplay: false, // Not supported by TrezorConnect or Ledger, but KeepKey should do it
|
|
151
151
|
blockchain: 'secret',
|
|
152
152
|
symbol: 'SCRT',
|
|
153
153
|
symbolSwapKit: 'SCRT',
|
|
@@ -167,7 +167,7 @@ function getPaths(blockchains, isTestnet) {
|
|
|
167
167
|
addressNList: [0x80000000 + 44, 0x80000000 + 118, 0x80000000 + 0, 0, 0],
|
|
168
168
|
addressNListMaster: [0x80000000 + 44, 0x80000000 + 118, 0x80000000 + 0, 0, 0],
|
|
169
169
|
curve: 'secp256k1',
|
|
170
|
-
showDisplay: false,
|
|
170
|
+
showDisplay: false, // Not supported by TrezorConnect or Ledger, but KeepKey should do it
|
|
171
171
|
blockchain: 'cosmos',
|
|
172
172
|
symbol: 'ATOM',
|
|
173
173
|
symbolSwapKit: 'GAIA',
|
|
@@ -187,7 +187,7 @@ function getPaths(blockchains, isTestnet) {
|
|
|
187
187
|
addressNList: [0x80000000 + 44, 0x80000000 + 118, 0x80000000 + 0, 0, 0],
|
|
188
188
|
addressNListMaster: [0x80000000 + 44, 0x80000000 + 118, 0x80000000 + 0, 0, 0],
|
|
189
189
|
curve: 'secp256k1',
|
|
190
|
-
showDisplay: false,
|
|
190
|
+
showDisplay: false, // Not supported by TrezorConnect or Ledger, but KeepKey should do it
|
|
191
191
|
blockchain: 'osmosis',
|
|
192
192
|
symbol: 'OSMO',
|
|
193
193
|
symbolSwapKit: 'OSMO',
|
|
@@ -207,7 +207,7 @@ function getPaths(blockchains, isTestnet) {
|
|
|
207
207
|
addressNList: [0x80000000 + 44, 0x80000000 + 714, 0x80000000 + 0, 0, 0],
|
|
208
208
|
addressNListMaster: [0x80000000 + 44, 0x80000000 + 714, 0x80000000 + 0, 0, 0],
|
|
209
209
|
curve: 'secp256k1',
|
|
210
|
-
showDisplay: false,
|
|
210
|
+
showDisplay: false, // Not supported by TrezorConnect or Ledger, but KeepKey should do it
|
|
211
211
|
blockchain: 'binance',
|
|
212
212
|
symbol: 'BNB',
|
|
213
213
|
symbolSwapKit: 'BNB',
|
|
@@ -227,7 +227,7 @@ function getPaths(blockchains, isTestnet) {
|
|
|
227
227
|
addressNList: [0x80000000 + 44, 0x80000000 + 145, 0x80000000 + 0],
|
|
228
228
|
addressNListMaster: [0x80000000 + 44, 0x80000000 + 145, 0x80000000 + 0, 0, 0],
|
|
229
229
|
curve: 'secp256k1',
|
|
230
|
-
showDisplay: false,
|
|
230
|
+
showDisplay: false, // Not supported by TrezorConnect or Ledger, but KeepKey should do it
|
|
231
231
|
blockchain: 'bitcoincash',
|
|
232
232
|
symbol: 'BCH',
|
|
233
233
|
symbolSwapKit: 'BCH',
|
|
@@ -247,7 +247,7 @@ function getPaths(blockchains, isTestnet) {
|
|
|
247
247
|
addressNList: [0x80000000 + 44, 0x80000000 + 2, 0x80000000 + 0],
|
|
248
248
|
addressNListMaster: [0x80000000 + 44, 0x80000000 + 2, 0x80000000 + 0, 0, 0],
|
|
249
249
|
curve: 'secp256k1',
|
|
250
|
-
showDisplay: false,
|
|
250
|
+
showDisplay: false, // Not supported by TrezorConnect or Ledger, but KeepKey should do it
|
|
251
251
|
blockchain: 'litecoin',
|
|
252
252
|
symbol: 'LTC',
|
|
253
253
|
symbolSwapKit: 'LTC',
|
|
@@ -264,7 +264,7 @@ function getPaths(blockchains, isTestnet) {
|
|
|
264
264
|
symbol: 'LTC',
|
|
265
265
|
symbolSwapKit: 'LTC',
|
|
266
266
|
network: 'bip122:12a765e31ffd4059bada1e25190f6e98',
|
|
267
|
-
script_type: "p2wpkh",
|
|
267
|
+
script_type: "p2wpkh", //bech32
|
|
268
268
|
available_scripts_types: ['p2pkh', 'p2sh', 'p2wpkh', 'p2sh-p2wpkh'],
|
|
269
269
|
type: "zpub",
|
|
270
270
|
addressNList: [0x80000000 + 84, 0x80000000 + 2, 0x80000000 + 0],
|
|
@@ -283,7 +283,7 @@ function getPaths(blockchains, isTestnet) {
|
|
|
283
283
|
addressNList: [0x80000000 + 44, 0x80000000 + 3, 0x80000000 + 0],
|
|
284
284
|
addressNListMaster: [0x80000000 + 44, 0x80000000 + 3, 0x80000000 + 0, 0, 0],
|
|
285
285
|
curve: 'secp256k1',
|
|
286
|
-
showDisplay: false,
|
|
286
|
+
showDisplay: false, // Not supported by TrezorConnect or Ledger, but KeepKey should do it
|
|
287
287
|
blockchain: 'dogecoin',
|
|
288
288
|
symbol: 'DOGE',
|
|
289
289
|
symbolSwapKit: 'DOGE',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pioneer-platform/pioneer-coins",
|
|
3
|
-
"version": "9.2.
|
|
3
|
+
"version": "9.2.2",
|
|
4
4
|
"main": "./lib/index.js",
|
|
5
5
|
"types": "./lib/main.d.ts",
|
|
6
6
|
"_moduleAliases": {
|
|
@@ -15,20 +15,7 @@
|
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@pioneer-platform/loggerdog": "^8.3.1",
|
|
18
|
-
"
|
|
19
|
-
"bignumber.js": "^9.0.1",
|
|
20
|
-
"bitcoin-regex": "^2.0.0",
|
|
21
|
-
"bitcoincash-regex": "^1.1.8",
|
|
22
|
-
"bs58check": "^3.0.1",
|
|
23
|
-
"crypto-js": "^4.0.0",
|
|
24
|
-
"dash-regex": "^1.0.10",
|
|
25
|
-
"dogecoin-regex": "^1.0.9",
|
|
26
|
-
"ethereum-regex": "^1.1.12",
|
|
27
|
-
"ethereum-tx-decoder": "^3.0.0",
|
|
28
|
-
"litecoin-regex": "^1.0.8",
|
|
29
|
-
"monero-regex": "^1.0.8",
|
|
30
|
-
"neo-regex": "^1.0.7",
|
|
31
|
-
"ripple-regex": "^1.1.8"
|
|
18
|
+
"bignumber.js": "^9.0.1"
|
|
32
19
|
},
|
|
33
20
|
"devDependencies": {
|
|
34
21
|
"@types/express": "^4.17.6",
|
|
@@ -36,5 +23,5 @@
|
|
|
36
23
|
"nodemon": "^2.0.3",
|
|
37
24
|
"typescript": "^5.0.2"
|
|
38
25
|
},
|
|
39
|
-
"gitHead": "
|
|
26
|
+
"gitHead": "aeae28273014ab69b42f22abec159c6693a56c40"
|
|
40
27
|
}
|