@ledgerhq/coin-celo
Version:
98 lines • 3.27 kB
JavaScript
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.tokenTransactionFixture = exports.transactionFixture = exports.accountWithTokenAccountFixture = exports.accountFixture = void 0;
const index_1 = require("@ledgerhq/coin-framework/account/index");
const currencies_1 = require("@ledgerhq/cryptoassets/lib/currencies");
const bignumber_js_1 = __importDefault(require("bignumber.js"));
const faker_1 = require("@faker-js/faker");
const currency = (0, currencies_1.getCryptoCurrencyById)("celo");
const accountFixture = {
type: "Account",
id: faker_1.faker.string.uuid(),
seedIdentifier: faker_1.faker.string.uuid(),
derivationMode: "",
index: faker_1.faker.number.int(),
freshAddress: "address",
freshAddressPath: "derivationPath",
used: true,
balance: new bignumber_js_1.default(0),
spendableBalance: new bignumber_js_1.default(0),
creationDate: faker_1.faker.date.past(),
blockHeight: faker_1.faker.number.int({ min: 100_000, max: 200_000 }),
currency,
operationsCount: 0,
operations: [],
pendingOperations: [],
lastSyncDate: new Date(),
balanceHistoryCache: index_1.emptyHistoryCache,
swapHistory: [],
celoResources: {
registrationStatus: false,
lockedBalance: (0, bignumber_js_1.default)(0),
nonvotingLockedBalance: (0, bignumber_js_1.default)(0),
pendingWithdrawals: null,
votes: null,
electionAddress: null,
lockedGoldAddress: null,
maxNumGroupsVotedFor: (0, bignumber_js_1.default)(0),
},
};
exports.accountFixture = accountFixture;
const subAccounts = [
{
id: "subAccountId",
type: "TokenAccount",
parentId: accountFixture.id,
token: {
type: "TokenCurrency",
id: "celoToken",
contractAddress: "contract_address",
parentCurrency: currency,
},
balance: (0, bignumber_js_1.default)(212),
spendableBalance: (0, bignumber_js_1.default)(212),
creationDate: faker_1.faker.date.past(),
operationsCount: 0,
operations: [],
pendingOperations: [],
balanceHistoryCache: {
HOUR: {
latestDate: null,
balances: [],
},
DAY: {
latestDate: null,
balances: [],
},
WEEK: {
latestDate: null,
balances: [],
},
},
swapHistory: [],
},
];
const accountWithTokenAccountFixture = {
...accountFixture,
subAccounts,
};
exports.accountWithTokenAccountFixture = accountWithTokenAccountFixture;
const transactionFixture = {
amount: new bignumber_js_1.default(10),
recipient: "recipient",
useAllAmount: false,
family: "celo",
mode: "send",
index: 0,
fees: null,
};
exports.transactionFixture = transactionFixture;
const tokenTransactionFixture = {
...transactionFixture,
subAccountId: "subAccountId",
};
exports.tokenTransactionFixture = tokenTransactionFixture;
//# sourceMappingURL=fixtures.js.map