diff --git a/lib/components/KeypomContext.js b/lib/components/KeypomContext.js index ab5d3afb3..1c233c62b 100644 --- a/lib/components/KeypomContext.js +++ b/lib/components/KeypomContext.js @@ -24,13 +24,14 @@ var __importStar = (this && this.__importStar) || function (mod) { }; Object.defineProperty(exports, "__esModule", { value: true }); exports.useKeypom = exports.KeypomContextProvider = void 0; -var react_1 = __importStar(require("../../../keypom-app/node_modules/react/index")); +var react_1 = __importStar(require("react")); var keypom_1 = require("../lib/keypom"); var KeypomContext = react_1.default.createContext(null); var KeypomContextProvider = function (_a) { var children = _a.children; var _b = (0, react_1.useState)(null), env = _b[0], setEnv = _b[1]; (0, react_1.useEffect)(function () { + // try to call getEnv of Keypom SDK which will throw if initKeypom isn't called somewhere in client codebase var tried = 0; var attempts = 10, timeout = 1000; var lazyCheck = function () { diff --git a/lib/lib/checks.d.ts b/lib/lib/checks.d.ts new file mode 100644 index 000000000..36f35accb --- /dev/null +++ b/lib/lib/checks.d.ts @@ -0,0 +1,25 @@ +import { Account, Near } from "near-api-js"; +import { FCData } from "./types/fc"; +import { Funder } from "./types/general"; +export declare function isValidAccountObj(o: Account | undefined): o is Account; +export declare function isValidNearObject(o: Near): o is Near; +export declare function isValidFunderObject(o: Funder): o is Funder; +export declare const assert: (exp: any, m: any) => void; +export declare const assertValidDropConfig: (config: { + uses_per_key?: number; + time?: { + start?: number; + end?: number; + throttle?: number; + interval?: number; + }; + usage?: { + permission?: string; + refund_deposit?: boolean; + auto_delete_drop?: boolean; + auto_withdraw?: boolean; + }; + root_account_id?: string; +}) => void; +export declare const assertValidFCData: (fcData: FCData | undefined, depositPerUse: string, usesPerKey: number) => void; +export declare const assertDropIdUnique: (dropId: string) => Promise; diff --git a/lib/lib/checks.js b/lib/lib/checks.js new file mode 100644 index 000000000..ac3600511 --- /dev/null +++ b/lib/lib/checks.js @@ -0,0 +1,130 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.assertDropIdUnique = exports.assertValidFCData = exports.assertValidDropConfig = exports.assert = exports.isValidFunderObject = exports.isValidNearObject = exports.isValidAccountObj = void 0; +var bn_js_1 = __importDefault(require("bn.js")); +var keypom_1 = require("./keypom"); +function isValidAccountObj(o) { + if (o) { + return o.connection !== undefined && o.accountId !== undefined; + } + return true; +} +exports.isValidAccountObj = isValidAccountObj; +function isValidNearObject(o) { + return o.connection !== undefined && o.config !== undefined && o.accountCreator !== undefined; +} +exports.isValidNearObject = isValidNearObject; +function isValidFunderObject(o) { + return o.accountId !== undefined && o.secretKey !== undefined; +} +exports.isValidFunderObject = isValidFunderObject; +var assert = function (exp, m) { + if (!exp) { + throw new Error(m); + } +}; +exports.assert = assert; +var assertValidDropConfig = function (config) { + var _a; + (0, exports.assert)(((config === null || config === void 0 ? void 0 : config.uses_per_key) || 1) != 0, "Cannot have 0 uses per key for a drop config"); + if ((_a = config === null || config === void 0 ? void 0 : config.usage) === null || _a === void 0 ? void 0 : _a.permission) { + (0, exports.assert)(config.usage.permission == "create_account_and_claim" || config.usage.permission == "claim", "Invalid permission type for usage. Must be 'create_account_and_claim' or 'claim'"); + } + if (config === null || config === void 0 ? void 0 : config.time) { + var currentBlockTimestamp = Date.now() * 1e6; + (0, exports.assert)((config.time.interval != undefined && config.time.start != undefined) == false, "If you want to set a claim interval, you must also set a start timestamp"); + (0, exports.assert)((config.time.start || currentBlockTimestamp) >= currentBlockTimestamp, "The start timestamp must be greater than the current block timestamp"); + exports.assert((config.time.end || currentBlockTimestamp) >= currentBlockTimestamp, "The end timestamp must be greater than the current block timestamp"); + if (config.time.start != undefined && config.time.end != undefined) { + (0, exports.assert)(config.time.start < config.time.end, "The start timestamp must be less than the end timestamp"); + } + } +}; +exports.assertValidDropConfig = assertValidDropConfig; +var assertValidFCData = function (fcData, depositPerUse, usesPerKey) { + var _a; + if ((_a = fcData === null || fcData === void 0 ? void 0 : fcData.config) === null || _a === void 0 ? void 0 : _a.attachedGas) { + (0, exports.assert)(depositPerUse == "0", "Cannot specify gas to attach and have a balance in the linkdrop"); + (0, exports.assert)(new bn_js_1.default(fcData.config.attachedGas).lte(new bn_js_1.default("80000000000000")), "Cannot have 0 attached gas"); + } + if (fcData === null || fcData === void 0 ? void 0 : fcData.methods) { + var numMethodData = fcData.methods.length; + if (usesPerKey == 1) { + (0, exports.assert)(numMethodData == 1, "Cannot have more Method Data than the number of uses per key"); + } + else if (usesPerKey > 1) { + (0, exports.assert)(numMethodData == usesPerKey, "Number of FCs must match number of uses per key if more than 1 is specified"); + } + if (usesPerKey > 1 && numMethodData == 1) { + (0, exports.assert)(fcData.methods[0] != undefined, "cannot have a single none function call"); + } + } +}; +exports.assertValidFCData = assertValidFCData; +var assertDropIdUnique = function (dropId) { return __awaiter(void 0, void 0, void 0, function () { + var _a, viewAccount, contractId, dropInfo, _1; + return __generator(this, function (_b) { + switch (_b.label) { + case 0: + _a = (0, keypom_1.getEnv)(), viewAccount = _a.viewAccount, contractId = _a.contractId; + _b.label = 1; + case 1: + _b.trys.push([1, 3, , 4]); + return [4 /*yield*/, viewAccount.viewFunction2({ + contractId: contractId, + methodName: 'get_drop_information', + args: { + drop_id: dropId + } + })]; + case 2: + dropInfo = _b.sent(); + (0, exports.assert)(!dropInfo, "Drop with ID ".concat(dropId, " already exists. Please use a different drop ID.")); + return [3 /*break*/, 4]; + case 3: + _1 = _b.sent(); + return [3 /*break*/, 4]; + case 4: return [2 /*return*/]; + } + }); +}); }; +exports.assertDropIdUnique = assertDropIdUnique; diff --git a/lib/lib/claims.js b/lib/lib/claims.js index 704a136d4..6152d188c 100644 --- a/lib/lib/claims.js +++ b/lib/lib/claims.js @@ -61,6 +61,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) { Object.defineProperty(exports, "__esModule", { value: true }); exports.claim = void 0; var nearAPI = __importStar(require("near-api-js")); +var checks_1 = require("./checks"); var KeyPair = nearAPI.KeyPair; var keypom_1 = require("./keypom"); /** @@ -164,24 +165,18 @@ var keypom_1 = require("./keypom"); var claim = function (_a) { var secretKey = _a.secretKey, accountId = _a.accountId, newAccountId = _a.newAccountId, newPublicKey = _a.newPublicKey, password = _a.password; return __awaiter(void 0, void 0, void 0, function () { - var _b, networkId, keyStore, attachedGas, contractId, contractAccount, receiverId, execute, fundingAccountDetails, keyPair, transactions, result; + var _b, networkId, keyStore, attachedGas, contractId, contractAccount, receiverId, execute, fundingAccountDetails, near, keyPair, transactions, result; return __generator(this, function (_c) { switch (_c.label) { case 0: - _b = (0, keypom_1.getEnv)(), networkId = _b.networkId, keyStore = _b.keyStore, attachedGas = _b.attachedGas, contractId = _b.contractId, contractAccount = _b.contractAccount, receiverId = _b.receiverId, execute = _b.execute, fundingAccountDetails = _b.fundingAccountDetails; - if (!keyStore) { - throw new Error('Keypom SDK is not initialized. Please call `initKeypom`.'); - } + _b = (0, keypom_1.getEnv)(), networkId = _b.networkId, keyStore = _b.keyStore, attachedGas = _b.attachedGas, contractId = _b.contractId, contractAccount = _b.contractAccount, receiverId = _b.receiverId, execute = _b.execute, fundingAccountDetails = _b.fundingAccountDetails, near = _b.near; + (0, checks_1.assert)(near && networkId && keyStore, 'Keypom SDK is not initialized. Please call `initKeypom`.'); keyPair = KeyPair.fromString(secretKey); return [4 /*yield*/, keyStore.setKey(networkId, contractId, keyPair)]; case 1: _c.sent(); - if (newAccountId && !newPublicKey) { - throw new Error('If creating a new account, a newPublicKey must be passed in.'); - } - if (!newAccountId && !accountId) { - throw new Error('Either an accountId or newAccountId must be passed in.'); - } + (0, checks_1.assert)(!newAccountId || newPublicKey, 'If creating a new account, a newPublicKey must be passed in.'); + (0, checks_1.assert)(newAccountId || accountId, 'Either an accountId or newAccountId must be passed in.'); transactions = [{ receiverId: receiverId, actions: [{ diff --git a/lib/lib/drops.js b/lib/lib/drops.js index 5dd54691f..6b50e2863 100644 --- a/lib/lib/drops.js +++ b/lib/lib/drops.js @@ -69,6 +69,7 @@ var _a = nearAPI.utils.format, parseNearAmount = _a.parseNearAmount, formatNearA var keypom_1 = require("./keypom"); var keypom_utils_1 = require("./keypom-utils"); var views_1 = require("./views"); +var checks_1 = require("./checks"); exports.KEY_LIMIT = 50; /** * Creates a new drop based on parameters passed in. @@ -203,16 +204,16 @@ exports.KEY_LIMIT = 50; var createDrop = function (_a) { var account = _a.account, wallet = _a.wallet, dropId = _a.dropId, _b = _a.numKeys, numKeys = _b === void 0 ? 0 : _b, publicKeys = _a.publicKeys, rootEntropy = _a.rootEntropy, depositPerUseNEAR = _a.depositPerUseNEAR, depositPerUseYocto = _a.depositPerUseYocto, metadata = _a.metadata, _c = _a.config, config = _c === void 0 ? {} : _c, _d = _a.ftData, ftData = _d === void 0 ? {} : _d, _e = _a.nftData, nftData = _e === void 0 ? {} : _e, _f = _a.simpleData, simpleData = _f === void 0 ? {} : _f, fcData = _a.fcData, basePassword = _a.basePassword, passwordProtectedUses = _a.passwordProtectedUses, _g = _a.useBalance, useBalance = _g === void 0 ? false : _g; return __awaiter(void 0, void 0, void 0, function () { - var _h, near, viewAccount, gas, attachedGas, contractId, receiverId, getAccount, execute, fundingAccount, fundingAccountDetails, finalConfig, keys, rootEntropyUsed, nonceDropIdMeta, passwords, ftBalancePerUse, metadata_1, createDropArgs, storageCalculated, requiredDeposit, hasBalance, userBal, deposit, transactions, tokenIds, nftTXs, responses; - var _j, _k, _l, _m; - return __generator(this, function (_o) { - switch (_o.label) { + var _h, near, viewAccount, gas, attachedGas, contractId, receiverId, getAccount, execute, fundingAccount, fundingAccountDetails, finalConfig, keys, rootEntropyUsed, nonceDropIdMeta, passwords, ftBalancePerUse, metadata_1, createDropArgs, storageCalculated, requiredDeposit, hasBalance, userBal, deposit, transactions, _j, _k, tokenIds, nftTXs, responses; + var _l, _m, _o, _p; + return __generator(this, function (_q) { + switch (_q.label) { case 0: _h = (0, keypom_1.getEnv)(), near = _h.near, viewAccount = _h.viewAccount, gas = _h.gas, attachedGas = _h.attachedGas, contractId = _h.contractId, receiverId = _h.receiverId, getAccount = _h.getAccount, execute = _h.execute, fundingAccount = _h.fundingAccount, fundingAccountDetails = _h.fundingAccountDetails; - if (!near) { - throw new Error('Keypom SDK is not initialized. Please call `initKeypom`.'); - } + (0, checks_1.assert)(near != undefined, 'Keypom SDK is not initialized. Please call `initKeypom`.'); + (0, checks_1.assert)((0, checks_1.isValidAccountObj)(account), 'Passed in account is not a valid account object.'); account = getAccount({ account: account, wallet: wallet }); + (0, checks_1.assert)(contractId == "v1-3.keypom.near" || contractId == "v1-3.keypom.testnet", "Only the latest Keypom contract can be used to call this methods. Please update the contract to: v1-3.keypom.near or v1-3.keypom.testnet"); /// parse args if (depositPerUseNEAR) { depositPerUseYocto = parseNearAmount(depositPerUseNEAR.toString()) || '0'; @@ -220,69 +221,73 @@ var createDrop = function (_a) { if (!depositPerUseYocto) depositPerUseYocto = '0'; // Ensure that if the dropID is passed in, it's greater than 1 billion - if (dropId && parseInt(dropId) < 1000000000) { - throw new Error('All custom drop IDs must be greater than 1_000_000_000'); - } + (0, checks_1.assert)(parseInt(dropId || "1000000000") >= 1000000000, 'All custom drop IDs must be greater than 1_000_000_000'); if (!dropId) dropId = Date.now().toString(); + return [4 /*yield*/, (0, checks_1.assertDropIdUnique)(dropId)]; + case 1: + _q.sent(); finalConfig = { uses_per_key: (config === null || config === void 0 ? void 0 : config.usesPerKey) || 1, root_account_id: config === null || config === void 0 ? void 0 : config.dropRoot, usage: { - auto_delete_drop: ((_j = config === null || config === void 0 ? void 0 : config.usage) === null || _j === void 0 ? void 0 : _j.autoDeleteDrop) || false, - auto_withdraw: ((_k = config === null || config === void 0 ? void 0 : config.usage) === null || _k === void 0 ? void 0 : _k.autoWithdraw) || true, - permissions: (_l = config === null || config === void 0 ? void 0 : config.usage) === null || _l === void 0 ? void 0 : _l.permissions, - refund_deposit: (_m = config === null || config === void 0 ? void 0 : config.usage) === null || _m === void 0 ? void 0 : _m.refundDeposit, + auto_delete_drop: ((_l = config === null || config === void 0 ? void 0 : config.usage) === null || _l === void 0 ? void 0 : _l.autoDeleteDrop) || false, + auto_withdraw: ((_m = config === null || config === void 0 ? void 0 : config.usage) === null || _m === void 0 ? void 0 : _m.autoWithdraw) || true, + permissions: (_o = config === null || config === void 0 ? void 0 : config.usage) === null || _o === void 0 ? void 0 : _o.permissions, + refund_deposit: (_p = config === null || config === void 0 ? void 0 : config.usage) === null || _p === void 0 ? void 0 : _p.refundDeposit, }, time: config === null || config === void 0 ? void 0 : config.time, }; - if (!!publicKeys) return [3 /*break*/, 5]; + (0, checks_1.assertValidDropConfig)(finalConfig); + if (!!publicKeys) return [3 /*break*/, 6]; rootEntropyUsed = rootEntropy || (fundingAccountDetails === null || fundingAccountDetails === void 0 ? void 0 : fundingAccountDetails.rootEntropy); - if (!rootEntropyUsed) return [3 /*break*/, 2]; + if (!rootEntropyUsed) return [3 /*break*/, 3]; nonceDropIdMeta = Array.from({ length: numKeys }, function (_, i) { return "".concat(dropId, "_").concat(i); }); return [4 /*yield*/, (0, keypom_utils_1.generateKeys)({ numKeys: numKeys, rootEntropy: rootEntropyUsed, metaEntropy: nonceDropIdMeta })]; - case 1: - keys = _o.sent(); - return [3 /*break*/, 4]; - case 2: return [4 /*yield*/, (0, keypom_utils_1.generateKeys)({ + case 2: + keys = _q.sent(); + return [3 /*break*/, 5]; + case 3: return [4 /*yield*/, (0, keypom_utils_1.generateKeys)({ numKeys: numKeys, })]; - case 3: - // No entropy is provided so all keys should be fully random - keys = _o.sent(); - _o.label = 4; case 4: - publicKeys = keys.publicKeys; - _o.label = 5; + // No entropy is provided so all keys should be fully random + keys = _q.sent(); + _q.label = 5; case 5: + publicKeys = keys.publicKeys; + _q.label = 6; + case 6: numKeys = publicKeys.length; - if (!basePassword) return [3 /*break*/, 7]; + if (!basePassword) return [3 /*break*/, 8]; + (0, checks_1.assert)(numKeys <= 50, "Cannot add 50 keys at once with passwords"); return [4 /*yield*/, (0, keypom_utils_1.generatePerUsePasswords)({ publicKeys: publicKeys, basePassword: basePassword, uses: passwordProtectedUses || Array.from({ length: (config === null || config === void 0 ? void 0 : config.usesPerKey) || 1 }, function (_, i) { return i + 1; }) })]; - case 6: - // Generate the passwords with the base password and public keys. By default, each key will have a unique password for all of its uses unless passwordProtectedUses is passed in - passwords = _o.sent(); - _o.label = 7; case 7: - if (!ftData) return [3 /*break*/, 9]; + // Generate the passwords with the base password and public keys. By default, each key will have a unique password for all of its uses unless passwordProtectedUses is passed in + passwords = _q.sent(); + _q.label = 8; + case 8: + if (!ftData) return [3 /*break*/, 10]; ftBalancePerUse = (ftData === null || ftData === void 0 ? void 0 : ftData.absoluteAmount) || "0"; - if (!ftData.amount) return [3 /*break*/, 9]; + if (!ftData.amount) return [3 /*break*/, 10]; return [4 /*yield*/, viewAccount.viewFunction2({ contractId: ftData.contractId, methodName: 'ft_metadata', })]; - case 8: - metadata_1 = _o.sent(); - ftBalancePerUse = (0, keypom_utils_1.parseFTAmount)(ftData.amount, metadata_1.decimals); - _o.label = 9; case 9: + metadata_1 = _q.sent(); + ftBalancePerUse = (0, keypom_utils_1.parseFTAmount)(ftData.amount, metadata_1.decimals); + _q.label = 10; + case 10: + (0, checks_1.assertValidFCData)(fcData, depositPerUseYocto, finalConfig.uses_per_key); createDropArgs = { drop_id: dropId, public_keys: publicKeys || [], @@ -318,6 +323,10 @@ var createDrop = function (_a) { }) : undefined, passwords_per_use: passwords }; + // If there is no ft data, nft data, or fc data, ensure the deposit per use is greater than 0 + if (createDropArgs.fc === undefined && createDropArgs.ft === undefined && createDropArgs.nft === undefined) { + (0, checks_1.assert)(depositPerUseYocto != "0", "Deposit per use must be greater than 0 for simple drops"); + } storageCalculated = (0, keypom_utils_1.getStorageBase)(createDropArgs); return [4 /*yield*/, (0, keypom_utils_1.estimateRequiredDeposit)({ near: near, @@ -329,19 +338,19 @@ var createDrop = function (_a) { ftData: ftData, fcData: fcData, })]; - case 10: - requiredDeposit = _o.sent(); + case 11: + requiredDeposit = _q.sent(); hasBalance = false; - if (!useBalance) return [3 /*break*/, 12]; + if (!useBalance) return [3 /*break*/, 13]; return [4 /*yield*/, (0, views_1.getUserBalance)({ accountId: account.accountId })]; - case 11: - userBal = _o.sent(); + case 12: + userBal = _q.sent(); if (userBal < requiredDeposit) { throw new Error("Insufficient balance on Keypom to create drop. Use attached deposit instead."); } hasBalance = true; - _o.label = 12; - case 12: + _q.label = 13; + case 13: deposit = !hasBalance ? requiredDeposit : '0'; transactions = []; transactions.push({ @@ -357,38 +366,38 @@ var createDrop = function (_a) { } }] }); - if ((ftData === null || ftData === void 0 ? void 0 : ftData.contractId) && (publicKeys === null || publicKeys === void 0 ? void 0 : publicKeys.length)) { - transactions.push((0, keypom_utils_1.ftTransferCall)({ + if (!((ftData === null || ftData === void 0 ? void 0 : ftData.contractId) && (publicKeys === null || publicKeys === void 0 ? void 0 : publicKeys.length))) return [3 /*break*/, 15]; + _k = (_j = transactions).push; + return [4 /*yield*/, (0, keypom_utils_1.ftTransferCall)({ account: account, contractId: ftData.contractId, - args: { - receiver_id: contractId, - amount: new bn_js_1.default(ftBalancePerUse).mul(new bn_js_1.default(publicKeys.length)).toString(), - msg: dropId.toString(), - }, + absoluteAmount: new bn_js_1.default(ftBalancePerUse).mul(new bn_js_1.default(numKeys)).mul(new bn_js_1.default(finalConfig.uses_per_key)).toString(), + dropId: dropId, returnTransaction: true - })); - } + })]; + case 14: + _k.apply(_j, [_q.sent()]); + _q.label = 15; + case 15: tokenIds = nftData === null || nftData === void 0 ? void 0 : nftData.tokenIds; - if (!(tokenIds && (tokenIds === null || tokenIds === void 0 ? void 0 : tokenIds.length) > 0)) return [3 /*break*/, 14]; + if (!(tokenIds && (tokenIds === null || tokenIds === void 0 ? void 0 : tokenIds.length) > 0)) return [3 /*break*/, 17]; if (tokenIds.length > 2) { throw new Error("You can only automatically register 2 NFTs with 'createDrop'. If you need to register more NFTs you can use the method 'nftTransferCall' after you create the drop."); } return [4 /*yield*/, (0, keypom_utils_1.nftTransferCall)({ account: account, contractId: nftData.contractId, - receiverId: contractId, tokenIds: tokenIds, - msg: dropId.toString(), + dropId: dropId.toString(), returnTransactions: true })]; - case 13: - nftTXs = _o.sent(); + case 16: + nftTXs = _q.sent(); transactions = transactions.concat(nftTXs); - _o.label = 14; - case 14: return [4 /*yield*/, execute({ transactions: transactions, account: account, wallet: wallet })]; - case 15: - responses = _o.sent(); + _q.label = 17; + case 17: return [4 /*yield*/, execute({ transactions: transactions, account: account, wallet: wallet })]; + case 18: + responses = _q.sent(); return [2 /*return*/, { responses: responses, keys: keys, dropId: dropId }]; } }); @@ -450,6 +459,8 @@ var deleteDrops = function (_a) { switch (_d.label) { case 0: _c = (0, keypom_1.getEnv)(), gas300 = _c.gas300, receiverId = _c.receiverId, execute = _c.execute, getAccount = _c.getAccount; + (0, checks_1.assert)(receiverId == "v1-3.keypom.near" || receiverId == "v1-3.keypom.testnet", "Only the latest Keypom contract can be used to call this methods. Please update the contract to: v1-3.keypom.near or v1-3.keypom.testnet"); + (0, checks_1.assert)((0, checks_1.isValidAccountObj)(account), 'Passed in account is not a valid account object.'); account = getAccount({ account: account, wallet: wallet }); if (!!drops) return [3 /*break*/, 2]; if (!dropIds) { @@ -467,12 +478,13 @@ var deleteDrops = function (_a) { drops = _d.sent(); _d.label = 2; case 2: return [4 /*yield*/, Promise.all(drops.map(function (_a) { - var drop_id = _a.drop_id, keys = _a.keys, registered_uses = _a.registered_uses, ft = _a.ft, nft = _a.nft; + var owner_id = _a.owner_id, drop_id = _a.drop_id, keys = _a.keys, registered_uses = _a.registered_uses, ft = _a.ft, nft = _a.nft; return __awaiter(void 0, void 0, void 0, function () { var keySupply, updateKeys, responses, _b, _c, _d, deleteKeys, _e, _f, _g; return __generator(this, function (_h) { switch (_h.label) { case 0: + (0, checks_1.assert)(owner_id == account.accountId, 'Only the owner of the drop can delete drops.'); keySupply = (keys === null || keys === void 0 ? void 0 : keys.length) || 0; updateKeys = function () { return __awaiter(void 0, void 0, void 0, function () { var keyPromises; @@ -626,4 +638,27 @@ var deleteDrops = function (_a) { }); }; exports.deleteDrops = deleteDrops; -// TODO: add register & unregister uses +// This should be done later. Very small number of drops will have lazy registrations enabled. +// /** +// * Allows a user to register uses for a simple drop that has lazy registrations enabled. This drop can be over-registered. +// * +// * @param {Account=} account (OPTIONAL) If specified, the passed in account will be used to sign the txn instead of the funder account. +// * @param {BrowserWalletBehaviour=} wallet (OPTIONAL) If using a browser wallet through wallet selector and that wallet should sign the transaction, pass it in. +// * @param {string[]=} dropId Specify the drop ID of the drop you want to register uses on +// * +// * @example Create 5 drops and delete each of them +// * ```js +// * ``` +// */ +// export const registerUses = async ({ +// account, +// wallet, +// dropId, +// numUses, +// useBalance = false, +// }: RegisterUsesParams) => { +// const { +// gas300, receiverId, execute, getAccount +// } = getEnv() +// account = getAccount({ account, wallet }); +// } diff --git a/lib/lib/keypom-utils.d.ts b/lib/lib/keypom-utils.d.ts index 1e175993f..92a26eb06 100644 --- a/lib/lib/keypom-utils.d.ts +++ b/lib/lib/keypom-utils.d.ts @@ -116,8 +116,69 @@ export declare const keypomView: ({ methodName, args }: { args: any; }) => Promise; export declare const execute: ({ transactions, account, wallet, fundingAccount, }: ExecuteParams) => Promise>; -export declare const ftTransferCall: ({ account, contractId, args, returnTransaction, }: FTTransferCallParams) => Promise | Transaction; -export declare const nftTransferCall: ({ account, wallet, contractId, receiverId, tokenIds, msg, returnTransactions, }: NFTTransferCallParams) => Promise | Transaction[]>; +/** + * For FT Drops, keys need to be registered before they can be used. This is done via the `ft_transfer_call` method on the FT contract. + * This is a convenience method to make that process easier. + * + * @param {Account=} account (OPTIONAL) If specified, the passed in account will be used to sign the txn instead of the funder account. + * @param {BrowserWalletBehaviour=} wallet (OPTIONAL) If using a browser wallet through wallet selector and that wallet should sign the transaction, pass it in. + * @param {string} contractId The fungible token contract ID. + * @param {string} absoluteAmount Amount of tokens to transfer but considering the decimal amount (non human-readable). + Example: transferring one wNEAR should be passed in as "1000000000000000000000000" and NOT "1" + * @param {string} amount Human readable format for the amount of tokens to transfer. + Example: transferring one wNEAR should be passed in as "1" and NOT "1000000000000000000000000" + * @param {string} dropId The drop ID to register the keys for. + * @param {boolean=} returnTransaction (OPTIONAL) If true, the transaction will be returned instead of being signed and sent. + * + * @example Send FTs using the funder account (not passing in any accounts into the call) + * * ```js + * // Initialize the SDK on testnet + * await initKeypom({ + * network: "testnet", + * funder: { + * accountId: "benji_demo.testnet", + * secretKey: "ed25519:5yARProkcALbxaSQ66aYZMSBPWL9uPBmkoQGjV3oi2ddQDMh1teMAbz7jqNV9oVyMy7kZNREjYvWPqjcA6LW9Jb1" + * } + * }); + * + * await ftTransferCall({ + * contractId: "ft.keypom.testnet", + * amount: "1", + * dropId: "1231231", + * )}; + * ``` +*/ +export declare const ftTransferCall: ({ account, wallet, contractId, absoluteAmount, amount, dropId, returnTransaction, }: FTTransferCallParams) => Promise | Transaction>; +/** + * For NFT Drops, keys need to be registered before they can be used. This is done via the `nft_transfer_call` method on the NFT contract. + * This is a convenience method to make that process easier. + * + * @param {Account=} account (OPTIONAL) If specified, the passed in account will be used to sign the txn instead of the funder account. + * @param {BrowserWalletBehaviour=} wallet (OPTIONAL) If using a browser wallet through wallet selector and that wallet should sign the transaction, pass it in. + * @param {string} contractId The fungible token contract ID. + * @param {string[]} tokenIds A set of token IDs that should be sent to the Keypom contract in order to register keys. + * @param {string} dropId The drop ID to register the keys for. + * @param {boolean=} returnTransaction (OPTIONAL) If true, the transaction will be returned instead of being signed and sent. + * + * @example Send 3 NFTs using the funder account (not passing in any accounts into the call) + * * ```js + * // Initialize the SDK on testnet + * await initKeypom({ + * network: "testnet", + * funder: { + * accountId: "benji_demo.testnet", + * secretKey: "ed25519:5yARProkcALbxaSQ66aYZMSBPWL9uPBmkoQGjV3oi2ddQDMh1teMAbz7jqNV9oVyMy7kZNREjYvWPqjcA6LW9Jb1" + * } + * }); + * + * await nftTransferCall({ + * contractId: "nft.keypom.testnet", + * tokenIds: ["1", "2", "3], + * dropId: "1231231", + * )}; + * ``` +*/ +export declare const nftTransferCall: ({ account, wallet, contractId, tokenIds, dropId, returnTransactions, }: NFTTransferCallParams) => Promise | Transaction[]>; export declare const parseFTAmount: (amt: string, decimals: number) => string; export declare const transformTransactions: (transactions: SignAndSendTransactionParams[]) => SignAndSendTransactionOptions[]; export declare const getStorageBase: ({ public_keys, deposit_per_use, drop_id, config, metadata, simple, ft, nft, fc, passwords_per_use }: CreateDropProtocolArgs) => string | null; diff --git a/lib/lib/keypom-utils.js b/lib/lib/keypom-utils.js index 7fdba1ab2..0e939b8e3 100644 --- a/lib/lib/keypom-utils.js +++ b/lib/lib/keypom-utils.js @@ -67,6 +67,7 @@ var bn_js_1 = __importDefault(require("bn.js")); var nearAPI = __importStar(require("near-api-js")); var near_api_js_1 = require("near-api-js"); var near_seed_phrase_1 = require("near-seed-phrase"); +var checks_1 = require("./checks"); var keypom_1 = require("./keypom"); var KeyPair = nearAPI.KeyPair, utils = nearAPI.utils, parseNearAmount = nearAPI.utils.format.parseNearAmount; exports.exportedNearAPI = nearAPI; @@ -193,9 +194,7 @@ var generateKeys = function (_a) { metaEntropy = [metaEntropy]; } numEntropy = (metaEntropy === null || metaEntropy === void 0 ? void 0 : metaEntropy.length) || numKeys; - if (numEntropy != numKeys) { - throw new Error("You must provide the same number of meta entropy values as the number of keys"); - } + (0, checks_1.assert)(numEntropy == numKeys, "You must provide the same number of meta entropy values as the number of keys"); keyPairs = []; publicKeys = []; secretKeys = []; @@ -264,6 +263,7 @@ var getUserBalance = function (_a) { var _b, contractId, viewAccount; return __generator(this, function (_c) { _b = (0, keypom_1.getEnv)(), contractId = _b.contractId, viewAccount = _b.viewAccount; + (0, checks_1.assert)(viewAccount, 'initKeypom must be called before view functions can be called.'); return [2 /*return*/, viewAccount.viewFunction2({ contractId: contractId, methodName: 'get_user_balance', args: { account_id: accountId } })]; }); }); @@ -275,9 +275,7 @@ var keypomView = function (_a) { var _b, viewAccount, contractId; return __generator(this, function (_c) { _b = (0, keypom_1.getEnv)(), viewAccount = _b.viewAccount, contractId = _b.contractId; - if (!viewAccount) { - throw new Error('initKeypom must be called before view functions can be called.'); - } + (0, checks_1.assert)(viewAccount, 'initKeypom must be called before view functions can be called.'); return [2 /*return*/, viewAccount.viewFunction2({ contractId: contractId, methodName: methodName, @@ -351,9 +349,7 @@ var execute = function (_a) { case 6: return [2 /*return*/, responses]; case 7: nearAccount = account || fundingAccount; - if (!nearAccount) { - throw new Error("Call with either a NEAR Account argument 'account' or initialize Keypom with a 'fundingAccount'"); - } + (0, checks_1.assert)(nearAccount, "Call with either a NEAR Account argument 'account' or initialize Keypom with a 'fundingAccount'"); return [4 /*yield*/, signAndSendTransactions(nearAccount, (0, exports.transformTransactions)(transactions))]; case 8: return [2 /*return*/, _d.sent()]; } @@ -361,44 +357,129 @@ var execute = function (_a) { }); }; exports.execute = execute; -// TODO: Document this +/** + * For FT Drops, keys need to be registered before they can be used. This is done via the `ft_transfer_call` method on the FT contract. + * This is a convenience method to make that process easier. + * + * @param {Account=} account (OPTIONAL) If specified, the passed in account will be used to sign the txn instead of the funder account. + * @param {BrowserWalletBehaviour=} wallet (OPTIONAL) If using a browser wallet through wallet selector and that wallet should sign the transaction, pass it in. + * @param {string} contractId The fungible token contract ID. + * @param {string} absoluteAmount Amount of tokens to transfer but considering the decimal amount (non human-readable). + Example: transferring one wNEAR should be passed in as "1000000000000000000000000" and NOT "1" + * @param {string} amount Human readable format for the amount of tokens to transfer. + Example: transferring one wNEAR should be passed in as "1" and NOT "1000000000000000000000000" + * @param {string} dropId The drop ID to register the keys for. + * @param {boolean=} returnTransaction (OPTIONAL) If true, the transaction will be returned instead of being signed and sent. + * + * @example Send FTs using the funder account (not passing in any accounts into the call) + * * ```js + * // Initialize the SDK on testnet + * await initKeypom({ + * network: "testnet", + * funder: { + * accountId: "benji_demo.testnet", + * secretKey: "ed25519:5yARProkcALbxaSQ66aYZMSBPWL9uPBmkoQGjV3oi2ddQDMh1teMAbz7jqNV9oVyMy7kZNREjYvWPqjcA6LW9Jb1" + * } + * }); + * + * await ftTransferCall({ + * contractId: "ft.keypom.testnet", + * amount: "1", + * dropId: "1231231", + * )}; + * ``` +*/ var ftTransferCall = function (_a) { - var account = _a.account, contractId = _a.contractId, args = _a.args, _b = _a.returnTransaction, returnTransaction = _b === void 0 ? false : _b; - var tx = { - receiverId: contractId, - signerId: account.accountId, - actions: [{ - type: 'FunctionCall', - params: { - methodName: 'ft_transfer_call', - args: args, - gas: '50000000000000', - deposit: '1', - } - }] - }; - if (returnTransaction) - return tx; - return (0, exports.execute)({ account: account, transactions: [tx] }); + var account = _a.account, wallet = _a.wallet, contractId = _a.contractId, absoluteAmount = _a.absoluteAmount, amount = _a.amount, dropId = _a.dropId, _b = _a.returnTransaction, returnTransaction = _b === void 0 ? false : _b; + return __awaiter(void 0, void 0, void 0, function () { + var _c, getAccount, near, keypomContractId, viewAccount, metadata, tx; + return __generator(this, function (_d) { + switch (_d.label) { + case 0: + _c = (0, keypom_1.getEnv)(), getAccount = _c.getAccount, near = _c.near, keypomContractId = _c.receiverId, viewAccount = _c.viewAccount; + (0, checks_1.assert)(near != undefined, 'Keypom SDK is not initialized. Please call `initKeypom`.'); + (0, checks_1.assert)((0, checks_1.isValidAccountObj)(account), 'Passed in account is not a valid account object.'); + account = getAccount({ account: account, wallet: wallet }); + if (!amount) return [3 /*break*/, 2]; + return [4 /*yield*/, viewAccount.viewFunction2({ + contractId: contractId, + methodName: 'ft_metadata', + })]; + case 1: + metadata = _d.sent(); + absoluteAmount = (0, exports.parseFTAmount)(amount, metadata.decimals); + _d.label = 2; + case 2: + tx = { + receiverId: contractId, + signerId: account.accountId, + actions: [{ + type: 'FunctionCall', + params: { + methodName: 'ft_transfer_call', + args: { + receiver_id: keypomContractId, + amount: absoluteAmount, + msg: dropId.toString() + }, + gas: '50000000000000', + deposit: '1', + } + }] + }; + if (returnTransaction) + return [2 /*return*/, tx]; + return [2 /*return*/, (0, exports.execute)({ account: account, transactions: [tx] })]; + } + }); + }); }; exports.ftTransferCall = ftTransferCall; -// TODO: Document this +/** + * For NFT Drops, keys need to be registered before they can be used. This is done via the `nft_transfer_call` method on the NFT contract. + * This is a convenience method to make that process easier. + * + * @param {Account=} account (OPTIONAL) If specified, the passed in account will be used to sign the txn instead of the funder account. + * @param {BrowserWalletBehaviour=} wallet (OPTIONAL) If using a browser wallet through wallet selector and that wallet should sign the transaction, pass it in. + * @param {string} contractId The fungible token contract ID. + * @param {string[]} tokenIds A set of token IDs that should be sent to the Keypom contract in order to register keys. + * @param {string} dropId The drop ID to register the keys for. + * @param {boolean=} returnTransaction (OPTIONAL) If true, the transaction will be returned instead of being signed and sent. + * + * @example Send 3 NFTs using the funder account (not passing in any accounts into the call) + * * ```js + * // Initialize the SDK on testnet + * await initKeypom({ + * network: "testnet", + * funder: { + * accountId: "benji_demo.testnet", + * secretKey: "ed25519:5yARProkcALbxaSQ66aYZMSBPWL9uPBmkoQGjV3oi2ddQDMh1teMAbz7jqNV9oVyMy7kZNREjYvWPqjcA6LW9Jb1" + * } + * }); + * + * await nftTransferCall({ + * contractId: "nft.keypom.testnet", + * tokenIds: ["1", "2", "3], + * dropId: "1231231", + * )}; + * ``` +*/ var nftTransferCall = function (_a) { - var account = _a.account, wallet = _a.wallet, contractId = _a.contractId, receiverId = _a.receiverId, tokenIds = _a.tokenIds, msg = _a.msg, _b = _a.returnTransactions, returnTransactions = _b === void 0 ? false : _b; + var account = _a.account, wallet = _a.wallet, contractId = _a.contractId, tokenIds = _a.tokenIds, dropId = _a.dropId, _b = _a.returnTransactions, returnTransactions = _b === void 0 ? false : _b; return __awaiter(void 0, void 0, void 0, function () { - var getAccount, responses, transactions, i, tx, _c, _d; - return __generator(this, function (_e) { - switch (_e.label) { + var _c, getAccount, near, receiverId, responses, transactions, i, tx, _d, _e; + return __generator(this, function (_f) { + switch (_f.label) { case 0: - getAccount = (0, keypom_1.getEnv)().getAccount; + _c = (0, keypom_1.getEnv)(), getAccount = _c.getAccount, near = _c.near, receiverId = _c.receiverId; + (0, checks_1.assert)(near != undefined, 'Keypom SDK is not initialized. Please call `initKeypom`.'); + (0, checks_1.assert)((0, checks_1.isValidAccountObj)(account), 'Passed in account is not a valid account object.'); account = getAccount({ account: account, wallet: wallet }); - if (tokenIds.length > 6) { - throw new Error("This method can only transfer 6 NFTs in 1 batch transaction."); - } + (0, checks_1.assert)(tokenIds.length < 6, "This method can only transfer 6 NFTs in 1 batch transaction."); responses = []; transactions = []; i = 0; - _e.label = 1; + _f.label = 1; case 1: if (!(i < tokenIds.length)) return [3 /*break*/, 4]; tx = { @@ -411,7 +492,7 @@ var nftTransferCall = function (_a) { args: { receiver_id: receiverId, token_id: tokenIds[i], - msg: msg + msg: dropId.toString() }, gas: '50000000000000', deposit: '1', @@ -421,14 +502,14 @@ var nftTransferCall = function (_a) { transactions.push(tx); if (returnTransactions) return [3 /*break*/, 3]; - _d = (_c = responses).push; + _e = (_d = responses).push; return [4 /*yield*/, (0, exports.execute)({ account: account, transactions: transactions, })]; case 2: - _d.apply(_c, [_e.sent()]); - _e.label = 3; + _e.apply(_d, [_f.sent()]); + _f.label = 3; case 3: i++; return [3 /*break*/, 1]; @@ -622,7 +703,7 @@ var estimateRequiredDeposit = function (_a) { extraFtCosts = _e.sent(); requiredDeposit = requiredDeposit.add(new bn_js_1.default(extraFtCosts)); _e.label = 2; - case 2: return [2 /*return*/, requiredDeposit.toString()]; + case 2: return [2 /*return*/, requiredDeposit.toString() || "0"]; } }); }); @@ -700,7 +781,7 @@ var getFtCosts = function (near, numKeys, usesPerKey, ftContract) { return __awa min = (_a.sent()).min; costs = new bn_js_1.default(min).mul(new bn_js_1.default(numKeys)).mul(new bn_js_1.default(usesPerKey)).add(new bn_js_1.default(min)); // console.log('costs: ', costs.toString()); - return [2 /*return*/, costs.toString()]; + return [2 /*return*/, costs.toString() || "0"]; } }); }); }; diff --git a/lib/lib/keypom.js b/lib/lib/keypom.js index 89f866881..ee48dc3f8 100644 --- a/lib/lib/keypom.js +++ b/lib/lib/keypom.js @@ -76,6 +76,7 @@ var KeyPair = nearAPI.KeyPair, _a = nearAPI.keyStores, BrowserLocalStorageKeySto var near_api_js_1 = require("near-api-js"); var near_seed_phrase_1 = require("near-seed-phrase"); var keypom_utils_1 = require("./keypom-utils"); +var checks_1 = require("./checks"); var gas = '200000000000000'; var gas300 = '300000000000000'; var attachedGas = '100000000000000'; @@ -95,6 +96,16 @@ var networks = { helperUrl: 'https://helper.testnet.near.org' } }; +var officialKeypomContracts = { + mainnet: { + "v1.keypom.near": true, + "v1-3.keypom.near": true + }, + testnet: { + "v1.keypom.testnet": true, + "v1-3.keypom.testnet": true + } +}; var contractBase = 'v1-3.keypom'; var contractId = "".concat(contractBase, ".testnet"); var receiverId = contractId; @@ -225,7 +236,9 @@ var initKeypom = function (_a) { return __generator(this, function (_c) { switch (_c.label) { case 0: + (0, checks_1.assert)(network == "testnet" || network == "mainnet", "Network must be either `testnet` or `mainnet`"); if (_near) { + (0, checks_1.assert)((0, checks_1.isValidNearObject)(_near), "The NEAR object passed in is not valid. Please pass in a valid NEAR object."); near = _near; keyStore = near.config.keyStore; } @@ -240,6 +253,10 @@ var initKeypom = function (_a) { contractId = receiverId = "".concat(contractBase, ".near"); } if (keypomContractId) { + (0, checks_1.assert)(officialKeypomContracts[networkId][keypomContractId] === true, "The keypom contract passed in must be an official Keypom contract for the given network."); + if (keypomContractId != "v1-3.keypom.near" || keypomContractId != "v1-3.keypom.near") { + console.warn("The Keypom contract you are using is not the latest version. Most methods will be unavailable. Please use the latest contract: v1-3.keypom.near or v1-3.keypom.testnet"); + } contractId = receiverId = keypomContractId; } viewAccount = new near_api_js_1.Account(connection, networks[networkId].viewAccountId); @@ -300,9 +317,8 @@ var updateFunder = function (_a) { return __generator(this, function (_b) { switch (_b.label) { case 0: - if (near == undefined) { - throw new Error("You must initialize the SDK via `initKeypom` before updating the funder account."); - } + (0, checks_1.assert)(near !== undefined, "You must initialize the SDK via `initKeypom` before updating the funder account."); + (0, checks_1.assert)((0, checks_1.isValidFunderObject)(funder), "The funder object passed in is not valid. Please pass in a valid funder object."); accountId = funder.accountId, secretKey = funder.secretKey, seedPhrase = funder.seedPhrase; if (seedPhrase) { secretKey = (0, near_seed_phrase_1.parseSeedPhrase)(seedPhrase).secretKey; @@ -352,8 +368,10 @@ var updateKeypomContractId = function (_a) { var keypomContractId = _a.keypomContractId; return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_b) { - if (near == undefined) { - throw new Error("You must initialize the SDK via `initKeypom` before updating the Keypom contract ID."); + (0, checks_1.assert)(near !== undefined, "You must initialize the SDK via `initKeypom` before updating the Keypom contract ID."); + (0, checks_1.assert)(officialKeypomContracts[networkId][keypomContractId] === true, "The keypom contract passed in must be an official Keypom contract for the given network."); + if (keypomContractId != "v1-3.keypom.near" || keypomContractId != "v1-3.keypom.near") { + console.warn("The Keypom contract you are using is not the latest version. Most methods will be unavailable. Please use the latest contract: v1-3.keypom.near or v1-3.keypom.testnet"); } contractId = receiverId = keypomContractId; contractAccount = new near_api_js_1.Account(connection, contractId); diff --git a/lib/lib/keys.js b/lib/lib/keys.js index 7da02b619..4d2c0259e 100644 --- a/lib/lib/keys.js +++ b/lib/lib/keys.js @@ -69,6 +69,7 @@ var parseNearAmount = nearAPI.utils.format.parseNearAmount; var views_1 = require("./views"); var keypom_1 = require("./keypom"); var keypom_utils_1 = require("./keypom-utils"); +var checks_1 = require("./checks"); /** * Add keys to a specific drop * @@ -187,29 +188,27 @@ var keypom_utils_1 = require("./keypom-utils"); var addKeys = function (_a) { var account = _a.account, wallet = _a.wallet, dropId = _a.dropId, drop = _a.drop, numKeys = _a.numKeys, publicKeys = _a.publicKeys, nftTokenIds = _a.nftTokenIds, rootEntropy = _a.rootEntropy, basePassword = _a.basePassword, passwordProtectedUses = _a.passwordProtectedUses, _b = _a.useBalance, useBalance = _b === void 0 ? false : _b; return __awaiter(void 0, void 0, void 0, function () { - var _c, near, gas, contractId, receiverId, getAccount, execute, fundingAccountDetails, _d, drop_id, registered_uses, required_gas, deposit_per_use, uses_per_key, _e, ftData, _f, nftData, fcData, next_key_id, _g, keys, rootEntropyUsed, nonceDropIdMeta, passwords, camelFTData, camelFCData, requiredDeposit, hasBalance, userBal, transactions, responses, nftResponses; - return __generator(this, function (_h) { - switch (_h.label) { + var _c, near, gas, contractId, receiverId, getAccount, execute, fundingAccountDetails, _d, drop_id, owner_id, registered_uses, required_gas, deposit_per_use, uses_per_key, _e, ftData, _f, nftData, fcData, next_key_id, _g, keys, rootEntropyUsed, nonceDropIdMeta, passwords, camelFTData, camelFCData, requiredDeposit, hasBalance, userBal, transactions, _h, _j, responses, nftResponses; + return __generator(this, function (_k) { + switch (_k.label) { case 0: _c = (0, keypom_1.getEnv)(), near = _c.near, gas = _c.gas, contractId = _c.contractId, receiverId = _c.receiverId, getAccount = _c.getAccount, execute = _c.execute, fundingAccountDetails = _c.fundingAccountDetails; - if (!near) { - throw new Error('Keypom SDK is not initialized. Please call `initKeypom`.'); - } - if (!drop && !dropId) { - throw new Error("Either a dropId or drop object must be passed in."); - } - if (!(publicKeys === null || publicKeys === void 0 ? void 0 : publicKeys.length) && !numKeys) { - throw new Error("Either pass in publicKeys or set numKeys to a positive non-zero value."); - } + (0, checks_1.assert)(near != undefined, 'Keypom SDK is not initialized. Please call `initKeypom`.'); + (0, checks_1.assert)((0, checks_1.isValidAccountObj)(account), 'Passed in account is not a valid account object.'); + account = getAccount({ account: account, wallet: wallet }); + (0, checks_1.assert)(drop || dropId, 'Either a dropId or drop object must be passed in.'); + (0, checks_1.assert)(numKeys || (publicKeys === null || publicKeys === void 0 ? void 0 : publicKeys.length), "Either pass in publicKeys or set numKeys to a positive non-zero value."); + (0, checks_1.assert)(receiverId == "v1-3.keypom.near" || receiverId == "v1-3.keypom.testnet", "Only the latest Keypom contract can be used to call this methods. Please update the contract to: v1-3.keypom.near or v1-3.keypom.testnet"); account = getAccount({ account: account, wallet: wallet }); _g = drop; if (_g) return [3 /*break*/, 2]; return [4 /*yield*/, (0, views_1.getDropInformation)({ dropId: dropId })]; case 1: - _g = (_h.sent()); - _h.label = 2; + _g = (_k.sent()); + _k.label = 2; case 2: - _d = _g, drop_id = _d.drop_id, registered_uses = _d.registered_uses, required_gas = _d.required_gas, deposit_per_use = _d.deposit_per_use, uses_per_key = _d.config.uses_per_key, _e = _d.ft, ftData = _e === void 0 ? {} : _e, _f = _d.nft, nftData = _f === void 0 ? {} : _f, fcData = _d.fc, next_key_id = _d.next_key_id; + _d = _g, drop_id = _d.drop_id, owner_id = _d.owner_id, registered_uses = _d.registered_uses, required_gas = _d.required_gas, deposit_per_use = _d.deposit_per_use, uses_per_key = _d.config.uses_per_key, _e = _d.ft, ftData = _e === void 0 ? {} : _e, _f = _d.nft, nftData = _f === void 0 ? {} : _f, fcData = _d.fc, next_key_id = _d.next_key_id; + (0, checks_1.assert)(owner_id === account.accountId, 'You are not the owner of this drop. You cannot add keys to it.'); if (!!publicKeys) return [3 /*break*/, 7]; rootEntropyUsed = rootEntropy || (fundingAccountDetails === null || fundingAccountDetails === void 0 ? void 0 : fundingAccountDetails.rootEntropy); if (!rootEntropyUsed) return [3 /*break*/, 4]; @@ -220,21 +219,22 @@ var addKeys = function (_a) { metaEntropy: nonceDropIdMeta })]; case 3: - keys = _h.sent(); + keys = _k.sent(); return [3 /*break*/, 6]; case 4: return [4 /*yield*/, (0, keypom_utils_1.generateKeys)({ numKeys: numKeys, })]; case 5: // No entropy is provided so all keys should be fully random - keys = _h.sent(); - _h.label = 6; + keys = _k.sent(); + _k.label = 6; case 6: publicKeys = keys.publicKeys; - _h.label = 7; + _k.label = 7; case 7: numKeys = publicKeys.length; if (!basePassword) return [3 /*break*/, 9]; + (0, checks_1.assert)(numKeys <= 50, "Cannot add 50 keys at once with passwords"); return [4 /*yield*/, (0, keypom_utils_1.generatePerUsePasswords)({ publicKeys: publicKeys, basePassword: basePassword, @@ -242,8 +242,8 @@ var addKeys = function (_a) { })]; case 8: // Generate the passwords with the base password and public keys. By default, each key will have a unique password for all of its uses unless passwordProtectedUses is passed in - passwords = _h.sent(); - _h.label = 9; + passwords = _k.sent(); + _k.label = 9; case 9: camelFTData = (0, keypom_utils_1.toCamel)(ftData); camelFCData = (0, keypom_utils_1.toCamel)(fcData); @@ -258,18 +258,15 @@ var addKeys = function (_a) { ftData: camelFTData })]; case 10: - requiredDeposit = _h.sent(); - console.log('requiredDeposit: ', requiredDeposit); + requiredDeposit = _k.sent(); hasBalance = false; if (!useBalance) return [3 /*break*/, 12]; return [4 /*yield*/, (0, views_1.getUserBalance)({ accountId: account.accountId })]; case 11: - userBal = _h.sent(); - if (userBal < requiredDeposit) { - throw new Error("Insufficient balance on Keypom to create drop. Use attached deposit instead."); - } + userBal = _k.sent(); + (0, checks_1.assert)(userBal >= requiredDeposit, "Insufficient balance on Keypom to create drop. Use attached deposit instead."); hasBalance = true; - _h.label = 12; + _k.label = 12; case 12: transactions = []; transactions.push({ @@ -288,34 +285,33 @@ var addKeys = function (_a) { } }] }); - if (ftData.contract_id) { - transactions.push((0, keypom_utils_1.ftTransferCall)({ + if (!ftData.contract_id) return [3 /*break*/, 14]; + _j = (_h = transactions).push; + return [4 /*yield*/, (0, keypom_utils_1.ftTransferCall)({ account: account, contractId: ftData.contract_id, - args: { - receiver_id: contractId, - amount: new bn_js_1.default(ftData.balance_per_use).mul(new bn_js_1.default(numKeys - registered_uses)).toString(), - msg: drop_id.toString(), - }, + absoluteAmount: new bn_js_1.default(ftData.balance_per_use).mul(new bn_js_1.default(numKeys)).mul(new bn_js_1.default(uses_per_key)).toString(), + dropId: drop_id, returnTransaction: true - })); - } - return [4 /*yield*/, execute({ transactions: transactions, account: account, wallet: wallet })]; + })]; case 13: - responses = _h.sent(); - if (!(nftTokenIds && nftTokenIds.length > 0)) return [3 /*break*/, 15]; + _j.apply(_h, [_k.sent()]); + _k.label = 14; + case 14: return [4 /*yield*/, execute({ transactions: transactions, account: account, wallet: wallet })]; + case 15: + responses = _k.sent(); + if (!(nftTokenIds && nftTokenIds.length > 0)) return [3 /*break*/, 17]; return [4 /*yield*/, (0, keypom_utils_1.nftTransferCall)({ account: account, contractId: nftData.contract_id, - receiverId: contractId, tokenIds: nftTokenIds, - msg: drop_id.toString(), + dropId: drop_id.toString(), })]; - case 14: - nftResponses = _h.sent(); + case 16: + nftResponses = _k.sent(); responses = responses.concat(nftResponses); - _h.label = 15; - case 15: return [2 /*return*/, { responses: responses, dropId: drop_id, keys: keys }]; + _k.label = 17; + case 17: return [2 /*return*/, { responses: responses, dropId: drop_id, keys: keys }]; } }); }); @@ -356,14 +352,18 @@ exports.addKeys = addKeys; var deleteKeys = function (_a) { var account = _a.account, wallet = _a.wallet, publicKeys = _a.publicKeys, dropId = _a.dropId, _b = _a.withdrawBalance, withdrawBalance = _b === void 0 ? false : _b; return __awaiter(void 0, void 0, void 0, function () { - var _c, receiverId, execute, _d, drop_id, registered_uses, ft, nft, actions, transactions; + var _c, receiverId, execute, getAccount, _d, owner_id, drop_id, registered_uses, ft, nft, actions, transactions; return __generator(this, function (_e) { switch (_e.label) { case 0: - _c = (0, keypom_1.getEnv)(), receiverId = _c.receiverId, execute = _c.execute; + _c = (0, keypom_1.getEnv)(), receiverId = _c.receiverId, execute = _c.execute, getAccount = _c.getAccount; + (0, checks_1.assert)(receiverId == "v1-3.keypom.near" || receiverId == "v1-3.keypom.testnet", "Only the latest Keypom contract can be used to call this methods. Please update the contract to: v1-3.keypom.near or v1-3.keypom.testnet"); return [4 /*yield*/, (0, views_1.getDropInformation)({ dropId: dropId })]; case 1: - _d = _e.sent(), drop_id = _d.drop_id, registered_uses = _d.registered_uses, ft = _d.ft, nft = _d.nft; + _d = _e.sent(), owner_id = _d.owner_id, drop_id = _d.drop_id, registered_uses = _d.registered_uses, ft = _d.ft, nft = _d.nft; + (0, checks_1.assert)((0, checks_1.isValidAccountObj)(account), 'Passed in account is not a valid account object.'); + account = getAccount({ account: account, wallet: wallet }); + (0, checks_1.assert)(owner_id == account.accountId, 'Only the owner of the drop can delete keys.'); actions = []; if ((ft || nft) && registered_uses > 0) { actions.push({ diff --git a/lib/lib/types/params.d.ts b/lib/lib/types/params.d.ts index 231ed321b..94b7d73c0 100644 --- a/lib/lib/types/params.d.ts +++ b/lib/lib/types/params.d.ts @@ -40,6 +40,13 @@ export interface AddKeyParams { passwordProtectedUses?: number[]; useBalance?: boolean; } +export interface RegisterUsesParams { + account?: Account; + wallet?: BrowserWalletBehaviour; + dropId: string; + numUses: number; + useBalance?: boolean; +} export interface DeleteDropParams { account?: Account; wallet?: BrowserWalletBehaviour; @@ -72,18 +79,20 @@ export interface GenerateKeysParams { metaEntropy?: string[] | string; } export interface FTTransferCallParams { - account: Account; + account?: Account; + wallet?: BrowserWalletBehaviour; contractId: string; - args: object; + absoluteAmount?: string; + amount?: string; + dropId: string; returnTransaction?: boolean; } export interface NFTTransferCallParams { account?: Account; wallet?: BrowserWalletBehaviour; contractId: string; - receiverId: string; tokenIds: string[]; - msg: string | null; + dropId: string; returnTransactions?: boolean; } export interface EstimatorParams { diff --git a/lib/lib/views.js b/lib/lib/views.js index 7561effcf..7a4eac137 100644 --- a/lib/lib/views.js +++ b/lib/lib/views.js @@ -37,6 +37,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) { }; Object.defineProperty(exports, "__esModule", { value: true }); exports.getContractSourceMetadata = exports.getUserBalance = exports.getNftTokenIDsForDrop = exports.getNftSupplyForDrop = exports.getDrops = exports.getDropSupplyForOwner = exports.getKeysForDrop = exports.getKeySupplyForDrop = exports.getDropInformation = exports.getKeyInformationBatch = exports.getKeyInformation = exports.getKeys = exports.getKeyTotalSupply = exports.getKeyBalance = void 0; +var checks_1 = require("./checks"); var drops_1 = require("./drops"); var keypom_1 = require("./keypom"); var keypom_utils_1 = require("./keypom-utils"); @@ -288,6 +289,7 @@ var getDropInformation = function (_a) { switch (_e.label) { case 0: _c = (0, keypom_1.getEnv)(), viewAccount = _c.viewAccount, contractId = _c.contractId; + (0, checks_1.assert)(viewAccount, 'initKeypom must be called before view functions can be called.'); return [4 /*yield*/, viewAccount.viewFunction2({ contractId: contractId, methodName: 'get_drop_information', @@ -504,9 +506,7 @@ var getDrops = function (_a) { case 1: drops = _c.sent(); if (!withKeys) return [3 /*break*/, 3]; - if (drops.length > 20) { - throw new Error("Too many RPC requests in parallel. Use 'limit' arg 20 or less."); - } + (0, checks_1.assert)(drops.length <= 20, "Too many RPC requests in parallel. Use 'limit' arg 20 or less."); return [4 /*yield*/, Promise.all(drops.map(function (drop, i) { return __awaiter(void 0, void 0, void 0, function () { var drop_id, _a; return __generator(this, function (_b) { diff --git a/lib/tsconfig.tsbuildinfo b/lib/tsconfig.tsbuildinfo index d4e3cd883..6876fa3c1 100644 --- a/lib/tsconfig.tsbuildinfo +++ b/lib/tsconfig.tsbuildinfo @@ -1 +1 @@ -{"program":{"fileNames":["../node_modules/typescript/lib/lib.d.ts","../node_modules/typescript/lib/lib.es5.d.ts","../node_modules/typescript/lib/lib.es2015.d.ts","../node_modules/typescript/lib/lib.es2016.d.ts","../node_modules/typescript/lib/lib.es2017.d.ts","../node_modules/typescript/lib/lib.es2018.d.ts","../node_modules/typescript/lib/lib.dom.d.ts","../node_modules/typescript/lib/lib.webworker.importscripts.d.ts","../node_modules/typescript/lib/lib.scripthost.d.ts","../node_modules/typescript/lib/lib.es2015.core.d.ts","../node_modules/typescript/lib/lib.es2015.collection.d.ts","../node_modules/typescript/lib/lib.es2015.generator.d.ts","../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../node_modules/typescript/lib/lib.es2015.promise.d.ts","../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../node_modules/typescript/lib/lib.es2017.object.d.ts","../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2017.string.d.ts","../node_modules/typescript/lib/lib.es2017.intl.d.ts","../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../node_modules/typescript/lib/lib.es2018.intl.d.ts","../node_modules/typescript/lib/lib.es2018.promise.d.ts","../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../node_modules/typescript/lib/lib.es2020.intl.d.ts","../node_modules/typescript/lib/lib.esnext.intl.d.ts","../node_modules/near-api-js/lib/utils/enums.d.ts","../node_modules/near-api-js/lib/utils/key_pair.d.ts","../node_modules/near-api-js/lib/key_stores/keystore.d.ts","../node_modules/near-api-js/lib/key_stores/in_memory_key_store.d.ts","../node_modules/near-api-js/lib/key_stores/browser_local_storage_key_store.d.ts","../node_modules/near-api-js/lib/key_stores/unencrypted_file_system_keystore.d.ts","../node_modules/near-api-js/lib/key_stores/merge_key_store.d.ts","../node_modules/near-api-js/lib/key_stores/index.d.ts","../node_modules/@types/node/globals.d.ts","../node_modules/@types/node/assert.d.ts","../node_modules/@types/node/async_hooks.d.ts","../node_modules/@types/node/buffer.d.ts","../node_modules/@types/node/child_process.d.ts","../node_modules/@types/node/cluster.d.ts","../node_modules/@types/node/console.d.ts","../node_modules/@types/node/constants.d.ts","../node_modules/@types/node/crypto.d.ts","../node_modules/@types/node/dgram.d.ts","../node_modules/@types/node/dns.d.ts","../node_modules/@types/node/domain.d.ts","../node_modules/@types/node/events.d.ts","../node_modules/@types/node/fs.d.ts","../node_modules/@types/node/http.d.ts","../node_modules/@types/node/http2.d.ts","../node_modules/@types/node/https.d.ts","../node_modules/@types/node/inspector.d.ts","../node_modules/@types/node/module.d.ts","../node_modules/@types/node/net.d.ts","../node_modules/@types/node/os.d.ts","../node_modules/@types/node/path.d.ts","../node_modules/@types/node/perf_hooks.d.ts","../node_modules/@types/node/process.d.ts","../node_modules/@types/node/punycode.d.ts","../node_modules/@types/node/querystring.d.ts","../node_modules/@types/node/readline.d.ts","../node_modules/@types/node/repl.d.ts","../node_modules/@types/node/stream.d.ts","../node_modules/@types/node/string_decoder.d.ts","../node_modules/@types/node/timers.d.ts","../node_modules/@types/node/tls.d.ts","../node_modules/@types/node/trace_events.d.ts","../node_modules/@types/node/tty.d.ts","../node_modules/@types/node/url.d.ts","../node_modules/@types/node/util.d.ts","../node_modules/@types/node/v8.d.ts","../node_modules/@types/node/vm.d.ts","../node_modules/@types/node/worker_threads.d.ts","../node_modules/@types/node/zlib.d.ts","../node_modules/@types/node/base.d.ts","../node_modules/@types/node/ts3.2/util.d.ts","../node_modules/@types/node/ts3.2/globals.d.ts","../node_modules/@types/node/ts3.2/index.d.ts","../node_modules/near-api-js/lib/signer.d.ts","../node_modules/near-api-js/lib/transaction.d.ts","../node_modules/near-api-js/lib/providers/provider.d.ts","../node_modules/near-api-js/lib/utils/web.d.ts","../node_modules/near-api-js/lib/utils/errors.d.ts","../node_modules/near-api-js/lib/providers/json-rpc-provider.d.ts","../node_modules/near-api-js/lib/providers/index.d.ts","../node_modules/borsh/lib/index.d.ts","../node_modules/near-api-js/lib/utils/serialize.d.ts","../node_modules/near-api-js/lib/utils/format.d.ts","../node_modules/near-api-js/lib/utils/rpc_errors.d.ts","../node_modules/near-api-js/lib/utils/index.d.ts","../node_modules/near-api-js/lib/validators.d.ts","../node_modules/near-api-js/lib/connection.d.ts","../node_modules/near-api-js/lib/account.d.ts","../node_modules/near-api-js/lib/account_multisig.d.ts","../node_modules/near-api-js/lib/account_creator.d.ts","../node_modules/near-api-js/lib/contract.d.ts","../node_modules/near-api-js/lib/near.d.ts","../node_modules/near-api-js/lib/wallet-account.d.ts","../node_modules/near-api-js/lib/common-index.d.ts","../node_modules/near-api-js/lib/connect.d.ts","../node_modules/near-api-js/lib/constants.d.ts","../node_modules/near-api-js/lib/index.d.ts","../node_modules/@near-wallet-selector/core/lib/services/provider/provider.service.types.d.ts","../node_modules/@near-wallet-selector/core/lib/services/provider/provider.service.d.ts","../node_modules/@near-wallet-selector/core/lib/services/storage/storage.service.types.d.ts","../node_modules/@near-wallet-selector/core/lib/services/storage/json-storage.service.types.d.ts","../node_modules/@near-wallet-selector/core/lib/services/storage/json-storage.service.d.ts","../node_modules/@near-wallet-selector/core/lib/services/storage/web-storage.service.d.ts","../node_modules/@near-wallet-selector/core/lib/services/logger/logger.service.types.d.ts","../node_modules/@near-wallet-selector/core/lib/services/logger/logger.service.d.ts","../node_modules/@near-wallet-selector/core/lib/wallet/transactions.types.d.ts","../node_modules/@near-wallet-selector/core/lib/wallet/index.d.ts","../node_modules/@near-wallet-selector/core/lib/options.types.d.ts","../node_modules/rxjs/dist/types/internal/subscription.d.ts","../node_modules/rxjs/dist/types/internal/subscriber.d.ts","../node_modules/rxjs/dist/types/internal/operator.d.ts","../node_modules/rxjs/dist/types/internal/observable.d.ts","../node_modules/rxjs/dist/types/internal/types.d.ts","../node_modules/rxjs/dist/types/internal/operators/audit.d.ts","../node_modules/rxjs/dist/types/internal/operators/audittime.d.ts","../node_modules/rxjs/dist/types/internal/operators/buffer.d.ts","../node_modules/rxjs/dist/types/internal/operators/buffercount.d.ts","../node_modules/rxjs/dist/types/internal/operators/buffertime.d.ts","../node_modules/rxjs/dist/types/internal/operators/buffertoggle.d.ts","../node_modules/rxjs/dist/types/internal/operators/bufferwhen.d.ts","../node_modules/rxjs/dist/types/internal/operators/catcherror.d.ts","../node_modules/rxjs/dist/types/internal/operators/combinelatestall.d.ts","../node_modules/rxjs/dist/types/internal/operators/combineall.d.ts","../node_modules/rxjs/dist/types/internal/operators/combinelatest.d.ts","../node_modules/rxjs/dist/types/internal/operators/combinelatestwith.d.ts","../node_modules/rxjs/dist/types/internal/operators/concat.d.ts","../node_modules/rxjs/dist/types/internal/operators/concatall.d.ts","../node_modules/rxjs/dist/types/internal/operators/concatmap.d.ts","../node_modules/rxjs/dist/types/internal/operators/concatmapto.d.ts","../node_modules/rxjs/dist/types/internal/operators/concatwith.d.ts","../node_modules/rxjs/dist/types/internal/operators/connect.d.ts","../node_modules/rxjs/dist/types/internal/operators/count.d.ts","../node_modules/rxjs/dist/types/internal/operators/debounce.d.ts","../node_modules/rxjs/dist/types/internal/operators/debouncetime.d.ts","../node_modules/rxjs/dist/types/internal/operators/defaultifempty.d.ts","../node_modules/rxjs/dist/types/internal/operators/delay.d.ts","../node_modules/rxjs/dist/types/internal/operators/delaywhen.d.ts","../node_modules/rxjs/dist/types/internal/operators/dematerialize.d.ts","../node_modules/rxjs/dist/types/internal/operators/distinct.d.ts","../node_modules/rxjs/dist/types/internal/operators/distinctuntilchanged.d.ts","../node_modules/rxjs/dist/types/internal/operators/distinctuntilkeychanged.d.ts","../node_modules/rxjs/dist/types/internal/operators/elementat.d.ts","../node_modules/rxjs/dist/types/internal/operators/endwith.d.ts","../node_modules/rxjs/dist/types/internal/operators/every.d.ts","../node_modules/rxjs/dist/types/internal/operators/exhaustall.d.ts","../node_modules/rxjs/dist/types/internal/operators/exhaust.d.ts","../node_modules/rxjs/dist/types/internal/operators/exhaustmap.d.ts","../node_modules/rxjs/dist/types/internal/operators/expand.d.ts","../node_modules/rxjs/dist/types/internal/operators/filter.d.ts","../node_modules/rxjs/dist/types/internal/operators/finalize.d.ts","../node_modules/rxjs/dist/types/internal/operators/find.d.ts","../node_modules/rxjs/dist/types/internal/operators/findindex.d.ts","../node_modules/rxjs/dist/types/internal/operators/first.d.ts","../node_modules/rxjs/dist/types/internal/subject.d.ts","../node_modules/rxjs/dist/types/internal/operators/groupby.d.ts","../node_modules/rxjs/dist/types/internal/operators/ignoreelements.d.ts","../node_modules/rxjs/dist/types/internal/operators/isempty.d.ts","../node_modules/rxjs/dist/types/internal/operators/last.d.ts","../node_modules/rxjs/dist/types/internal/operators/map.d.ts","../node_modules/rxjs/dist/types/internal/operators/mapto.d.ts","../node_modules/rxjs/dist/types/internal/notification.d.ts","../node_modules/rxjs/dist/types/internal/operators/materialize.d.ts","../node_modules/rxjs/dist/types/internal/operators/max.d.ts","../node_modules/rxjs/dist/types/internal/operators/merge.d.ts","../node_modules/rxjs/dist/types/internal/operators/mergeall.d.ts","../node_modules/rxjs/dist/types/internal/operators/mergemap.d.ts","../node_modules/rxjs/dist/types/internal/operators/flatmap.d.ts","../node_modules/rxjs/dist/types/internal/operators/mergemapto.d.ts","../node_modules/rxjs/dist/types/internal/operators/mergescan.d.ts","../node_modules/rxjs/dist/types/internal/operators/mergewith.d.ts","../node_modules/rxjs/dist/types/internal/operators/min.d.ts","../node_modules/rxjs/dist/types/internal/observable/connectableobservable.d.ts","../node_modules/rxjs/dist/types/internal/operators/multicast.d.ts","../node_modules/rxjs/dist/types/internal/operators/observeon.d.ts","../node_modules/rxjs/dist/types/internal/operators/onerrorresumenext.d.ts","../node_modules/rxjs/dist/types/internal/operators/pairwise.d.ts","../node_modules/rxjs/dist/types/internal/operators/partition.d.ts","../node_modules/rxjs/dist/types/internal/operators/pluck.d.ts","../node_modules/rxjs/dist/types/internal/operators/publish.d.ts","../node_modules/rxjs/dist/types/internal/operators/publishbehavior.d.ts","../node_modules/rxjs/dist/types/internal/operators/publishlast.d.ts","../node_modules/rxjs/dist/types/internal/operators/publishreplay.d.ts","../node_modules/rxjs/dist/types/internal/operators/race.d.ts","../node_modules/rxjs/dist/types/internal/operators/racewith.d.ts","../node_modules/rxjs/dist/types/internal/operators/reduce.d.ts","../node_modules/rxjs/dist/types/internal/operators/repeat.d.ts","../node_modules/rxjs/dist/types/internal/operators/repeatwhen.d.ts","../node_modules/rxjs/dist/types/internal/operators/retry.d.ts","../node_modules/rxjs/dist/types/internal/operators/retrywhen.d.ts","../node_modules/rxjs/dist/types/internal/operators/refcount.d.ts","../node_modules/rxjs/dist/types/internal/operators/sample.d.ts","../node_modules/rxjs/dist/types/internal/operators/sampletime.d.ts","../node_modules/rxjs/dist/types/internal/operators/scan.d.ts","../node_modules/rxjs/dist/types/internal/operators/sequenceequal.d.ts","../node_modules/rxjs/dist/types/internal/operators/share.d.ts","../node_modules/rxjs/dist/types/internal/operators/sharereplay.d.ts","../node_modules/rxjs/dist/types/internal/operators/single.d.ts","../node_modules/rxjs/dist/types/internal/operators/skip.d.ts","../node_modules/rxjs/dist/types/internal/operators/skiplast.d.ts","../node_modules/rxjs/dist/types/internal/operators/skipuntil.d.ts","../node_modules/rxjs/dist/types/internal/operators/skipwhile.d.ts","../node_modules/rxjs/dist/types/internal/operators/startwith.d.ts","../node_modules/rxjs/dist/types/internal/operators/subscribeon.d.ts","../node_modules/rxjs/dist/types/internal/operators/switchall.d.ts","../node_modules/rxjs/dist/types/internal/operators/switchmap.d.ts","../node_modules/rxjs/dist/types/internal/operators/switchmapto.d.ts","../node_modules/rxjs/dist/types/internal/operators/switchscan.d.ts","../node_modules/rxjs/dist/types/internal/operators/take.d.ts","../node_modules/rxjs/dist/types/internal/operators/takelast.d.ts","../node_modules/rxjs/dist/types/internal/operators/takeuntil.d.ts","../node_modules/rxjs/dist/types/internal/operators/takewhile.d.ts","../node_modules/rxjs/dist/types/internal/operators/tap.d.ts","../node_modules/rxjs/dist/types/internal/operators/throttle.d.ts","../node_modules/rxjs/dist/types/internal/operators/throttletime.d.ts","../node_modules/rxjs/dist/types/internal/operators/throwifempty.d.ts","../node_modules/rxjs/dist/types/internal/operators/timeinterval.d.ts","../node_modules/rxjs/dist/types/internal/operators/timeout.d.ts","../node_modules/rxjs/dist/types/internal/operators/timeoutwith.d.ts","../node_modules/rxjs/dist/types/internal/operators/timestamp.d.ts","../node_modules/rxjs/dist/types/internal/operators/toarray.d.ts","../node_modules/rxjs/dist/types/internal/operators/window.d.ts","../node_modules/rxjs/dist/types/internal/operators/windowcount.d.ts","../node_modules/rxjs/dist/types/internal/operators/windowtime.d.ts","../node_modules/rxjs/dist/types/internal/operators/windowtoggle.d.ts","../node_modules/rxjs/dist/types/internal/operators/windowwhen.d.ts","../node_modules/rxjs/dist/types/internal/operators/withlatestfrom.d.ts","../node_modules/rxjs/dist/types/internal/operators/zip.d.ts","../node_modules/rxjs/dist/types/internal/operators/zipall.d.ts","../node_modules/rxjs/dist/types/internal/operators/zipwith.d.ts","../node_modules/rxjs/dist/types/operators/index.d.ts","../node_modules/rxjs/dist/types/internal/scheduler/action.d.ts","../node_modules/rxjs/dist/types/internal/scheduler.d.ts","../node_modules/rxjs/dist/types/internal/testing/testmessage.d.ts","../node_modules/rxjs/dist/types/internal/testing/subscriptionlog.d.ts","../node_modules/rxjs/dist/types/internal/testing/subscriptionloggable.d.ts","../node_modules/rxjs/dist/types/internal/testing/coldobservable.d.ts","../node_modules/rxjs/dist/types/internal/testing/hotobservable.d.ts","../node_modules/rxjs/dist/types/internal/scheduler/asyncscheduler.d.ts","../node_modules/rxjs/dist/types/internal/scheduler/timerhandle.d.ts","../node_modules/rxjs/dist/types/internal/scheduler/asyncaction.d.ts","../node_modules/rxjs/dist/types/internal/scheduler/virtualtimescheduler.d.ts","../node_modules/rxjs/dist/types/internal/testing/testscheduler.d.ts","../node_modules/rxjs/dist/types/testing/index.d.ts","../node_modules/rxjs/dist/types/internal/symbol/observable.d.ts","../node_modules/rxjs/dist/types/internal/observable/dom/animationframes.d.ts","../node_modules/rxjs/dist/types/internal/behaviorsubject.d.ts","../node_modules/rxjs/dist/types/internal/replaysubject.d.ts","../node_modules/rxjs/dist/types/internal/asyncsubject.d.ts","../node_modules/rxjs/dist/types/internal/scheduler/asapscheduler.d.ts","../node_modules/rxjs/dist/types/internal/scheduler/asap.d.ts","../node_modules/rxjs/dist/types/internal/scheduler/async.d.ts","../node_modules/rxjs/dist/types/internal/scheduler/queuescheduler.d.ts","../node_modules/rxjs/dist/types/internal/scheduler/queue.d.ts","../node_modules/rxjs/dist/types/internal/scheduler/animationframescheduler.d.ts","../node_modules/rxjs/dist/types/internal/scheduler/animationframe.d.ts","../node_modules/rxjs/dist/types/internal/util/identity.d.ts","../node_modules/rxjs/dist/types/internal/util/pipe.d.ts","../node_modules/rxjs/dist/types/internal/util/noop.d.ts","../node_modules/rxjs/dist/types/internal/util/isobservable.d.ts","../node_modules/rxjs/dist/types/internal/lastvaluefrom.d.ts","../node_modules/rxjs/dist/types/internal/firstvaluefrom.d.ts","../node_modules/rxjs/dist/types/internal/util/argumentoutofrangeerror.d.ts","../node_modules/rxjs/dist/types/internal/util/emptyerror.d.ts","../node_modules/rxjs/dist/types/internal/util/notfounderror.d.ts","../node_modules/rxjs/dist/types/internal/util/objectunsubscribederror.d.ts","../node_modules/rxjs/dist/types/internal/util/sequenceerror.d.ts","../node_modules/rxjs/dist/types/internal/util/unsubscriptionerror.d.ts","../node_modules/rxjs/dist/types/internal/observable/bindcallback.d.ts","../node_modules/rxjs/dist/types/internal/observable/bindnodecallback.d.ts","../node_modules/rxjs/dist/types/internal/anycatcher.d.ts","../node_modules/rxjs/dist/types/internal/observable/combinelatest.d.ts","../node_modules/rxjs/dist/types/internal/observable/concat.d.ts","../node_modules/rxjs/dist/types/internal/observable/connectable.d.ts","../node_modules/rxjs/dist/types/internal/observable/defer.d.ts","../node_modules/rxjs/dist/types/internal/observable/empty.d.ts","../node_modules/rxjs/dist/types/internal/observable/forkjoin.d.ts","../node_modules/rxjs/dist/types/internal/observable/from.d.ts","../node_modules/rxjs/dist/types/internal/observable/fromevent.d.ts","../node_modules/rxjs/dist/types/internal/observable/fromeventpattern.d.ts","../node_modules/rxjs/dist/types/internal/observable/generate.d.ts","../node_modules/rxjs/dist/types/internal/observable/iif.d.ts","../node_modules/rxjs/dist/types/internal/observable/interval.d.ts","../node_modules/rxjs/dist/types/internal/observable/merge.d.ts","../node_modules/rxjs/dist/types/internal/observable/never.d.ts","../node_modules/rxjs/dist/types/internal/observable/of.d.ts","../node_modules/rxjs/dist/types/internal/observable/onerrorresumenext.d.ts","../node_modules/rxjs/dist/types/internal/observable/pairs.d.ts","../node_modules/rxjs/dist/types/internal/observable/partition.d.ts","../node_modules/rxjs/dist/types/internal/observable/race.d.ts","../node_modules/rxjs/dist/types/internal/observable/range.d.ts","../node_modules/rxjs/dist/types/internal/observable/throwerror.d.ts","../node_modules/rxjs/dist/types/internal/observable/timer.d.ts","../node_modules/rxjs/dist/types/internal/observable/using.d.ts","../node_modules/rxjs/dist/types/internal/observable/zip.d.ts","../node_modules/rxjs/dist/types/internal/scheduled/scheduled.d.ts","../node_modules/rxjs/dist/types/internal/config.d.ts","../node_modules/rxjs/dist/types/index.d.ts","../node_modules/@near-wallet-selector/core/lib/store.types.d.ts","../node_modules/@near-wallet-selector/core/lib/services/event-emitter/event-emitter.types.d.ts","../node_modules/@near-wallet-selector/core/lib/services/event-emitter/event-emitter.service.d.ts","../node_modules/@near-wallet-selector/core/lib/services/wallet-modules/wallet-modules.service.types.d.ts","../node_modules/@near-wallet-selector/core/lib/services/wallet-modules/wallet-modules.service.d.ts","../node_modules/@near-wallet-selector/core/lib/services/index.d.ts","../node_modules/@near-wallet-selector/core/lib/utils.types.d.ts","../node_modules/@near-wallet-selector/core/lib/wallet/wallet.types.d.ts","../node_modules/@near-wallet-selector/core/lib/wallet-selector.types.d.ts","../node_modules/@near-wallet-selector/core/lib/wallet-selector.d.ts","../node_modules/@near-wallet-selector/core/lib/helpers/waitfor.d.ts","../node_modules/@near-wallet-selector/core/lib/helpers/getactiveaccount.d.ts","../node_modules/@near-wallet-selector/core/lib/helpers/index.d.ts","../node_modules/@near-wallet-selector/core/index.d.ts","../src/lib/types/general.ts","../src/lib/types/fc.ts","../src/lib/types/ft.ts","../src/lib/types/nft.ts","../src/lib/types/simple.ts","../src/lib/types/drops.ts","../src/lib/types/params.ts","../src/lib/keypom.ts","../src/lib/keypom-utils.ts","../node_modules/@types/react/global.d.ts","../node_modules/csstype/index.d.ts","../node_modules/@types/prop-types/index.d.ts","../node_modules/@types/scheduler/tracing.d.ts","../node_modules/@types/react/index.d.ts","../src/components/keypomcontext.tsx","../src/lib/views.ts","../src/lib/drops.ts","../src/lib/keys.ts","../src/lib/claims.ts","../src/index.ts","../src/assets/icons.ts","../node_modules/@types/scheduler/index.d.ts"],"fileInfos":["2dc8c927c9c162a773c6bb3cdc4f3286c23f10eedc67414028f9cb5951610f60",{"version":"f20c05dbfe50a208301d2a1da37b9931bce0466eb5a1f4fe240971b4ecc82b67","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9","5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06",{"version":"9b087de7268e4efc5f215347a62656663933d63c0b1d7b624913240367b999ea","affectsGlobalScope":true},{"version":"7fac8cb5fc820bc2a59ae11ef1c5b38d3832c6d0dfaec5acdb5569137d09a481","affectsGlobalScope":true},{"version":"097a57355ded99c68e6df1b738990448e0bf170e606707df5a7c0481ff2427cd","affectsGlobalScope":true},{"version":"adb996790133eb33b33aadb9c09f15c2c575e71fb57a62de8bf74dbf59ec7dfb","affectsGlobalScope":true},{"version":"8cc8c5a3bac513368b0157f3d8b31cfdcfe78b56d3724f30f80ed9715e404af8","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"c5c05907c02476e4bde6b7e76a79ffcd948aedd14b6a8f56e4674221b0417398","affectsGlobalScope":true},{"version":"0d5f52b3174bee6edb81260ebcd792692c32c81fd55499d69531496f3f2b25e7","affectsGlobalScope":true},{"version":"55f400eec64d17e888e278f4def2f254b41b89515d3b88ad75d5e05f019daddd","affectsGlobalScope":true},{"version":"181f1784c6c10b751631b24ce60c7f78b20665db4550b335be179217bacc0d5f","affectsGlobalScope":true},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true},{"version":"75ec0bdd727d887f1b79ed6619412ea72ba3c81d92d0787ccb64bab18d261f14","affectsGlobalScope":true},{"version":"3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006","affectsGlobalScope":true},{"version":"17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a","affectsGlobalScope":true},{"version":"7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98","affectsGlobalScope":true},{"version":"6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577","affectsGlobalScope":true},{"version":"81cac4cbc92c0c839c70f8ffb94eb61e2d32dc1c3cf6d95844ca099463cf37ea","affectsGlobalScope":true},{"version":"b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e","affectsGlobalScope":true},{"version":"0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a","affectsGlobalScope":true},{"version":"da233fc1c8a377ba9e0bed690a73c290d843c2c3d23a7bd7ec5cd3d7d73ba1e0","affectsGlobalScope":true},{"version":"d154ea5bb7f7f9001ed9153e876b2d5b8f5c2bb9ec02b3ae0d239ec769f1f2ae","affectsGlobalScope":true},{"version":"bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c","affectsGlobalScope":true},{"version":"c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8","affectsGlobalScope":true},{"version":"09aa50414b80c023553090e2f53827f007a301bc34b0495bfb2c3c08ab9ad1eb","affectsGlobalScope":true},{"version":"775d9c9fd150d5de79e0450f35bc8b8f94ae64e3eb5da12725ff2a649dccc777","affectsGlobalScope":true},{"version":"52d1bb7ab7a3306fd0375c8bff560feed26ed676a5b0457fa8027b563aecb9a4","affectsGlobalScope":true},"80fc108ad79ff0476af2615faf91165fc53fd5e9c26f4dd65c8c023909e5f706","3873cb155ac58e170d7295cdc9283dba5bc41660008c8bf67897633a577650b6","b8a9367889fe66b6b2f1a4f5c2bbdc97c23dd4ae472470902311a658780407db","c282e0cf56c8f40f2460e6896f985e2827f75da29400ab4e2161535d9243ae30","793b4470d1ef96268a79c974809608b6d7f06dc998e3e94247fc299381efe8b8","0b48f901c2931dcffa0650ea1dba1d247cc6ee9b13956069419854fb14324f4b","8f4802f38a3782bea74c9eeeb871e27eabbc3d29401559445b27356d37d467a2","2443cf925775612aa2ca54cfa182fa49e30e75f9f40233133f47abdd47001f2d",{"version":"aec138735da3ce80430f3a273b540b674157acb7c8e007899fc537845b060581","affectsGlobalScope":true},"58a52f282f1dad18179023804c1f3a7536bf875748a0a314abd43f60fd5b244f","138476cfdccbb9e2c7e06602bc216af843a56c4f3469a79106bc660ba94bd66a","fe892fea1e75a442fffb4a604d7eeb451e858787a9f2f01c4e83bf12a3b5048d","c3525f0f2d1ceb812810fe17f614ce8bd9a932285c065d8bc958eb32347041de","736b604328c576304485a9769ae0540ea979eb888a04541fb73af9cde1d91c25","525c8fc510d9632d2a0a9de2d41c3ac1cdd79ff44d3b45c6d81cacabb683528d","b952021e804dcd9cb5e5552e1ec8bf9f479b61e20da5641e2a542fe77db9a598","fa8882db772bdbaed4832b25c6d68a8d3106c857595887ab1a5000fc573a4064","beedf72ae8a4176d262e464b70544021a8cd765e21f58325eae5d132a3eb359d","92bd533d635f967b198fde9bc789996370f0db3322306646d961f64e67ed5b7a","d5b7c8819ce1bd31a45f7675309e145ec28e3aa1b60a8e0637fd0e8916255baa","4a419878f025046ff6748d073123b0451849f83b7dbca907037a53e3eaa9bbbb","dbe39c84ad40acd4b4259bc035aa5870ab08bcab899d2f7089c7922a434cf02d","61af0c7f7be9887d42de91222b0d758fa9912027c2dbda957b749bcd43427b54","c1be6aa0155b02d94de321f13663128c0ff847082f1c9fae29219f603f1718f7","152af7c23ec219f632afa2d861abc65993f56cd39a4f3a4018515dbc05950a74","7f71142177d3c98370b31751e3d320c9743ed28eee215acb88d8e0d2a31e321e","03394bf8deb8781b490ae9266a843fbdf00647947d79e25fcbf1d89a9e9c8a66","cc5fac2b9e45a6670b96fd32cb42c97e0d4a7b2ee12c87963c6fe0f55fa84f50","1a6016bd905855b2b45881e9edbd7ab8c7175f8bcbb711ff06989c4bcdc75486","5fb30076f0e0e5744db8993648bfb67aadd895f439edad5cce039127a87a8a36","27ef4001526ee9d8afa57687a60bb3b59c52b32d29db0a2260094ab64726164f","3a8848a9c307429b861402cc69bc472ffe0c05b86474fc158723169161e16389","30ec6f9c683b988c3cfaa0c4690692049c4e7ed7dc6f6e94f56194c06b86f5e1","80c4d0b88eb9712f6cd30a672a8288f978afc8df652b4fdb434236b7836766ff","94cf93922adcc9cb4acf11d8d71641af728de919a50ae55d8e83159afea1a42c","65dbe15ed8a8ed5d4707a63868178dc38111cfc06de28a2e50713ca017a9c157","58124c3a58f62499993ee554500c49b756149bf079f07d41dc0fe5ea74bf90b2","17e157df6125098a1a34eb4d201ee4ac03bbe97e471ab5627bb2c40fce555948","b40652bf8ce4a18133b31349086523b219724dca8df3448c1a0742528e7ad5b9","c61e008d7f29f532b933b25e57620e3b11f9cf76d88e35f2d3a4e0aaac1d5d9e","978aecd2e6bc2ac094e9a35eda98ff8586713857b3655e7c98ca5ed8f7d50662","b8553c42868db5dd58a51b0a7f02afb4c99e3b0bd98ea4d2da8140cf978dc46c","431151f55411c3f27cf539b987a7d1de453188ed58e54bc946183d280d3444a2","2d662fd31aed8c66b20f46390e5497357905a7d8bc22ec8a6c5a30d5f316f6dc","e880a08fbb0d9ee2f733f9183f4d1bdb75bc9e0e64060a8a1fc30540791fcded","f98df5ec124f441b465332271d0b083aeec815cd3c92d9249b9739e6318477a9","0a7a6d65b520ba55bfe2db2b1a81cf53d4f937d314f107e1be543458273d5afd","f91189e04264b0e41ee96ff96661c3871e739b90156df2f2288da7a81019dcd9","6622f76993bdfeaacb947ba7c4cf26f2e5c5194194d02d792c3cba4174cd8fce","4f54f0a9dd3b644c99ec32b32f8804d5978bc854799b228ae9c467bf3c84c64c",{"version":"ce6b191c382ee19f23678b8c364484627bcf424e8f408357a2f5530fb8d52a45","affectsGlobalScope":true},"765fc34423b93c2ab763670d8d11d99e5f47387c13c161d6f1640dd6d91b7d1c","c21b847fcb59e6b8b3d14ef69f5f898c5f23af58f30139f4b4ecdd895221cf61","8074bd97ca2b632073c0ba61e121ebae88a8539121610ff2f963bfd7dc2420eb","03d5347b2c4b66ca5cc913f06a207f0dfffc9375d340c67488366f6162fdd61b","2b22ea4e7bf1b80a3c546c11c5141060f97b08df7777c94b28c2706d497396fa","5d311484dd59482d9ad090f51431b63f7da2727ea88d899b71a1e0d92dd91a79","96e75435c3b2d2a2b8f14802f8bf064c8cba8a97aa9a0479daddcbe448119ccb","3ed62301cf931ae66d79848f6608cc1a40d1bcfc0cc31f74ff13ef39f386b952","82be895c4d00dfddc7ae78afe619829a9d74faae1982b504af19e565bf7f8bac","193a838b209e1d9d8b81257f688e9079f78927131e8ac640497c1357351fff44","3b1cbbc525b33809588bede93b27af062babaac89ea8e1ffcf6b5f5a677d0228","b19f1a784ff230e0ab9ca9ae9dcef279dbe6620a70517803af35cffb270c29a6","3db9223ef1d787b47e08965bdb58c96d330454d9a2a006a3581b434610516d73","77e565890487b64564a166dc9cdf48a2d66dc1b74da123f8071aeec4ccc47040","6fc360a04203051412a34ebac6c6ac1dba4b23258be4f26f2c396910f60ae675","da854782df3a73a8683b1f7e5d779b9bfe561c76c83ddc92d416b7aae6421de1","4984a47822dad9cc4ce63fd61c29e816f6aeb95be14bb7b1a26b4589648bc754","4b94f3c3863af13f43bc31216a5d9dd3fefc9d10973e212627290dbf5fd18ccc","e510b321347e623ff25af8f4f8b9c3e47addc96ba6147c674109699934082c66","a5eb60edb3bcaa2504afe3a8cb6c1e48c73c5e585c5122c6e18f2deb55bdf73f","84c74aeb041403c9bddf46f13a699a14bed0f2a01cb020e55b36857bdd2bafe7","0fb20b6c36984b95815d9c2726cad681e4da875e0aaeeba27a0e93d68e52fe3c","e174d04105fdd9ccdbdc4605d542caf688c4f9f13968129b7e106f8f036be165","838c505b8a85847b82cebfedf69d2638d39d763a03bba0eb9f5564d339dc83e8","9e755713010e97c315200b9f97c3b4f6faa7e2d8f573601f4b56e9ce462c9340","e59b3062cef66ccc3e6141929f673657f75db0007a9573a24cd0d4f8fbc33cdd","5d2cd6b38d4f14cdc27c8bb3236e5b375e0f6bbaae5f93d8724b5069d7b415f6","8961c78b9c29411581a13424749a94a8c5f499086a929dfcf2eaf2a28bd0e1e7","0c238ffad8ac6f4be1be79c909937a723516e5a38cc15377f0511cd48566e3e5","0e658283180165f495b0967bdba03bd1c08daa63677216069adcde752bc4acb2","9a8f42036a42120c39a5d384abe92bd47e187b3a50ed134ad23d12b479af2697","97faf2f5042e998abfd4ae4b65b6e9807ebfb4b3484afeeef2a688ade549ae30","0d53e597adb0c3d1d2db4b5e5324150a509c6b31bfa87be53fba9b0b45ae6a6b","7f70b7f311e3ffeef82c2c7f63b1ae875c139443a91dbf0f9abb236ff331a1aa","36ffedc870284ea24bed3ca6acc45af3965e30fbfb89cdf4908b3b1c0779e48f","39d4efcc2f58febd9f64ff6a2aaacdbe3cab04c3738b1e0d92b25c7465017ebb","fa3d0cd03fa17459d9ddd98b120b4bb084da39f0391cbdce480a6ef74be0cc7a","e3fd84e6470b7e0679c4073ee5ce971d324182486dde5a49b67cae29168b51d2","dd8331d0a5190a4735ce6c152e420230188c4966067a756673c36dd7ba72b10e","cfdf36cfc0721c29f58651fc12f0f5a349d29da3a63180afc5b3d77b95653f82",{"version":"d57e7ff5243e0dcd04cf2edf9ad9520af40edd6eba31c14c3f405f0c437fa379","affectsGlobalScope":true},"0f882d4ae58f431454030289154feb0132e1b00ca5c3197c6b749bd098aed73a","7ff7f4632a6e7b6872fb1843f3c0df495b49840eae2a23c6fbc943f863da8c29","d267771149e172ade39e3ef96b4063209d5a7e8291702fe03983aa52f2b3d5f6","a78590b0efcef281236e3234520c348d63be1d4561b63b20e6c3b6fc18b37dfb","4d59c6a10b6c79a0927c79efa89b3c9f71d174ec14ec2792076cfd2330d0cf8e","a496f51933422872de22729b7a0233589325a1a1707cccd05cd914098944a202","75b6663bc569724017997481b6b3774065c204b316cb4f5ad7df3b5162d2dce1","06a38095ad4368314366bc08f7cbc0fe274ef7321ec611005d0bdd9c6565e4d5","4599793db9aed9b84677f0ca1cf7ef3c69bb91cda4fe4329cbab778ca4d80a58","ad0028f96921778931fb8419d8de33b10908314fa99699de1702020f69235da1","ccd2a35321c0786bd3808042dc43b960cac13f2cc660ac37a0087e12bc97d2fc","df524ed01de4f19efb44bded628dbba9f840148be4b6cfe096e29d4b01589de3","2e3981b9cee48174ff85ae15019fd72933f7023a4ed05094740f7e6f7775623c","836ebdc3b9e4c006acc4f405b7e558e56d47830e05c40d991b1e27fe8bc91157","2cc6b617c6120ba64b5778ccd4b74c951adc3a3941bb6b39f47d48701c44af39","eca02b99615a8f1652e21399d832618e38bf166c0747c9247349bc901a2f7741","7f7d6d42e5780e86f5b860a6f95179fae06a368b3af28c1c4230397c47021a59","4740a7d11ab3b381be0f269f1903fb3ff226a2fba55a01756b2997e67cd853f2","863dbc4e77f0353e6f9d6bc0e2b4622d5c07ff6f099ff66cafd7924b2ff4dd3f","bf034a18ed7e2a058f9e48c4c2480a124138fbd3586a80c77736a9ec079d12a8","f88758992a0bf13d095520aacd4381fb456ff121fb9aa184e6eb0eecb26cfadc","c249e9ae33bfcad97deec3c73c9ed2656e112fbdf22deace0b39724be6a5dcf0","d8b45924965c0c4fc0b946c0b6d597aa8d5de9cdf5c727e3d39422d17efec438","d07ea953cfea0c4bd11641912846bd955f4fd26ad2b7b8a279d69c7ab9cb3add","feddabf6ab0eb191e721f0126f3db8688db97c77a1234968bde7a2d70c4ae513","dbbda62ea5f4d1f8b40cc2b7e2e2fae424abbb4715a04a3659cb8b317f7b228b","cde0568b836865a24f4ee5859462004a326dfb76d514e6f56c8e78feedebed58","7f5cb3a03588ed46d52a6c2138315d930cd6ffb5c2134247cd07bc23cbea0b5a","7797f4c91491dcb0f21fa318fd8a1014990d5a72f8a32de2af06eb4d4476a3b5","f39fb20b83c3f9853c13d4ac95533760979d3023c0a5affe2c0a62d91ab3afd8","e4fca08aed8afb32bb8643d7469810bc8681115fe398e56a028df9e73b2d867f","2622639d24718ddfccc33a9a6daf5a2dd94d540ca41e3da00fe365d2c3f25db3","078966067552650f44ca96c68eddbb8539f30ee48a9ab3f24abdcf0a4037b535","2cd6250c43dba360377481c98d48db6ab1532a7527339edb0deffddc28ba66b1","7a9d600990fbe263a23daebed9ba1bbc5761e45679a7e2b2774a42756ef077a2","66bc155515fbea8c31a4efccbbac44de7c037b01f3aa00b76312cf7252725d30","5703288ddbfc4f7845cdbf80c6af17c8cde2a228757479796c2378b1662fcd48","0dfd353f0c16dd5107a7e0713dc52d0a2538293b0a0eac6000a017f9c0a60b56","9cd683a4663ef4d9c6486f1b8a34c73bdbc344d69490931bfe2fbcada12ab35b","42f6a409bad5259ece69df25d2b8ace2ff2ade45fe6386ee45203bdd9329f971","d3b1a8b87a5e77d70056325e137a0e04d984b991546fdd3c1034ff4102d603c4","2eb162efd6dba5972b9f8f85141d900d09da4fba23864f287f98f9890a05e95f","3f878fb5be9ebe8bd0ac5c22515d42b8b72d3745ef7617e73e9b2548ccbdf54b","e9ed562b7599c8c8c01595891480a30f9945a93a46456d22ee67ebf346b7538a","e7bf975a98cecefe2e8902fb7da9314675ecdce553aea722aaec97327668e18b","3d36f93648518338c875d9f77a8eab52905365483dbb3afe43ed68f1b712b67c","4fa54df9184d291bd78b36f5063372042cd995460e906cb14014e40d1442a326","b4e32bd5e3b493e4ea6b5ec69a4c02aa1fdaa78e1df9a863bb07604de8f9d123","f6bd1aa152ca2b5064e06282ee3137842ae6825b6b09aa89a2ff063b976a56f3","bce2390bb3a76f8bf2ba4397c66db5277bf3e698ee614347e5eb79d7fc0942c6","fbdc8d7cc7daf4101bf567512c67fb990d8fe300e0ba7f213171192177f44aa0","298e0da6d858e39fc0c1eebfa4f5c8af487868c6f2e98c3ef800537d402fb5c3","3b6457fb3866562d279377f923cf3758c80ed7bfcc19414b72a24d0a98188e0c","4fb5d7efb3520b92c1b767ce18968057c5e70886d7fb3416c487231df9275af9","df2303a61eb57b2717d17123e82bc0f3fd60f6e4673cb5506192dfe23c9480bf","b104960f4c5f807535ab43282356b2fe29c5d14a02035c623ac2012be3d5f76c","a35ca245eb852b70b20300546443abb1fcbac6e5066e4baaa092af4ea614d9b5","55da140feab55f10a538a9879a97c4be3df4934cbd679665c91a7263a86095e1","1a39e51e3362aec7d4edec9b317ff83916fe0471f86ddf2d3ef3af5952e87d9e","4b3f36b96f129a8e125c91d41a05f711e73b3285f80bceb3a1aecb13c97c4502","852779920fc4220bc42ec6d3c9b6164e23ea9371a788531b48b4005fe0cb4392","9a82e1b959524c1abfeeb024ee1a400234130a341f2b90a313ce4e37833b7dd2","515b97cede17d91c9669cc1c7fb7a8a5f0a5f2d8999f925a5f70b4ebea93723e","08e8e57241f874bdbf69ab2b65cb0ee18b4183d5c9452937da49b934fc679c4b","944af466f063d4bd090ab9d988c620b90a014e919d5f78963f6074a136ea225e","644addd4811636da491c9546654bc005ba8599f23df6d731d91eba86f3137fc2","a9249493114b181814728cbfeb7234738193a4169b654ec4705d48d7a4d25222","aad6f20d6eb01192ae02294361faa6e1f320d72447b56f433db853bbe80b15ca","876fbedec2f494eb6f834ce8636b07d581c657d205d81a3ba894eff0facc6b84","58527aa45f11c9b259a6a9d78b397f35020bfbb104f4d3bb177039b5c18146bd","91b8b61d45b5d22f3458a4ac82e03b464a0926bab795a920fe0eca805ec476eb","2744532f8fb960eb78497ac660db719f503a10c801f87131d26fd9cbef75dcef","6884287c54891ac19cfbe056f3ed29cab1732a00dec69bd3b140ce62c11783c6","abc3487041159734b8611d9d6fd85de6892f11ebe8c2583baedfc1f87c53757c","cb46657d3237f80742d5701ebcced8f6e5cf8938442354387d6c77d7048dfae6","76281a3b799bbd17ec8e6de7d2fa45ccf749049fd53f00857daf0dbc449616b8","661f322e45545a554e4ffc38db6c4068a66e1323baf66acb0d8a9fa28195a669","91d70dce48c2a2bb55f0b851cf1bdba4202f107f1e8fdf45f94ff6be4b8e8f99","ce978e20a6f26f606b535f0d6deb384ae6a73f8d0bd0dfca0925f5317cad1f25","f2d3567210ca4d559d8297d6c4402599c93e3bc7485054192d38db5e132fbc0a","887d8058aeeade45984fdb8696147078bc630d3fea15ab2b7baacde0fe281fb7","ad27aa59d346179ac449bd3077d245f213152879e4027356306ccf1722d61d51","ea546a7ed9eaa71ba78d4d392509dadea4bafed283269dd6c4b09e7d8824e986","4ec0f2a141a9ae7d3557b8efe630ac2021bc3a9ac61238b59293f4cf2f196e82","b2db743c71652e03c52d51445af58d0af3316231faa92b66018b29c7ba975f6c","0863a5876c85fbaffbb8ec8aeda8b5042deb6932616139706d2b82cde9d3f7c7","1294b8ecdd212362323f349dd83b5c94ea77bfee4dad24fc290980a3c8af6ce3","ba9c46725e2a0bd9df59d3a1e801cc60f90db3ef7817131c53945dce2b8c0c56","281d373eeabf80c4851f8de991e6abe4d385c30379d80897bbc3df3dcac99cee","624c5dce95672d9dcca40d9d9d82ef855f5f902292f43aa265cc8fd963c6ce84","8a48d9c6184992d1c3ed5daa55f83d708c37582916926a5555a900608f804b60","605dd288c636cf9b5317fe76dec75d3c7fb855fdcd3ee8cb4fea7d7091ca6fb4","95addea67857d4e568a02e429b15458cec203876b2ea5f5ea18ccfeeb91b8ce0","b5a615b0ad865ffa562980a10bda162ac1744fd363b4edc2cfc664222071cbcf","bbccd721363897950a55ce09529503f25a69522e5c91a22679b66e941e5f8654","d3a1e70795c38d7851b6e4f3b441c5ffdae171d6e2576a2204b7d79059aeea66","d7b8d41887c5fccfe19802c4336d34348b752abf0d98839575699d71deff60be","063fe3004728b8516a4d799ee16f9a71801ba24e0443dd98638cef1bd4353a7c","b8a0236f47d9037efdaf93da602415ae425dababe097fc92f83fd47ce9aaa69f","fab7912fc3ff45fce2f5d5febc9494c4d0a85d6c63fff68f21e4669c32eaacb9","f6c3fcb9d75d8aea778236fd9327ceb935b41865dbf3beac698be77e0ae9018d","b20bc124abd8ee572d0d756713ff987b116cdae908a6fcbc40e80d4b999f56b4","a599f3f450ad62c3fdc0c3fd25cddcc9332ffb44327087947d48914a8da81364","645dff895168aa82350c9aa60aa0b3621b84289fef043be842f45a9c6c0ac6e2","f068ff5b7fb3bdc5380e0c677e21de829bd25cdac63a9b083fdc220fcb225280","09d2fdca6ea6c135897a26976ad3c0db724adaf23ef4e38ad852b1d8efef1ae6","15de5b7739bf7e40213a200853bf78455ee5958af08eda786605a54a7f25ade6","f3acb439e08f0c2c78c712a876dc6c2080302c46916f1d63b7dbe509616ce9ae","37862e711637ebd927907a82cbf0143ea30e95eb165df554926c43936b1d77a9","89e253db2c2cc9a510c521f14dd2b1aae4de2556ee5159ad8d118d3587e3a880","3d0a172cee184a0f4111a7bd7fbb8729af3f54b30c06a2677d85c20ea9c811ab","d6a07e5e8dee6dc63c7ecd9c21756babf097e1537fbc91ddfec17328a063f65d","6fdc88b1287c276b55b7f7c4c7b49587813c763eea9751ce0baf0a7e61cd5d89","6a02443704052768bd021f24783aa104b02ae4444e9b735317bf13c6b857a11e","37987b0fe9800cf25473c882ce07bccdab2763c5681c1a2d16816aead46aa8d1","c84c03c721154068e1a60d83e9e85819bd3ef70b824ac2edc498aa31c06e5781","c23a403716784b53cf6ce9ffff9dcdb959b7cacdf115294a3377d96b6df1e161","c96fb6a0c1e879f95634ab0ff439cbb6fff6227b26bbf0153bef9ed0aabba60d","db936079fe6396aad9bf7ad0479ffc9220cec808a26a745baebb5f9e2ef9dbc7","06bc0b9cc7bf0b92534f1517fe5adde1f23f60cc6cc5c59f8e1c65db48a40067","919a753b0cbb12ccc606c62e2d34884d75a48ba19b1dda497c72621b11dac088","2c27e33ee0bf722988da00abd582cc9b806ce3fd9153a864800a339ad13f3fcf","92d7b3a5aa5dc872e54cbad2a7094b3ea4f72c7901de1d07b4c334ff658297f0","7a52922b38e9686d5bdc6e75774929eec6688d26c1dfe4a03ddec77ede468e87","aa5efca2833d89b55248f1889a6433dab1b1f41768e9a75f8ce35f9bf56c5ec4","3da085d344bf625767c5b1fcada31a5d94ebefc4e36bf18a676ca37460bc4e4e","006855ddea8674d084173a768f88519dc154be94eba5e2120262a33709832b9b","17dd843a266f99ca4b3a1257538bd1cc69dc5c7f2f23c3891f0430615b8c9c1c","5430364886c721a30475253356162b6c27871718094cb3e69e2bcea71a17e533","1218398da7c8dc4add10bdb3aa2856aad54b123d847eaf574d1d694ac269bfb5","189014f3213ee7457dbeea04dca10ca5d9ed2062cd39641aca5f3b4c75de9d99","b637cd92688a6cdf4f8f184ff529dc2bc7f15692828e2c0c66a60e6972f400c7","7061e83d6792897077bcac039fccf7325234004769f591c63a8cf8478bf551bb","7ab905865063322f2bba361d0f2ef93520f64a382bac13b127479860ad99f62e","277a358d61376fce7ac3392402909c96cf6a0a613146549fc0165ccff953e012","50614c808e099a1d4413786f3783d9eeaaa74b267f2c87fcf8a893287e91c301","f4cb6530f248e87cefa74ef623206fec805f6252f885f8e14ef3d1a5872cef2d","38c332caadd8391566552395d592076470a5e7423f70964620eabf05c02907cd","eb17b5bf1fc763a644c21d76572c0e41e351c3f6dfcde649428d5d829f7294d2","cb124162c87b29ff5121e3ee5bb29c782f101e0135d6c2644ab1b31d530a435e","406d6f5d3707c488362fb40d1c1f8a7b0a42b70554b427160185d93e430228f5","2e9776410c5bc290d9432a9215c67398a273e514a79b9e15f32ecddfde8a03be","313ff8df074b81d3e4f088ff3a3a06df3d9b0d0c7f55469ccc2ac887ecb6b867","c718475bca06806cc243e77777641cb67ba68f2c57321a4773ebb47760a3bcf2","96e6bf811343caab5112b68880905c5d20d9257054afac6c18e718a4c549ed27","a2793bc73ba63ca7d259cb0f0b61d0023820170d08a1f9715006c8042d060165","d5011b38165771fdf75a9a06d6d379a1fc7edd7eb695ebdc52319fb6e3c6d81f","88417fb19d339304e9616a38ea513251047c9e300c81f9467fc317df8a582e71","3e8e2d132f726dddbda57819f5391504e585cb3beab6b32203064e7e40618583","6e23627cd3f10418b5b2db102fdcf557b75f2837f266d88afac6b18f333bb1bc","866046dcea88f23d766a65487ee7870c4cf8285a4c75407c80a5c26ed250ef8d","019f4f1cbc781cc15c6173f8be5ef907405722194ab297127b3c3426e5368339","41f4413eac08210dfc1b1cdb5891ad08b05c79f5038bdf8c06e4aedaa85b943d","c79f1c8b51d8475dde8d2973f740f43ca34b1f0a95d93649cd76c1ee20abba19","35f0d2bd2c5c05c0cb19095bf5b7c44365b1c88efe6285370855b90417277a64","8264b129f4c4eb4799703f8e5ee2223a184d1cdbfc782158b1f40a88a4435a1f","527ddda6f8be1279f3294714534c49d6e90f238cea325519882ebf88d7ec5bd2","b23877792e8bd00271d0ec5d401b68e4228540a4316de3d9dfb697b955c161a4","35b2eb1de01633db90d41abe93730b29984856fcc840b4c2801bfd3761a2097b","95f0c9127b879c2fc7e31f8e09ff45bb4aae302e60f4b9ceaf4d9ee6bc51ec66","2a6b4655a6edce9e07c7d826848f72533c9991d40bc36e3f85558ad20e87ce2d","6e3d29fdc96ebbb2ac672d2dae710c689c1ea0d0e9469e0847616f3c38fd085f","d505055b8fadd42da235c85947911d8d198ad70c5f5775991e7821d4f89c90f5","8b5a5852099dca7d7e7a7cef6d681dc1586aafacdb963ca180fe5cabbfa3a24b","0d1aa3341d1ad2064adada71c5d01a2f572e4aac09410e5616d90894105a0eb9","52494ca5a884da3bf11b8165ab31429715f0970d9c6383240c5666f4bd713e01","162fafa2291749df2ab4516854aa781fcee1d9fca2ecd85fb48ae794c0700ce2","b4b9b51ee6f6309cda2e539245235a8caeca2b1d6bf12b5e5c162d17333c450f","d2ffe8356f060b88c1c5cf1fa874a4b779fb87fd1977084876e8be9eab6bf485","c76053984b39150d00ade365b096a8bc21a4a7f2ee9e0a926711b00f8e7bf701","956b510767e3d6f362ea5800510635197723737af5d19ae07ee987ea4a90bfa5","cd1a8ff61f5063d7e6e2094e25d35c90b499961b63911f2f4ae0ff5555c2b4d7","1cf09b5945779e9bc75c4dcd805fb149c28fc90da3335186ef620647a3c540e1","9cdc0b9a313090ec45b34ea1eb02fbace433f509e753634b043e9b83038261e6","c93474cff0088351a65d3cad24037874a26a5371a48528563e56efe31cb3d8bb","b4580df8ea7f62d7b06588001952bf69426e6b03cf3d2569f5f608e45f29ba08","de27f7bb9be9d8a2b4557ec6503b8a315f74d598ce9a0ab81b5ed5610e1a8e81","fe3c378dcefa7ed8b21bd6822f5d7838b1119836da75ae1e1fb485d27b8ffb62","7365bf3333d4277b6fe374ed055624e5ec080dbb919e2d78f1cb75a3f1a4b4f6","a5fbf3bc5c16ab5c84465ba7a043a4bee4c2b20bd3633d50d80118a3844edbaf","0923e4ac8c894ad507bd2daee0df66b699de88467201381ece011ba5a080e1ff","e4f6626f827ea509255647e1b6db82145a2eb1a6b46202655e7d9bb19145c33b","26e23972c40f378f0301d8d7025ea895557c2865a1a31c8ea9c3fff0dbc27075","bfddbff94132b423ad1d71bdbefb1d388c21a74ac1a8742df9324e5bf6109058","a928a783c18f57164c154b56501121f3725016f46ba48750b8fc61b2c7ecfde3","9a4e44028bdad7131c8bc4d2dd6b11c96c73720984ef0fa5862770ac924f698e","73b70caa5e573babbd422dadbdd9fffe7d0561fa5dde7390f7eacba7928353c1","7c910133015e22b8860634faf0706388c67b6a4241aef018af83f477bc753f25","6e805ad67e05df4251ba7b536e33bc88b9223340e6c04356060c13c613803d8b","be5fdd78c5818f3a1f91c5ba49505c30289b3a343dd527fcd322e7294f82b570","25bc80fdce8d0c51cc70575e64f0cd4bbc07c29574dfd850eb0e7058e71f9412","2a067faa9c770827d6217677ba8e483341571271ab8a1953566061742d7c09fc","f4cd742d89e118e5846ae09c61ba59772f9ca993bdc164f2166c8ca354e53676","e6c964223ca3a4fc0ca2921455e18e6b11dd1f9ac88c6d83c3a814b3ac556a42","0d5f2f526a48952639da8e5d8cfaaa36ccbbe20cd97ae2f430cf67869a98b508","b582de0d5211b094b4faccc7994cbebd056d583a86f4388e311b4c3f5c9a57e4","3cf40945704725d08f75cbb0476c318cd0a6af32882ddc70656063d68ce89f1c","8bf2fb20a845b4e13f6c97d0b57b1ea520661710b9660046e24113a1e3100848",{"version":"3a1723be4d02c58f5e89c3cdb8e1e2111bdda02e9f00eb8fe4b3139311a686e3","signature":"72bae06f7e6667a78d55f8e8c2026ca56f4d46b476b69ab91a0c082d6f037ff0"},{"version":"a58d4251be1368e523491385d80a24a645e9e9878a1a66eb871b6ff3a77bc57d","signature":"e4d40a0e7e735a3c8e9b5be1b3b363519ccd9b844f751ee36faa926a10e6e8cd"},{"version":"1f45b593e0a4c5ac3298ddfe4cb1f2a92fa8b7caa1333c8e2802780aedf8289a","signature":"0414407cf9147c7d8ee07e237f75d4cbcc44ee39b2687384b86167e410cde3db"},{"version":"daa9e5946887a45381b8f186953ec83e8c8fd15156fe9dfbb8e2af9199055272","signature":"593708b4eb66dd36df9778838f0a9b26ba184ddd4f2fab7f1346372da9e64cd3"},{"version":"be0baeb214e83d69730c61ead47f58b59849cc513bcc44e1c6a0eac48a4fcc39","signature":"fec87b56647a9684145542ea67012fbf2592e162aec8e03c70b515516d86f990"},{"version":"dcd1ee5db0df8ffdb00d0d6f0c6d36a8296ae187a9bfcf5d67c8d5cafcdf9022","signature":"8a13ba29f38297cd5b29507be5657fc74feb18b5aea2a465dcaed87aa38aa93f"},{"version":"b8edfdaa165db9ff874b8023bf68cf04bbe93aa9a9f255bf19835ac24c02db34","signature":"03f5a2a64dcd2403a83dbe18579a0c5f8ec4cad45d6f6b90f8e10ed7dadfe17c"},{"version":"a9d6622583acb0028f04e74008982b0f30c74632665cb5e3b1cf21900cf84613","signature":"39cf2e55d905e66d276a7ee7f37fb53f91ad2a09ec7f8ff9695258356f1a6ca0"},{"version":"6d9ee70ca7e69da712429c5cc4183463d5821fd72f7db41ae79aa0f0c37d3ee6","signature":"e7924d70f11cdf5d10e22e2f7d4fb1a41f0327f2f7df748db82eb9b150c88481"},{"version":"bbdf156fea2fabed31a569445835aeedcc33643d404fcbaa54541f06c109df3f","affectsGlobalScope":true},"1c29793071152b207c01ea1954e343be9a44d85234447b2b236acae9e709a383","6a386ff939f180ae8ef064699d8b7b6e62bc2731a62d7fbf5e02589383838dea","f5a8b384f182b3851cec3596ccc96cb7464f8d3469f48c74bf2befb782a19de5",{"version":"ef8a481f9f2205fcc287eef2b4e461d2fc16bc8a0e49a844681f2f742d69747e","affectsGlobalScope":true},{"version":"9de226591ea9e315b155d9956aa2042bbae48b636964ff7e3b30145653bfee1b","signature":"2e0ea6e50c127271bdccb6ec52ad399135c720a39c325d4f5200c28f23657e52"},{"version":"c558a53f5677bcc7f71b1b72c6b45cfaac2727f1be090459dcf60c154eb53f56","signature":"41209affcb01ad84b8556374f992f03c6a0cfd9484f14ceddee69a0cfcc3485f"},{"version":"ceb971a0c07e23d4da4808a0593ac1d2a1f7d4ab59b1452075031005177a69e3","signature":"1e724ed1c80504a3fb56692706eeb29e2a01c6686760971fbf57841f5f57914f"},{"version":"eea622cab34c9df7d913d0fbc7899d8aadedaf7e0244071f3cdb8065efe28cff","signature":"d648db16aaa9d69e1f46daa54046036b12890d36b06abe023f0fdbb0624f1246"},{"version":"323a8690079ac2483eaccac0d12d8470e47d36d8eb525930384ef6d258b277d3","signature":"b4e7a48ea1daf9924430593cef040244151a8b71184071084acd56d0b898abd3"},{"version":"52f6acbf461223507e1890d4f512e24f7b3e32171292d9f6738148d23bb60119","signature":"dfc44e6951e9419c3fc987a4f0ab200671c997090613de06d8f97f9b1538c575"},{"version":"66d597dd9b39153cd0b7178f83ee8d6942eef416442f60f5dd28d595b97fa342","signature":"e8b30f8b77aab91d6d3fbcd65ba7b373bc6694c16fcc3ef1b0681ba3195e743a"},"74b0245c42990ed8a849df955db3f4362c81b13f799ebc981b7bec2d5b414a57"],"options":{"declaration":true,"esModuleInterop":true,"jsx":2,"module":1,"noImplicitAny":false,"outDir":"./","skipLibCheck":true,"strict":true,"target":1},"fileIdsList":[[76,82,91,118,119,309,314,315,317,318,321],[76,82,309],[76,82,319,320],[76,82],[76,82,310],[76,82,109,110,111,112,113,114,115,116,310,311,313],[76,82,115],[76,82,86,87,108,109],[76,82,86,87],[76,82,111,112],[76,82,111],[76,82,118,312],[76,82,109,111,118,119,309,311,317],[76,82,118,308],[76,82,317],[76,82,119,309,314,316],[76,82,117,316],[76,82,91,108,117,119,309,314,315],[41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,82],[53,60,69,76,82],[45,53,60,76,82],[69,76,82],[51,53,60,76,82],[53,76,82],[53,69,75,76,82],[53,60,69,75,76,82],[53,54,55,60,69,72,75,76,82],[53,55,72,75,76,82],[51,53,69,76,82],[43,76,82],[53,69,76,82],[67,76,78,82],[49,51,60,69,76,82],[41,76,82],[76,81,82,83],[76],[60,76,82],[66,76,82],[82],[76,82,332,333,334,335],[76,82,84],[34,76,82,84,86,87,91,98],[34,76,82,98,99],[76,82,86,91,98,99],[34,76,82,85,86,91,96,97,98,99,100,101,102,103,104],[76,82,103],[76,82,85,91],[76,82,99],[40,76,82,105,106,107],[34,35,76,82],[35,36,37,38,39,76,82],[34,76,82],[34,40,76,82,85,98,99,101,102],[76,82,87,90],[76,82,86,87,88,89],[76,82,86],[33,34,76,82,84,85],[33,34,76,82,88,89,93,94,95],[33,76,82],[76,82,89],[76,82,92],[76,82,87],[40,76,82,86,91,96,98,99,103],[76,82,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,136,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,176,177,178,179,180,181,182,183,184,185,187,189,190,191,192,193,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,239,240,241,243,252,254,255,256,257,258,259,261,262,264,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307],[76,82,165],[76,82,121,124],[76,82,123],[76,82,123,124],[76,82,120,121,122,124],[76,82,121,123,124,281],[76,82,124],[76,82,120,123,165],[76,82,123,124,281],[76,82,123,289],[76,82,121,123,124],[76,82,133],[76,82,156],[76,82,177],[76,82,123,124,165],[76,82,124,172],[76,82,123,124,165,183],[76,82,123,124,183],[76,82,124,224],[76,82,124,165],[76,82,120,124,242],[76,82,120,124,243],[76,82,265],[76,82,249,251],[76,82,260],[76,82,249],[76,82,120,124,242,249,250],[76,82,242,243,251],[76,82,263],[76,82,120,124,249,250,251],[76,82,122,123,124],[76,82,120,124],[76,82,121,123,243,244,245,246],[76,82,165,243,244,245,246],[76,82,243,245],[76,82,123,244,245,247,248,252],[76,82,120,123],[76,82,124,267],[76,82,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,166,167,168,169,170,171,173,174,175,176,177,178,179,180,181,182,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240],[76,82,253],[76,82,323,330,336],[76,82,323,324,325,326,327,328,329,330,331,337,338,339,340,341],[76,82,108,330],[76,82,108,322,329,330,331,338],[76,82,99,108,118,322,323,329,330],[40,76,82,108,322,323,329,331],[76,82,108,329,330,331,338],[76,82,324,325,326,327],[76,82,330],[40,76,82,96,108],[76,82,108,316,322,323,324,325,326,327,328,330],[76,82,323,328,329,330,331,339],[323,336],[323,324,325,326,327,328,329,330,331,337,338,339,340,341],[329],[99,108,118,322,323,329],[108,323,329],[324,325,326,327],[330],[40,96,108],[108,316,322,323,324,325,326,327,328,330],[323,328,329]],"referencedMap":[[322,1],[320,2],[321,3],[319,4],[119,4],[311,5],[310,4],[314,6],[116,7],[115,4],[110,8],[109,9],[113,10],[112,4],[111,4],[114,11],[313,12],[312,13],[309,14],[315,4],[318,15],[317,16],[118,17],[117,4],[316,18],[42,4],[43,4],[81,19],[44,4],[45,20],[46,21],[47,4],[48,4],[49,22],[50,23],[51,4],[52,24],[53,4],[54,25],[41,4],[55,26],[56,27],[57,28],[58,24],[59,4],[60,29],[61,4],[62,4],[63,30],[64,4],[65,4],[66,4],[67,31],[68,32],[69,24],[70,4],[71,4],[72,33],[73,4],[83,34],[84,35],[82,36],[74,37],[75,38],[76,39],[77,4],[78,4],[79,31],[80,22],[334,4],[332,4],[336,40],[344,4],[335,4],[92,41],[333,4],[99,42],[101,43],[100,44],[105,45],[106,46],[98,47],[107,4],[102,48],[108,49],[37,50],[36,50],[40,51],[35,52],[39,50],[38,50],[103,53],[91,54],[90,55],[87,56],[85,50],[86,57],[33,4],[89,4],[94,4],[96,58],[34,59],[95,60],[93,61],[88,4],[97,62],[104,63],[308,64],[281,4],[259,65],[257,65],[307,66],[272,67],[271,67],[172,68],[123,69],[279,68],[280,68],[282,70],[283,68],[284,71],[183,72],[285,68],[256,68],[286,68],[287,73],[288,68],[289,67],[290,74],[291,68],[292,68],[293,68],[294,68],[295,67],[296,68],[297,68],[298,68],[299,68],[300,75],[301,68],[302,68],[303,68],[304,68],[305,68],[122,66],[125,71],[126,71],[127,68],[128,71],[129,71],[130,71],[131,71],[132,68],[134,76],[135,71],[133,71],[136,71],[137,71],[138,71],[139,71],[140,71],[141,71],[142,68],[143,71],[144,71],[145,71],[146,71],[147,71],[148,68],[149,71],[150,68],[151,71],[152,71],[153,71],[154,71],[155,68],[157,77],[156,71],[158,71],[159,71],[160,71],[161,71],[162,75],[163,68],[164,68],[178,78],[166,79],[167,71],[168,71],[169,68],[170,71],[171,71],[173,80],[174,71],[175,71],[176,71],[177,71],[179,71],[180,71],[181,71],[182,71],[184,81],[185,71],[186,71],[187,71],[188,68],[189,71],[190,82],[191,82],[192,82],[193,68],[194,71],[195,71],[196,71],[201,71],[197,71],[198,68],[199,71],[200,68],[202,68],[203,71],[204,71],[205,68],[206,68],[207,71],[208,68],[209,71],[210,71],[211,68],[212,71],[213,71],[214,71],[215,71],[216,71],[217,71],[218,71],[219,71],[220,71],[221,71],[222,71],[223,71],[224,71],[225,83],[226,71],[227,71],[228,71],[229,71],[230,71],[231,71],[232,68],[233,68],[234,68],[235,68],[236,68],[237,71],[238,71],[239,71],[240,71],[258,84],[306,68],[243,85],[242,86],[266,87],[265,88],[261,89],[260,88],[262,90],[251,91],[249,92],[264,93],[263,90],[250,41],[252,94],[165,95],[121,96],[120,71],[255,4],[247,97],[248,98],[245,4],[246,99],[244,71],[253,100],[124,101],[273,4],[274,4],[267,4],[270,67],[269,4],[275,4],[276,4],[268,102],[277,4],[278,4],[241,103],[254,104],[1,4],[7,4],[11,4],[10,4],[3,4],[12,4],[13,4],[14,4],[15,4],[16,4],[17,4],[18,4],[19,4],[4,4],[5,4],[23,4],[20,4],[21,4],[22,4],[24,4],[25,4],[26,4],[6,4],[27,4],[28,4],[29,4],[30,4],[31,4],[2,4],[32,4],[9,4],[8,4],[343,4],[337,105],[342,106],[341,107],[339,108],[331,109],[330,110],[340,111],[328,112],[324,113],[325,4],[323,114],[326,4],[329,115],[327,4],[338,116]],"exportedModulesMap":[[322,1],[320,2],[321,3],[319,4],[119,4],[311,5],[310,4],[314,6],[116,7],[115,4],[110,8],[109,9],[113,10],[112,4],[111,4],[114,11],[313,12],[312,13],[309,14],[315,4],[318,15],[317,16],[118,17],[117,4],[316,18],[42,4],[43,4],[81,19],[44,4],[45,20],[46,21],[47,4],[48,4],[49,22],[50,23],[51,4],[52,24],[53,4],[54,25],[41,4],[55,26],[56,27],[57,28],[58,24],[59,4],[60,29],[61,4],[62,4],[63,30],[64,4],[65,4],[66,4],[67,31],[68,32],[69,24],[70,4],[71,4],[72,33],[73,4],[83,34],[84,35],[82,36],[74,37],[75,38],[76,39],[77,4],[78,4],[79,31],[80,22],[334,4],[332,4],[336,40],[344,4],[335,4],[92,41],[333,4],[99,42],[101,43],[100,44],[105,45],[106,46],[98,47],[107,4],[102,48],[108,49],[37,50],[36,50],[40,51],[35,52],[39,50],[38,50],[103,53],[91,54],[90,55],[87,56],[85,50],[86,57],[33,4],[89,4],[94,4],[96,58],[34,59],[95,60],[93,61],[88,4],[97,62],[104,63],[308,64],[281,4],[259,65],[257,65],[307,66],[272,67],[271,67],[172,68],[123,69],[279,68],[280,68],[282,70],[283,68],[284,71],[183,72],[285,68],[256,68],[286,68],[287,73],[288,68],[289,67],[290,74],[291,68],[292,68],[293,68],[294,68],[295,67],[296,68],[297,68],[298,68],[299,68],[300,75],[301,68],[302,68],[303,68],[304,68],[305,68],[122,66],[125,71],[126,71],[127,68],[128,71],[129,71],[130,71],[131,71],[132,68],[134,76],[135,71],[133,71],[136,71],[137,71],[138,71],[139,71],[140,71],[141,71],[142,68],[143,71],[144,71],[145,71],[146,71],[147,71],[148,68],[149,71],[150,68],[151,71],[152,71],[153,71],[154,71],[155,68],[157,77],[156,71],[158,71],[159,71],[160,71],[161,71],[162,75],[163,68],[164,68],[178,78],[166,79],[167,71],[168,71],[169,68],[170,71],[171,71],[173,80],[174,71],[175,71],[176,71],[177,71],[179,71],[180,71],[181,71],[182,71],[184,81],[185,71],[186,71],[187,71],[188,68],[189,71],[190,82],[191,82],[192,82],[193,68],[194,71],[195,71],[196,71],[201,71],[197,71],[198,68],[199,71],[200,68],[202,68],[203,71],[204,71],[205,68],[206,68],[207,71],[208,68],[209,71],[210,71],[211,68],[212,71],[213,71],[214,71],[215,71],[216,71],[217,71],[218,71],[219,71],[220,71],[221,71],[222,71],[223,71],[224,71],[225,83],[226,71],[227,71],[228,71],[229,71],[230,71],[231,71],[232,68],[233,68],[234,68],[235,68],[236,68],[237,71],[238,71],[239,71],[240,71],[258,84],[306,68],[243,85],[242,86],[266,87],[265,88],[261,89],[260,88],[262,90],[251,91],[249,92],[264,93],[263,90],[250,41],[252,94],[165,95],[121,96],[120,71],[255,4],[247,97],[248,98],[245,4],[246,99],[244,71],[253,100],[124,101],[273,4],[274,4],[267,4],[270,67],[269,4],[275,4],[276,4],[268,102],[277,4],[278,4],[241,103],[254,104],[1,4],[7,4],[11,4],[10,4],[3,4],[12,4],[13,4],[14,4],[15,4],[16,4],[17,4],[18,4],[19,4],[4,4],[5,4],[23,4],[20,4],[21,4],[22,4],[24,4],[25,4],[26,4],[6,4],[27,4],[28,4],[29,4],[30,4],[31,4],[2,4],[32,4],[9,4],[8,4],[337,117],[342,118],[339,119],[331,120],[330,121],[340,119],[328,122],[324,123],[323,124],[329,125],[338,126]],"semanticDiagnosticsPerFile":[322,320,321,319,119,311,310,314,116,115,110,109,113,112,111,114,313,312,309,315,318,317,118,117,316,42,43,81,44,45,46,47,48,49,50,51,52,53,54,41,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,83,84,82,74,75,76,77,78,79,80,334,332,336,344,335,92,333,99,101,100,105,106,98,107,102,108,37,36,40,35,39,38,103,91,90,87,85,86,33,89,94,96,34,95,93,88,97,104,308,281,259,257,307,272,271,172,123,279,280,282,283,284,183,285,256,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,122,125,126,127,128,129,130,131,132,134,135,133,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,157,156,158,159,160,161,162,163,164,178,166,167,168,169,170,171,173,174,175,176,177,179,180,181,182,184,185,186,187,188,189,190,191,192,193,194,195,196,201,197,198,199,200,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,258,306,243,242,266,265,261,260,262,251,249,264,263,250,252,165,121,120,255,247,248,245,246,244,253,124,273,274,267,270,269,275,276,268,277,278,241,254,1,7,11,10,3,12,13,14,15,16,17,18,19,4,5,23,20,21,22,24,25,26,6,27,28,29,30,31,2,32,9,8,343,337,342,[341,[{"file":"../src/lib/claims.ts","start":4213,"length":10,"code":2345,"category":1,"messageText":{"messageText":"Argument of type 'string | undefined' is not assignable to parameter of type 'string'.","category":1,"code":2345,"next":[{"messageText":"Type 'undefined' is not assignable to type 'string'.","category":1,"code":2322}]}}]],[339,[{"file":"../src/lib/drops.ts","start":11348,"length":11,"code":2345,"category":1,"messageText":{"messageText":"Argument of type 'string | undefined' is not assignable to parameter of type 'string'.","category":1,"code":2345,"next":[{"messageText":"Type 'undefined' is not assignable to type 'string'.","category":1,"code":2322}]}},{"file":"../src/lib/drops.ts","start":12067,"length":10,"code":2322,"category":1,"messageText":{"messageText":"Type 'string | undefined' is not assignable to type 'string'.","category":1,"code":2322,"next":[{"messageText":"Type 'undefined' is not assignable to type 'string'.","category":1,"code":2322}]},"relatedInformation":[{"file":"../node_modules/@near-wallet-selector/core/lib/wallet/transactions.types.d.ts","start":1515,"length":10,"messageText":"The expected type comes from property 'receiverId' which is declared here on type 'Transaction'","category":3,"code":6500}]},{"file":"../src/lib/drops.ts","start":13373,"length":3,"code":2322,"category":1,"messageText":{"messageText":"Type 'string | undefined' is not assignable to type 'string'.","category":1,"code":2322,"next":[{"messageText":"Type 'undefined' is not assignable to type 'string'.","category":1,"code":2322}]},"relatedInformation":[{"file":"../node_modules/@near-wallet-selector/core/lib/wallet/transactions.types.d.ts","start":335,"length":3,"messageText":"The expected type comes from property 'gas' which is declared here on type '{ methodName: string; args: object; gas: string; deposit: string; }'","category":3,"code":6500}]},{"file":"../src/lib/drops.ts","start":14163,"length":10,"code":2322,"category":1,"messageText":{"messageText":"Type 'string | undefined' is not assignable to type 'string'.","category":1,"code":2322,"next":[{"messageText":"Type 'undefined' is not assignable to type 'string'.","category":1,"code":2322}]},"relatedInformation":[{"file":"../src/lib/types/params.ts","start":2161,"length":10,"messageText":"The expected type comes from property 'receiverId' which is declared here on type 'NFTTransferCallParams'","category":3,"code":6500}]}]],331,330,[340,[{"file":"../src/lib/keys.ts","start":10302,"length":10,"code":2322,"category":1,"messageText":{"messageText":"Type 'string | undefined' is not assignable to type 'string'.","category":1,"code":2322,"next":[{"messageText":"Type 'undefined' is not assignable to type 'string'.","category":1,"code":2322}]},"relatedInformation":[{"file":"../src/lib/types/params.ts","start":2161,"length":10,"messageText":"The expected type comes from property 'receiverId' which is declared here on type 'NFTTransferCallParams'","category":3,"code":6500}]}]],328,324,325,323,326,329,327,338]},"version":"4.8.4"} +{"program":{"fileNames":["../node_modules/typescript/lib/lib.d.ts","../node_modules/typescript/lib/lib.es5.d.ts","../node_modules/typescript/lib/lib.es2015.d.ts","../node_modules/typescript/lib/lib.es2016.d.ts","../node_modules/typescript/lib/lib.es2017.d.ts","../node_modules/typescript/lib/lib.es2018.d.ts","../node_modules/typescript/lib/lib.dom.d.ts","../node_modules/typescript/lib/lib.webworker.importscripts.d.ts","../node_modules/typescript/lib/lib.scripthost.d.ts","../node_modules/typescript/lib/lib.es2015.core.d.ts","../node_modules/typescript/lib/lib.es2015.collection.d.ts","../node_modules/typescript/lib/lib.es2015.generator.d.ts","../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../node_modules/typescript/lib/lib.es2015.promise.d.ts","../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../node_modules/typescript/lib/lib.es2017.object.d.ts","../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2017.string.d.ts","../node_modules/typescript/lib/lib.es2017.intl.d.ts","../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../node_modules/typescript/lib/lib.es2018.intl.d.ts","../node_modules/typescript/lib/lib.es2018.promise.d.ts","../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../node_modules/typescript/lib/lib.es2020.intl.d.ts","../node_modules/typescript/lib/lib.esnext.intl.d.ts","../node_modules/near-api-js/lib/utils/enums.d.ts","../node_modules/near-api-js/lib/utils/key_pair.d.ts","../node_modules/near-api-js/lib/key_stores/keystore.d.ts","../node_modules/near-api-js/lib/key_stores/in_memory_key_store.d.ts","../node_modules/near-api-js/lib/key_stores/browser_local_storage_key_store.d.ts","../node_modules/near-api-js/lib/key_stores/unencrypted_file_system_keystore.d.ts","../node_modules/near-api-js/lib/key_stores/merge_key_store.d.ts","../node_modules/near-api-js/lib/key_stores/index.d.ts","../node_modules/@types/node/globals.d.ts","../node_modules/@types/node/assert.d.ts","../node_modules/@types/node/async_hooks.d.ts","../node_modules/@types/node/buffer.d.ts","../node_modules/@types/node/child_process.d.ts","../node_modules/@types/node/cluster.d.ts","../node_modules/@types/node/console.d.ts","../node_modules/@types/node/constants.d.ts","../node_modules/@types/node/crypto.d.ts","../node_modules/@types/node/dgram.d.ts","../node_modules/@types/node/dns.d.ts","../node_modules/@types/node/domain.d.ts","../node_modules/@types/node/events.d.ts","../node_modules/@types/node/fs.d.ts","../node_modules/@types/node/http.d.ts","../node_modules/@types/node/http2.d.ts","../node_modules/@types/node/https.d.ts","../node_modules/@types/node/inspector.d.ts","../node_modules/@types/node/module.d.ts","../node_modules/@types/node/net.d.ts","../node_modules/@types/node/os.d.ts","../node_modules/@types/node/path.d.ts","../node_modules/@types/node/perf_hooks.d.ts","../node_modules/@types/node/process.d.ts","../node_modules/@types/node/punycode.d.ts","../node_modules/@types/node/querystring.d.ts","../node_modules/@types/node/readline.d.ts","../node_modules/@types/node/repl.d.ts","../node_modules/@types/node/stream.d.ts","../node_modules/@types/node/string_decoder.d.ts","../node_modules/@types/node/timers.d.ts","../node_modules/@types/node/tls.d.ts","../node_modules/@types/node/trace_events.d.ts","../node_modules/@types/node/tty.d.ts","../node_modules/@types/node/url.d.ts","../node_modules/@types/node/util.d.ts","../node_modules/@types/node/v8.d.ts","../node_modules/@types/node/vm.d.ts","../node_modules/@types/node/worker_threads.d.ts","../node_modules/@types/node/zlib.d.ts","../node_modules/@types/node/base.d.ts","../node_modules/@types/node/ts3.2/util.d.ts","../node_modules/@types/node/ts3.2/globals.d.ts","../node_modules/@types/node/ts3.2/index.d.ts","../node_modules/near-api-js/lib/signer.d.ts","../node_modules/near-api-js/lib/transaction.d.ts","../node_modules/near-api-js/lib/providers/provider.d.ts","../node_modules/near-api-js/lib/utils/web.d.ts","../node_modules/near-api-js/lib/utils/errors.d.ts","../node_modules/near-api-js/lib/providers/json-rpc-provider.d.ts","../node_modules/near-api-js/lib/providers/index.d.ts","../node_modules/borsh/lib/index.d.ts","../node_modules/near-api-js/lib/utils/serialize.d.ts","../node_modules/near-api-js/lib/utils/format.d.ts","../node_modules/near-api-js/lib/utils/rpc_errors.d.ts","../node_modules/near-api-js/lib/utils/index.d.ts","../node_modules/near-api-js/lib/validators.d.ts","../node_modules/near-api-js/lib/connection.d.ts","../node_modules/near-api-js/lib/account.d.ts","../node_modules/near-api-js/lib/account_multisig.d.ts","../node_modules/near-api-js/lib/account_creator.d.ts","../node_modules/near-api-js/lib/contract.d.ts","../node_modules/near-api-js/lib/near.d.ts","../node_modules/near-api-js/lib/wallet-account.d.ts","../node_modules/near-api-js/lib/common-index.d.ts","../node_modules/near-api-js/lib/connect.d.ts","../node_modules/near-api-js/lib/constants.d.ts","../node_modules/near-api-js/lib/index.d.ts","../node_modules/@near-wallet-selector/core/lib/services/provider/provider.service.types.d.ts","../node_modules/@near-wallet-selector/core/lib/services/provider/provider.service.d.ts","../node_modules/@near-wallet-selector/core/lib/services/storage/storage.service.types.d.ts","../node_modules/@near-wallet-selector/core/lib/services/storage/json-storage.service.types.d.ts","../node_modules/@near-wallet-selector/core/lib/services/storage/json-storage.service.d.ts","../node_modules/@near-wallet-selector/core/lib/services/storage/web-storage.service.d.ts","../node_modules/@near-wallet-selector/core/lib/services/logger/logger.service.types.d.ts","../node_modules/@near-wallet-selector/core/lib/services/logger/logger.service.d.ts","../node_modules/@near-wallet-selector/core/lib/wallet/transactions.types.d.ts","../node_modules/@near-wallet-selector/core/lib/wallet/index.d.ts","../node_modules/@near-wallet-selector/core/lib/options.types.d.ts","../node_modules/rxjs/dist/types/internal/subscription.d.ts","../node_modules/rxjs/dist/types/internal/subscriber.d.ts","../node_modules/rxjs/dist/types/internal/operator.d.ts","../node_modules/rxjs/dist/types/internal/observable.d.ts","../node_modules/rxjs/dist/types/internal/types.d.ts","../node_modules/rxjs/dist/types/internal/operators/audit.d.ts","../node_modules/rxjs/dist/types/internal/operators/audittime.d.ts","../node_modules/rxjs/dist/types/internal/operators/buffer.d.ts","../node_modules/rxjs/dist/types/internal/operators/buffercount.d.ts","../node_modules/rxjs/dist/types/internal/operators/buffertime.d.ts","../node_modules/rxjs/dist/types/internal/operators/buffertoggle.d.ts","../node_modules/rxjs/dist/types/internal/operators/bufferwhen.d.ts","../node_modules/rxjs/dist/types/internal/operators/catcherror.d.ts","../node_modules/rxjs/dist/types/internal/operators/combinelatestall.d.ts","../node_modules/rxjs/dist/types/internal/operators/combineall.d.ts","../node_modules/rxjs/dist/types/internal/operators/combinelatest.d.ts","../node_modules/rxjs/dist/types/internal/operators/combinelatestwith.d.ts","../node_modules/rxjs/dist/types/internal/operators/concat.d.ts","../node_modules/rxjs/dist/types/internal/operators/concatall.d.ts","../node_modules/rxjs/dist/types/internal/operators/concatmap.d.ts","../node_modules/rxjs/dist/types/internal/operators/concatmapto.d.ts","../node_modules/rxjs/dist/types/internal/operators/concatwith.d.ts","../node_modules/rxjs/dist/types/internal/operators/connect.d.ts","../node_modules/rxjs/dist/types/internal/operators/count.d.ts","../node_modules/rxjs/dist/types/internal/operators/debounce.d.ts","../node_modules/rxjs/dist/types/internal/operators/debouncetime.d.ts","../node_modules/rxjs/dist/types/internal/operators/defaultifempty.d.ts","../node_modules/rxjs/dist/types/internal/operators/delay.d.ts","../node_modules/rxjs/dist/types/internal/operators/delaywhen.d.ts","../node_modules/rxjs/dist/types/internal/operators/dematerialize.d.ts","../node_modules/rxjs/dist/types/internal/operators/distinct.d.ts","../node_modules/rxjs/dist/types/internal/operators/distinctuntilchanged.d.ts","../node_modules/rxjs/dist/types/internal/operators/distinctuntilkeychanged.d.ts","../node_modules/rxjs/dist/types/internal/operators/elementat.d.ts","../node_modules/rxjs/dist/types/internal/operators/endwith.d.ts","../node_modules/rxjs/dist/types/internal/operators/every.d.ts","../node_modules/rxjs/dist/types/internal/operators/exhaustall.d.ts","../node_modules/rxjs/dist/types/internal/operators/exhaust.d.ts","../node_modules/rxjs/dist/types/internal/operators/exhaustmap.d.ts","../node_modules/rxjs/dist/types/internal/operators/expand.d.ts","../node_modules/rxjs/dist/types/internal/operators/filter.d.ts","../node_modules/rxjs/dist/types/internal/operators/finalize.d.ts","../node_modules/rxjs/dist/types/internal/operators/find.d.ts","../node_modules/rxjs/dist/types/internal/operators/findindex.d.ts","../node_modules/rxjs/dist/types/internal/operators/first.d.ts","../node_modules/rxjs/dist/types/internal/subject.d.ts","../node_modules/rxjs/dist/types/internal/operators/groupby.d.ts","../node_modules/rxjs/dist/types/internal/operators/ignoreelements.d.ts","../node_modules/rxjs/dist/types/internal/operators/isempty.d.ts","../node_modules/rxjs/dist/types/internal/operators/last.d.ts","../node_modules/rxjs/dist/types/internal/operators/map.d.ts","../node_modules/rxjs/dist/types/internal/operators/mapto.d.ts","../node_modules/rxjs/dist/types/internal/notification.d.ts","../node_modules/rxjs/dist/types/internal/operators/materialize.d.ts","../node_modules/rxjs/dist/types/internal/operators/max.d.ts","../node_modules/rxjs/dist/types/internal/operators/merge.d.ts","../node_modules/rxjs/dist/types/internal/operators/mergeall.d.ts","../node_modules/rxjs/dist/types/internal/operators/mergemap.d.ts","../node_modules/rxjs/dist/types/internal/operators/flatmap.d.ts","../node_modules/rxjs/dist/types/internal/operators/mergemapto.d.ts","../node_modules/rxjs/dist/types/internal/operators/mergescan.d.ts","../node_modules/rxjs/dist/types/internal/operators/mergewith.d.ts","../node_modules/rxjs/dist/types/internal/operators/min.d.ts","../node_modules/rxjs/dist/types/internal/observable/connectableobservable.d.ts","../node_modules/rxjs/dist/types/internal/operators/multicast.d.ts","../node_modules/rxjs/dist/types/internal/operators/observeon.d.ts","../node_modules/rxjs/dist/types/internal/operators/onerrorresumenext.d.ts","../node_modules/rxjs/dist/types/internal/operators/pairwise.d.ts","../node_modules/rxjs/dist/types/internal/operators/partition.d.ts","../node_modules/rxjs/dist/types/internal/operators/pluck.d.ts","../node_modules/rxjs/dist/types/internal/operators/publish.d.ts","../node_modules/rxjs/dist/types/internal/operators/publishbehavior.d.ts","../node_modules/rxjs/dist/types/internal/operators/publishlast.d.ts","../node_modules/rxjs/dist/types/internal/operators/publishreplay.d.ts","../node_modules/rxjs/dist/types/internal/operators/race.d.ts","../node_modules/rxjs/dist/types/internal/operators/racewith.d.ts","../node_modules/rxjs/dist/types/internal/operators/reduce.d.ts","../node_modules/rxjs/dist/types/internal/operators/repeat.d.ts","../node_modules/rxjs/dist/types/internal/operators/repeatwhen.d.ts","../node_modules/rxjs/dist/types/internal/operators/retry.d.ts","../node_modules/rxjs/dist/types/internal/operators/retrywhen.d.ts","../node_modules/rxjs/dist/types/internal/operators/refcount.d.ts","../node_modules/rxjs/dist/types/internal/operators/sample.d.ts","../node_modules/rxjs/dist/types/internal/operators/sampletime.d.ts","../node_modules/rxjs/dist/types/internal/operators/scan.d.ts","../node_modules/rxjs/dist/types/internal/operators/sequenceequal.d.ts","../node_modules/rxjs/dist/types/internal/operators/share.d.ts","../node_modules/rxjs/dist/types/internal/operators/sharereplay.d.ts","../node_modules/rxjs/dist/types/internal/operators/single.d.ts","../node_modules/rxjs/dist/types/internal/operators/skip.d.ts","../node_modules/rxjs/dist/types/internal/operators/skiplast.d.ts","../node_modules/rxjs/dist/types/internal/operators/skipuntil.d.ts","../node_modules/rxjs/dist/types/internal/operators/skipwhile.d.ts","../node_modules/rxjs/dist/types/internal/operators/startwith.d.ts","../node_modules/rxjs/dist/types/internal/operators/subscribeon.d.ts","../node_modules/rxjs/dist/types/internal/operators/switchall.d.ts","../node_modules/rxjs/dist/types/internal/operators/switchmap.d.ts","../node_modules/rxjs/dist/types/internal/operators/switchmapto.d.ts","../node_modules/rxjs/dist/types/internal/operators/switchscan.d.ts","../node_modules/rxjs/dist/types/internal/operators/take.d.ts","../node_modules/rxjs/dist/types/internal/operators/takelast.d.ts","../node_modules/rxjs/dist/types/internal/operators/takeuntil.d.ts","../node_modules/rxjs/dist/types/internal/operators/takewhile.d.ts","../node_modules/rxjs/dist/types/internal/operators/tap.d.ts","../node_modules/rxjs/dist/types/internal/operators/throttle.d.ts","../node_modules/rxjs/dist/types/internal/operators/throttletime.d.ts","../node_modules/rxjs/dist/types/internal/operators/throwifempty.d.ts","../node_modules/rxjs/dist/types/internal/operators/timeinterval.d.ts","../node_modules/rxjs/dist/types/internal/operators/timeout.d.ts","../node_modules/rxjs/dist/types/internal/operators/timeoutwith.d.ts","../node_modules/rxjs/dist/types/internal/operators/timestamp.d.ts","../node_modules/rxjs/dist/types/internal/operators/toarray.d.ts","../node_modules/rxjs/dist/types/internal/operators/window.d.ts","../node_modules/rxjs/dist/types/internal/operators/windowcount.d.ts","../node_modules/rxjs/dist/types/internal/operators/windowtime.d.ts","../node_modules/rxjs/dist/types/internal/operators/windowtoggle.d.ts","../node_modules/rxjs/dist/types/internal/operators/windowwhen.d.ts","../node_modules/rxjs/dist/types/internal/operators/withlatestfrom.d.ts","../node_modules/rxjs/dist/types/internal/operators/zip.d.ts","../node_modules/rxjs/dist/types/internal/operators/zipall.d.ts","../node_modules/rxjs/dist/types/internal/operators/zipwith.d.ts","../node_modules/rxjs/dist/types/operators/index.d.ts","../node_modules/rxjs/dist/types/internal/scheduler/action.d.ts","../node_modules/rxjs/dist/types/internal/scheduler.d.ts","../node_modules/rxjs/dist/types/internal/testing/testmessage.d.ts","../node_modules/rxjs/dist/types/internal/testing/subscriptionlog.d.ts","../node_modules/rxjs/dist/types/internal/testing/subscriptionloggable.d.ts","../node_modules/rxjs/dist/types/internal/testing/coldobservable.d.ts","../node_modules/rxjs/dist/types/internal/testing/hotobservable.d.ts","../node_modules/rxjs/dist/types/internal/scheduler/asyncscheduler.d.ts","../node_modules/rxjs/dist/types/internal/scheduler/timerhandle.d.ts","../node_modules/rxjs/dist/types/internal/scheduler/asyncaction.d.ts","../node_modules/rxjs/dist/types/internal/scheduler/virtualtimescheduler.d.ts","../node_modules/rxjs/dist/types/internal/testing/testscheduler.d.ts","../node_modules/rxjs/dist/types/testing/index.d.ts","../node_modules/rxjs/dist/types/internal/symbol/observable.d.ts","../node_modules/rxjs/dist/types/internal/observable/dom/animationframes.d.ts","../node_modules/rxjs/dist/types/internal/behaviorsubject.d.ts","../node_modules/rxjs/dist/types/internal/replaysubject.d.ts","../node_modules/rxjs/dist/types/internal/asyncsubject.d.ts","../node_modules/rxjs/dist/types/internal/scheduler/asapscheduler.d.ts","../node_modules/rxjs/dist/types/internal/scheduler/asap.d.ts","../node_modules/rxjs/dist/types/internal/scheduler/async.d.ts","../node_modules/rxjs/dist/types/internal/scheduler/queuescheduler.d.ts","../node_modules/rxjs/dist/types/internal/scheduler/queue.d.ts","../node_modules/rxjs/dist/types/internal/scheduler/animationframescheduler.d.ts","../node_modules/rxjs/dist/types/internal/scheduler/animationframe.d.ts","../node_modules/rxjs/dist/types/internal/util/identity.d.ts","../node_modules/rxjs/dist/types/internal/util/pipe.d.ts","../node_modules/rxjs/dist/types/internal/util/noop.d.ts","../node_modules/rxjs/dist/types/internal/util/isobservable.d.ts","../node_modules/rxjs/dist/types/internal/lastvaluefrom.d.ts","../node_modules/rxjs/dist/types/internal/firstvaluefrom.d.ts","../node_modules/rxjs/dist/types/internal/util/argumentoutofrangeerror.d.ts","../node_modules/rxjs/dist/types/internal/util/emptyerror.d.ts","../node_modules/rxjs/dist/types/internal/util/notfounderror.d.ts","../node_modules/rxjs/dist/types/internal/util/objectunsubscribederror.d.ts","../node_modules/rxjs/dist/types/internal/util/sequenceerror.d.ts","../node_modules/rxjs/dist/types/internal/util/unsubscriptionerror.d.ts","../node_modules/rxjs/dist/types/internal/observable/bindcallback.d.ts","../node_modules/rxjs/dist/types/internal/observable/bindnodecallback.d.ts","../node_modules/rxjs/dist/types/internal/anycatcher.d.ts","../node_modules/rxjs/dist/types/internal/observable/combinelatest.d.ts","../node_modules/rxjs/dist/types/internal/observable/concat.d.ts","../node_modules/rxjs/dist/types/internal/observable/connectable.d.ts","../node_modules/rxjs/dist/types/internal/observable/defer.d.ts","../node_modules/rxjs/dist/types/internal/observable/empty.d.ts","../node_modules/rxjs/dist/types/internal/observable/forkjoin.d.ts","../node_modules/rxjs/dist/types/internal/observable/from.d.ts","../node_modules/rxjs/dist/types/internal/observable/fromevent.d.ts","../node_modules/rxjs/dist/types/internal/observable/fromeventpattern.d.ts","../node_modules/rxjs/dist/types/internal/observable/generate.d.ts","../node_modules/rxjs/dist/types/internal/observable/iif.d.ts","../node_modules/rxjs/dist/types/internal/observable/interval.d.ts","../node_modules/rxjs/dist/types/internal/observable/merge.d.ts","../node_modules/rxjs/dist/types/internal/observable/never.d.ts","../node_modules/rxjs/dist/types/internal/observable/of.d.ts","../node_modules/rxjs/dist/types/internal/observable/onerrorresumenext.d.ts","../node_modules/rxjs/dist/types/internal/observable/pairs.d.ts","../node_modules/rxjs/dist/types/internal/observable/partition.d.ts","../node_modules/rxjs/dist/types/internal/observable/race.d.ts","../node_modules/rxjs/dist/types/internal/observable/range.d.ts","../node_modules/rxjs/dist/types/internal/observable/throwerror.d.ts","../node_modules/rxjs/dist/types/internal/observable/timer.d.ts","../node_modules/rxjs/dist/types/internal/observable/using.d.ts","../node_modules/rxjs/dist/types/internal/observable/zip.d.ts","../node_modules/rxjs/dist/types/internal/scheduled/scheduled.d.ts","../node_modules/rxjs/dist/types/internal/config.d.ts","../node_modules/rxjs/dist/types/index.d.ts","../node_modules/@near-wallet-selector/core/lib/store.types.d.ts","../node_modules/@near-wallet-selector/core/lib/services/event-emitter/event-emitter.types.d.ts","../node_modules/@near-wallet-selector/core/lib/services/event-emitter/event-emitter.service.d.ts","../node_modules/@near-wallet-selector/core/lib/services/wallet-modules/wallet-modules.service.types.d.ts","../node_modules/@near-wallet-selector/core/lib/services/wallet-modules/wallet-modules.service.d.ts","../node_modules/@near-wallet-selector/core/lib/services/index.d.ts","../node_modules/@near-wallet-selector/core/lib/utils.types.d.ts","../node_modules/@near-wallet-selector/core/lib/wallet/wallet.types.d.ts","../node_modules/@near-wallet-selector/core/lib/wallet-selector.types.d.ts","../node_modules/@near-wallet-selector/core/lib/wallet-selector.d.ts","../node_modules/@near-wallet-selector/core/lib/helpers/waitfor.d.ts","../node_modules/@near-wallet-selector/core/lib/helpers/getactiveaccount.d.ts","../node_modules/@near-wallet-selector/core/lib/helpers/index.d.ts","../node_modules/@near-wallet-selector/core/index.d.ts","../src/lib/types/general.ts","../src/lib/types/ft.ts","../src/lib/types/nft.ts","../src/lib/types/simple.ts","../src/lib/types/drops.ts","../src/lib/types/params.ts","../src/lib/keypom.ts","../src/lib/types/fc.ts","../src/lib/checks.ts","../src/lib/keypom-utils.ts","../node_modules/@types/react/global.d.ts","../node_modules/csstype/index.d.ts","../node_modules/@types/prop-types/index.d.ts","../node_modules/@types/scheduler/tracing.d.ts","../node_modules/@types/react/index.d.ts","../src/components/keypomcontext.tsx","../src/lib/views.ts","../src/lib/drops.ts","../src/lib/keys.ts","../src/lib/claims.ts","../src/index.ts","../src/assets/icons.ts","../node_modules/@types/scheduler/index.d.ts"],"fileInfos":["2dc8c927c9c162a773c6bb3cdc4f3286c23f10eedc67414028f9cb5951610f60",{"version":"f20c05dbfe50a208301d2a1da37b9931bce0466eb5a1f4fe240971b4ecc82b67","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9","5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06",{"version":"9b087de7268e4efc5f215347a62656663933d63c0b1d7b624913240367b999ea","affectsGlobalScope":true},{"version":"7fac8cb5fc820bc2a59ae11ef1c5b38d3832c6d0dfaec5acdb5569137d09a481","affectsGlobalScope":true},{"version":"097a57355ded99c68e6df1b738990448e0bf170e606707df5a7c0481ff2427cd","affectsGlobalScope":true},{"version":"adb996790133eb33b33aadb9c09f15c2c575e71fb57a62de8bf74dbf59ec7dfb","affectsGlobalScope":true},{"version":"8cc8c5a3bac513368b0157f3d8b31cfdcfe78b56d3724f30f80ed9715e404af8","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"c5c05907c02476e4bde6b7e76a79ffcd948aedd14b6a8f56e4674221b0417398","affectsGlobalScope":true},{"version":"0d5f52b3174bee6edb81260ebcd792692c32c81fd55499d69531496f3f2b25e7","affectsGlobalScope":true},{"version":"55f400eec64d17e888e278f4def2f254b41b89515d3b88ad75d5e05f019daddd","affectsGlobalScope":true},{"version":"181f1784c6c10b751631b24ce60c7f78b20665db4550b335be179217bacc0d5f","affectsGlobalScope":true},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true},{"version":"75ec0bdd727d887f1b79ed6619412ea72ba3c81d92d0787ccb64bab18d261f14","affectsGlobalScope":true},{"version":"3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006","affectsGlobalScope":true},{"version":"17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a","affectsGlobalScope":true},{"version":"7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98","affectsGlobalScope":true},{"version":"6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577","affectsGlobalScope":true},{"version":"81cac4cbc92c0c839c70f8ffb94eb61e2d32dc1c3cf6d95844ca099463cf37ea","affectsGlobalScope":true},{"version":"b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e","affectsGlobalScope":true},{"version":"0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a","affectsGlobalScope":true},{"version":"da233fc1c8a377ba9e0bed690a73c290d843c2c3d23a7bd7ec5cd3d7d73ba1e0","affectsGlobalScope":true},{"version":"d154ea5bb7f7f9001ed9153e876b2d5b8f5c2bb9ec02b3ae0d239ec769f1f2ae","affectsGlobalScope":true},{"version":"bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c","affectsGlobalScope":true},{"version":"c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8","affectsGlobalScope":true},{"version":"09aa50414b80c023553090e2f53827f007a301bc34b0495bfb2c3c08ab9ad1eb","affectsGlobalScope":true},{"version":"775d9c9fd150d5de79e0450f35bc8b8f94ae64e3eb5da12725ff2a649dccc777","affectsGlobalScope":true},{"version":"52d1bb7ab7a3306fd0375c8bff560feed26ed676a5b0457fa8027b563aecb9a4","affectsGlobalScope":true},"80fc108ad79ff0476af2615faf91165fc53fd5e9c26f4dd65c8c023909e5f706","3873cb155ac58e170d7295cdc9283dba5bc41660008c8bf67897633a577650b6","b8a9367889fe66b6b2f1a4f5c2bbdc97c23dd4ae472470902311a658780407db","c282e0cf56c8f40f2460e6896f985e2827f75da29400ab4e2161535d9243ae30","793b4470d1ef96268a79c974809608b6d7f06dc998e3e94247fc299381efe8b8","0b48f901c2931dcffa0650ea1dba1d247cc6ee9b13956069419854fb14324f4b","8f4802f38a3782bea74c9eeeb871e27eabbc3d29401559445b27356d37d467a2","2443cf925775612aa2ca54cfa182fa49e30e75f9f40233133f47abdd47001f2d",{"version":"aec138735da3ce80430f3a273b540b674157acb7c8e007899fc537845b060581","affectsGlobalScope":true},"58a52f282f1dad18179023804c1f3a7536bf875748a0a314abd43f60fd5b244f","138476cfdccbb9e2c7e06602bc216af843a56c4f3469a79106bc660ba94bd66a","fe892fea1e75a442fffb4a604d7eeb451e858787a9f2f01c4e83bf12a3b5048d","c3525f0f2d1ceb812810fe17f614ce8bd9a932285c065d8bc958eb32347041de","736b604328c576304485a9769ae0540ea979eb888a04541fb73af9cde1d91c25","525c8fc510d9632d2a0a9de2d41c3ac1cdd79ff44d3b45c6d81cacabb683528d","b952021e804dcd9cb5e5552e1ec8bf9f479b61e20da5641e2a542fe77db9a598","fa8882db772bdbaed4832b25c6d68a8d3106c857595887ab1a5000fc573a4064","beedf72ae8a4176d262e464b70544021a8cd765e21f58325eae5d132a3eb359d","92bd533d635f967b198fde9bc789996370f0db3322306646d961f64e67ed5b7a","d5b7c8819ce1bd31a45f7675309e145ec28e3aa1b60a8e0637fd0e8916255baa","4a419878f025046ff6748d073123b0451849f83b7dbca907037a53e3eaa9bbbb","dbe39c84ad40acd4b4259bc035aa5870ab08bcab899d2f7089c7922a434cf02d","61af0c7f7be9887d42de91222b0d758fa9912027c2dbda957b749bcd43427b54","c1be6aa0155b02d94de321f13663128c0ff847082f1c9fae29219f603f1718f7","152af7c23ec219f632afa2d861abc65993f56cd39a4f3a4018515dbc05950a74","7f71142177d3c98370b31751e3d320c9743ed28eee215acb88d8e0d2a31e321e","03394bf8deb8781b490ae9266a843fbdf00647947d79e25fcbf1d89a9e9c8a66","cc5fac2b9e45a6670b96fd32cb42c97e0d4a7b2ee12c87963c6fe0f55fa84f50","1a6016bd905855b2b45881e9edbd7ab8c7175f8bcbb711ff06989c4bcdc75486","5fb30076f0e0e5744db8993648bfb67aadd895f439edad5cce039127a87a8a36","27ef4001526ee9d8afa57687a60bb3b59c52b32d29db0a2260094ab64726164f","3a8848a9c307429b861402cc69bc472ffe0c05b86474fc158723169161e16389","30ec6f9c683b988c3cfaa0c4690692049c4e7ed7dc6f6e94f56194c06b86f5e1","80c4d0b88eb9712f6cd30a672a8288f978afc8df652b4fdb434236b7836766ff","94cf93922adcc9cb4acf11d8d71641af728de919a50ae55d8e83159afea1a42c","65dbe15ed8a8ed5d4707a63868178dc38111cfc06de28a2e50713ca017a9c157","58124c3a58f62499993ee554500c49b756149bf079f07d41dc0fe5ea74bf90b2","17e157df6125098a1a34eb4d201ee4ac03bbe97e471ab5627bb2c40fce555948","b40652bf8ce4a18133b31349086523b219724dca8df3448c1a0742528e7ad5b9","c61e008d7f29f532b933b25e57620e3b11f9cf76d88e35f2d3a4e0aaac1d5d9e","978aecd2e6bc2ac094e9a35eda98ff8586713857b3655e7c98ca5ed8f7d50662","b8553c42868db5dd58a51b0a7f02afb4c99e3b0bd98ea4d2da8140cf978dc46c","431151f55411c3f27cf539b987a7d1de453188ed58e54bc946183d280d3444a2","2d662fd31aed8c66b20f46390e5497357905a7d8bc22ec8a6c5a30d5f316f6dc","e880a08fbb0d9ee2f733f9183f4d1bdb75bc9e0e64060a8a1fc30540791fcded","f98df5ec124f441b465332271d0b083aeec815cd3c92d9249b9739e6318477a9","0a7a6d65b520ba55bfe2db2b1a81cf53d4f937d314f107e1be543458273d5afd","f91189e04264b0e41ee96ff96661c3871e739b90156df2f2288da7a81019dcd9","6622f76993bdfeaacb947ba7c4cf26f2e5c5194194d02d792c3cba4174cd8fce","4f54f0a9dd3b644c99ec32b32f8804d5978bc854799b228ae9c467bf3c84c64c",{"version":"ce6b191c382ee19f23678b8c364484627bcf424e8f408357a2f5530fb8d52a45","affectsGlobalScope":true},"765fc34423b93c2ab763670d8d11d99e5f47387c13c161d6f1640dd6d91b7d1c","c21b847fcb59e6b8b3d14ef69f5f898c5f23af58f30139f4b4ecdd895221cf61","8074bd97ca2b632073c0ba61e121ebae88a8539121610ff2f963bfd7dc2420eb","03d5347b2c4b66ca5cc913f06a207f0dfffc9375d340c67488366f6162fdd61b","2b22ea4e7bf1b80a3c546c11c5141060f97b08df7777c94b28c2706d497396fa","5d311484dd59482d9ad090f51431b63f7da2727ea88d899b71a1e0d92dd91a79","96e75435c3b2d2a2b8f14802f8bf064c8cba8a97aa9a0479daddcbe448119ccb","3ed62301cf931ae66d79848f6608cc1a40d1bcfc0cc31f74ff13ef39f386b952","82be895c4d00dfddc7ae78afe619829a9d74faae1982b504af19e565bf7f8bac","193a838b209e1d9d8b81257f688e9079f78927131e8ac640497c1357351fff44","3b1cbbc525b33809588bede93b27af062babaac89ea8e1ffcf6b5f5a677d0228","b19f1a784ff230e0ab9ca9ae9dcef279dbe6620a70517803af35cffb270c29a6","3db9223ef1d787b47e08965bdb58c96d330454d9a2a006a3581b434610516d73","77e565890487b64564a166dc9cdf48a2d66dc1b74da123f8071aeec4ccc47040","6fc360a04203051412a34ebac6c6ac1dba4b23258be4f26f2c396910f60ae675","da854782df3a73a8683b1f7e5d779b9bfe561c76c83ddc92d416b7aae6421de1","4984a47822dad9cc4ce63fd61c29e816f6aeb95be14bb7b1a26b4589648bc754","4b94f3c3863af13f43bc31216a5d9dd3fefc9d10973e212627290dbf5fd18ccc","e510b321347e623ff25af8f4f8b9c3e47addc96ba6147c674109699934082c66","a5eb60edb3bcaa2504afe3a8cb6c1e48c73c5e585c5122c6e18f2deb55bdf73f","84c74aeb041403c9bddf46f13a699a14bed0f2a01cb020e55b36857bdd2bafe7","0fb20b6c36984b95815d9c2726cad681e4da875e0aaeeba27a0e93d68e52fe3c","e174d04105fdd9ccdbdc4605d542caf688c4f9f13968129b7e106f8f036be165","838c505b8a85847b82cebfedf69d2638d39d763a03bba0eb9f5564d339dc83e8","9e755713010e97c315200b9f97c3b4f6faa7e2d8f573601f4b56e9ce462c9340","e59b3062cef66ccc3e6141929f673657f75db0007a9573a24cd0d4f8fbc33cdd","5d2cd6b38d4f14cdc27c8bb3236e5b375e0f6bbaae5f93d8724b5069d7b415f6","8961c78b9c29411581a13424749a94a8c5f499086a929dfcf2eaf2a28bd0e1e7","0c238ffad8ac6f4be1be79c909937a723516e5a38cc15377f0511cd48566e3e5","0e658283180165f495b0967bdba03bd1c08daa63677216069adcde752bc4acb2","9a8f42036a42120c39a5d384abe92bd47e187b3a50ed134ad23d12b479af2697","97faf2f5042e998abfd4ae4b65b6e9807ebfb4b3484afeeef2a688ade549ae30","0d53e597adb0c3d1d2db4b5e5324150a509c6b31bfa87be53fba9b0b45ae6a6b","7f70b7f311e3ffeef82c2c7f63b1ae875c139443a91dbf0f9abb236ff331a1aa","36ffedc870284ea24bed3ca6acc45af3965e30fbfb89cdf4908b3b1c0779e48f","39d4efcc2f58febd9f64ff6a2aaacdbe3cab04c3738b1e0d92b25c7465017ebb","fa3d0cd03fa17459d9ddd98b120b4bb084da39f0391cbdce480a6ef74be0cc7a","e3fd84e6470b7e0679c4073ee5ce971d324182486dde5a49b67cae29168b51d2","dd8331d0a5190a4735ce6c152e420230188c4966067a756673c36dd7ba72b10e","cfdf36cfc0721c29f58651fc12f0f5a349d29da3a63180afc5b3d77b95653f82",{"version":"d57e7ff5243e0dcd04cf2edf9ad9520af40edd6eba31c14c3f405f0c437fa379","affectsGlobalScope":true},"0f882d4ae58f431454030289154feb0132e1b00ca5c3197c6b749bd098aed73a","7ff7f4632a6e7b6872fb1843f3c0df495b49840eae2a23c6fbc943f863da8c29","d267771149e172ade39e3ef96b4063209d5a7e8291702fe03983aa52f2b3d5f6","a78590b0efcef281236e3234520c348d63be1d4561b63b20e6c3b6fc18b37dfb","4d59c6a10b6c79a0927c79efa89b3c9f71d174ec14ec2792076cfd2330d0cf8e","a496f51933422872de22729b7a0233589325a1a1707cccd05cd914098944a202","75b6663bc569724017997481b6b3774065c204b316cb4f5ad7df3b5162d2dce1","06a38095ad4368314366bc08f7cbc0fe274ef7321ec611005d0bdd9c6565e4d5","4599793db9aed9b84677f0ca1cf7ef3c69bb91cda4fe4329cbab778ca4d80a58","ad0028f96921778931fb8419d8de33b10908314fa99699de1702020f69235da1","ccd2a35321c0786bd3808042dc43b960cac13f2cc660ac37a0087e12bc97d2fc","df524ed01de4f19efb44bded628dbba9f840148be4b6cfe096e29d4b01589de3","2e3981b9cee48174ff85ae15019fd72933f7023a4ed05094740f7e6f7775623c","836ebdc3b9e4c006acc4f405b7e558e56d47830e05c40d991b1e27fe8bc91157","2cc6b617c6120ba64b5778ccd4b74c951adc3a3941bb6b39f47d48701c44af39","eca02b99615a8f1652e21399d832618e38bf166c0747c9247349bc901a2f7741","7f7d6d42e5780e86f5b860a6f95179fae06a368b3af28c1c4230397c47021a59","4740a7d11ab3b381be0f269f1903fb3ff226a2fba55a01756b2997e67cd853f2","863dbc4e77f0353e6f9d6bc0e2b4622d5c07ff6f099ff66cafd7924b2ff4dd3f","bf034a18ed7e2a058f9e48c4c2480a124138fbd3586a80c77736a9ec079d12a8","f88758992a0bf13d095520aacd4381fb456ff121fb9aa184e6eb0eecb26cfadc","c249e9ae33bfcad97deec3c73c9ed2656e112fbdf22deace0b39724be6a5dcf0","d8b45924965c0c4fc0b946c0b6d597aa8d5de9cdf5c727e3d39422d17efec438","d07ea953cfea0c4bd11641912846bd955f4fd26ad2b7b8a279d69c7ab9cb3add","feddabf6ab0eb191e721f0126f3db8688db97c77a1234968bde7a2d70c4ae513","dbbda62ea5f4d1f8b40cc2b7e2e2fae424abbb4715a04a3659cb8b317f7b228b","cde0568b836865a24f4ee5859462004a326dfb76d514e6f56c8e78feedebed58","7f5cb3a03588ed46d52a6c2138315d930cd6ffb5c2134247cd07bc23cbea0b5a","7797f4c91491dcb0f21fa318fd8a1014990d5a72f8a32de2af06eb4d4476a3b5","f39fb20b83c3f9853c13d4ac95533760979d3023c0a5affe2c0a62d91ab3afd8","e4fca08aed8afb32bb8643d7469810bc8681115fe398e56a028df9e73b2d867f","2622639d24718ddfccc33a9a6daf5a2dd94d540ca41e3da00fe365d2c3f25db3","078966067552650f44ca96c68eddbb8539f30ee48a9ab3f24abdcf0a4037b535","2cd6250c43dba360377481c98d48db6ab1532a7527339edb0deffddc28ba66b1","7a9d600990fbe263a23daebed9ba1bbc5761e45679a7e2b2774a42756ef077a2","66bc155515fbea8c31a4efccbbac44de7c037b01f3aa00b76312cf7252725d30","5703288ddbfc4f7845cdbf80c6af17c8cde2a228757479796c2378b1662fcd48","0dfd353f0c16dd5107a7e0713dc52d0a2538293b0a0eac6000a017f9c0a60b56","9cd683a4663ef4d9c6486f1b8a34c73bdbc344d69490931bfe2fbcada12ab35b","42f6a409bad5259ece69df25d2b8ace2ff2ade45fe6386ee45203bdd9329f971","d3b1a8b87a5e77d70056325e137a0e04d984b991546fdd3c1034ff4102d603c4","2eb162efd6dba5972b9f8f85141d900d09da4fba23864f287f98f9890a05e95f","3f878fb5be9ebe8bd0ac5c22515d42b8b72d3745ef7617e73e9b2548ccbdf54b","e9ed562b7599c8c8c01595891480a30f9945a93a46456d22ee67ebf346b7538a","e7bf975a98cecefe2e8902fb7da9314675ecdce553aea722aaec97327668e18b","3d36f93648518338c875d9f77a8eab52905365483dbb3afe43ed68f1b712b67c","4fa54df9184d291bd78b36f5063372042cd995460e906cb14014e40d1442a326","b4e32bd5e3b493e4ea6b5ec69a4c02aa1fdaa78e1df9a863bb07604de8f9d123","f6bd1aa152ca2b5064e06282ee3137842ae6825b6b09aa89a2ff063b976a56f3","bce2390bb3a76f8bf2ba4397c66db5277bf3e698ee614347e5eb79d7fc0942c6","fbdc8d7cc7daf4101bf567512c67fb990d8fe300e0ba7f213171192177f44aa0","298e0da6d858e39fc0c1eebfa4f5c8af487868c6f2e98c3ef800537d402fb5c3","3b6457fb3866562d279377f923cf3758c80ed7bfcc19414b72a24d0a98188e0c","4fb5d7efb3520b92c1b767ce18968057c5e70886d7fb3416c487231df9275af9","df2303a61eb57b2717d17123e82bc0f3fd60f6e4673cb5506192dfe23c9480bf","b104960f4c5f807535ab43282356b2fe29c5d14a02035c623ac2012be3d5f76c","a35ca245eb852b70b20300546443abb1fcbac6e5066e4baaa092af4ea614d9b5","55da140feab55f10a538a9879a97c4be3df4934cbd679665c91a7263a86095e1","1a39e51e3362aec7d4edec9b317ff83916fe0471f86ddf2d3ef3af5952e87d9e","4b3f36b96f129a8e125c91d41a05f711e73b3285f80bceb3a1aecb13c97c4502","852779920fc4220bc42ec6d3c9b6164e23ea9371a788531b48b4005fe0cb4392","9a82e1b959524c1abfeeb024ee1a400234130a341f2b90a313ce4e37833b7dd2","515b97cede17d91c9669cc1c7fb7a8a5f0a5f2d8999f925a5f70b4ebea93723e","08e8e57241f874bdbf69ab2b65cb0ee18b4183d5c9452937da49b934fc679c4b","944af466f063d4bd090ab9d988c620b90a014e919d5f78963f6074a136ea225e","644addd4811636da491c9546654bc005ba8599f23df6d731d91eba86f3137fc2","a9249493114b181814728cbfeb7234738193a4169b654ec4705d48d7a4d25222","aad6f20d6eb01192ae02294361faa6e1f320d72447b56f433db853bbe80b15ca","876fbedec2f494eb6f834ce8636b07d581c657d205d81a3ba894eff0facc6b84","58527aa45f11c9b259a6a9d78b397f35020bfbb104f4d3bb177039b5c18146bd","91b8b61d45b5d22f3458a4ac82e03b464a0926bab795a920fe0eca805ec476eb","2744532f8fb960eb78497ac660db719f503a10c801f87131d26fd9cbef75dcef","6884287c54891ac19cfbe056f3ed29cab1732a00dec69bd3b140ce62c11783c6","abc3487041159734b8611d9d6fd85de6892f11ebe8c2583baedfc1f87c53757c","cb46657d3237f80742d5701ebcced8f6e5cf8938442354387d6c77d7048dfae6","76281a3b799bbd17ec8e6de7d2fa45ccf749049fd53f00857daf0dbc449616b8","661f322e45545a554e4ffc38db6c4068a66e1323baf66acb0d8a9fa28195a669","91d70dce48c2a2bb55f0b851cf1bdba4202f107f1e8fdf45f94ff6be4b8e8f99","ce978e20a6f26f606b535f0d6deb384ae6a73f8d0bd0dfca0925f5317cad1f25","f2d3567210ca4d559d8297d6c4402599c93e3bc7485054192d38db5e132fbc0a","887d8058aeeade45984fdb8696147078bc630d3fea15ab2b7baacde0fe281fb7","ad27aa59d346179ac449bd3077d245f213152879e4027356306ccf1722d61d51","ea546a7ed9eaa71ba78d4d392509dadea4bafed283269dd6c4b09e7d8824e986","4ec0f2a141a9ae7d3557b8efe630ac2021bc3a9ac61238b59293f4cf2f196e82","b2db743c71652e03c52d51445af58d0af3316231faa92b66018b29c7ba975f6c","0863a5876c85fbaffbb8ec8aeda8b5042deb6932616139706d2b82cde9d3f7c7","1294b8ecdd212362323f349dd83b5c94ea77bfee4dad24fc290980a3c8af6ce3","ba9c46725e2a0bd9df59d3a1e801cc60f90db3ef7817131c53945dce2b8c0c56","281d373eeabf80c4851f8de991e6abe4d385c30379d80897bbc3df3dcac99cee","624c5dce95672d9dcca40d9d9d82ef855f5f902292f43aa265cc8fd963c6ce84","8a48d9c6184992d1c3ed5daa55f83d708c37582916926a5555a900608f804b60","605dd288c636cf9b5317fe76dec75d3c7fb855fdcd3ee8cb4fea7d7091ca6fb4","95addea67857d4e568a02e429b15458cec203876b2ea5f5ea18ccfeeb91b8ce0","b5a615b0ad865ffa562980a10bda162ac1744fd363b4edc2cfc664222071cbcf","bbccd721363897950a55ce09529503f25a69522e5c91a22679b66e941e5f8654","d3a1e70795c38d7851b6e4f3b441c5ffdae171d6e2576a2204b7d79059aeea66","d7b8d41887c5fccfe19802c4336d34348b752abf0d98839575699d71deff60be","063fe3004728b8516a4d799ee16f9a71801ba24e0443dd98638cef1bd4353a7c","b8a0236f47d9037efdaf93da602415ae425dababe097fc92f83fd47ce9aaa69f","fab7912fc3ff45fce2f5d5febc9494c4d0a85d6c63fff68f21e4669c32eaacb9","f6c3fcb9d75d8aea778236fd9327ceb935b41865dbf3beac698be77e0ae9018d","b20bc124abd8ee572d0d756713ff987b116cdae908a6fcbc40e80d4b999f56b4","a599f3f450ad62c3fdc0c3fd25cddcc9332ffb44327087947d48914a8da81364","645dff895168aa82350c9aa60aa0b3621b84289fef043be842f45a9c6c0ac6e2","f068ff5b7fb3bdc5380e0c677e21de829bd25cdac63a9b083fdc220fcb225280","09d2fdca6ea6c135897a26976ad3c0db724adaf23ef4e38ad852b1d8efef1ae6","15de5b7739bf7e40213a200853bf78455ee5958af08eda786605a54a7f25ade6","f3acb439e08f0c2c78c712a876dc6c2080302c46916f1d63b7dbe509616ce9ae","37862e711637ebd927907a82cbf0143ea30e95eb165df554926c43936b1d77a9","89e253db2c2cc9a510c521f14dd2b1aae4de2556ee5159ad8d118d3587e3a880","3d0a172cee184a0f4111a7bd7fbb8729af3f54b30c06a2677d85c20ea9c811ab","d6a07e5e8dee6dc63c7ecd9c21756babf097e1537fbc91ddfec17328a063f65d","6fdc88b1287c276b55b7f7c4c7b49587813c763eea9751ce0baf0a7e61cd5d89","6a02443704052768bd021f24783aa104b02ae4444e9b735317bf13c6b857a11e","37987b0fe9800cf25473c882ce07bccdab2763c5681c1a2d16816aead46aa8d1","c84c03c721154068e1a60d83e9e85819bd3ef70b824ac2edc498aa31c06e5781","c23a403716784b53cf6ce9ffff9dcdb959b7cacdf115294a3377d96b6df1e161","c96fb6a0c1e879f95634ab0ff439cbb6fff6227b26bbf0153bef9ed0aabba60d","db936079fe6396aad9bf7ad0479ffc9220cec808a26a745baebb5f9e2ef9dbc7","06bc0b9cc7bf0b92534f1517fe5adde1f23f60cc6cc5c59f8e1c65db48a40067","919a753b0cbb12ccc606c62e2d34884d75a48ba19b1dda497c72621b11dac088","2c27e33ee0bf722988da00abd582cc9b806ce3fd9153a864800a339ad13f3fcf","92d7b3a5aa5dc872e54cbad2a7094b3ea4f72c7901de1d07b4c334ff658297f0","7a52922b38e9686d5bdc6e75774929eec6688d26c1dfe4a03ddec77ede468e87","aa5efca2833d89b55248f1889a6433dab1b1f41768e9a75f8ce35f9bf56c5ec4","3da085d344bf625767c5b1fcada31a5d94ebefc4e36bf18a676ca37460bc4e4e","006855ddea8674d084173a768f88519dc154be94eba5e2120262a33709832b9b","17dd843a266f99ca4b3a1257538bd1cc69dc5c7f2f23c3891f0430615b8c9c1c","5430364886c721a30475253356162b6c27871718094cb3e69e2bcea71a17e533","1218398da7c8dc4add10bdb3aa2856aad54b123d847eaf574d1d694ac269bfb5","189014f3213ee7457dbeea04dca10ca5d9ed2062cd39641aca5f3b4c75de9d99","b637cd92688a6cdf4f8f184ff529dc2bc7f15692828e2c0c66a60e6972f400c7","7061e83d6792897077bcac039fccf7325234004769f591c63a8cf8478bf551bb","7ab905865063322f2bba361d0f2ef93520f64a382bac13b127479860ad99f62e","277a358d61376fce7ac3392402909c96cf6a0a613146549fc0165ccff953e012","50614c808e099a1d4413786f3783d9eeaaa74b267f2c87fcf8a893287e91c301","f4cb6530f248e87cefa74ef623206fec805f6252f885f8e14ef3d1a5872cef2d","38c332caadd8391566552395d592076470a5e7423f70964620eabf05c02907cd","eb17b5bf1fc763a644c21d76572c0e41e351c3f6dfcde649428d5d829f7294d2","cb124162c87b29ff5121e3ee5bb29c782f101e0135d6c2644ab1b31d530a435e","406d6f5d3707c488362fb40d1c1f8a7b0a42b70554b427160185d93e430228f5","2e9776410c5bc290d9432a9215c67398a273e514a79b9e15f32ecddfde8a03be","313ff8df074b81d3e4f088ff3a3a06df3d9b0d0c7f55469ccc2ac887ecb6b867","c718475bca06806cc243e77777641cb67ba68f2c57321a4773ebb47760a3bcf2","96e6bf811343caab5112b68880905c5d20d9257054afac6c18e718a4c549ed27","a2793bc73ba63ca7d259cb0f0b61d0023820170d08a1f9715006c8042d060165","d5011b38165771fdf75a9a06d6d379a1fc7edd7eb695ebdc52319fb6e3c6d81f","88417fb19d339304e9616a38ea513251047c9e300c81f9467fc317df8a582e71","3e8e2d132f726dddbda57819f5391504e585cb3beab6b32203064e7e40618583","6e23627cd3f10418b5b2db102fdcf557b75f2837f266d88afac6b18f333bb1bc","866046dcea88f23d766a65487ee7870c4cf8285a4c75407c80a5c26ed250ef8d","019f4f1cbc781cc15c6173f8be5ef907405722194ab297127b3c3426e5368339","41f4413eac08210dfc1b1cdb5891ad08b05c79f5038bdf8c06e4aedaa85b943d","c79f1c8b51d8475dde8d2973f740f43ca34b1f0a95d93649cd76c1ee20abba19","35f0d2bd2c5c05c0cb19095bf5b7c44365b1c88efe6285370855b90417277a64","8264b129f4c4eb4799703f8e5ee2223a184d1cdbfc782158b1f40a88a4435a1f","527ddda6f8be1279f3294714534c49d6e90f238cea325519882ebf88d7ec5bd2","b23877792e8bd00271d0ec5d401b68e4228540a4316de3d9dfb697b955c161a4","35b2eb1de01633db90d41abe93730b29984856fcc840b4c2801bfd3761a2097b","95f0c9127b879c2fc7e31f8e09ff45bb4aae302e60f4b9ceaf4d9ee6bc51ec66","2a6b4655a6edce9e07c7d826848f72533c9991d40bc36e3f85558ad20e87ce2d","6e3d29fdc96ebbb2ac672d2dae710c689c1ea0d0e9469e0847616f3c38fd085f","d505055b8fadd42da235c85947911d8d198ad70c5f5775991e7821d4f89c90f5","8b5a5852099dca7d7e7a7cef6d681dc1586aafacdb963ca180fe5cabbfa3a24b","0d1aa3341d1ad2064adada71c5d01a2f572e4aac09410e5616d90894105a0eb9","52494ca5a884da3bf11b8165ab31429715f0970d9c6383240c5666f4bd713e01","162fafa2291749df2ab4516854aa781fcee1d9fca2ecd85fb48ae794c0700ce2","b4b9b51ee6f6309cda2e539245235a8caeca2b1d6bf12b5e5c162d17333c450f","d2ffe8356f060b88c1c5cf1fa874a4b779fb87fd1977084876e8be9eab6bf485","c76053984b39150d00ade365b096a8bc21a4a7f2ee9e0a926711b00f8e7bf701","956b510767e3d6f362ea5800510635197723737af5d19ae07ee987ea4a90bfa5","cd1a8ff61f5063d7e6e2094e25d35c90b499961b63911f2f4ae0ff5555c2b4d7","1cf09b5945779e9bc75c4dcd805fb149c28fc90da3335186ef620647a3c540e1","9cdc0b9a313090ec45b34ea1eb02fbace433f509e753634b043e9b83038261e6","c93474cff0088351a65d3cad24037874a26a5371a48528563e56efe31cb3d8bb","b4580df8ea7f62d7b06588001952bf69426e6b03cf3d2569f5f608e45f29ba08","de27f7bb9be9d8a2b4557ec6503b8a315f74d598ce9a0ab81b5ed5610e1a8e81","fe3c378dcefa7ed8b21bd6822f5d7838b1119836da75ae1e1fb485d27b8ffb62","7365bf3333d4277b6fe374ed055624e5ec080dbb919e2d78f1cb75a3f1a4b4f6","a5fbf3bc5c16ab5c84465ba7a043a4bee4c2b20bd3633d50d80118a3844edbaf","0923e4ac8c894ad507bd2daee0df66b699de88467201381ece011ba5a080e1ff","e4f6626f827ea509255647e1b6db82145a2eb1a6b46202655e7d9bb19145c33b","26e23972c40f378f0301d8d7025ea895557c2865a1a31c8ea9c3fff0dbc27075","bfddbff94132b423ad1d71bdbefb1d388c21a74ac1a8742df9324e5bf6109058","a928a783c18f57164c154b56501121f3725016f46ba48750b8fc61b2c7ecfde3","9a4e44028bdad7131c8bc4d2dd6b11c96c73720984ef0fa5862770ac924f698e","73b70caa5e573babbd422dadbdd9fffe7d0561fa5dde7390f7eacba7928353c1","7c910133015e22b8860634faf0706388c67b6a4241aef018af83f477bc753f25","6e805ad67e05df4251ba7b536e33bc88b9223340e6c04356060c13c613803d8b","be5fdd78c5818f3a1f91c5ba49505c30289b3a343dd527fcd322e7294f82b570","25bc80fdce8d0c51cc70575e64f0cd4bbc07c29574dfd850eb0e7058e71f9412","2a067faa9c770827d6217677ba8e483341571271ab8a1953566061742d7c09fc","f4cd742d89e118e5846ae09c61ba59772f9ca993bdc164f2166c8ca354e53676","e6c964223ca3a4fc0ca2921455e18e6b11dd1f9ac88c6d83c3a814b3ac556a42","0d5f2f526a48952639da8e5d8cfaaa36ccbbe20cd97ae2f430cf67869a98b508","b582de0d5211b094b4faccc7994cbebd056d583a86f4388e311b4c3f5c9a57e4","3cf40945704725d08f75cbb0476c318cd0a6af32882ddc70656063d68ce89f1c","8bf2fb20a845b4e13f6c97d0b57b1ea520661710b9660046e24113a1e3100848",{"version":"3a1723be4d02c58f5e89c3cdb8e1e2111bdda02e9f00eb8fe4b3139311a686e3","signature":"72bae06f7e6667a78d55f8e8c2026ca56f4d46b476b69ab91a0c082d6f037ff0"},{"version":"264912fff16684a4ee1974b54b24508434e5675785c78a79e1695d85fe67ba8e","signature":"68f43236e401933fe7a12bf71375b10c6d00e70e0082ead24e5c9edc0dec8b13"},{"version":"daa9e5946887a45381b8f186953ec83e8c8fd15156fe9dfbb8e2af9199055272","signature":"593708b4eb66dd36df9778838f0a9b26ba184ddd4f2fab7f1346372da9e64cd3"},{"version":"be0baeb214e83d69730c61ead47f58b59849cc513bcc44e1c6a0eac48a4fcc39","signature":"fec87b56647a9684145542ea67012fbf2592e162aec8e03c70b515516d86f990"},{"version":"1dda020ecc0f815240f5c575d6a847645897dcaea8069df075e32c402ddc11b9","signature":"a49ea0723c051f8139dc1791cd046171bb5befaa3dbee79fb3e68e37f6963bf1"},{"version":"3e98a5db65225ee7fd9d72e3b0b03567f21696f8fec5a59a870adcfbbfb9ec88","signature":"f75c7928d03c2acfcbaec940936b56c8b23bd3002f4cbd13192bf4388494f508"},{"version":"6bcbba6491ef2d069b2a41fb874ca686b9cd0d0af5f4cf845ab0934e1e5d630e","signature":"39cf2e55d905e66d276a7ee7f37fb53f91ad2a09ec7f8ff9695258356f1a6ca0"},{"version":"a58d4251be1368e523491385d80a24a645e9e9878a1a66eb871b6ff3a77bc57d","signature":"e4d40a0e7e735a3c8e9b5be1b3b363519ccd9b844f751ee36faa926a10e6e8cd"},{"version":"d79d6bb04f6a02e9cec763cbc73dbabe03f995704c0427e6425ab714d4a6ed33","signature":"7010be4b3519a3cd62da0e2cfeae4e66594d73d6430ac239de9d7a0553866497"},{"version":"f007eff7aa3a4a33b0eda0ae5bc74255a59355eb0f69cd2191c8849714211b3d","signature":"0de8e25b357815950c11fd794ae26f52ec26821fd79911007e42cadd4a334ce8"},{"version":"bbdf156fea2fabed31a569445835aeedcc33643d404fcbaa54541f06c109df3f","affectsGlobalScope":true},"1c29793071152b207c01ea1954e343be9a44d85234447b2b236acae9e709a383","6a386ff939f180ae8ef064699d8b7b6e62bc2731a62d7fbf5e02589383838dea","f5a8b384f182b3851cec3596ccc96cb7464f8d3469f48c74bf2befb782a19de5",{"version":"ef8a481f9f2205fcc287eef2b4e461d2fc16bc8a0e49a844681f2f742d69747e","affectsGlobalScope":true},{"version":"d492e7d8975c42a9bbc54f75cd32b235659c98979ff12c66f03e8e317619e469","signature":"2e0ea6e50c127271bdccb6ec52ad399135c720a39c325d4f5200c28f23657e52"},{"version":"49910cb76322db239f8a034402cd4edeea05209038ba0f0c522963e121774806","signature":"41209affcb01ad84b8556374f992f03c6a0cfd9484f14ceddee69a0cfcc3485f"},{"version":"33f6f9cad6d86a06b20553dafac7cb07b3698d78ad73496fdbccd5855cc31f84","signature":"1e724ed1c80504a3fb56692706eeb29e2a01c6686760971fbf57841f5f57914f"},{"version":"79602d28edfadca559f0aec0aeb9a3d78af4506974263fe6674fd647b1ec4de2","signature":"d648db16aaa9d69e1f46daa54046036b12890d36b06abe023f0fdbb0624f1246"},{"version":"8f937a077b7774eab4b3e9114d31fa1f20106a562aac0bac18a48f2de6c3e10a","signature":"b4e7a48ea1daf9924430593cef040244151a8b71184071084acd56d0b898abd3"},{"version":"52f6acbf461223507e1890d4f512e24f7b3e32171292d9f6738148d23bb60119","signature":"dfc44e6951e9419c3fc987a4f0ab200671c997090613de06d8f97f9b1538c575"},{"version":"66d597dd9b39153cd0b7178f83ee8d6942eef416442f60f5dd28d595b97fa342","signature":"e8b30f8b77aab91d6d3fbcd65ba7b373bc6694c16fcc3ef1b0681ba3195e743a"},"74b0245c42990ed8a849df955db3f4362c81b13f799ebc981b7bec2d5b414a57"],"options":{"declaration":true,"esModuleInterop":true,"jsx":2,"module":1,"noImplicitAny":false,"outDir":"./","skipLibCheck":true,"strict":true,"target":1},"fileIdsList":[[76,82,91,118,119,309,314,315,317,318,321],[76,82,309],[76,82,319,320],[76,82],[76,82,310],[76,82,109,110,111,112,113,114,115,116,310,311,313],[76,82,115],[76,82,86,87,108,109],[76,82,86,87],[76,82,111,112],[76,82,111],[76,82,118,312],[76,82,109,111,118,119,309,311,317],[76,82,118,308],[76,82,317],[76,82,119,309,314,316],[76,82,117,316],[76,82,91,108,117,119,309,314,315],[41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,82],[53,60,69,76,82],[45,53,60,76,82],[69,76,82],[51,53,60,76,82],[53,76,82],[53,69,75,76,82],[53,60,69,75,76,82],[53,54,55,60,69,72,75,76,82],[53,55,72,75,76,82],[51,53,69,76,82],[43,76,82],[53,69,76,82],[67,76,78,82],[49,51,60,69,76,82],[41,76,82],[76,81,82,83],[76],[60,76,82],[66,76,82],[82],[76,82,333,334,335,336],[76,82,84],[34,76,82,84,86,87,91,98],[34,76,82,98,99],[76,82,86,91,98,99],[34,76,82,85,86,91,96,97,98,99,100,101,102,103,104],[76,82,103],[76,82,85,91],[76,82,99],[40,76,82,105,106,107],[34,35,76,82],[35,36,37,38,39,76,82],[34,76,82],[34,40,76,82,85,98,99,101,102],[76,82,87,90],[76,82,86,87,88,89],[76,82,86],[33,34,76,82,84,85],[33,34,76,82,88,89,93,94,95],[33,76,82],[76,82,89],[76,82,92],[76,82,87],[40,76,82,86,91,96,98,99,103],[76,82,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,136,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,176,177,178,179,180,181,182,183,184,185,187,189,190,191,192,193,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,239,240,241,243,252,254,255,256,257,258,259,261,262,264,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307],[76,82,165],[76,82,121,124],[76,82,123],[76,82,123,124],[76,82,120,121,122,124],[76,82,121,123,124,281],[76,82,124],[76,82,120,123,165],[76,82,123,124,281],[76,82,123,289],[76,82,121,123,124],[76,82,133],[76,82,156],[76,82,177],[76,82,123,124,165],[76,82,124,172],[76,82,123,124,165,183],[76,82,123,124,183],[76,82,124,224],[76,82,124,165],[76,82,120,124,242],[76,82,120,124,243],[76,82,265],[76,82,249,251],[76,82,260],[76,82,249],[76,82,120,124,242,249,250],[76,82,242,243,251],[76,82,263],[76,82,120,124,249,250,251],[76,82,122,123,124],[76,82,120,124],[76,82,121,123,243,244,245,246],[76,82,165,243,244,245,246],[76,82,243,245],[76,82,123,244,245,247,248,252],[76,82,120,123],[76,82,124,267],[76,82,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,166,167,168,169,170,171,173,174,175,176,177,178,179,180,181,182,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240],[76,82,253],[76,82,323,329,337],[76,82,323,324,325,326,327,328,329,330,332,338,339,340,341,342],[76,82,108,323,329,330],[76,82,108,329,331],[76,82,108,322,328,329,331,332,339],[76,82,99,108,118,322,323,327,328,329,330,331],[40,76,82,108,322,323,328,331,332],[76,82,108,328,329,331,332,339],[76,82,324,325,326,330],[76,82,329],[40,76,82,96,108],[76,82,108,316,322,323,324,325,326,327,329,330],[76,82,323,327,328,329,331,332,340],[323,337],[323,324,325,326,327,328,329,330,332,338,339,340,341,342],[108,323,330],[328],[99,108,118,322,323,327,328],[108,323,328],[324,325,326,330],[329],[40,96,108],[108,316,322,323,324,325,326,327,329,330],[323,327,328]],"referencedMap":[[322,1],[320,2],[321,3],[319,4],[119,4],[311,5],[310,4],[314,6],[116,7],[115,4],[110,8],[109,9],[113,10],[112,4],[111,4],[114,11],[313,12],[312,13],[309,14],[315,4],[318,15],[317,16],[118,17],[117,4],[316,18],[42,4],[43,4],[81,19],[44,4],[45,20],[46,21],[47,4],[48,4],[49,22],[50,23],[51,4],[52,24],[53,4],[54,25],[41,4],[55,26],[56,27],[57,28],[58,24],[59,4],[60,29],[61,4],[62,4],[63,30],[64,4],[65,4],[66,4],[67,31],[68,32],[69,24],[70,4],[71,4],[72,33],[73,4],[83,34],[84,35],[82,36],[74,37],[75,38],[76,39],[77,4],[78,4],[79,31],[80,22],[335,4],[333,4],[337,40],[345,4],[336,4],[92,41],[334,4],[99,42],[101,43],[100,44],[105,45],[106,46],[98,47],[107,4],[102,48],[108,49],[37,50],[36,50],[40,51],[35,52],[39,50],[38,50],[103,53],[91,54],[90,55],[87,56],[85,50],[86,57],[33,4],[89,4],[94,4],[96,58],[34,59],[95,60],[93,61],[88,4],[97,62],[104,63],[308,64],[281,4],[259,65],[257,65],[307,66],[272,67],[271,67],[172,68],[123,69],[279,68],[280,68],[282,70],[283,68],[284,71],[183,72],[285,68],[256,68],[286,68],[287,73],[288,68],[289,67],[290,74],[291,68],[292,68],[293,68],[294,68],[295,67],[296,68],[297,68],[298,68],[299,68],[300,75],[301,68],[302,68],[303,68],[304,68],[305,68],[122,66],[125,71],[126,71],[127,68],[128,71],[129,71],[130,71],[131,71],[132,68],[134,76],[135,71],[133,71],[136,71],[137,71],[138,71],[139,71],[140,71],[141,71],[142,68],[143,71],[144,71],[145,71],[146,71],[147,71],[148,68],[149,71],[150,68],[151,71],[152,71],[153,71],[154,71],[155,68],[157,77],[156,71],[158,71],[159,71],[160,71],[161,71],[162,75],[163,68],[164,68],[178,78],[166,79],[167,71],[168,71],[169,68],[170,71],[171,71],[173,80],[174,71],[175,71],[176,71],[177,71],[179,71],[180,71],[181,71],[182,71],[184,81],[185,71],[186,71],[187,71],[188,68],[189,71],[190,82],[191,82],[192,82],[193,68],[194,71],[195,71],[196,71],[201,71],[197,71],[198,68],[199,71],[200,68],[202,68],[203,71],[204,71],[205,68],[206,68],[207,71],[208,68],[209,71],[210,71],[211,68],[212,71],[213,71],[214,71],[215,71],[216,71],[217,71],[218,71],[219,71],[220,71],[221,71],[222,71],[223,71],[224,71],[225,83],[226,71],[227,71],[228,71],[229,71],[230,71],[231,71],[232,68],[233,68],[234,68],[235,68],[236,68],[237,71],[238,71],[239,71],[240,71],[258,84],[306,68],[243,85],[242,86],[266,87],[265,88],[261,89],[260,88],[262,90],[251,91],[249,92],[264,93],[263,90],[250,41],[252,94],[165,95],[121,96],[120,71],[255,4],[247,97],[248,98],[245,4],[246,99],[244,71],[253,100],[124,101],[273,4],[274,4],[267,4],[270,67],[269,4],[275,4],[276,4],[268,102],[277,4],[278,4],[241,103],[254,104],[1,4],[7,4],[11,4],[10,4],[3,4],[12,4],[13,4],[14,4],[15,4],[16,4],[17,4],[18,4],[19,4],[4,4],[5,4],[23,4],[20,4],[21,4],[22,4],[24,4],[25,4],[26,4],[6,4],[27,4],[28,4],[29,4],[30,4],[31,4],[2,4],[32,4],[9,4],[8,4],[344,4],[338,105],[343,106],[331,107],[342,108],[340,109],[332,110],[329,111],[341,112],[327,113],[330,114],[324,4],[323,115],[325,4],[328,116],[326,4],[339,117]],"exportedModulesMap":[[322,1],[320,2],[321,3],[319,4],[119,4],[311,5],[310,4],[314,6],[116,7],[115,4],[110,8],[109,9],[113,10],[112,4],[111,4],[114,11],[313,12],[312,13],[309,14],[315,4],[318,15],[317,16],[118,17],[117,4],[316,18],[42,4],[43,4],[81,19],[44,4],[45,20],[46,21],[47,4],[48,4],[49,22],[50,23],[51,4],[52,24],[53,4],[54,25],[41,4],[55,26],[56,27],[57,28],[58,24],[59,4],[60,29],[61,4],[62,4],[63,30],[64,4],[65,4],[66,4],[67,31],[68,32],[69,24],[70,4],[71,4],[72,33],[73,4],[83,34],[84,35],[82,36],[74,37],[75,38],[76,39],[77,4],[78,4],[79,31],[80,22],[335,4],[333,4],[337,40],[345,4],[336,4],[92,41],[334,4],[99,42],[101,43],[100,44],[105,45],[106,46],[98,47],[107,4],[102,48],[108,49],[37,50],[36,50],[40,51],[35,52],[39,50],[38,50],[103,53],[91,54],[90,55],[87,56],[85,50],[86,57],[33,4],[89,4],[94,4],[96,58],[34,59],[95,60],[93,61],[88,4],[97,62],[104,63],[308,64],[281,4],[259,65],[257,65],[307,66],[272,67],[271,67],[172,68],[123,69],[279,68],[280,68],[282,70],[283,68],[284,71],[183,72],[285,68],[256,68],[286,68],[287,73],[288,68],[289,67],[290,74],[291,68],[292,68],[293,68],[294,68],[295,67],[296,68],[297,68],[298,68],[299,68],[300,75],[301,68],[302,68],[303,68],[304,68],[305,68],[122,66],[125,71],[126,71],[127,68],[128,71],[129,71],[130,71],[131,71],[132,68],[134,76],[135,71],[133,71],[136,71],[137,71],[138,71],[139,71],[140,71],[141,71],[142,68],[143,71],[144,71],[145,71],[146,71],[147,71],[148,68],[149,71],[150,68],[151,71],[152,71],[153,71],[154,71],[155,68],[157,77],[156,71],[158,71],[159,71],[160,71],[161,71],[162,75],[163,68],[164,68],[178,78],[166,79],[167,71],[168,71],[169,68],[170,71],[171,71],[173,80],[174,71],[175,71],[176,71],[177,71],[179,71],[180,71],[181,71],[182,71],[184,81],[185,71],[186,71],[187,71],[188,68],[189,71],[190,82],[191,82],[192,82],[193,68],[194,71],[195,71],[196,71],[201,71],[197,71],[198,68],[199,71],[200,68],[202,68],[203,71],[204,71],[205,68],[206,68],[207,71],[208,68],[209,71],[210,71],[211,68],[212,71],[213,71],[214,71],[215,71],[216,71],[217,71],[218,71],[219,71],[220,71],[221,71],[222,71],[223,71],[224,71],[225,83],[226,71],[227,71],[228,71],[229,71],[230,71],[231,71],[232,68],[233,68],[234,68],[235,68],[236,68],[237,71],[238,71],[239,71],[240,71],[258,84],[306,68],[243,85],[242,86],[266,87],[265,88],[261,89],[260,88],[262,90],[251,91],[249,92],[264,93],[263,90],[250,41],[252,94],[165,95],[121,96],[120,71],[255,4],[247,97],[248,98],[245,4],[246,99],[244,71],[253,100],[124,101],[273,4],[274,4],[267,4],[270,67],[269,4],[275,4],[276,4],[268,102],[277,4],[278,4],[241,103],[254,104],[1,4],[7,4],[11,4],[10,4],[3,4],[12,4],[13,4],[14,4],[15,4],[16,4],[17,4],[18,4],[19,4],[4,4],[5,4],[23,4],[20,4],[21,4],[22,4],[24,4],[25,4],[26,4],[6,4],[27,4],[28,4],[29,4],[30,4],[31,4],[2,4],[32,4],[9,4],[8,4],[338,118],[343,119],[331,120],[340,121],[332,122],[329,123],[341,121],[327,124],[330,125],[323,126],[328,127],[339,128]],"semanticDiagnosticsPerFile":[322,320,321,319,119,311,310,314,116,115,110,109,113,112,111,114,313,312,309,315,318,317,118,117,316,42,43,81,44,45,46,47,48,49,50,51,52,53,54,41,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,83,84,82,74,75,76,77,78,79,80,335,333,337,345,336,92,334,99,101,100,105,106,98,107,102,108,37,36,40,35,39,38,103,91,90,87,85,86,33,89,94,96,34,95,93,88,97,104,308,281,259,257,307,272,271,172,123,279,280,282,283,284,183,285,256,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,122,125,126,127,128,129,130,131,132,134,135,133,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,157,156,158,159,160,161,162,163,164,178,166,167,168,169,170,171,173,174,175,176,177,179,180,181,182,184,185,186,187,188,189,190,191,192,193,194,195,196,201,197,198,199,200,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,258,306,243,242,266,265,261,260,262,251,249,264,263,250,252,165,121,120,255,247,248,245,246,244,253,124,273,274,267,270,269,275,276,268,277,278,241,254,1,7,11,10,3,12,13,14,15,16,17,18,19,4,5,23,20,21,22,24,25,26,6,27,28,29,30,31,2,32,9,8,344,338,343,331,342,340,332,329,341,327,330,324,323,325,328,326,339]},"version":"4.8.4"} \ No newline at end of file diff --git a/src/lib/checks.ts b/src/lib/checks.ts new file mode 100644 index 000000000..02c0988ec --- /dev/null +++ b/src/lib/checks.ts @@ -0,0 +1,113 @@ +import { Account, Near } from "near-api-js"; +import { FCData } from "./types/fc"; +import BN from 'bn.js'; +import { getEnv } from "./keypom"; +import { Funder } from "./types/general"; + +export function isValidAccountObj(o: Account | undefined): o is Account { + if (o) { + return (o as Account).connection !== undefined && (o as Account).accountId !== undefined; + } + + return true +} + +export function isValidNearObject(o: Near): o is Near { + return (o as Near).connection !== undefined && (o as Near).config !== undefined && (o as Near).accountCreator !== undefined; +} + +export function isValidFunderObject(o: Funder): o is Funder { + return (o as Funder).accountId !== undefined && (o as Funder).secretKey !== undefined; +} + +export const assert = (exp, m) => { + if (!exp) { + throw new Error(m); + } +} + +export const assertValidDropConfig = (config: { + uses_per_key?: number, + time?: { + start?: number, + end?: number, + throttle?: number, + interval?: number, + }, + usage?: { + permission?: string, + refund_deposit?: boolean, + auto_delete_drop?: boolean, + auto_withdraw?: boolean + }, + root_account_id?: string, +}) => { + assert((config?.uses_per_key || 1) != 0, "Cannot have 0 uses per key for a drop config"); + + if (config?.usage?.permission) { + assert(config.usage.permission == "create_account_and_claim" || config.usage.permission == "claim", "Invalid permission type for usage. Must be 'create_account_and_claim' or 'claim'"); + } + + if (config?.time) { + const currentBlockTimestamp = Date.now() * 1e6; + + assert( + (config.time.interval != undefined && config.time.start != undefined) == false, + "If you want to set a claim interval, you must also set a start timestamp" + ); + assert( + (config.time.start || currentBlockTimestamp) >= currentBlockTimestamp, + "The start timestamp must be greater than the current block timestamp" + ); + assert!( + (config.time.end || currentBlockTimestamp) >= currentBlockTimestamp, + "The end timestamp must be greater than the current block timestamp" + ); + + if (config.time.start != undefined && config.time.end != undefined) { + assert( + config.time.start < config.time.end, + "The start timestamp must be less than the end timestamp" + ); + } + } +} + +export const assertValidFCData = (fcData: FCData | undefined, depositPerUse: string, usesPerKey: number) => { + if (fcData?.config?.attachedGas) { + assert(depositPerUse == "0", "Cannot specify gas to attach and have a balance in the linkdrop") + assert(new BN(fcData.config.attachedGas).lte(new BN("80000000000000")), "Cannot have 0 attached gas"); + } + + if (fcData?.methods) { + const numMethodData = fcData.methods.length; + + if (usesPerKey == 1) { + assert(numMethodData == 1, "Cannot have more Method Data than the number of uses per key"); + } + else if (usesPerKey > 1) { + assert(numMethodData == usesPerKey, "Number of FCs must match number of uses per key if more than 1 is specified"); + } + + if (usesPerKey > 1 && numMethodData == 1) { + assert(fcData.methods[0] != undefined, "cannot have a single none function call"); + } + } +} + +export const assertDropIdUnique = async (dropId: string) => { + const { + viewAccount, contractId + } = getEnv() + + try { + const dropInfo = await viewAccount.viewFunction2({ + contractId, + methodName: 'get_drop_information', + args: { + drop_id: dropId + } + }) + assert(!dropInfo, `Drop with ID ${dropId} already exists. Please use a different drop ID.`); + } catch(_) {} +} \ No newline at end of file diff --git a/src/lib/claims.ts b/src/lib/claims.ts index a945fb25a..426c1a5a2 100644 --- a/src/lib/claims.ts +++ b/src/lib/claims.ts @@ -1,4 +1,5 @@ import * as nearAPI from "near-api-js"; +import { assert } from "./checks"; const { KeyPair, } = nearAPI; @@ -111,23 +112,15 @@ export const claim = async ({ password, }) => { const { - networkId, keyStore, attachedGas, contractId, contractAccount, receiverId, execute, fundingAccountDetails, + networkId, keyStore, attachedGas, contractId, contractAccount, receiverId, execute, fundingAccountDetails, near, } = getEnv() - if (!keyStore) { - throw new Error('Keypom SDK is not initialized. Please call `initKeypom`.') - } - + assert(near && networkId && keyStore, 'Keypom SDK is not initialized. Please call `initKeypom`.') const keyPair = KeyPair.fromString(secretKey) - await keyStore.setKey(networkId!, contractId, keyPair) - - if (newAccountId && !newPublicKey) { - throw new Error('If creating a new account, a newPublicKey must be passed in.') - } + await keyStore!.setKey(networkId!, contractId!, keyPair) - if (!newAccountId && !accountId) { - throw new Error('Either an accountId or newAccountId must be passed in.') - } + assert(!newAccountId || newPublicKey, 'If creating a new account, a newPublicKey must be passed in.') + assert(newAccountId || accountId, 'Either an accountId or newAccountId must be passed in.') const transactions: any[] = [{ receiverId, diff --git a/src/lib/drops.ts b/src/lib/drops.ts index 856296188..924813e7d 100644 --- a/src/lib/drops.ts +++ b/src/lib/drops.ts @@ -12,8 +12,10 @@ import { estimateRequiredDeposit, ftTransferCall, generateKeys, generatePerUsePasswords, getStorageBase, key2str, keypomView, nftTransferCall, parseFTAmount, toCamel } from "./keypom-utils"; -import { CreateDropParams, CreateDropProtocolArgs, CreateOrAddReturn, DeleteDropParams, GetDropParams } from './types/params'; +import { CreateDropParams, CreateDropProtocolArgs, CreateOrAddReturn, DeleteDropParams, GetDropParams, RegisterUsesParams } from './types/params'; import { getDropInformation, getUserBalance } from './views'; +import { assert, assertDropIdUnique, assertValidDropConfig, assertValidFCData, isValidAccountObj } from './checks'; +import { Account } from 'near-api-js'; export const KEY_LIMIT = 50; @@ -171,11 +173,10 @@ export const createDrop = async ({ gas, attachedGas, contractId, receiverId, getAccount, execute, fundingAccount, fundingAccountDetails } = getEnv() - if (!near) { - throw new Error('Keypom SDK is not initialized. Please call `initKeypom`.') - } - + assert(near != undefined, 'Keypom SDK is not initialized. Please call `initKeypom`.') + assert(isValidAccountObj(account), 'Passed in account is not a valid account object.') account = getAccount({ account, wallet }) + assert(contractId == "v1-3.keypom.near" || contractId == "v1-3.keypom.testnet", "Only the latest Keypom contract can be used to call this methods. Please update the contract to: v1-3.keypom.near or v1-3.keypom.testnet"); /// parse args if (depositPerUseNEAR) { @@ -184,11 +185,11 @@ export const createDrop = async ({ if (!depositPerUseYocto) depositPerUseYocto = '0' // Ensure that if the dropID is passed in, it's greater than 1 billion - if (dropId && parseInt(dropId) < 1000000000) { - throw new Error('All custom drop IDs must be greater than 1_000_000_000'); - } + assert(parseInt(dropId || "1000000000") >= 1000000000, 'All custom drop IDs must be greater than 1_000_000_000'); if (!dropId) dropId = Date.now().toString() + await assertDropIdUnique(dropId); + const finalConfig = { uses_per_key: config?.usesPerKey || 1, root_account_id: config?.dropRoot, @@ -201,6 +202,8 @@ export const createDrop = async ({ time: config?.time, } + assertValidDropConfig(finalConfig); + // If there are no publicKeys being passed in, we should generate our own based on the number of keys if (!publicKeys) { var keys; @@ -229,6 +232,8 @@ export const createDrop = async ({ numKeys = publicKeys!.length; let passwords; if (basePassword) { + assert(numKeys <= 50, "Cannot add 50 keys at once with passwords"); + // Generate the passwords with the base password and public keys. By default, each key will have a unique password for all of its uses unless passwordProtectedUses is passed in passwords = await generatePerUsePasswords({ publicKeys: publicKeys!, @@ -249,6 +254,8 @@ export const createDrop = async ({ } } + assertValidFCData(fcData, depositPerUseYocto, finalConfig.uses_per_key); + const createDropArgs: CreateDropProtocolArgs = { drop_id: dropId, public_keys: publicKeys || [], @@ -285,14 +292,19 @@ export const createDrop = async ({ passwords_per_use: passwords } + // If there is no ft data, nft data, or fc data, ensure the deposit per use is greater than 0 + if (createDropArgs.fc === undefined && createDropArgs.ft === undefined && createDropArgs.nft === undefined) { + assert(depositPerUseYocto != "0", "Deposit per use must be greater than 0 for simple drops"); + } + /// estimate required deposit const storageCalculated = getStorageBase(createDropArgs); let requiredDeposit = await estimateRequiredDeposit({ - near, + near: near!, depositPerUse: depositPerUseYocto, numKeys, usesPerKey: finalConfig.uses_per_key, - attachedGas: parseInt(attachedGas), + attachedGas: parseInt(attachedGas!), storage: storageCalculated, ftData, fcData, @@ -313,28 +325,25 @@ export const createDrop = async ({ let transactions: Transaction[] = [] transactions.push({ - receiverId, + receiverId: receiverId!, signerId: account!.accountId, // We know this is not undefined since getAccount throws actions: [{ type: 'FunctionCall', params: { methodName: 'create_drop', args: createDropArgs, - gas, + gas: gas!, deposit, } }] }) if (ftData?.contractId && publicKeys?.length) { - transactions.push(ftTransferCall({ + transactions.push(await ftTransferCall({ account: account!, contractId: ftData.contractId, - args: { - receiver_id: contractId, - amount: new BN(ftBalancePerUse!).mul(new BN(publicKeys.length)).toString(), - msg: dropId.toString(), - }, + absoluteAmount: new BN(ftBalancePerUse!).mul(new BN(numKeys)).mul(new BN(finalConfig.uses_per_key)).toString(), + dropId, returnTransaction: true }) as Transaction) } @@ -347,9 +356,8 @@ export const createDrop = async ({ const nftTXs = await nftTransferCall({ account: account!, contractId: nftData.contractId as string, - receiverId: contractId, tokenIds, - msg: dropId.toString(), + dropId: dropId.toString(), returnTransactions: true }) as Transaction[] transactions = transactions.concat(nftTXs) @@ -415,11 +423,14 @@ export const deleteDrops = async ({ withdrawBalance = true, }: DeleteDropParams) => { const { - gas300, receiverId, execute, getAccount + gas300, receiverId, execute, getAccount, } = getEnv() - + + assert(receiverId == "v1-3.keypom.near" || receiverId == "v1-3.keypom.testnet", "Only the latest Keypom contract can be used to call this methods. Please update the contract to: v1-3.keypom.near or v1-3.keypom.testnet"); + + assert(isValidAccountObj(account), 'Passed in account is not a valid account object.') account = getAccount({ account, wallet }); - + // If the drop information isn't passed in, we should get it from the drop IDs if (!drops) { if (!dropIds) {throw new Error('Must pass in either drops or dropIds')}; @@ -431,12 +442,15 @@ export const deleteDrops = async ({ } const responses = await Promise.all(drops.map(async ({ + owner_id, drop_id, keys, registered_uses, ft, nft, }) => { + assert(owner_id == account!.accountId, 'Only the owner of the drop can delete drops.'); + let keySupply = keys?.length || 0 const updateKeys = async () => { @@ -541,4 +555,29 @@ export const deleteDrops = async ({ return responses } -// TODO: add register & unregister uses \ No newline at end of file + +// This should be done later. Very small number of drops will have lazy registrations enabled. +// /** +// * Allows a user to register uses for a simple drop that has lazy registrations enabled. This drop can be over-registered. +// * +// * @param {Account=} account (OPTIONAL) If specified, the passed in account will be used to sign the txn instead of the funder account. +// * @param {BrowserWalletBehaviour=} wallet (OPTIONAL) If using a browser wallet through wallet selector and that wallet should sign the transaction, pass it in. +// * @param {string[]=} dropId Specify the drop ID of the drop you want to register uses on +// * +// * @example Create 5 drops and delete each of them +// * ```js +// * ``` +// */ +// export const registerUses = async ({ +// account, +// wallet, +// dropId, +// numUses, +// useBalance = false, +// }: RegisterUsesParams) => { +// const { +// gas300, receiverId, execute, getAccount +// } = getEnv() + +// account = getAccount({ account, wallet }); +// } diff --git a/src/lib/keypom-utils.ts b/src/lib/keypom-utils.ts index fc22356c9..27396953a 100644 --- a/src/lib/keypom-utils.ts +++ b/src/lib/keypom-utils.ts @@ -6,6 +6,7 @@ import * as nearAPI from 'near-api-js'; import { Account, Near, transactions } from "near-api-js"; import { SignAndSendTransactionOptions } from "near-api-js/lib/account"; import { generateSeedPhrase } from 'near-seed-phrase'; +import { assert, isValidAccountObj } from "./checks"; import { getEnv } from "./keypom"; import { PasswordPerUse } from "./types/drops"; import { FCData } from "./types/fc"; @@ -132,9 +133,7 @@ export const generateKeys = async ({numKeys, rootEntropy, metaEntropy}: Generate // Ensure that if metaEntropy is provided, it should be the same length as the number of keys const numEntropy = metaEntropy?.length || numKeys; - if (numEntropy != numKeys) { - throw new Error(`You must provide the same number of meta entropy values as the number of keys`) - } + assert(numEntropy == numKeys, `You must provide the same number of meta entropy values as the number of keys`) var keyPairs: NearKeyPair[] = [] var publicKeys: string[] = [] @@ -192,6 +191,7 @@ export const getUserBalance = async ({ accountId }: {accountId: string}): Promise => { const { contractId, viewAccount } = getEnv() + assert(viewAccount, 'initKeypom must be called before view functions can be called.'); return viewAccount.viewFunction2({ contractId, methodName: 'get_user_balance', args: { account_id: accountId }}) } @@ -200,9 +200,7 @@ export const keypomView = async ({ methodName, args }) => { viewAccount, contractId, } = getEnv() - if (!viewAccount) { - throw new Error('initKeypom must be called before view functions can be called.') - } + assert(viewAccount, 'initKeypom must be called before view functions can be called.'); return viewAccount!.viewFunction2({ contractId, @@ -239,7 +237,6 @@ export const execute = async ({ wallet, fundingAccount, }: ExecuteParams): Promise> => { - const { contractId, } = getEnv() @@ -268,28 +265,78 @@ export const execute = async ({ /// instance of NEAR Account (backend usage) const nearAccount = account || fundingAccount - if (!nearAccount) { - throw new Error(`Call with either a NEAR Account argument 'account' or initialize Keypom with a 'fundingAccount'`) - } + assert(nearAccount,`Call with either a NEAR Account argument 'account' or initialize Keypom with a 'fundingAccount'`) return await signAndSendTransactions(nearAccount, transformTransactions( transactions)) } -// TODO: Document this -export const ftTransferCall = ({ +/** + * For FT Drops, keys need to be registered before they can be used. This is done via the `ft_transfer_call` method on the FT contract. + * This is a convenience method to make that process easier. + * + * @param {Account=} account (OPTIONAL) If specified, the passed in account will be used to sign the txn instead of the funder account. + * @param {BrowserWalletBehaviour=} wallet (OPTIONAL) If using a browser wallet through wallet selector and that wallet should sign the transaction, pass it in. + * @param {string} contractId The fungible token contract ID. + * @param {string} absoluteAmount Amount of tokens to transfer but considering the decimal amount (non human-readable). + Example: transferring one wNEAR should be passed in as "1000000000000000000000000" and NOT "1" + * @param {string} amount Human readable format for the amount of tokens to transfer. + Example: transferring one wNEAR should be passed in as "1" and NOT "1000000000000000000000000" + * @param {string} dropId The drop ID to register the keys for. + * @param {boolean=} returnTransaction (OPTIONAL) If true, the transaction will be returned instead of being signed and sent. + * + * @example Send FTs using the funder account (not passing in any accounts into the call) + * * ```js + * // Initialize the SDK on testnet + * await initKeypom({ + * network: "testnet", + * funder: { + * accountId: "benji_demo.testnet", + * secretKey: "ed25519:5yARProkcALbxaSQ66aYZMSBPWL9uPBmkoQGjV3oi2ddQDMh1teMAbz7jqNV9oVyMy7kZNREjYvWPqjcA6LW9Jb1" + * } + * }); + * + * await ftTransferCall({ + * contractId: "ft.keypom.testnet", + * amount: "1", + * dropId: "1231231", + * )}; + * ``` +*/ +export const ftTransferCall = async ({ account, + wallet, contractId, - args, + absoluteAmount, + amount, + dropId, returnTransaction = false, -}: FTTransferCallParams): Promise | Transaction => { +}: FTTransferCallParams): Promise | Transaction> => { + const { getAccount, near, receiverId: keypomContractId, viewAccount } = getEnv(); + assert(near != undefined, 'Keypom SDK is not initialized. Please call `initKeypom`.') + assert(isValidAccountObj(account), 'Passed in account is not a valid account object.') + account = getAccount({ account, wallet }) + + if (amount) { + const metadata = await viewAccount.viewFunction2({ + contractId, + methodName: 'ft_metadata', + }) + + absoluteAmount = parseFTAmount(amount, metadata.decimals); + } + const tx: Transaction = { receiverId: contractId, - signerId: account.accountId, + signerId: account!.accountId, actions: [{ type: 'FunctionCall', params: { methodName: 'ft_transfer_call', - args, + args: { + receiver_id: keypomContractId, + amount: absoluteAmount, + msg: dropId.toString() + }, gas: '50000000000000', deposit: '1', } @@ -297,27 +344,53 @@ export const ftTransferCall = ({ } if (returnTransaction) return tx - return execute({ account, transactions: [tx]}) as Promise + return execute({ account: account!, transactions: [tx]}) as Promise } -// TODO: Document this +/** + * For NFT Drops, keys need to be registered before they can be used. This is done via the `nft_transfer_call` method on the NFT contract. + * This is a convenience method to make that process easier. + * + * @param {Account=} account (OPTIONAL) If specified, the passed in account will be used to sign the txn instead of the funder account. + * @param {BrowserWalletBehaviour=} wallet (OPTIONAL) If using a browser wallet through wallet selector and that wallet should sign the transaction, pass it in. + * @param {string} contractId The fungible token contract ID. + * @param {string[]} tokenIds A set of token IDs that should be sent to the Keypom contract in order to register keys. + * @param {string} dropId The drop ID to register the keys for. + * @param {boolean=} returnTransaction (OPTIONAL) If true, the transaction will be returned instead of being signed and sent. + * + * @example Send 3 NFTs using the funder account (not passing in any accounts into the call) + * * ```js + * // Initialize the SDK on testnet + * await initKeypom({ + * network: "testnet", + * funder: { + * accountId: "benji_demo.testnet", + * secretKey: "ed25519:5yARProkcALbxaSQ66aYZMSBPWL9uPBmkoQGjV3oi2ddQDMh1teMAbz7jqNV9oVyMy7kZNREjYvWPqjcA6LW9Jb1" + * } + * }); + * + * await nftTransferCall({ + * contractId: "nft.keypom.testnet", + * tokenIds: ["1", "2", "3], + * dropId: "1231231", + * )}; + * ``` +*/ export const nftTransferCall = async ({ account, wallet, contractId, - receiverId, tokenIds, - msg, + dropId, returnTransactions = false, }: NFTTransferCallParams): Promise | Transaction[]> => { - const { getAccount } = getEnv(); - + const { getAccount, near, receiverId } = getEnv(); + assert(near != undefined, 'Keypom SDK is not initialized. Please call `initKeypom`.') + assert(isValidAccountObj(account), 'Passed in account is not a valid account object.') account = getAccount({ account, wallet }) - if (tokenIds.length > 6) { - throw new Error(`This method can only transfer 6 NFTs in 1 batch transaction.`) - } + assert(tokenIds.length < 6, `This method can only transfer 6 NFTs in 1 batch transaction.`) const responses: Array = [] @@ -335,7 +408,7 @@ export const nftTransferCall = async ({ args: { receiver_id: receiverId, token_id: tokenIds[i], - msg + msg: dropId.toString() }, gas: '50000000000000', deposit: '1', @@ -388,7 +461,7 @@ const signAndSendTransactions = async (account: Account, txs: SignAndSendTransac export const transformTransactions = (transactions: SignAndSendTransactionParams[]): SignAndSendTransactionOptions[] => transactions.map(({ receiverId, actions: _actions }) => { const actions = _actions.map((action) => - createAction(action) + createAction(action) ); let txnOption: SignAndSendTransactionOptions = { receiverId: receiverId as string, @@ -576,7 +649,7 @@ export const estimateRequiredDeposit = async ({ } - return requiredDeposit.toString(); + return requiredDeposit.toString() || "0"; }; // Estimate the amount of allowance required for a given attached gas. @@ -655,7 +728,7 @@ const getFtCosts = async (near: Near, numKeys: number, usesPerKey: number, ftCon // console.log('storageBalanceBounds: ', storageBalanceBounds) let costs: BN = new BN(min).mul(new BN(numKeys)).mul(new BN(usesPerKey)).add(new BN(min)); // console.log('costs: ', costs.toString()); - return costs.toString(); + return costs.toString() || "0"; }; /** @@ -735,4 +808,4 @@ export const toCamel = o => { } } return newO - } +} \ No newline at end of file diff --git a/src/lib/keypom.ts b/src/lib/keypom.ts index f607df06e..ce679fc8c 100644 --- a/src/lib/keypom.ts +++ b/src/lib/keypom.ts @@ -13,6 +13,7 @@ import { } from "./keypom-utils"; import { EnvVars, Funder } from "./types/general"; import { InitKeypomParams } from "./types/params"; +import { assert, isValidFunderObject, isValidNearObject } from "./checks"; const gas = '200000000000000' const gas300 = '300000000000000' @@ -34,6 +35,17 @@ const networks = { } } +let officialKeypomContracts = { + mainnet: { + "v1.keypom.near": true, + "v1-3.keypom.near": true + }, + testnet: { + "v1.keypom.testnet": true, + "v1-3.keypom.testnet": true + } +} + let contractBase = 'v1-3.keypom' let contractId = `${contractBase}.testnet` let receiverId = contractId @@ -152,8 +164,10 @@ export const initKeypom = async ({ funder, keypomContractId, }: InitKeypomParams) => { - + assert(network == "testnet" || network == "mainnet", "Network must be either `testnet` or `mainnet`"); + if (_near) { + assert(isValidNearObject(_near), "The NEAR object passed in is not valid. Please pass in a valid NEAR object."); near = _near keyStore = near.config.keyStore } else { @@ -173,6 +187,11 @@ export const initKeypom = async ({ } if (keypomContractId) { + assert(officialKeypomContracts[networkId!][keypomContractId] === true, "The keypom contract passed in must be an official Keypom contract for the given network."); + if (keypomContractId != "v1-3.keypom.near" || keypomContractId != "v1-3.keypom.near") { + console.warn("The Keypom contract you are using is not the latest version. Most methods will be unavailable. Please use the latest contract: v1-3.keypom.near or v1-3.keypom.testnet"); + } + contractId = receiverId = keypomContractId } @@ -225,9 +244,8 @@ export const initKeypom = async ({ export const updateFunder = async ({ funder }:{funder: Funder}) => { - if (near == undefined) { - throw new Error("You must initialize the SDK via `initKeypom` before updating the funder account."); - } + assert(near !== undefined, "You must initialize the SDK via `initKeypom` before updating the funder account.") + assert(isValidFunderObject(funder), "The funder object passed in is not valid. Please pass in a valid funder object."); let { accountId, secretKey, seedPhrase } = funder if (seedPhrase) { @@ -274,9 +292,10 @@ export const updateFunder = async ({ export const updateKeypomContractId = async ({ keypomContractId }:{keypomContractId: string}) => { - - if (near == undefined) { - throw new Error("You must initialize the SDK via `initKeypom` before updating the Keypom contract ID."); + assert(near !== undefined, "You must initialize the SDK via `initKeypom` before updating the Keypom contract ID.") + assert(officialKeypomContracts[networkId!][keypomContractId] === true, "The keypom contract passed in must be an official Keypom contract for the given network."); + if (keypomContractId != "v1-3.keypom.near" || keypomContractId != "v1-3.keypom.near") { + console.warn("The Keypom contract you are using is not the latest version. Most methods will be unavailable. Please use the latest contract: v1-3.keypom.near or v1-3.keypom.testnet"); } contractId = receiverId = keypomContractId diff --git a/src/lib/keys.ts b/src/lib/keys.ts index 895a88fc2..3b97f2743 100644 --- a/src/lib/keys.ts +++ b/src/lib/keys.ts @@ -14,6 +14,7 @@ import { key2str, nftTransferCall, toCamel } from "./keypom-utils"; import { AddKeyParams, CreateOrAddReturn, DeleteKeyParams } from './types/params'; +import { assert, isValidAccountObj } from './checks'; /** * Add keys to a specific drop @@ -147,21 +148,19 @@ export const addKeys = async ({ near, gas, contractId, receiverId, getAccount, execute, fundingAccountDetails } = getEnv() - if (!near) { - throw new Error('Keypom SDK is not initialized. Please call `initKeypom`.') - } - - if (!drop && !dropId) { - throw new Error("Either a dropId or drop object must be passed in.") - } + assert(near != undefined, 'Keypom SDK is not initialized. Please call `initKeypom`.') + assert(isValidAccountObj(account), 'Passed in account is not a valid account object.') + account = getAccount({ account, wallet }) - if (!publicKeys?.length && !numKeys) { - throw new Error("Either pass in publicKeys or set numKeys to a positive non-zero value.") - } + assert(drop || dropId, 'Either a dropId or drop object must be passed in.') + assert(numKeys || publicKeys?.length, "Either pass in publicKeys or set numKeys to a positive non-zero value.") + assert(receiverId == "v1-3.keypom.near" || receiverId == "v1-3.keypom.testnet", "Only the latest Keypom contract can be used to call this methods. Please update the contract to: v1-3.keypom.near or v1-3.keypom.testnet"); account = getAccount({ account, wallet }); + const { drop_id, + owner_id, registered_uses, required_gas, deposit_per_use, @@ -172,6 +171,8 @@ export const addKeys = async ({ next_key_id, } = drop || await getDropInformation({dropId: dropId!}); + assert(owner_id === account!.accountId, 'You are not the owner of this drop. You cannot add keys to it.') + // If there are no publicKeys being passed in, we should generate our own based on the number of keys if (!publicKeys) { var keys; @@ -200,6 +201,8 @@ export const addKeys = async ({ numKeys = publicKeys!.length; let passwords; if (basePassword) { + assert(numKeys <= 50, "Cannot add 50 keys at once with passwords"); + // Generate the passwords with the base password and public keys. By default, each key will have a unique password for all of its uses unless passwordProtectedUses is passed in passwords = await generatePerUsePasswords({ publicKeys: publicKeys!, @@ -212,7 +215,7 @@ export const addKeys = async ({ const camelFCData = toCamel(fcData); let requiredDeposit = await estimateRequiredDeposit({ - near, + near: near!, depositPerUse: deposit_per_use, numKeys, usesPerKey: uses_per_key, @@ -221,14 +224,11 @@ export const addKeys = async ({ fcData: camelFCData, ftData: camelFTData }) - console.log('requiredDeposit: ', requiredDeposit) var hasBalance = false; if(useBalance) { let userBal = await getUserBalance({accountId: account!.accountId}); - if(userBal < requiredDeposit) { - throw new Error(`Insufficient balance on Keypom to create drop. Use attached deposit instead.`); - } + assert(userBal >= requiredDeposit, `Insufficient balance on Keypom to create drop. Use attached deposit instead.`) hasBalance = true; } @@ -253,14 +253,11 @@ export const addKeys = async ({ }) if (ftData.contract_id) { - transactions.push(ftTransferCall({ + transactions.push(await ftTransferCall({ account: account!, contractId: ftData.contract_id, - args: { - receiver_id: contractId, - amount: new BN(ftData.balance_per_use).mul(new BN(numKeys - registered_uses)).toString(), - msg: drop_id.toString(), - }, + absoluteAmount: new BN(ftData.balance_per_use!).mul(new BN(numKeys)).mul(new BN(uses_per_key)).toString(), + dropId: drop_id, returnTransaction: true })) } @@ -271,9 +268,8 @@ export const addKeys = async ({ const nftResponses = await nftTransferCall({ account: account!, contractId: nftData.contract_id, - receiverId: contractId, tokenIds: nftTokenIds, - msg: drop_id.toString(), + dropId: drop_id.toString(), }) responses = responses.concat(nftResponses) } @@ -322,10 +318,15 @@ export const deleteKeys = async ({ }: DeleteKeyParams) => { const { - receiverId, execute, + receiverId, execute, getAccount } = getEnv() + assert(receiverId == "v1-3.keypom.near" || receiverId == "v1-3.keypom.testnet", "Only the latest Keypom contract can be used to call this methods. Please update the contract to: v1-3.keypom.near or v1-3.keypom.testnet"); - const { drop_id, registered_uses, ft, nft } = await getDropInformation({ dropId }) + const { owner_id, drop_id, registered_uses, ft, nft } = await getDropInformation({ dropId }) + + assert(isValidAccountObj(account), 'Passed in account is not a valid account object.') + account = getAccount({ account, wallet }); + assert(owner_id == account!.accountId, 'Only the owner of the drop can delete keys.') const actions: any[] = [] if ((ft || nft) && registered_uses > 0) { diff --git a/src/lib/types/params.ts b/src/lib/types/params.ts index ef6bdde2f..56b4b1d6a 100644 --- a/src/lib/types/params.ts +++ b/src/lib/types/params.ts @@ -43,6 +43,14 @@ export interface AddKeyParams { useBalance?: boolean, } +export interface RegisterUsesParams { + account?: Account, + wallet?: BrowserWalletBehaviour, + dropId: string, + numUses: number, + useBalance?: boolean, +} + export interface DeleteDropParams { account?: Account, wallet?: BrowserWalletBehaviour, @@ -80,9 +88,12 @@ export interface GenerateKeysParams { } export interface FTTransferCallParams { - account: Account, + account?: Account, + wallet?: BrowserWalletBehaviour, contractId: string, - args: object, + absoluteAmount?: string + amount?: string, + dropId: string, returnTransaction?: boolean, } @@ -90,9 +101,8 @@ export interface NFTTransferCallParams { account?: Account, wallet?: BrowserWalletBehaviour, contractId: string, - receiverId: string, tokenIds: string[], - msg: string | null, + dropId: string, returnTransactions?: boolean, } diff --git a/src/lib/views.ts b/src/lib/views.ts index 7c25cbf8d..5951a4830 100644 --- a/src/lib/views.ts +++ b/src/lib/views.ts @@ -1,3 +1,4 @@ +import { assert } from "./checks" import { KEY_LIMIT } from "./drops" import { getEnv } from "./keypom" import { keypomView } from "./keypom-utils" @@ -237,6 +238,8 @@ export const getDropInformation = async ({ dropId, withKeys = false } : {dropId: viewAccount, contractId, } = getEnv() + assert(viewAccount, 'initKeypom must be called before view functions can be called.'); + const dropInfo = await viewAccount.viewFunction2({ contractId, methodName: 'get_drop_information', @@ -440,9 +443,7 @@ export const getDrops = async ({ }) if (withKeys) { - if (drops.length > 20) { - throw new Error(`Too many RPC requests in parallel. Use 'limit' arg 20 or less.`) - } + assert(drops.length <= 20, `Too many RPC requests in parallel. Use 'limit' arg 20 or less.`) await Promise.all(drops.map(async (drop, i) => { const { drop_id } = drop diff --git a/test/ws.test.js b/test/ws.test.js index 011409837..2d3b2d2c5 100644 --- a/test/ws.test.js +++ b/test/ws.test.js @@ -371,6 +371,7 @@ test('add keys to simple drop', async (t) => { test('add keys to ft drop', async (t) => { + console.log('drops for FTs!!: ', drops) const drop = drops[1] const { drop_id: dropId, next_key_id: nextKeyId } = drop @@ -387,6 +388,7 @@ test('add keys to ft drop', async (t) => { publicKeys.push(keys.publicKeys[0]); } + console.log('drop (FTs): ', drop) await addKeys({ drop, publicKeys, @@ -530,3 +532,15 @@ test('delete 1 key from simple drop', async (t) => { t.is(drops[0].keys.length, NUM_KEYS - 2) }); + +test('invalid args being passed in', async (t) => { + try { + await createDrop({ + account: "foobar.testnet" + }); + + t.is(1, 2, 'should have thrown an error') + } catch(e) {} + + t.is(1, 1, 'no error was thrown! :)') +});