Skip to content

Commit 29ca737

Browse files
authored
feat: compile entrypoint file with typescript (#577)
* feat: move index to typescript * chore: encapsulate error messages enum * chore: add indirection to make compatible to how we used to export the lib * chore: lib should be ts * chore: formatting
1 parent b9fa39e commit 29ca737

File tree

4 files changed

+107
-104
lines changed

4 files changed

+107
-104
lines changed

index.js

-103
This file was deleted.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "@hathor/wallet-lib",
33
"version": "1.0.2",
44
"description": "Library used by Hathor Wallet",
5-
"main": "index.js",
5+
"main": "lib/index.js",
66
"directories": {
77
"lib": "lib"
88
},

src/index.ts

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import * as hathorLib from './lib';
2+
3+
export default hathorLib;
4+
export * from './lib';

src/lib.ts

+102
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
import * as constants from './constants';
2+
import dateFormatter from './utils/date';
3+
import websocket from './websocket';
4+
import * as errors from './errors';
5+
import * as ErrorMessages from './errorMessages';
6+
import walletApi from './api/wallet';
7+
import txApi from './api/txApi';
8+
import txMiningApi from './api/txMining';
9+
import versionApi from './api/version';
10+
import * as axios from './api/axiosInstance';
11+
import metadataApi from './api/metadataApi';
12+
import { Storage } from './storage/storage';
13+
import LevelDBStore from './storage/leveldb/store';
14+
import { MemoryStore } from './storage/memory_store';
15+
import network from './network';
16+
import HathorWallet from './new/wallet';
17+
import Connection from './new/connection';
18+
import WalletServiceConnection from './wallet/connection';
19+
import SendTransaction from './new/sendTransaction';
20+
import Address from './models/address';
21+
import Output from './models/output';
22+
import P2PKH from './models/p2pkh';
23+
import P2SH from './models/p2sh';
24+
import P2SHSignature from './models/p2sh_signature';
25+
import ScriptData from './models/script_data';
26+
import Input from './models/input';
27+
import Transaction from './models/transaction';
28+
import CreateTokenTransaction from './models/create_token_transaction';
29+
import Network from './models/network';
30+
import * as addressUtils from './utils/address';
31+
import * as cryptoUtils from './utils/crypto';
32+
import dateUtils from './utils/date';
33+
import tokensUtils from './utils/tokens';
34+
import walletUtils from './utils/wallet';
35+
import helpersUtils from './utils/helpers';
36+
import * as numberUtils from './utils/numbers';
37+
import * as scriptsUtils from './utils/scripts';
38+
import transactionUtils from './utils/transaction';
39+
import * as bufferUtils from './utils/buffer';
40+
import HathorWalletServiceWallet from './wallet/wallet';
41+
import walletServiceApi from './wallet/api/walletApi';
42+
import SendTransactionWalletService from './wallet/sendTransactionWalletService';
43+
import config from './config';
44+
import * as PushNotification from './pushNotification';
45+
import { WalletType } from './types';
46+
import { PartialTx, PartialTxInputData } from './models/partial_tx';
47+
import PartialTxProposal from './wallet/partialTxProposal';
48+
import * as swapService from './wallet/api/swapService';
49+
import { AtomicSwapServiceConnection } from './swapService/swapConnection';
50+
51+
export {
52+
PartialTx,
53+
PartialTxInputData,
54+
PartialTxProposal,
55+
dateFormatter,
56+
websocket,
57+
walletApi,
58+
txApi,
59+
txMiningApi,
60+
versionApi,
61+
metadataApi,
62+
errors,
63+
ErrorMessages,
64+
constants,
65+
axios,
66+
Storage,
67+
LevelDBStore,
68+
MemoryStore,
69+
network,
70+
HathorWallet,
71+
Connection,
72+
AtomicSwapServiceConnection,
73+
WalletServiceConnection,
74+
SendTransaction,
75+
Address,
76+
Output,
77+
P2PKH,
78+
P2SH,
79+
P2SHSignature,
80+
ScriptData,
81+
Input,
82+
Transaction,
83+
CreateTokenTransaction,
84+
Network,
85+
addressUtils,
86+
cryptoUtils,
87+
dateUtils,
88+
tokensUtils,
89+
walletUtils,
90+
numberUtils,
91+
helpersUtils,
92+
scriptsUtils,
93+
bufferUtils,
94+
transactionUtils,
95+
HathorWalletServiceWallet,
96+
walletServiceApi,
97+
SendTransactionWalletService,
98+
config,
99+
PushNotification,
100+
swapService,
101+
WalletType,
102+
};

0 commit comments

Comments
 (0)