@cityofzion/bs-ethereum 1.2.4 → 1.4.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/dist/BSEthereum.d.ts +1 -1
- package/dist/BSEthereum.js +26 -17
- package/dist/LedgerServiceEthereum.d.ts +15 -4
- package/dist/LedgerServiceEthereum.js +132 -25
- package/dist/constants.d.ts +1 -0
- package/dist/constants.js +2 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/package.json +4 -2
package/dist/BSEthereum.d.ts
CHANGED
|
@@ -23,6 +23,6 @@ export declare class BSEthereum<BSCustomName extends string = string> implements
|
|
|
23
23
|
decrypt(json: string, password: string): Promise<Account>;
|
|
24
24
|
encrypt(key: string, password: string): Promise<string>;
|
|
25
25
|
transfer(param: TransferParam): Promise<string>;
|
|
26
|
-
calculateTransferFee(
|
|
26
|
+
calculateTransferFee(param: TransferParam): Promise<string>;
|
|
27
27
|
resolveNameServiceDomain(domainName: string): Promise<string>;
|
|
28
28
|
}
|
package/dist/BSEthereum.js
CHANGED
|
@@ -144,13 +144,12 @@ class BSEthereum {
|
|
|
144
144
|
throw new Error('You must provide getLedgerTransport function to use Ledger');
|
|
145
145
|
ledgerTransport = yield this.ledgerService.getLedgerTransport(param.senderAccount);
|
|
146
146
|
}
|
|
147
|
-
let
|
|
147
|
+
let signer;
|
|
148
148
|
if (ledgerTransport) {
|
|
149
|
-
|
|
149
|
+
signer = new LedgerServiceEthereum_1.LedgerSigner(ledgerTransport, provider);
|
|
150
150
|
}
|
|
151
151
|
else {
|
|
152
|
-
|
|
153
|
-
signTransactionFunction = wallet.signTransaction.bind(wallet);
|
|
152
|
+
signer = new ethers_1.ethers.Wallet(param.senderAccount.key, provider);
|
|
154
153
|
}
|
|
155
154
|
const decimals = (_a = param.intent.tokenDecimals) !== null && _a !== void 0 ? _a : 18;
|
|
156
155
|
const amount = ethersBigNumber.parseFixed(param.intent.amount, decimals);
|
|
@@ -168,29 +167,39 @@ class BSEthereum {
|
|
|
168
167
|
]);
|
|
169
168
|
transactionParams = yield contract.populateTransaction.transfer(param.intent.receiverAddress, amount);
|
|
170
169
|
}
|
|
171
|
-
const
|
|
172
|
-
|
|
173
|
-
const signedTransaction = yield signTransactionFunction(transaction);
|
|
174
|
-
const transactionResponse = yield provider.sendTransaction(signedTransaction);
|
|
175
|
-
return transactionResponse.hash;
|
|
170
|
+
const transaction = yield signer.sendTransaction(transactionParams);
|
|
171
|
+
return transaction.hash;
|
|
176
172
|
});
|
|
177
173
|
}
|
|
178
|
-
calculateTransferFee(
|
|
174
|
+
calculateTransferFee(param) {
|
|
179
175
|
var _a;
|
|
180
176
|
return __awaiter(this, void 0, void 0, function* () {
|
|
181
177
|
const provider = new ethers_1.ethers.providers.JsonRpcProvider(this.network.url);
|
|
178
|
+
let ledgerTransport;
|
|
179
|
+
if (param.isLedger) {
|
|
180
|
+
if (!this.ledgerService.getLedgerTransport)
|
|
181
|
+
throw new Error('You must provide getLedgerTransport function to use Ledger');
|
|
182
|
+
ledgerTransport = yield this.ledgerService.getLedgerTransport(param.senderAccount);
|
|
183
|
+
}
|
|
184
|
+
let signer;
|
|
185
|
+
if (ledgerTransport) {
|
|
186
|
+
signer = new LedgerServiceEthereum_1.LedgerSigner(ledgerTransport, provider);
|
|
187
|
+
}
|
|
188
|
+
else {
|
|
189
|
+
signer = new ethers_1.ethers.Wallet(param.senderAccount.key, provider);
|
|
190
|
+
}
|
|
182
191
|
const gasPrice = yield provider.getGasPrice();
|
|
183
192
|
let estimated;
|
|
184
|
-
const isNative = constants_1.NATIVE_ASSETS.some(asset => asset.hash === intent.tokenHash);
|
|
185
|
-
const decimals = (_a = intent.tokenDecimals) !== null && _a !== void 0 ? _a : 18;
|
|
186
|
-
const amount = ethersBigNumber.parseFixed(intent.amount, decimals);
|
|
193
|
+
const isNative = constants_1.NATIVE_ASSETS.some(asset => asset.hash === param.intent.tokenHash);
|
|
194
|
+
const decimals = (_a = param.intent.tokenDecimals) !== null && _a !== void 0 ? _a : 18;
|
|
195
|
+
const amount = ethersBigNumber.parseFixed(param.intent.amount, decimals);
|
|
187
196
|
if (!isNative) {
|
|
188
|
-
const contract = new ethers_1.ethers.Contract(intent.tokenHash, ['function transfer(address to, uint amount) returns (bool)'],
|
|
189
|
-
estimated = yield contract.estimateGas.transfer(intent.receiverAddress, amount);
|
|
197
|
+
const contract = new ethers_1.ethers.Contract(param.intent.tokenHash, ['function transfer(address to, uint amount) returns (bool)'], signer);
|
|
198
|
+
estimated = yield contract.estimateGas.transfer(param.intent.receiverAddress, amount);
|
|
190
199
|
}
|
|
191
200
|
else {
|
|
192
|
-
estimated = yield
|
|
193
|
-
to: intent.receiverAddress,
|
|
201
|
+
estimated = yield signer.estimateGas({
|
|
202
|
+
to: param.intent.receiverAddress,
|
|
194
203
|
value: amount,
|
|
195
204
|
});
|
|
196
205
|
}
|
|
@@ -1,11 +1,22 @@
|
|
|
1
|
-
import { Account, LedgerService } from '@cityofzion/blockchain-service';
|
|
1
|
+
import { Account, LedgerService, LedgerServiceEmitter } from '@cityofzion/blockchain-service';
|
|
2
2
|
import Transport from '@ledgerhq/hw-transport';
|
|
3
|
-
import { ethers } from 'ethers';
|
|
4
|
-
|
|
3
|
+
import { ethers, Signer } from 'ethers';
|
|
4
|
+
import { TypedDataSigner } from '@ethersproject/abstract-signer';
|
|
5
|
+
export declare class LedgerSigner extends Signer implements TypedDataSigner {
|
|
5
6
|
#private;
|
|
7
|
+
constructor(transport: Transport, provider?: ethers.providers.Provider, emitter?: LedgerServiceEmitter);
|
|
8
|
+
connect(provider: ethers.providers.Provider): LedgerSigner;
|
|
9
|
+
getAddress(): Promise<string>;
|
|
10
|
+
getPublicKey(): Promise<string>;
|
|
11
|
+
signMessage(message: string | ethers.utils.Bytes): Promise<string>;
|
|
12
|
+
signTransaction(transaction: ethers.utils.Deferrable<ethers.providers.TransactionRequest>): Promise<string>;
|
|
13
|
+
_signTypedData(domain: ethers.TypedDataDomain, types: Record<string, ethers.TypedDataField[]>, value: Record<string, any>): Promise<string>;
|
|
14
|
+
}
|
|
15
|
+
export declare class LedgerServiceEthereum implements LedgerService {
|
|
6
16
|
getLedgerTransport?: ((account: Account) => Promise<Transport>) | undefined;
|
|
17
|
+
emitter: LedgerServiceEmitter;
|
|
7
18
|
constructor(getLedgerTransport?: ((account: Account) => Promise<Transport>) | undefined);
|
|
8
19
|
getAddress(transport: Transport): Promise<string>;
|
|
9
20
|
getPublicKey(transport: Transport): Promise<string>;
|
|
10
|
-
|
|
21
|
+
getSigner(transport: Transport): LedgerSigner;
|
|
11
22
|
}
|
|
@@ -31,51 +31,158 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
31
31
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
32
32
|
});
|
|
33
33
|
};
|
|
34
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
35
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
36
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
37
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
38
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
39
|
+
};
|
|
34
40
|
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
35
41
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
36
42
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
37
43
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
38
44
|
};
|
|
39
|
-
var
|
|
45
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
46
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
47
|
+
};
|
|
48
|
+
var _LedgerSigner_instances, _LedgerSigner_transport, _LedgerSigner_emitter, _LedgerSigner_path, _LedgerSigner_retry;
|
|
40
49
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
41
|
-
exports.LedgerServiceEthereum = void 0;
|
|
50
|
+
exports.LedgerServiceEthereum = exports.LedgerSigner = void 0;
|
|
42
51
|
const hw_app_eth_1 = __importStar(require("@ledgerhq/hw-app-eth"));
|
|
43
52
|
const ethers_1 = require("ethers");
|
|
53
|
+
const properties_1 = require("@ethersproject/properties");
|
|
54
|
+
const constants_1 = require("./constants");
|
|
55
|
+
const events_1 = __importDefault(require("events"));
|
|
56
|
+
class LedgerSigner extends ethers_1.Signer {
|
|
57
|
+
constructor(transport, provider, emitter) {
|
|
58
|
+
super();
|
|
59
|
+
_LedgerSigner_instances.add(this);
|
|
60
|
+
_LedgerSigner_transport.set(this, void 0);
|
|
61
|
+
_LedgerSigner_emitter.set(this, void 0);
|
|
62
|
+
_LedgerSigner_path.set(this, void 0);
|
|
63
|
+
__classPrivateFieldSet(this, _LedgerSigner_path, constants_1.DEFAULT_PATH, "f");
|
|
64
|
+
__classPrivateFieldSet(this, _LedgerSigner_transport, transport, "f");
|
|
65
|
+
__classPrivateFieldSet(this, _LedgerSigner_emitter, emitter, "f");
|
|
66
|
+
(0, properties_1.defineReadOnly)(this, 'provider', provider);
|
|
67
|
+
}
|
|
68
|
+
connect(provider) {
|
|
69
|
+
return new LedgerSigner(__classPrivateFieldGet(this, _LedgerSigner_transport, "f"), provider);
|
|
70
|
+
}
|
|
71
|
+
getAddress() {
|
|
72
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
73
|
+
const ledgerApp = new hw_app_eth_1.default(__classPrivateFieldGet(this, _LedgerSigner_transport, "f"));
|
|
74
|
+
const { address } = yield __classPrivateFieldGet(this, _LedgerSigner_instances, "m", _LedgerSigner_retry).call(this, () => ledgerApp.getAddress(__classPrivateFieldGet(this, _LedgerSigner_path, "f")));
|
|
75
|
+
return ethers_1.ethers.utils.getAddress(address);
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
getPublicKey() {
|
|
79
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
80
|
+
const ledgerApp = new hw_app_eth_1.default(__classPrivateFieldGet(this, _LedgerSigner_transport, "f"));
|
|
81
|
+
const { publicKey } = yield __classPrivateFieldGet(this, _LedgerSigner_instances, "m", _LedgerSigner_retry).call(this, () => ledgerApp.getAddress(__classPrivateFieldGet(this, _LedgerSigner_path, "f")));
|
|
82
|
+
return '0x' + publicKey;
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
signMessage(message) {
|
|
86
|
+
var _a, _b;
|
|
87
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
88
|
+
if (typeof message === 'string') {
|
|
89
|
+
message = ethers_1.ethers.utils.toUtf8Bytes(message);
|
|
90
|
+
}
|
|
91
|
+
const ledgerApp = new hw_app_eth_1.default(__classPrivateFieldGet(this, _LedgerSigner_transport, "f"));
|
|
92
|
+
(_a = __classPrivateFieldGet(this, _LedgerSigner_emitter, "f")) === null || _a === void 0 ? void 0 : _a.emit('getSignatureStart');
|
|
93
|
+
const obj = yield __classPrivateFieldGet(this, _LedgerSigner_instances, "m", _LedgerSigner_retry).call(this, () => ledgerApp.signPersonalMessage(__classPrivateFieldGet(this, _LedgerSigner_path, "f"), ethers_1.ethers.utils.hexlify(message).substring(2)));
|
|
94
|
+
(_b = __classPrivateFieldGet(this, _LedgerSigner_emitter, "f")) === null || _b === void 0 ? void 0 : _b.emit('getSignatureEnd');
|
|
95
|
+
// Normalize the signature for Ethers
|
|
96
|
+
obj.r = '0x' + obj.r;
|
|
97
|
+
obj.s = '0x' + obj.s;
|
|
98
|
+
return ethers_1.ethers.utils.joinSignature(obj);
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
signTransaction(transaction) {
|
|
102
|
+
var _a, _b;
|
|
103
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
104
|
+
const ledgerApp = new hw_app_eth_1.default(__classPrivateFieldGet(this, _LedgerSigner_transport, "f"));
|
|
105
|
+
const tx = yield ethers_1.ethers.utils.resolveProperties(transaction);
|
|
106
|
+
const unsignedTransaction = Object.assign(Object.assign({}, tx), { nonce: tx.nonce ? ethers_1.ethers.BigNumber.from(transaction.nonce).toNumber() : undefined });
|
|
107
|
+
const serializedUnsignedTransaction = ethers_1.ethers.utils.serializeTransaction(unsignedTransaction).substring(2);
|
|
108
|
+
const resolution = yield hw_app_eth_1.ledgerService.resolveTransaction(serializedUnsignedTransaction, {}, {});
|
|
109
|
+
(_a = __classPrivateFieldGet(this, _LedgerSigner_emitter, "f")) === null || _a === void 0 ? void 0 : _a.emit('getSignatureStart');
|
|
110
|
+
const signature = yield __classPrivateFieldGet(this, _LedgerSigner_instances, "m", _LedgerSigner_retry).call(this, () => ledgerApp.signTransaction(__classPrivateFieldGet(this, _LedgerSigner_path, "f"), serializedUnsignedTransaction, resolution));
|
|
111
|
+
(_b = __classPrivateFieldGet(this, _LedgerSigner_emitter, "f")) === null || _b === void 0 ? void 0 : _b.emit('getSignatureEnd');
|
|
112
|
+
return ethers_1.ethers.utils.serializeTransaction(unsignedTransaction, {
|
|
113
|
+
v: ethers_1.ethers.BigNumber.from('0x' + signature.v).toNumber(),
|
|
114
|
+
r: '0x' + signature.r,
|
|
115
|
+
s: '0x' + signature.s,
|
|
116
|
+
});
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
_signTypedData(domain, types, value) {
|
|
120
|
+
var _a, _b;
|
|
121
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
122
|
+
const populated = yield ethers_1.ethers.utils._TypedDataEncoder.resolveNames(domain, types, value, (name) => __awaiter(this, void 0, void 0, function* () {
|
|
123
|
+
if (!this.provider)
|
|
124
|
+
throw new Error('Cannot resolve ENS names without a provider');
|
|
125
|
+
const resolved = yield this.provider.resolveName(name);
|
|
126
|
+
if (!resolved)
|
|
127
|
+
throw new Error('No address found for domain name');
|
|
128
|
+
return resolved;
|
|
129
|
+
}));
|
|
130
|
+
const payload = ethers_1.ethers.utils._TypedDataEncoder.getPayload(populated.domain, types, populated.value);
|
|
131
|
+
const ledgerApp = new hw_app_eth_1.default(__classPrivateFieldGet(this, _LedgerSigner_transport, "f"));
|
|
132
|
+
(_a = __classPrivateFieldGet(this, _LedgerSigner_emitter, "f")) === null || _a === void 0 ? void 0 : _a.emit('getSignatureStart');
|
|
133
|
+
const obj = yield __classPrivateFieldGet(this, _LedgerSigner_instances, "m", _LedgerSigner_retry).call(this, () => ledgerApp.signEIP712Message(__classPrivateFieldGet(this, _LedgerSigner_path, "f"), payload));
|
|
134
|
+
(_b = __classPrivateFieldGet(this, _LedgerSigner_emitter, "f")) === null || _b === void 0 ? void 0 : _b.emit('getSignatureEnd');
|
|
135
|
+
// Normalize the signature for Ethers
|
|
136
|
+
obj.r = '0x' + obj.r;
|
|
137
|
+
obj.s = '0x' + obj.s;
|
|
138
|
+
return ethers_1.ethers.utils.joinSignature(obj);
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
exports.LedgerSigner = LedgerSigner;
|
|
143
|
+
_LedgerSigner_transport = new WeakMap(), _LedgerSigner_emitter = new WeakMap(), _LedgerSigner_path = new WeakMap(), _LedgerSigner_instances = new WeakSet(), _LedgerSigner_retry = function _LedgerSigner_retry(callback) {
|
|
144
|
+
// eslint-disable-next-line no-async-promise-executor
|
|
145
|
+
return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
|
146
|
+
// Wait up to 5 seconds
|
|
147
|
+
for (let i = 0; i < 50; i++) {
|
|
148
|
+
try {
|
|
149
|
+
const result = yield callback();
|
|
150
|
+
return resolve(result);
|
|
151
|
+
}
|
|
152
|
+
catch (error) {
|
|
153
|
+
if (error.id !== 'TransportLocked') {
|
|
154
|
+
return reject(error);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
yield wait(100);
|
|
158
|
+
}
|
|
159
|
+
return reject(new Error('timeout'));
|
|
160
|
+
}));
|
|
161
|
+
};
|
|
44
162
|
class LedgerServiceEthereum {
|
|
45
163
|
constructor(getLedgerTransport) {
|
|
46
164
|
this.getLedgerTransport = getLedgerTransport;
|
|
47
|
-
|
|
165
|
+
this.emitter = new events_1.default();
|
|
48
166
|
}
|
|
49
167
|
getAddress(transport) {
|
|
50
168
|
return __awaiter(this, void 0, void 0, function* () {
|
|
51
|
-
const
|
|
52
|
-
|
|
53
|
-
return address;
|
|
169
|
+
const signer = new LedgerSigner(transport);
|
|
170
|
+
return yield signer.getAddress();
|
|
54
171
|
});
|
|
55
172
|
}
|
|
56
173
|
getPublicKey(transport) {
|
|
57
174
|
return __awaiter(this, void 0, void 0, function* () {
|
|
58
|
-
const
|
|
59
|
-
|
|
60
|
-
return '0x' + publicKey;
|
|
175
|
+
const signer = new LedgerSigner(transport);
|
|
176
|
+
return yield signer.getPublicKey();
|
|
61
177
|
});
|
|
62
178
|
}
|
|
63
|
-
|
|
64
|
-
return
|
|
65
|
-
return (transaction) => __awaiter(this, void 0, void 0, function* () {
|
|
66
|
-
const ledgerApp = new hw_app_eth_1.default(transport);
|
|
67
|
-
const unsignedTransaction = Object.assign(Object.assign({}, transaction), { nonce: transaction.nonce ? ethers_1.ethers.BigNumber.from(transaction.nonce).toNumber() : undefined });
|
|
68
|
-
const serializedUnsignedTransaction = ethers_1.ethers.utils.serializeTransaction(unsignedTransaction).substring(2);
|
|
69
|
-
const resolution = yield hw_app_eth_1.ledgerService.resolveTransaction(serializedUnsignedTransaction, {}, {});
|
|
70
|
-
const signature = yield ledgerApp.signTransaction(__classPrivateFieldGet(this, _LedgerServiceEthereum_defaultPath, "f"), serializedUnsignedTransaction, resolution);
|
|
71
|
-
return ethers_1.ethers.utils.serializeTransaction(unsignedTransaction, {
|
|
72
|
-
v: ethers_1.ethers.BigNumber.from('0x' + signature.v).toNumber(),
|
|
73
|
-
r: '0x' + signature.r,
|
|
74
|
-
s: '0x' + signature.s,
|
|
75
|
-
});
|
|
76
|
-
});
|
|
77
|
-
});
|
|
179
|
+
getSigner(transport) {
|
|
180
|
+
return new LedgerSigner(transport, undefined, this.emitter);
|
|
78
181
|
}
|
|
79
182
|
}
|
|
80
183
|
exports.LedgerServiceEthereum = LedgerServiceEthereum;
|
|
81
|
-
|
|
184
|
+
function wait(duration) {
|
|
185
|
+
return new Promise(resolve => {
|
|
186
|
+
setTimeout(resolve, duration);
|
|
187
|
+
});
|
|
188
|
+
}
|
package/dist/constants.d.ts
CHANGED
|
@@ -14,3 +14,4 @@ export declare const GHOSTMARKET_CHAIN_BY_NETWORK_TYPE: Partial<Record<NetworkTy
|
|
|
14
14
|
export declare const DERIVATION_PATH = "m/44'/60'/0'/0/?";
|
|
15
15
|
export declare const RPC_LIST_BY_NETWORK_TYPE: Record<NetworkType, string[]>;
|
|
16
16
|
export declare const DEFAULT_URL_BY_NETWORK_TYPE: Record<NetworkType, string>;
|
|
17
|
+
export declare const DEFAULT_PATH = "44'/60'/0'/0/0";
|
package/dist/constants.js
CHANGED
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.DEFAULT_URL_BY_NETWORK_TYPE = exports.RPC_LIST_BY_NETWORK_TYPE = exports.DERIVATION_PATH = exports.GHOSTMARKET_CHAIN_BY_NETWORK_TYPE = exports.GHOSTMARKET_URL_BY_NETWORK_TYPE = exports.BITQUERY_MIRROR_NETWORK_BY_NETWORK_TYPE = exports.BITQUERY_MIRROR_URL = exports.NATIVE_ASSETS = exports.TOKENS = void 0;
|
|
6
|
+
exports.DEFAULT_PATH = exports.DEFAULT_URL_BY_NETWORK_TYPE = exports.RPC_LIST_BY_NETWORK_TYPE = exports.DERIVATION_PATH = exports.GHOSTMARKET_CHAIN_BY_NETWORK_TYPE = exports.GHOSTMARKET_URL_BY_NETWORK_TYPE = exports.BITQUERY_MIRROR_NETWORK_BY_NETWORK_TYPE = exports.BITQUERY_MIRROR_URL = exports.NATIVE_ASSETS = exports.TOKENS = void 0;
|
|
7
7
|
const common_json_1 = __importDefault(require("./assets/tokens/common.json"));
|
|
8
8
|
exports.TOKENS = {
|
|
9
9
|
mainnet: [...common_json_1.default],
|
|
@@ -49,3 +49,4 @@ exports.DEFAULT_URL_BY_NETWORK_TYPE = {
|
|
|
49
49
|
testnet: exports.RPC_LIST_BY_NETWORK_TYPE.testnet[0],
|
|
50
50
|
custom: exports.RPC_LIST_BY_NETWORK_TYPE.custom[0],
|
|
51
51
|
};
|
|
52
|
+
exports.DEFAULT_PATH = "44'/60'/0'/0/0";
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -20,4 +20,4 @@ __exportStar(require("./constants"), exports);
|
|
|
20
20
|
__exportStar(require("./BitqueryBDSEthereum"), exports);
|
|
21
21
|
__exportStar(require("./BitqueryEDSEthereum"), exports);
|
|
22
22
|
__exportStar(require("./RpcBDSEthereum"), exports);
|
|
23
|
-
__exportStar(require("./
|
|
23
|
+
__exportStar(require("./LedgerServiceEthereum"), exports);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cityofzion/bs-ethereum",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"repository": "https://github.com/CityOfZion/blockchain-services",
|
|
@@ -21,7 +21,9 @@
|
|
|
21
21
|
"@ledgerhq/hw-transport-node-hid": "~6.28.5",
|
|
22
22
|
"@ledgerhq/hw-transport": "~6.30.5",
|
|
23
23
|
"@ledgerhq/hw-app-eth": "~6.35.7",
|
|
24
|
-
"@
|
|
24
|
+
"@ethersproject/abstract-signer": "~5.7.0",
|
|
25
|
+
"@ethersproject/properties": "~5.7.0",
|
|
26
|
+
"@cityofzion/blockchain-service": "0.12.0"
|
|
25
27
|
},
|
|
26
28
|
"devDependencies": {
|
|
27
29
|
"@types/jest": "29.5.3",
|