@shapeshiftoss/hdwallet-ledger 1.55.2 → 1.55.3

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/bitcoin.js CHANGED
@@ -1,126 +1,76 @@
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
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
- return new (P || (P = Promise))(function (resolve, reject) {
28
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
29
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
30
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
31
- step((generator = generator.apply(thisArg, _arguments || [])).next());
32
- });
33
- };
34
- var __importDefault = (this && this.__importDefault) || function (mod) {
35
- return (mod && mod.__esModule) ? mod : { "default": mod };
36
- };
37
- Object.defineProperty(exports, "__esModule", { value: true });
38
- exports.btcIsSameAccount = exports.btcGetAccountPaths = exports.btcVerifyMessage = exports.btcSignMessage = exports.btcSupportsNativeShapeShift = exports.btcSupportsSecureTransfer = exports.btcSignTx = exports.btcGetPublicKeys = exports.btcGetAddress = exports.btcSupportsScriptType = exports.btcSupportsCoin = exports.supportedCoins = void 0;
39
- const core = __importStar(require("@shapeshiftoss/hdwallet-core"));
40
- const base64_js_1 = __importDefault(require("base64-js"));
41
- const bchAddr = __importStar(require("bchaddrjs"));
42
- const bitcoin = __importStar(require("bitcoinjs-lib"));
43
- const bitcoinMsg = __importStar(require("bitcoinjs-message"));
44
- const lodash_1 = __importDefault(require("lodash"));
45
- const currencies_1 = require("./currencies");
46
- const utils_1 = require("./utils");
47
- const utxoUtils_1 = require("./utxoUtils");
48
- exports.supportedCoins = ["Testnet", "Bitcoin", "BitcoinCash", "Litecoin", "Dash", "DigiByte", "Dogecoin"];
1
+ import * as core from "@shapeshiftoss/hdwallet-core";
2
+ import Base64 from "base64-js";
3
+ import * as bchAddr from "bchaddrjs";
4
+ import * as bitcoin from "bitcoinjs-lib";
5
+ import * as bitcoinMsg from "bitcoinjs-message";
6
+ import _ from "lodash";
7
+ import { currencies } from "./currencies";
8
+ import { handleError, networksUtil, translateScriptType } from "./utils";
9
+ import { convertXpubVersion, scriptTypeToAccountType } from "./utxoUtils";
10
+ export const supportedCoins = ["Testnet", "Bitcoin", "BitcoinCash", "Litecoin", "Dash", "DigiByte", "Dogecoin"];
49
11
  const segwitCoins = ["Bitcoin", "DigiByte", "Litecoin", "BitcoinGold", "Testnet"];
50
- function btcSupportsCoin(coin) {
51
- return __awaiter(this, void 0, void 0, function* () {
52
- return exports.supportedCoins.includes(coin);
53
- });
12
+ export async function btcSupportsCoin(coin) {
13
+ return supportedCoins.includes(coin);
54
14
  }
55
- exports.btcSupportsCoin = btcSupportsCoin;
56
- function btcSupportsScriptType(coin, scriptType) {
57
- return __awaiter(this, void 0, void 0, function* () {
58
- const supported = {
59
- Bitcoin: [
60
- core.BTCInputScriptType.SpendAddress,
61
- core.BTCInputScriptType.SpendWitness,
62
- core.BTCInputScriptType.SpendP2SHWitness,
63
- ],
64
- BitcoinCash: [core.BTCInputScriptType.SpendAddress],
65
- };
66
- const scriptTypes = supported[coin];
67
- return !!scriptTypes && !!scriptType && scriptTypes.includes(scriptType);
68
- });
15
+ export async function btcSupportsScriptType(coin, scriptType) {
16
+ const supported = {
17
+ Bitcoin: [
18
+ core.BTCInputScriptType.SpendAddress,
19
+ core.BTCInputScriptType.SpendWitness,
20
+ core.BTCInputScriptType.SpendP2SHWitness,
21
+ ],
22
+ BitcoinCash: [core.BTCInputScriptType.SpendAddress],
23
+ };
24
+ const scriptTypes = supported[coin];
25
+ return !!scriptTypes && !!scriptType && scriptTypes.includes(scriptType);
69
26
  }
70
- exports.btcSupportsScriptType = btcSupportsScriptType;
71
- function btcGetAddress(transport, msg) {
72
- return __awaiter(this, void 0, void 0, function* () {
73
- const bip32path = core.addressNListToBIP32(msg.addressNList);
74
- const scriptTypeish = (() => {
75
- if (msg.coin === "BitcoinCash")
76
- return core.BTCInputScriptType.CashAddr;
77
- if (msg.scriptType)
78
- return msg.scriptType;
79
- return core.BTCInputScriptType.SpendAddress;
80
- })();
81
- const opts = {
82
- verify: !!msg.showDisplay,
83
- format: (0, utils_1.translateScriptType)(scriptTypeish),
84
- };
85
- const res = yield transport.call("Btc", "getWalletPublicKey", bip32path, opts);
86
- (0, utils_1.handleError)(res, transport, "Unable to obtain BTC address from device");
87
- const address = res.payload.bitcoinAddress;
88
- return msg.coin.toLowerCase() === "bitcoincash" ? bchAddr.toCashAddress(address) : address;
89
- });
27
+ export async function btcGetAddress(transport, msg) {
28
+ const bip32path = core.addressNListToBIP32(msg.addressNList);
29
+ const scriptTypeish = (() => {
30
+ if (msg.coin === "BitcoinCash")
31
+ return core.BTCInputScriptType.CashAddr;
32
+ if (msg.scriptType)
33
+ return msg.scriptType;
34
+ return core.BTCInputScriptType.SpendAddress;
35
+ })();
36
+ const opts = {
37
+ verify: !!msg.showDisplay,
38
+ format: translateScriptType(scriptTypeish),
39
+ };
40
+ const res = await transport.call("Btc", "getWalletPublicKey", bip32path, opts);
41
+ handleError(res, transport, "Unable to obtain BTC address from device");
42
+ const address = res.payload.bitcoinAddress;
43
+ return msg.coin.toLowerCase() === "bitcoincash" ? bchAddr.toCashAddress(address) : address;
90
44
  }
91
- exports.btcGetAddress = btcGetAddress;
92
45
  // Adapted from https://github.com/LedgerHQ/ledger-wallet-webtool
93
- function btcGetPublicKeys(transport, msg) {
94
- return __awaiter(this, void 0, void 0, function* () {
95
- const xpubs = [];
96
- for (const getPublicKey of msg) {
97
- const { addressNList, coin } = getPublicKey;
98
- if (!coin)
99
- throw new Error("coin is required");
100
- if (!getPublicKey.scriptType)
101
- throw new Error("scriptType is required");
102
- const parentBip32path = core.addressNListToBIP32(addressNList);
103
- const getWalletXpubResponse = yield transport.call("Btc", "getWalletXpub", {
104
- path: parentBip32path,
105
- xpubVersion: currencies_1.currencies[getPublicKey.coin].xpubVersion,
106
- });
107
- (0, utils_1.handleError)(getWalletXpubResponse, transport, "Unable to obtain public key from device.");
108
- const { payload: _xpub } = getWalletXpubResponse;
109
- // Ledger returns
110
- // - LTC pubkeys in Ltub format for all scriptTypes.
111
- // - BTC pubkeys in xpub format for all scriptTypes
112
- // - Doge pubkeys in xpub format instead of dgub
113
- // They *are* the correct accounts, but not in the format we want.
114
- // We need to convert SegWit pubkeys to Mtubs/ypubs, and SegWit native to zpubs, and Doge xpubs to dgubs.
115
- const xpub = (0, utxoUtils_1.convertXpubVersion)(_xpub, utxoUtils_1.scriptTypeToAccountType[getPublicKey.scriptType], getPublicKey.coin);
116
- xpubs.push({
117
- xpub,
118
- });
119
- }
120
- return xpubs;
121
- });
46
+ export async function btcGetPublicKeys(transport, msg) {
47
+ const xpubs = [];
48
+ for (const getPublicKey of msg) {
49
+ const { addressNList, coin } = getPublicKey;
50
+ if (!coin)
51
+ throw new Error("coin is required");
52
+ if (!getPublicKey.scriptType)
53
+ throw new Error("scriptType is required");
54
+ const parentBip32path = core.addressNListToBIP32(addressNList);
55
+ const getWalletXpubResponse = await transport.call("Btc", "getWalletXpub", {
56
+ path: parentBip32path,
57
+ xpubVersion: currencies[getPublicKey.coin].xpubVersion,
58
+ });
59
+ handleError(getWalletXpubResponse, transport, "Unable to obtain public key from device.");
60
+ const { payload: _xpub } = getWalletXpubResponse;
61
+ // Ledger returns
62
+ // - LTC pubkeys in Ltub format for all scriptTypes.
63
+ // - BTC pubkeys in xpub format for all scriptTypes
64
+ // - Doge pubkeys in xpub format instead of dgub
65
+ // They *are* the correct accounts, but not in the format we want.
66
+ // We need to convert SegWit pubkeys to Mtubs/ypubs, and SegWit native to zpubs, and Doge xpubs to dgubs.
67
+ const xpub = convertXpubVersion(_xpub, scriptTypeToAccountType[getPublicKey.scriptType], getPublicKey.coin);
68
+ xpubs.push({
69
+ xpub,
70
+ });
71
+ }
72
+ return xpubs;
122
73
  }
123
- exports.btcGetPublicKeys = btcGetPublicKeys;
124
74
  /*
125
75
  Sign Transaction UTXO's
126
76
  (Utilizing bitcoinjs-lib TxBuilder object)
@@ -162,140 +112,126 @@ Parameters
162
112
  * expiryHeight is an optional Buffer for zec overwinter / sapling Txs
163
113
  * useTrustedInputForSegwit trust inputs for segwit transactions
164
114
  */
165
- function btcSignTx(wallet, transport, msg) {
166
- return __awaiter(this, void 0, void 0, function* () {
167
- const supportsSecureTransfer = yield wallet.btcSupportsSecureTransfer();
168
- const slip44 = core.mustBeDefined(core.slip44ByCoin(msg.coin));
169
- const txBuilder = new bitcoin.TransactionBuilder(utils_1.networksUtil[slip44].bitcoinjs);
170
- const indexes = [];
171
- const txs = [];
172
- const associatedKeysets = [];
173
- let segwit = false;
174
- for (const output of msg.outputs) {
175
- let outputAddress;
176
- if (output.addressNList !== undefined && output.isChange) {
177
- const maybeOutputAddress = yield wallet.btcGetAddress({
178
- addressNList: output.addressNList,
179
- scriptType: output.scriptType,
180
- coin: msg.coin,
181
- });
182
- if (!maybeOutputAddress)
183
- throw new Error("could not determine output address from addressNList");
184
- outputAddress = maybeOutputAddress;
185
- }
186
- else if (output.addressNList !== undefined &&
187
- output.addressType === core.BTCOutputAddressType.Transfer &&
188
- !supportsSecureTransfer) {
189
- throw new Error("Ledger does not support SecureTransfer");
190
- }
191
- else if (output.address !== undefined) {
192
- outputAddress = output.address;
193
- }
194
- else {
195
- throw new Error("could not determine output address");
196
- }
197
- if (msg.coin === "BitcoinCash" && bchAddr.isCashAddress(outputAddress)) {
198
- outputAddress = bchAddr.toLegacyAddress(outputAddress);
199
- }
200
- txBuilder.addOutput(outputAddress, Number(output.amount));
115
+ export async function btcSignTx(wallet, transport, msg) {
116
+ const supportsSecureTransfer = await wallet.btcSupportsSecureTransfer();
117
+ const slip44 = core.mustBeDefined(core.slip44ByCoin(msg.coin));
118
+ const txBuilder = new bitcoin.TransactionBuilder(networksUtil[slip44].bitcoinjs);
119
+ const indexes = [];
120
+ const txs = [];
121
+ const associatedKeysets = [];
122
+ let segwit = false;
123
+ for (const output of msg.outputs) {
124
+ let outputAddress;
125
+ if (output.addressNList !== undefined && output.isChange) {
126
+ const maybeOutputAddress = await wallet.btcGetAddress({
127
+ addressNList: output.addressNList,
128
+ scriptType: output.scriptType,
129
+ coin: msg.coin,
130
+ });
131
+ if (!maybeOutputAddress)
132
+ throw new Error("could not determine output address from addressNList");
133
+ outputAddress = maybeOutputAddress;
201
134
  }
202
- if (msg.opReturnData) {
203
- if (msg.opReturnData.length > 80) {
204
- throw new Error("OP_RETURN data must be less than 80 chars.");
205
- }
206
- const ret = bitcoin.script.compile([bitcoin.opcodes.OP_RETURN, Buffer.from(msg.opReturnData)]);
207
- txBuilder.addOutput(ret, 0);
135
+ else if (output.addressNList !== undefined &&
136
+ output.addressType === core.BTCOutputAddressType.Transfer &&
137
+ !supportsSecureTransfer) {
138
+ throw new Error("Ledger does not support SecureTransfer");
208
139
  }
209
- const unsignedHex = txBuilder.buildIncomplete().toHex();
210
- const splitTxRes = yield transport.call("Btc", "splitTransaction", unsignedHex);
211
- (0, utils_1.handleError)(splitTxRes, transport, "splitTransaction failed");
212
- const outputScriptRes = yield transport.call("Btc", "serializeTransactionOutputs", splitTxRes.payload);
213
- (0, utils_1.handleError)(outputScriptRes, transport, "serializeTransactionOutputs failed");
214
- const outputScriptHex = outputScriptRes.payload.toString("hex");
215
- for (let i = 0; i < msg.inputs.length; i++) {
216
- if (msg.inputs[i].scriptType === core.BTCInputScriptType.SpendWitness ||
217
- msg.inputs[i].scriptType === core.BTCInputScriptType.SpendP2SHWitness)
218
- segwit = true;
219
- const keySet = core.addressNListToBIP32(msg.inputs[i].addressNList).replace(/^m\//, "");
220
- const vout = msg.inputs[i].vout;
221
- const tx = yield transport.call("Btc", "splitTransaction", msg.inputs[i].hex, utils_1.networksUtil[slip44].isSegwitSupported, utils_1.networksUtil[slip44].areTransactionTimestamped);
222
- (0, utils_1.handleError)(tx, transport, "splitTransaction failed");
223
- indexes.push(vout);
224
- txs.push(tx.payload);
225
- associatedKeysets.push(keySet);
140
+ else if (output.address !== undefined) {
141
+ outputAddress = output.address;
226
142
  }
227
- if (txs.length !== indexes.length)
228
- throw new Error("tx/index array length mismatch");
229
- const inputs = lodash_1.default.zip(txs, indexes, [], []);
230
- const txArgs = {
231
- inputs,
232
- associatedKeysets,
233
- outputScriptHex,
234
- additionals: (() => {
235
- if (msg.coin === "BitcoinCash")
236
- return ["abc"];
237
- if (msg.inputs.some((input) => input.scriptType === core.BTCInputScriptType.SpendWitness))
238
- return ["bech32"];
239
- return [];
240
- })(),
241
- segwit,
242
- useTrustedInputForSegwit: Boolean(segwit),
243
- };
244
- // "invalid data received" error from Ledger if not done this way:
245
- if (utils_1.networksUtil[slip44].sigHash) {
246
- txArgs.sigHashType = utils_1.networksUtil[slip44].sigHash;
143
+ else {
144
+ throw new Error("could not determine output address");
247
145
  }
248
- const signedTx = yield transport.call("Btc", "createPaymentTransaction", txArgs);
249
- (0, utils_1.handleError)(signedTx, transport, "Could not sign transaction with device");
250
- return {
251
- serializedTx: signedTx.payload,
252
- signatures: [],
253
- };
254
- });
146
+ if (msg.coin === "BitcoinCash" && bchAddr.isCashAddress(outputAddress)) {
147
+ outputAddress = bchAddr.toLegacyAddress(outputAddress);
148
+ }
149
+ txBuilder.addOutput(outputAddress, Number(output.amount));
150
+ }
151
+ if (msg.opReturnData) {
152
+ if (msg.opReturnData.length > 80) {
153
+ throw new Error("OP_RETURN data must be less than 80 chars.");
154
+ }
155
+ const ret = bitcoin.script.compile([bitcoin.opcodes.OP_RETURN, Buffer.from(msg.opReturnData)]);
156
+ txBuilder.addOutput(ret, 0);
157
+ }
158
+ const unsignedHex = txBuilder.buildIncomplete().toHex();
159
+ const splitTxRes = await transport.call("Btc", "splitTransaction", unsignedHex);
160
+ handleError(splitTxRes, transport, "splitTransaction failed");
161
+ const outputScriptRes = await transport.call("Btc", "serializeTransactionOutputs", splitTxRes.payload);
162
+ handleError(outputScriptRes, transport, "serializeTransactionOutputs failed");
163
+ const outputScriptHex = outputScriptRes.payload.toString("hex");
164
+ for (let i = 0; i < msg.inputs.length; i++) {
165
+ if (msg.inputs[i].scriptType === core.BTCInputScriptType.SpendWitness ||
166
+ msg.inputs[i].scriptType === core.BTCInputScriptType.SpendP2SHWitness)
167
+ segwit = true;
168
+ const keySet = core.addressNListToBIP32(msg.inputs[i].addressNList).replace(/^m\//, "");
169
+ const vout = msg.inputs[i].vout;
170
+ const tx = await transport.call("Btc", "splitTransaction", msg.inputs[i].hex, networksUtil[slip44].isSegwitSupported, networksUtil[slip44].areTransactionTimestamped);
171
+ handleError(tx, transport, "splitTransaction failed");
172
+ indexes.push(vout);
173
+ txs.push(tx.payload);
174
+ associatedKeysets.push(keySet);
175
+ }
176
+ if (txs.length !== indexes.length)
177
+ throw new Error("tx/index array length mismatch");
178
+ const inputs = _.zip(txs, indexes, [], []);
179
+ const txArgs = {
180
+ inputs,
181
+ associatedKeysets,
182
+ outputScriptHex,
183
+ additionals: (() => {
184
+ if (msg.coin === "BitcoinCash")
185
+ return ["abc"];
186
+ if (msg.inputs.some((input) => input.scriptType === core.BTCInputScriptType.SpendWitness))
187
+ return ["bech32"];
188
+ return [];
189
+ })(),
190
+ segwit,
191
+ useTrustedInputForSegwit: Boolean(segwit),
192
+ };
193
+ // "invalid data received" error from Ledger if not done this way:
194
+ if (networksUtil[slip44].sigHash) {
195
+ txArgs.sigHashType = networksUtil[slip44].sigHash;
196
+ }
197
+ const signedTx = await transport.call("Btc", "createPaymentTransaction", txArgs);
198
+ handleError(signedTx, transport, "Could not sign transaction with device");
199
+ return {
200
+ serializedTx: signedTx.payload,
201
+ signatures: [],
202
+ };
255
203
  }
256
- exports.btcSignTx = btcSignTx;
257
- function btcSupportsSecureTransfer() {
258
- return __awaiter(this, void 0, void 0, function* () {
259
- return false;
260
- });
204
+ export async function btcSupportsSecureTransfer() {
205
+ return false;
261
206
  }
262
- exports.btcSupportsSecureTransfer = btcSupportsSecureTransfer;
263
- function btcSupportsNativeShapeShift() {
207
+ export function btcSupportsNativeShapeShift() {
264
208
  return false;
265
209
  }
266
- exports.btcSupportsNativeShapeShift = btcSupportsNativeShapeShift;
267
- function btcSignMessage(wallet, transport, msg) {
268
- var _a;
269
- return __awaiter(this, void 0, void 0, function* () {
270
- const bip32path = core.addressNListToBIP32(msg.addressNList);
271
- const res = yield transport.call("Btc", "signMessage", bip32path, Buffer.from(msg.message).toString("hex"));
272
- (0, utils_1.handleError)(res, transport, "Could not sign message with device");
273
- const v = res.payload["v"] + 27 + 4;
274
- const signature = Buffer.from(v.toString(16) + res.payload["r"] + res.payload["s"], "hex").toString("hex");
275
- const coin = msg.coin;
276
- if (!coin)
277
- throw new Error("could not determine type of coin");
278
- const address = yield btcGetAddress(transport, {
279
- addressNList: msg.addressNList,
280
- coin,
281
- showDisplay: false,
282
- scriptType: (_a = msg.scriptType) !== null && _a !== void 0 ? _a : core.BTCInputScriptType.SpendAddress,
283
- });
284
- return {
285
- address,
286
- signature,
287
- };
210
+ export async function btcSignMessage(wallet, transport, msg) {
211
+ const bip32path = core.addressNListToBIP32(msg.addressNList);
212
+ const res = await transport.call("Btc", "signMessage", bip32path, Buffer.from(msg.message).toString("hex"));
213
+ handleError(res, transport, "Could not sign message with device");
214
+ const v = res.payload["v"] + 27 + 4;
215
+ const signature = Buffer.from(v.toString(16) + res.payload["r"] + res.payload["s"], "hex").toString("hex");
216
+ const coin = msg.coin;
217
+ if (!coin)
218
+ throw new Error("could not determine type of coin");
219
+ const address = await btcGetAddress(transport, {
220
+ addressNList: msg.addressNList,
221
+ coin,
222
+ showDisplay: false,
223
+ scriptType: msg.scriptType ?? core.BTCInputScriptType.SpendAddress,
288
224
  });
225
+ return {
226
+ address,
227
+ signature,
228
+ };
289
229
  }
290
- exports.btcSignMessage = btcSignMessage;
291
- function btcVerifyMessage(msg) {
292
- return __awaiter(this, void 0, void 0, function* () {
293
- const signature = base64_js_1.default.fromByteArray(core.fromHexString(msg.signature));
294
- return bitcoinMsg.verify(msg.message, msg.address, signature);
295
- });
230
+ export async function btcVerifyMessage(msg) {
231
+ const signature = Base64.fromByteArray(core.fromHexString(msg.signature));
232
+ return bitcoinMsg.verify(msg.message, msg.address, signature);
296
233
  }
297
- exports.btcVerifyMessage = btcVerifyMessage;
298
- function btcGetAccountPaths(msg) {
234
+ export function btcGetAccountPaths(msg) {
299
235
  const slip44 = core.slip44ByCoin(msg.coin);
300
236
  if (slip44 === undefined)
301
237
  return [];
@@ -325,11 +261,9 @@ function btcGetAccountPaths(msg) {
325
261
  });
326
262
  return paths;
327
263
  }
328
- exports.btcGetAccountPaths = btcGetAccountPaths;
329
264
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
330
- function btcIsSameAccount(msg) {
265
+ export function btcIsSameAccount(msg) {
331
266
  // TODO: There's no way this is correct.
332
267
  return true;
333
268
  }
334
- exports.btcIsSameAccount = btcIsSameAccount;
335
269
  //# sourceMappingURL=bitcoin.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"bit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c,CA2D7B,CAAC"}
1
+ {"version":3,"file":"cosmos.d.ts","sourceRoot":"","sources":["../src/cosmos.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,IAAI,MAAM,8BAA8B,CAAC;AAIrD,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAO9C,eAAO,MAAM,gBAAgB,cAAqB,eAAe,OAAO,IAAI,CAAC,gBAAgB,KAAG,OAAO,CAAC,MAAM,CAO7G,CAAC;AAEF,eAAO,MAAM,YAAY,cACZ,eAAe,OACrB,IAAI,CAAC,YAAY,KACrB,OAAO,CAAC,IAAI,CAAC,cAAc,CA2D7B,CAAC"}