UNPKG

@infy-protocol/sdk

Version:

Lend and rent any ERC721s and ERC1155s on supported mainnet and testnet.

1,722 lines (1,604 loc) 198 kB
import { Contract, BigNumber } from 'ethers'; import BigNumberJS from 'bignumber.js'; function _regeneratorRuntime() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function () { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function (obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return generator._invoke = function (innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; }(innerFn, self, context), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == typeof value && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (object) { var keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function (skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function () { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function (exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function (type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function (record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function (finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function (tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function (iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; } function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } var TimeBasedNFTRentalsAbi = [{ inputs: [{ internalType: 'address', name: '_paymentOptionProvider', type: 'address' }, { internalType: 'address payable', name: '_treasury', type: 'address' }, { internalType: 'address', name: '_admin', type: 'address' }], stateMutability: 'nonpayable', type: 'constructor' }, { inputs: [{ internalType: 'uint256', name: 'lendAmount', type: 'uint256' }, { internalType: 'uint256', name: 'availableAmount', type: 'uint256' }], name: 'ActiveRenting', type: 'error' }, { inputs: [], name: 'ClaimIsNotAllowedYet', type: 'error' }, { inputs: [], name: 'CollateralPriceIsZero', type: 'error' }, { inputs: [], name: 'DistributeClaimError', type: 'error' }, { inputs: [{ internalType: 'uint8', name: 'code', type: 'uint8' }], name: 'DistributePaymentError', type: 'error' }, { inputs: [], name: 'ExceedMaxRentFee', type: 'error' }, { inputs: [], name: 'LendingEmpty', type: 'error' }, { inputs: [], name: 'LendingNotEmpty', type: 'error' }, { inputs: [], name: 'NoDataPassed', type: 'error' }, { inputs: [], name: 'NotAllowedToRent', type: 'error' }, { inputs: [{ internalType: 'address', name: 'caller', type: 'address' }], name: 'NotAnAdmin', type: 'error' }, { inputs: [{ internalType: 'uint8', name: 'errorCode', type: 'uint8' }], name: 'NotLendable', type: 'error' }, { inputs: [{ internalType: 'uint8', name: 'errorCode', type: 'uint8' }], name: 'NotRentable', type: 'error' }, { inputs: [], name: 'Paused', type: 'error' }, { inputs: [{ internalType: 'uint256', name: 'rentAmount', type: 'uint256' }, { internalType: 'uint256', name: 'availableAmount', type: 'uint256' }], name: 'RentAmountExceedsAvailableAmount', type: 'error' }, { inputs: [{ internalType: 'uint32', name: 'rentDuration', type: 'uint32' }, { internalType: 'uint32', name: 'minRentDuration', type: 'uint32' }], name: 'RentDurationBelowMinRentDuration', type: 'error' }, { inputs: [{ internalType: 'uint32', name: 'rentDuration', type: 'uint32' }, { internalType: 'uint32', name: 'maxRentDuration', type: 'uint32' }], name: 'RentDurationExceedsMaxRentDuration', type: 'error' }, { inputs: [], name: 'RentPriceIsZero', type: 'error' }, { inputs: [], name: 'RentingEmpty', type: 'error' }, { inputs: [], name: 'RentingNotEmpty', type: 'error' }, { inputs: [], name: 'ReturnIsPastDuration', type: 'error' }, { inputs: [], name: 'ReturningNotAllowed', type: 'error' }, { inputs: [{ internalType: 'address', name: 'lender', type: 'address' }, { internalType: 'address', name: 'msgSender', type: 'address' }], name: 'StopperNotLender', type: 'error' }, { anonymous: false, inputs: [{ indexed: false, internalType: 'bool', name: 'isERC721', type: 'bool' }, { indexed: true, internalType: 'address', name: 'lenderAddress', type: 'address' }, { indexed: true, internalType: 'address', name: 'nftAddress', type: 'address' }, { indexed: true, internalType: 'uint256', name: 'tokenId', type: 'uint256' }, { indexed: false, internalType: 'uint256', name: 'lendingId', type: 'uint256' }, { indexed: false, internalType: 'uint32', name: 'maxRentDuration', type: 'uint32' }, { indexed: false, internalType: 'uint32', name: 'minRentDuration', type: 'uint32' }, { indexed: false, internalType: 'uint256', name: 'dailyRentPrice', type: 'uint256' }, { indexed: false, internalType: 'uint256', name: 'lendAmount', type: 'uint256' }, { indexed: false, internalType: 'uint256', name: 'collateral', type: 'uint256' }, { indexed: false, internalType: 'address[]', name: 'allowedRenters', type: 'address[]' }, { indexed: false, internalType: 'uint8', name: 'paymentOption', type: 'uint8' }], name: 'Lend', type: 'event' }, { anonymous: false, inputs: [{ indexed: true, internalType: 'address', name: 'renterAddress', type: 'address' }, { indexed: true, internalType: 'uint256', name: 'lendingId', type: 'uint256' }, { indexed: true, internalType: 'uint256', name: 'rentingId', type: 'uint256' }, { indexed: false, internalType: 'uint256', name: 'rentAmount', type: 'uint256' }, { indexed: false, internalType: 'uint32', name: 'rentDuration', type: 'uint32' }, { indexed: false, internalType: 'uint32', name: 'rentedAt', type: 'uint32' }], name: 'Rent', type: 'event' }, { anonymous: false, inputs: [{ indexed: true, internalType: 'uint256', name: 'rentingId', type: 'uint256' }, { indexed: false, internalType: 'uint32', name: 'claimedAt', type: 'uint32' }, { indexed: false, internalType: 'bool', name: 'isCollateralFree', type: 'bool' }], name: 'RentOrCollateralClaimed', type: 'event' }, { anonymous: false, inputs: [{ indexed: true, internalType: 'uint256', name: 'lendingId', type: 'uint256' }, { indexed: false, internalType: 'uint32', name: 'stoppedAt', type: 'uint32' }], name: 'StopLend', type: 'event' }, { anonymous: false, inputs: [{ indexed: true, internalType: 'uint256', name: 'rentingId', type: 'uint256' }, { indexed: false, internalType: 'uint32', name: 'stoppedAt', type: 'uint32' }], name: 'StopRent', type: 'event' }, { inputs: [{ internalType: 'enum NFTStandard[]', name: '_nftStandards', type: 'uint8[]' }, { internalType: 'address[]', name: '_nfts', type: 'address[]' }, { internalType: 'uint256[]', name: '_tokenIds', type: 'uint256[]' }, { internalType: 'uint256[]', name: '_lendingIds', type: 'uint256[]' }, { internalType: 'uint256[]', name: '_rentingIds', type: 'uint256[]' }], name: 'claimRentOrCollateral', outputs: [], stateMutability: 'nonpayable', type: 'function' }, { inputs: [{ internalType: 'address', name: '_nfts', type: 'address' }, { internalType: 'uint256', name: '_tokenIds', type: 'uint256' }, { internalType: 'uint256', name: '_lendingIds', type: 'uint256' }], name: 'getLendingInfo', outputs: [{ internalType: 'uint8', name: '', type: 'uint8' }, { internalType: 'address', name: '', type: 'address' }, { internalType: 'uint32', name: '', type: 'uint32' }, { internalType: 'uint32', name: '', type: 'uint32' }, { internalType: 'uint256', name: '', type: 'uint256' }, { internalType: 'uint256', name: '', type: 'uint256' }, { internalType: 'uint256', name: '', type: 'uint256' }, { internalType: 'uint8', name: '', type: 'uint8' }], stateMutability: 'view', type: 'function' }, { inputs: [{ internalType: 'address', name: '_nfts', type: 'address' }, { internalType: 'uint256', name: '_tokenIds', type: 'uint256' }, { internalType: 'uint256', name: '_rentingIds', type: 'uint256' }], name: 'getRentingInfo', outputs: [{ internalType: 'address', name: '', type: 'address' }, { internalType: 'uint256', name: '', type: 'uint256' }, { internalType: 'uint32', name: '', type: 'uint32' }, { internalType: 'uint32', name: '', type: 'uint32' }], stateMutability: 'view', type: 'function' }, { inputs: [{ internalType: 'enum NFTStandard[]', name: '_nftStandards', type: 'uint8[]' }, { internalType: 'address[]', name: '_nfts', type: 'address[]' }, { internalType: 'uint256[]', name: '_tokenIds', type: 'uint256[]' }, { internalType: 'uint256[]', name: '_lendAmounts', type: 'uint256[]' }, { internalType: 'uint32[]', name: '_maxRentDurations', type: 'uint32[]' }, { internalType: 'uint32[]', name: '_minRentDurations', type: 'uint32[]' }, { internalType: 'uint256[]', name: '_dailyRentPrices', type: 'uint256[]' }, { internalType: 'uint8[]', name: '_paymentOptions', type: 'uint8[]' }, { internalType: 'uint256[]', name: '_collateralPrices', type: 'uint256[]' }, { components: [{ internalType: 'address[]', name: 'allowedRenters', type: 'address[]' }], internalType: 'struct ITimeBasedNFTRentals.AllowedRenters[]', name: '_allowedRenters', type: 'tuple[]' }], name: 'lend', outputs: [], stateMutability: 'nonpayable', type: 'function' }, { inputs: [{ internalType: 'address', name: '', type: 'address' }, { internalType: 'address', name: '', type: 'address' }, { internalType: 'uint256[]', name: '', type: 'uint256[]' }, { internalType: 'uint256[]', name: '', type: 'uint256[]' }, { internalType: 'bytes', name: '', type: 'bytes' }], name: 'onERC1155BatchReceived', outputs: [{ internalType: 'bytes4', name: '', type: 'bytes4' }], stateMutability: 'nonpayable', type: 'function' }, { inputs: [{ internalType: 'address', name: '', type: 'address' }, { internalType: 'address', name: '', type: 'address' }, { internalType: 'uint256', name: '', type: 'uint256' }, { internalType: 'uint256', name: '', type: 'uint256' }, { internalType: 'bytes', name: '', type: 'bytes' }], name: 'onERC1155Received', outputs: [{ internalType: 'bytes4', name: '', type: 'bytes4' }], stateMutability: 'nonpayable', type: 'function' }, { inputs: [{ internalType: 'address', name: '', type: 'address' }, { internalType: 'address', name: '', type: 'address' }, { internalType: 'uint256', name: '', type: 'uint256' }, { internalType: 'bytes', name: '', type: 'bytes' }], name: 'onERC721Received', outputs: [{ internalType: 'bytes4', name: '', type: 'bytes4' }], stateMutability: 'nonpayable', type: 'function' }, { inputs: [], name: 'paused', outputs: [{ internalType: 'bool', name: '', type: 'bool' }], stateMutability: 'view', type: 'function' }, { inputs: [{ internalType: 'enum NFTStandard[]', name: '_nftStandards', type: 'uint8[]' }, { internalType: 'address[]', name: '_nfts', type: 'address[]' }, { internalType: 'uint256[]', name: '_tokenIds', type: 'uint256[]' }, { internalType: 'uint256[]', name: '_lendingIds', type: 'uint256[]' }, { internalType: 'uint32[]', name: '_rentDurations', type: 'uint32[]' }, { internalType: 'uint256[]', name: '_rentAmounts', type: 'uint256[]' }], name: 'rent', outputs: [], stateMutability: 'payable', type: 'function' }, { inputs: [], name: 'rentFee', outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], stateMutability: 'view', type: 'function' }, { inputs: [{ internalType: 'bool', name: '_paused', type: 'bool' }], name: 'setPaused', outputs: [], stateMutability: 'nonpayable', type: 'function' }, { inputs: [{ internalType: 'uint256', name: '_rentFee', type: 'uint256' }], name: 'setRentFee', outputs: [], stateMutability: 'nonpayable', type: 'function' }, { inputs: [{ internalType: 'address payable', name: '_treasury', type: 'address' }], name: 'setTreasury', outputs: [], stateMutability: 'nonpayable', type: 'function' }, { inputs: [{ internalType: 'enum NFTStandard[]', name: '_nftStandards', type: 'uint8[]' }, { internalType: 'address[]', name: '_nfts', type: 'address[]' }, { internalType: 'uint256[]', name: '_tokenIds', type: 'uint256[]' }, { internalType: 'uint256[]', name: '_lendingIds', type: 'uint256[]' }], name: 'stopLending', outputs: [], stateMutability: 'nonpayable', type: 'function' }, { inputs: [{ internalType: 'enum NFTStandard[]', name: '_nftStandards', type: 'uint8[]' }, { internalType: 'address[]', name: '_nfts', type: 'address[]' }, { internalType: 'uint256[]', name: '_tokenIds', type: 'uint256[]' }, { internalType: 'uint256[]', name: '_lendingIds', type: 'uint256[]' }, { internalType: 'uint256[]', name: '_rentingIds', type: 'uint256[]' }], name: 'stopRenting', outputs: [], stateMutability: 'nonpayable', type: 'function' }, { inputs: [{ internalType: 'bytes4', name: 'interfaceId', type: 'bytes4' }], name: 'supportsInterface', outputs: [{ internalType: 'bool', name: '', type: 'bool' }], stateMutability: 'view', type: 'function' }]; var WEI_DECIMAL = 18; var sameLength = function sameLength(a, b) { return a.length === b.length; }; var validateSameLength = function validateSameLength() { for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } var prev = args[0]; for (var _i = 0, _args = args; _i < _args.length; _i++) { var curr = _args[_i]; if (!curr) continue; if (!sameLength(prev, curr)) throw new Error('args length variable'); prev = curr; } return true; }; /** * To spend as little gas as possible, arguments must follow a particular format * when passed to the contract. This function prepares whatever inputs you want * to send, and returns the inputs in an optimal format. * * This algorithm's time complexity is pretty awful. But, it will never run on * large arrays, so it doesn't really matter. * @param args */ var prepareBatch = function prepareBatch(args) { if (args.nftAddresses.length === 1) return args; validateSameLength(Object.values(args)); var nfts = new Map(); var pb = { nftAddresses: [], tokenIds: [], nftStandards: [] }; // O(N), maybe higher because of [...o[k]!, v[i]] var updateNfts = function updateNfts(nftAddresses, i) { var o = nfts.get(nftAddresses); for (var _i2 = 0, _Object$entries = Object.entries(args); _i2 < _Object$entries.length; _i2++) { var _o$k; var _Object$entries$_i = _Object$entries[_i2], k = _Object$entries$_i[0], v = _Object$entries$_i[1]; if (!o) throw new Error("could not find " + nftAddresses); if (v) o[k] = [].concat((_o$k = o[k]) != null ? _o$k : [], [v[i]]); } return nfts; }; var createNft = function createNft(nftAddresses, i) { nfts.set(nftAddresses, { nftStandards: [args.nftStandards[i]], nftAddresses: [nftAddresses], tokenIds: [args.tokenIds[i]], lendAmounts: args.lendAmounts ? [args.lendAmounts[i]] : undefined, rentAmounts: args.rentAmounts ? [args.rentAmounts[i]] : undefined, maxRentDurations: args.maxRentDurations ? [args.maxRentDurations[i]] : undefined, minRentDurations: args.minRentDurations ? [args.minRentDurations[i]] : undefined, dailyRentPrices: args.dailyRentPrices ? [args.dailyRentPrices[i]] : undefined, collateralPrices: args.collateralPrices ? [args.collateralPrices[i]] : undefined, paymentOptions: args.paymentOptions ? [args.paymentOptions[i]] : undefined, rentDurations: args.rentDurations ? [args.rentDurations[i]] : undefined, lendingIds: args.lendingIds ? [args.lendingIds[i]] : undefined, rentingIds: args.rentingIds ? [args.rentingIds[i]] : undefined, allowedRenters: args.allowedRenters ? [args.allowedRenters[i]] : undefined }); return nfts; }; // O(2 * N), yikes to 2 var worstArgsort = function worstArgsort(tokenIds) { var indices = new Array(tokenIds.length); for (var i = 0; i < tokenIds.length; ++i) { indices[i] = i; } indices.sort(function (a, b) { return tokenIds[a].lt(tokenIds[b]) ? -1 : tokenIds[a].gt(tokenIds[b]) ? 1 : 0; }); return { sortedTokenID: sortPerIndices(indices, tokenIds), argsort: indices }; }; var sortPerIndices = function sortPerIndices(argsort, arr) { return argsort.map(function (i) { return arr[i]; }); }; // O(N ** M). for each nft loop through all args. M - number of args Object.values(args.nftAddresses).forEach(function (nft, i) { if (nfts.has(nft)) nfts = updateNfts(nft, i);else nfts = createNft(nft, i); }); var iterator = nfts.keys(); // O(N * N) while (iterator) { var g = iterator.next().value; if (!g) break; // end of loop var nft = nfts.get(g); var tokenIds = nft.tokenIds; var _worstArgsort = worstArgsort(tokenIds), argsort = _worstArgsort.argsort; for (var _i3 = 0, _Object$keys = Object.keys(nft); _i3 < _Object$keys.length; _i3++) { var _nft$k, _pb$k; var k = _Object$keys[_i3]; if (!nft[k]) continue; var sorted = sortPerIndices(argsort, (_nft$k = nft[k]) != null ? _nft$k : []); pb[k] = [].concat((_pb$k = pb[k]) != null ? _pb$k : [], sorted); } } return pb; }; var prepareRevenueShareBatch = function prepareRevenueShareBatch(args) { if (args.nftAddresses.length === 1) return args; validateSameLength(Object.values(args)); var nfts = new Map(); var pb = { nftAddresses: [], tokenIds: [], nftStandards: [] }; // O(N), maybe higher because of [...o[k]!, v[i]] var updateNfts = function updateNfts(nftAddresses, i) { var o = nfts.get(nftAddresses); for (var _i4 = 0, _Object$entries2 = Object.entries(args); _i4 < _Object$entries2.length; _i4++) { var _o$k2; var _Object$entries2$_i = _Object$entries2[_i4], k = _Object$entries2$_i[0], v = _Object$entries2$_i[1]; if (!o) throw new Error("could not find " + nftAddresses); if (v) o[k] = [].concat((_o$k2 = o[k]) != null ? _o$k2 : [], [v[i]]); } return nfts; }; var createNft = function createNft(nftAddresses, i) { nfts.set(nftAddresses, { nftStandards: args.nftStandards ? [args.nftStandards[i]] : undefined, nftAddresses: [nftAddresses], tokenIds: [args.tokenIds[i]], lendAmounts: args.lendAmounts ? [args.lendAmounts[i]] : undefined, rentAmounts: args.rentAmounts ? [args.rentAmounts[i]] : undefined, maxRentDurations: args.maxRentDurations ? [args.maxRentDurations[i]] : undefined, paymentOptions: args.paymentOptions ? [args.paymentOptions[i]] : undefined, rentDurations: args.rentDurations ? [args.rentDurations[i]] : undefined, lendingIds: args.lendingIds ? [args.lendingIds[i]] : undefined, rentingIds: args.rentingIds ? [args.rentingIds[i]] : undefined, upfrontFees: args.upfrontFees ? [args.upfrontFees[i]] : undefined, revenueShareInfos: args.revenueShareInfos ? [args.revenueShareInfos[i]] : undefined, allowedRenters: args.allowedRenters ? [args.allowedRenters[i]] : undefined }); return nfts; }; // O(2 * N), yikes to 2 var worstArgsort = function worstArgsort(tokenIds) { var indices = new Array(tokenIds.length); for (var i = 0; i < tokenIds.length; ++i) { indices[i] = i; } indices.sort(function (a, b) { return tokenIds[a].lt(tokenIds[b]) ? -1 : tokenIds[a].gt(tokenIds[b]) ? 1 : 0; }); return { sortedTokenID: sortPerIndices(indices, tokenIds), argsort: indices }; }; var sortPerIndices = function sortPerIndices(argsort, arr) { return argsort.map(function (i) { return arr[i]; }); }; // O(N ** M). for each nft loop through all args. M - number of args Object.values(args.nftAddresses).forEach(function (nft, i) { if (nfts.has(nft)) nfts = updateNfts(nft, i);else nfts = createNft(nft, i); }); var iterator = nfts.keys(); // O(N * N) while (iterator) { var g = iterator.next().value; if (!g) break; // end of loop var nft = nfts.get(g); var tokenIds = nft.tokenIds; var _worstArgsort2 = worstArgsort(tokenIds), argsort = _worstArgsort2.argsort; for (var _i5 = 0, _Object$keys2 = Object.keys(nft); _i5 < _Object$keys2.length; _i5++) { var _nft$k2, _pb$k2; var k = _Object$keys2[_i5]; if (!nft[k]) continue; var sorted = sortPerIndices(argsort, (_nft$k2 = nft[k]) != null ? _nft$k2 : []); pb[k] = [].concat((_pb$k2 = pb[k]) != null ? _pb$k2 : [], sorted); } } return pb; }; var bigNumberToWei = function bigNumberToWei(amount, decimal) { if (decimal === void 0) { decimal = WEI_DECIMAL; } if (isNaN(Number(amount))) { return BigNumberJS(0).toString(); } return new BigNumberJS(amount).multipliedBy(new BigNumberJS(10).pow(Number(decimal))).toString(); }; var bigNumberToEther = function bigNumberToEther(amount, decimal) { if (decimal === void 0) { decimal = WEI_DECIMAL; } if (isNaN(Number(amount))) { return BigNumberJS(0).toString(); } return new BigNumberJS(amount).div(new BigNumberJS(10).pow(Number(decimal))).toString(); }; var _NetworkConfig; /// Value must be same as abi's "Bytecode" file name var ContractType; (function (ContractType) { ContractType["COLLATERALIZED"] = "Collateralized"; ContractType["COLLATERAL_FREE"] = "CollateralFree"; ContractType["REVENUE_SHARE"] = "RevenueShare"; ContractType["REVENUE_SHARED_CONFIGURATOR"] = "RevenueSharedConfigurator"; ContractType["E721"] = "E721"; ContractType["E721_B"] = "E721B"; ContractType["E1155"] = "E1155"; ContractType["E1155_B"] = "E1155B"; ContractType["WETH"] = "WETH"; ContractType["DAI"] = "DAI"; ContractType["USDC"] = "USDC"; ContractType["USDT"] = "USDT"; ContractType["T_USD"] = "TUSD"; ContractType["UTILS"] = "Utils"; })(ContractType || (ContractType = {})); var CONTRACT_TYPE_LIST = /*#__PURE__*/Object.values(ContractType).filter(function (id) { return typeof id === 'string'; }); var SupportedChainIds; (function (SupportedChainIds) { SupportedChainIds[SupportedChainIds["ETHEREUM_MAINNET"] = 1] = "ETHEREUM_MAINNET"; SupportedChainIds[SupportedChainIds["ETHEREUM_ROPSTEN"] = 3] = "ETHEREUM_ROPSTEN"; SupportedChainIds[SupportedChainIds["ETHEREUM_RINKEBY"] = 4] = "ETHEREUM_RINKEBY"; SupportedChainIds[SupportedChainIds["ETHEREUM_KOVAN"] = 42] = "ETHEREUM_KOVAN"; SupportedChainIds[SupportedChainIds["BINANCE_MAINNET"] = 56] = "BINANCE_MAINNET"; SupportedChainIds[SupportedChainIds["BINANCE_TESTNET"] = 97] = "BINANCE_TESTNET"; SupportedChainIds[SupportedChainIds["POLYGON_MAINNET"] = 137] = "POLYGON_MAINNET"; SupportedChainIds[SupportedChainIds["POLYGON_TESTNET"] = 80001] = "POLYGON_TESTNET"; })(SupportedChainIds || (SupportedChainIds = {})); var ALL_SUPPORTED_CHAIN_IDS = /*#__PURE__*/Object.values(SupportedChainIds).filter(function (id) { return typeof id === 'number'; }); /// Note: /// 1. Contract address array version priority [Vn....3,2,1] (Latest contract at zero index) var NetworkConfig = (_NetworkConfig = {}, _NetworkConfig[SupportedChainIds.ETHEREUM_MAINNET] = { name: 'Ethereum Mainnet', chainId: 1, shortName: 'eth', chain: 'ETH', networkId: 1, nativeCurrency: { name: 'Ether', symbol: 'ETH', decimals: 18 }, rpc: ['https://mainnet.infura.io/v3/${INFURA_API_KEY}', 'wss://mainnet.infura.io/ws/v3/${INFURA_API_KEY}', 'https://api.mycryptoapi.com/eth', 'https://cloudflare-eth.com'], faucets: [], explorers: { name: 'etherscan', url: 'https://etherscan.io', standard: 'EIP3091' }, infoURL: 'https://ethereum.org', logoURL: '/assets/images/chain-logos/ethereum-logo.png', collateralizedContractAddresses: [], collateralFreeContractAddresses: [], revenueSharedNFTRentalsContractAddresses: [], revenueSharedConfiguratorContractAddresses: [], e721ContractAddresses: [], e721BContractAddresses: [], e1155ContractAddresses: [], e1155BContractAddresses: [], wETHContractAddresses: [], daiContractAddresses: [], usdcContractAddresses: [], usdtContractAddresses: [], tUSDContractAddresses: [], utilsContractAddresses: [], subgraphs: { collateralized: '', collateralFree: '', revenueSharedNFTRentals: '', e721: '', e1155: '' }, moralisDetails: { isSupported: true, lookupValue: 'eth' }, chainApiId: 'binancecoin', isSupported: false, isTestnet: false }, _NetworkConfig[SupportedChainIds.ETHEREUM_ROPSTEN] = { name: 'Ethereum Testnet Ropsten', chainId: 3, shortName: 'rop', chain: 'ETH-Testnet', networkId: 3, nativeCurrency: { name: 'Ropsten Ether', symbol: 'ROP', decimals: 18 }, rpc: ['https://ropsten.infura.io/v3/${INFURA_API_KEY}', 'wss://ropsten.infura.io/ws/v3/${INFURA_API_KEY}'], faucets: ['https://faucet.ropsten.be?${ADDRESS}'], explorers: { name: 'etherscan-ropsten', url: 'https://ropsten.etherscan.io/', standard: 'EIP3091' }, infoURL: 'https://github.com/ethereum/ropsten', logoURL: '/assets/images/chain-logos/ethereum-logo.png', collateralizedContractAddresses: [], collateralFreeContractAddresses: [], revenueSharedNFTRentalsContractAddresses: [], revenueSharedConfiguratorContractAddresses: [], e721ContractAddresses: [], e721BContractAddresses: [], e1155ContractAddresses: [], e1155BContractAddresses: [], wETHContractAddresses: [], daiContractAddresses: [], usdcContractAddresses: [], usdtContractAddresses: [], tUSDContractAddresses: [], utilsContractAddresses: [], subgraphs: { collateralized: '', collateralFree: '', revenueSharedNFTRentals: '', e721: '', e1155: '' }, moralisDetails: { isSupported: false, lookupValue: '' }, chainApiId: 'binancecoin', isSupported: false, isTestnet: true }, _NetworkConfig[SupportedChainIds.ETHEREUM_RINKEBY] = { name: 'Ethereum Testnet Rinkeby', chainId: 4, shortName: 'rin', chain: 'ETH-Testnet', networkId: 4, nativeCurrency: { name: 'Rinkeby Ether', symbol: 'RIN', decimals: 18 }, rpc: ['https://rinkeby.infura.io/v3/${INFURA_API_KEY}', 'wss://rinkeby.infura.io/ws/v3/${INFURA_API_KEY}'], faucets: ['https://faucet.rinkeby.io'], explorers: { name: 'etherscan-rinkeby', url: 'https://rinkeby.etherscan.io', standard: 'EIP3091' }, infoURL: 'https://www.rinkeby.io', logoURL: '/assets/images/chain-logos/ethereum-logo.png', collateralizedContractAddresses: [], collateralFreeContractAddresses: [], revenueSharedNFTRentalsContractAddresses: [], revenueSharedConfiguratorContractAddresses: [], e721ContractAddresses: [], e721BContractAddresses: [], e1155ContractAddresses: [], e1155BContractAddresses: [], wETHContractAddresses: [], daiContractAddresses: [], usdcContractAddresses: [], usdtContractAddresses: [], tUSDContractAddresses: [], utilsContractAddresses: [], subgraphs: { collateralized: '', collateralFree: '', revenueSharedNFTRentals: '', e721: '', e1155: '' }, moralisDetails: { isSupported: false, lookupValue: '' }, chainApiId: 'binancecoin', isSupported: false, isTestnet: true }, _NetworkConfig[SupportedChainIds.ETHEREUM_KOVAN] = { name: 'Kovan Testnet', chainId: 42, shortName: 'KOV', chain: 'kovan', networkId: 42, nativeCurrency: { name: 'Kovan', symbol: 'KOV', decimals: 18 }, rpc: ['https://kovan.poa.network', 'http://kovan.poa.network:8545', 'https://kovan.infura.io/v3/${INFURA_API_KEY}', 'wss://kovan.infura.io/ws/v3/${INFURA_API_KEY}', 'ws://kovan.poa.network:8546'], faucets: ['https://faucet.kovan.network', 'https://gitter.im/kovan-testnet/faucet'], explorers: { name: 'etherscan-kovan', url: 'https://kovan.etherscan.io/', standard: 'EIP3091' }, infoURL: 'https://kovan-testnet.github.io/website', logoURL: '/assets/images/chain-logos/kovan-logo-svg.svg', collateralizedContractAddresses: ['0xc4E1142e0dcF1CBdDcD101Bd6C82DB5bDc946C6e'], collateralFreeContractAddresses: ['0x0948a02CCf44949C3853Cb087698C91C9E37Dddd'], revenueSharedNFTRentalsContractAddresses: [], revenueSharedConfiguratorContractAddresses: ['0x3A92F1c74D4F10b9eb3E12C890E55663F510F8a5'], e721ContractAddresses: ['0xD3b55Bf4A849992AA52f2293CDDb493A18b980Dd'], e721BContractAddresses: ['0x4EF6d4f83341AAF584DB7599ba7BCB0f29CdC51A'], e1155ContractAddresses: ['0xBFBA01C44c6f36EB7f8b6e805c969d1F438fF650'], e1155BContractAddresses: ['0xE9397bDf06a56303e0159f1D618Efde7E90dA3A3'], wETHContractAddresses: ['0xe74ffdF419f30aD24dDe778d7317Ba7d3BB18f4a'], daiContractAddresses: ['0x45793Ad70378a863922706f465eCbC26f4c195f9'], usdcContractAddresses: ['0x3ebBC74E7579F800fE8C3d058377b95c06f7f0e1'], usdtContractAddresses: ['0xAA92036d1D11f4120E9345E990072e868B48Be7e'], tUSDContractAddresses: ['0xeFEfAC77461FF56Ff26F3Db522e42AbEA7aE38b5'], utilsContractAddresses: ['0xAe79A95cCeFDEb13584e7595d4FCC8D3cAac352a'], subgraphs: { collateralized: 'https://kovan.infy.network/subgraphs/name/infy-collateralized/subgraph', collateralFree: 'https://kovan.infy.network/subgraphs/name/infy-collateral-free/subgraph', revenueSharedNFTRentals: '', e721: 'https://kovan.infy.network/subgraphs/name/wighawag/eip721-subgraph', e1155: 'https://kovan.infy.network/subgraphs/name/amxx/eip1155-subgraph' }, moralisDetails: { isSupported: false, lookupValue: '' }, chainApiId: 'kovan-testnet', isSupported: false, isTestnet: true }, _NetworkConfig[SupportedChainIds.BINANCE_MAINNET] = { name: 'BSC Mainnet', chainId: 56, shortName: 'bnb', chain: 'BSC', networkId: 56, nativeCurrency: { name: 'Binance Chain Native Token', symbol: 'BNB', decimals: 18 }, rpc: ['https://bsc-dataseed1.binance.org', 'https://bsc-dataseed2.binance.org', 'https://bsc-dataseed3.binance.org', 'https://bsc-dataseed4.binance.org', 'https://bsc-dataseed1.defibit.io', 'https://bsc-dataseed2.defibit.io', 'https://bsc-dataseed3.defibit.io', 'https://bsc-dataseed4.defibit.io', 'https://bsc-dataseed1.ninicoin.io', 'https://bsc-dataseed2.ninicoin.io', 'https://bsc-dataseed3.ninicoin.io', 'https://bsc-dataseed4.ninicoin.io', 'wss://bsc-ws-node.nariox.org'], faucets: [], explorers: { name: 'bscscan', url: 'https://bscscan.com', standard: 'EIP3091' }, infoURL: 'https://www.binance.org', logoURL: '/assets/images/chain-logos/binance-logo.png', collateralizedContractAddresses: ['0x4dA60d2646a8ed5461457012f5cd7b87905E9e55'], collateralFreeContractAddresses: ['0x858feeb9D751A07aF2D7b5ad7fa996B30261a891'], revenueSharedNFTRentalsContractAddresses: ['0xEc12AB0306A3bbDa93aACC2BE931F8A8343bCEA3'], revenueSharedConfiguratorContractAddresses: ['0x8F975d55b8b20D6e53264A4730998C14fE5b8C25'], e721ContractAddresses: [], e721BContractAddresses: [], e1155ContractAddresses: [], e1155BContractAddresses: [], wETHContractAddresses: ['0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c'], daiContractAddresses: ['0x1AF3F329e8BE154074D8769D1FFa4eE058B1DBc3'], usdcContractAddresses: ['0xD3b55Bf4A849992AA52f2293CDDb493A18b980Dd'], usdtContractAddresses: ['0xe9e7CEA3DedcA5984780Bafc599bD69ADd087D56'], tUSDContractAddresses: ['0x14016e85a25aeb13065688cafb43044c2ef86784'], utilsContractAddresses: [], subgraphs: { collateralized: 'https://api.thegraph.com/subgraphs/name/dudhatparesh/infy-collateralized-bsc', collateralFree: 'https://thegraph.com/explorer/subgraph/dudhatparesh/infy-collateral-free-bsc', revenueSharedNFTRentals: 'https://api.thegraph.com/subgraphs/name/dudhatparesh/infy-revenue-share-bsc', e721: '', e1155: '' }, moralisDetails: { isSupported: true, lookupValue: 'bsc' }, chainApiId: 'binancecoin', isSupported: true, isTestnet: false }, _NetworkConfig[SupportedChainIds.BINANCE_TESTNET] = { name: 'BSC Smart Chain Testnet', chainId: 97, shortName: 'bnbt', chain: 'BSC-Testnet', networkId: 97, nativeCurrency: { name: 'Binance Chain Native Token', symbol: 'BNB', decimals: 18 }, rpc: ['https://data-seed-prebsc-2-s1.binance.org:8545', 'https://data-seed-prebsc-1-s1.binance.org:8545', 'https://data-seed-prebsc-1-s2.binance.org:8545', 'https://data-seed-prebsc-2-s2.binance.org:8545', 'https://data-seed-prebsc-1-s3.binance.org:8545', 'https://data-seed-prebsc-2-s3.binance.org:8545'], faucets: ['https://testnet.binance.org/faucet-smart'], explorers: { name: 'bscscan-testnet', url: 'https://testnet.bscscan.com', standard: 'EIP3091' }, infoURL: 'https://testnet.binance.org/', logoURL: '/assets/images/chain-logos/binance-logo.png', collateralizedContractAddresses: [], collateralFreeContractAddresses: [], revenueSharedNFTRentalsContractAddresses: [], revenueSharedConfiguratorContractAddresses: [], e721ContractAddresses: [], e721BContractAddresses: [], e1155ContractAddresses: [], e1155BContractAddresses: [], wETHContractAddresses: [], daiContractAddresses: [], usdcContractAddresses: [], usdtContractAddresses: [], tUSDContractAddresses: [], utilsContractAddresses: [], subgraphs: { collateralized: '', collateralFree: '', revenueSharedNFTRentals: '', e721: '', e1155: '' }, moralisDetails: { isSupported: true, lookupValue: 'bsc testnet' }, chainApiId: 'binancecoin', isSupported: false, isTestnet: true }, _NetworkConfig[SupportedChainIds.POLYGON_MAINNET] = { name: 'Polygon', chainId: 137, shortName: 'Polygon', chain: 'Polygon', networkId: 137, nativeCurrency: { name: 'Matic', symbol: 'MATIC', decimals: 18 }, rpc: ['https://polygon-rpc.com/'], faucets: [], explorers: { name: 'polygonscan', url: 'https://polygonscan.com', standard: 'EIP3091' }, infoURL: 'https://matic.network/', logoURL: '/assets/images/chain-logos/matic-logo-svg.svg', collateralizedContractAddresses: ['0x30e1617F74c1E990Cf2af5532026FD58B561b5b4'], collateralFreeContractAddresses: ['0x730995e8cF5af41e581cfdCc457630C9700610E6'], revenueSharedNFTRentalsContractAddresses: ['0x9C5dA47ED0281aF302ED1E77a1B961ed980d5385'], revenueSharedConfiguratorContractAddresses: ['0x4a1BDD3a5BBAb4312432b1b507d67Bce6baC8B22'], e721ContractAddresses: [], e721BContractAddresses: [], e1155ContractAddresses: [], e1155BContractAddresses: [], wETHContractAddresses: ['0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619'], daiContractAddresses: ['0x8f3Cf7ad23Cd3CaDbD9735AFf958023239c6A063'], usdcContractAddresses: ['0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174'], usdtContractAddresses: ['0xc2132D05D31c914a87C6611C10748AEb04B58e8F'], tUSDContractAddresses: ['0x2e1AD108fF1D8C782fcBbB89AAd783aC49586756'], utilsContractAddresses: [], subgraphs: { collateralized: 'https://api.thegraph.com/subgraphs/name/dudhatparesh/infy-collateralized-polygon', collateralFree: 'https://api.thegraph.com/subgraphs/name/dudhatparesh/infy-collateral-free-polygon', revenueSharedNFTRentals: 'http