@ledgerhq/coin-filecoin
Version:
Ledger Filecoin Coin integration
55 lines • 3.27 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.createApi = createApi;
const rejectBalanceOptions_1 = require("@ledgerhq/coin-module-framework/api/getBalance/rejectBalanceOptions");
const craftTransactionData_1 = require("@ledgerhq/coin-module-framework/logic/craftTransactionData");
const getBalance_1 = require("../logic/account/getBalance");
const getNextSequence_1 = require("../logic/account/getNextSequence");
const lastBlock_1 = require("../logic/history/lastBlock");
const listOperations_1 = require("../logic/history/listOperations");
const broadcast_1 = require("../logic/transaction/broadcast");
const combine_1 = require("../logic/transaction/combine");
const craftTransaction_1 = require("../logic/transaction/craftTransaction");
const estimateFees_1 = require("../logic/transaction/estimateFees");
const validateAddress_1 = require("../logic/validateAddress");
const validateIntent_1 = require("../logic/validateIntent");
function createApi() {
return {
broadcast: (_context, tx, options) => (0, broadcast_1.broadcast)(tx, options?.broadcastConfig),
async call(_context) {
throw new Error("call is not supported");
},
async register() {
throw new Error("register is not supported");
},
combine: (_context, tx, signature, options) => (0, combine_1.combine)(tx, signature, options?.pubkey),
craftTransaction: (_context, intent, options) => (0, craftTransaction_1.craftTransaction)(intent, options?.customFees),
estimateFees: (_context, intent, options) => (0, estimateFees_1.estimateFees)(intent, options?.customFeesParameters),
lastBlock: (_context) => (0, lastBlock_1.lastBlock)(),
listOperations: (_context, address, options) => (0, listOperations_1.listOperations)(address, options),
validateIntent: (_context, intent, balances, options) => (0, validateIntent_1.validateIntent)(intent, balances, options?.customFees),
getNextSequence: (_context, address) => (0, getNextSequence_1.getNextSequence)(address),
validateAddress: (_context, address, parameters) => (0, validateAddress_1.validateAddress)(address, parameters),
craftTransactionData: (_context, intent) => (0, craftTransactionData_1.craftTransactionData)(intent),
getBalance: (_context, address, options) => (0, rejectBalanceOptions_1.rejectBalanceOptions)(() => (0, getBalance_1.getBalance)(address), options),
craftRawTransaction: (_context, _transaction, _sender, _publicKey, _sequence) => {
throw new Error("craftRawTransaction is not supported");
},
getBlock(_context, _height) {
throw new Error("getBlock is not supported");
},
getBlockInfo(_context, _height) {
throw new Error("getBlockInfo is not supported");
},
getStakes(_context, _address, _options) {
throw new Error("getStakes is not supported");
},
getRewards(_context, _address, _options) {
throw new Error("getRewards is not supported");
},
getValidators(_context, _options) {
throw new Error("getValidators is not supported");
},
};
}
//# sourceMappingURL=index.js.map