@ledgerhq/coin-algorand
Version:
Ledger Algorand Coin integration
46 lines • 2.21 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
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 config_1 = __importDefault(require("../config"));
const logic_1 = require("../logic");
const validateAddress_1 = require("../validateAddress");
function createApi(config) {
config_1.default.setCoinConfig(() => ({ ...config, status: { type: "active" } }));
return {
broadcast: logic_1.broadcast,
combine: logic_1.combine,
craftTransaction: logic_1.craftApiTransaction,
estimateFees: (_transactionIntent) => (0, logic_1.estimateFees)(),
getBalance: (address, options) => (0, rejectBalanceOptions_1.rejectBalanceOptions)(() => (0, logic_1.getBalance)(address), options),
getBlockInfo: logic_1.getBlockInfo,
lastBlock: logic_1.lastBlock,
listOperations: logic_1.listOperations,
validateIntent: logic_1.validateIntent,
getBlock(_height) {
throw new Error("getBlock is not supported for Algorand");
},
getNextSequence(_address) {
throw new Error("getNextSequence is not applicable for Algorand");
},
getStakes(_address, _cursor) {
throw new Error("getStakes is not supported for Algorand");
},
getRewards(_address, _cursor) {
throw new Error("getRewards is not supported for Algorand");
},
getValidators(_cursor) {
throw new Error("getValidators is not supported for Algorand");
},
craftRawTransaction: (_transaction, _sender, _publicKey, _sequence) => {
throw new Error("craftRawTransaction is not supported for Algorand");
},
validateAddress: validateAddress_1.validateAddress,
craftTransactionData: craftTransactionData_1.craftTransactionData,
};
}
//# sourceMappingURL=index.js.map