@ledgerhq/coin-stellar
Version:
Ledger Stellar Coin integration
23 lines • 1.13 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const config_1 = __importDefault(require("../config"));
const getBalance_1 = require("./getBalance");
const account_call_builder_1 = require("@stellar/stellar-sdk/lib/horizon/account_call_builder");
describe("getBalance", () => {
config_1.default.setCoinConfig(() => ({
status: { type: "active" },
explorer: { url: "https://stellar.explorer.com" },
}));
it("gets the balance of a Stellar account", async () => {
jest.spyOn(account_call_builder_1.AccountCallBuilder.prototype, "accountId").mockReturnValue({
call: () => Promise.resolve({ balances: [{ asset_type: "native", balance: "50" }] }),
});
expect(await (0, getBalance_1.getBalance)("GC65CUPW2IMTJJY6CII7F3OBPVG4YGASEPBBLM4V3LBKX62P6LA24OFV")).toEqual([
{ value: BigInt(500000000), asset: { type: "native" } },
]);
});
});
//# sourceMappingURL=getBalance.test.js.map