@bcpros/crypto-wallet-core
Version:
A multi-currency support library for address derivation, private key creation, and transaction creation
52 lines (43 loc) • 1.25 kB
text/typescript
import { BCHTxProvider } from './bch';
import { BTCTxProvider } from './btc';
import { DOGETxProvider } from './doge';
import { ERC20TxProvider } from './erc20';
import { ETHTxProvider } from './eth';
import { ETHMULTISIGTxProvider } from './eth-multisig';
import { LTCTxProvider } from './ltc';
import { XECTxProvider } from './xec';
import { XPITxProvider } from './xpi';
import { XRPTxProvider } from './xrp';
const providers = {
BTC: new BTCTxProvider(),
BCH: new BCHTxProvider(),
ETH: new ETHTxProvider(),
ERC20: new ERC20TxProvider(),
ETHMULTISIG: new ETHMULTISIGTxProvider(),
XRP: new XRPTxProvider(),
DOGE: new DOGETxProvider(),
XEC: new XECTxProvider(),
XPI: new XPITxProvider(),
LTC: new LTCTxProvider()
};
export class TransactionsProxy {
get({ chain }) {
return providers[chain];
}
create(params) {
return this.get(params).create(params);
}
sign(params): string {
return this.get(params).sign(params);
}
getSignature(params): string {
return this.get(params).getSignature(params);
}
applySignature(params) {
return this.get(params).applySignature(params);
}
getHash(params) {
return this.get(params).getHash(params);
}
}
export default new TransactionsProxy();