@shapeshiftoss/hdwallet-keepkey 1.62.39 → 1.62.42
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/LICENSE.md +6 -6
- package/dist/cjs/.tsbuildinfo +1 -0
- package/dist/{adapter.d.ts → cjs/adapter.d.ts} +6 -7
- package/dist/cjs/adapter.js +146 -0
- package/dist/{binance.d.ts → cjs/binance.d.ts} +3 -4
- package/dist/cjs/binance.js +144 -0
- package/dist/{bitcoin.d.ts → cjs/bitcoin.d.ts} +3 -4
- package/dist/cjs/bitcoin.js +549 -0
- package/dist/{bnbencoding.d.ts → cjs/bnbencoding.d.ts} +3 -2
- package/dist/{bnbencoding.js → cjs/bnbencoding.js} +22 -22
- package/dist/{cosmos.d.ts → cjs/cosmos.d.ts} +4 -5
- package/dist/cjs/cosmos.js +219 -0
- package/dist/{eos.d.ts → cjs/eos.d.ts} +3 -4
- package/dist/cjs/eos.js +244 -0
- package/dist/{ethereum.d.ts → cjs/ethereum.d.ts} +4 -5
- package/dist/cjs/ethereum.js +264 -0
- package/dist/cjs/index.d.ts +5 -0
- package/dist/{index.js → cjs/index.js} +0 -1
- package/dist/{keepkey.d.ts → cjs/keepkey.d.ts} +45 -20
- package/dist/cjs/keepkey.js +959 -0
- package/dist/{mayachain.d.ts → cjs/mayachain.d.ts} +4 -5
- package/dist/cjs/mayachain.js +169 -0
- package/dist/{osmosis.d.ts → cjs/osmosis.d.ts} +4 -5
- package/dist/cjs/osmosis.js +270 -0
- package/dist/cjs/package.json +1 -0
- package/dist/{ripple.d.ts → cjs/ripple.d.ts} +3 -4
- package/dist/cjs/ripple.js +104 -0
- package/dist/{thorchain.d.ts → cjs/thorchain.d.ts} +4 -5
- package/dist/cjs/thorchain.js +169 -0
- package/dist/{transport.d.ts → cjs/transport.d.ts} +2 -3
- package/dist/cjs/transport.js +333 -0
- package/dist/{typeRegistry.d.ts → cjs/typeRegistry.d.ts} +2 -3
- package/dist/{typeRegistry.js → cjs/typeRegistry.js} +26 -13
- package/dist/{utils.d.ts → cjs/utils.d.ts} +1 -2
- package/dist/{utils.js → cjs/utils.js} +7 -8
- package/dist/esm/.tsbuildinfo +1 -0
- package/dist/esm/adapter.d.ts +35 -0
- package/dist/esm/adapter.js +119 -0
- package/dist/esm/binance.d.ts +5 -0
- package/dist/esm/binance.js +112 -0
- package/dist/esm/bitcoin.d.ts +11 -0
- package/dist/esm/bitcoin.js +511 -0
- package/dist/esm/bnbencoding.d.ts +11 -0
- package/dist/esm/bnbencoding.js +103 -0
- package/dist/esm/cosmos.d.ts +6 -0
- package/dist/esm/cosmos.js +187 -0
- package/dist/esm/eos.d.ts +5 -0
- package/dist/esm/eos.js +212 -0
- package/dist/esm/ethereum.d.ts +17 -0
- package/dist/esm/ethereum.js +229 -0
- package/dist/esm/index.d.ts +5 -0
- package/dist/esm/index.js +5 -0
- package/dist/esm/keepkey.d.ts +177 -0
- package/dist/esm/keepkey.js +925 -0
- package/dist/esm/mayachain.d.ts +6 -0
- package/dist/esm/mayachain.js +137 -0
- package/dist/esm/osmosis.d.ts +6 -0
- package/dist/esm/osmosis.js +238 -0
- package/dist/esm/ripple.d.ts +5 -0
- package/dist/esm/ripple.js +72 -0
- package/dist/esm/thorchain.d.ts +6 -0
- package/dist/esm/thorchain.js +137 -0
- package/dist/esm/transport.d.ts +55 -0
- package/dist/esm/transport.js +306 -0
- package/dist/esm/typeRegistry.d.ts +4 -0
- package/dist/esm/typeRegistry.js +47 -0
- package/dist/esm/utils.d.ts +6 -0
- package/dist/esm/utils.js +56 -0
- package/package.json +33 -19
- package/dist/adapter.d.ts.map +0 -1
- package/dist/adapter.js +0 -175
- package/dist/adapter.js.map +0 -1
- package/dist/binance.d.ts.map +0 -1
- package/dist/binance.js +0 -146
- package/dist/binance.js.map +0 -1
- package/dist/bitcoin.d.ts.map +0 -1
- package/dist/bitcoin.js +0 -568
- package/dist/bitcoin.js.map +0 -1
- package/dist/bnbencoding.d.ts.map +0 -1
- package/dist/bnbencoding.js.map +0 -1
- package/dist/cosmos.d.ts.map +0 -1
- package/dist/cosmos.js +0 -230
- package/dist/cosmos.js.map +0 -1
- package/dist/eos.d.ts.map +0 -1
- package/dist/eos.js +0 -247
- package/dist/eos.js.map +0 -1
- package/dist/ethereum.d.ts.map +0 -1
- package/dist/ethereum.js +0 -281
- package/dist/ethereum.js.map +0 -1
- package/dist/index.d.ts +0 -6
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/keepkey.d.ts.map +0 -1
- package/dist/keepkey.js +0 -1027
- package/dist/keepkey.js.map +0 -1
- package/dist/mayachain.d.ts.map +0 -1
- package/dist/mayachain.js +0 -180
- package/dist/mayachain.js.map +0 -1
- package/dist/osmosis.d.ts.map +0 -1
- package/dist/osmosis.js +0 -278
- package/dist/osmosis.js.map +0 -1
- package/dist/ripple.d.ts.map +0 -1
- package/dist/ripple.js +0 -111
- package/dist/ripple.js.map +0 -1
- package/dist/thorchain.d.ts.map +0 -1
- package/dist/thorchain.js +0 -180
- package/dist/thorchain.js.map +0 -1
- package/dist/transport.d.ts.map +0 -1
- package/dist/transport.js +0 -365
- package/dist/transport.js.map +0 -1
- package/dist/typeRegistry.d.ts.map +0 -1
- package/dist/typeRegistry.js.map +0 -1
- package/dist/utils.d.ts.map +0 -1
- package/dist/utils.js.map +0 -1
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.ethVerifyMessage = exports.ethSignTypedData = exports.ethSignMessage = exports.ethGetAddress = exports.ethSignTx = exports.ethGetAccountPaths = exports.ethSupportsNativeShapeShift = exports.ethSupportsSecureTransfer = exports.ethSupportsNetwork = void 0;
|
|
27
|
+
const common_1 = require("@ethereumjs/common");
|
|
28
|
+
const tx_1 = require("@ethereumjs/tx");
|
|
29
|
+
const Messages = __importStar(require("@keepkey/device-protocol/lib/messages_pb"));
|
|
30
|
+
const Ethereum = __importStar(require("@keepkey/device-protocol/lib/messages-ethereum_pb"));
|
|
31
|
+
const Types = __importStar(require("@keepkey/device-protocol/lib/types_pb"));
|
|
32
|
+
const eth_sig_util_1 = require("@metamask/eth-sig-util");
|
|
33
|
+
const core = __importStar(require("@shapeshiftoss/hdwallet-core"));
|
|
34
|
+
const eip55 = __importStar(require("eip55"));
|
|
35
|
+
const utils_js_1 = require("ethers/lib/utils.js");
|
|
36
|
+
const utils_1 = require("./utils");
|
|
37
|
+
async function ethSupportsNetwork(_chainId) {
|
|
38
|
+
return true;
|
|
39
|
+
}
|
|
40
|
+
exports.ethSupportsNetwork = ethSupportsNetwork;
|
|
41
|
+
async function ethSupportsSecureTransfer() {
|
|
42
|
+
return true;
|
|
43
|
+
}
|
|
44
|
+
exports.ethSupportsSecureTransfer = ethSupportsSecureTransfer;
|
|
45
|
+
function ethSupportsNativeShapeShift() {
|
|
46
|
+
return true;
|
|
47
|
+
}
|
|
48
|
+
exports.ethSupportsNativeShapeShift = ethSupportsNativeShapeShift;
|
|
49
|
+
function ethGetAccountPaths(msg) {
|
|
50
|
+
const slip44 = core.slip44ByCoin(msg.coin);
|
|
51
|
+
if (slip44 === undefined)
|
|
52
|
+
return [];
|
|
53
|
+
return [
|
|
54
|
+
{
|
|
55
|
+
addressNList: [0x80000000 + 44, 0x80000000 + slip44, 0x80000000 + msg.accountIdx, 0, 0],
|
|
56
|
+
hardenedPath: [0x80000000 + 44, 0x80000000 + slip44, 0x80000000 + msg.accountIdx],
|
|
57
|
+
relPath: [0, 0],
|
|
58
|
+
description: 'KeepKey',
|
|
59
|
+
},
|
|
60
|
+
];
|
|
61
|
+
}
|
|
62
|
+
exports.ethGetAccountPaths = ethGetAccountPaths;
|
|
63
|
+
function stripLeadingZeroes(buf) {
|
|
64
|
+
const firstZeroIndex = buf.findIndex(x => x !== 0);
|
|
65
|
+
return buf.slice(firstZeroIndex !== -1 ? firstZeroIndex : buf.length);
|
|
66
|
+
}
|
|
67
|
+
async function ethSignTx(transport, msg) {
|
|
68
|
+
return transport.lockDuring(async () => {
|
|
69
|
+
const est = new Ethereum.EthereumSignTx();
|
|
70
|
+
est.setAddressNList(msg.addressNList);
|
|
71
|
+
est.setNonce(stripLeadingZeroes(core.arrayify(msg.nonce)));
|
|
72
|
+
est.setGasLimit(core.arrayify(msg.gasLimit));
|
|
73
|
+
if (msg.gasPrice) {
|
|
74
|
+
est.setGasPrice(core.arrayify(msg.gasPrice));
|
|
75
|
+
}
|
|
76
|
+
if (msg.maxFeePerGas) {
|
|
77
|
+
est.setMaxFeePerGas(core.arrayify(msg.maxFeePerGas));
|
|
78
|
+
est.setType(core.ETHTransactionType.ETH_TX_TYPE_EIP_1559);
|
|
79
|
+
if (msg.maxPriorityFeePerGas) {
|
|
80
|
+
est.setMaxPriorityFeePerGas(core.arrayify(msg.maxPriorityFeePerGas));
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
if (msg.value.match('^0x0*$') === null) {
|
|
84
|
+
est.setValue(core.arrayify(msg.value));
|
|
85
|
+
}
|
|
86
|
+
if (msg.toAddressNList) {
|
|
87
|
+
est.setAddressType(Types.OutputAddressType.SPEND);
|
|
88
|
+
est.setToAddressNList(msg.toAddressNList);
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
est.setAddressType(Types.OutputAddressType.SPEND);
|
|
92
|
+
}
|
|
93
|
+
if (msg.to) {
|
|
94
|
+
est.setTo(core.arrayify(msg.to));
|
|
95
|
+
}
|
|
96
|
+
let dataChunk = null;
|
|
97
|
+
let dataRemaining = undefined;
|
|
98
|
+
if (msg.data) {
|
|
99
|
+
dataRemaining = core.arrayify(msg.data);
|
|
100
|
+
est.setDataLength(dataRemaining.length);
|
|
101
|
+
dataChunk = dataRemaining.slice(0, 1024);
|
|
102
|
+
dataRemaining = dataRemaining.slice(dataChunk.length);
|
|
103
|
+
est.setDataInitialChunk(dataChunk);
|
|
104
|
+
}
|
|
105
|
+
if (msg.chainId !== undefined) {
|
|
106
|
+
est.setChainId(msg.chainId);
|
|
107
|
+
}
|
|
108
|
+
let response;
|
|
109
|
+
let nextResponse = await transport.call(Messages.MessageType.MESSAGETYPE_ETHEREUMSIGNTX, est, {
|
|
110
|
+
msgTimeout: core.LONG_TIMEOUT,
|
|
111
|
+
omitLock: true,
|
|
112
|
+
});
|
|
113
|
+
response = nextResponse.proto;
|
|
114
|
+
try {
|
|
115
|
+
const esa = new Ethereum.EthereumTxAck();
|
|
116
|
+
while (response.hasDataLength()) {
|
|
117
|
+
const dataLength = response.getDataLength();
|
|
118
|
+
dataRemaining = core.mustBeDefined(dataRemaining);
|
|
119
|
+
dataChunk = dataRemaining.slice(0, dataLength);
|
|
120
|
+
dataRemaining = dataRemaining.slice(dataLength, dataRemaining.length);
|
|
121
|
+
esa.setDataChunk(dataChunk);
|
|
122
|
+
nextResponse = await transport.call(Messages.MessageType.MESSAGETYPE_ETHEREUMTXACK, esa, {
|
|
123
|
+
msgTimeout: core.LONG_TIMEOUT,
|
|
124
|
+
omitLock: true,
|
|
125
|
+
});
|
|
126
|
+
response = nextResponse.proto;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
catch (error) {
|
|
130
|
+
console.error({ error });
|
|
131
|
+
throw new Error('Failed to sign ETH transaction');
|
|
132
|
+
}
|
|
133
|
+
const utxBase = {
|
|
134
|
+
to: msg.to,
|
|
135
|
+
value: msg.value,
|
|
136
|
+
data: msg.data,
|
|
137
|
+
chainId: msg.chainId,
|
|
138
|
+
nonce: msg.nonce,
|
|
139
|
+
gasLimit: msg.gasLimit,
|
|
140
|
+
maxFeePerGas: msg.maxFeePerGas,
|
|
141
|
+
maxPriorityFeePerGas: msg.maxPriorityFeePerGas,
|
|
142
|
+
};
|
|
143
|
+
const r = '0x' + core.toHexString(response.getSignatureR_asU8());
|
|
144
|
+
const s = '0x' + core.toHexString(response.getSignatureS_asU8());
|
|
145
|
+
if (!response.hasSignatureV())
|
|
146
|
+
throw new Error('could not get v');
|
|
147
|
+
const v = core.mustBeDefined(response.getSignatureV());
|
|
148
|
+
const v2 = '0x' + v.toString(16);
|
|
149
|
+
const common = common_1.Common.custom({ chainId: msg.chainId });
|
|
150
|
+
const tx = msg.maxFeePerGas
|
|
151
|
+
? tx_1.FeeMarketEIP1559Transaction.fromTxData({
|
|
152
|
+
...utxBase,
|
|
153
|
+
maxFeePerGas: msg.maxFeePerGas,
|
|
154
|
+
maxPriorityFeePerGas: msg.maxPriorityFeePerGas,
|
|
155
|
+
r,
|
|
156
|
+
s,
|
|
157
|
+
v: v2,
|
|
158
|
+
})
|
|
159
|
+
: tx_1.Transaction.fromTxData({ ...utxBase, gasPrice: msg.gasPrice, r, s, v: v2 }, { common });
|
|
160
|
+
return {
|
|
161
|
+
r,
|
|
162
|
+
s,
|
|
163
|
+
v,
|
|
164
|
+
serialized: '0x' + core.toHexString(tx.serialize()),
|
|
165
|
+
};
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
exports.ethSignTx = ethSignTx;
|
|
169
|
+
async function ethGetAddress(transport, msg) {
|
|
170
|
+
const getAddr = new Ethereum.EthereumGetAddress();
|
|
171
|
+
getAddr.setAddressNList(msg.addressNList);
|
|
172
|
+
getAddr.setShowDisplay(msg.showDisplay !== false);
|
|
173
|
+
const response = await transport.call(Messages.MessageType.MESSAGETYPE_ETHEREUMGETADDRESS, getAddr, {
|
|
174
|
+
msgTimeout: core.LONG_TIMEOUT,
|
|
175
|
+
});
|
|
176
|
+
const ethAddress = response.proto;
|
|
177
|
+
let address;
|
|
178
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
179
|
+
if (ethAddress.hasAddressStr())
|
|
180
|
+
address = ethAddress.getAddressStr();
|
|
181
|
+
else if (ethAddress.hasAddress())
|
|
182
|
+
address = '0x' + core.toHexString(ethAddress.getAddress_asU8());
|
|
183
|
+
else
|
|
184
|
+
throw new Error('Unable to obtain ETH address from device.');
|
|
185
|
+
return address;
|
|
186
|
+
}
|
|
187
|
+
exports.ethGetAddress = ethGetAddress;
|
|
188
|
+
async function ethSignMessage(transport, msg) {
|
|
189
|
+
const { addressNList, message } = msg;
|
|
190
|
+
if (!(0, utils_js_1.isHexString)(message))
|
|
191
|
+
throw new Error('data is not an hex string');
|
|
192
|
+
const m = new Ethereum.EthereumSignMessage();
|
|
193
|
+
m.setAddressNList(addressNList);
|
|
194
|
+
const messageBytes = (0, utils_js_1.arrayify)(message);
|
|
195
|
+
m.setMessage(messageBytes);
|
|
196
|
+
const response = await transport.call(Messages.MessageType.MESSAGETYPE_ETHEREUMSIGNMESSAGE, m, {
|
|
197
|
+
msgTimeout: core.LONG_TIMEOUT,
|
|
198
|
+
});
|
|
199
|
+
const sig = response.proto;
|
|
200
|
+
return {
|
|
201
|
+
address: eip55.encode('0x' + core.toHexString(sig.getAddress_asU8())),
|
|
202
|
+
signature: '0x' + core.toHexString(sig.getSignature_asU8()),
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
exports.ethSignMessage = ethSignMessage;
|
|
206
|
+
/**
|
|
207
|
+
* Supports EIP-712 eth_signTypedData_v4
|
|
208
|
+
* https://docs.metamask.io/wallet/how-to/sign-data/#use-eth_signtypeddata_v4
|
|
209
|
+
* Due to lack of firmware support, a hashed version of the data is
|
|
210
|
+
* displayed to the user on the device when signing
|
|
211
|
+
*/
|
|
212
|
+
async function ethSignTypedData(transport, msg) {
|
|
213
|
+
try {
|
|
214
|
+
const version = eth_sig_util_1.SignTypedDataVersion.V4;
|
|
215
|
+
const EIP_712_DOMAIN = 'EIP712Domain';
|
|
216
|
+
const { types, primaryType, domain, message } = msg.typedData;
|
|
217
|
+
const domainSeparatorHash = eth_sig_util_1.TypedDataUtils.hashStruct(EIP_712_DOMAIN, domain, types, version);
|
|
218
|
+
const ethereumSignTypedHash = new Ethereum.EthereumSignTypedHash();
|
|
219
|
+
ethereumSignTypedHash.setAddressNList(msg.addressNList);
|
|
220
|
+
ethereumSignTypedHash.setDomainSeparatorHash(domainSeparatorHash);
|
|
221
|
+
let messageHash = undefined;
|
|
222
|
+
// If "EIP712Domain" is the primaryType, messageHash is not required - look at T1 connect impl ;)
|
|
223
|
+
// todo: the firmware should define messageHash as an optional Uint8Array field for this case
|
|
224
|
+
if (primaryType !== EIP_712_DOMAIN) {
|
|
225
|
+
messageHash = eth_sig_util_1.TypedDataUtils.hashStruct(primaryType, message, types, version);
|
|
226
|
+
ethereumSignTypedHash.setMessageHash(messageHash);
|
|
227
|
+
}
|
|
228
|
+
const response = await transport.call(Messages.MessageType.MESSAGETYPE_ETHEREUMSIGNTYPEDHASH, ethereumSignTypedHash, {
|
|
229
|
+
msgTimeout: core.LONG_TIMEOUT,
|
|
230
|
+
});
|
|
231
|
+
const result = response.proto;
|
|
232
|
+
const res = {
|
|
233
|
+
address: result.getAddress() || '',
|
|
234
|
+
signature: '0x' + core.toHexString(result.getSignature_asU8()),
|
|
235
|
+
};
|
|
236
|
+
return res;
|
|
237
|
+
}
|
|
238
|
+
catch (error) {
|
|
239
|
+
console.error({ error });
|
|
240
|
+
throw new Error('Failed to sign typed ETH message');
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
exports.ethSignTypedData = ethSignTypedData;
|
|
244
|
+
async function ethVerifyMessage(transport, msg) {
|
|
245
|
+
const m = new Ethereum.EthereumVerifyMessage();
|
|
246
|
+
m.setAddress(core.arrayify(msg.address));
|
|
247
|
+
m.setSignature(core.arrayify(msg.signature));
|
|
248
|
+
m.setMessage((0, utils_js_1.isBytes)(msg.message) ? (0, utils_js_1.arrayify)(msg.message) : (0, utils_1.toUTF8Array)(msg.message));
|
|
249
|
+
let event;
|
|
250
|
+
try {
|
|
251
|
+
event = await transport.call(Messages.MessageType.MESSAGETYPE_ETHEREUMVERIFYMESSAGE, m, {
|
|
252
|
+
msgTimeout: core.LONG_TIMEOUT,
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
catch (e) {
|
|
256
|
+
if (core.isIndexable(e) && e.message_enum === Messages.MessageType.MESSAGETYPE_FAILURE) {
|
|
257
|
+
return false;
|
|
258
|
+
}
|
|
259
|
+
throw e;
|
|
260
|
+
}
|
|
261
|
+
const success = event.proto;
|
|
262
|
+
return success.getMessage() === 'Message verified';
|
|
263
|
+
}
|
|
264
|
+
exports.ethVerifyMessage = ethVerifyMessage;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import * as
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
/// <reference types="node" />
|
|
3
|
+
import * as Messages from '@keepkey/device-protocol/lib/messages_pb';
|
|
4
|
+
import * as Types from '@keepkey/device-protocol/lib/types_pb';
|
|
5
|
+
import type { Address } from '@shapeshiftoss/hdwallet-core';
|
|
6
|
+
import * as core from '@shapeshiftoss/hdwallet-core';
|
|
7
|
+
import type { Transport } from './transport';
|
|
6
8
|
export declare function isKeepKey(wallet: core.HDWallet): wallet is KeepKeyHDWallet;
|
|
7
9
|
export declare class KeepKeyHDWalletInfo implements core.HDWalletInfo, core.BTCWalletInfo, core.ETHWalletInfo, core.CosmosWalletInfo, core.OsmosisWalletInfo, core.BinanceWalletInfo, core.RippleWalletInfo, core.EosWalletInfo, core.ThorchainWalletInfo, core.MayachainWalletInfo {
|
|
8
10
|
readonly _supportsBTCInfo = true;
|
|
@@ -19,24 +21,24 @@ export declare class KeepKeyHDWalletInfo implements core.HDWalletInfo, core.BTCW
|
|
|
19
21
|
btcSupportsScriptType(coin: core.Coin, scriptType: core.BTCInputScriptType): Promise<boolean>;
|
|
20
22
|
btcSupportsSecureTransfer(): Promise<boolean>;
|
|
21
23
|
btcSupportsNativeShapeShift(): boolean;
|
|
22
|
-
btcGetAccountPaths(msg: core.BTCGetAccountPaths):
|
|
24
|
+
btcGetAccountPaths(msg: core.BTCGetAccountPaths): core.BTCAccountPath[];
|
|
23
25
|
ethSupportsNetwork(chain_id: number): Promise<boolean>;
|
|
24
26
|
ethSupportsSecureTransfer(): Promise<boolean>;
|
|
25
27
|
ethSupportsNativeShapeShift(): boolean;
|
|
26
28
|
ethSupportsEIP1559(): Promise<boolean>;
|
|
27
|
-
ethGetAccountPaths(msg: core.ETHGetAccountPath):
|
|
28
|
-
cosmosGetAccountPaths(msg: core.CosmosGetAccountPaths):
|
|
29
|
-
osmosisGetAccountPaths(msg: core.OsmosisGetAccountPaths):
|
|
30
|
-
thorchainGetAccountPaths(msg: core.ThorchainGetAccountPaths):
|
|
31
|
-
mayachainGetAccountPaths(msg: core.MayachainGetAccountPaths):
|
|
32
|
-
rippleGetAccountPaths(msg: core.RippleGetAccountPaths):
|
|
33
|
-
binanceGetAccountPaths(msg: core.BinanceGetAccountPaths):
|
|
34
|
-
eosGetAccountPaths(msg: core.EosGetAccountPaths):
|
|
29
|
+
ethGetAccountPaths(msg: core.ETHGetAccountPath): core.ETHAccountPath[];
|
|
30
|
+
cosmosGetAccountPaths(msg: core.CosmosGetAccountPaths): core.CosmosAccountPath[];
|
|
31
|
+
osmosisGetAccountPaths(msg: core.OsmosisGetAccountPaths): core.OsmosisAccountPath[];
|
|
32
|
+
thorchainGetAccountPaths(msg: core.ThorchainGetAccountPaths): core.ThorchainAccountPath[];
|
|
33
|
+
mayachainGetAccountPaths(msg: core.MayachainGetAccountPaths): core.MayachainAccountPath[];
|
|
34
|
+
rippleGetAccountPaths(msg: core.RippleGetAccountPaths): core.RippleAccountPath[];
|
|
35
|
+
binanceGetAccountPaths(msg: core.BinanceGetAccountPaths): core.BinanceAccountPath[];
|
|
36
|
+
eosGetAccountPaths(msg: core.EosGetAccountPaths): core.EosAccountPath[];
|
|
35
37
|
hasOnDevicePinEntry(): boolean;
|
|
36
38
|
hasOnDevicePassphrase(): boolean;
|
|
37
39
|
hasOnDeviceDisplay(): boolean;
|
|
38
40
|
hasOnDeviceRecovery(): boolean;
|
|
39
|
-
hasNativeShapeShift(
|
|
41
|
+
hasNativeShapeShift(_srcCoin: core.Coin, _dstCoin: core.Coin): boolean;
|
|
40
42
|
supportsBip44Accounts(): boolean;
|
|
41
43
|
supportsOfflineSigning(): boolean;
|
|
42
44
|
supportsBroadcast(): boolean;
|
|
@@ -66,8 +68,32 @@ export declare class KeepKeyHDWallet extends KeepKeyHDWalletInfo implements core
|
|
|
66
68
|
readonly _supportsBase = true;
|
|
67
69
|
readonly _supportsMonad = false;
|
|
68
70
|
readonly _supportsPlasma = false;
|
|
71
|
+
readonly _supportsPlume = false;
|
|
69
72
|
readonly _supportsKatana = false;
|
|
73
|
+
readonly _supportsEthereal = false;
|
|
74
|
+
readonly _supportsStory = false;
|
|
75
|
+
readonly _supportsSonic = false;
|
|
76
|
+
readonly _supportsBob = false;
|
|
77
|
+
readonly _supportsMode = false;
|
|
78
|
+
readonly _supportsSei = false;
|
|
70
79
|
readonly _supportsHyperEvm = false;
|
|
80
|
+
readonly _supportsMantle = false;
|
|
81
|
+
readonly _supportsInk = false;
|
|
82
|
+
readonly _supportsMegaEth = false;
|
|
83
|
+
readonly _supportsZkSyncEra = false;
|
|
84
|
+
readonly _supportsBlast = false;
|
|
85
|
+
readonly _supportsAbstract = false;
|
|
86
|
+
readonly _supportsWorldChain = false;
|
|
87
|
+
readonly _supportsHemi = false;
|
|
88
|
+
readonly _supportsFlowEvm = false;
|
|
89
|
+
readonly _supportsCelo = false;
|
|
90
|
+
readonly _supportsBerachain = false;
|
|
91
|
+
readonly _supportsLinea = false;
|
|
92
|
+
readonly _supportsScroll = false;
|
|
93
|
+
readonly _supportsCronos = false;
|
|
94
|
+
readonly _supportsUnichain = false;
|
|
95
|
+
readonly _supportsSoneium = false;
|
|
96
|
+
readonly _supportsRobinhood = false;
|
|
71
97
|
readonly _supportsBTC = true;
|
|
72
98
|
_supportsCosmos: boolean;
|
|
73
99
|
_supportsOsmosis: boolean;
|
|
@@ -88,7 +114,7 @@ export declare class KeepKeyHDWallet extends KeepKeyHDWalletInfo implements core
|
|
|
88
114
|
getLabel(): Promise<string>;
|
|
89
115
|
isInitialized(): Promise<boolean>;
|
|
90
116
|
isLocked(): Promise<boolean>;
|
|
91
|
-
getPublicKeys(getPublicKeys:
|
|
117
|
+
getPublicKeys(getPublicKeys: core.GetPublicKey[]): Promise<(core.PublicKey | null)[]>;
|
|
92
118
|
ping(msg: core.Ping): Promise<core.Pong>;
|
|
93
119
|
reset(msg: core.ResetDevice): Promise<void>;
|
|
94
120
|
recover(r: core.RecoverDevice): Promise<void>;
|
|
@@ -100,15 +126,15 @@ export declare class KeepKeyHDWallet extends KeepKeyHDWalletInfo implements core
|
|
|
100
126
|
sendCharacter(character: string): Promise<void>;
|
|
101
127
|
sendCharacterDelete(): Promise<void>;
|
|
102
128
|
sendCharacterDone(): Promise<void>;
|
|
103
|
-
sendWord(
|
|
129
|
+
sendWord(_word: string): Promise<void>;
|
|
104
130
|
sendCharacterProto(character: string, _delete: boolean, _done: boolean): Promise<any>;
|
|
105
131
|
applyPolicy(p: Required<Types.PolicyType.AsObject>): Promise<void>;
|
|
106
132
|
applySettings(s: Messages.ApplySettings.AsObject): Promise<void>;
|
|
107
133
|
cancel(): Promise<void>;
|
|
108
134
|
changePin(): Promise<void>;
|
|
109
|
-
cipherKeyValue(v: Messages.CipherKeyValue.AsObject & Required<Pick<Messages.CipherKeyValue.AsObject,
|
|
135
|
+
cipherKeyValue(v: Messages.CipherKeyValue.AsObject & Required<Pick<Messages.CipherKeyValue.AsObject, 'key'>>): Promise<string | Uint8Array>;
|
|
110
136
|
clearSession(): Promise<void>;
|
|
111
|
-
decryptKeyValue(v: Messages.CipherKeyValue.AsObject & Required<Pick<Messages.CipherKeyValue.AsObject,
|
|
137
|
+
decryptKeyValue(v: Messages.CipherKeyValue.AsObject & Required<Pick<Messages.CipherKeyValue.AsObject, 'key'>>): Promise<string | Uint8Array>;
|
|
112
138
|
firmwareErase(): Promise<void>;
|
|
113
139
|
firmwareUpload(firmware: Buffer): Promise<void>;
|
|
114
140
|
initialize(): Promise<Messages.Features.AsObject>;
|
|
@@ -149,4 +175,3 @@ export declare class KeepKeyHDWallet extends KeepKeyHDWalletInfo implements core
|
|
|
149
175
|
}
|
|
150
176
|
export declare function info(): KeepKeyHDWalletInfo;
|
|
151
177
|
export declare function create(transport: Transport): KeepKeyHDWallet;
|
|
152
|
-
//# sourceMappingURL=keepkey.d.ts.map
|