crypto-wallet-core
Version:
A multi-currency support library for address derivation, private key creation, and transaction creation
63 lines • 2.15 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.TransactionsProxy = void 0;
const arb_1 = require("./arb");
const base_1 = require("./base");
const bch_1 = require("./bch");
const btc_1 = require("./btc");
const doge_1 = require("./doge");
const erc20_1 = require("./erc20");
const eth_1 = require("./eth");
const eth_multisig_1 = require("./eth-multisig");
const ltc_1 = require("./ltc");
const matic_1 = require("./matic");
const matic_multisig_1 = require("./matic-multisig");
const op_1 = require("./op");
const sol_1 = require("./sol");
const spl_1 = require("./spl");
const xrp_1 = require("./xrp");
const providers = {
BTC: new btc_1.BTCTxProvider(),
BCH: new bch_1.BCHTxProvider(),
ETH: new eth_1.ETHTxProvider(),
ETHERC20: new erc20_1.ERC20TxProvider(),
ETHMULTISIG: new eth_multisig_1.ETHMULTISIGTxProvider(),
XRP: new xrp_1.XRPTxProvider(),
DOGE: new doge_1.DOGETxProvider(),
LTC: new ltc_1.LTCTxProvider(),
MATIC: new matic_1.MATICTxProvider(),
MATICMULTISIG: new matic_multisig_1.MATICMULTISIGTxProvider(),
MATICERC20: new matic_1.MATICERC20TxProvider(),
ARB: new arb_1.ARBTxProvider(),
ARBERC20: new arb_1.ARBERC20TxProvider(),
BASE: new base_1.BASETxProvider(),
BASEERC20: new base_1.BASEERC20TxProvider(),
OP: new op_1.OPTxProvider(),
OPERC20: new op_1.OPERC20TxProvider(),
SOL: new sol_1.SOLTxProvider(),
SOLSPL: new spl_1.SPLTxProvider(),
};
class TransactionsProxy {
get({ chain }) {
const normalizedChain = chain.toUpperCase();
return providers[normalizedChain];
}
create(params) {
return this.get(params).create(params);
}
sign(params) {
return this.get(params).sign(params);
}
getSignature(params) {
return this.get(params).getSignature(params);
}
applySignature(params) {
return this.get(params).applySignature(params);
}
getHash(params) {
return this.get(params).getHash(params);
}
}
exports.TransactionsProxy = TransactionsProxy;
exports.default = new TransactionsProxy();
//# sourceMappingURL=index.js.map