From 114121f214d338d63f0a5c9cd702ab8194e74d4e Mon Sep 17 00:00:00 2001 From: Jeroen Offerijns Date: Thu, 20 Aug 2020 17:30:54 +0200 Subject: [PATCH 01/65] feat: work on minting NFTs using ethers.js --- .nvmrc | 1 + dist/Tinlake.d.ts | 12 ++ dist/actions/collateral.d.ts | 6 +- dist/index.es.js | 36 +++++- dist/index.js | 36 +++++- docs/assets/js/search.js | 2 +- docs/classes/_tinlake_.tinlake.html | 118 +++++++++++++++--- docs/interfaces/_services_ethereum_.ethi.html | 16 +-- .../_services_ethereum_.events.html | 6 +- docs/modules/_actions_admin_.html | 30 ++--- docs/modules/_actions_analytics_.html | 60 ++++----- docs/modules/_actions_borrower_.html | 20 +-- docs/modules/_actions_collateral_.html | 22 ++-- docs/modules/_actions_currency_.html | 10 +- docs/modules/_actions_governance_.html | 4 +- docs/modules/_actions_index_.html | 2 +- docs/modules/_actions_lender_.html | 18 +-- docs/modules/_actions_proxy_.html | 30 ++--- docs/modules/_services_ethereum_.html | 10 +- docs/modules/_tinlake_.html | 74 +++++++++-- docs/modules/_types_tinlake_.html | 10 +- docs/modules/_utils_basetodisplay_.html | 2 +- docs/modules/_utils_bntohex_.html | 2 +- docs/modules/_utils_displaytobase_.html | 2 +- docs/modules/_utils_feetointerestrate_.html | 2 +- docs/modules/_utils_getloanstatus_.html | 4 +- docs/modules/_utils_interestratetofee_.html | 2 +- package.json | 18 +-- src/Tinlake.ts | 25 ++++ src/actions/collateral.ts | 19 ++- 30 files changed, 425 insertions(+), 174 deletions(-) create mode 100644 .nvmrc diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 0000000..970d890 --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +v12.16.3 \ No newline at end of file diff --git a/dist/Tinlake.d.ts b/dist/Tinlake.d.ts index bca273a..6144aca 100644 --- a/dist/Tinlake.d.ts +++ b/dist/Tinlake.d.ts @@ -1,14 +1,24 @@ import { ethI } from './services/ethereum'; import { ethers } from 'ethers'; declare const contractNames: string[]; +export declare type PendingTransaction = { + hash: string; + contractKey: string; + timesOutAt: number; +}; export declare type EthConfig = { from?: string; gasPrice?: string; gas?: string; }; +export declare type EthersOverrides = { + gasPrice?: number; + gasLimit?: number; +}; export declare type EthersConfig = { provider?: ethers.providers.Provider; signer?: ethers.Signer; + overrides?: EthersOverrides; }; export declare type ContractNames = typeof contractNames[number]; export declare type Contracts = { @@ -49,6 +59,8 @@ export default class Tinlake { setEthConfig: (ethConfig: EthConfig) => void; setEthersConfig: (ethersConfig: EthersConfig) => void; createContract(address: string, abiName: string): void; + getContract(address: string, abiName: string): ethers.Contract | undefined; + subscribe(tx: PendingTransaction, callback: (response: ethers.providers.TransactionReceipt) => void): Promise; getOperatorType: (tranche: string) => any; } export {}; diff --git a/dist/actions/collateral.d.ts b/dist/actions/collateral.d.ts index 1234fd5..9f12f6a 100644 --- a/dist/actions/collateral.d.ts +++ b/dist/actions/collateral.d.ts @@ -3,7 +3,7 @@ import BN from 'bn.js'; export declare function CollateralActions>(Base: ActionsBase): { new (...args: any[]): { mintTitleNFT: (nftAddr: string, user: string) => Promise; - mintNFT: (nftAddr: string, owner: string, tokenId: string, ref: string, amount: string, asset: string) => Promise; + mintNFT: (nftAddr: string, owner: string, tokenId: string, ref: string, amount: string, asset: string) => Promise; approveNFT: (nftAddr: string, tokenId: string, to: string) => Promise; setNFTApprovalForAll: (nftAddr: string, to: string, approved: boolean) => Promise; isNFTApprovedForAll: (nftAddr: string, owner: string, operator: string) => Promise; @@ -24,8 +24,10 @@ export declare function CollateralActions void; setContracts: () => void; setEthConfig: (ethConfig: import("../Tinlake").EthConfig) => void; - setEthersConfig: (ethersConfig: import("../Tinlake").EthersConfig | undefined) => void; + setEthersConfig: (ethersConfig: import("../Tinlake").EthersConfig) => void; createContract(address: string, abiName: string): void; + getContract(address: string, abiName: string): import("ethers").Contract | undefined; + subscribe(tx: import("../Tinlake").PendingTransaction, callback: (response: import("ethers/providers").TransactionReceipt) => void): Promise; getOperatorType: (tranche: string) => any; }; } & ActionsBase; diff --git a/dist/index.es.js b/dist/index.es.js index 677d4a7..33b84fe 100644 --- a/dist/index.es.js +++ b/dist/index.es.js @@ -29631,13 +29631,26 @@ function CollateralActions(Base) { }); }); }; _this.mintNFT = function (nftAddr, owner, tokenId, ref, amount, asset) { return __awaiter(_this, void 0, void 0, function () { - var nft, txHash; + var nft, tx, error_1, nft_1, txHash; return __generator(this, function (_a) { switch (_a.label) { case 0: - nft = this.eth.contract(this.contractAbis['COLLATERAL_NFT']).at(nftAddr); - return [4 /*yield*/, executeAndRetry(nft.mint, [owner, tokenId, ref, amount, asset, this.ethConfig])]; + nft = this.getContract(nftAddr, 'COLLATERAL_NFT'); + if (!nft) return [3 /*break*/, 4]; + _a.label = 1; case 1: + _a.trys.push([1, 3, , 4]); + return [4 /*yield*/, nft.mint(owner, tokenId, ref, amount, asset)]; + case 2: + tx = _a.sent(); + return [2 /*return*/, { hash: tx.hash, contractKey: 'COLLATERAL_NFT', timesOutAt: 0 }]; + case 3: + error_1 = _a.sent(); + return [2 /*return*/, error_1]; + case 4: + nft_1 = this.eth.contract(this.contractAbis['COLLATERAL_NFT']).at(nftAddr); + return [4 /*yield*/, executeAndRetry(nft_1.mint, [owner, tokenId, ref, amount, asset, this.ethConfig])]; + case 5: txHash = _a.sent(); console.log("[NFT.mint] txHash: " + txHash); return [2 /*return*/, waitAndReturnEvents(this.eth, txHash, this.contractAbis['COLLATERAL_NFT'], this.transactionTimeout)]; @@ -47465,6 +47478,23 @@ var Tinlake = /** @class */ (function () { var contract = this.eth.contract(this.contractAbis[abiName]).at(address); return contract; }; + Tinlake.prototype.getContract = function (address, abiName) { + return this.ethersConfig.signer ? new ethers_2$1.Contract(address, this.contractAbis[abiName], this.ethersConfig.signer) : undefined; + }; + Tinlake.prototype.subscribe = function (tx, callback) { + return __awaiter(this, void 0, void 0, function () { + var response; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, this.ethersConfig.provider.waitForTransaction(tx.hash)]; + case 1: + response = _a.sent(); + callback(response); + return [2 /*return*/]; + } + }); + }); + }; return Tinlake; }()); diff --git a/dist/index.js b/dist/index.js index c44bcb9..e117e93 100644 --- a/dist/index.js +++ b/dist/index.js @@ -29637,13 +29637,26 @@ function CollateralActions(Base) { }); }); }; _this.mintNFT = function (nftAddr, owner, tokenId, ref, amount, asset) { return __awaiter(_this, void 0, void 0, function () { - var nft, txHash; + var nft, tx, error_1, nft_1, txHash; return __generator(this, function (_a) { switch (_a.label) { case 0: - nft = this.eth.contract(this.contractAbis['COLLATERAL_NFT']).at(nftAddr); - return [4 /*yield*/, executeAndRetry(nft.mint, [owner, tokenId, ref, amount, asset, this.ethConfig])]; + nft = this.getContract(nftAddr, 'COLLATERAL_NFT'); + if (!nft) return [3 /*break*/, 4]; + _a.label = 1; case 1: + _a.trys.push([1, 3, , 4]); + return [4 /*yield*/, nft.mint(owner, tokenId, ref, amount, asset)]; + case 2: + tx = _a.sent(); + return [2 /*return*/, { hash: tx.hash, contractKey: 'COLLATERAL_NFT', timesOutAt: 0 }]; + case 3: + error_1 = _a.sent(); + return [2 /*return*/, error_1]; + case 4: + nft_1 = this.eth.contract(this.contractAbis['COLLATERAL_NFT']).at(nftAddr); + return [4 /*yield*/, executeAndRetry(nft_1.mint, [owner, tokenId, ref, amount, asset, this.ethConfig])]; + case 5: txHash = _a.sent(); console.log("[NFT.mint] txHash: " + txHash); return [2 /*return*/, waitAndReturnEvents(this.eth, txHash, this.contractAbis['COLLATERAL_NFT'], this.transactionTimeout)]; @@ -47471,6 +47484,23 @@ var Tinlake = /** @class */ (function () { var contract = this.eth.contract(this.contractAbis[abiName]).at(address); return contract; }; + Tinlake.prototype.getContract = function (address, abiName) { + return this.ethersConfig.signer ? new ethers_2$1.Contract(address, this.contractAbis[abiName], this.ethersConfig.signer) : undefined; + }; + Tinlake.prototype.subscribe = function (tx, callback) { + return __awaiter(this, void 0, void 0, function () { + var response; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, this.ethersConfig.provider.waitForTransaction(tx.hash)]; + case 1: + response = _a.sent(); + callback(response); + return [2 /*return*/]; + } + }); + }); + }; return Tinlake; }()); diff --git a/docs/assets/js/search.js b/docs/assets/js/search.js index 2a88c72..93bafeb 100644 --- a/docs/assets/js/search.js +++ b/docs/assets/js/search.js @@ -1,3 +1,3 @@ var typedoc = typedoc || {}; typedoc.search = typedoc.search || {}; - typedoc.search.data = {"kinds":{"1":"Module","32":"Variable","64":"Function","128":"Class","256":"Interface","512":"Constructor","1024":"Property","2048":"Method","65536":"Type literal","4194304":"Type alias"},"rows":[{"id":0,"kind":1,"name":"\"services/ethereum\"","url":"modules/_services_ethereum_.html","classes":"tsd-kind-module"},{"id":1,"kind":256,"name":"ethI","url":"interfaces/_services_ethereum_.ethi.html","classes":"tsd-kind-interface tsd-parent-kind-module","parent":"\"services/ethereum\""},{"id":2,"kind":1024,"name":"send","url":"interfaces/_services_ethereum_.ethi.html#send","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"services/ethereum\".ethI"},{"id":3,"kind":1024,"name":"web3_sha3","url":"interfaces/_services_ethereum_.ethi.html#web3_sha3","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"services/ethereum\".ethI"},{"id":4,"kind":65536,"name":"__type","url":"interfaces/_services_ethereum_.ethi.html#web3_sha3.__type-3","classes":"tsd-kind-type-literal tsd-parent-kind-property","parent":"\"services/ethereum\".ethI.web3_sha3"},{"id":5,"kind":1024,"name":"getTransactionReceipt","url":"interfaces/_services_ethereum_.ethi.html#gettransactionreceipt","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"services/ethereum\".ethI"},{"id":6,"kind":65536,"name":"__type","url":"interfaces/_services_ethereum_.ethi.html#gettransactionreceipt.__type-2","classes":"tsd-kind-type-literal tsd-parent-kind-property","parent":"\"services/ethereum\".ethI.getTransactionReceipt"},{"id":7,"kind":1024,"name":"getTransactionByHash","url":"interfaces/_services_ethereum_.ethi.html#gettransactionbyhash","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"services/ethereum\".ethI"},{"id":8,"kind":65536,"name":"__type","url":"interfaces/_services_ethereum_.ethi.html#gettransactionbyhash.__type-1","classes":"tsd-kind-type-literal tsd-parent-kind-property","parent":"\"services/ethereum\".ethI.getTransactionByHash"},{"id":9,"kind":1024,"name":"contract","url":"interfaces/_services_ethereum_.ethi.html#contract","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"services/ethereum\".ethI"},{"id":10,"kind":65536,"name":"__type","url":"interfaces/_services_ethereum_.ethi.html#contract.__type","classes":"tsd-kind-type-literal tsd-parent-kind-property","parent":"\"services/ethereum\".ethI.contract"},{"id":11,"kind":1024,"name":"sendRawTransaction","url":"interfaces/_services_ethereum_.ethi.html#sendrawtransaction","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"services/ethereum\".ethI"},{"id":12,"kind":1024,"name":"getTransactionCount","url":"interfaces/_services_ethereum_.ethi.html#gettransactioncount","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"services/ethereum\".ethI"},{"id":13,"kind":1024,"name":"abi","url":"interfaces/_services_ethereum_.ethi.html#abi","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"services/ethereum\".ethI"},{"id":14,"kind":256,"name":"Events","url":"interfaces/_services_ethereum_.events.html","classes":"tsd-kind-interface tsd-parent-kind-module","parent":"\"services/ethereum\""},{"id":15,"kind":1024,"name":"txHash","url":"interfaces/_services_ethereum_.events.html#txhash","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"services/ethereum\".Events"},{"id":16,"kind":1024,"name":"status","url":"interfaces/_services_ethereum_.events.html#status","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"services/ethereum\".Events"},{"id":17,"kind":1024,"name":"events","url":"interfaces/_services_ethereum_.events.html#events","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"services/ethereum\".Events"},{"id":18,"kind":32,"name":"ZERO_ADDRESS","url":"modules/_services_ethereum_.html#zero_address","classes":"tsd-kind-variable tsd-parent-kind-module","parent":"\"services/ethereum\""},{"id":19,"kind":64,"name":"executeAndRetry","url":"modules/_services_ethereum_.html#executeandretry","classes":"tsd-kind-function tsd-parent-kind-module","parent":"\"services/ethereum\""},{"id":20,"kind":64,"name":"waitAndReturnEvents","url":"modules/_services_ethereum_.html#waitandreturnevents","classes":"tsd-kind-function tsd-parent-kind-module","parent":"\"services/ethereum\""},{"id":21,"kind":64,"name":"waitForTransaction","url":"modules/_services_ethereum_.html#waitfortransaction","classes":"tsd-kind-function tsd-parent-kind-module","parent":"\"services/ethereum\""},{"id":22,"kind":64,"name":"findEvent","url":"modules/_services_ethereum_.html#findevent","classes":"tsd-kind-function tsd-parent-kind-module","parent":"\"services/ethereum\""},{"id":23,"kind":1,"name":"\"Tinlake\"","url":"modules/_tinlake_.html","classes":"tsd-kind-module"},{"id":24,"kind":128,"name":"Tinlake","url":"classes/_tinlake_.tinlake.html","classes":"tsd-kind-class tsd-parent-kind-module","parent":"\"Tinlake\""},{"id":25,"kind":1024,"name":"provider","url":"classes/_tinlake_.tinlake.html#provider","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":26,"kind":1024,"name":"eth","url":"classes/_tinlake_.tinlake.html#eth","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":27,"kind":1024,"name":"ethOptions","url":"classes/_tinlake_.tinlake.html#ethoptions","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":28,"kind":1024,"name":"ethConfig","url":"classes/_tinlake_.tinlake.html#ethconfig","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":29,"kind":1024,"name":"ethersConfig","url":"classes/_tinlake_.tinlake.html#ethersconfig","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":30,"kind":1024,"name":"contractAddresses","url":"classes/_tinlake_.tinlake.html#contractaddresses","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":31,"kind":1024,"name":"transactionTimeout","url":"classes/_tinlake_.tinlake.html#transactiontimeout","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":32,"kind":1024,"name":"contracts","url":"classes/_tinlake_.tinlake.html#contracts","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":33,"kind":1024,"name":"contractAbis","url":"classes/_tinlake_.tinlake.html#contractabis","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":34,"kind":1024,"name":"contractConfig","url":"classes/_tinlake_.tinlake.html#contractconfig","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":35,"kind":512,"name":"constructor","url":"classes/_tinlake_.tinlake.html#constructor","classes":"tsd-kind-constructor tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":36,"kind":2048,"name":"setProvider","url":"classes/_tinlake_.tinlake.html#setprovider","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":37,"kind":2048,"name":"setContracts","url":"classes/_tinlake_.tinlake.html#setcontracts","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":38,"kind":2048,"name":"setEthConfig","url":"classes/_tinlake_.tinlake.html#setethconfig","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":39,"kind":2048,"name":"setEthersConfig","url":"classes/_tinlake_.tinlake.html#setethersconfig","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":40,"kind":2048,"name":"createContract","url":"classes/_tinlake_.tinlake.html#createcontract","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":41,"kind":2048,"name":"getOperatorType","url":"classes/_tinlake_.tinlake.html#getoperatortype","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":42,"kind":4194304,"name":"EthConfig","url":"modules/_tinlake_.html#ethconfig","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"Tinlake\""},{"id":43,"kind":65536,"name":"__type","url":"modules/_tinlake_.html#ethconfig.__type-4","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"Tinlake\".EthConfig"},{"id":44,"kind":32,"name":"from","url":"modules/_tinlake_.html#ethconfig.__type-4.from","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".EthConfig.__type"},{"id":45,"kind":32,"name":"gasPrice","url":"modules/_tinlake_.html#ethconfig.__type-4.gasprice","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".EthConfig.__type"},{"id":46,"kind":32,"name":"gas","url":"modules/_tinlake_.html#ethconfig.__type-4.gas","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".EthConfig.__type"},{"id":47,"kind":4194304,"name":"EthersConfig","url":"modules/_tinlake_.html#ethersconfig","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"Tinlake\""},{"id":48,"kind":65536,"name":"__type","url":"modules/_tinlake_.html#ethersconfig.__type-5","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"Tinlake\".EthersConfig"},{"id":49,"kind":32,"name":"provider","url":"modules/_tinlake_.html#ethersconfig.__type-5.provider","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".EthersConfig.__type"},{"id":50,"kind":32,"name":"signer","url":"modules/_tinlake_.html#ethersconfig.__type-5.signer","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".EthersConfig.__type"},{"id":51,"kind":4194304,"name":"ContractNames","url":"modules/_tinlake_.html#contractnames","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"Tinlake\""},{"id":52,"kind":4194304,"name":"Contracts","url":"modules/_tinlake_.html#contracts","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"Tinlake\""},{"id":53,"kind":65536,"name":"__type","url":"modules/_tinlake_.html#contracts.__type-3","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"Tinlake\".Contracts"},{"id":54,"kind":4194304,"name":"ContractAbis","url":"modules/_tinlake_.html#contractabis","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"Tinlake\""},{"id":55,"kind":65536,"name":"__type","url":"modules/_tinlake_.html#contractabis.__type-1","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"Tinlake\".ContractAbis"},{"id":56,"kind":4194304,"name":"ContractAddresses","url":"modules/_tinlake_.html#contractaddresses","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"Tinlake\""},{"id":57,"kind":65536,"name":"__type","url":"modules/_tinlake_.html#contractaddresses.__type-2","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"Tinlake\".ContractAddresses"},{"id":58,"kind":4194304,"name":"TinlakeParams","url":"modules/_tinlake_.html#tinlakeparams","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"Tinlake\""},{"id":59,"kind":65536,"name":"__type","url":"modules/_tinlake_.html#tinlakeparams.__type-6","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"Tinlake\".TinlakeParams"},{"id":60,"kind":32,"name":"provider","url":"modules/_tinlake_.html#tinlakeparams.__type-6.provider-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".TinlakeParams.__type"},{"id":61,"kind":32,"name":"transactionTimeout","url":"modules/_tinlake_.html#tinlakeparams.__type-6.transactiontimeout","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".TinlakeParams.__type"},{"id":62,"kind":32,"name":"contractAddresses","url":"modules/_tinlake_.html#tinlakeparams.__type-6.contractaddresses-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".TinlakeParams.__type"},{"id":63,"kind":32,"name":"contractAbis","url":"modules/_tinlake_.html#tinlakeparams.__type-6.contractabis-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".TinlakeParams.__type"},{"id":64,"kind":32,"name":"ethConfig","url":"modules/_tinlake_.html#tinlakeparams.__type-6.ethconfig-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".TinlakeParams.__type"},{"id":65,"kind":32,"name":"ethersConfig","url":"modules/_tinlake_.html#tinlakeparams.__type-6.ethersconfig-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".TinlakeParams.__type"},{"id":66,"kind":32,"name":"ethOptions","url":"modules/_tinlake_.html#tinlakeparams.__type-6.ethoptions","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".TinlakeParams.__type"},{"id":67,"kind":32,"name":"contracts","url":"modules/_tinlake_.html#tinlakeparams.__type-6.contracts-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".TinlakeParams.__type"},{"id":68,"kind":32,"name":"contractConfig","url":"modules/_tinlake_.html#tinlakeparams.__type-6.contractconfig","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".TinlakeParams.__type"},{"id":69,"kind":4194304,"name":"Constructor","url":"modules/_tinlake_.html#constructor","classes":"tsd-kind-type-alias tsd-parent-kind-module tsd-has-type-parameter","parent":"\"Tinlake\""},{"id":70,"kind":65536,"name":"__type","url":"modules/_tinlake_.html#constructor.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"Tinlake\".Constructor"},{"id":71,"kind":1,"name":"\"actions/admin\"","url":"modules/_actions_admin_.html","classes":"tsd-kind-module"},{"id":72,"kind":64,"name":"AdminActions","url":"modules/_actions_admin_.html#adminactions","classes":"tsd-kind-function tsd-parent-kind-module tsd-has-type-parameter","parent":"\"actions/admin\""},{"id":73,"kind":4194304,"name":"IAdminActions","url":"modules/_actions_admin_.html#iadminactions","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"actions/admin\""},{"id":74,"kind":65536,"name":"__type","url":"modules/_actions_admin_.html#iadminactions.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"actions/admin\".IAdminActions"},{"id":75,"kind":64,"name":"isWard","url":"modules/_actions_admin_.html#iadminactions.__type.isward","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":76,"kind":64,"name":"canSetInterestRate","url":"modules/_actions_admin_.html#iadminactions.__type.cansetinterestrate","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":77,"kind":64,"name":"canSetSeniorTrancheInterest","url":"modules/_actions_admin_.html#iadminactions.__type.cansetseniortrancheinterest","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":78,"kind":64,"name":"canSetMinimumJuniorRatio","url":"modules/_actions_admin_.html#iadminactions.__type.cansetminimumjuniorratio","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":79,"kind":64,"name":"canSetRiskScore","url":"modules/_actions_admin_.html#iadminactions.__type.cansetriskscore","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":80,"kind":64,"name":"canSetInvestorAllowanceJunior","url":"modules/_actions_admin_.html#iadminactions.__type.cansetinvestorallowancejunior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":81,"kind":64,"name":"canSetInvestorAllowanceSenior","url":"modules/_actions_admin_.html#iadminactions.__type.cansetinvestorallowancesenior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":82,"kind":64,"name":"canSetLoanPrice","url":"modules/_actions_admin_.html#iadminactions.__type.cansetloanprice","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":83,"kind":64,"name":"initRate","url":"modules/_actions_admin_.html#iadminactions.__type.initrate","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":84,"kind":64,"name":"setRate","url":"modules/_actions_admin_.html#iadminactions.__type.setrate","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":85,"kind":64,"name":"setMinimumJuniorRatio","url":"modules/_actions_admin_.html#iadminactions.__type.setminimumjuniorratio","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":86,"kind":64,"name":"approveAllowanceJunior","url":"modules/_actions_admin_.html#iadminactions.__type.approveallowancejunior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":87,"kind":64,"name":"approveAllowanceSenior","url":"modules/_actions_admin_.html#iadminactions.__type.approveallowancesenior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":88,"kind":1,"name":"\"actions/borrower\"","url":"modules/_actions_borrower_.html","classes":"tsd-kind-module"},{"id":89,"kind":64,"name":"BorrowerActions","url":"modules/_actions_borrower_.html#borroweractions","classes":"tsd-kind-function tsd-parent-kind-module tsd-has-type-parameter","parent":"\"actions/borrower\""},{"id":90,"kind":4194304,"name":"IBorrowerActions","url":"modules/_actions_borrower_.html#iborroweractions","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"actions/borrower\""},{"id":91,"kind":65536,"name":"__type","url":"modules/_actions_borrower_.html#iborroweractions.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"actions/borrower\".IBorrowerActions"},{"id":92,"kind":64,"name":"issue","url":"modules/_actions_borrower_.html#iborroweractions.__type.issue","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/borrower\".IBorrowerActions.__type"},{"id":93,"kind":64,"name":"nftLookup","url":"modules/_actions_borrower_.html#iborroweractions.__type.nftlookup","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/borrower\".IBorrowerActions.__type"},{"id":94,"kind":64,"name":"lock","url":"modules/_actions_borrower_.html#iborroweractions.__type.lock","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/borrower\".IBorrowerActions.__type"},{"id":95,"kind":64,"name":"unlock","url":"modules/_actions_borrower_.html#iborroweractions.__type.unlock","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/borrower\".IBorrowerActions.__type"},{"id":96,"kind":64,"name":"close","url":"modules/_actions_borrower_.html#iborroweractions.__type.close","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/borrower\".IBorrowerActions.__type"},{"id":97,"kind":64,"name":"borrow","url":"modules/_actions_borrower_.html#iborroweractions.__type.borrow","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/borrower\".IBorrowerActions.__type"},{"id":98,"kind":64,"name":"withdraw","url":"modules/_actions_borrower_.html#iborroweractions.__type.withdraw","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/borrower\".IBorrowerActions.__type"},{"id":99,"kind":64,"name":"repay","url":"modules/_actions_borrower_.html#iborroweractions.__type.repay","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/borrower\".IBorrowerActions.__type"},{"id":100,"kind":1,"name":"\"actions/lender\"","url":"modules/_actions_lender_.html","classes":"tsd-kind-module"},{"id":101,"kind":64,"name":"LenderActions","url":"modules/_actions_lender_.html#lenderactions","classes":"tsd-kind-function tsd-parent-kind-module tsd-has-type-parameter","parent":"\"actions/lender\""},{"id":102,"kind":4194304,"name":"ILenderActions","url":"modules/_actions_lender_.html#ilenderactions","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"actions/lender\""},{"id":103,"kind":65536,"name":"__type","url":"modules/_actions_lender_.html#ilenderactions.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"actions/lender\".ILenderActions"},{"id":104,"kind":64,"name":"getSeniorTokenAllowance","url":"modules/_actions_lender_.html#ilenderactions.__type.getseniortokenallowance","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/lender\".ILenderActions.__type"},{"id":105,"kind":64,"name":"getJuniorTokenAllowance","url":"modules/_actions_lender_.html#ilenderactions.__type.getjuniortokenallowance","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/lender\".ILenderActions.__type"},{"id":106,"kind":64,"name":"supplyJunior","url":"modules/_actions_lender_.html#ilenderactions.__type.supplyjunior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/lender\".ILenderActions.__type"},{"id":107,"kind":32,"name":"approveJuniorToken","url":"modules/_actions_lender_.html#ilenderactions.__type.approvejuniortoken","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"actions/lender\".ILenderActions.__type"},{"id":108,"kind":65536,"name":"__type","url":"modules/_actions_lender_.html#ilenderactions.__type.approvejuniortoken.__type-1","classes":"tsd-kind-type-literal tsd-parent-kind-variable","parent":"\"actions/lender\".ILenderActions.__type.approveJuniorToken"},{"id":109,"kind":32,"name":"approveSeniorToken","url":"modules/_actions_lender_.html#ilenderactions.__type.approveseniortoken","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"actions/lender\".ILenderActions.__type"},{"id":110,"kind":65536,"name":"__type","url":"modules/_actions_lender_.html#ilenderactions.__type.approveseniortoken.__type-2","classes":"tsd-kind-type-literal tsd-parent-kind-variable","parent":"\"actions/lender\".ILenderActions.__type.approveSeniorToken"},{"id":111,"kind":64,"name":"redeemJunior","url":"modules/_actions_lender_.html#ilenderactions.__type.redeemjunior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/lender\".ILenderActions.__type"},{"id":112,"kind":64,"name":"supplySenior","url":"modules/_actions_lender_.html#ilenderactions.__type.supplysenior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/lender\".ILenderActions.__type"},{"id":113,"kind":64,"name":"redeemSenior","url":"modules/_actions_lender_.html#ilenderactions.__type.redeemsenior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/lender\".ILenderActions.__type"},{"id":114,"kind":64,"name":"balance","url":"modules/_actions_lender_.html#ilenderactions.__type.balance","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/lender\".ILenderActions.__type"},{"id":115,"kind":1,"name":"\"actions/currency\"","url":"modules/_actions_currency_.html","classes":"tsd-kind-module"},{"id":116,"kind":64,"name":"CurrencyActions","url":"modules/_actions_currency_.html#currencyactions","classes":"tsd-kind-function tsd-parent-kind-module tsd-has-type-parameter","parent":"\"actions/currency\""},{"id":117,"kind":4194304,"name":"ICurrencyActions","url":"modules/_actions_currency_.html#icurrencyactions","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"actions/currency\""},{"id":118,"kind":65536,"name":"__type","url":"modules/_actions_currency_.html#icurrencyactions.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"actions/currency\".ICurrencyActions"},{"id":119,"kind":64,"name":"mintCurrency","url":"modules/_actions_currency_.html#icurrencyactions.__type.mintcurrency","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/currency\".ICurrencyActions.__type"},{"id":120,"kind":64,"name":"getCurrencyBalance","url":"modules/_actions_currency_.html#icurrencyactions.__type.getcurrencybalance","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/currency\".ICurrencyActions.__type"},{"id":121,"kind":64,"name":"approveCurrency","url":"modules/_actions_currency_.html#icurrencyactions.__type.approvecurrency","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/currency\".ICurrencyActions.__type"},{"id":122,"kind":32,"name":"getCurrencyAllowance","url":"modules/_actions_currency_.html#icurrencyactions.__type.getcurrencyallowance","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"actions/currency\".ICurrencyActions.__type"},{"id":123,"kind":65536,"name":"__type","url":"modules/_actions_currency_.html#icurrencyactions.__type.getcurrencyallowance.__type-3","classes":"tsd-kind-type-literal tsd-parent-kind-variable","parent":"\"actions/currency\".ICurrencyActions.__type.getCurrencyAllowance"},{"id":124,"kind":32,"name":"getJuniorForCurrencyAllowance","url":"modules/_actions_currency_.html#icurrencyactions.__type.getjuniorforcurrencyallowance","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"actions/currency\".ICurrencyActions.__type"},{"id":125,"kind":65536,"name":"__type","url":"modules/_actions_currency_.html#icurrencyactions.__type.getjuniorforcurrencyallowance.__type-4","classes":"tsd-kind-type-literal tsd-parent-kind-variable","parent":"\"actions/currency\".ICurrencyActions.__type.getJuniorForCurrencyAllowance"},{"id":126,"kind":32,"name":"getSeniorForCurrencyAllowance","url":"modules/_actions_currency_.html#icurrencyactions.__type.getseniorforcurrencyallowance","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"actions/currency\".ICurrencyActions.__type"},{"id":127,"kind":65536,"name":"__type","url":"modules/_actions_currency_.html#icurrencyactions.__type.getseniorforcurrencyallowance.__type-5","classes":"tsd-kind-type-literal tsd-parent-kind-variable","parent":"\"actions/currency\".ICurrencyActions.__type.getSeniorForCurrencyAllowance"},{"id":128,"kind":32,"name":"approveSeniorForCurrency","url":"modules/_actions_currency_.html#icurrencyactions.__type.approveseniorforcurrency","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"actions/currency\".ICurrencyActions.__type"},{"id":129,"kind":65536,"name":"__type","url":"modules/_actions_currency_.html#icurrencyactions.__type.approveseniorforcurrency.__type-2","classes":"tsd-kind-type-literal tsd-parent-kind-variable","parent":"\"actions/currency\".ICurrencyActions.__type.approveSeniorForCurrency"},{"id":130,"kind":32,"name":"approveJuniorForCurrency","url":"modules/_actions_currency_.html#icurrencyactions.__type.approvejuniorforcurrency","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"actions/currency\".ICurrencyActions.__type"},{"id":131,"kind":65536,"name":"__type","url":"modules/_actions_currency_.html#icurrencyactions.__type.approvejuniorforcurrency.__type-1","classes":"tsd-kind-type-literal tsd-parent-kind-variable","parent":"\"actions/currency\".ICurrencyActions.__type.approveJuniorForCurrency"},{"id":132,"kind":1,"name":"\"actions/collateral\"","url":"modules/_actions_collateral_.html","classes":"tsd-kind-module"},{"id":133,"kind":64,"name":"CollateralActions","url":"modules/_actions_collateral_.html#collateralactions","classes":"tsd-kind-function tsd-parent-kind-module tsd-has-type-parameter","parent":"\"actions/collateral\""},{"id":134,"kind":4194304,"name":"ICollateralActions","url":"modules/_actions_collateral_.html#icollateralactions","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"actions/collateral\""},{"id":135,"kind":65536,"name":"__type","url":"modules/_actions_collateral_.html#icollateralactions.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"actions/collateral\".ICollateralActions"},{"id":136,"kind":64,"name":"mintTitleNFT","url":"modules/_actions_collateral_.html#icollateralactions.__type.minttitlenft","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/collateral\".ICollateralActions.__type"},{"id":137,"kind":64,"name":"mintNFT","url":"modules/_actions_collateral_.html#icollateralactions.__type.mintnft","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/collateral\".ICollateralActions.__type"},{"id":138,"kind":64,"name":"approveNFT","url":"modules/_actions_collateral_.html#icollateralactions.__type.approvenft","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/collateral\".ICollateralActions.__type"},{"id":139,"kind":64,"name":"setNFTApprovalForAll","url":"modules/_actions_collateral_.html#icollateralactions.__type.setnftapprovalforall","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/collateral\".ICollateralActions.__type"},{"id":140,"kind":64,"name":"isNFTApprovedForAll","url":"modules/_actions_collateral_.html#icollateralactions.__type.isnftapprovedforall","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/collateral\".ICollateralActions.__type"},{"id":141,"kind":64,"name":"getNFTCount","url":"modules/_actions_collateral_.html#icollateralactions.__type.getnftcount","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/collateral\".ICollateralActions.__type"},{"id":142,"kind":64,"name":"getNFTData","url":"modules/_actions_collateral_.html#icollateralactions.__type.getnftdata","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/collateral\".ICollateralActions.__type"},{"id":143,"kind":64,"name":"getNFTOwner","url":"modules/_actions_collateral_.html#icollateralactions.__type.getnftowner","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/collateral\".ICollateralActions.__type"},{"id":144,"kind":64,"name":"transferNFT","url":"modules/_actions_collateral_.html#icollateralactions.__type.transfernft","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/collateral\".ICollateralActions.__type"},{"id":145,"kind":1,"name":"\"actions/governance\"","url":"modules/_actions_governance_.html","classes":"tsd-kind-module"},{"id":146,"kind":4194304,"name":"IGovernanceActions","url":"modules/_actions_governance_.html#igovernanceactions","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"actions/governance\""},{"id":147,"kind":65536,"name":"__type","url":"modules/_actions_governance_.html#igovernanceactions.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"actions/governance\".IGovernanceActions"},{"id":148,"kind":64,"name":"relyAddress","url":"modules/_actions_governance_.html#igovernanceactions.__type.relyaddress","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/governance\".IGovernanceActions.__type"},{"id":149,"kind":1,"name":"\"actions/proxy\"","url":"modules/_actions_proxy_.html","classes":"tsd-kind-module"},{"id":150,"kind":64,"name":"ProxyActions","url":"modules/_actions_proxy_.html#proxyactions","classes":"tsd-kind-function tsd-parent-kind-module tsd-has-type-parameter","parent":"\"actions/proxy\""},{"id":151,"kind":4194304,"name":"IProxyActions","url":"modules/_actions_proxy_.html#iproxyactions","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"actions/proxy\""},{"id":152,"kind":65536,"name":"__type","url":"modules/_actions_proxy_.html#iproxyactions.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"actions/proxy\".IProxyActions"},{"id":153,"kind":64,"name":"buildProxy","url":"modules/_actions_proxy_.html#iproxyactions.__type.buildproxy","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":154,"kind":64,"name":"checkProxyExists","url":"modules/_actions_proxy_.html#iproxyactions.__type.checkproxyexists","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":155,"kind":64,"name":"getProxy","url":"modules/_actions_proxy_.html#iproxyactions.__type.getproxy","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":156,"kind":64,"name":"proxyCount","url":"modules/_actions_proxy_.html#iproxyactions.__type.proxycount","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":157,"kind":64,"name":"getProxyAccessToken","url":"modules/_actions_proxy_.html#iproxyactions.__type.getproxyaccesstoken","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":158,"kind":64,"name":"getProxyAccessTokenOwner","url":"modules/_actions_proxy_.html#iproxyactions.__type.getproxyaccesstokenowner","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":159,"kind":64,"name":"getProxyOwnerByLoan","url":"modules/_actions_proxy_.html#iproxyactions.__type.getproxyownerbyloan","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":160,"kind":64,"name":"getProxyOwnerByAddress","url":"modules/_actions_proxy_.html#iproxyactions.__type.getproxyownerbyaddress","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":161,"kind":64,"name":"proxyCreateNew","url":"modules/_actions_proxy_.html#iproxyactions.__type.proxycreatenew","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":162,"kind":64,"name":"proxyIssue","url":"modules/_actions_proxy_.html#iproxyactions.__type.proxyissue","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":163,"kind":64,"name":"proxyTransferIssue","url":"modules/_actions_proxy_.html#iproxyactions.__type.proxytransferissue","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":164,"kind":64,"name":"proxyLockBorrowWithdraw","url":"modules/_actions_proxy_.html#iproxyactions.__type.proxylockborrowwithdraw","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":165,"kind":64,"name":"proxyRepayUnlockClose","url":"modules/_actions_proxy_.html#iproxyactions.__type.proxyrepayunlockclose","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":166,"kind":1,"name":"\"actions/index\"","url":"modules/_actions_index_.html","classes":"tsd-kind-module"},{"id":167,"kind":4194304,"name":"TinlakeActions","url":"modules/_actions_index_.html#tinlakeactions","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"actions/index\""},{"id":168,"kind":1,"name":"\"types/tinlake\"","url":"modules/_types_tinlake_.html","classes":"tsd-kind-module"},{"id":169,"kind":4194304,"name":"Loan","url":"modules/_types_tinlake_.html#loan","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"types/tinlake\""},{"id":170,"kind":65536,"name":"__type","url":"modules/_types_tinlake_.html#loan.__type-3","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"types/tinlake\".Loan"},{"id":171,"kind":32,"name":"loanId","url":"modules/_types_tinlake_.html#loan.__type-3.loanid","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":172,"kind":32,"name":"registry","url":"modules/_types_tinlake_.html#loan.__type-3.registry","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":173,"kind":32,"name":"tokenId","url":"modules/_types_tinlake_.html#loan.__type-3.tokenid","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":174,"kind":32,"name":"ownerOf","url":"modules/_types_tinlake_.html#loan.__type-3.ownerof","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":175,"kind":32,"name":"principal","url":"modules/_types_tinlake_.html#loan.__type-3.principal","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":176,"kind":32,"name":"interestRate","url":"modules/_types_tinlake_.html#loan.__type-3.interestrate","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":177,"kind":32,"name":"debt","url":"modules/_types_tinlake_.html#loan.__type-3.debt","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":178,"kind":32,"name":"threshold","url":"modules/_types_tinlake_.html#loan.__type-3.threshold","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":179,"kind":32,"name":"price","url":"modules/_types_tinlake_.html#loan.__type-3.price","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":180,"kind":32,"name":"status","url":"modules/_types_tinlake_.html#loan.__type-3.status","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":181,"kind":32,"name":"nft","url":"modules/_types_tinlake_.html#loan.__type-3.nft","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":182,"kind":32,"name":"proxyOwner","url":"modules/_types_tinlake_.html#loan.__type-3.proxyowner","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":183,"kind":4194304,"name":"Tranche","url":"modules/_types_tinlake_.html#tranche","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"types/tinlake\""},{"id":184,"kind":65536,"name":"__type","url":"modules/_types_tinlake_.html#tranche.__type-5","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"types/tinlake\".Tranche"},{"id":185,"kind":32,"name":"availableFunds","url":"modules/_types_tinlake_.html#tranche.__type-5.availablefunds","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Tranche.__type"},{"id":186,"kind":32,"name":"tokenPrice","url":"modules/_types_tinlake_.html#tranche.__type-5.tokenprice","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Tranche.__type"},{"id":187,"kind":32,"name":"type","url":"modules/_types_tinlake_.html#tranche.__type-5.type","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Tranche.__type"},{"id":188,"kind":32,"name":"token","url":"modules/_types_tinlake_.html#tranche.__type-5.token","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Tranche.__type"},{"id":189,"kind":32,"name":"totalSupply","url":"modules/_types_tinlake_.html#tranche.__type-5.totalsupply","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Tranche.__type"},{"id":190,"kind":32,"name":"interestRate","url":"modules/_types_tinlake_.html#tranche.__type-5.interestrate-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Tranche.__type"},{"id":191,"kind":4194304,"name":"NFT","url":"modules/_types_tinlake_.html#nft-1","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"types/tinlake\""},{"id":192,"kind":65536,"name":"__type","url":"modules/_types_tinlake_.html#nft-1.__type-4","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"types/tinlake\".NFT"},{"id":193,"kind":32,"name":"registry","url":"modules/_types_tinlake_.html#nft-1.__type-4.registry-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".NFT.__type"},{"id":194,"kind":32,"name":"tokenId","url":"modules/_types_tinlake_.html#nft-1.__type-4.tokenid-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".NFT.__type"},{"id":195,"kind":32,"name":"nftOwner","url":"modules/_types_tinlake_.html#nft-1.__type-4.nftowner","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".NFT.__type"},{"id":196,"kind":32,"name":"nftData","url":"modules/_types_tinlake_.html#nft-1.__type-4.nftdata","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".NFT.__type"},{"id":197,"kind":4194304,"name":"Investor","url":"modules/_types_tinlake_.html#investor","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"types/tinlake\""},{"id":198,"kind":65536,"name":"__type","url":"modules/_types_tinlake_.html#investor.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"types/tinlake\".Investor"},{"id":199,"kind":32,"name":"junior","url":"modules/_types_tinlake_.html#investor.__type.junior","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Investor.__type"},{"id":200,"kind":65536,"name":"__type","url":"modules/_types_tinlake_.html#investor.__type.junior.__type-1","classes":"tsd-kind-type-literal tsd-parent-kind-variable","parent":"\"types/tinlake\".Investor.__type.junior"},{"id":201,"kind":32,"name":"maxSupply","url":"modules/_types_tinlake_.html#investor.__type.junior.__type-1.maxsupply","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Investor.__type.junior.__type"},{"id":202,"kind":32,"name":"tokenBalance","url":"modules/_types_tinlake_.html#investor.__type.junior.__type-1.tokenbalance","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Investor.__type.junior.__type"},{"id":203,"kind":32,"name":"maxRedeem","url":"modules/_types_tinlake_.html#investor.__type.junior.__type-1.maxredeem","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Investor.__type.junior.__type"},{"id":204,"kind":32,"name":"senior","url":"modules/_types_tinlake_.html#investor.__type.senior","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Investor.__type"},{"id":205,"kind":65536,"name":"__type","url":"modules/_types_tinlake_.html#investor.__type.senior.__type-2","classes":"tsd-kind-type-literal tsd-parent-kind-variable","parent":"\"types/tinlake\".Investor.__type.senior"},{"id":206,"kind":32,"name":"maxSupply","url":"modules/_types_tinlake_.html#investor.__type.senior.__type-2.maxsupply-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Investor.__type.senior.__type"},{"id":207,"kind":32,"name":"tokenBalance","url":"modules/_types_tinlake_.html#investor.__type.senior.__type-2.tokenbalance-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Investor.__type.senior.__type"},{"id":208,"kind":32,"name":"maxRedeem","url":"modules/_types_tinlake_.html#investor.__type.senior.__type-2.maxredeem-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Investor.__type.senior.__type"},{"id":209,"kind":32,"name":"address","url":"modules/_types_tinlake_.html#investor.__type.address","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Investor.__type"},{"id":210,"kind":4194304,"name":"ITinlake","url":"modules/_types_tinlake_.html#itinlake","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"types/tinlake\""},{"id":211,"kind":1,"name":"\"actions/analytics\"","url":"modules/_actions_analytics_.html","classes":"tsd-kind-module"},{"id":212,"kind":64,"name":"AnalyticsActions","url":"modules/_actions_analytics_.html#analyticsactions","classes":"tsd-kind-function tsd-parent-kind-module tsd-has-type-parameter","parent":"\"actions/analytics\""},{"id":213,"kind":4194304,"name":"IAnalyticsActions","url":"modules/_actions_analytics_.html#ianalyticsactions","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"actions/analytics\""},{"id":214,"kind":65536,"name":"__type","url":"modules/_actions_analytics_.html#ianalyticsactions.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"actions/analytics\".IAnalyticsActions"},{"id":215,"kind":64,"name":"getTotalDebt","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.gettotaldebt","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":216,"kind":64,"name":"getTotalBalance","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.gettotalbalance","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":217,"kind":64,"name":"getDebt","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getdebt","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":218,"kind":64,"name":"loanCount","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.loancount","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":219,"kind":64,"name":"getLoanList","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getloanlist","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":220,"kind":64,"name":"getLoan","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getloan","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":221,"kind":64,"name":"getCollateral","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getcollateral","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":222,"kind":64,"name":"getPrincipal","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getprincipal","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":223,"kind":64,"name":"getInterestRate","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getinterestrate","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":224,"kind":64,"name":"getOwnerOfLoan","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getownerofloan","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":225,"kind":64,"name":"getOwnerOfCollateral","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getownerofcollateral","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":226,"kind":64,"name":"existsSenior","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.existssenior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":227,"kind":64,"name":"getJuniorReserve","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getjuniorreserve","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":228,"kind":64,"name":"getSeniorReserve","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getseniorreserve","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":229,"kind":64,"name":"getJuniorTokenBalance","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getjuniortokenbalance","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":230,"kind":64,"name":"getSeniorTokenBalance","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getseniortokenbalance","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":231,"kind":64,"name":"getMaxSupplyAmountJunior","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getmaxsupplyamountjunior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":232,"kind":64,"name":"getMaxRedeemAmountJunior","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getmaxredeemamountjunior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":233,"kind":64,"name":"getMaxSupplyAmountSenior","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getmaxsupplyamountsenior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":234,"kind":64,"name":"getMaxRedeemAmountSenior","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getmaxredeemamountsenior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":235,"kind":64,"name":"getTokenPriceJunior","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.gettokenpricejunior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":236,"kind":64,"name":"getTokenPriceSenior","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.gettokenpricesenior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":237,"kind":64,"name":"getSeniorDebt","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getseniordebt","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":238,"kind":64,"name":"getSeniorInterestRate","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getseniorinterestrate","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":239,"kind":64,"name":"getMinJuniorRatio","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getminjuniorratio","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":240,"kind":64,"name":"getCurrentJuniorRatio","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getcurrentjuniorratio","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":241,"kind":64,"name":"getAssetValueJunior","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getassetvaluejunior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":242,"kind":64,"name":"getInvestor","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getinvestor","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":243,"kind":1,"name":"\"utils/baseToDisplay\"","url":"modules/_utils_basetodisplay_.html","classes":"tsd-kind-module"},{"id":244,"kind":64,"name":"baseToDisplay","url":"modules/_utils_basetodisplay_.html#basetodisplay","classes":"tsd-kind-function tsd-parent-kind-module","parent":"\"utils/baseToDisplay\""},{"id":245,"kind":1,"name":"\"utils/baseToDisplay.spec\"","url":"modules/_utils_basetodisplay_spec_.html","classes":"tsd-kind-module"},{"id":246,"kind":1,"name":"\"utils/bnToHex\"","url":"modules/_utils_bntohex_.html","classes":"tsd-kind-module"},{"id":247,"kind":64,"name":"bnToHex","url":"modules/_utils_bntohex_.html#bntohex","classes":"tsd-kind-function tsd-parent-kind-module","parent":"\"utils/bnToHex\""},{"id":248,"kind":1,"name":"\"utils/bnToHex.spec\"","url":"modules/_utils_bntohex_spec_.html","classes":"tsd-kind-module"},{"id":249,"kind":1,"name":"\"utils/displayToBase\"","url":"modules/_utils_displaytobase_.html","classes":"tsd-kind-module"},{"id":250,"kind":64,"name":"displayToBase","url":"modules/_utils_displaytobase_.html#displaytobase","classes":"tsd-kind-function tsd-parent-kind-module","parent":"\"utils/displayToBase\""},{"id":251,"kind":1,"name":"\"utils/displayToBase.spec\"","url":"modules/_utils_displaytobase_spec_.html","classes":"tsd-kind-module"},{"id":252,"kind":1,"name":"\"utils/feeToInterestRate\"","url":"modules/_utils_feetointerestrate_.html","classes":"tsd-kind-module"},{"id":253,"kind":64,"name":"feeToInterestRate","url":"modules/_utils_feetointerestrate_.html#feetointerestrate","classes":"tsd-kind-function tsd-parent-kind-module","parent":"\"utils/feeToInterestRate\""},{"id":254,"kind":1,"name":"\"utils/feeToInterestRate.spec\"","url":"modules/_utils_feetointerestrate_spec_.html","classes":"tsd-kind-module"},{"id":255,"kind":1,"name":"\"utils/getLoanStatus\"","url":"modules/_utils_getloanstatus_.html","classes":"tsd-kind-module"},{"id":256,"kind":4194304,"name":"LoanStatus","url":"modules/_utils_getloanstatus_.html#loanstatus","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"utils/getLoanStatus\""},{"id":257,"kind":64,"name":"getLoanStatus","url":"modules/_utils_getloanstatus_.html#getloanstatus","classes":"tsd-kind-function tsd-parent-kind-module","parent":"\"utils/getLoanStatus\""},{"id":258,"kind":1,"name":"\"utils/interestRateToFee\"","url":"modules/_utils_interestratetofee_.html","classes":"tsd-kind-module"},{"id":259,"kind":64,"name":"interestRateToFee","url":"modules/_utils_interestratetofee_.html#interestratetofee","classes":"tsd-kind-function tsd-parent-kind-module","parent":"\"utils/interestRateToFee\""},{"id":260,"kind":1,"name":"\"utils/interestRateToFee.spec\"","url":"modules/_utils_interestratetofee_spec_.html","classes":"tsd-kind-module"}]}; \ No newline at end of file + typedoc.search.data = {"kinds":{"1":"Module","32":"Variable","64":"Function","128":"Class","256":"Interface","512":"Constructor","1024":"Property","2048":"Method","65536":"Type literal","4194304":"Type alias"},"rows":[{"id":0,"kind":1,"name":"\"services/ethereum\"","url":"modules/_services_ethereum_.html","classes":"tsd-kind-module"},{"id":1,"kind":256,"name":"ethI","url":"interfaces/_services_ethereum_.ethi.html","classes":"tsd-kind-interface tsd-parent-kind-module","parent":"\"services/ethereum\""},{"id":2,"kind":1024,"name":"send","url":"interfaces/_services_ethereum_.ethi.html#send","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"services/ethereum\".ethI"},{"id":3,"kind":1024,"name":"web3_sha3","url":"interfaces/_services_ethereum_.ethi.html#web3_sha3","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"services/ethereum\".ethI"},{"id":4,"kind":65536,"name":"__type","url":"interfaces/_services_ethereum_.ethi.html#web3_sha3.__type-3","classes":"tsd-kind-type-literal tsd-parent-kind-property","parent":"\"services/ethereum\".ethI.web3_sha3"},{"id":5,"kind":1024,"name":"getTransactionReceipt","url":"interfaces/_services_ethereum_.ethi.html#gettransactionreceipt","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"services/ethereum\".ethI"},{"id":6,"kind":65536,"name":"__type","url":"interfaces/_services_ethereum_.ethi.html#gettransactionreceipt.__type-2","classes":"tsd-kind-type-literal tsd-parent-kind-property","parent":"\"services/ethereum\".ethI.getTransactionReceipt"},{"id":7,"kind":1024,"name":"getTransactionByHash","url":"interfaces/_services_ethereum_.ethi.html#gettransactionbyhash","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"services/ethereum\".ethI"},{"id":8,"kind":65536,"name":"__type","url":"interfaces/_services_ethereum_.ethi.html#gettransactionbyhash.__type-1","classes":"tsd-kind-type-literal tsd-parent-kind-property","parent":"\"services/ethereum\".ethI.getTransactionByHash"},{"id":9,"kind":1024,"name":"contract","url":"interfaces/_services_ethereum_.ethi.html#contract","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"services/ethereum\".ethI"},{"id":10,"kind":65536,"name":"__type","url":"interfaces/_services_ethereum_.ethi.html#contract.__type","classes":"tsd-kind-type-literal tsd-parent-kind-property","parent":"\"services/ethereum\".ethI.contract"},{"id":11,"kind":1024,"name":"sendRawTransaction","url":"interfaces/_services_ethereum_.ethi.html#sendrawtransaction","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"services/ethereum\".ethI"},{"id":12,"kind":1024,"name":"getTransactionCount","url":"interfaces/_services_ethereum_.ethi.html#gettransactioncount","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"services/ethereum\".ethI"},{"id":13,"kind":1024,"name":"abi","url":"interfaces/_services_ethereum_.ethi.html#abi","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"services/ethereum\".ethI"},{"id":14,"kind":256,"name":"Events","url":"interfaces/_services_ethereum_.events.html","classes":"tsd-kind-interface tsd-parent-kind-module","parent":"\"services/ethereum\""},{"id":15,"kind":1024,"name":"txHash","url":"interfaces/_services_ethereum_.events.html#txhash","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"services/ethereum\".Events"},{"id":16,"kind":1024,"name":"status","url":"interfaces/_services_ethereum_.events.html#status","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"services/ethereum\".Events"},{"id":17,"kind":1024,"name":"events","url":"interfaces/_services_ethereum_.events.html#events","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"services/ethereum\".Events"},{"id":18,"kind":32,"name":"ZERO_ADDRESS","url":"modules/_services_ethereum_.html#zero_address","classes":"tsd-kind-variable tsd-parent-kind-module","parent":"\"services/ethereum\""},{"id":19,"kind":64,"name":"executeAndRetry","url":"modules/_services_ethereum_.html#executeandretry","classes":"tsd-kind-function tsd-parent-kind-module","parent":"\"services/ethereum\""},{"id":20,"kind":64,"name":"waitAndReturnEvents","url":"modules/_services_ethereum_.html#waitandreturnevents","classes":"tsd-kind-function tsd-parent-kind-module","parent":"\"services/ethereum\""},{"id":21,"kind":64,"name":"waitForTransaction","url":"modules/_services_ethereum_.html#waitfortransaction","classes":"tsd-kind-function tsd-parent-kind-module","parent":"\"services/ethereum\""},{"id":22,"kind":64,"name":"findEvent","url":"modules/_services_ethereum_.html#findevent","classes":"tsd-kind-function tsd-parent-kind-module","parent":"\"services/ethereum\""},{"id":23,"kind":1,"name":"\"Tinlake\"","url":"modules/_tinlake_.html","classes":"tsd-kind-module"},{"id":24,"kind":128,"name":"Tinlake","url":"classes/_tinlake_.tinlake.html","classes":"tsd-kind-class tsd-parent-kind-module","parent":"\"Tinlake\""},{"id":25,"kind":1024,"name":"provider","url":"classes/_tinlake_.tinlake.html#provider","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":26,"kind":1024,"name":"eth","url":"classes/_tinlake_.tinlake.html#eth","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":27,"kind":1024,"name":"ethOptions","url":"classes/_tinlake_.tinlake.html#ethoptions","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":28,"kind":1024,"name":"ethConfig","url":"classes/_tinlake_.tinlake.html#ethconfig","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":29,"kind":1024,"name":"ethersConfig","url":"classes/_tinlake_.tinlake.html#ethersconfig","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":30,"kind":1024,"name":"contractAddresses","url":"classes/_tinlake_.tinlake.html#contractaddresses","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":31,"kind":1024,"name":"transactionTimeout","url":"classes/_tinlake_.tinlake.html#transactiontimeout","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":32,"kind":1024,"name":"contracts","url":"classes/_tinlake_.tinlake.html#contracts","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":33,"kind":1024,"name":"contractAbis","url":"classes/_tinlake_.tinlake.html#contractabis","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":34,"kind":1024,"name":"contractConfig","url":"classes/_tinlake_.tinlake.html#contractconfig","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":35,"kind":512,"name":"constructor","url":"classes/_tinlake_.tinlake.html#constructor","classes":"tsd-kind-constructor tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":36,"kind":2048,"name":"setProvider","url":"classes/_tinlake_.tinlake.html#setprovider","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":37,"kind":2048,"name":"setContracts","url":"classes/_tinlake_.tinlake.html#setcontracts","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":38,"kind":2048,"name":"setEthConfig","url":"classes/_tinlake_.tinlake.html#setethconfig","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":39,"kind":2048,"name":"setEthersConfig","url":"classes/_tinlake_.tinlake.html#setethersconfig","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":40,"kind":2048,"name":"createContract","url":"classes/_tinlake_.tinlake.html#createcontract","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":41,"kind":2048,"name":"getContract","url":"classes/_tinlake_.tinlake.html#getcontract","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":42,"kind":2048,"name":"subscribe","url":"classes/_tinlake_.tinlake.html#subscribe","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":43,"kind":2048,"name":"getOperatorType","url":"classes/_tinlake_.tinlake.html#getoperatortype","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":44,"kind":4194304,"name":"PendingTransaction","url":"modules/_tinlake_.html#pendingtransaction","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"Tinlake\""},{"id":45,"kind":65536,"name":"__type","url":"modules/_tinlake_.html#pendingtransaction.__type-7","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"Tinlake\".PendingTransaction"},{"id":46,"kind":32,"name":"hash","url":"modules/_tinlake_.html#pendingtransaction.__type-7.hash","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".PendingTransaction.__type"},{"id":47,"kind":32,"name":"contractKey","url":"modules/_tinlake_.html#pendingtransaction.__type-7.contractkey","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".PendingTransaction.__type"},{"id":48,"kind":32,"name":"timesOutAt","url":"modules/_tinlake_.html#pendingtransaction.__type-7.timesoutat","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".PendingTransaction.__type"},{"id":49,"kind":4194304,"name":"EthConfig","url":"modules/_tinlake_.html#ethconfig","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"Tinlake\""},{"id":50,"kind":65536,"name":"__type","url":"modules/_tinlake_.html#ethconfig.__type-4","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"Tinlake\".EthConfig"},{"id":51,"kind":32,"name":"from","url":"modules/_tinlake_.html#ethconfig.__type-4.from","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".EthConfig.__type"},{"id":52,"kind":32,"name":"gasPrice","url":"modules/_tinlake_.html#ethconfig.__type-4.gasprice","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".EthConfig.__type"},{"id":53,"kind":32,"name":"gas","url":"modules/_tinlake_.html#ethconfig.__type-4.gas","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".EthConfig.__type"},{"id":54,"kind":4194304,"name":"EthersOverrides","url":"modules/_tinlake_.html#ethersoverrides","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"Tinlake\""},{"id":55,"kind":65536,"name":"__type","url":"modules/_tinlake_.html#ethersoverrides.__type-6","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"Tinlake\".EthersOverrides"},{"id":56,"kind":32,"name":"gasPrice","url":"modules/_tinlake_.html#ethersoverrides.__type-6.gasprice-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".EthersOverrides.__type"},{"id":57,"kind":32,"name":"gasLimit","url":"modules/_tinlake_.html#ethersoverrides.__type-6.gaslimit","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".EthersOverrides.__type"},{"id":58,"kind":4194304,"name":"EthersConfig","url":"modules/_tinlake_.html#ethersconfig","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"Tinlake\""},{"id":59,"kind":65536,"name":"__type","url":"modules/_tinlake_.html#ethersconfig.__type-5","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"Tinlake\".EthersConfig"},{"id":60,"kind":32,"name":"provider","url":"modules/_tinlake_.html#ethersconfig.__type-5.provider","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".EthersConfig.__type"},{"id":61,"kind":32,"name":"signer","url":"modules/_tinlake_.html#ethersconfig.__type-5.signer","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".EthersConfig.__type"},{"id":62,"kind":32,"name":"overrides","url":"modules/_tinlake_.html#ethersconfig.__type-5.overrides","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".EthersConfig.__type"},{"id":63,"kind":4194304,"name":"ContractNames","url":"modules/_tinlake_.html#contractnames","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"Tinlake\""},{"id":64,"kind":4194304,"name":"Contracts","url":"modules/_tinlake_.html#contracts","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"Tinlake\""},{"id":65,"kind":65536,"name":"__type","url":"modules/_tinlake_.html#contracts.__type-3","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"Tinlake\".Contracts"},{"id":66,"kind":4194304,"name":"ContractAbis","url":"modules/_tinlake_.html#contractabis","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"Tinlake\""},{"id":67,"kind":65536,"name":"__type","url":"modules/_tinlake_.html#contractabis.__type-1","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"Tinlake\".ContractAbis"},{"id":68,"kind":4194304,"name":"ContractAddresses","url":"modules/_tinlake_.html#contractaddresses","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"Tinlake\""},{"id":69,"kind":65536,"name":"__type","url":"modules/_tinlake_.html#contractaddresses.__type-2","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"Tinlake\".ContractAddresses"},{"id":70,"kind":4194304,"name":"TinlakeParams","url":"modules/_tinlake_.html#tinlakeparams","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"Tinlake\""},{"id":71,"kind":65536,"name":"__type","url":"modules/_tinlake_.html#tinlakeparams.__type-8","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"Tinlake\".TinlakeParams"},{"id":72,"kind":32,"name":"provider","url":"modules/_tinlake_.html#tinlakeparams.__type-8.provider-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".TinlakeParams.__type"},{"id":73,"kind":32,"name":"transactionTimeout","url":"modules/_tinlake_.html#tinlakeparams.__type-8.transactiontimeout","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".TinlakeParams.__type"},{"id":74,"kind":32,"name":"contractAddresses","url":"modules/_tinlake_.html#tinlakeparams.__type-8.contractaddresses-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".TinlakeParams.__type"},{"id":75,"kind":32,"name":"contractAbis","url":"modules/_tinlake_.html#tinlakeparams.__type-8.contractabis-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".TinlakeParams.__type"},{"id":76,"kind":32,"name":"ethConfig","url":"modules/_tinlake_.html#tinlakeparams.__type-8.ethconfig-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".TinlakeParams.__type"},{"id":77,"kind":32,"name":"ethersConfig","url":"modules/_tinlake_.html#tinlakeparams.__type-8.ethersconfig-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".TinlakeParams.__type"},{"id":78,"kind":32,"name":"ethOptions","url":"modules/_tinlake_.html#tinlakeparams.__type-8.ethoptions","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".TinlakeParams.__type"},{"id":79,"kind":32,"name":"contracts","url":"modules/_tinlake_.html#tinlakeparams.__type-8.contracts-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".TinlakeParams.__type"},{"id":80,"kind":32,"name":"contractConfig","url":"modules/_tinlake_.html#tinlakeparams.__type-8.contractconfig","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".TinlakeParams.__type"},{"id":81,"kind":4194304,"name":"Constructor","url":"modules/_tinlake_.html#constructor","classes":"tsd-kind-type-alias tsd-parent-kind-module tsd-has-type-parameter","parent":"\"Tinlake\""},{"id":82,"kind":65536,"name":"__type","url":"modules/_tinlake_.html#constructor.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"Tinlake\".Constructor"},{"id":83,"kind":1,"name":"\"actions/admin\"","url":"modules/_actions_admin_.html","classes":"tsd-kind-module"},{"id":84,"kind":64,"name":"AdminActions","url":"modules/_actions_admin_.html#adminactions","classes":"tsd-kind-function tsd-parent-kind-module tsd-has-type-parameter","parent":"\"actions/admin\""},{"id":85,"kind":4194304,"name":"IAdminActions","url":"modules/_actions_admin_.html#iadminactions","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"actions/admin\""},{"id":86,"kind":65536,"name":"__type","url":"modules/_actions_admin_.html#iadminactions.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"actions/admin\".IAdminActions"},{"id":87,"kind":64,"name":"isWard","url":"modules/_actions_admin_.html#iadminactions.__type.isward","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":88,"kind":64,"name":"canSetInterestRate","url":"modules/_actions_admin_.html#iadminactions.__type.cansetinterestrate","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":89,"kind":64,"name":"canSetSeniorTrancheInterest","url":"modules/_actions_admin_.html#iadminactions.__type.cansetseniortrancheinterest","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":90,"kind":64,"name":"canSetMinimumJuniorRatio","url":"modules/_actions_admin_.html#iadminactions.__type.cansetminimumjuniorratio","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":91,"kind":64,"name":"canSetRiskScore","url":"modules/_actions_admin_.html#iadminactions.__type.cansetriskscore","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":92,"kind":64,"name":"canSetInvestorAllowanceJunior","url":"modules/_actions_admin_.html#iadminactions.__type.cansetinvestorallowancejunior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":93,"kind":64,"name":"canSetInvestorAllowanceSenior","url":"modules/_actions_admin_.html#iadminactions.__type.cansetinvestorallowancesenior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":94,"kind":64,"name":"canSetLoanPrice","url":"modules/_actions_admin_.html#iadminactions.__type.cansetloanprice","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":95,"kind":64,"name":"initRate","url":"modules/_actions_admin_.html#iadminactions.__type.initrate","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":96,"kind":64,"name":"setRate","url":"modules/_actions_admin_.html#iadminactions.__type.setrate","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":97,"kind":64,"name":"setMinimumJuniorRatio","url":"modules/_actions_admin_.html#iadminactions.__type.setminimumjuniorratio","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":98,"kind":64,"name":"approveAllowanceJunior","url":"modules/_actions_admin_.html#iadminactions.__type.approveallowancejunior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":99,"kind":64,"name":"approveAllowanceSenior","url":"modules/_actions_admin_.html#iadminactions.__type.approveallowancesenior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":100,"kind":1,"name":"\"actions/borrower\"","url":"modules/_actions_borrower_.html","classes":"tsd-kind-module"},{"id":101,"kind":64,"name":"BorrowerActions","url":"modules/_actions_borrower_.html#borroweractions","classes":"tsd-kind-function tsd-parent-kind-module tsd-has-type-parameter","parent":"\"actions/borrower\""},{"id":102,"kind":4194304,"name":"IBorrowerActions","url":"modules/_actions_borrower_.html#iborroweractions","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"actions/borrower\""},{"id":103,"kind":65536,"name":"__type","url":"modules/_actions_borrower_.html#iborroweractions.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"actions/borrower\".IBorrowerActions"},{"id":104,"kind":64,"name":"issue","url":"modules/_actions_borrower_.html#iborroweractions.__type.issue","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/borrower\".IBorrowerActions.__type"},{"id":105,"kind":64,"name":"nftLookup","url":"modules/_actions_borrower_.html#iborroweractions.__type.nftlookup","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/borrower\".IBorrowerActions.__type"},{"id":106,"kind":64,"name":"lock","url":"modules/_actions_borrower_.html#iborroweractions.__type.lock","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/borrower\".IBorrowerActions.__type"},{"id":107,"kind":64,"name":"unlock","url":"modules/_actions_borrower_.html#iborroweractions.__type.unlock","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/borrower\".IBorrowerActions.__type"},{"id":108,"kind":64,"name":"close","url":"modules/_actions_borrower_.html#iborroweractions.__type.close","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/borrower\".IBorrowerActions.__type"},{"id":109,"kind":64,"name":"borrow","url":"modules/_actions_borrower_.html#iborroweractions.__type.borrow","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/borrower\".IBorrowerActions.__type"},{"id":110,"kind":64,"name":"withdraw","url":"modules/_actions_borrower_.html#iborroweractions.__type.withdraw","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/borrower\".IBorrowerActions.__type"},{"id":111,"kind":64,"name":"repay","url":"modules/_actions_borrower_.html#iborroweractions.__type.repay","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/borrower\".IBorrowerActions.__type"},{"id":112,"kind":1,"name":"\"actions/lender\"","url":"modules/_actions_lender_.html","classes":"tsd-kind-module"},{"id":113,"kind":64,"name":"LenderActions","url":"modules/_actions_lender_.html#lenderactions","classes":"tsd-kind-function tsd-parent-kind-module tsd-has-type-parameter","parent":"\"actions/lender\""},{"id":114,"kind":4194304,"name":"ILenderActions","url":"modules/_actions_lender_.html#ilenderactions","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"actions/lender\""},{"id":115,"kind":65536,"name":"__type","url":"modules/_actions_lender_.html#ilenderactions.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"actions/lender\".ILenderActions"},{"id":116,"kind":64,"name":"getSeniorTokenAllowance","url":"modules/_actions_lender_.html#ilenderactions.__type.getseniortokenallowance","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/lender\".ILenderActions.__type"},{"id":117,"kind":64,"name":"getJuniorTokenAllowance","url":"modules/_actions_lender_.html#ilenderactions.__type.getjuniortokenallowance","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/lender\".ILenderActions.__type"},{"id":118,"kind":64,"name":"supplyJunior","url":"modules/_actions_lender_.html#ilenderactions.__type.supplyjunior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/lender\".ILenderActions.__type"},{"id":119,"kind":32,"name":"approveJuniorToken","url":"modules/_actions_lender_.html#ilenderactions.__type.approvejuniortoken","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"actions/lender\".ILenderActions.__type"},{"id":120,"kind":65536,"name":"__type","url":"modules/_actions_lender_.html#ilenderactions.__type.approvejuniortoken.__type-1","classes":"tsd-kind-type-literal tsd-parent-kind-variable","parent":"\"actions/lender\".ILenderActions.__type.approveJuniorToken"},{"id":121,"kind":32,"name":"approveSeniorToken","url":"modules/_actions_lender_.html#ilenderactions.__type.approveseniortoken","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"actions/lender\".ILenderActions.__type"},{"id":122,"kind":65536,"name":"__type","url":"modules/_actions_lender_.html#ilenderactions.__type.approveseniortoken.__type-2","classes":"tsd-kind-type-literal tsd-parent-kind-variable","parent":"\"actions/lender\".ILenderActions.__type.approveSeniorToken"},{"id":123,"kind":64,"name":"redeemJunior","url":"modules/_actions_lender_.html#ilenderactions.__type.redeemjunior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/lender\".ILenderActions.__type"},{"id":124,"kind":64,"name":"supplySenior","url":"modules/_actions_lender_.html#ilenderactions.__type.supplysenior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/lender\".ILenderActions.__type"},{"id":125,"kind":64,"name":"redeemSenior","url":"modules/_actions_lender_.html#ilenderactions.__type.redeemsenior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/lender\".ILenderActions.__type"},{"id":126,"kind":64,"name":"balance","url":"modules/_actions_lender_.html#ilenderactions.__type.balance","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/lender\".ILenderActions.__type"},{"id":127,"kind":1,"name":"\"actions/currency\"","url":"modules/_actions_currency_.html","classes":"tsd-kind-module"},{"id":128,"kind":64,"name":"CurrencyActions","url":"modules/_actions_currency_.html#currencyactions","classes":"tsd-kind-function tsd-parent-kind-module tsd-has-type-parameter","parent":"\"actions/currency\""},{"id":129,"kind":4194304,"name":"ICurrencyActions","url":"modules/_actions_currency_.html#icurrencyactions","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"actions/currency\""},{"id":130,"kind":65536,"name":"__type","url":"modules/_actions_currency_.html#icurrencyactions.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"actions/currency\".ICurrencyActions"},{"id":131,"kind":64,"name":"mintCurrency","url":"modules/_actions_currency_.html#icurrencyactions.__type.mintcurrency","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/currency\".ICurrencyActions.__type"},{"id":132,"kind":64,"name":"getCurrencyBalance","url":"modules/_actions_currency_.html#icurrencyactions.__type.getcurrencybalance","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/currency\".ICurrencyActions.__type"},{"id":133,"kind":64,"name":"approveCurrency","url":"modules/_actions_currency_.html#icurrencyactions.__type.approvecurrency","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/currency\".ICurrencyActions.__type"},{"id":134,"kind":32,"name":"getCurrencyAllowance","url":"modules/_actions_currency_.html#icurrencyactions.__type.getcurrencyallowance","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"actions/currency\".ICurrencyActions.__type"},{"id":135,"kind":65536,"name":"__type","url":"modules/_actions_currency_.html#icurrencyactions.__type.getcurrencyallowance.__type-3","classes":"tsd-kind-type-literal tsd-parent-kind-variable","parent":"\"actions/currency\".ICurrencyActions.__type.getCurrencyAllowance"},{"id":136,"kind":32,"name":"getJuniorForCurrencyAllowance","url":"modules/_actions_currency_.html#icurrencyactions.__type.getjuniorforcurrencyallowance","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"actions/currency\".ICurrencyActions.__type"},{"id":137,"kind":65536,"name":"__type","url":"modules/_actions_currency_.html#icurrencyactions.__type.getjuniorforcurrencyallowance.__type-4","classes":"tsd-kind-type-literal tsd-parent-kind-variable","parent":"\"actions/currency\".ICurrencyActions.__type.getJuniorForCurrencyAllowance"},{"id":138,"kind":32,"name":"getSeniorForCurrencyAllowance","url":"modules/_actions_currency_.html#icurrencyactions.__type.getseniorforcurrencyallowance","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"actions/currency\".ICurrencyActions.__type"},{"id":139,"kind":65536,"name":"__type","url":"modules/_actions_currency_.html#icurrencyactions.__type.getseniorforcurrencyallowance.__type-5","classes":"tsd-kind-type-literal tsd-parent-kind-variable","parent":"\"actions/currency\".ICurrencyActions.__type.getSeniorForCurrencyAllowance"},{"id":140,"kind":32,"name":"approveSeniorForCurrency","url":"modules/_actions_currency_.html#icurrencyactions.__type.approveseniorforcurrency","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"actions/currency\".ICurrencyActions.__type"},{"id":141,"kind":65536,"name":"__type","url":"modules/_actions_currency_.html#icurrencyactions.__type.approveseniorforcurrency.__type-2","classes":"tsd-kind-type-literal tsd-parent-kind-variable","parent":"\"actions/currency\".ICurrencyActions.__type.approveSeniorForCurrency"},{"id":142,"kind":32,"name":"approveJuniorForCurrency","url":"modules/_actions_currency_.html#icurrencyactions.__type.approvejuniorforcurrency","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"actions/currency\".ICurrencyActions.__type"},{"id":143,"kind":65536,"name":"__type","url":"modules/_actions_currency_.html#icurrencyactions.__type.approvejuniorforcurrency.__type-1","classes":"tsd-kind-type-literal tsd-parent-kind-variable","parent":"\"actions/currency\".ICurrencyActions.__type.approveJuniorForCurrency"},{"id":144,"kind":1,"name":"\"actions/collateral\"","url":"modules/_actions_collateral_.html","classes":"tsd-kind-module"},{"id":145,"kind":64,"name":"CollateralActions","url":"modules/_actions_collateral_.html#collateralactions","classes":"tsd-kind-function tsd-parent-kind-module tsd-has-type-parameter","parent":"\"actions/collateral\""},{"id":146,"kind":4194304,"name":"ICollateralActions","url":"modules/_actions_collateral_.html#icollateralactions","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"actions/collateral\""},{"id":147,"kind":65536,"name":"__type","url":"modules/_actions_collateral_.html#icollateralactions.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"actions/collateral\".ICollateralActions"},{"id":148,"kind":64,"name":"mintTitleNFT","url":"modules/_actions_collateral_.html#icollateralactions.__type.minttitlenft","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/collateral\".ICollateralActions.__type"},{"id":149,"kind":64,"name":"mintNFT","url":"modules/_actions_collateral_.html#icollateralactions.__type.mintnft","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/collateral\".ICollateralActions.__type"},{"id":150,"kind":64,"name":"approveNFT","url":"modules/_actions_collateral_.html#icollateralactions.__type.approvenft","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/collateral\".ICollateralActions.__type"},{"id":151,"kind":64,"name":"setNFTApprovalForAll","url":"modules/_actions_collateral_.html#icollateralactions.__type.setnftapprovalforall","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/collateral\".ICollateralActions.__type"},{"id":152,"kind":64,"name":"isNFTApprovedForAll","url":"modules/_actions_collateral_.html#icollateralactions.__type.isnftapprovedforall","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/collateral\".ICollateralActions.__type"},{"id":153,"kind":64,"name":"getNFTCount","url":"modules/_actions_collateral_.html#icollateralactions.__type.getnftcount","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/collateral\".ICollateralActions.__type"},{"id":154,"kind":64,"name":"getNFTData","url":"modules/_actions_collateral_.html#icollateralactions.__type.getnftdata","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/collateral\".ICollateralActions.__type"},{"id":155,"kind":64,"name":"getNFTOwner","url":"modules/_actions_collateral_.html#icollateralactions.__type.getnftowner","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/collateral\".ICollateralActions.__type"},{"id":156,"kind":64,"name":"transferNFT","url":"modules/_actions_collateral_.html#icollateralactions.__type.transfernft","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/collateral\".ICollateralActions.__type"},{"id":157,"kind":1,"name":"\"actions/governance\"","url":"modules/_actions_governance_.html","classes":"tsd-kind-module"},{"id":158,"kind":4194304,"name":"IGovernanceActions","url":"modules/_actions_governance_.html#igovernanceactions","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"actions/governance\""},{"id":159,"kind":65536,"name":"__type","url":"modules/_actions_governance_.html#igovernanceactions.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"actions/governance\".IGovernanceActions"},{"id":160,"kind":64,"name":"relyAddress","url":"modules/_actions_governance_.html#igovernanceactions.__type.relyaddress","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/governance\".IGovernanceActions.__type"},{"id":161,"kind":1,"name":"\"actions/proxy\"","url":"modules/_actions_proxy_.html","classes":"tsd-kind-module"},{"id":162,"kind":64,"name":"ProxyActions","url":"modules/_actions_proxy_.html#proxyactions","classes":"tsd-kind-function tsd-parent-kind-module tsd-has-type-parameter","parent":"\"actions/proxy\""},{"id":163,"kind":4194304,"name":"IProxyActions","url":"modules/_actions_proxy_.html#iproxyactions","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"actions/proxy\""},{"id":164,"kind":65536,"name":"__type","url":"modules/_actions_proxy_.html#iproxyactions.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"actions/proxy\".IProxyActions"},{"id":165,"kind":64,"name":"buildProxy","url":"modules/_actions_proxy_.html#iproxyactions.__type.buildproxy","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":166,"kind":64,"name":"checkProxyExists","url":"modules/_actions_proxy_.html#iproxyactions.__type.checkproxyexists","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":167,"kind":64,"name":"getProxy","url":"modules/_actions_proxy_.html#iproxyactions.__type.getproxy","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":168,"kind":64,"name":"proxyCount","url":"modules/_actions_proxy_.html#iproxyactions.__type.proxycount","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":169,"kind":64,"name":"getProxyAccessToken","url":"modules/_actions_proxy_.html#iproxyactions.__type.getproxyaccesstoken","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":170,"kind":64,"name":"getProxyAccessTokenOwner","url":"modules/_actions_proxy_.html#iproxyactions.__type.getproxyaccesstokenowner","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":171,"kind":64,"name":"getProxyOwnerByLoan","url":"modules/_actions_proxy_.html#iproxyactions.__type.getproxyownerbyloan","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":172,"kind":64,"name":"getProxyOwnerByAddress","url":"modules/_actions_proxy_.html#iproxyactions.__type.getproxyownerbyaddress","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":173,"kind":64,"name":"proxyCreateNew","url":"modules/_actions_proxy_.html#iproxyactions.__type.proxycreatenew","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":174,"kind":64,"name":"proxyIssue","url":"modules/_actions_proxy_.html#iproxyactions.__type.proxyissue","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":175,"kind":64,"name":"proxyTransferIssue","url":"modules/_actions_proxy_.html#iproxyactions.__type.proxytransferissue","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":176,"kind":64,"name":"proxyLockBorrowWithdraw","url":"modules/_actions_proxy_.html#iproxyactions.__type.proxylockborrowwithdraw","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":177,"kind":64,"name":"proxyRepayUnlockClose","url":"modules/_actions_proxy_.html#iproxyactions.__type.proxyrepayunlockclose","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":178,"kind":1,"name":"\"actions/index\"","url":"modules/_actions_index_.html","classes":"tsd-kind-module"},{"id":179,"kind":4194304,"name":"TinlakeActions","url":"modules/_actions_index_.html#tinlakeactions","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"actions/index\""},{"id":180,"kind":1,"name":"\"types/tinlake\"","url":"modules/_types_tinlake_.html","classes":"tsd-kind-module"},{"id":181,"kind":4194304,"name":"Loan","url":"modules/_types_tinlake_.html#loan","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"types/tinlake\""},{"id":182,"kind":65536,"name":"__type","url":"modules/_types_tinlake_.html#loan.__type-3","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"types/tinlake\".Loan"},{"id":183,"kind":32,"name":"loanId","url":"modules/_types_tinlake_.html#loan.__type-3.loanid","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":184,"kind":32,"name":"registry","url":"modules/_types_tinlake_.html#loan.__type-3.registry","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":185,"kind":32,"name":"tokenId","url":"modules/_types_tinlake_.html#loan.__type-3.tokenid","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":186,"kind":32,"name":"ownerOf","url":"modules/_types_tinlake_.html#loan.__type-3.ownerof","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":187,"kind":32,"name":"principal","url":"modules/_types_tinlake_.html#loan.__type-3.principal","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":188,"kind":32,"name":"interestRate","url":"modules/_types_tinlake_.html#loan.__type-3.interestrate","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":189,"kind":32,"name":"debt","url":"modules/_types_tinlake_.html#loan.__type-3.debt","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":190,"kind":32,"name":"threshold","url":"modules/_types_tinlake_.html#loan.__type-3.threshold","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":191,"kind":32,"name":"price","url":"modules/_types_tinlake_.html#loan.__type-3.price","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":192,"kind":32,"name":"status","url":"modules/_types_tinlake_.html#loan.__type-3.status","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":193,"kind":32,"name":"nft","url":"modules/_types_tinlake_.html#loan.__type-3.nft","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":194,"kind":32,"name":"proxyOwner","url":"modules/_types_tinlake_.html#loan.__type-3.proxyowner","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":195,"kind":4194304,"name":"Tranche","url":"modules/_types_tinlake_.html#tranche","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"types/tinlake\""},{"id":196,"kind":65536,"name":"__type","url":"modules/_types_tinlake_.html#tranche.__type-5","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"types/tinlake\".Tranche"},{"id":197,"kind":32,"name":"availableFunds","url":"modules/_types_tinlake_.html#tranche.__type-5.availablefunds","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Tranche.__type"},{"id":198,"kind":32,"name":"tokenPrice","url":"modules/_types_tinlake_.html#tranche.__type-5.tokenprice","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Tranche.__type"},{"id":199,"kind":32,"name":"type","url":"modules/_types_tinlake_.html#tranche.__type-5.type","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Tranche.__type"},{"id":200,"kind":32,"name":"token","url":"modules/_types_tinlake_.html#tranche.__type-5.token","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Tranche.__type"},{"id":201,"kind":32,"name":"totalSupply","url":"modules/_types_tinlake_.html#tranche.__type-5.totalsupply","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Tranche.__type"},{"id":202,"kind":32,"name":"interestRate","url":"modules/_types_tinlake_.html#tranche.__type-5.interestrate-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Tranche.__type"},{"id":203,"kind":4194304,"name":"NFT","url":"modules/_types_tinlake_.html#nft-1","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"types/tinlake\""},{"id":204,"kind":65536,"name":"__type","url":"modules/_types_tinlake_.html#nft-1.__type-4","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"types/tinlake\".NFT"},{"id":205,"kind":32,"name":"registry","url":"modules/_types_tinlake_.html#nft-1.__type-4.registry-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".NFT.__type"},{"id":206,"kind":32,"name":"tokenId","url":"modules/_types_tinlake_.html#nft-1.__type-4.tokenid-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".NFT.__type"},{"id":207,"kind":32,"name":"nftOwner","url":"modules/_types_tinlake_.html#nft-1.__type-4.nftowner","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".NFT.__type"},{"id":208,"kind":32,"name":"nftData","url":"modules/_types_tinlake_.html#nft-1.__type-4.nftdata","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".NFT.__type"},{"id":209,"kind":4194304,"name":"Investor","url":"modules/_types_tinlake_.html#investor","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"types/tinlake\""},{"id":210,"kind":65536,"name":"__type","url":"modules/_types_tinlake_.html#investor.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"types/tinlake\".Investor"},{"id":211,"kind":32,"name":"junior","url":"modules/_types_tinlake_.html#investor.__type.junior","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Investor.__type"},{"id":212,"kind":65536,"name":"__type","url":"modules/_types_tinlake_.html#investor.__type.junior.__type-1","classes":"tsd-kind-type-literal tsd-parent-kind-variable","parent":"\"types/tinlake\".Investor.__type.junior"},{"id":213,"kind":32,"name":"maxSupply","url":"modules/_types_tinlake_.html#investor.__type.junior.__type-1.maxsupply","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Investor.__type.junior.__type"},{"id":214,"kind":32,"name":"tokenBalance","url":"modules/_types_tinlake_.html#investor.__type.junior.__type-1.tokenbalance","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Investor.__type.junior.__type"},{"id":215,"kind":32,"name":"maxRedeem","url":"modules/_types_tinlake_.html#investor.__type.junior.__type-1.maxredeem","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Investor.__type.junior.__type"},{"id":216,"kind":32,"name":"senior","url":"modules/_types_tinlake_.html#investor.__type.senior","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Investor.__type"},{"id":217,"kind":65536,"name":"__type","url":"modules/_types_tinlake_.html#investor.__type.senior.__type-2","classes":"tsd-kind-type-literal tsd-parent-kind-variable","parent":"\"types/tinlake\".Investor.__type.senior"},{"id":218,"kind":32,"name":"maxSupply","url":"modules/_types_tinlake_.html#investor.__type.senior.__type-2.maxsupply-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Investor.__type.senior.__type"},{"id":219,"kind":32,"name":"tokenBalance","url":"modules/_types_tinlake_.html#investor.__type.senior.__type-2.tokenbalance-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Investor.__type.senior.__type"},{"id":220,"kind":32,"name":"maxRedeem","url":"modules/_types_tinlake_.html#investor.__type.senior.__type-2.maxredeem-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Investor.__type.senior.__type"},{"id":221,"kind":32,"name":"address","url":"modules/_types_tinlake_.html#investor.__type.address","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Investor.__type"},{"id":222,"kind":4194304,"name":"ITinlake","url":"modules/_types_tinlake_.html#itinlake","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"types/tinlake\""},{"id":223,"kind":1,"name":"\"actions/analytics\"","url":"modules/_actions_analytics_.html","classes":"tsd-kind-module"},{"id":224,"kind":64,"name":"AnalyticsActions","url":"modules/_actions_analytics_.html#analyticsactions","classes":"tsd-kind-function tsd-parent-kind-module tsd-has-type-parameter","parent":"\"actions/analytics\""},{"id":225,"kind":4194304,"name":"IAnalyticsActions","url":"modules/_actions_analytics_.html#ianalyticsactions","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"actions/analytics\""},{"id":226,"kind":65536,"name":"__type","url":"modules/_actions_analytics_.html#ianalyticsactions.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"actions/analytics\".IAnalyticsActions"},{"id":227,"kind":64,"name":"getTotalDebt","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.gettotaldebt","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":228,"kind":64,"name":"getTotalBalance","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.gettotalbalance","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":229,"kind":64,"name":"getDebt","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getdebt","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":230,"kind":64,"name":"loanCount","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.loancount","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":231,"kind":64,"name":"getLoanList","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getloanlist","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":232,"kind":64,"name":"getLoan","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getloan","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":233,"kind":64,"name":"getCollateral","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getcollateral","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":234,"kind":64,"name":"getPrincipal","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getprincipal","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":235,"kind":64,"name":"getInterestRate","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getinterestrate","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":236,"kind":64,"name":"getOwnerOfLoan","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getownerofloan","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":237,"kind":64,"name":"getOwnerOfCollateral","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getownerofcollateral","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":238,"kind":64,"name":"existsSenior","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.existssenior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":239,"kind":64,"name":"getJuniorReserve","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getjuniorreserve","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":240,"kind":64,"name":"getSeniorReserve","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getseniorreserve","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":241,"kind":64,"name":"getJuniorTokenBalance","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getjuniortokenbalance","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":242,"kind":64,"name":"getSeniorTokenBalance","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getseniortokenbalance","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":243,"kind":64,"name":"getMaxSupplyAmountJunior","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getmaxsupplyamountjunior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":244,"kind":64,"name":"getMaxRedeemAmountJunior","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getmaxredeemamountjunior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":245,"kind":64,"name":"getMaxSupplyAmountSenior","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getmaxsupplyamountsenior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":246,"kind":64,"name":"getMaxRedeemAmountSenior","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getmaxredeemamountsenior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":247,"kind":64,"name":"getTokenPriceJunior","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.gettokenpricejunior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":248,"kind":64,"name":"getTokenPriceSenior","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.gettokenpricesenior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":249,"kind":64,"name":"getSeniorDebt","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getseniordebt","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":250,"kind":64,"name":"getSeniorInterestRate","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getseniorinterestrate","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":251,"kind":64,"name":"getMinJuniorRatio","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getminjuniorratio","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":252,"kind":64,"name":"getCurrentJuniorRatio","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getcurrentjuniorratio","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":253,"kind":64,"name":"getAssetValueJunior","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getassetvaluejunior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":254,"kind":64,"name":"getInvestor","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getinvestor","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":255,"kind":1,"name":"\"utils/baseToDisplay\"","url":"modules/_utils_basetodisplay_.html","classes":"tsd-kind-module"},{"id":256,"kind":64,"name":"baseToDisplay","url":"modules/_utils_basetodisplay_.html#basetodisplay","classes":"tsd-kind-function tsd-parent-kind-module","parent":"\"utils/baseToDisplay\""},{"id":257,"kind":1,"name":"\"utils/baseToDisplay.spec\"","url":"modules/_utils_basetodisplay_spec_.html","classes":"tsd-kind-module"},{"id":258,"kind":1,"name":"\"utils/bnToHex\"","url":"modules/_utils_bntohex_.html","classes":"tsd-kind-module"},{"id":259,"kind":64,"name":"bnToHex","url":"modules/_utils_bntohex_.html#bntohex","classes":"tsd-kind-function tsd-parent-kind-module","parent":"\"utils/bnToHex\""},{"id":260,"kind":1,"name":"\"utils/bnToHex.spec\"","url":"modules/_utils_bntohex_spec_.html","classes":"tsd-kind-module"},{"id":261,"kind":1,"name":"\"utils/displayToBase\"","url":"modules/_utils_displaytobase_.html","classes":"tsd-kind-module"},{"id":262,"kind":64,"name":"displayToBase","url":"modules/_utils_displaytobase_.html#displaytobase","classes":"tsd-kind-function tsd-parent-kind-module","parent":"\"utils/displayToBase\""},{"id":263,"kind":1,"name":"\"utils/displayToBase.spec\"","url":"modules/_utils_displaytobase_spec_.html","classes":"tsd-kind-module"},{"id":264,"kind":1,"name":"\"utils/feeToInterestRate\"","url":"modules/_utils_feetointerestrate_.html","classes":"tsd-kind-module"},{"id":265,"kind":64,"name":"feeToInterestRate","url":"modules/_utils_feetointerestrate_.html#feetointerestrate","classes":"tsd-kind-function tsd-parent-kind-module","parent":"\"utils/feeToInterestRate\""},{"id":266,"kind":1,"name":"\"utils/feeToInterestRate.spec\"","url":"modules/_utils_feetointerestrate_spec_.html","classes":"tsd-kind-module"},{"id":267,"kind":1,"name":"\"utils/getLoanStatus\"","url":"modules/_utils_getloanstatus_.html","classes":"tsd-kind-module"},{"id":268,"kind":4194304,"name":"LoanStatus","url":"modules/_utils_getloanstatus_.html#loanstatus","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"utils/getLoanStatus\""},{"id":269,"kind":64,"name":"getLoanStatus","url":"modules/_utils_getloanstatus_.html#getloanstatus","classes":"tsd-kind-function tsd-parent-kind-module","parent":"\"utils/getLoanStatus\""},{"id":270,"kind":1,"name":"\"utils/interestRateToFee\"","url":"modules/_utils_interestratetofee_.html","classes":"tsd-kind-module"},{"id":271,"kind":64,"name":"interestRateToFee","url":"modules/_utils_interestratetofee_.html#interestratetofee","classes":"tsd-kind-function tsd-parent-kind-module","parent":"\"utils/interestRateToFee\""},{"id":272,"kind":1,"name":"\"utils/interestRateToFee.spec\"","url":"modules/_utils_interestratetofee_spec_.html","classes":"tsd-kind-module"}]}; \ No newline at end of file diff --git a/docs/classes/_tinlake_.tinlake.html b/docs/classes/_tinlake_.tinlake.html index c98342a..8208205 100644 --- a/docs/classes/_tinlake_.tinlake.html +++ b/docs/classes/_tinlake_.tinlake.html @@ -102,11 +102,13 @@

Properties

Methods

@@ -124,7 +126,7 @@

constructor

  • Parameters

    @@ -146,7 +148,7 @@

    contractAbis

    contractAbis: ContractAbis
    @@ -156,7 +158,7 @@

    contractAddresses

    contractAddresses: ContractAddresses
    @@ -166,7 +168,7 @@

    contractConfig

    contractConfig: any
    @@ -176,7 +178,7 @@

    contracts

    contracts: Contracts
    @@ -186,7 +188,7 @@

    eth

    eth: ethI
    @@ -196,7 +198,7 @@

    ethConfig

    ethConfig: EthConfig
    @@ -206,7 +208,7 @@

    ethOptions

    ethOptions: any
    @@ -216,7 +218,7 @@

    ethersConfig

    ethersConfig: EthersConfig
    @@ -226,7 +228,7 @@

    provider

    provider: any
    @@ -236,7 +238,7 @@

    transactionTimeout

    transactionTimeout: number
    @@ -253,7 +255,7 @@

    createContract

  • Parameters

    @@ -269,6 +271,32 @@

    Returns void +
    + +

    getContract

    +
      +
    • getContract(address: string, abiName: string): Contract | undefined
    • +
    +
      +
    • + +

      Parameters

      +
        +
      • +
        address: string
        +
      • +
      • +
        abiName: string
        +
      • +
      +

      Returns Contract | undefined

      +
    • +
    +

    getOperatorType

    @@ -279,7 +307,7 @@

    getOperatorType

  • Parameters

    @@ -302,7 +330,7 @@

    setContracts

  • Returns void

    @@ -319,7 +347,7 @@

    setEthConfig

  • Parameters

    @@ -342,7 +370,7 @@

    setEthersConfig

  • Parameters

    @@ -365,7 +393,7 @@

    setProvider

  • Parameters

    @@ -381,6 +409,50 @@

    Returns void

  • +
    + +

    subscribe

    +
      +
    • subscribe(tx: PendingTransaction, callback: (response: TransactionReceipt) => void): Promise<void>
    • +
    +
      +
    • + +

      Parameters

      +
        +
      • +
        tx: PendingTransaction
        +
      • +
      • +
        callback: (response: TransactionReceipt) => void
        +
          +
        • +
            +
          • (response: TransactionReceipt): void
          • +
          +
            +
          • +

            Parameters

            +
              +
            • +
              response: TransactionReceipt
              +
            • +
            +

            Returns void

            +
          • +
          +
        • +
        +
      • +
      +

      Returns Promise<void>

      +
    • +
    +

  • +
  • + getContract +
  • getOperatorType
  • @@ -518,6 +593,9 @@

    Returns void setProvider +
  • + subscribe +
  • @@ -543,6 +621,12 @@

    Returns void EthersConfig +
  • + EthersOverrides +
  • +
  • + PendingTransaction +
  • TinlakeParams
  • diff --git a/docs/interfaces/_services_ethereum_.ethi.html b/docs/interfaces/_services_ethereum_.ethi.html index a507e97..df76883 100644 --- a/docs/interfaces/_services_ethereum_.ethi.html +++ b/docs/interfaces/_services_ethereum_.ethi.html @@ -101,7 +101,7 @@

    abi

    abi: any
    @@ -111,7 +111,7 @@

    contract

    contract: (arg0: any) => { at: (arg0: any) => void }
    @@ -165,7 +165,7 @@

    getTransactionByHash

    getTransactionByHash: (arg0: any, arg1: (err: any, tx: any) => void) => void
    @@ -220,7 +220,7 @@

    getTransactionCount

    getTransactionCount: any
    @@ -230,7 +230,7 @@

    getTransactionReceipt

    getTransactionReceipt: (arg0: any, arg1: (err: any, receipt: any) => void) => void
    @@ -285,7 +285,7 @@

    send

    send: Function
    @@ -295,7 +295,7 @@

    sendRawTransaction

    sendRawTransaction: any
    @@ -305,7 +305,7 @@

    web3_sha3

    web3_sha3: (signature: string) => string
    diff --git a/docs/interfaces/_services_ethereum_.events.html b/docs/interfaces/_services_ethereum_.events.html index bca241f..b5a8af7 100644 --- a/docs/interfaces/_services_ethereum_.events.html +++ b/docs/interfaces/_services_ethereum_.events.html @@ -96,7 +96,7 @@

    events

    events: { data: any[]; event: { name: any } }[]
    @@ -106,7 +106,7 @@

    status

    status: any
    @@ -116,7 +116,7 @@

    txHash

    txHash: string
    diff --git a/docs/modules/_actions_admin_.html b/docs/modules/_actions_admin_.html index a021330..3fcab2d 100644 --- a/docs/modules/_actions_admin_.html +++ b/docs/modules/_actions_admin_.html @@ -89,7 +89,7 @@

    IAdminActions

    IAdminActions: { approveAllowanceJunior: any; approveAllowanceSenior: any; canSetInterestRate: any; canSetInvestorAllowanceJunior: any; canSetInvestorAllowanceSenior: any; canSetLoanPrice: any; canSetMinimumJuniorRatio: any; canSetRiskScore: any; canSetSeniorTrancheInterest: any; initRate: any; isWard: any; setMinimumJuniorRatio: any; setRate: any }
    @@ -104,7 +104,7 @@
    approveAllowanceJunior:
  • Parameters

    @@ -132,7 +132,7 @@
    approveAllowanceSenior:
  • Parameters

    @@ -160,7 +160,7 @@
    canSetInterestRate:

    Parameters

    @@ -182,7 +182,7 @@
    canSetInvestorAllowanceJunior

    Parameters

    @@ -204,7 +204,7 @@
    canSetInvestorAllowanceSenior

    Parameters

    @@ -226,7 +226,7 @@
    canSetLoanPrice: fu
  • Parameters

    @@ -248,7 +248,7 @@
    canSetMinimumJuniorRatio

    Parameters

    @@ -270,7 +270,7 @@
    canSetRiskScore: fu
  • Parameters

    @@ -292,7 +292,7 @@
    canSetSeniorTrancheInterest

    Parameters

    @@ -314,7 +314,7 @@
    initRate: function
  • Parameters

    @@ -336,7 +336,7 @@
    isWard: function
  • Parameters

    @@ -361,7 +361,7 @@
    setMinimumJuniorRatio:

    Parameters

    @@ -383,7 +383,7 @@
    setRate: function
  • Parameters

    @@ -415,7 +415,7 @@

    AdminActions

  • Type parameters

    diff --git a/docs/modules/_actions_analytics_.html b/docs/modules/_actions_analytics_.html index a4837b3..cf9d8da 100644 --- a/docs/modules/_actions_analytics_.html +++ b/docs/modules/_actions_analytics_.html @@ -89,7 +89,7 @@

    IAnalyticsActions

    IAnalyticsActions: { existsSenior: any; getAssetValueJunior: any; getCollateral: any; getCurrentJuniorRatio: any; getDebt: any; getInterestRate: any; getInvestor: any; getJuniorReserve: any; getJuniorTokenBalance: any; getLoan: any; getLoanList: any; getMaxRedeemAmountJunior: any; getMaxRedeemAmountSenior: any; getMaxSupplyAmountJunior: any; getMaxSupplyAmountSenior: any; getMinJuniorRatio: any; getOwnerOfCollateral: any; getOwnerOfLoan: any; getPrincipal: any; getSeniorDebt: any; getSeniorInterestRate: any; getSeniorReserve: any; getSeniorTokenBalance: any; getTokenPriceJunior: any; getTokenPriceSenior: any; getTotalBalance: any; getTotalDebt: any; loanCount: any }
    @@ -104,7 +104,7 @@
    existsSenior: function
  • Returns boolean

    @@ -120,7 +120,7 @@
    getAssetValueJunior:

    Returns Promise<BN>

    @@ -136,7 +136,7 @@
    getCollateral: function
  • Parameters

    @@ -158,7 +158,7 @@
    getCurrentJuniorRatio:

    Returns Promise<BN>

    @@ -174,7 +174,7 @@
    getDebt: function
  • Parameters

    @@ -196,7 +196,7 @@
    getInterestRate: functio
  • Parameters

    @@ -218,7 +218,7 @@
    getInvestor: function
  • Parameters

    @@ -240,7 +240,7 @@
    getJuniorReserve: functi
  • Returns Promise<BN>

    @@ -256,7 +256,7 @@
    getJuniorTokenBalance:

    Parameters

    @@ -278,7 +278,7 @@
    getLoan: function
  • Parameters

    @@ -300,7 +300,7 @@
    getLoanList: function

    Returns Promise<Loan[]>

    @@ -316,7 +316,7 @@
    getMaxRedeemAmountJunior

    Parameters

    @@ -338,7 +338,7 @@
    getMaxRedeemAmountSenior

    Parameters

    @@ -360,7 +360,7 @@
    getMaxSupplyAmountJunior

    Parameters

    @@ -382,7 +382,7 @@
    getMaxSupplyAmountSenior

    Parameters

    @@ -404,7 +404,7 @@
    getMinJuniorRatio:
  • Returns Promise<BN>

    @@ -420,7 +420,7 @@
    getOwnerOfCollateral: fu
  • Parameters

    @@ -448,7 +448,7 @@
    getOwnerOfLoan: function
  • Parameters

    @@ -470,7 +470,7 @@
    getPrincipal: function
  • Parameters

    @@ -492,7 +492,7 @@
    getSeniorDebt: function<
  • Returns Promise<BN>

    @@ -508,7 +508,7 @@
    getSeniorInterestRate:

    Returns Promise<BN>

    @@ -524,7 +524,7 @@
    getSeniorReserve: functi
  • Returns Promise<BN>

    @@ -540,7 +540,7 @@
    getSeniorTokenBalance:

    Parameters

    @@ -562,7 +562,7 @@
    getTokenPriceJunior:

    Returns Promise<BN>

    @@ -578,7 +578,7 @@
    getTokenPriceSenior:

    Parameters

    @@ -600,7 +600,7 @@
    getTotalBalance: functio
  • Returns Promise<BN>

    @@ -616,7 +616,7 @@
    getTotalDebt: function

    Returns Promise<BN>

    @@ -632,7 +632,7 @@
    loanCount: function
  • Returns Promise<BN>

    @@ -655,7 +655,7 @@

    AnalyticsActions

  • Type parameters

    diff --git a/docs/modules/_actions_borrower_.html b/docs/modules/_actions_borrower_.html index bc94845..abd19bb 100644 --- a/docs/modules/_actions_borrower_.html +++ b/docs/modules/_actions_borrower_.html @@ -89,7 +89,7 @@

    IBorrowerActions

    IBorrowerActions: { borrow: any; close: any; issue: any; lock: any; nftLookup: any; repay: any; unlock: any; withdraw: any }
    @@ -104,7 +104,7 @@
    borrow: function
  • Parameters

    @@ -129,7 +129,7 @@
    close: function
  • Parameters

    @@ -151,7 +151,7 @@
    issue: function
  • Parameters

    @@ -176,7 +176,7 @@
    lock: function
  • Parameters

    @@ -198,7 +198,7 @@
    nftLookup: function
  • Parameters

    @@ -223,7 +223,7 @@
    repay: function
  • Parameters

    @@ -248,7 +248,7 @@
    unlock: function
  • Parameters

    @@ -270,7 +270,7 @@
    withdraw: function
  • Parameters

    @@ -305,7 +305,7 @@

    BorrowerActions

  • Type parameters

    diff --git a/docs/modules/_actions_collateral_.html b/docs/modules/_actions_collateral_.html index 39fe894..36454bb 100644 --- a/docs/modules/_actions_collateral_.html +++ b/docs/modules/_actions_collateral_.html @@ -89,7 +89,7 @@

    ICollateralActions

    ICollateralActions: { approveNFT: any; getNFTCount: any; getNFTData: any; getNFTOwner: any; isNFTApprovedForAll: any; mintNFT: any; mintTitleNFT: any; setNFTApprovalForAll: any; transferNFT: any }
    @@ -104,7 +104,7 @@
    approveNFT: function
  • Parameters

    @@ -132,7 +132,7 @@
    getNFTCount: function
  • Parameters

    @@ -154,7 +154,7 @@
    getNFTData: function
  • Parameters

    @@ -179,7 +179,7 @@
    getNFTOwner: function
  • Parameters

    @@ -204,7 +204,7 @@
    isNFTApprovedForAll: fun
  • Parameters

    @@ -232,7 +232,7 @@
    mintNFT: function
  • Parameters

    @@ -269,7 +269,7 @@
    mintTitleNFT: function
  • Parameters

    @@ -294,7 +294,7 @@
    setNFTApprovalForAll: fu
  • Parameters

    @@ -322,7 +322,7 @@
    transferNFT: function
  • Parameters

    @@ -360,7 +360,7 @@

    CollateralActions

  • Type parameters

    diff --git a/docs/modules/_actions_currency_.html b/docs/modules/_actions_currency_.html index 9aa1645..8c47961 100644 --- a/docs/modules/_actions_currency_.html +++ b/docs/modules/_actions_currency_.html @@ -89,7 +89,7 @@

    ICurrencyActions

    ICurrencyActions: { approveJuniorForCurrency: (currencyAmount: string) => Promise<unknown>; approveSeniorForCurrency: (currencyAmount: string) => Promise<unknown>; getCurrencyAllowance: (owner: string, spender: string) => Promise<BN>; getJuniorForCurrencyAllowance: (owner: string) => Promise<BN | undefined>; getSeniorForCurrencyAllowance: (owner: string) => Promise<BN | undefined>; approveCurrency: any; getCurrencyBalance: any; mintCurrency: any }
    @@ -212,7 +212,7 @@
    approveCurrency: function

    Parameters

    @@ -237,7 +237,7 @@
    getCurrencyBalance: func
  • Parameters

    @@ -259,7 +259,7 @@
    mintCurrency: function
  • Parameters

    @@ -291,7 +291,7 @@

    CurrencyActions

  • Type parameters

    diff --git a/docs/modules/_actions_governance_.html b/docs/modules/_actions_governance_.html index 5b27f01..2ee5a72 100644 --- a/docs/modules/_actions_governance_.html +++ b/docs/modules/_actions_governance_.html @@ -83,7 +83,7 @@

    IGovernanceActions

    IGovernanceActions: { relyAddress: any }
    @@ -98,7 +98,7 @@
    relyAddress: function
  • Parameters

    diff --git a/docs/modules/_actions_index_.html b/docs/modules/_actions_index_.html index 3bec655..85d5fb6 100644 --- a/docs/modules/_actions_index_.html +++ b/docs/modules/_actions_index_.html @@ -83,7 +83,7 @@

    TinlakeActions

    diff --git a/docs/modules/_actions_lender_.html b/docs/modules/_actions_lender_.html index e071693..a4a657b 100644 --- a/docs/modules/_actions_lender_.html +++ b/docs/modules/_actions_lender_.html @@ -89,7 +89,7 @@

    ILenderActions

    ILenderActions: { approveJuniorToken: (tokenAmount: string) => Promise<unknown>; approveSeniorToken: (tokenAmount: string) => Promise<unknown>; balance: any; getJuniorTokenAllowance: any; getSeniorTokenAllowance: any; redeemJunior: any; redeemSenior: any; supplyJunior: any; supplySenior: any }
    @@ -146,7 +146,7 @@
    balance: function
  • Returns Promise<any>

    @@ -162,7 +162,7 @@
    getJuniorTokenAllowance: <
  • Parameters

    @@ -184,7 +184,7 @@
    getSeniorTokenAllowance: <
  • Parameters

    @@ -206,7 +206,7 @@
    redeemJunior: function
  • Parameters

    @@ -228,7 +228,7 @@
    redeemSenior: function
  • Parameters

    @@ -250,7 +250,7 @@
    supplyJunior: function
  • Parameters

    @@ -272,7 +272,7 @@
    supplySenior: function
  • Parameters

    @@ -301,7 +301,7 @@

    LenderActions

  • Type parameters

    diff --git a/docs/modules/_actions_proxy_.html b/docs/modules/_actions_proxy_.html index e53b2d4..c143880 100644 --- a/docs/modules/_actions_proxy_.html +++ b/docs/modules/_actions_proxy_.html @@ -89,7 +89,7 @@

    IProxyActions

    IProxyActions: { buildProxy: any; checkProxyExists: any; getProxy: any; getProxyAccessToken: any; getProxyAccessTokenOwner: any; getProxyOwnerByAddress: any; getProxyOwnerByLoan: any; proxyCount: any; proxyCreateNew: any; proxyIssue: any; proxyLockBorrowWithdraw: any; proxyRepayUnlockClose: any; proxyTransferIssue: any }
    @@ -104,7 +104,7 @@
    buildProxy: function
  • Parameters

    @@ -126,7 +126,7 @@
    checkProxyExists: functi
  • Parameters

    @@ -148,7 +148,7 @@
    getProxy: function
  • Parameters

    @@ -170,7 +170,7 @@
    getProxyAccessToken:

    Parameters

    @@ -192,7 +192,7 @@
    getProxyAccessTokenOwner

    Parameters

    @@ -214,7 +214,7 @@
    getProxyOwnerByAddress:

    Parameters

    @@ -236,7 +236,7 @@
    getProxyOwnerByLoan:

    Parameters

    @@ -258,7 +258,7 @@
    proxyCount: function
  • Returns Promise<any>

    @@ -274,7 +274,7 @@
    proxyCreateNew: function
  • Parameters

    @@ -296,7 +296,7 @@
    proxyIssue: function
  • Parameters

    @@ -324,7 +324,7 @@
    proxyLockBorrowWithdraw: <
  • Parameters

    @@ -355,7 +355,7 @@
    proxyRepayUnlockClose:

    Parameters

    @@ -386,7 +386,7 @@
    proxyTransferIssue: func
  • Parameters

    @@ -421,7 +421,7 @@

    ProxyActions

  • Type parameters

    diff --git a/docs/modules/_services_ethereum_.html b/docs/modules/_services_ethereum_.html index 5339464..a14402a 100644 --- a/docs/modules/_services_ethereum_.html +++ b/docs/modules/_services_ethereum_.html @@ -99,7 +99,7 @@

    Const ZERO_ADDRESS

    ZERO_ADDRESS: "0x0000000000000000000000000000000000000000" = "0x0000000000000000000000000000000000000000"
    @@ -116,7 +116,7 @@

    executeAndRetry

  • Parameters

    @@ -142,7 +142,7 @@

    Const findEvent

  • Parameters

    @@ -209,7 +209,7 @@

    Const waitAndReturn

    Parameters

    @@ -241,7 +241,7 @@

    Const waitForTransactio
  • Parameters

    diff --git a/docs/modules/_tinlake_.html b/docs/modules/_tinlake_.html index b4fad03..99bfc58 100644 --- a/docs/modules/_tinlake_.html +++ b/docs/modules/_tinlake_.html @@ -82,6 +82,8 @@

    Type aliases

  • Contracts
  • EthConfig
  • EthersConfig
  • +
  • EthersOverrides
  • +
  • PendingTransaction
  • TinlakeParams
  • @@ -96,7 +98,7 @@

    Constructor

    Constructor<T>: {}

    Type parameters

    @@ -117,7 +119,7 @@

    ContractAbis

    ContractAbis: {}
    @@ -132,7 +134,7 @@

    ContractAddresses

    ContractAddresses: {}
    @@ -147,7 +149,7 @@

    ContractNames

    ContractNames: typeof contractNames[number]
    @@ -157,7 +159,7 @@

    Contracts

    Contracts: {}
    @@ -172,7 +174,7 @@

    EthConfig

    EthConfig: { from?: undefined | string; gas?: undefined | string; gasPrice?: undefined | string }
    @@ -193,15 +195,18 @@
    Optional gasPrice

    EthersConfig

    -
    EthersConfig: { provider?: ethers.providers.Provider; signer?: ethers.Signer }
    +
    EthersConfig: { overrides?: EthersOverrides; provider?: ethers.providers.Provider; signer?: ethers.Signer }

    Type declaration

      +
    • +
      Optional overrides?: EthersOverrides
      +
    • Optional provider?: ethers.providers.Provider
    • @@ -211,13 +216,58 @@
      Optional signer + +

      EthersOverrides

      +
      EthersOverrides: { gasLimit?: undefined | number; gasPrice?: undefined | number }
      + +
      +

      Type declaration

      +
        +
      • +
        Optional gasLimit?: undefined | number
        +
      • +
      • +
        Optional gasPrice?: undefined | number
        +
      • +
      +
      + +
      + +

      PendingTransaction

      +
      PendingTransaction: { contractKey: string; hash: string; timesOutAt: number }
      + +
      +

      Type declaration

      +
        +
      • +
        contractKey: string
        +
      • +
      • +
        hash: string
        +
      • +
      • +
        timesOutAt: number
        +
      • +
      +
      +

      TinlakeParams

      TinlakeParams: { contractAbis?: ContractAbis | {}; contractAddresses?: ContractAddresses | {}; contractConfig?: any | {}; contracts?: Contracts | {}; ethConfig?: EthConfig; ethOptions?: any | {}; ethersConfig?: EthersConfig; provider: any; transactionTimeout: number }
      @@ -358,6 +408,12 @@
      transactionTimeout: EthersConfig +
    • + EthersOverrides +
    • +
    • + PendingTransaction +
    • TinlakeParams
    • diff --git a/docs/modules/_types_tinlake_.html b/docs/modules/_types_tinlake_.html index 1f1f82d..7151f82 100644 --- a/docs/modules/_types_tinlake_.html +++ b/docs/modules/_types_tinlake_.html @@ -87,7 +87,7 @@

      ITinlake

      @@ -97,7 +97,7 @@

      Investor

      Investor: { address: string; junior: { maxRedeem: BN; maxSupply: BN; tokenBalance: BN }; senior: { maxRedeem?: BN; maxSupply?: BN; tokenBalance?: BN } }
      @@ -143,7 +143,7 @@

      Loan

      Loan: { debt: BN; interestRate: BN; loanId: string; nft?: NFT; ownerOf: BN; price?: BN; principal: BN; proxyOwner?: undefined | string; registry: string; status?: undefined | string; threshold?: BN; tokenId: BN }
      @@ -194,7 +194,7 @@

      NFT

      NFT: { nftData: any; nftOwner: string; registry: string; tokenId: BN }
      @@ -221,7 +221,7 @@

      Tranche

      Tranche: { availableFunds: BN; interestRate?: BN; token: string; tokenPrice: BN; totalSupply: BN; type: string }
      diff --git a/docs/modules/_utils_basetodisplay_.html b/docs/modules/_utils_basetodisplay_.html index 77a793b..50ab576 100644 --- a/docs/modules/_utils_basetodisplay_.html +++ b/docs/modules/_utils_basetodisplay_.html @@ -87,7 +87,7 @@

      Const baseToDisplay

    • Parameters

      diff --git a/docs/modules/_utils_bntohex_.html b/docs/modules/_utils_bntohex_.html index 90e7450..48e9521 100644 --- a/docs/modules/_utils_bntohex_.html +++ b/docs/modules/_utils_bntohex_.html @@ -87,7 +87,7 @@

      Const bnToHex

    • Parameters

      diff --git a/docs/modules/_utils_displaytobase_.html b/docs/modules/_utils_displaytobase_.html index 049c174..fb2ef19 100644 --- a/docs/modules/_utils_displaytobase_.html +++ b/docs/modules/_utils_displaytobase_.html @@ -87,7 +87,7 @@

      Const displayToBase

    • Parameters

      diff --git a/docs/modules/_utils_feetointerestrate_.html b/docs/modules/_utils_feetointerestrate_.html index 0ae9d71..df4857b 100644 --- a/docs/modules/_utils_feetointerestrate_.html +++ b/docs/modules/_utils_feetointerestrate_.html @@ -87,7 +87,7 @@

      Const feeToInterestRate
    • diff --git a/docs/modules/_utils_getloanstatus_.html b/docs/modules/_utils_getloanstatus_.html index b1c9dc1..c307fbd 100644 --- a/docs/modules/_utils_getloanstatus_.html +++ b/docs/modules/_utils_getloanstatus_.html @@ -89,7 +89,7 @@

      LoanStatus

      LoanStatus: "Whitelisted" | "Ongoing" | "Repaid"
      @@ -106,7 +106,7 @@

      getLoanStatus

    • Parameters

      diff --git a/docs/modules/_utils_interestratetofee_.html b/docs/modules/_utils_interestratetofee_.html index 4829a34..aa5e1f9 100644 --- a/docs/modules/_utils_interestratetofee_.html +++ b/docs/modules/_utils_interestratetofee_.html @@ -87,7 +87,7 @@

      Const interestRateToFee
    • diff --git a/package.json b/package.json index d267e29..75844d8 100644 --- a/package.json +++ b/package.json @@ -8,6 +8,15 @@ "files": [ "dist" ], + "scripts": { + "build": "rollup -c", + "start": "rollup -cw", + "test": "ts-mocha -p src/test/tsconfig.json src/**/*.spec.ts src/*.spec.ts --timeout 40000", + "nodemon": "nodemon node inspect dist/Tinlake.js", + "generate-docs": "typedoc --out docs --exclude \"./node_modules/**\" --exclude \"./src/abi/**\" --exclude \"./src/index.ts\" --exclude \"./src/actions/*.spec.ts\" --exclude \"./src/test/**\" --excludeExternals --excludeNotExported --ignoreCompilerErrors ./src", + "lint": "tslint --project .", + "lint-fix": "tslint --fix -c ./tslint.json 'src/**/*{.ts,.tsx}'" + }, "dependencies": { "bignumber.js": "^9.0.0", "decimal.js-light": "^2.5.0", @@ -43,15 +52,6 @@ "typedoc": "^0.17.3", "typescript": "^3.8.3" }, - "scripts": { - "build": "rollup -c", - "watch": "rollup -cw", - "test": "ts-mocha -p src/test/tsconfig.json src/**/*.spec.ts src/*.spec.ts --timeout 40000", - "nodemon": "nodemon node inspect dist/Tinlake.js", - "generate-docs": "typedoc --out docs --exclude \"./node_modules/**\" --exclude \"./src/abi/**\" --exclude \"./src/index.ts\" --exclude \"./src/actions/*.spec.ts\" --exclude \"./src/test/**\" --excludeExternals --excludeNotExported --ignoreCompilerErrors ./src", - "lint": "tslint --project .", - "lint-fix": "tslint --fix -c ./tslint.json 'src/**/*{.ts,.tsx}'" - }, "husky": { "hooks": { "pre-commit": "npm run generate-docs && npm run lint-fix && npm run build && git add ./dist/* && git add ./docs/*" diff --git a/src/Tinlake.ts b/src/Tinlake.ts index d8070b1..bddb5ee 100644 --- a/src/Tinlake.ts +++ b/src/Tinlake.ts @@ -37,15 +37,27 @@ type AbiOutput = { type: 'address' | 'uint256'; }; +export type PendingTransaction = { + hash: string + contractKey: string + timesOutAt: number +} + export type EthConfig = { from?: string; gasPrice?: string; gas?: string; }; +export type EthersOverrides = { + gasPrice?: number; + gasLimit?: number; +}; + export type EthersConfig = { provider?: ethers.providers.Provider signer?: ethers.Signer, + overrides?: EthersOverrides }; export type ContractNames = typeof contractNames[number]; @@ -151,6 +163,19 @@ export default class Tinlake { return contract; } + getContract(address: string, abiName: string): ethers.Contract | undefined { + return this.ethersConfig.signer ? new ethers.Contract( + address, + this.contractAbis[abiName], + this.ethersConfig.signer + ) : undefined + } + + async subscribe(tx: PendingTransaction, callback: (response: ethers.providers.TransactionReceipt) => void) { + const response = await this.ethersConfig.provider!.waitForTransaction(tx.hash); + callback(response) + } + getOperatorType = (tranche: string) => { switch (tranche) { case 'senior': diff --git a/src/actions/collateral.ts b/src/actions/collateral.ts index 8d0fcc6..393d945 100644 --- a/src/actions/collateral.ts +++ b/src/actions/collateral.ts @@ -14,10 +14,21 @@ export function CollateralActions } mintNFT = async (nftAddr: string, owner: string, tokenId: string, ref: string, amount: string, asset:string) => { - const nft: any = this.eth.contract(this.contractAbis['COLLATERAL_NFT']).at(nftAddr); - const txHash = await executeAndRetry(nft.mint, [owner, tokenId, ref, amount, asset, this.ethConfig]); - console.log(`[NFT.mint] txHash: ${txHash}`); - return waitAndReturnEvents(this.eth, txHash, this.contractAbis['COLLATERAL_NFT'], this.transactionTimeout); + const nft = this.getContract(nftAddr, "COLLATERAL_NFT") + + if (nft) { + try { + const tx = await nft.mint(owner, tokenId, ref, amount, asset); + return { hash: tx.hash, contractKey: "COLLATERAL_NFT", timesOutAt: 0 }; + } catch (error) { + return error + } + } else { + const nft: any = this.eth.contract(this.contractAbis['COLLATERAL_NFT']).at(nftAddr); + const txHash = await executeAndRetry(nft.mint, [owner, tokenId, ref, amount, asset, this.ethConfig]); + console.log(`[NFT.mint] txHash: ${txHash}`); + return waitAndReturnEvents(this.eth, txHash, this.contractAbis['COLLATERAL_NFT'], this.transactionTimeout); + } } approveNFT = async (nftAddr: string, tokenId: string, to: string) => { From ebf784b1a20a10bd2a6875144c4a957817280397 Mon Sep 17 00:00:00 2001 From: Jeroen Offerijns Date: Thu, 20 Aug 2020 17:31:24 +0200 Subject: [PATCH 02/65] feat: pass overrides for ethers --- docs/classes/_tinlake_.tinlake.html | 38 ++++++------ docs/interfaces/_services_ethereum_.ethi.html | 16 ++--- .../_services_ethereum_.events.html | 6 +- docs/modules/_actions_admin_.html | 30 +++++----- docs/modules/_actions_analytics_.html | 60 +++++++++---------- docs/modules/_actions_borrower_.html | 20 +++---- docs/modules/_actions_collateral_.html | 22 +++---- docs/modules/_actions_currency_.html | 10 ++-- docs/modules/_actions_governance_.html | 4 +- docs/modules/_actions_index_.html | 2 +- docs/modules/_actions_lender_.html | 18 +++--- docs/modules/_actions_proxy_.html | 30 +++++----- docs/modules/_services_ethereum_.html | 10 ++-- docs/modules/_tinlake_.html | 20 +++---- docs/modules/_types_tinlake_.html | 10 ++-- docs/modules/_utils_basetodisplay_.html | 2 +- docs/modules/_utils_bntohex_.html | 2 +- docs/modules/_utils_displaytobase_.html | 2 +- docs/modules/_utils_feetointerestrate_.html | 2 +- docs/modules/_utils_getloanstatus_.html | 4 +- docs/modules/_utils_interestratetofee_.html | 2 +- src/Tinlake.ts | 12 ++-- src/actions/collateral.ts | 8 +-- 23 files changed, 165 insertions(+), 165 deletions(-) diff --git a/docs/classes/_tinlake_.tinlake.html b/docs/classes/_tinlake_.tinlake.html index 8208205..83c22e6 100644 --- a/docs/classes/_tinlake_.tinlake.html +++ b/docs/classes/_tinlake_.tinlake.html @@ -126,7 +126,7 @@

      constructor

    • Parameters

      @@ -148,7 +148,7 @@

      contractAbis

      contractAbis: ContractAbis
      @@ -158,7 +158,7 @@

      contractAddresses

      contractAddresses: ContractAddresses
      @@ -168,7 +168,7 @@

      contractConfig

      contractConfig: any
      @@ -178,7 +178,7 @@

      contracts

      contracts: Contracts
      @@ -188,7 +188,7 @@

      eth

      eth: ethI
      @@ -198,7 +198,7 @@

      ethConfig

      ethConfig: EthConfig
      @@ -208,7 +208,7 @@

      ethOptions

      ethOptions: any
      @@ -218,7 +218,7 @@

      ethersConfig

      ethersConfig: EthersConfig
      @@ -228,7 +228,7 @@

      provider

      provider: any
      @@ -238,7 +238,7 @@

      transactionTimeout

      transactionTimeout: number
      @@ -255,7 +255,7 @@

      createContract

    • Parameters

      @@ -281,7 +281,7 @@

      getContract

    • Parameters

      @@ -307,7 +307,7 @@

      getOperatorType

    • Parameters

      @@ -330,7 +330,7 @@

      setContracts

    • Returns void

      @@ -347,7 +347,7 @@

      setEthConfig

    • Parameters

      @@ -370,7 +370,7 @@

      setEthersConfig

    • Parameters

      @@ -393,7 +393,7 @@

      setProvider

    • Parameters

      @@ -419,7 +419,7 @@

      subscribe

    • Parameters

      diff --git a/docs/interfaces/_services_ethereum_.ethi.html b/docs/interfaces/_services_ethereum_.ethi.html index df76883..539e8a3 100644 --- a/docs/interfaces/_services_ethereum_.ethi.html +++ b/docs/interfaces/_services_ethereum_.ethi.html @@ -101,7 +101,7 @@

      abi

      abi: any
      @@ -111,7 +111,7 @@

      contract

      contract: (arg0: any) => { at: (arg0: any) => void }
      @@ -165,7 +165,7 @@

      getTransactionByHash

      getTransactionByHash: (arg0: any, arg1: (err: any, tx: any) => void) => void
      @@ -220,7 +220,7 @@

      getTransactionCount

      getTransactionCount: any
      @@ -230,7 +230,7 @@

      getTransactionReceipt

      getTransactionReceipt: (arg0: any, arg1: (err: any, receipt: any) => void) => void
      @@ -285,7 +285,7 @@

      send

      send: Function
      @@ -295,7 +295,7 @@

      sendRawTransaction

      sendRawTransaction: any
      @@ -305,7 +305,7 @@

      web3_sha3

      web3_sha3: (signature: string) => string
      diff --git a/docs/interfaces/_services_ethereum_.events.html b/docs/interfaces/_services_ethereum_.events.html index b5a8af7..d03a663 100644 --- a/docs/interfaces/_services_ethereum_.events.html +++ b/docs/interfaces/_services_ethereum_.events.html @@ -96,7 +96,7 @@

      events

      events: { data: any[]; event: { name: any } }[]
      @@ -106,7 +106,7 @@

      status

      status: any
      @@ -116,7 +116,7 @@

      txHash

      txHash: string
      diff --git a/docs/modules/_actions_admin_.html b/docs/modules/_actions_admin_.html index 3fcab2d..5615bb2 100644 --- a/docs/modules/_actions_admin_.html +++ b/docs/modules/_actions_admin_.html @@ -89,7 +89,7 @@

      IAdminActions

      IAdminActions: { approveAllowanceJunior: any; approveAllowanceSenior: any; canSetInterestRate: any; canSetInvestorAllowanceJunior: any; canSetInvestorAllowanceSenior: any; canSetLoanPrice: any; canSetMinimumJuniorRatio: any; canSetRiskScore: any; canSetSeniorTrancheInterest: any; initRate: any; isWard: any; setMinimumJuniorRatio: any; setRate: any }
      @@ -104,7 +104,7 @@
      approveAllowanceJunior:
    • Parameters

      @@ -132,7 +132,7 @@
      approveAllowanceSenior:
    • Parameters

      @@ -160,7 +160,7 @@
      canSetInterestRate:

      Parameters

      @@ -182,7 +182,7 @@
      canSetInvestorAllowanceJunior

      Parameters

      @@ -204,7 +204,7 @@
      canSetInvestorAllowanceSenior

      Parameters

      @@ -226,7 +226,7 @@
      canSetLoanPrice: fu
    • Parameters

      @@ -248,7 +248,7 @@
      canSetMinimumJuniorRatio

      Parameters

      @@ -270,7 +270,7 @@
      canSetRiskScore: fu
    • Parameters

      @@ -292,7 +292,7 @@
      canSetSeniorTrancheInterest

      Parameters

      @@ -314,7 +314,7 @@
      initRate: function
    • Parameters

      @@ -336,7 +336,7 @@
      isWard: function
    • Parameters

      @@ -361,7 +361,7 @@
      setMinimumJuniorRatio:

      Parameters

      @@ -383,7 +383,7 @@
      setRate: function
    • Parameters

      @@ -415,7 +415,7 @@

      AdminActions

    • Type parameters

      diff --git a/docs/modules/_actions_analytics_.html b/docs/modules/_actions_analytics_.html index cf9d8da..f40dc72 100644 --- a/docs/modules/_actions_analytics_.html +++ b/docs/modules/_actions_analytics_.html @@ -89,7 +89,7 @@

      IAnalyticsActions

      IAnalyticsActions: { existsSenior: any; getAssetValueJunior: any; getCollateral: any; getCurrentJuniorRatio: any; getDebt: any; getInterestRate: any; getInvestor: any; getJuniorReserve: any; getJuniorTokenBalance: any; getLoan: any; getLoanList: any; getMaxRedeemAmountJunior: any; getMaxRedeemAmountSenior: any; getMaxSupplyAmountJunior: any; getMaxSupplyAmountSenior: any; getMinJuniorRatio: any; getOwnerOfCollateral: any; getOwnerOfLoan: any; getPrincipal: any; getSeniorDebt: any; getSeniorInterestRate: any; getSeniorReserve: any; getSeniorTokenBalance: any; getTokenPriceJunior: any; getTokenPriceSenior: any; getTotalBalance: any; getTotalDebt: any; loanCount: any }
      @@ -104,7 +104,7 @@
      existsSenior: function
    • Returns boolean

      @@ -120,7 +120,7 @@
      getAssetValueJunior:

      Returns Promise<BN>

      @@ -136,7 +136,7 @@
      getCollateral: function
    • Parameters

      @@ -158,7 +158,7 @@
      getCurrentJuniorRatio:

      Returns Promise<BN>

      @@ -174,7 +174,7 @@
      getDebt: function
    • Parameters

      @@ -196,7 +196,7 @@
      getInterestRate: functio
    • Parameters

      @@ -218,7 +218,7 @@
      getInvestor: function
    • Parameters

      @@ -240,7 +240,7 @@
      getJuniorReserve: functi
    • Returns Promise<BN>

      @@ -256,7 +256,7 @@
      getJuniorTokenBalance:

      Parameters

      @@ -278,7 +278,7 @@
      getLoan: function
    • Parameters

      @@ -300,7 +300,7 @@
      getLoanList: function

      Returns Promise<Loan[]>

      @@ -316,7 +316,7 @@
      getMaxRedeemAmountJunior

      Parameters

      @@ -338,7 +338,7 @@
      getMaxRedeemAmountSenior

      Parameters

      @@ -360,7 +360,7 @@
      getMaxSupplyAmountJunior

      Parameters

      @@ -382,7 +382,7 @@
      getMaxSupplyAmountSenior

      Parameters

      @@ -404,7 +404,7 @@
      getMinJuniorRatio:
    • Returns Promise<BN>

      @@ -420,7 +420,7 @@
      getOwnerOfCollateral: fu
    • Parameters

      @@ -448,7 +448,7 @@
      getOwnerOfLoan: function
    • Parameters

      @@ -470,7 +470,7 @@
      getPrincipal: function
    • Parameters

      @@ -492,7 +492,7 @@
      getSeniorDebt: function<
    • Returns Promise<BN>

      @@ -508,7 +508,7 @@
      getSeniorInterestRate:

      Returns Promise<BN>

      @@ -524,7 +524,7 @@
      getSeniorReserve: functi
    • Returns Promise<BN>

      @@ -540,7 +540,7 @@
      getSeniorTokenBalance:

      Parameters

      @@ -562,7 +562,7 @@
      getTokenPriceJunior:

      Returns Promise<BN>

      @@ -578,7 +578,7 @@
      getTokenPriceSenior:

      Parameters

      @@ -600,7 +600,7 @@
      getTotalBalance: functio
    • Returns Promise<BN>

      @@ -616,7 +616,7 @@
      getTotalDebt: function

      Returns Promise<BN>

      @@ -632,7 +632,7 @@
      loanCount: function
    • Returns Promise<BN>

      @@ -655,7 +655,7 @@

      AnalyticsActions

    • Type parameters

      diff --git a/docs/modules/_actions_borrower_.html b/docs/modules/_actions_borrower_.html index abd19bb..1127472 100644 --- a/docs/modules/_actions_borrower_.html +++ b/docs/modules/_actions_borrower_.html @@ -89,7 +89,7 @@

      IBorrowerActions

      IBorrowerActions: { borrow: any; close: any; issue: any; lock: any; nftLookup: any; repay: any; unlock: any; withdraw: any }
      @@ -104,7 +104,7 @@
      borrow: function
    • Parameters

      @@ -129,7 +129,7 @@
      close: function
    • Parameters

      @@ -151,7 +151,7 @@
      issue: function
    • Parameters

      @@ -176,7 +176,7 @@
      lock: function
    • Parameters

      @@ -198,7 +198,7 @@
      nftLookup: function
    • Parameters

      @@ -223,7 +223,7 @@
      repay: function
    • Parameters

      @@ -248,7 +248,7 @@
      unlock: function
    • Parameters

      @@ -270,7 +270,7 @@
      withdraw: function
    • Parameters

      @@ -305,7 +305,7 @@

      BorrowerActions

    • Type parameters

      diff --git a/docs/modules/_actions_collateral_.html b/docs/modules/_actions_collateral_.html index 36454bb..495b17d 100644 --- a/docs/modules/_actions_collateral_.html +++ b/docs/modules/_actions_collateral_.html @@ -89,7 +89,7 @@

      ICollateralActions

      ICollateralActions: { approveNFT: any; getNFTCount: any; getNFTData: any; getNFTOwner: any; isNFTApprovedForAll: any; mintNFT: any; mintTitleNFT: any; setNFTApprovalForAll: any; transferNFT: any }
      @@ -104,7 +104,7 @@
      approveNFT: function
    • Parameters

      @@ -132,7 +132,7 @@
      getNFTCount: function
    • Parameters

      @@ -154,7 +154,7 @@
      getNFTData: function
    • Parameters

      @@ -179,7 +179,7 @@
      getNFTOwner: function
    • Parameters

      @@ -204,7 +204,7 @@
      isNFTApprovedForAll: fun
    • Parameters

      @@ -232,7 +232,7 @@
      mintNFT: function
    • Parameters

      @@ -269,7 +269,7 @@
      mintTitleNFT: function
    • Parameters

      @@ -294,7 +294,7 @@
      setNFTApprovalForAll: fu
    • Parameters

      @@ -322,7 +322,7 @@
      transferNFT: function
    • Parameters

      @@ -360,7 +360,7 @@

      CollateralActions

    • Type parameters

      diff --git a/docs/modules/_actions_currency_.html b/docs/modules/_actions_currency_.html index 8c47961..020d8d1 100644 --- a/docs/modules/_actions_currency_.html +++ b/docs/modules/_actions_currency_.html @@ -89,7 +89,7 @@

      ICurrencyActions

      ICurrencyActions: { approveJuniorForCurrency: (currencyAmount: string) => Promise<unknown>; approveSeniorForCurrency: (currencyAmount: string) => Promise<unknown>; getCurrencyAllowance: (owner: string, spender: string) => Promise<BN>; getJuniorForCurrencyAllowance: (owner: string) => Promise<BN | undefined>; getSeniorForCurrencyAllowance: (owner: string) => Promise<BN | undefined>; approveCurrency: any; getCurrencyBalance: any; mintCurrency: any }
      @@ -212,7 +212,7 @@
      approveCurrency: function

      Parameters

      @@ -237,7 +237,7 @@
      getCurrencyBalance: func
    • Parameters

      @@ -259,7 +259,7 @@
      mintCurrency: function
    • Parameters

      @@ -291,7 +291,7 @@

      CurrencyActions

    • Type parameters

      diff --git a/docs/modules/_actions_governance_.html b/docs/modules/_actions_governance_.html index 2ee5a72..d84fa61 100644 --- a/docs/modules/_actions_governance_.html +++ b/docs/modules/_actions_governance_.html @@ -83,7 +83,7 @@

      IGovernanceActions

      IGovernanceActions: { relyAddress: any }
      @@ -98,7 +98,7 @@
      relyAddress: function
    • Parameters

      diff --git a/docs/modules/_actions_index_.html b/docs/modules/_actions_index_.html index 85d5fb6..d9375ba 100644 --- a/docs/modules/_actions_index_.html +++ b/docs/modules/_actions_index_.html @@ -83,7 +83,7 @@

      TinlakeActions

      diff --git a/docs/modules/_actions_lender_.html b/docs/modules/_actions_lender_.html index a4a657b..b271ef5 100644 --- a/docs/modules/_actions_lender_.html +++ b/docs/modules/_actions_lender_.html @@ -89,7 +89,7 @@

      ILenderActions

      ILenderActions: { approveJuniorToken: (tokenAmount: string) => Promise<unknown>; approveSeniorToken: (tokenAmount: string) => Promise<unknown>; balance: any; getJuniorTokenAllowance: any; getSeniorTokenAllowance: any; redeemJunior: any; redeemSenior: any; supplyJunior: any; supplySenior: any }
      @@ -146,7 +146,7 @@
      balance: function
    • Returns Promise<any>

      @@ -162,7 +162,7 @@
      getJuniorTokenAllowance: <
    • Parameters

      @@ -184,7 +184,7 @@
      getSeniorTokenAllowance: <
    • Parameters

      @@ -206,7 +206,7 @@
      redeemJunior: function
    • Parameters

      @@ -228,7 +228,7 @@
      redeemSenior: function
    • Parameters

      @@ -250,7 +250,7 @@
      supplyJunior: function
    • Parameters

      @@ -272,7 +272,7 @@
      supplySenior: function
    • Parameters

      @@ -301,7 +301,7 @@

      LenderActions

    • Type parameters

      diff --git a/docs/modules/_actions_proxy_.html b/docs/modules/_actions_proxy_.html index c143880..d98953d 100644 --- a/docs/modules/_actions_proxy_.html +++ b/docs/modules/_actions_proxy_.html @@ -89,7 +89,7 @@

      IProxyActions

      IProxyActions: { buildProxy: any; checkProxyExists: any; getProxy: any; getProxyAccessToken: any; getProxyAccessTokenOwner: any; getProxyOwnerByAddress: any; getProxyOwnerByLoan: any; proxyCount: any; proxyCreateNew: any; proxyIssue: any; proxyLockBorrowWithdraw: any; proxyRepayUnlockClose: any; proxyTransferIssue: any }
      @@ -104,7 +104,7 @@
      buildProxy: function
    • Parameters

      @@ -126,7 +126,7 @@
      checkProxyExists: functi
    • Parameters

      @@ -148,7 +148,7 @@
      getProxy: function
    • Parameters

      @@ -170,7 +170,7 @@
      getProxyAccessToken:

      Parameters

      @@ -192,7 +192,7 @@
      getProxyAccessTokenOwner

      Parameters

      @@ -214,7 +214,7 @@
      getProxyOwnerByAddress:

      Parameters

      @@ -236,7 +236,7 @@
      getProxyOwnerByLoan:

      Parameters

      @@ -258,7 +258,7 @@
      proxyCount: function
    • Returns Promise<any>

      @@ -274,7 +274,7 @@
      proxyCreateNew: function
    • Parameters

      @@ -296,7 +296,7 @@
      proxyIssue: function
    • Parameters

      @@ -324,7 +324,7 @@
      proxyLockBorrowWithdraw: <
    • Parameters

      @@ -355,7 +355,7 @@
      proxyRepayUnlockClose:

      Parameters

      @@ -386,7 +386,7 @@
      proxyTransferIssue: func
    • Parameters

      @@ -421,7 +421,7 @@

      ProxyActions

    • Type parameters

      diff --git a/docs/modules/_services_ethereum_.html b/docs/modules/_services_ethereum_.html index a14402a..2e08916 100644 --- a/docs/modules/_services_ethereum_.html +++ b/docs/modules/_services_ethereum_.html @@ -99,7 +99,7 @@

      Const ZERO_ADDRESS

      ZERO_ADDRESS: "0x0000000000000000000000000000000000000000" = "0x0000000000000000000000000000000000000000"
      @@ -116,7 +116,7 @@

      executeAndRetry

    • Parameters

      @@ -142,7 +142,7 @@

      Const findEvent

    • Parameters

      @@ -209,7 +209,7 @@

      Const waitAndReturn

      Parameters

      @@ -241,7 +241,7 @@

      Const waitForTransactio
    • Parameters

      diff --git a/docs/modules/_tinlake_.html b/docs/modules/_tinlake_.html index 99bfc58..2357d4e 100644 --- a/docs/modules/_tinlake_.html +++ b/docs/modules/_tinlake_.html @@ -98,7 +98,7 @@

      Constructor

      Constructor<T>: {}

      Type parameters

      @@ -119,7 +119,7 @@

      ContractAbis

      ContractAbis: {}
      @@ -134,7 +134,7 @@

      ContractAddresses

      ContractAddresses: {}
      @@ -149,7 +149,7 @@

      ContractNames

      ContractNames: typeof contractNames[number]
      @@ -159,7 +159,7 @@

      Contracts

      Contracts: {}
      @@ -174,7 +174,7 @@

      EthConfig

      EthConfig: { from?: undefined | string; gas?: undefined | string; gasPrice?: undefined | string }
      @@ -198,7 +198,7 @@

      EthersConfig

      EthersConfig: { overrides?: EthersOverrides; provider?: ethers.providers.Provider; signer?: ethers.Signer }
      @@ -222,7 +222,7 @@

      EthersOverrides

      EthersOverrides: { gasLimit?: undefined | number; gasPrice?: undefined | number }
      @@ -243,7 +243,7 @@

      PendingTransaction

      PendingTransaction: { contractKey: string; hash: string; timesOutAt: number }
      @@ -267,7 +267,7 @@

      TinlakeParams

      TinlakeParams: { contractAbis?: ContractAbis | {}; contractAddresses?: ContractAddresses | {}; contractConfig?: any | {}; contracts?: Contracts | {}; ethConfig?: EthConfig; ethOptions?: any | {}; ethersConfig?: EthersConfig; provider: any; transactionTimeout: number }
      diff --git a/docs/modules/_types_tinlake_.html b/docs/modules/_types_tinlake_.html index 7151f82..8af356f 100644 --- a/docs/modules/_types_tinlake_.html +++ b/docs/modules/_types_tinlake_.html @@ -87,7 +87,7 @@

      ITinlake

      @@ -97,7 +97,7 @@

      Investor

      Investor: { address: string; junior: { maxRedeem: BN; maxSupply: BN; tokenBalance: BN }; senior: { maxRedeem?: BN; maxSupply?: BN; tokenBalance?: BN } }
      @@ -143,7 +143,7 @@

      Loan

      Loan: { debt: BN; interestRate: BN; loanId: string; nft?: NFT; ownerOf: BN; price?: BN; principal: BN; proxyOwner?: undefined | string; registry: string; status?: undefined | string; threshold?: BN; tokenId: BN }
      @@ -194,7 +194,7 @@

      NFT

      NFT: { nftData: any; nftOwner: string; registry: string; tokenId: BN }
      @@ -221,7 +221,7 @@

      Tranche

      Tranche: { availableFunds: BN; interestRate?: BN; token: string; tokenPrice: BN; totalSupply: BN; type: string }
      diff --git a/docs/modules/_utils_basetodisplay_.html b/docs/modules/_utils_basetodisplay_.html index 50ab576..a31abfd 100644 --- a/docs/modules/_utils_basetodisplay_.html +++ b/docs/modules/_utils_basetodisplay_.html @@ -87,7 +87,7 @@

      Const baseToDisplay

    • Parameters

      diff --git a/docs/modules/_utils_bntohex_.html b/docs/modules/_utils_bntohex_.html index 48e9521..b313343 100644 --- a/docs/modules/_utils_bntohex_.html +++ b/docs/modules/_utils_bntohex_.html @@ -87,7 +87,7 @@

      Const bnToHex

    • Parameters

      diff --git a/docs/modules/_utils_displaytobase_.html b/docs/modules/_utils_displaytobase_.html index fb2ef19..c258b2f 100644 --- a/docs/modules/_utils_displaytobase_.html +++ b/docs/modules/_utils_displaytobase_.html @@ -87,7 +87,7 @@

      Const displayToBase

    • Parameters

      diff --git a/docs/modules/_utils_feetointerestrate_.html b/docs/modules/_utils_feetointerestrate_.html index df4857b..fb0888e 100644 --- a/docs/modules/_utils_feetointerestrate_.html +++ b/docs/modules/_utils_feetointerestrate_.html @@ -87,7 +87,7 @@

      Const feeToInterestRate
    • diff --git a/docs/modules/_utils_getloanstatus_.html b/docs/modules/_utils_getloanstatus_.html index c307fbd..38eefff 100644 --- a/docs/modules/_utils_getloanstatus_.html +++ b/docs/modules/_utils_getloanstatus_.html @@ -89,7 +89,7 @@

      LoanStatus

      LoanStatus: "Whitelisted" | "Ongoing" | "Repaid"
      @@ -106,7 +106,7 @@

      getLoanStatus

    • Parameters

      diff --git a/docs/modules/_utils_interestratetofee_.html b/docs/modules/_utils_interestratetofee_.html index aa5e1f9..d6bc72d 100644 --- a/docs/modules/_utils_interestratetofee_.html +++ b/docs/modules/_utils_interestratetofee_.html @@ -87,7 +87,7 @@

      Const interestRateToFee
    • diff --git a/src/Tinlake.ts b/src/Tinlake.ts index bddb5ee..cd02d71 100644 --- a/src/Tinlake.ts +++ b/src/Tinlake.ts @@ -40,8 +40,8 @@ type AbiOutput = { export type PendingTransaction = { hash: string contractKey: string - timesOutAt: number -} + timesOutAt: number, +}; export type EthConfig = { from?: string; @@ -57,7 +57,7 @@ export type EthersOverrides = { export type EthersConfig = { provider?: ethers.providers.Provider signer?: ethers.Signer, - overrides?: EthersOverrides + overrides?: EthersOverrides, }; export type ContractNames = typeof contractNames[number]; @@ -167,13 +167,13 @@ export default class Tinlake { return this.ethersConfig.signer ? new ethers.Contract( address, this.contractAbis[abiName], - this.ethersConfig.signer - ) : undefined + this.ethersConfig.signer, + ) : undefined; } async subscribe(tx: PendingTransaction, callback: (response: ethers.providers.TransactionReceipt) => void) { const response = await this.ethersConfig.provider!.waitForTransaction(tx.hash); - callback(response) + callback(response); } getOperatorType = (tranche: string) => { diff --git a/src/actions/collateral.ts b/src/actions/collateral.ts index 393d945..5e0efd3 100644 --- a/src/actions/collateral.ts +++ b/src/actions/collateral.ts @@ -14,16 +14,16 @@ export function CollateralActions } mintNFT = async (nftAddr: string, owner: string, tokenId: string, ref: string, amount: string, asset:string) => { - const nft = this.getContract(nftAddr, "COLLATERAL_NFT") + const nft = this.getContract(nftAddr, 'COLLATERAL_NFT'); if (nft) { try { const tx = await nft.mint(owner, tokenId, ref, amount, asset); - return { hash: tx.hash, contractKey: "COLLATERAL_NFT", timesOutAt: 0 }; + return { hash: tx.hash, contractKey: 'COLLATERAL_NFT', timesOutAt: 0 }; } catch (error) { - return error + return error; } - } else { + } { const nft: any = this.eth.contract(this.contractAbis['COLLATERAL_NFT']).at(nftAddr); const txHash = await executeAndRetry(nft.mint, [owner, tokenId, ref, amount, asset, this.ethConfig]); console.log(`[NFT.mint] txHash: ${txHash}`); From eb794d66d6b302aa96556d1290fe74df30e6df57 Mon Sep 17 00:00:00 2001 From: Jeroen Offerijns Date: Fri, 21 Aug 2020 11:40:16 +0200 Subject: [PATCH 03/65] feat: ipmlement get transaction receipt method using ethers.js --- dist/Tinlake.d.ts | 2 +- dist/actions/collateral.d.ts | 2 +- dist/index.es.js | 26 ++-- dist/index.js | 26 ++-- docs/assets/js/search.js | 2 +- docs/classes/_tinlake_.tinlake.html | 111 +++++++----------- docs/interfaces/_services_ethereum_.ethi.html | 16 +-- .../_services_ethereum_.events.html | 6 +- docs/modules/_actions_admin_.html | 30 ++--- docs/modules/_actions_analytics_.html | 60 +++++----- docs/modules/_actions_borrower_.html | 20 ++-- docs/modules/_actions_collateral_.html | 22 ++-- docs/modules/_actions_currency_.html | 10 +- docs/modules/_actions_governance_.html | 4 +- docs/modules/_actions_index_.html | 2 +- docs/modules/_actions_lender_.html | 18 +-- docs/modules/_actions_proxy_.html | 30 ++--- docs/modules/_services_ethereum_.html | 10 +- docs/modules/_tinlake_.html | 20 ++-- docs/modules/_types_tinlake_.html | 10 +- docs/modules/_utils_basetodisplay_.html | 2 +- docs/modules/_utils_bntohex_.html | 2 +- docs/modules/_utils_displaytobase_.html | 2 +- docs/modules/_utils_feetointerestrate_.html | 2 +- docs/modules/_utils_getloanstatus_.html | 4 +- docs/modules/_utils_interestratetofee_.html | 2 +- src/Tinlake.ts | 5 +- src/actions/collateral.ts | 13 +- 28 files changed, 221 insertions(+), 238 deletions(-) diff --git a/dist/Tinlake.d.ts b/dist/Tinlake.d.ts index 6144aca..7e1c3c5 100644 --- a/dist/Tinlake.d.ts +++ b/dist/Tinlake.d.ts @@ -60,7 +60,7 @@ export default class Tinlake { setEthersConfig: (ethersConfig: EthersConfig) => void; createContract(address: string, abiName: string): void; getContract(address: string, abiName: string): ethers.Contract | undefined; - subscribe(tx: PendingTransaction, callback: (response: ethers.providers.TransactionReceipt) => void): Promise; + getTransactionReceipt(tx: PendingTransaction): Promise; getOperatorType: (tranche: string) => any; } export {}; diff --git a/dist/actions/collateral.d.ts b/dist/actions/collateral.d.ts index 9f12f6a..ab46cc2 100644 --- a/dist/actions/collateral.d.ts +++ b/dist/actions/collateral.d.ts @@ -27,7 +27,7 @@ export declare function CollateralActions void; createContract(address: string, abiName: string): void; getContract(address: string, abiName: string): import("ethers").Contract | undefined; - subscribe(tx: import("../Tinlake").PendingTransaction, callback: (response: import("ethers/providers").TransactionReceipt) => void): Promise; + getTransactionReceipt(tx: import("../Tinlake").PendingTransaction): Promise; getOperatorType: (tranche: string) => any; }; } & ActionsBase; diff --git a/dist/index.es.js b/dist/index.es.js index 33b84fe..be16f5a 100644 --- a/dist/index.es.js +++ b/dist/index.es.js @@ -29631,25 +29631,29 @@ function CollateralActions(Base) { }); }); }; _this.mintNFT = function (nftAddr, owner, tokenId, ref, amount, asset) { return __awaiter(_this, void 0, void 0, function () { - var nft, tx, error_1, nft_1, txHash; + var nftContract, tx, error_1, nft, txHash; return __generator(this, function (_a) { switch (_a.label) { case 0: - nft = this.getContract(nftAddr, 'COLLATERAL_NFT'); - if (!nft) return [3 /*break*/, 4]; + nftContract = this.getContract(nftAddr, 'COLLATERAL_NFT'); + if (!nftContract) return [3 /*break*/, 4]; _a.label = 1; case 1: _a.trys.push([1, 3, , 4]); - return [4 /*yield*/, nft.mint(owner, tokenId, ref, amount, asset)]; + return [4 /*yield*/, nftContract.mint(owner, tokenId, ref, amount, asset)]; case 2: tx = _a.sent(); - return [2 /*return*/, { hash: tx.hash, contractKey: 'COLLATERAL_NFT', timesOutAt: 0 }]; + return [2 /*return*/, { + hash: tx.hash, + contractKey: 'COLLATERAL_NFT', + timesOutAt: 0, + }]; case 3: error_1 = _a.sent(); return [2 /*return*/, error_1]; case 4: - nft_1 = this.eth.contract(this.contractAbis['COLLATERAL_NFT']).at(nftAddr); - return [4 /*yield*/, executeAndRetry(nft_1.mint, [owner, tokenId, ref, amount, asset, this.ethConfig])]; + nft = this.eth.contract(this.contractAbis['COLLATERAL_NFT']).at(nftAddr); + return [4 /*yield*/, executeAndRetry(nft.mint, [owner, tokenId, ref, amount, asset, this.ethConfig])]; case 5: txHash = _a.sent(); console.log("[NFT.mint] txHash: " + txHash); @@ -47481,16 +47485,12 @@ var Tinlake = /** @class */ (function () { Tinlake.prototype.getContract = function (address, abiName) { return this.ethersConfig.signer ? new ethers_2$1.Contract(address, this.contractAbis[abiName], this.ethersConfig.signer) : undefined; }; - Tinlake.prototype.subscribe = function (tx, callback) { + Tinlake.prototype.getTransactionReceipt = function (tx) { return __awaiter(this, void 0, void 0, function () { - var response; return __generator(this, function (_a) { switch (_a.label) { case 0: return [4 /*yield*/, this.ethersConfig.provider.waitForTransaction(tx.hash)]; - case 1: - response = _a.sent(); - callback(response); - return [2 /*return*/]; + case 1: return [2 /*return*/, _a.sent()]; } }); }); diff --git a/dist/index.js b/dist/index.js index e117e93..675adec 100644 --- a/dist/index.js +++ b/dist/index.js @@ -29637,25 +29637,29 @@ function CollateralActions(Base) { }); }); }; _this.mintNFT = function (nftAddr, owner, tokenId, ref, amount, asset) { return __awaiter(_this, void 0, void 0, function () { - var nft, tx, error_1, nft_1, txHash; + var nftContract, tx, error_1, nft, txHash; return __generator(this, function (_a) { switch (_a.label) { case 0: - nft = this.getContract(nftAddr, 'COLLATERAL_NFT'); - if (!nft) return [3 /*break*/, 4]; + nftContract = this.getContract(nftAddr, 'COLLATERAL_NFT'); + if (!nftContract) return [3 /*break*/, 4]; _a.label = 1; case 1: _a.trys.push([1, 3, , 4]); - return [4 /*yield*/, nft.mint(owner, tokenId, ref, amount, asset)]; + return [4 /*yield*/, nftContract.mint(owner, tokenId, ref, amount, asset)]; case 2: tx = _a.sent(); - return [2 /*return*/, { hash: tx.hash, contractKey: 'COLLATERAL_NFT', timesOutAt: 0 }]; + return [2 /*return*/, { + hash: tx.hash, + contractKey: 'COLLATERAL_NFT', + timesOutAt: 0, + }]; case 3: error_1 = _a.sent(); return [2 /*return*/, error_1]; case 4: - nft_1 = this.eth.contract(this.contractAbis['COLLATERAL_NFT']).at(nftAddr); - return [4 /*yield*/, executeAndRetry(nft_1.mint, [owner, tokenId, ref, amount, asset, this.ethConfig])]; + nft = this.eth.contract(this.contractAbis['COLLATERAL_NFT']).at(nftAddr); + return [4 /*yield*/, executeAndRetry(nft.mint, [owner, tokenId, ref, amount, asset, this.ethConfig])]; case 5: txHash = _a.sent(); console.log("[NFT.mint] txHash: " + txHash); @@ -47487,16 +47491,12 @@ var Tinlake = /** @class */ (function () { Tinlake.prototype.getContract = function (address, abiName) { return this.ethersConfig.signer ? new ethers_2$1.Contract(address, this.contractAbis[abiName], this.ethersConfig.signer) : undefined; }; - Tinlake.prototype.subscribe = function (tx, callback) { + Tinlake.prototype.getTransactionReceipt = function (tx) { return __awaiter(this, void 0, void 0, function () { - var response; return __generator(this, function (_a) { switch (_a.label) { case 0: return [4 /*yield*/, this.ethersConfig.provider.waitForTransaction(tx.hash)]; - case 1: - response = _a.sent(); - callback(response); - return [2 /*return*/]; + case 1: return [2 /*return*/, _a.sent()]; } }); }); diff --git a/docs/assets/js/search.js b/docs/assets/js/search.js index 93bafeb..af7ee17 100644 --- a/docs/assets/js/search.js +++ b/docs/assets/js/search.js @@ -1,3 +1,3 @@ var typedoc = typedoc || {}; typedoc.search = typedoc.search || {}; - typedoc.search.data = {"kinds":{"1":"Module","32":"Variable","64":"Function","128":"Class","256":"Interface","512":"Constructor","1024":"Property","2048":"Method","65536":"Type literal","4194304":"Type alias"},"rows":[{"id":0,"kind":1,"name":"\"services/ethereum\"","url":"modules/_services_ethereum_.html","classes":"tsd-kind-module"},{"id":1,"kind":256,"name":"ethI","url":"interfaces/_services_ethereum_.ethi.html","classes":"tsd-kind-interface tsd-parent-kind-module","parent":"\"services/ethereum\""},{"id":2,"kind":1024,"name":"send","url":"interfaces/_services_ethereum_.ethi.html#send","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"services/ethereum\".ethI"},{"id":3,"kind":1024,"name":"web3_sha3","url":"interfaces/_services_ethereum_.ethi.html#web3_sha3","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"services/ethereum\".ethI"},{"id":4,"kind":65536,"name":"__type","url":"interfaces/_services_ethereum_.ethi.html#web3_sha3.__type-3","classes":"tsd-kind-type-literal tsd-parent-kind-property","parent":"\"services/ethereum\".ethI.web3_sha3"},{"id":5,"kind":1024,"name":"getTransactionReceipt","url":"interfaces/_services_ethereum_.ethi.html#gettransactionreceipt","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"services/ethereum\".ethI"},{"id":6,"kind":65536,"name":"__type","url":"interfaces/_services_ethereum_.ethi.html#gettransactionreceipt.__type-2","classes":"tsd-kind-type-literal tsd-parent-kind-property","parent":"\"services/ethereum\".ethI.getTransactionReceipt"},{"id":7,"kind":1024,"name":"getTransactionByHash","url":"interfaces/_services_ethereum_.ethi.html#gettransactionbyhash","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"services/ethereum\".ethI"},{"id":8,"kind":65536,"name":"__type","url":"interfaces/_services_ethereum_.ethi.html#gettransactionbyhash.__type-1","classes":"tsd-kind-type-literal tsd-parent-kind-property","parent":"\"services/ethereum\".ethI.getTransactionByHash"},{"id":9,"kind":1024,"name":"contract","url":"interfaces/_services_ethereum_.ethi.html#contract","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"services/ethereum\".ethI"},{"id":10,"kind":65536,"name":"__type","url":"interfaces/_services_ethereum_.ethi.html#contract.__type","classes":"tsd-kind-type-literal tsd-parent-kind-property","parent":"\"services/ethereum\".ethI.contract"},{"id":11,"kind":1024,"name":"sendRawTransaction","url":"interfaces/_services_ethereum_.ethi.html#sendrawtransaction","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"services/ethereum\".ethI"},{"id":12,"kind":1024,"name":"getTransactionCount","url":"interfaces/_services_ethereum_.ethi.html#gettransactioncount","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"services/ethereum\".ethI"},{"id":13,"kind":1024,"name":"abi","url":"interfaces/_services_ethereum_.ethi.html#abi","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"services/ethereum\".ethI"},{"id":14,"kind":256,"name":"Events","url":"interfaces/_services_ethereum_.events.html","classes":"tsd-kind-interface tsd-parent-kind-module","parent":"\"services/ethereum\""},{"id":15,"kind":1024,"name":"txHash","url":"interfaces/_services_ethereum_.events.html#txhash","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"services/ethereum\".Events"},{"id":16,"kind":1024,"name":"status","url":"interfaces/_services_ethereum_.events.html#status","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"services/ethereum\".Events"},{"id":17,"kind":1024,"name":"events","url":"interfaces/_services_ethereum_.events.html#events","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"services/ethereum\".Events"},{"id":18,"kind":32,"name":"ZERO_ADDRESS","url":"modules/_services_ethereum_.html#zero_address","classes":"tsd-kind-variable tsd-parent-kind-module","parent":"\"services/ethereum\""},{"id":19,"kind":64,"name":"executeAndRetry","url":"modules/_services_ethereum_.html#executeandretry","classes":"tsd-kind-function tsd-parent-kind-module","parent":"\"services/ethereum\""},{"id":20,"kind":64,"name":"waitAndReturnEvents","url":"modules/_services_ethereum_.html#waitandreturnevents","classes":"tsd-kind-function tsd-parent-kind-module","parent":"\"services/ethereum\""},{"id":21,"kind":64,"name":"waitForTransaction","url":"modules/_services_ethereum_.html#waitfortransaction","classes":"tsd-kind-function tsd-parent-kind-module","parent":"\"services/ethereum\""},{"id":22,"kind":64,"name":"findEvent","url":"modules/_services_ethereum_.html#findevent","classes":"tsd-kind-function tsd-parent-kind-module","parent":"\"services/ethereum\""},{"id":23,"kind":1,"name":"\"Tinlake\"","url":"modules/_tinlake_.html","classes":"tsd-kind-module"},{"id":24,"kind":128,"name":"Tinlake","url":"classes/_tinlake_.tinlake.html","classes":"tsd-kind-class tsd-parent-kind-module","parent":"\"Tinlake\""},{"id":25,"kind":1024,"name":"provider","url":"classes/_tinlake_.tinlake.html#provider","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":26,"kind":1024,"name":"eth","url":"classes/_tinlake_.tinlake.html#eth","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":27,"kind":1024,"name":"ethOptions","url":"classes/_tinlake_.tinlake.html#ethoptions","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":28,"kind":1024,"name":"ethConfig","url":"classes/_tinlake_.tinlake.html#ethconfig","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":29,"kind":1024,"name":"ethersConfig","url":"classes/_tinlake_.tinlake.html#ethersconfig","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":30,"kind":1024,"name":"contractAddresses","url":"classes/_tinlake_.tinlake.html#contractaddresses","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":31,"kind":1024,"name":"transactionTimeout","url":"classes/_tinlake_.tinlake.html#transactiontimeout","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":32,"kind":1024,"name":"contracts","url":"classes/_tinlake_.tinlake.html#contracts","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":33,"kind":1024,"name":"contractAbis","url":"classes/_tinlake_.tinlake.html#contractabis","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":34,"kind":1024,"name":"contractConfig","url":"classes/_tinlake_.tinlake.html#contractconfig","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":35,"kind":512,"name":"constructor","url":"classes/_tinlake_.tinlake.html#constructor","classes":"tsd-kind-constructor tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":36,"kind":2048,"name":"setProvider","url":"classes/_tinlake_.tinlake.html#setprovider","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":37,"kind":2048,"name":"setContracts","url":"classes/_tinlake_.tinlake.html#setcontracts","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":38,"kind":2048,"name":"setEthConfig","url":"classes/_tinlake_.tinlake.html#setethconfig","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":39,"kind":2048,"name":"setEthersConfig","url":"classes/_tinlake_.tinlake.html#setethersconfig","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":40,"kind":2048,"name":"createContract","url":"classes/_tinlake_.tinlake.html#createcontract","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":41,"kind":2048,"name":"getContract","url":"classes/_tinlake_.tinlake.html#getcontract","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":42,"kind":2048,"name":"subscribe","url":"classes/_tinlake_.tinlake.html#subscribe","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":43,"kind":2048,"name":"getOperatorType","url":"classes/_tinlake_.tinlake.html#getoperatortype","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":44,"kind":4194304,"name":"PendingTransaction","url":"modules/_tinlake_.html#pendingtransaction","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"Tinlake\""},{"id":45,"kind":65536,"name":"__type","url":"modules/_tinlake_.html#pendingtransaction.__type-7","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"Tinlake\".PendingTransaction"},{"id":46,"kind":32,"name":"hash","url":"modules/_tinlake_.html#pendingtransaction.__type-7.hash","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".PendingTransaction.__type"},{"id":47,"kind":32,"name":"contractKey","url":"modules/_tinlake_.html#pendingtransaction.__type-7.contractkey","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".PendingTransaction.__type"},{"id":48,"kind":32,"name":"timesOutAt","url":"modules/_tinlake_.html#pendingtransaction.__type-7.timesoutat","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".PendingTransaction.__type"},{"id":49,"kind":4194304,"name":"EthConfig","url":"modules/_tinlake_.html#ethconfig","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"Tinlake\""},{"id":50,"kind":65536,"name":"__type","url":"modules/_tinlake_.html#ethconfig.__type-4","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"Tinlake\".EthConfig"},{"id":51,"kind":32,"name":"from","url":"modules/_tinlake_.html#ethconfig.__type-4.from","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".EthConfig.__type"},{"id":52,"kind":32,"name":"gasPrice","url":"modules/_tinlake_.html#ethconfig.__type-4.gasprice","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".EthConfig.__type"},{"id":53,"kind":32,"name":"gas","url":"modules/_tinlake_.html#ethconfig.__type-4.gas","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".EthConfig.__type"},{"id":54,"kind":4194304,"name":"EthersOverrides","url":"modules/_tinlake_.html#ethersoverrides","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"Tinlake\""},{"id":55,"kind":65536,"name":"__type","url":"modules/_tinlake_.html#ethersoverrides.__type-6","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"Tinlake\".EthersOverrides"},{"id":56,"kind":32,"name":"gasPrice","url":"modules/_tinlake_.html#ethersoverrides.__type-6.gasprice-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".EthersOverrides.__type"},{"id":57,"kind":32,"name":"gasLimit","url":"modules/_tinlake_.html#ethersoverrides.__type-6.gaslimit","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".EthersOverrides.__type"},{"id":58,"kind":4194304,"name":"EthersConfig","url":"modules/_tinlake_.html#ethersconfig","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"Tinlake\""},{"id":59,"kind":65536,"name":"__type","url":"modules/_tinlake_.html#ethersconfig.__type-5","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"Tinlake\".EthersConfig"},{"id":60,"kind":32,"name":"provider","url":"modules/_tinlake_.html#ethersconfig.__type-5.provider","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".EthersConfig.__type"},{"id":61,"kind":32,"name":"signer","url":"modules/_tinlake_.html#ethersconfig.__type-5.signer","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".EthersConfig.__type"},{"id":62,"kind":32,"name":"overrides","url":"modules/_tinlake_.html#ethersconfig.__type-5.overrides","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".EthersConfig.__type"},{"id":63,"kind":4194304,"name":"ContractNames","url":"modules/_tinlake_.html#contractnames","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"Tinlake\""},{"id":64,"kind":4194304,"name":"Contracts","url":"modules/_tinlake_.html#contracts","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"Tinlake\""},{"id":65,"kind":65536,"name":"__type","url":"modules/_tinlake_.html#contracts.__type-3","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"Tinlake\".Contracts"},{"id":66,"kind":4194304,"name":"ContractAbis","url":"modules/_tinlake_.html#contractabis","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"Tinlake\""},{"id":67,"kind":65536,"name":"__type","url":"modules/_tinlake_.html#contractabis.__type-1","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"Tinlake\".ContractAbis"},{"id":68,"kind":4194304,"name":"ContractAddresses","url":"modules/_tinlake_.html#contractaddresses","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"Tinlake\""},{"id":69,"kind":65536,"name":"__type","url":"modules/_tinlake_.html#contractaddresses.__type-2","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"Tinlake\".ContractAddresses"},{"id":70,"kind":4194304,"name":"TinlakeParams","url":"modules/_tinlake_.html#tinlakeparams","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"Tinlake\""},{"id":71,"kind":65536,"name":"__type","url":"modules/_tinlake_.html#tinlakeparams.__type-8","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"Tinlake\".TinlakeParams"},{"id":72,"kind":32,"name":"provider","url":"modules/_tinlake_.html#tinlakeparams.__type-8.provider-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".TinlakeParams.__type"},{"id":73,"kind":32,"name":"transactionTimeout","url":"modules/_tinlake_.html#tinlakeparams.__type-8.transactiontimeout","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".TinlakeParams.__type"},{"id":74,"kind":32,"name":"contractAddresses","url":"modules/_tinlake_.html#tinlakeparams.__type-8.contractaddresses-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".TinlakeParams.__type"},{"id":75,"kind":32,"name":"contractAbis","url":"modules/_tinlake_.html#tinlakeparams.__type-8.contractabis-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".TinlakeParams.__type"},{"id":76,"kind":32,"name":"ethConfig","url":"modules/_tinlake_.html#tinlakeparams.__type-8.ethconfig-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".TinlakeParams.__type"},{"id":77,"kind":32,"name":"ethersConfig","url":"modules/_tinlake_.html#tinlakeparams.__type-8.ethersconfig-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".TinlakeParams.__type"},{"id":78,"kind":32,"name":"ethOptions","url":"modules/_tinlake_.html#tinlakeparams.__type-8.ethoptions","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".TinlakeParams.__type"},{"id":79,"kind":32,"name":"contracts","url":"modules/_tinlake_.html#tinlakeparams.__type-8.contracts-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".TinlakeParams.__type"},{"id":80,"kind":32,"name":"contractConfig","url":"modules/_tinlake_.html#tinlakeparams.__type-8.contractconfig","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".TinlakeParams.__type"},{"id":81,"kind":4194304,"name":"Constructor","url":"modules/_tinlake_.html#constructor","classes":"tsd-kind-type-alias tsd-parent-kind-module tsd-has-type-parameter","parent":"\"Tinlake\""},{"id":82,"kind":65536,"name":"__type","url":"modules/_tinlake_.html#constructor.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"Tinlake\".Constructor"},{"id":83,"kind":1,"name":"\"actions/admin\"","url":"modules/_actions_admin_.html","classes":"tsd-kind-module"},{"id":84,"kind":64,"name":"AdminActions","url":"modules/_actions_admin_.html#adminactions","classes":"tsd-kind-function tsd-parent-kind-module tsd-has-type-parameter","parent":"\"actions/admin\""},{"id":85,"kind":4194304,"name":"IAdminActions","url":"modules/_actions_admin_.html#iadminactions","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"actions/admin\""},{"id":86,"kind":65536,"name":"__type","url":"modules/_actions_admin_.html#iadminactions.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"actions/admin\".IAdminActions"},{"id":87,"kind":64,"name":"isWard","url":"modules/_actions_admin_.html#iadminactions.__type.isward","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":88,"kind":64,"name":"canSetInterestRate","url":"modules/_actions_admin_.html#iadminactions.__type.cansetinterestrate","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":89,"kind":64,"name":"canSetSeniorTrancheInterest","url":"modules/_actions_admin_.html#iadminactions.__type.cansetseniortrancheinterest","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":90,"kind":64,"name":"canSetMinimumJuniorRatio","url":"modules/_actions_admin_.html#iadminactions.__type.cansetminimumjuniorratio","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":91,"kind":64,"name":"canSetRiskScore","url":"modules/_actions_admin_.html#iadminactions.__type.cansetriskscore","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":92,"kind":64,"name":"canSetInvestorAllowanceJunior","url":"modules/_actions_admin_.html#iadminactions.__type.cansetinvestorallowancejunior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":93,"kind":64,"name":"canSetInvestorAllowanceSenior","url":"modules/_actions_admin_.html#iadminactions.__type.cansetinvestorallowancesenior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":94,"kind":64,"name":"canSetLoanPrice","url":"modules/_actions_admin_.html#iadminactions.__type.cansetloanprice","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":95,"kind":64,"name":"initRate","url":"modules/_actions_admin_.html#iadminactions.__type.initrate","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":96,"kind":64,"name":"setRate","url":"modules/_actions_admin_.html#iadminactions.__type.setrate","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":97,"kind":64,"name":"setMinimumJuniorRatio","url":"modules/_actions_admin_.html#iadminactions.__type.setminimumjuniorratio","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":98,"kind":64,"name":"approveAllowanceJunior","url":"modules/_actions_admin_.html#iadminactions.__type.approveallowancejunior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":99,"kind":64,"name":"approveAllowanceSenior","url":"modules/_actions_admin_.html#iadminactions.__type.approveallowancesenior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":100,"kind":1,"name":"\"actions/borrower\"","url":"modules/_actions_borrower_.html","classes":"tsd-kind-module"},{"id":101,"kind":64,"name":"BorrowerActions","url":"modules/_actions_borrower_.html#borroweractions","classes":"tsd-kind-function tsd-parent-kind-module tsd-has-type-parameter","parent":"\"actions/borrower\""},{"id":102,"kind":4194304,"name":"IBorrowerActions","url":"modules/_actions_borrower_.html#iborroweractions","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"actions/borrower\""},{"id":103,"kind":65536,"name":"__type","url":"modules/_actions_borrower_.html#iborroweractions.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"actions/borrower\".IBorrowerActions"},{"id":104,"kind":64,"name":"issue","url":"modules/_actions_borrower_.html#iborroweractions.__type.issue","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/borrower\".IBorrowerActions.__type"},{"id":105,"kind":64,"name":"nftLookup","url":"modules/_actions_borrower_.html#iborroweractions.__type.nftlookup","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/borrower\".IBorrowerActions.__type"},{"id":106,"kind":64,"name":"lock","url":"modules/_actions_borrower_.html#iborroweractions.__type.lock","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/borrower\".IBorrowerActions.__type"},{"id":107,"kind":64,"name":"unlock","url":"modules/_actions_borrower_.html#iborroweractions.__type.unlock","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/borrower\".IBorrowerActions.__type"},{"id":108,"kind":64,"name":"close","url":"modules/_actions_borrower_.html#iborroweractions.__type.close","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/borrower\".IBorrowerActions.__type"},{"id":109,"kind":64,"name":"borrow","url":"modules/_actions_borrower_.html#iborroweractions.__type.borrow","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/borrower\".IBorrowerActions.__type"},{"id":110,"kind":64,"name":"withdraw","url":"modules/_actions_borrower_.html#iborroweractions.__type.withdraw","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/borrower\".IBorrowerActions.__type"},{"id":111,"kind":64,"name":"repay","url":"modules/_actions_borrower_.html#iborroweractions.__type.repay","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/borrower\".IBorrowerActions.__type"},{"id":112,"kind":1,"name":"\"actions/lender\"","url":"modules/_actions_lender_.html","classes":"tsd-kind-module"},{"id":113,"kind":64,"name":"LenderActions","url":"modules/_actions_lender_.html#lenderactions","classes":"tsd-kind-function tsd-parent-kind-module tsd-has-type-parameter","parent":"\"actions/lender\""},{"id":114,"kind":4194304,"name":"ILenderActions","url":"modules/_actions_lender_.html#ilenderactions","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"actions/lender\""},{"id":115,"kind":65536,"name":"__type","url":"modules/_actions_lender_.html#ilenderactions.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"actions/lender\".ILenderActions"},{"id":116,"kind":64,"name":"getSeniorTokenAllowance","url":"modules/_actions_lender_.html#ilenderactions.__type.getseniortokenallowance","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/lender\".ILenderActions.__type"},{"id":117,"kind":64,"name":"getJuniorTokenAllowance","url":"modules/_actions_lender_.html#ilenderactions.__type.getjuniortokenallowance","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/lender\".ILenderActions.__type"},{"id":118,"kind":64,"name":"supplyJunior","url":"modules/_actions_lender_.html#ilenderactions.__type.supplyjunior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/lender\".ILenderActions.__type"},{"id":119,"kind":32,"name":"approveJuniorToken","url":"modules/_actions_lender_.html#ilenderactions.__type.approvejuniortoken","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"actions/lender\".ILenderActions.__type"},{"id":120,"kind":65536,"name":"__type","url":"modules/_actions_lender_.html#ilenderactions.__type.approvejuniortoken.__type-1","classes":"tsd-kind-type-literal tsd-parent-kind-variable","parent":"\"actions/lender\".ILenderActions.__type.approveJuniorToken"},{"id":121,"kind":32,"name":"approveSeniorToken","url":"modules/_actions_lender_.html#ilenderactions.__type.approveseniortoken","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"actions/lender\".ILenderActions.__type"},{"id":122,"kind":65536,"name":"__type","url":"modules/_actions_lender_.html#ilenderactions.__type.approveseniortoken.__type-2","classes":"tsd-kind-type-literal tsd-parent-kind-variable","parent":"\"actions/lender\".ILenderActions.__type.approveSeniorToken"},{"id":123,"kind":64,"name":"redeemJunior","url":"modules/_actions_lender_.html#ilenderactions.__type.redeemjunior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/lender\".ILenderActions.__type"},{"id":124,"kind":64,"name":"supplySenior","url":"modules/_actions_lender_.html#ilenderactions.__type.supplysenior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/lender\".ILenderActions.__type"},{"id":125,"kind":64,"name":"redeemSenior","url":"modules/_actions_lender_.html#ilenderactions.__type.redeemsenior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/lender\".ILenderActions.__type"},{"id":126,"kind":64,"name":"balance","url":"modules/_actions_lender_.html#ilenderactions.__type.balance","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/lender\".ILenderActions.__type"},{"id":127,"kind":1,"name":"\"actions/currency\"","url":"modules/_actions_currency_.html","classes":"tsd-kind-module"},{"id":128,"kind":64,"name":"CurrencyActions","url":"modules/_actions_currency_.html#currencyactions","classes":"tsd-kind-function tsd-parent-kind-module tsd-has-type-parameter","parent":"\"actions/currency\""},{"id":129,"kind":4194304,"name":"ICurrencyActions","url":"modules/_actions_currency_.html#icurrencyactions","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"actions/currency\""},{"id":130,"kind":65536,"name":"__type","url":"modules/_actions_currency_.html#icurrencyactions.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"actions/currency\".ICurrencyActions"},{"id":131,"kind":64,"name":"mintCurrency","url":"modules/_actions_currency_.html#icurrencyactions.__type.mintcurrency","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/currency\".ICurrencyActions.__type"},{"id":132,"kind":64,"name":"getCurrencyBalance","url":"modules/_actions_currency_.html#icurrencyactions.__type.getcurrencybalance","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/currency\".ICurrencyActions.__type"},{"id":133,"kind":64,"name":"approveCurrency","url":"modules/_actions_currency_.html#icurrencyactions.__type.approvecurrency","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/currency\".ICurrencyActions.__type"},{"id":134,"kind":32,"name":"getCurrencyAllowance","url":"modules/_actions_currency_.html#icurrencyactions.__type.getcurrencyallowance","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"actions/currency\".ICurrencyActions.__type"},{"id":135,"kind":65536,"name":"__type","url":"modules/_actions_currency_.html#icurrencyactions.__type.getcurrencyallowance.__type-3","classes":"tsd-kind-type-literal tsd-parent-kind-variable","parent":"\"actions/currency\".ICurrencyActions.__type.getCurrencyAllowance"},{"id":136,"kind":32,"name":"getJuniorForCurrencyAllowance","url":"modules/_actions_currency_.html#icurrencyactions.__type.getjuniorforcurrencyallowance","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"actions/currency\".ICurrencyActions.__type"},{"id":137,"kind":65536,"name":"__type","url":"modules/_actions_currency_.html#icurrencyactions.__type.getjuniorforcurrencyallowance.__type-4","classes":"tsd-kind-type-literal tsd-parent-kind-variable","parent":"\"actions/currency\".ICurrencyActions.__type.getJuniorForCurrencyAllowance"},{"id":138,"kind":32,"name":"getSeniorForCurrencyAllowance","url":"modules/_actions_currency_.html#icurrencyactions.__type.getseniorforcurrencyallowance","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"actions/currency\".ICurrencyActions.__type"},{"id":139,"kind":65536,"name":"__type","url":"modules/_actions_currency_.html#icurrencyactions.__type.getseniorforcurrencyallowance.__type-5","classes":"tsd-kind-type-literal tsd-parent-kind-variable","parent":"\"actions/currency\".ICurrencyActions.__type.getSeniorForCurrencyAllowance"},{"id":140,"kind":32,"name":"approveSeniorForCurrency","url":"modules/_actions_currency_.html#icurrencyactions.__type.approveseniorforcurrency","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"actions/currency\".ICurrencyActions.__type"},{"id":141,"kind":65536,"name":"__type","url":"modules/_actions_currency_.html#icurrencyactions.__type.approveseniorforcurrency.__type-2","classes":"tsd-kind-type-literal tsd-parent-kind-variable","parent":"\"actions/currency\".ICurrencyActions.__type.approveSeniorForCurrency"},{"id":142,"kind":32,"name":"approveJuniorForCurrency","url":"modules/_actions_currency_.html#icurrencyactions.__type.approvejuniorforcurrency","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"actions/currency\".ICurrencyActions.__type"},{"id":143,"kind":65536,"name":"__type","url":"modules/_actions_currency_.html#icurrencyactions.__type.approvejuniorforcurrency.__type-1","classes":"tsd-kind-type-literal tsd-parent-kind-variable","parent":"\"actions/currency\".ICurrencyActions.__type.approveJuniorForCurrency"},{"id":144,"kind":1,"name":"\"actions/collateral\"","url":"modules/_actions_collateral_.html","classes":"tsd-kind-module"},{"id":145,"kind":64,"name":"CollateralActions","url":"modules/_actions_collateral_.html#collateralactions","classes":"tsd-kind-function tsd-parent-kind-module tsd-has-type-parameter","parent":"\"actions/collateral\""},{"id":146,"kind":4194304,"name":"ICollateralActions","url":"modules/_actions_collateral_.html#icollateralactions","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"actions/collateral\""},{"id":147,"kind":65536,"name":"__type","url":"modules/_actions_collateral_.html#icollateralactions.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"actions/collateral\".ICollateralActions"},{"id":148,"kind":64,"name":"mintTitleNFT","url":"modules/_actions_collateral_.html#icollateralactions.__type.minttitlenft","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/collateral\".ICollateralActions.__type"},{"id":149,"kind":64,"name":"mintNFT","url":"modules/_actions_collateral_.html#icollateralactions.__type.mintnft","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/collateral\".ICollateralActions.__type"},{"id":150,"kind":64,"name":"approveNFT","url":"modules/_actions_collateral_.html#icollateralactions.__type.approvenft","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/collateral\".ICollateralActions.__type"},{"id":151,"kind":64,"name":"setNFTApprovalForAll","url":"modules/_actions_collateral_.html#icollateralactions.__type.setnftapprovalforall","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/collateral\".ICollateralActions.__type"},{"id":152,"kind":64,"name":"isNFTApprovedForAll","url":"modules/_actions_collateral_.html#icollateralactions.__type.isnftapprovedforall","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/collateral\".ICollateralActions.__type"},{"id":153,"kind":64,"name":"getNFTCount","url":"modules/_actions_collateral_.html#icollateralactions.__type.getnftcount","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/collateral\".ICollateralActions.__type"},{"id":154,"kind":64,"name":"getNFTData","url":"modules/_actions_collateral_.html#icollateralactions.__type.getnftdata","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/collateral\".ICollateralActions.__type"},{"id":155,"kind":64,"name":"getNFTOwner","url":"modules/_actions_collateral_.html#icollateralactions.__type.getnftowner","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/collateral\".ICollateralActions.__type"},{"id":156,"kind":64,"name":"transferNFT","url":"modules/_actions_collateral_.html#icollateralactions.__type.transfernft","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/collateral\".ICollateralActions.__type"},{"id":157,"kind":1,"name":"\"actions/governance\"","url":"modules/_actions_governance_.html","classes":"tsd-kind-module"},{"id":158,"kind":4194304,"name":"IGovernanceActions","url":"modules/_actions_governance_.html#igovernanceactions","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"actions/governance\""},{"id":159,"kind":65536,"name":"__type","url":"modules/_actions_governance_.html#igovernanceactions.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"actions/governance\".IGovernanceActions"},{"id":160,"kind":64,"name":"relyAddress","url":"modules/_actions_governance_.html#igovernanceactions.__type.relyaddress","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/governance\".IGovernanceActions.__type"},{"id":161,"kind":1,"name":"\"actions/proxy\"","url":"modules/_actions_proxy_.html","classes":"tsd-kind-module"},{"id":162,"kind":64,"name":"ProxyActions","url":"modules/_actions_proxy_.html#proxyactions","classes":"tsd-kind-function tsd-parent-kind-module tsd-has-type-parameter","parent":"\"actions/proxy\""},{"id":163,"kind":4194304,"name":"IProxyActions","url":"modules/_actions_proxy_.html#iproxyactions","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"actions/proxy\""},{"id":164,"kind":65536,"name":"__type","url":"modules/_actions_proxy_.html#iproxyactions.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"actions/proxy\".IProxyActions"},{"id":165,"kind":64,"name":"buildProxy","url":"modules/_actions_proxy_.html#iproxyactions.__type.buildproxy","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":166,"kind":64,"name":"checkProxyExists","url":"modules/_actions_proxy_.html#iproxyactions.__type.checkproxyexists","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":167,"kind":64,"name":"getProxy","url":"modules/_actions_proxy_.html#iproxyactions.__type.getproxy","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":168,"kind":64,"name":"proxyCount","url":"modules/_actions_proxy_.html#iproxyactions.__type.proxycount","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":169,"kind":64,"name":"getProxyAccessToken","url":"modules/_actions_proxy_.html#iproxyactions.__type.getproxyaccesstoken","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":170,"kind":64,"name":"getProxyAccessTokenOwner","url":"modules/_actions_proxy_.html#iproxyactions.__type.getproxyaccesstokenowner","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":171,"kind":64,"name":"getProxyOwnerByLoan","url":"modules/_actions_proxy_.html#iproxyactions.__type.getproxyownerbyloan","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":172,"kind":64,"name":"getProxyOwnerByAddress","url":"modules/_actions_proxy_.html#iproxyactions.__type.getproxyownerbyaddress","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":173,"kind":64,"name":"proxyCreateNew","url":"modules/_actions_proxy_.html#iproxyactions.__type.proxycreatenew","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":174,"kind":64,"name":"proxyIssue","url":"modules/_actions_proxy_.html#iproxyactions.__type.proxyissue","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":175,"kind":64,"name":"proxyTransferIssue","url":"modules/_actions_proxy_.html#iproxyactions.__type.proxytransferissue","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":176,"kind":64,"name":"proxyLockBorrowWithdraw","url":"modules/_actions_proxy_.html#iproxyactions.__type.proxylockborrowwithdraw","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":177,"kind":64,"name":"proxyRepayUnlockClose","url":"modules/_actions_proxy_.html#iproxyactions.__type.proxyrepayunlockclose","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":178,"kind":1,"name":"\"actions/index\"","url":"modules/_actions_index_.html","classes":"tsd-kind-module"},{"id":179,"kind":4194304,"name":"TinlakeActions","url":"modules/_actions_index_.html#tinlakeactions","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"actions/index\""},{"id":180,"kind":1,"name":"\"types/tinlake\"","url":"modules/_types_tinlake_.html","classes":"tsd-kind-module"},{"id":181,"kind":4194304,"name":"Loan","url":"modules/_types_tinlake_.html#loan","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"types/tinlake\""},{"id":182,"kind":65536,"name":"__type","url":"modules/_types_tinlake_.html#loan.__type-3","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"types/tinlake\".Loan"},{"id":183,"kind":32,"name":"loanId","url":"modules/_types_tinlake_.html#loan.__type-3.loanid","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":184,"kind":32,"name":"registry","url":"modules/_types_tinlake_.html#loan.__type-3.registry","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":185,"kind":32,"name":"tokenId","url":"modules/_types_tinlake_.html#loan.__type-3.tokenid","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":186,"kind":32,"name":"ownerOf","url":"modules/_types_tinlake_.html#loan.__type-3.ownerof","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":187,"kind":32,"name":"principal","url":"modules/_types_tinlake_.html#loan.__type-3.principal","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":188,"kind":32,"name":"interestRate","url":"modules/_types_tinlake_.html#loan.__type-3.interestrate","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":189,"kind":32,"name":"debt","url":"modules/_types_tinlake_.html#loan.__type-3.debt","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":190,"kind":32,"name":"threshold","url":"modules/_types_tinlake_.html#loan.__type-3.threshold","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":191,"kind":32,"name":"price","url":"modules/_types_tinlake_.html#loan.__type-3.price","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":192,"kind":32,"name":"status","url":"modules/_types_tinlake_.html#loan.__type-3.status","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":193,"kind":32,"name":"nft","url":"modules/_types_tinlake_.html#loan.__type-3.nft","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":194,"kind":32,"name":"proxyOwner","url":"modules/_types_tinlake_.html#loan.__type-3.proxyowner","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":195,"kind":4194304,"name":"Tranche","url":"modules/_types_tinlake_.html#tranche","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"types/tinlake\""},{"id":196,"kind":65536,"name":"__type","url":"modules/_types_tinlake_.html#tranche.__type-5","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"types/tinlake\".Tranche"},{"id":197,"kind":32,"name":"availableFunds","url":"modules/_types_tinlake_.html#tranche.__type-5.availablefunds","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Tranche.__type"},{"id":198,"kind":32,"name":"tokenPrice","url":"modules/_types_tinlake_.html#tranche.__type-5.tokenprice","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Tranche.__type"},{"id":199,"kind":32,"name":"type","url":"modules/_types_tinlake_.html#tranche.__type-5.type","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Tranche.__type"},{"id":200,"kind":32,"name":"token","url":"modules/_types_tinlake_.html#tranche.__type-5.token","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Tranche.__type"},{"id":201,"kind":32,"name":"totalSupply","url":"modules/_types_tinlake_.html#tranche.__type-5.totalsupply","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Tranche.__type"},{"id":202,"kind":32,"name":"interestRate","url":"modules/_types_tinlake_.html#tranche.__type-5.interestrate-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Tranche.__type"},{"id":203,"kind":4194304,"name":"NFT","url":"modules/_types_tinlake_.html#nft-1","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"types/tinlake\""},{"id":204,"kind":65536,"name":"__type","url":"modules/_types_tinlake_.html#nft-1.__type-4","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"types/tinlake\".NFT"},{"id":205,"kind":32,"name":"registry","url":"modules/_types_tinlake_.html#nft-1.__type-4.registry-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".NFT.__type"},{"id":206,"kind":32,"name":"tokenId","url":"modules/_types_tinlake_.html#nft-1.__type-4.tokenid-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".NFT.__type"},{"id":207,"kind":32,"name":"nftOwner","url":"modules/_types_tinlake_.html#nft-1.__type-4.nftowner","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".NFT.__type"},{"id":208,"kind":32,"name":"nftData","url":"modules/_types_tinlake_.html#nft-1.__type-4.nftdata","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".NFT.__type"},{"id":209,"kind":4194304,"name":"Investor","url":"modules/_types_tinlake_.html#investor","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"types/tinlake\""},{"id":210,"kind":65536,"name":"__type","url":"modules/_types_tinlake_.html#investor.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"types/tinlake\".Investor"},{"id":211,"kind":32,"name":"junior","url":"modules/_types_tinlake_.html#investor.__type.junior","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Investor.__type"},{"id":212,"kind":65536,"name":"__type","url":"modules/_types_tinlake_.html#investor.__type.junior.__type-1","classes":"tsd-kind-type-literal tsd-parent-kind-variable","parent":"\"types/tinlake\".Investor.__type.junior"},{"id":213,"kind":32,"name":"maxSupply","url":"modules/_types_tinlake_.html#investor.__type.junior.__type-1.maxsupply","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Investor.__type.junior.__type"},{"id":214,"kind":32,"name":"tokenBalance","url":"modules/_types_tinlake_.html#investor.__type.junior.__type-1.tokenbalance","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Investor.__type.junior.__type"},{"id":215,"kind":32,"name":"maxRedeem","url":"modules/_types_tinlake_.html#investor.__type.junior.__type-1.maxredeem","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Investor.__type.junior.__type"},{"id":216,"kind":32,"name":"senior","url":"modules/_types_tinlake_.html#investor.__type.senior","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Investor.__type"},{"id":217,"kind":65536,"name":"__type","url":"modules/_types_tinlake_.html#investor.__type.senior.__type-2","classes":"tsd-kind-type-literal tsd-parent-kind-variable","parent":"\"types/tinlake\".Investor.__type.senior"},{"id":218,"kind":32,"name":"maxSupply","url":"modules/_types_tinlake_.html#investor.__type.senior.__type-2.maxsupply-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Investor.__type.senior.__type"},{"id":219,"kind":32,"name":"tokenBalance","url":"modules/_types_tinlake_.html#investor.__type.senior.__type-2.tokenbalance-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Investor.__type.senior.__type"},{"id":220,"kind":32,"name":"maxRedeem","url":"modules/_types_tinlake_.html#investor.__type.senior.__type-2.maxredeem-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Investor.__type.senior.__type"},{"id":221,"kind":32,"name":"address","url":"modules/_types_tinlake_.html#investor.__type.address","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Investor.__type"},{"id":222,"kind":4194304,"name":"ITinlake","url":"modules/_types_tinlake_.html#itinlake","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"types/tinlake\""},{"id":223,"kind":1,"name":"\"actions/analytics\"","url":"modules/_actions_analytics_.html","classes":"tsd-kind-module"},{"id":224,"kind":64,"name":"AnalyticsActions","url":"modules/_actions_analytics_.html#analyticsactions","classes":"tsd-kind-function tsd-parent-kind-module tsd-has-type-parameter","parent":"\"actions/analytics\""},{"id":225,"kind":4194304,"name":"IAnalyticsActions","url":"modules/_actions_analytics_.html#ianalyticsactions","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"actions/analytics\""},{"id":226,"kind":65536,"name":"__type","url":"modules/_actions_analytics_.html#ianalyticsactions.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"actions/analytics\".IAnalyticsActions"},{"id":227,"kind":64,"name":"getTotalDebt","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.gettotaldebt","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":228,"kind":64,"name":"getTotalBalance","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.gettotalbalance","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":229,"kind":64,"name":"getDebt","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getdebt","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":230,"kind":64,"name":"loanCount","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.loancount","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":231,"kind":64,"name":"getLoanList","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getloanlist","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":232,"kind":64,"name":"getLoan","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getloan","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":233,"kind":64,"name":"getCollateral","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getcollateral","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":234,"kind":64,"name":"getPrincipal","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getprincipal","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":235,"kind":64,"name":"getInterestRate","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getinterestrate","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":236,"kind":64,"name":"getOwnerOfLoan","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getownerofloan","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":237,"kind":64,"name":"getOwnerOfCollateral","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getownerofcollateral","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":238,"kind":64,"name":"existsSenior","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.existssenior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":239,"kind":64,"name":"getJuniorReserve","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getjuniorreserve","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":240,"kind":64,"name":"getSeniorReserve","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getseniorreserve","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":241,"kind":64,"name":"getJuniorTokenBalance","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getjuniortokenbalance","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":242,"kind":64,"name":"getSeniorTokenBalance","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getseniortokenbalance","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":243,"kind":64,"name":"getMaxSupplyAmountJunior","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getmaxsupplyamountjunior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":244,"kind":64,"name":"getMaxRedeemAmountJunior","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getmaxredeemamountjunior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":245,"kind":64,"name":"getMaxSupplyAmountSenior","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getmaxsupplyamountsenior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":246,"kind":64,"name":"getMaxRedeemAmountSenior","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getmaxredeemamountsenior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":247,"kind":64,"name":"getTokenPriceJunior","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.gettokenpricejunior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":248,"kind":64,"name":"getTokenPriceSenior","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.gettokenpricesenior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":249,"kind":64,"name":"getSeniorDebt","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getseniordebt","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":250,"kind":64,"name":"getSeniorInterestRate","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getseniorinterestrate","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":251,"kind":64,"name":"getMinJuniorRatio","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getminjuniorratio","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":252,"kind":64,"name":"getCurrentJuniorRatio","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getcurrentjuniorratio","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":253,"kind":64,"name":"getAssetValueJunior","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getassetvaluejunior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":254,"kind":64,"name":"getInvestor","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getinvestor","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":255,"kind":1,"name":"\"utils/baseToDisplay\"","url":"modules/_utils_basetodisplay_.html","classes":"tsd-kind-module"},{"id":256,"kind":64,"name":"baseToDisplay","url":"modules/_utils_basetodisplay_.html#basetodisplay","classes":"tsd-kind-function tsd-parent-kind-module","parent":"\"utils/baseToDisplay\""},{"id":257,"kind":1,"name":"\"utils/baseToDisplay.spec\"","url":"modules/_utils_basetodisplay_spec_.html","classes":"tsd-kind-module"},{"id":258,"kind":1,"name":"\"utils/bnToHex\"","url":"modules/_utils_bntohex_.html","classes":"tsd-kind-module"},{"id":259,"kind":64,"name":"bnToHex","url":"modules/_utils_bntohex_.html#bntohex","classes":"tsd-kind-function tsd-parent-kind-module","parent":"\"utils/bnToHex\""},{"id":260,"kind":1,"name":"\"utils/bnToHex.spec\"","url":"modules/_utils_bntohex_spec_.html","classes":"tsd-kind-module"},{"id":261,"kind":1,"name":"\"utils/displayToBase\"","url":"modules/_utils_displaytobase_.html","classes":"tsd-kind-module"},{"id":262,"kind":64,"name":"displayToBase","url":"modules/_utils_displaytobase_.html#displaytobase","classes":"tsd-kind-function tsd-parent-kind-module","parent":"\"utils/displayToBase\""},{"id":263,"kind":1,"name":"\"utils/displayToBase.spec\"","url":"modules/_utils_displaytobase_spec_.html","classes":"tsd-kind-module"},{"id":264,"kind":1,"name":"\"utils/feeToInterestRate\"","url":"modules/_utils_feetointerestrate_.html","classes":"tsd-kind-module"},{"id":265,"kind":64,"name":"feeToInterestRate","url":"modules/_utils_feetointerestrate_.html#feetointerestrate","classes":"tsd-kind-function tsd-parent-kind-module","parent":"\"utils/feeToInterestRate\""},{"id":266,"kind":1,"name":"\"utils/feeToInterestRate.spec\"","url":"modules/_utils_feetointerestrate_spec_.html","classes":"tsd-kind-module"},{"id":267,"kind":1,"name":"\"utils/getLoanStatus\"","url":"modules/_utils_getloanstatus_.html","classes":"tsd-kind-module"},{"id":268,"kind":4194304,"name":"LoanStatus","url":"modules/_utils_getloanstatus_.html#loanstatus","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"utils/getLoanStatus\""},{"id":269,"kind":64,"name":"getLoanStatus","url":"modules/_utils_getloanstatus_.html#getloanstatus","classes":"tsd-kind-function tsd-parent-kind-module","parent":"\"utils/getLoanStatus\""},{"id":270,"kind":1,"name":"\"utils/interestRateToFee\"","url":"modules/_utils_interestratetofee_.html","classes":"tsd-kind-module"},{"id":271,"kind":64,"name":"interestRateToFee","url":"modules/_utils_interestratetofee_.html#interestratetofee","classes":"tsd-kind-function tsd-parent-kind-module","parent":"\"utils/interestRateToFee\""},{"id":272,"kind":1,"name":"\"utils/interestRateToFee.spec\"","url":"modules/_utils_interestratetofee_spec_.html","classes":"tsd-kind-module"}]}; \ No newline at end of file + typedoc.search.data = {"kinds":{"1":"Module","32":"Variable","64":"Function","128":"Class","256":"Interface","512":"Constructor","1024":"Property","2048":"Method","65536":"Type literal","4194304":"Type alias"},"rows":[{"id":0,"kind":1,"name":"\"services/ethereum\"","url":"modules/_services_ethereum_.html","classes":"tsd-kind-module"},{"id":1,"kind":256,"name":"ethI","url":"interfaces/_services_ethereum_.ethi.html","classes":"tsd-kind-interface tsd-parent-kind-module","parent":"\"services/ethereum\""},{"id":2,"kind":1024,"name":"send","url":"interfaces/_services_ethereum_.ethi.html#send","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"services/ethereum\".ethI"},{"id":3,"kind":1024,"name":"web3_sha3","url":"interfaces/_services_ethereum_.ethi.html#web3_sha3","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"services/ethereum\".ethI"},{"id":4,"kind":65536,"name":"__type","url":"interfaces/_services_ethereum_.ethi.html#web3_sha3.__type-3","classes":"tsd-kind-type-literal tsd-parent-kind-property","parent":"\"services/ethereum\".ethI.web3_sha3"},{"id":5,"kind":1024,"name":"getTransactionReceipt","url":"interfaces/_services_ethereum_.ethi.html#gettransactionreceipt","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"services/ethereum\".ethI"},{"id":6,"kind":65536,"name":"__type","url":"interfaces/_services_ethereum_.ethi.html#gettransactionreceipt.__type-2","classes":"tsd-kind-type-literal tsd-parent-kind-property","parent":"\"services/ethereum\".ethI.getTransactionReceipt"},{"id":7,"kind":1024,"name":"getTransactionByHash","url":"interfaces/_services_ethereum_.ethi.html#gettransactionbyhash","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"services/ethereum\".ethI"},{"id":8,"kind":65536,"name":"__type","url":"interfaces/_services_ethereum_.ethi.html#gettransactionbyhash.__type-1","classes":"tsd-kind-type-literal tsd-parent-kind-property","parent":"\"services/ethereum\".ethI.getTransactionByHash"},{"id":9,"kind":1024,"name":"contract","url":"interfaces/_services_ethereum_.ethi.html#contract","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"services/ethereum\".ethI"},{"id":10,"kind":65536,"name":"__type","url":"interfaces/_services_ethereum_.ethi.html#contract.__type","classes":"tsd-kind-type-literal tsd-parent-kind-property","parent":"\"services/ethereum\".ethI.contract"},{"id":11,"kind":1024,"name":"sendRawTransaction","url":"interfaces/_services_ethereum_.ethi.html#sendrawtransaction","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"services/ethereum\".ethI"},{"id":12,"kind":1024,"name":"getTransactionCount","url":"interfaces/_services_ethereum_.ethi.html#gettransactioncount","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"services/ethereum\".ethI"},{"id":13,"kind":1024,"name":"abi","url":"interfaces/_services_ethereum_.ethi.html#abi","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"services/ethereum\".ethI"},{"id":14,"kind":256,"name":"Events","url":"interfaces/_services_ethereum_.events.html","classes":"tsd-kind-interface tsd-parent-kind-module","parent":"\"services/ethereum\""},{"id":15,"kind":1024,"name":"txHash","url":"interfaces/_services_ethereum_.events.html#txhash","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"services/ethereum\".Events"},{"id":16,"kind":1024,"name":"status","url":"interfaces/_services_ethereum_.events.html#status","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"services/ethereum\".Events"},{"id":17,"kind":1024,"name":"events","url":"interfaces/_services_ethereum_.events.html#events","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"services/ethereum\".Events"},{"id":18,"kind":32,"name":"ZERO_ADDRESS","url":"modules/_services_ethereum_.html#zero_address","classes":"tsd-kind-variable tsd-parent-kind-module","parent":"\"services/ethereum\""},{"id":19,"kind":64,"name":"executeAndRetry","url":"modules/_services_ethereum_.html#executeandretry","classes":"tsd-kind-function tsd-parent-kind-module","parent":"\"services/ethereum\""},{"id":20,"kind":64,"name":"waitAndReturnEvents","url":"modules/_services_ethereum_.html#waitandreturnevents","classes":"tsd-kind-function tsd-parent-kind-module","parent":"\"services/ethereum\""},{"id":21,"kind":64,"name":"waitForTransaction","url":"modules/_services_ethereum_.html#waitfortransaction","classes":"tsd-kind-function tsd-parent-kind-module","parent":"\"services/ethereum\""},{"id":22,"kind":64,"name":"findEvent","url":"modules/_services_ethereum_.html#findevent","classes":"tsd-kind-function tsd-parent-kind-module","parent":"\"services/ethereum\""},{"id":23,"kind":1,"name":"\"Tinlake\"","url":"modules/_tinlake_.html","classes":"tsd-kind-module"},{"id":24,"kind":128,"name":"Tinlake","url":"classes/_tinlake_.tinlake.html","classes":"tsd-kind-class tsd-parent-kind-module","parent":"\"Tinlake\""},{"id":25,"kind":1024,"name":"provider","url":"classes/_tinlake_.tinlake.html#provider","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":26,"kind":1024,"name":"eth","url":"classes/_tinlake_.tinlake.html#eth","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":27,"kind":1024,"name":"ethOptions","url":"classes/_tinlake_.tinlake.html#ethoptions","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":28,"kind":1024,"name":"ethConfig","url":"classes/_tinlake_.tinlake.html#ethconfig","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":29,"kind":1024,"name":"ethersConfig","url":"classes/_tinlake_.tinlake.html#ethersconfig","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":30,"kind":1024,"name":"contractAddresses","url":"classes/_tinlake_.tinlake.html#contractaddresses","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":31,"kind":1024,"name":"transactionTimeout","url":"classes/_tinlake_.tinlake.html#transactiontimeout","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":32,"kind":1024,"name":"contracts","url":"classes/_tinlake_.tinlake.html#contracts","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":33,"kind":1024,"name":"contractAbis","url":"classes/_tinlake_.tinlake.html#contractabis","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":34,"kind":1024,"name":"contractConfig","url":"classes/_tinlake_.tinlake.html#contractconfig","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":35,"kind":512,"name":"constructor","url":"classes/_tinlake_.tinlake.html#constructor","classes":"tsd-kind-constructor tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":36,"kind":2048,"name":"setProvider","url":"classes/_tinlake_.tinlake.html#setprovider","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":37,"kind":2048,"name":"setContracts","url":"classes/_tinlake_.tinlake.html#setcontracts","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":38,"kind":2048,"name":"setEthConfig","url":"classes/_tinlake_.tinlake.html#setethconfig","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":39,"kind":2048,"name":"setEthersConfig","url":"classes/_tinlake_.tinlake.html#setethersconfig","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":40,"kind":2048,"name":"createContract","url":"classes/_tinlake_.tinlake.html#createcontract","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":41,"kind":2048,"name":"getContract","url":"classes/_tinlake_.tinlake.html#getcontract","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":42,"kind":2048,"name":"getTransactionReceipt","url":"classes/_tinlake_.tinlake.html#gettransactionreceipt","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":43,"kind":2048,"name":"getOperatorType","url":"classes/_tinlake_.tinlake.html#getoperatortype","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":44,"kind":4194304,"name":"PendingTransaction","url":"modules/_tinlake_.html#pendingtransaction","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"Tinlake\""},{"id":45,"kind":65536,"name":"__type","url":"modules/_tinlake_.html#pendingtransaction.__type-7","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"Tinlake\".PendingTransaction"},{"id":46,"kind":32,"name":"hash","url":"modules/_tinlake_.html#pendingtransaction.__type-7.hash","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".PendingTransaction.__type"},{"id":47,"kind":32,"name":"contractKey","url":"modules/_tinlake_.html#pendingtransaction.__type-7.contractkey","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".PendingTransaction.__type"},{"id":48,"kind":32,"name":"timesOutAt","url":"modules/_tinlake_.html#pendingtransaction.__type-7.timesoutat","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".PendingTransaction.__type"},{"id":49,"kind":4194304,"name":"EthConfig","url":"modules/_tinlake_.html#ethconfig","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"Tinlake\""},{"id":50,"kind":65536,"name":"__type","url":"modules/_tinlake_.html#ethconfig.__type-4","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"Tinlake\".EthConfig"},{"id":51,"kind":32,"name":"from","url":"modules/_tinlake_.html#ethconfig.__type-4.from","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".EthConfig.__type"},{"id":52,"kind":32,"name":"gasPrice","url":"modules/_tinlake_.html#ethconfig.__type-4.gasprice","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".EthConfig.__type"},{"id":53,"kind":32,"name":"gas","url":"modules/_tinlake_.html#ethconfig.__type-4.gas","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".EthConfig.__type"},{"id":54,"kind":4194304,"name":"EthersOverrides","url":"modules/_tinlake_.html#ethersoverrides","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"Tinlake\""},{"id":55,"kind":65536,"name":"__type","url":"modules/_tinlake_.html#ethersoverrides.__type-6","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"Tinlake\".EthersOverrides"},{"id":56,"kind":32,"name":"gasPrice","url":"modules/_tinlake_.html#ethersoverrides.__type-6.gasprice-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".EthersOverrides.__type"},{"id":57,"kind":32,"name":"gasLimit","url":"modules/_tinlake_.html#ethersoverrides.__type-6.gaslimit","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".EthersOverrides.__type"},{"id":58,"kind":4194304,"name":"EthersConfig","url":"modules/_tinlake_.html#ethersconfig","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"Tinlake\""},{"id":59,"kind":65536,"name":"__type","url":"modules/_tinlake_.html#ethersconfig.__type-5","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"Tinlake\".EthersConfig"},{"id":60,"kind":32,"name":"provider","url":"modules/_tinlake_.html#ethersconfig.__type-5.provider","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".EthersConfig.__type"},{"id":61,"kind":32,"name":"signer","url":"modules/_tinlake_.html#ethersconfig.__type-5.signer","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".EthersConfig.__type"},{"id":62,"kind":32,"name":"overrides","url":"modules/_tinlake_.html#ethersconfig.__type-5.overrides","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".EthersConfig.__type"},{"id":63,"kind":4194304,"name":"ContractNames","url":"modules/_tinlake_.html#contractnames","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"Tinlake\""},{"id":64,"kind":4194304,"name":"Contracts","url":"modules/_tinlake_.html#contracts","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"Tinlake\""},{"id":65,"kind":65536,"name":"__type","url":"modules/_tinlake_.html#contracts.__type-3","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"Tinlake\".Contracts"},{"id":66,"kind":4194304,"name":"ContractAbis","url":"modules/_tinlake_.html#contractabis","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"Tinlake\""},{"id":67,"kind":65536,"name":"__type","url":"modules/_tinlake_.html#contractabis.__type-1","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"Tinlake\".ContractAbis"},{"id":68,"kind":4194304,"name":"ContractAddresses","url":"modules/_tinlake_.html#contractaddresses","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"Tinlake\""},{"id":69,"kind":65536,"name":"__type","url":"modules/_tinlake_.html#contractaddresses.__type-2","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"Tinlake\".ContractAddresses"},{"id":70,"kind":4194304,"name":"TinlakeParams","url":"modules/_tinlake_.html#tinlakeparams","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"Tinlake\""},{"id":71,"kind":65536,"name":"__type","url":"modules/_tinlake_.html#tinlakeparams.__type-8","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"Tinlake\".TinlakeParams"},{"id":72,"kind":32,"name":"provider","url":"modules/_tinlake_.html#tinlakeparams.__type-8.provider-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".TinlakeParams.__type"},{"id":73,"kind":32,"name":"transactionTimeout","url":"modules/_tinlake_.html#tinlakeparams.__type-8.transactiontimeout","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".TinlakeParams.__type"},{"id":74,"kind":32,"name":"contractAddresses","url":"modules/_tinlake_.html#tinlakeparams.__type-8.contractaddresses-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".TinlakeParams.__type"},{"id":75,"kind":32,"name":"contractAbis","url":"modules/_tinlake_.html#tinlakeparams.__type-8.contractabis-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".TinlakeParams.__type"},{"id":76,"kind":32,"name":"ethConfig","url":"modules/_tinlake_.html#tinlakeparams.__type-8.ethconfig-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".TinlakeParams.__type"},{"id":77,"kind":32,"name":"ethersConfig","url":"modules/_tinlake_.html#tinlakeparams.__type-8.ethersconfig-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".TinlakeParams.__type"},{"id":78,"kind":32,"name":"ethOptions","url":"modules/_tinlake_.html#tinlakeparams.__type-8.ethoptions","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".TinlakeParams.__type"},{"id":79,"kind":32,"name":"contracts","url":"modules/_tinlake_.html#tinlakeparams.__type-8.contracts-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".TinlakeParams.__type"},{"id":80,"kind":32,"name":"contractConfig","url":"modules/_tinlake_.html#tinlakeparams.__type-8.contractconfig","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".TinlakeParams.__type"},{"id":81,"kind":4194304,"name":"Constructor","url":"modules/_tinlake_.html#constructor","classes":"tsd-kind-type-alias tsd-parent-kind-module tsd-has-type-parameter","parent":"\"Tinlake\""},{"id":82,"kind":65536,"name":"__type","url":"modules/_tinlake_.html#constructor.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"Tinlake\".Constructor"},{"id":83,"kind":1,"name":"\"actions/admin\"","url":"modules/_actions_admin_.html","classes":"tsd-kind-module"},{"id":84,"kind":64,"name":"AdminActions","url":"modules/_actions_admin_.html#adminactions","classes":"tsd-kind-function tsd-parent-kind-module tsd-has-type-parameter","parent":"\"actions/admin\""},{"id":85,"kind":4194304,"name":"IAdminActions","url":"modules/_actions_admin_.html#iadminactions","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"actions/admin\""},{"id":86,"kind":65536,"name":"__type","url":"modules/_actions_admin_.html#iadminactions.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"actions/admin\".IAdminActions"},{"id":87,"kind":64,"name":"isWard","url":"modules/_actions_admin_.html#iadminactions.__type.isward","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":88,"kind":64,"name":"canSetInterestRate","url":"modules/_actions_admin_.html#iadminactions.__type.cansetinterestrate","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":89,"kind":64,"name":"canSetSeniorTrancheInterest","url":"modules/_actions_admin_.html#iadminactions.__type.cansetseniortrancheinterest","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":90,"kind":64,"name":"canSetMinimumJuniorRatio","url":"modules/_actions_admin_.html#iadminactions.__type.cansetminimumjuniorratio","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":91,"kind":64,"name":"canSetRiskScore","url":"modules/_actions_admin_.html#iadminactions.__type.cansetriskscore","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":92,"kind":64,"name":"canSetInvestorAllowanceJunior","url":"modules/_actions_admin_.html#iadminactions.__type.cansetinvestorallowancejunior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":93,"kind":64,"name":"canSetInvestorAllowanceSenior","url":"modules/_actions_admin_.html#iadminactions.__type.cansetinvestorallowancesenior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":94,"kind":64,"name":"canSetLoanPrice","url":"modules/_actions_admin_.html#iadminactions.__type.cansetloanprice","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":95,"kind":64,"name":"initRate","url":"modules/_actions_admin_.html#iadminactions.__type.initrate","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":96,"kind":64,"name":"setRate","url":"modules/_actions_admin_.html#iadminactions.__type.setrate","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":97,"kind":64,"name":"setMinimumJuniorRatio","url":"modules/_actions_admin_.html#iadminactions.__type.setminimumjuniorratio","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":98,"kind":64,"name":"approveAllowanceJunior","url":"modules/_actions_admin_.html#iadminactions.__type.approveallowancejunior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":99,"kind":64,"name":"approveAllowanceSenior","url":"modules/_actions_admin_.html#iadminactions.__type.approveallowancesenior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":100,"kind":1,"name":"\"actions/borrower\"","url":"modules/_actions_borrower_.html","classes":"tsd-kind-module"},{"id":101,"kind":64,"name":"BorrowerActions","url":"modules/_actions_borrower_.html#borroweractions","classes":"tsd-kind-function tsd-parent-kind-module tsd-has-type-parameter","parent":"\"actions/borrower\""},{"id":102,"kind":4194304,"name":"IBorrowerActions","url":"modules/_actions_borrower_.html#iborroweractions","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"actions/borrower\""},{"id":103,"kind":65536,"name":"__type","url":"modules/_actions_borrower_.html#iborroweractions.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"actions/borrower\".IBorrowerActions"},{"id":104,"kind":64,"name":"issue","url":"modules/_actions_borrower_.html#iborroweractions.__type.issue","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/borrower\".IBorrowerActions.__type"},{"id":105,"kind":64,"name":"nftLookup","url":"modules/_actions_borrower_.html#iborroweractions.__type.nftlookup","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/borrower\".IBorrowerActions.__type"},{"id":106,"kind":64,"name":"lock","url":"modules/_actions_borrower_.html#iborroweractions.__type.lock","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/borrower\".IBorrowerActions.__type"},{"id":107,"kind":64,"name":"unlock","url":"modules/_actions_borrower_.html#iborroweractions.__type.unlock","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/borrower\".IBorrowerActions.__type"},{"id":108,"kind":64,"name":"close","url":"modules/_actions_borrower_.html#iborroweractions.__type.close","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/borrower\".IBorrowerActions.__type"},{"id":109,"kind":64,"name":"borrow","url":"modules/_actions_borrower_.html#iborroweractions.__type.borrow","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/borrower\".IBorrowerActions.__type"},{"id":110,"kind":64,"name":"withdraw","url":"modules/_actions_borrower_.html#iborroweractions.__type.withdraw","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/borrower\".IBorrowerActions.__type"},{"id":111,"kind":64,"name":"repay","url":"modules/_actions_borrower_.html#iborroweractions.__type.repay","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/borrower\".IBorrowerActions.__type"},{"id":112,"kind":1,"name":"\"actions/lender\"","url":"modules/_actions_lender_.html","classes":"tsd-kind-module"},{"id":113,"kind":64,"name":"LenderActions","url":"modules/_actions_lender_.html#lenderactions","classes":"tsd-kind-function tsd-parent-kind-module tsd-has-type-parameter","parent":"\"actions/lender\""},{"id":114,"kind":4194304,"name":"ILenderActions","url":"modules/_actions_lender_.html#ilenderactions","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"actions/lender\""},{"id":115,"kind":65536,"name":"__type","url":"modules/_actions_lender_.html#ilenderactions.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"actions/lender\".ILenderActions"},{"id":116,"kind":64,"name":"getSeniorTokenAllowance","url":"modules/_actions_lender_.html#ilenderactions.__type.getseniortokenallowance","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/lender\".ILenderActions.__type"},{"id":117,"kind":64,"name":"getJuniorTokenAllowance","url":"modules/_actions_lender_.html#ilenderactions.__type.getjuniortokenallowance","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/lender\".ILenderActions.__type"},{"id":118,"kind":64,"name":"supplyJunior","url":"modules/_actions_lender_.html#ilenderactions.__type.supplyjunior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/lender\".ILenderActions.__type"},{"id":119,"kind":32,"name":"approveJuniorToken","url":"modules/_actions_lender_.html#ilenderactions.__type.approvejuniortoken","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"actions/lender\".ILenderActions.__type"},{"id":120,"kind":65536,"name":"__type","url":"modules/_actions_lender_.html#ilenderactions.__type.approvejuniortoken.__type-1","classes":"tsd-kind-type-literal tsd-parent-kind-variable","parent":"\"actions/lender\".ILenderActions.__type.approveJuniorToken"},{"id":121,"kind":32,"name":"approveSeniorToken","url":"modules/_actions_lender_.html#ilenderactions.__type.approveseniortoken","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"actions/lender\".ILenderActions.__type"},{"id":122,"kind":65536,"name":"__type","url":"modules/_actions_lender_.html#ilenderactions.__type.approveseniortoken.__type-2","classes":"tsd-kind-type-literal tsd-parent-kind-variable","parent":"\"actions/lender\".ILenderActions.__type.approveSeniorToken"},{"id":123,"kind":64,"name":"redeemJunior","url":"modules/_actions_lender_.html#ilenderactions.__type.redeemjunior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/lender\".ILenderActions.__type"},{"id":124,"kind":64,"name":"supplySenior","url":"modules/_actions_lender_.html#ilenderactions.__type.supplysenior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/lender\".ILenderActions.__type"},{"id":125,"kind":64,"name":"redeemSenior","url":"modules/_actions_lender_.html#ilenderactions.__type.redeemsenior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/lender\".ILenderActions.__type"},{"id":126,"kind":64,"name":"balance","url":"modules/_actions_lender_.html#ilenderactions.__type.balance","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/lender\".ILenderActions.__type"},{"id":127,"kind":1,"name":"\"actions/currency\"","url":"modules/_actions_currency_.html","classes":"tsd-kind-module"},{"id":128,"kind":64,"name":"CurrencyActions","url":"modules/_actions_currency_.html#currencyactions","classes":"tsd-kind-function tsd-parent-kind-module tsd-has-type-parameter","parent":"\"actions/currency\""},{"id":129,"kind":4194304,"name":"ICurrencyActions","url":"modules/_actions_currency_.html#icurrencyactions","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"actions/currency\""},{"id":130,"kind":65536,"name":"__type","url":"modules/_actions_currency_.html#icurrencyactions.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"actions/currency\".ICurrencyActions"},{"id":131,"kind":64,"name":"mintCurrency","url":"modules/_actions_currency_.html#icurrencyactions.__type.mintcurrency","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/currency\".ICurrencyActions.__type"},{"id":132,"kind":64,"name":"getCurrencyBalance","url":"modules/_actions_currency_.html#icurrencyactions.__type.getcurrencybalance","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/currency\".ICurrencyActions.__type"},{"id":133,"kind":64,"name":"approveCurrency","url":"modules/_actions_currency_.html#icurrencyactions.__type.approvecurrency","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/currency\".ICurrencyActions.__type"},{"id":134,"kind":32,"name":"getCurrencyAllowance","url":"modules/_actions_currency_.html#icurrencyactions.__type.getcurrencyallowance","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"actions/currency\".ICurrencyActions.__type"},{"id":135,"kind":65536,"name":"__type","url":"modules/_actions_currency_.html#icurrencyactions.__type.getcurrencyallowance.__type-3","classes":"tsd-kind-type-literal tsd-parent-kind-variable","parent":"\"actions/currency\".ICurrencyActions.__type.getCurrencyAllowance"},{"id":136,"kind":32,"name":"getJuniorForCurrencyAllowance","url":"modules/_actions_currency_.html#icurrencyactions.__type.getjuniorforcurrencyallowance","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"actions/currency\".ICurrencyActions.__type"},{"id":137,"kind":65536,"name":"__type","url":"modules/_actions_currency_.html#icurrencyactions.__type.getjuniorforcurrencyallowance.__type-4","classes":"tsd-kind-type-literal tsd-parent-kind-variable","parent":"\"actions/currency\".ICurrencyActions.__type.getJuniorForCurrencyAllowance"},{"id":138,"kind":32,"name":"getSeniorForCurrencyAllowance","url":"modules/_actions_currency_.html#icurrencyactions.__type.getseniorforcurrencyallowance","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"actions/currency\".ICurrencyActions.__type"},{"id":139,"kind":65536,"name":"__type","url":"modules/_actions_currency_.html#icurrencyactions.__type.getseniorforcurrencyallowance.__type-5","classes":"tsd-kind-type-literal tsd-parent-kind-variable","parent":"\"actions/currency\".ICurrencyActions.__type.getSeniorForCurrencyAllowance"},{"id":140,"kind":32,"name":"approveSeniorForCurrency","url":"modules/_actions_currency_.html#icurrencyactions.__type.approveseniorforcurrency","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"actions/currency\".ICurrencyActions.__type"},{"id":141,"kind":65536,"name":"__type","url":"modules/_actions_currency_.html#icurrencyactions.__type.approveseniorforcurrency.__type-2","classes":"tsd-kind-type-literal tsd-parent-kind-variable","parent":"\"actions/currency\".ICurrencyActions.__type.approveSeniorForCurrency"},{"id":142,"kind":32,"name":"approveJuniorForCurrency","url":"modules/_actions_currency_.html#icurrencyactions.__type.approvejuniorforcurrency","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"actions/currency\".ICurrencyActions.__type"},{"id":143,"kind":65536,"name":"__type","url":"modules/_actions_currency_.html#icurrencyactions.__type.approvejuniorforcurrency.__type-1","classes":"tsd-kind-type-literal tsd-parent-kind-variable","parent":"\"actions/currency\".ICurrencyActions.__type.approveJuniorForCurrency"},{"id":144,"kind":1,"name":"\"actions/collateral\"","url":"modules/_actions_collateral_.html","classes":"tsd-kind-module"},{"id":145,"kind":64,"name":"CollateralActions","url":"modules/_actions_collateral_.html#collateralactions","classes":"tsd-kind-function tsd-parent-kind-module tsd-has-type-parameter","parent":"\"actions/collateral\""},{"id":146,"kind":4194304,"name":"ICollateralActions","url":"modules/_actions_collateral_.html#icollateralactions","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"actions/collateral\""},{"id":147,"kind":65536,"name":"__type","url":"modules/_actions_collateral_.html#icollateralactions.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"actions/collateral\".ICollateralActions"},{"id":148,"kind":64,"name":"mintTitleNFT","url":"modules/_actions_collateral_.html#icollateralactions.__type.minttitlenft","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/collateral\".ICollateralActions.__type"},{"id":149,"kind":64,"name":"mintNFT","url":"modules/_actions_collateral_.html#icollateralactions.__type.mintnft","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/collateral\".ICollateralActions.__type"},{"id":150,"kind":64,"name":"approveNFT","url":"modules/_actions_collateral_.html#icollateralactions.__type.approvenft","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/collateral\".ICollateralActions.__type"},{"id":151,"kind":64,"name":"setNFTApprovalForAll","url":"modules/_actions_collateral_.html#icollateralactions.__type.setnftapprovalforall","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/collateral\".ICollateralActions.__type"},{"id":152,"kind":64,"name":"isNFTApprovedForAll","url":"modules/_actions_collateral_.html#icollateralactions.__type.isnftapprovedforall","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/collateral\".ICollateralActions.__type"},{"id":153,"kind":64,"name":"getNFTCount","url":"modules/_actions_collateral_.html#icollateralactions.__type.getnftcount","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/collateral\".ICollateralActions.__type"},{"id":154,"kind":64,"name":"getNFTData","url":"modules/_actions_collateral_.html#icollateralactions.__type.getnftdata","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/collateral\".ICollateralActions.__type"},{"id":155,"kind":64,"name":"getNFTOwner","url":"modules/_actions_collateral_.html#icollateralactions.__type.getnftowner","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/collateral\".ICollateralActions.__type"},{"id":156,"kind":64,"name":"transferNFT","url":"modules/_actions_collateral_.html#icollateralactions.__type.transfernft","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/collateral\".ICollateralActions.__type"},{"id":157,"kind":1,"name":"\"actions/governance\"","url":"modules/_actions_governance_.html","classes":"tsd-kind-module"},{"id":158,"kind":4194304,"name":"IGovernanceActions","url":"modules/_actions_governance_.html#igovernanceactions","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"actions/governance\""},{"id":159,"kind":65536,"name":"__type","url":"modules/_actions_governance_.html#igovernanceactions.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"actions/governance\".IGovernanceActions"},{"id":160,"kind":64,"name":"relyAddress","url":"modules/_actions_governance_.html#igovernanceactions.__type.relyaddress","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/governance\".IGovernanceActions.__type"},{"id":161,"kind":1,"name":"\"actions/proxy\"","url":"modules/_actions_proxy_.html","classes":"tsd-kind-module"},{"id":162,"kind":64,"name":"ProxyActions","url":"modules/_actions_proxy_.html#proxyactions","classes":"tsd-kind-function tsd-parent-kind-module tsd-has-type-parameter","parent":"\"actions/proxy\""},{"id":163,"kind":4194304,"name":"IProxyActions","url":"modules/_actions_proxy_.html#iproxyactions","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"actions/proxy\""},{"id":164,"kind":65536,"name":"__type","url":"modules/_actions_proxy_.html#iproxyactions.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"actions/proxy\".IProxyActions"},{"id":165,"kind":64,"name":"buildProxy","url":"modules/_actions_proxy_.html#iproxyactions.__type.buildproxy","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":166,"kind":64,"name":"checkProxyExists","url":"modules/_actions_proxy_.html#iproxyactions.__type.checkproxyexists","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":167,"kind":64,"name":"getProxy","url":"modules/_actions_proxy_.html#iproxyactions.__type.getproxy","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":168,"kind":64,"name":"proxyCount","url":"modules/_actions_proxy_.html#iproxyactions.__type.proxycount","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":169,"kind":64,"name":"getProxyAccessToken","url":"modules/_actions_proxy_.html#iproxyactions.__type.getproxyaccesstoken","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":170,"kind":64,"name":"getProxyAccessTokenOwner","url":"modules/_actions_proxy_.html#iproxyactions.__type.getproxyaccesstokenowner","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":171,"kind":64,"name":"getProxyOwnerByLoan","url":"modules/_actions_proxy_.html#iproxyactions.__type.getproxyownerbyloan","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":172,"kind":64,"name":"getProxyOwnerByAddress","url":"modules/_actions_proxy_.html#iproxyactions.__type.getproxyownerbyaddress","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":173,"kind":64,"name":"proxyCreateNew","url":"modules/_actions_proxy_.html#iproxyactions.__type.proxycreatenew","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":174,"kind":64,"name":"proxyIssue","url":"modules/_actions_proxy_.html#iproxyactions.__type.proxyissue","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":175,"kind":64,"name":"proxyTransferIssue","url":"modules/_actions_proxy_.html#iproxyactions.__type.proxytransferissue","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":176,"kind":64,"name":"proxyLockBorrowWithdraw","url":"modules/_actions_proxy_.html#iproxyactions.__type.proxylockborrowwithdraw","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":177,"kind":64,"name":"proxyRepayUnlockClose","url":"modules/_actions_proxy_.html#iproxyactions.__type.proxyrepayunlockclose","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":178,"kind":1,"name":"\"actions/index\"","url":"modules/_actions_index_.html","classes":"tsd-kind-module"},{"id":179,"kind":4194304,"name":"TinlakeActions","url":"modules/_actions_index_.html#tinlakeactions","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"actions/index\""},{"id":180,"kind":1,"name":"\"types/tinlake\"","url":"modules/_types_tinlake_.html","classes":"tsd-kind-module"},{"id":181,"kind":4194304,"name":"Loan","url":"modules/_types_tinlake_.html#loan","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"types/tinlake\""},{"id":182,"kind":65536,"name":"__type","url":"modules/_types_tinlake_.html#loan.__type-3","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"types/tinlake\".Loan"},{"id":183,"kind":32,"name":"loanId","url":"modules/_types_tinlake_.html#loan.__type-3.loanid","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":184,"kind":32,"name":"registry","url":"modules/_types_tinlake_.html#loan.__type-3.registry","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":185,"kind":32,"name":"tokenId","url":"modules/_types_tinlake_.html#loan.__type-3.tokenid","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":186,"kind":32,"name":"ownerOf","url":"modules/_types_tinlake_.html#loan.__type-3.ownerof","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":187,"kind":32,"name":"principal","url":"modules/_types_tinlake_.html#loan.__type-3.principal","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":188,"kind":32,"name":"interestRate","url":"modules/_types_tinlake_.html#loan.__type-3.interestrate","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":189,"kind":32,"name":"debt","url":"modules/_types_tinlake_.html#loan.__type-3.debt","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":190,"kind":32,"name":"threshold","url":"modules/_types_tinlake_.html#loan.__type-3.threshold","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":191,"kind":32,"name":"price","url":"modules/_types_tinlake_.html#loan.__type-3.price","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":192,"kind":32,"name":"status","url":"modules/_types_tinlake_.html#loan.__type-3.status","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":193,"kind":32,"name":"nft","url":"modules/_types_tinlake_.html#loan.__type-3.nft","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":194,"kind":32,"name":"proxyOwner","url":"modules/_types_tinlake_.html#loan.__type-3.proxyowner","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":195,"kind":4194304,"name":"Tranche","url":"modules/_types_tinlake_.html#tranche","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"types/tinlake\""},{"id":196,"kind":65536,"name":"__type","url":"modules/_types_tinlake_.html#tranche.__type-5","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"types/tinlake\".Tranche"},{"id":197,"kind":32,"name":"availableFunds","url":"modules/_types_tinlake_.html#tranche.__type-5.availablefunds","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Tranche.__type"},{"id":198,"kind":32,"name":"tokenPrice","url":"modules/_types_tinlake_.html#tranche.__type-5.tokenprice","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Tranche.__type"},{"id":199,"kind":32,"name":"type","url":"modules/_types_tinlake_.html#tranche.__type-5.type","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Tranche.__type"},{"id":200,"kind":32,"name":"token","url":"modules/_types_tinlake_.html#tranche.__type-5.token","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Tranche.__type"},{"id":201,"kind":32,"name":"totalSupply","url":"modules/_types_tinlake_.html#tranche.__type-5.totalsupply","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Tranche.__type"},{"id":202,"kind":32,"name":"interestRate","url":"modules/_types_tinlake_.html#tranche.__type-5.interestrate-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Tranche.__type"},{"id":203,"kind":4194304,"name":"NFT","url":"modules/_types_tinlake_.html#nft-1","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"types/tinlake\""},{"id":204,"kind":65536,"name":"__type","url":"modules/_types_tinlake_.html#nft-1.__type-4","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"types/tinlake\".NFT"},{"id":205,"kind":32,"name":"registry","url":"modules/_types_tinlake_.html#nft-1.__type-4.registry-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".NFT.__type"},{"id":206,"kind":32,"name":"tokenId","url":"modules/_types_tinlake_.html#nft-1.__type-4.tokenid-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".NFT.__type"},{"id":207,"kind":32,"name":"nftOwner","url":"modules/_types_tinlake_.html#nft-1.__type-4.nftowner","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".NFT.__type"},{"id":208,"kind":32,"name":"nftData","url":"modules/_types_tinlake_.html#nft-1.__type-4.nftdata","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".NFT.__type"},{"id":209,"kind":4194304,"name":"Investor","url":"modules/_types_tinlake_.html#investor","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"types/tinlake\""},{"id":210,"kind":65536,"name":"__type","url":"modules/_types_tinlake_.html#investor.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"types/tinlake\".Investor"},{"id":211,"kind":32,"name":"junior","url":"modules/_types_tinlake_.html#investor.__type.junior","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Investor.__type"},{"id":212,"kind":65536,"name":"__type","url":"modules/_types_tinlake_.html#investor.__type.junior.__type-1","classes":"tsd-kind-type-literal tsd-parent-kind-variable","parent":"\"types/tinlake\".Investor.__type.junior"},{"id":213,"kind":32,"name":"maxSupply","url":"modules/_types_tinlake_.html#investor.__type.junior.__type-1.maxsupply","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Investor.__type.junior.__type"},{"id":214,"kind":32,"name":"tokenBalance","url":"modules/_types_tinlake_.html#investor.__type.junior.__type-1.tokenbalance","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Investor.__type.junior.__type"},{"id":215,"kind":32,"name":"maxRedeem","url":"modules/_types_tinlake_.html#investor.__type.junior.__type-1.maxredeem","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Investor.__type.junior.__type"},{"id":216,"kind":32,"name":"senior","url":"modules/_types_tinlake_.html#investor.__type.senior","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Investor.__type"},{"id":217,"kind":65536,"name":"__type","url":"modules/_types_tinlake_.html#investor.__type.senior.__type-2","classes":"tsd-kind-type-literal tsd-parent-kind-variable","parent":"\"types/tinlake\".Investor.__type.senior"},{"id":218,"kind":32,"name":"maxSupply","url":"modules/_types_tinlake_.html#investor.__type.senior.__type-2.maxsupply-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Investor.__type.senior.__type"},{"id":219,"kind":32,"name":"tokenBalance","url":"modules/_types_tinlake_.html#investor.__type.senior.__type-2.tokenbalance-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Investor.__type.senior.__type"},{"id":220,"kind":32,"name":"maxRedeem","url":"modules/_types_tinlake_.html#investor.__type.senior.__type-2.maxredeem-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Investor.__type.senior.__type"},{"id":221,"kind":32,"name":"address","url":"modules/_types_tinlake_.html#investor.__type.address","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Investor.__type"},{"id":222,"kind":4194304,"name":"ITinlake","url":"modules/_types_tinlake_.html#itinlake","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"types/tinlake\""},{"id":223,"kind":1,"name":"\"actions/analytics\"","url":"modules/_actions_analytics_.html","classes":"tsd-kind-module"},{"id":224,"kind":64,"name":"AnalyticsActions","url":"modules/_actions_analytics_.html#analyticsactions","classes":"tsd-kind-function tsd-parent-kind-module tsd-has-type-parameter","parent":"\"actions/analytics\""},{"id":225,"kind":4194304,"name":"IAnalyticsActions","url":"modules/_actions_analytics_.html#ianalyticsactions","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"actions/analytics\""},{"id":226,"kind":65536,"name":"__type","url":"modules/_actions_analytics_.html#ianalyticsactions.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"actions/analytics\".IAnalyticsActions"},{"id":227,"kind":64,"name":"getTotalDebt","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.gettotaldebt","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":228,"kind":64,"name":"getTotalBalance","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.gettotalbalance","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":229,"kind":64,"name":"getDebt","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getdebt","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":230,"kind":64,"name":"loanCount","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.loancount","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":231,"kind":64,"name":"getLoanList","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getloanlist","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":232,"kind":64,"name":"getLoan","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getloan","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":233,"kind":64,"name":"getCollateral","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getcollateral","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":234,"kind":64,"name":"getPrincipal","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getprincipal","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":235,"kind":64,"name":"getInterestRate","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getinterestrate","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":236,"kind":64,"name":"getOwnerOfLoan","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getownerofloan","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":237,"kind":64,"name":"getOwnerOfCollateral","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getownerofcollateral","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":238,"kind":64,"name":"existsSenior","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.existssenior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":239,"kind":64,"name":"getJuniorReserve","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getjuniorreserve","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":240,"kind":64,"name":"getSeniorReserve","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getseniorreserve","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":241,"kind":64,"name":"getJuniorTokenBalance","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getjuniortokenbalance","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":242,"kind":64,"name":"getSeniorTokenBalance","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getseniortokenbalance","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":243,"kind":64,"name":"getMaxSupplyAmountJunior","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getmaxsupplyamountjunior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":244,"kind":64,"name":"getMaxRedeemAmountJunior","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getmaxredeemamountjunior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":245,"kind":64,"name":"getMaxSupplyAmountSenior","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getmaxsupplyamountsenior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":246,"kind":64,"name":"getMaxRedeemAmountSenior","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getmaxredeemamountsenior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":247,"kind":64,"name":"getTokenPriceJunior","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.gettokenpricejunior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":248,"kind":64,"name":"getTokenPriceSenior","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.gettokenpricesenior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":249,"kind":64,"name":"getSeniorDebt","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getseniordebt","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":250,"kind":64,"name":"getSeniorInterestRate","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getseniorinterestrate","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":251,"kind":64,"name":"getMinJuniorRatio","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getminjuniorratio","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":252,"kind":64,"name":"getCurrentJuniorRatio","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getcurrentjuniorratio","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":253,"kind":64,"name":"getAssetValueJunior","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getassetvaluejunior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":254,"kind":64,"name":"getInvestor","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getinvestor","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":255,"kind":1,"name":"\"utils/baseToDisplay\"","url":"modules/_utils_basetodisplay_.html","classes":"tsd-kind-module"},{"id":256,"kind":64,"name":"baseToDisplay","url":"modules/_utils_basetodisplay_.html#basetodisplay","classes":"tsd-kind-function tsd-parent-kind-module","parent":"\"utils/baseToDisplay\""},{"id":257,"kind":1,"name":"\"utils/baseToDisplay.spec\"","url":"modules/_utils_basetodisplay_spec_.html","classes":"tsd-kind-module"},{"id":258,"kind":1,"name":"\"utils/bnToHex\"","url":"modules/_utils_bntohex_.html","classes":"tsd-kind-module"},{"id":259,"kind":64,"name":"bnToHex","url":"modules/_utils_bntohex_.html#bntohex","classes":"tsd-kind-function tsd-parent-kind-module","parent":"\"utils/bnToHex\""},{"id":260,"kind":1,"name":"\"utils/bnToHex.spec\"","url":"modules/_utils_bntohex_spec_.html","classes":"tsd-kind-module"},{"id":261,"kind":1,"name":"\"utils/displayToBase\"","url":"modules/_utils_displaytobase_.html","classes":"tsd-kind-module"},{"id":262,"kind":64,"name":"displayToBase","url":"modules/_utils_displaytobase_.html#displaytobase","classes":"tsd-kind-function tsd-parent-kind-module","parent":"\"utils/displayToBase\""},{"id":263,"kind":1,"name":"\"utils/displayToBase.spec\"","url":"modules/_utils_displaytobase_spec_.html","classes":"tsd-kind-module"},{"id":264,"kind":1,"name":"\"utils/feeToInterestRate\"","url":"modules/_utils_feetointerestrate_.html","classes":"tsd-kind-module"},{"id":265,"kind":64,"name":"feeToInterestRate","url":"modules/_utils_feetointerestrate_.html#feetointerestrate","classes":"tsd-kind-function tsd-parent-kind-module","parent":"\"utils/feeToInterestRate\""},{"id":266,"kind":1,"name":"\"utils/feeToInterestRate.spec\"","url":"modules/_utils_feetointerestrate_spec_.html","classes":"tsd-kind-module"},{"id":267,"kind":1,"name":"\"utils/getLoanStatus\"","url":"modules/_utils_getloanstatus_.html","classes":"tsd-kind-module"},{"id":268,"kind":4194304,"name":"LoanStatus","url":"modules/_utils_getloanstatus_.html#loanstatus","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"utils/getLoanStatus\""},{"id":269,"kind":64,"name":"getLoanStatus","url":"modules/_utils_getloanstatus_.html#getloanstatus","classes":"tsd-kind-function tsd-parent-kind-module","parent":"\"utils/getLoanStatus\""},{"id":270,"kind":1,"name":"\"utils/interestRateToFee\"","url":"modules/_utils_interestratetofee_.html","classes":"tsd-kind-module"},{"id":271,"kind":64,"name":"interestRateToFee","url":"modules/_utils_interestratetofee_.html#interestratetofee","classes":"tsd-kind-function tsd-parent-kind-module","parent":"\"utils/interestRateToFee\""},{"id":272,"kind":1,"name":"\"utils/interestRateToFee.spec\"","url":"modules/_utils_interestratetofee_spec_.html","classes":"tsd-kind-module"}]}; \ No newline at end of file diff --git a/docs/classes/_tinlake_.tinlake.html b/docs/classes/_tinlake_.tinlake.html index 83c22e6..3b72a69 100644 --- a/docs/classes/_tinlake_.tinlake.html +++ b/docs/classes/_tinlake_.tinlake.html @@ -104,11 +104,11 @@

      Methods

    • createContract
    • getContract
    • getOperatorType
    • +
    • getTransactionReceipt
    • setContracts
    • setEthConfig
    • setEthersConfig
    • setProvider
    • -
    • subscribe
    @@ -126,7 +126,7 @@

    constructor

  • Parameters

    @@ -148,7 +148,7 @@

    contractAbis

    contractAbis: ContractAbis
    @@ -158,7 +158,7 @@

    contractAddresses

    contractAddresses: ContractAddresses
    @@ -168,7 +168,7 @@

    contractConfig

    contractConfig: any
    @@ -178,7 +178,7 @@

    contracts

    contracts: Contracts
    @@ -188,7 +188,7 @@

    eth

    eth: ethI
    @@ -198,7 +198,7 @@

    ethConfig

    ethConfig: EthConfig
    @@ -208,7 +208,7 @@

    ethOptions

    ethOptions: any
    @@ -218,7 +218,7 @@

    ethersConfig

    ethersConfig: EthersConfig
    @@ -228,7 +228,7 @@

    provider

    provider: any
    @@ -238,7 +238,7 @@

    transactionTimeout

    transactionTimeout: number
    @@ -255,7 +255,7 @@

    createContract

  • Parameters

    @@ -281,7 +281,7 @@

    getContract

  • Parameters

    @@ -307,7 +307,7 @@

    getOperatorType

  • Parameters

    @@ -320,6 +320,29 @@

    Returns any +
    + +

    getTransactionReceipt

    + + +

    setContracts

    @@ -330,7 +353,7 @@

    setContracts

  • Returns void

    @@ -347,7 +370,7 @@

    setEthConfig

  • Parameters

    @@ -370,7 +393,7 @@

    setEthersConfig

  • Parameters

    @@ -393,7 +416,7 @@

    setProvider

  • Parameters

    @@ -409,50 +432,6 @@

    Returns void

  • -
    - -

    subscribe

    -
      -
    • subscribe(tx: PendingTransaction, callback: (response: TransactionReceipt) => void): Promise<void>
    • -
    -
      -
    • - -

      Parameters

      -
        -
      • -
        tx: PendingTransaction
        -
      • -
      • -
        callback: (response: TransactionReceipt) => void
        -
          -
        • -
            -
          • (response: TransactionReceipt): void
          • -
          -
            -
          • -

            Parameters

            -
              -
            • -
              response: TransactionReceipt
              -
            • -
            -

            Returns void

            -
          • -
          -
        • -
        -
      • -
      -

      Returns Promise<void>

      -
    • -
    -

  • +
  • + getTransactionReceipt +
  • setContracts
  • @@ -593,9 +575,6 @@

    Returns Promise setProvider

  • -
  • - subscribe -
  • diff --git a/docs/interfaces/_services_ethereum_.ethi.html b/docs/interfaces/_services_ethereum_.ethi.html index 539e8a3..cd0eef0 100644 --- a/docs/interfaces/_services_ethereum_.ethi.html +++ b/docs/interfaces/_services_ethereum_.ethi.html @@ -101,7 +101,7 @@

    abi

    abi: any
    @@ -111,7 +111,7 @@

    contract

    contract: (arg0: any) => { at: (arg0: any) => void }
    @@ -165,7 +165,7 @@

    getTransactionByHash

    getTransactionByHash: (arg0: any, arg1: (err: any, tx: any) => void) => void
    @@ -220,7 +220,7 @@

    getTransactionCount

    getTransactionCount: any
    @@ -230,7 +230,7 @@

    getTransactionReceipt

    getTransactionReceipt: (arg0: any, arg1: (err: any, receipt: any) => void) => void
    @@ -285,7 +285,7 @@

    send

    send: Function
    @@ -295,7 +295,7 @@

    sendRawTransaction

    sendRawTransaction: any
    @@ -305,7 +305,7 @@

    web3_sha3

    web3_sha3: (signature: string) => string
    diff --git a/docs/interfaces/_services_ethereum_.events.html b/docs/interfaces/_services_ethereum_.events.html index d03a663..e580185 100644 --- a/docs/interfaces/_services_ethereum_.events.html +++ b/docs/interfaces/_services_ethereum_.events.html @@ -96,7 +96,7 @@

    events

    events: { data: any[]; event: { name: any } }[]
    @@ -106,7 +106,7 @@

    status

    status: any
    @@ -116,7 +116,7 @@

    txHash

    txHash: string
    diff --git a/docs/modules/_actions_admin_.html b/docs/modules/_actions_admin_.html index 5615bb2..1849bf7 100644 --- a/docs/modules/_actions_admin_.html +++ b/docs/modules/_actions_admin_.html @@ -89,7 +89,7 @@

    IAdminActions

    IAdminActions: { approveAllowanceJunior: any; approveAllowanceSenior: any; canSetInterestRate: any; canSetInvestorAllowanceJunior: any; canSetInvestorAllowanceSenior: any; canSetLoanPrice: any; canSetMinimumJuniorRatio: any; canSetRiskScore: any; canSetSeniorTrancheInterest: any; initRate: any; isWard: any; setMinimumJuniorRatio: any; setRate: any }
    @@ -104,7 +104,7 @@
    approveAllowanceJunior:
  • Parameters

    @@ -132,7 +132,7 @@
    approveAllowanceSenior:
  • Parameters

    @@ -160,7 +160,7 @@
    canSetInterestRate:

    Parameters

    @@ -182,7 +182,7 @@
    canSetInvestorAllowanceJunior

    Parameters

    @@ -204,7 +204,7 @@
    canSetInvestorAllowanceSenior

    Parameters

    @@ -226,7 +226,7 @@
    canSetLoanPrice: fu
  • Parameters

    @@ -248,7 +248,7 @@
    canSetMinimumJuniorRatio

    Parameters

    @@ -270,7 +270,7 @@
    canSetRiskScore: fu
  • Parameters

    @@ -292,7 +292,7 @@
    canSetSeniorTrancheInterest

    Parameters

    @@ -314,7 +314,7 @@
    initRate: function
  • Parameters

    @@ -336,7 +336,7 @@
    isWard: function
  • Parameters

    @@ -361,7 +361,7 @@
    setMinimumJuniorRatio:

    Parameters

    @@ -383,7 +383,7 @@
    setRate: function
  • Parameters

    @@ -415,7 +415,7 @@

    AdminActions

  • Type parameters

    diff --git a/docs/modules/_actions_analytics_.html b/docs/modules/_actions_analytics_.html index f40dc72..e8b46fe 100644 --- a/docs/modules/_actions_analytics_.html +++ b/docs/modules/_actions_analytics_.html @@ -89,7 +89,7 @@

    IAnalyticsActions

    IAnalyticsActions: { existsSenior: any; getAssetValueJunior: any; getCollateral: any; getCurrentJuniorRatio: any; getDebt: any; getInterestRate: any; getInvestor: any; getJuniorReserve: any; getJuniorTokenBalance: any; getLoan: any; getLoanList: any; getMaxRedeemAmountJunior: any; getMaxRedeemAmountSenior: any; getMaxSupplyAmountJunior: any; getMaxSupplyAmountSenior: any; getMinJuniorRatio: any; getOwnerOfCollateral: any; getOwnerOfLoan: any; getPrincipal: any; getSeniorDebt: any; getSeniorInterestRate: any; getSeniorReserve: any; getSeniorTokenBalance: any; getTokenPriceJunior: any; getTokenPriceSenior: any; getTotalBalance: any; getTotalDebt: any; loanCount: any }
    @@ -104,7 +104,7 @@
    existsSenior: function
  • Returns boolean

    @@ -120,7 +120,7 @@
    getAssetValueJunior:

    Returns Promise<BN>

    @@ -136,7 +136,7 @@
    getCollateral: function
  • Parameters

    @@ -158,7 +158,7 @@
    getCurrentJuniorRatio:

    Returns Promise<BN>

    @@ -174,7 +174,7 @@
    getDebt: function
  • Parameters

    @@ -196,7 +196,7 @@
    getInterestRate: functio
  • Parameters

    @@ -218,7 +218,7 @@
    getInvestor: function
  • Parameters

    @@ -240,7 +240,7 @@
    getJuniorReserve: functi
  • Returns Promise<BN>

    @@ -256,7 +256,7 @@
    getJuniorTokenBalance:

    Parameters

    @@ -278,7 +278,7 @@
    getLoan: function
  • Parameters

    @@ -300,7 +300,7 @@
    getLoanList: function

    Returns Promise<Loan[]>

    @@ -316,7 +316,7 @@
    getMaxRedeemAmountJunior

    Parameters

    @@ -338,7 +338,7 @@
    getMaxRedeemAmountSenior

    Parameters

    @@ -360,7 +360,7 @@
    getMaxSupplyAmountJunior

    Parameters

    @@ -382,7 +382,7 @@
    getMaxSupplyAmountSenior

    Parameters

    @@ -404,7 +404,7 @@
    getMinJuniorRatio:
  • Returns Promise<BN>

    @@ -420,7 +420,7 @@
    getOwnerOfCollateral: fu
  • Parameters

    @@ -448,7 +448,7 @@
    getOwnerOfLoan: function
  • Parameters

    @@ -470,7 +470,7 @@
    getPrincipal: function
  • Parameters

    @@ -492,7 +492,7 @@
    getSeniorDebt: function<
  • Returns Promise<BN>

    @@ -508,7 +508,7 @@
    getSeniorInterestRate:

    Returns Promise<BN>

    @@ -524,7 +524,7 @@
    getSeniorReserve: functi
  • Returns Promise<BN>

    @@ -540,7 +540,7 @@
    getSeniorTokenBalance:

    Parameters

    @@ -562,7 +562,7 @@
    getTokenPriceJunior:

    Returns Promise<BN>

    @@ -578,7 +578,7 @@
    getTokenPriceSenior:

    Parameters

    @@ -600,7 +600,7 @@
    getTotalBalance: functio
  • Returns Promise<BN>

    @@ -616,7 +616,7 @@
    getTotalDebt: function

    Returns Promise<BN>

    @@ -632,7 +632,7 @@
    loanCount: function
  • Returns Promise<BN>

    @@ -655,7 +655,7 @@

    AnalyticsActions

  • Type parameters

    diff --git a/docs/modules/_actions_borrower_.html b/docs/modules/_actions_borrower_.html index 1127472..4910433 100644 --- a/docs/modules/_actions_borrower_.html +++ b/docs/modules/_actions_borrower_.html @@ -89,7 +89,7 @@

    IBorrowerActions

    IBorrowerActions: { borrow: any; close: any; issue: any; lock: any; nftLookup: any; repay: any; unlock: any; withdraw: any }
    @@ -104,7 +104,7 @@
    borrow: function
  • Parameters

    @@ -129,7 +129,7 @@
    close: function
  • Parameters

    @@ -151,7 +151,7 @@
    issue: function
  • Parameters

    @@ -176,7 +176,7 @@
    lock: function
  • Parameters

    @@ -198,7 +198,7 @@
    nftLookup: function
  • Parameters

    @@ -223,7 +223,7 @@
    repay: function
  • Parameters

    @@ -248,7 +248,7 @@
    unlock: function
  • Parameters

    @@ -270,7 +270,7 @@
    withdraw: function
  • Parameters

    @@ -305,7 +305,7 @@

    BorrowerActions

  • Type parameters

    diff --git a/docs/modules/_actions_collateral_.html b/docs/modules/_actions_collateral_.html index 495b17d..3a47641 100644 --- a/docs/modules/_actions_collateral_.html +++ b/docs/modules/_actions_collateral_.html @@ -89,7 +89,7 @@

    ICollateralActions

    ICollateralActions: { approveNFT: any; getNFTCount: any; getNFTData: any; getNFTOwner: any; isNFTApprovedForAll: any; mintNFT: any; mintTitleNFT: any; setNFTApprovalForAll: any; transferNFT: any }
    @@ -104,7 +104,7 @@
    approveNFT: function
  • Parameters

    @@ -132,7 +132,7 @@
    getNFTCount: function
  • Parameters

    @@ -154,7 +154,7 @@
    getNFTData: function
  • Parameters

    @@ -179,7 +179,7 @@
    getNFTOwner: function
  • Parameters

    @@ -204,7 +204,7 @@
    isNFTApprovedForAll: fun
  • Parameters

    @@ -232,7 +232,7 @@
    mintNFT: function
  • Parameters

    @@ -269,7 +269,7 @@
    mintTitleNFT: function
  • Parameters

    @@ -294,7 +294,7 @@
    setNFTApprovalForAll: fu
  • Parameters

    @@ -322,7 +322,7 @@
    transferNFT: function
  • Parameters

    @@ -360,7 +360,7 @@

    CollateralActions

  • Type parameters

    diff --git a/docs/modules/_actions_currency_.html b/docs/modules/_actions_currency_.html index 020d8d1..6b69c62 100644 --- a/docs/modules/_actions_currency_.html +++ b/docs/modules/_actions_currency_.html @@ -89,7 +89,7 @@

    ICurrencyActions

    ICurrencyActions: { approveJuniorForCurrency: (currencyAmount: string) => Promise<unknown>; approveSeniorForCurrency: (currencyAmount: string) => Promise<unknown>; getCurrencyAllowance: (owner: string, spender: string) => Promise<BN>; getJuniorForCurrencyAllowance: (owner: string) => Promise<BN | undefined>; getSeniorForCurrencyAllowance: (owner: string) => Promise<BN | undefined>; approveCurrency: any; getCurrencyBalance: any; mintCurrency: any }
    @@ -212,7 +212,7 @@
    approveCurrency: function

    Parameters

    @@ -237,7 +237,7 @@
    getCurrencyBalance: func
  • Parameters

    @@ -259,7 +259,7 @@
    mintCurrency: function
  • Parameters

    @@ -291,7 +291,7 @@

    CurrencyActions

  • Type parameters

    diff --git a/docs/modules/_actions_governance_.html b/docs/modules/_actions_governance_.html index d84fa61..2d26fe4 100644 --- a/docs/modules/_actions_governance_.html +++ b/docs/modules/_actions_governance_.html @@ -83,7 +83,7 @@

    IGovernanceActions

    IGovernanceActions: { relyAddress: any }
    @@ -98,7 +98,7 @@
    relyAddress: function
  • Parameters

    diff --git a/docs/modules/_actions_index_.html b/docs/modules/_actions_index_.html index d9375ba..1ca134c 100644 --- a/docs/modules/_actions_index_.html +++ b/docs/modules/_actions_index_.html @@ -83,7 +83,7 @@

    TinlakeActions

    diff --git a/docs/modules/_actions_lender_.html b/docs/modules/_actions_lender_.html index b271ef5..e30c01a 100644 --- a/docs/modules/_actions_lender_.html +++ b/docs/modules/_actions_lender_.html @@ -89,7 +89,7 @@

    ILenderActions

    ILenderActions: { approveJuniorToken: (tokenAmount: string) => Promise<unknown>; approveSeniorToken: (tokenAmount: string) => Promise<unknown>; balance: any; getJuniorTokenAllowance: any; getSeniorTokenAllowance: any; redeemJunior: any; redeemSenior: any; supplyJunior: any; supplySenior: any }
    @@ -146,7 +146,7 @@
    balance: function
  • Returns Promise<any>

    @@ -162,7 +162,7 @@
    getJuniorTokenAllowance: <
  • Parameters

    @@ -184,7 +184,7 @@
    getSeniorTokenAllowance: <
  • Parameters

    @@ -206,7 +206,7 @@
    redeemJunior: function
  • Parameters

    @@ -228,7 +228,7 @@
    redeemSenior: function
  • Parameters

    @@ -250,7 +250,7 @@
    supplyJunior: function
  • Parameters

    @@ -272,7 +272,7 @@
    supplySenior: function
  • Parameters

    @@ -301,7 +301,7 @@

    LenderActions

  • Type parameters

    diff --git a/docs/modules/_actions_proxy_.html b/docs/modules/_actions_proxy_.html index d98953d..1cdc176 100644 --- a/docs/modules/_actions_proxy_.html +++ b/docs/modules/_actions_proxy_.html @@ -89,7 +89,7 @@

    IProxyActions

    IProxyActions: { buildProxy: any; checkProxyExists: any; getProxy: any; getProxyAccessToken: any; getProxyAccessTokenOwner: any; getProxyOwnerByAddress: any; getProxyOwnerByLoan: any; proxyCount: any; proxyCreateNew: any; proxyIssue: any; proxyLockBorrowWithdraw: any; proxyRepayUnlockClose: any; proxyTransferIssue: any }
    @@ -104,7 +104,7 @@
    buildProxy: function
  • Parameters

    @@ -126,7 +126,7 @@
    checkProxyExists: functi
  • Parameters

    @@ -148,7 +148,7 @@
    getProxy: function
  • Parameters

    @@ -170,7 +170,7 @@
    getProxyAccessToken:

    Parameters

    @@ -192,7 +192,7 @@
    getProxyAccessTokenOwner

    Parameters

    @@ -214,7 +214,7 @@
    getProxyOwnerByAddress:

    Parameters

    @@ -236,7 +236,7 @@
    getProxyOwnerByLoan:

    Parameters

    @@ -258,7 +258,7 @@
    proxyCount: function
  • Returns Promise<any>

    @@ -274,7 +274,7 @@
    proxyCreateNew: function
  • Parameters

    @@ -296,7 +296,7 @@
    proxyIssue: function
  • Parameters

    @@ -324,7 +324,7 @@
    proxyLockBorrowWithdraw: <
  • Parameters

    @@ -355,7 +355,7 @@
    proxyRepayUnlockClose:

    Parameters

    @@ -386,7 +386,7 @@
    proxyTransferIssue: func
  • Parameters

    @@ -421,7 +421,7 @@

    ProxyActions

  • Type parameters

    diff --git a/docs/modules/_services_ethereum_.html b/docs/modules/_services_ethereum_.html index 2e08916..594c941 100644 --- a/docs/modules/_services_ethereum_.html +++ b/docs/modules/_services_ethereum_.html @@ -99,7 +99,7 @@

    Const ZERO_ADDRESS

    ZERO_ADDRESS: "0x0000000000000000000000000000000000000000" = "0x0000000000000000000000000000000000000000"
    @@ -116,7 +116,7 @@

    executeAndRetry

  • Parameters

    @@ -142,7 +142,7 @@

    Const findEvent

  • Parameters

    @@ -209,7 +209,7 @@

    Const waitAndReturn

    Parameters

    @@ -241,7 +241,7 @@

    Const waitForTransactio
  • Parameters

    diff --git a/docs/modules/_tinlake_.html b/docs/modules/_tinlake_.html index 2357d4e..da3b752 100644 --- a/docs/modules/_tinlake_.html +++ b/docs/modules/_tinlake_.html @@ -98,7 +98,7 @@

    Constructor

    Constructor<T>: {}

    Type parameters

    @@ -119,7 +119,7 @@

    ContractAbis

    ContractAbis: {}
    @@ -134,7 +134,7 @@

    ContractAddresses

    ContractAddresses: {}
    @@ -149,7 +149,7 @@

    ContractNames

    ContractNames: typeof contractNames[number]
    @@ -159,7 +159,7 @@

    Contracts

    Contracts: {}
    @@ -174,7 +174,7 @@

    EthConfig

    EthConfig: { from?: undefined | string; gas?: undefined | string; gasPrice?: undefined | string }
    @@ -198,7 +198,7 @@

    EthersConfig

    EthersConfig: { overrides?: EthersOverrides; provider?: ethers.providers.Provider; signer?: ethers.Signer }
    @@ -222,7 +222,7 @@

    EthersOverrides

    EthersOverrides: { gasLimit?: undefined | number; gasPrice?: undefined | number }
    @@ -243,7 +243,7 @@

    PendingTransaction

    PendingTransaction: { contractKey: string; hash: string; timesOutAt: number }
    @@ -267,7 +267,7 @@

    TinlakeParams

    TinlakeParams: { contractAbis?: ContractAbis | {}; contractAddresses?: ContractAddresses | {}; contractConfig?: any | {}; contracts?: Contracts | {}; ethConfig?: EthConfig; ethOptions?: any | {}; ethersConfig?: EthersConfig; provider: any; transactionTimeout: number }
    diff --git a/docs/modules/_types_tinlake_.html b/docs/modules/_types_tinlake_.html index 8af356f..7a04d52 100644 --- a/docs/modules/_types_tinlake_.html +++ b/docs/modules/_types_tinlake_.html @@ -87,7 +87,7 @@

    ITinlake

    @@ -97,7 +97,7 @@

    Investor

    Investor: { address: string; junior: { maxRedeem: BN; maxSupply: BN; tokenBalance: BN }; senior: { maxRedeem?: BN; maxSupply?: BN; tokenBalance?: BN } }
    @@ -143,7 +143,7 @@

    Loan

    Loan: { debt: BN; interestRate: BN; loanId: string; nft?: NFT; ownerOf: BN; price?: BN; principal: BN; proxyOwner?: undefined | string; registry: string; status?: undefined | string; threshold?: BN; tokenId: BN }
    @@ -194,7 +194,7 @@

    NFT

    NFT: { nftData: any; nftOwner: string; registry: string; tokenId: BN }
    @@ -221,7 +221,7 @@

    Tranche

    Tranche: { availableFunds: BN; interestRate?: BN; token: string; tokenPrice: BN; totalSupply: BN; type: string }
    diff --git a/docs/modules/_utils_basetodisplay_.html b/docs/modules/_utils_basetodisplay_.html index a31abfd..b1ddefd 100644 --- a/docs/modules/_utils_basetodisplay_.html +++ b/docs/modules/_utils_basetodisplay_.html @@ -87,7 +87,7 @@

    Const baseToDisplay

  • Parameters

    diff --git a/docs/modules/_utils_bntohex_.html b/docs/modules/_utils_bntohex_.html index b313343..8354b5b 100644 --- a/docs/modules/_utils_bntohex_.html +++ b/docs/modules/_utils_bntohex_.html @@ -87,7 +87,7 @@

    Const bnToHex

  • Parameters

    diff --git a/docs/modules/_utils_displaytobase_.html b/docs/modules/_utils_displaytobase_.html index c258b2f..f4d55f9 100644 --- a/docs/modules/_utils_displaytobase_.html +++ b/docs/modules/_utils_displaytobase_.html @@ -87,7 +87,7 @@

    Const displayToBase

  • Parameters

    diff --git a/docs/modules/_utils_feetointerestrate_.html b/docs/modules/_utils_feetointerestrate_.html index fb0888e..86e0200 100644 --- a/docs/modules/_utils_feetointerestrate_.html +++ b/docs/modules/_utils_feetointerestrate_.html @@ -87,7 +87,7 @@

    Const feeToInterestRate
  • diff --git a/docs/modules/_utils_getloanstatus_.html b/docs/modules/_utils_getloanstatus_.html index 38eefff..d90ae1d 100644 --- a/docs/modules/_utils_getloanstatus_.html +++ b/docs/modules/_utils_getloanstatus_.html @@ -89,7 +89,7 @@

    LoanStatus

    LoanStatus: "Whitelisted" | "Ongoing" | "Repaid"
    @@ -106,7 +106,7 @@

    getLoanStatus

  • Parameters

    diff --git a/docs/modules/_utils_interestratetofee_.html b/docs/modules/_utils_interestratetofee_.html index d6bc72d..6aace65 100644 --- a/docs/modules/_utils_interestratetofee_.html +++ b/docs/modules/_utils_interestratetofee_.html @@ -87,7 +87,7 @@

    Const interestRateToFee
  • diff --git a/src/Tinlake.ts b/src/Tinlake.ts index cd02d71..4179113 100644 --- a/src/Tinlake.ts +++ b/src/Tinlake.ts @@ -171,9 +171,8 @@ export default class Tinlake { ) : undefined; } - async subscribe(tx: PendingTransaction, callback: (response: ethers.providers.TransactionReceipt) => void) { - const response = await this.ethersConfig.provider!.waitForTransaction(tx.hash); - callback(response); + async getTransactionReceipt(tx: PendingTransaction): Promise { + return await this.ethersConfig.provider!.waitForTransaction(tx.hash); } getOperatorType = (tranche: string) => { diff --git a/src/actions/collateral.ts b/src/actions/collateral.ts index 5e0efd3..b7a91c8 100644 --- a/src/actions/collateral.ts +++ b/src/actions/collateral.ts @@ -14,12 +14,17 @@ export function CollateralActions } mintNFT = async (nftAddr: string, owner: string, tokenId: string, ref: string, amount: string, asset:string) => { - const nft = this.getContract(nftAddr, 'COLLATERAL_NFT'); + const nftContract = this.getContract(nftAddr, 'COLLATERAL_NFT'); - if (nft) { + if (nftContract) { try { - const tx = await nft.mint(owner, tokenId, ref, amount, asset); - return { hash: tx.hash, contractKey: 'COLLATERAL_NFT', timesOutAt: 0 }; + const tx = await nftContract.mint(owner, tokenId, ref, amount, asset); + + return { + hash: tx.hash, + contractKey: 'COLLATERAL_NFT', + timesOutAt: 0, + }; } catch (error) { return error; } From 9db8fe939d29d10b956c20118ed3823a698b888b Mon Sep 17 00:00:00 2001 From: Jeroen Offerijns Date: Tue, 25 Aug 2020 20:50:50 +0200 Subject: [PATCH 04/65] feat: use ethers.js in several functions --- dist/Tinlake.d.ts | 14 +- dist/actions/admin.d.ts | 19 +- dist/actions/analytics.d.ts | 9 +- dist/actions/borrower.d.ts | 9 +- dist/actions/collateral.d.ts | 26 ++- dist/actions/currency.d.ts | 35 ++- dist/actions/governance.d.ts | 9 +- dist/actions/lender.d.ts | 25 ++- dist/actions/proxy.d.ts | 19 +- dist/index.d.ts | 133 +++++++++--- dist/index.es.js | 205 +++++++++--------- dist/index.js | 205 +++++++++--------- docs/assets/js/search.js | 2 +- docs/classes/_tinlake_.tinlake.html | 92 ++++++-- docs/interfaces/_services_ethereum_.ethi.html | 16 +- .../_services_ethereum_.events.html | 6 +- docs/modules/_actions_admin_.html | 34 +-- docs/modules/_actions_analytics_.html | 60 ++--- docs/modules/_actions_borrower_.html | 20 +- docs/modules/_actions_collateral_.html | 26 +-- docs/modules/_actions_currency_.html | 28 +-- docs/modules/_actions_governance_.html | 4 +- docs/modules/_actions_index_.html | 2 +- docs/modules/_actions_lender_.html | 26 +-- docs/modules/_actions_proxy_.html | 30 +-- docs/modules/_services_ethereum_.html | 10 +- docs/modules/_tinlake_.html | 30 +-- docs/modules/_types_tinlake_.html | 10 +- docs/modules/_utils_basetodisplay_.html | 2 +- docs/modules/_utils_bntohex_.html | 2 +- docs/modules/_utils_displaytobase_.html | 2 +- docs/modules/_utils_feetointerestrate_.html | 2 +- docs/modules/_utils_getloanstatus_.html | 4 +- docs/modules/_utils_interestratetofee_.html | 2 +- src/Tinlake.ts | 52 +++-- src/actions/admin.ts | 17 +- src/actions/analytics.ts | 8 +- src/actions/collateral.ts | 56 ++--- src/actions/currency.ts | 23 +- src/actions/lender.ts | 26 ++- src/actions/proxy.ts | 69 +++--- 41 files changed, 793 insertions(+), 576 deletions(-) diff --git a/dist/Tinlake.d.ts b/dist/Tinlake.d.ts index 7e1c3c5..04d3000 100644 --- a/dist/Tinlake.d.ts +++ b/dist/Tinlake.d.ts @@ -4,7 +4,7 @@ declare const contractNames: string[]; export declare type PendingTransaction = { hash: string; contractKey: string; - timesOutAt: number; + timesOutAt?: number; }; export declare type EthConfig = { from?: string; @@ -16,8 +16,8 @@ export declare type EthersOverrides = { gasLimit?: number; }; export declare type EthersConfig = { - provider?: ethers.providers.Provider; - signer?: ethers.Signer; + provider: ethers.providers.Provider; + signer: ethers.Signer; overrides?: EthersOverrides; }; export declare type ContractNames = typeof contractNames[number]; @@ -51,15 +51,17 @@ export default class Tinlake { contractAddresses: ContractAddresses; transactionTimeout: number; contracts: Contracts; + ethersContracts: Contracts; contractAbis: ContractAbis; contractConfig: any; constructor(params: TinlakeParams); setProvider: (provider: any, ethOptions?: any) => void; setContracts: () => void; setEthConfig: (ethConfig: EthConfig) => void; - setEthersConfig: (ethersConfig: EthersConfig) => void; - createContract(address: string, abiName: string): void; - getContract(address: string, abiName: string): ethers.Contract | undefined; + setEthersConfig: (ethersConfig: EthersConfig | undefined) => void; + createEthContract(address: string, abiName: string): void; + createContract(address: string, abiName: string): ethers.Contract; + getContract(address: string, abiName: string): ethers.Contract; getTransactionReceipt(tx: PendingTransaction): Promise; getOperatorType: (tranche: string) => any; } diff --git a/dist/actions/admin.d.ts b/dist/actions/admin.d.ts index 2b8f7f0..fc12aea 100644 --- a/dist/actions/admin.d.ts +++ b/dist/actions/admin.d.ts @@ -1,4 +1,4 @@ -import { ContractNames, Constructor, TinlakeParams } from '../Tinlake'; +import { ContractNames, Constructor, TinlakeParams, PendingTransaction } from '../Tinlake'; import BN from 'bn.js'; export declare function AdminActions>(Base: ActionsBase): { new (...args: any[]): { @@ -15,23 +15,32 @@ export declare function AdminActions Promise; changeRate: (loan: string, ratePerSecond: string) => Promise; setRate: (loan: string, ratePerSecond: string) => Promise; - setMinimumJuniorRatio: (ratio: string) => Promise; + setMinimumJuniorRatio: (ratio: string) => Promise<{ + hash: any; + contractKey: string; + timesOutAt: number; + }>; approveAllowanceJunior: (user: string, maxCurrency: string, maxToken: string) => Promise; approveAllowanceSenior: (user: string, maxCurrency: string, maxToken: string) => Promise; provider: any; - signer: import("ethers").Signer; eth: import("../services/ethereum").ethI; ethOptions: any; ethConfig: import("../Tinlake").EthConfig; + ethersConfig: import("../Tinlake").EthersConfig; contractAddresses: import("../Tinlake").ContractAddresses; transactionTimeout: number; contracts: import("../Tinlake").Contracts; + ethersContracts: import("../Tinlake").Contracts; contractAbis: import("../Tinlake").ContractAbis; contractConfig: any; setProvider: (provider: any, ethOptions?: any) => void; setContracts: () => void; setEthConfig: (ethConfig: import("../Tinlake").EthConfig) => void; - createContract(address: string, abiName: string): void; + setEthersConfig: (ethersConfig: import("../Tinlake").EthersConfig | undefined) => void; + createEthContract(address: string, abiName: string): void; + createContract(address: string, abiName: string): import("ethers").Contract; + getContract(address: string, abiName: string): import("ethers").Contract; + getTransactionReceipt(tx: PendingTransaction): Promise; getOperatorType: (tranche: string) => any; }; } & ActionsBase; @@ -46,7 +55,7 @@ export declare type IAdminActions = { canSetLoanPrice(user: string): Promise; initRate(rate: string): Promise; setRate(loan: string, rate: string): Promise; - setMinimumJuniorRatio(amount: string): Promise; + setMinimumJuniorRatio(amount: string): Promise; approveAllowanceJunior(user: string, maxCurrency: string, maxToken: string): Promise; approveAllowanceSenior(user: string, maxCurrency: string, maxToken: string): Promise; }; diff --git a/dist/actions/analytics.d.ts b/dist/actions/analytics.d.ts index a0daa2a..9c2d4e9 100644 --- a/dist/actions/analytics.d.ts +++ b/dist/actions/analytics.d.ts @@ -35,19 +35,24 @@ export declare function AnalyticsActions Promise; getSeniorInterestRate: () => Promise; provider: any; - signer: import("ethers").Signer; eth: import("../services/ethereum").ethI; ethOptions: any; ethConfig: import("../Tinlake").EthConfig; + ethersConfig: import("../Tinlake").EthersConfig; contractAddresses: import("../Tinlake").ContractAddresses; transactionTimeout: number; contracts: import("../Tinlake").Contracts; + ethersContracts: import("../Tinlake").Contracts; contractAbis: import("../Tinlake").ContractAbis; contractConfig: any; setProvider: (provider: any, ethOptions?: any) => void; setContracts: () => void; setEthConfig: (ethConfig: import("../Tinlake").EthConfig) => void; - createContract(address: string, abiName: string): void; + setEthersConfig: (ethersConfig: import("../Tinlake").EthersConfig | undefined) => void; + createEthContract(address: string, abiName: string): void; + createContract(address: string, abiName: string): import("ethers").Contract; + getContract(address: string, abiName: string): import("ethers").Contract; + getTransactionReceipt(tx: import("../Tinlake").PendingTransaction): Promise; getOperatorType: (tranche: string) => any; }; } & ActionsBase; diff --git a/dist/actions/borrower.d.ts b/dist/actions/borrower.d.ts index c7e7d3b..8ef172c 100644 --- a/dist/actions/borrower.d.ts +++ b/dist/actions/borrower.d.ts @@ -11,19 +11,24 @@ export declare function BorrowerActions Promise; repay: (loan: string, currencyAmount: string) => Promise; provider: any; - signer: ethers.Signer; eth: import("../services/ethereum").ethI; ethOptions: any; ethConfig: import("../Tinlake").EthConfig; + ethersConfig: import("../Tinlake").EthersConfig; contractAddresses: import("../Tinlake").ContractAddresses; transactionTimeout: number; contracts: import("../Tinlake").Contracts; + ethersContracts: import("../Tinlake").Contracts; contractAbis: import("../Tinlake").ContractAbis; contractConfig: any; setProvider: (provider: any, ethOptions?: any) => void; setContracts: () => void; setEthConfig: (ethConfig: import("../Tinlake").EthConfig) => void; - createContract(address: string, abiName: string): void; + setEthersConfig: (ethersConfig: import("../Tinlake").EthersConfig | undefined) => void; + createEthContract(address: string, abiName: string): void; + createContract(address: string, abiName: string): ethers.Contract; + getContract(address: string, abiName: string): ethers.Contract; + getTransactionReceipt(tx: import("../Tinlake").PendingTransaction): Promise; getOperatorType: (tranche: string) => any; }; } & ActionsBase; diff --git a/dist/actions/collateral.d.ts b/dist/actions/collateral.d.ts index ab46cc2..a1debfb 100644 --- a/dist/actions/collateral.d.ts +++ b/dist/actions/collateral.d.ts @@ -1,12 +1,18 @@ -import { Constructor, TinlakeParams } from '../Tinlake'; +import { Constructor, TinlakeParams, PendingTransaction } from '../Tinlake'; import BN from 'bn.js'; export declare function CollateralActions>(Base: ActionsBase): { new (...args: any[]): { mintTitleNFT: (nftAddr: string, user: string) => Promise; - mintNFT: (nftAddr: string, owner: string, tokenId: string, ref: string, amount: string, asset: string) => Promise; + mintNFT: (nftAddr: string, owner: string, tokenId: string, ref: string, amount: string, asset: string) => Promise<{ + hash: any; + contractKey: string; + }>; approveNFT: (nftAddr: string, tokenId: string, to: string) => Promise; - setNFTApprovalForAll: (nftAddr: string, to: string, approved: boolean) => Promise; - isNFTApprovedForAll: (nftAddr: string, owner: string, operator: string) => Promise; + setNFTApprovalForAll: (nftAddr: string, to: string, approved: boolean) => Promise<{ + hash: any; + contractKey: string; + }>; + isNFTApprovedForAll: (nftAddr: string, owner: string, operator: string) => Promise; getNFTCount: (nftAddr: string) => Promise; getNFTData: (nftAddr: string, tokenId: string) => Promise; getNFTOwner: (nftAddr: string, tokenId: string) => Promise; @@ -19,21 +25,23 @@ export declare function CollateralActions void; setContracts: () => void; setEthConfig: (ethConfig: import("../Tinlake").EthConfig) => void; - setEthersConfig: (ethersConfig: import("../Tinlake").EthersConfig) => void; - createContract(address: string, abiName: string): void; - getContract(address: string, abiName: string): import("ethers").Contract | undefined; - getTransactionReceipt(tx: import("../Tinlake").PendingTransaction): Promise; + setEthersConfig: (ethersConfig: import("../Tinlake").EthersConfig | undefined) => void; + createEthContract(address: string, abiName: string): void; + createContract(address: string, abiName: string): import("ethers").Contract; + getContract(address: string, abiName: string): import("ethers").Contract; + getTransactionReceipt(tx: PendingTransaction): Promise; getOperatorType: (tranche: string) => any; }; } & ActionsBase; export declare type ICollateralActions = { mintTitleNFT(nftAddr: string, usr: string): Promise; - mintNFT(nftAddr: string, owner: string, tokenId: string, ref: string, amount: string, asset: string): Promise; + mintNFT(nftAddr: string, owner: string, tokenId: string, ref: string, amount: string, asset: string): Promise; approveNFT(nftAddr: string, tokenId: string, to: string): Promise; setNFTApprovalForAll(nftAddr: string, to: string, approved: boolean): Promise; isNFTApprovedForAll(nftAddr: string, owner: string, operator: string): Promise; diff --git a/dist/actions/currency.d.ts b/dist/actions/currency.d.ts index be806ac..3da1062 100644 --- a/dist/actions/currency.d.ts +++ b/dist/actions/currency.d.ts @@ -1,15 +1,24 @@ -import { Constructor, TinlakeParams } from '../Tinlake'; +import { Constructor, TinlakeParams, PendingTransaction } from '../Tinlake'; import BN from 'bn.js'; export declare function CurrencyActions>(Base: ActionsBase): { new (...args: any[]): { mintCurrency: (usr: string, amount: string) => Promise; - getCurrencyAllowance: (owner: string, spender: string) => Promise; - getJuniorForCurrencyAllowance: (owner: string) => Promise; - getSeniorForCurrencyAllowance: (owner: string) => Promise; + getCurrencyAllowance: (owner: string, spender: string) => Promise; + getJuniorForCurrencyAllowance: (owner: string) => Promise; + getSeniorForCurrencyAllowance: (owner: string) => Promise; getCurrencyBalance: (user: string) => Promise; - approveCurrency: (usr: string, currencyAmount: string) => Promise; - approveSeniorForCurrency: (currencyAmount: string) => Promise; - approveJuniorForCurrency: (currencyAmount: string) => Promise; + approveCurrency: (usr: string, currencyAmount: string) => Promise<{ + hash: any; + contractKey: string; + }>; + approveSeniorForCurrency: (currencyAmount: string) => Promise<{ + hash: any; + contractKey: string; + } | undefined>; + approveJuniorForCurrency: (currencyAmount: string) => Promise<{ + hash: any; + contractKey: string; + } | undefined>; provider: any; eth: import("../services/ethereum").ethI; ethOptions: any; @@ -18,24 +27,28 @@ export declare function CurrencyActions void; setContracts: () => void; setEthConfig: (ethConfig: import("../Tinlake").EthConfig) => void; setEthersConfig: (ethersConfig: import("../Tinlake").EthersConfig | undefined) => void; - createContract(address: string, abiName: string): void; + createEthContract(address: string, abiName: string): void; + createContract(address: string, abiName: string): import("ethers").Contract; + getContract(address: string, abiName: string): import("ethers").Contract; + getTransactionReceipt(tx: PendingTransaction): Promise; getOperatorType: (tranche: string) => any; }; } & ActionsBase; export declare type ICurrencyActions = { mintCurrency(usr: string, amount: string): Promise; getCurrencyBalance(usr: string): Promise; - approveCurrency(usr: string, amount: string): Promise; getCurrencyAllowance: (owner: string, spender: string) => Promise; getJuniorForCurrencyAllowance: (owner: string) => Promise; getSeniorForCurrencyAllowance: (owner: string) => Promise; - approveSeniorForCurrency: (currencyAmount: string) => Promise; - approveJuniorForCurrency: (currencyAmount: string) => Promise; + approveCurrency(usr: string, amount: string): Promise; + approveSeniorForCurrency: (currencyAmount: string) => Promise; + approveJuniorForCurrency: (currencyAmount: string) => Promise; }; export default CurrencyActions; diff --git a/dist/actions/governance.d.ts b/dist/actions/governance.d.ts index 860652d..4dacbef 100644 --- a/dist/actions/governance.d.ts +++ b/dist/actions/governance.d.ts @@ -3,19 +3,24 @@ declare function GovernanceActions Promise; provider: any; - signer: import("ethers").Signer; eth: import("../services/ethereum").ethI; ethOptions: any; ethConfig: import("../Tinlake").EthConfig; + ethersConfig: import("../Tinlake").EthersConfig; contractAddresses: import("../Tinlake").ContractAddresses; transactionTimeout: number; contracts: import("../Tinlake").Contracts; + ethersContracts: import("../Tinlake").Contracts; contractAbis: import("../Tinlake").ContractAbis; contractConfig: any; setProvider: (provider: any, ethOptions?: any) => void; setContracts: () => void; setEthConfig: (ethConfig: import("../Tinlake").EthConfig) => void; - createContract(address: string, abiName: string): void; + setEthersConfig: (ethersConfig: import("../Tinlake").EthersConfig | undefined) => void; + createEthContract(address: string, abiName: string): void; + createContract(address: string, abiName: string): import("ethers").Contract; + getContract(address: string, abiName: string): import("ethers").Contract; + getTransactionReceipt(tx: import("../Tinlake").PendingTransaction): Promise; getOperatorType: (tranche: string) => any; }; } & ActionsBase; diff --git a/dist/actions/lender.d.ts b/dist/actions/lender.d.ts index 7022faa..bfc81ba 100644 --- a/dist/actions/lender.d.ts +++ b/dist/actions/lender.d.ts @@ -1,41 +1,52 @@ -import { Constructor, TinlakeParams } from '../Tinlake'; +import { Constructor, TinlakeParams, PendingTransaction } from '../Tinlake'; import BN from 'bn.js'; export declare function LenderActions>(Base: ActionBase): { new (...args: any[]): { - supplySenior: (currencyAmount: string) => Promise; + supplySenior: (currencyAmount: string) => Promise<{ + hash: any; + contractKey: string; + }>; redeemSenior: (tokenAmount: string) => Promise; getSeniorTokenAllowance: (owner: string) => Promise; approveSeniorToken: (tokenAmount: string) => Promise; - supplyJunior: (currencyAmount: string) => Promise; + supplyJunior: (currencyAmount: string) => Promise<{ + hash: any; + contractKey: string; + }>; redeemJunior: (tokenAmount: string) => Promise; getJuniorTokenAllowance: (owner: string) => Promise; approveJuniorToken: (tokenAmount: string) => Promise; balance: () => Promise; provider: any; - signer: import("ethers").Signer; eth: import("../services/ethereum").ethI; ethOptions: any; ethConfig: import("../Tinlake").EthConfig; + ethersConfig: import("../Tinlake").EthersConfig; contractAddresses: import("../Tinlake").ContractAddresses; transactionTimeout: number; contracts: import("../Tinlake").Contracts; + ethersContracts: import("../Tinlake").Contracts; contractAbis: import("../Tinlake").ContractAbis; contractConfig: any; setProvider: (provider: any, ethOptions?: any) => void; setContracts: () => void; setEthConfig: (ethConfig: import("../Tinlake").EthConfig) => void; - createContract(address: string, abiName: string): void; + setEthersConfig: (ethersConfig: import("../Tinlake").EthersConfig | undefined) => void; + createEthContract(address: string, abiName: string): void; + createContract(address: string, abiName: string): import("ethers").Contract; + getContract(address: string, abiName: string): import("ethers").Contract; + getTransactionReceipt(tx: PendingTransaction): Promise; getOperatorType: (tranche: string) => any; }; } & ActionBase; export declare type ILenderActions = { getSeniorTokenAllowance(owner: string): Promise; getJuniorTokenAllowance(owner: string): Promise; - supplyJunior(currencyAmount: string): Promise; + supplyJunior(currencyAmount: string): Promise; approveJuniorToken: (tokenAmount: string) => Promise; approveSeniorToken: (tokenAmount: string) => Promise; redeemJunior(tokenAmount: string): Promise; - supplySenior(currencyAmount: string): Promise; + supplySenior(currencyAmount: string): Promise; redeemSenior(tokenAmount: string): Promise; balance(): Promise; }; diff --git a/dist/actions/proxy.d.ts b/dist/actions/proxy.d.ts index bcbf4f3..ce352b7 100644 --- a/dist/actions/proxy.d.ts +++ b/dist/actions/proxy.d.ts @@ -12,24 +12,35 @@ export declare function ProxyActions Promise; checkProxyExists: (address: string) => Promise; proxyCreateNew: (address: string) => Promise; - proxyIssue: (proxyAddr: string, nftRegistryAddr: string, tokenId: string) => Promise; - proxyTransferIssue: (proxyAddr: string, nftRegistryAddr: string, tokenId: string) => Promise; + proxyIssue: (proxyAddr: string, nftRegistryAddr: string, tokenId: string) => Promise<{ + hash: any; + contractKey: string; + }>; + proxyTransferIssue: (proxyAddr: string, nftRegistryAddr: string, tokenId: string) => Promise<{ + hash: any; + contractKey: string; + }>; proxyLockBorrowWithdraw: (proxyAddr: string, loanId: string, amount: string, usr: string) => Promise; proxyRepayUnlockClose: (proxyAddr: string, tokenId: string, loanId: string, registry: string) => Promise; provider: any; - signer: ethers.Signer; eth: import("../services/ethereum").ethI; ethOptions: any; ethConfig: import("../Tinlake").EthConfig; + ethersConfig: import("../Tinlake").EthersConfig; contractAddresses: import("../Tinlake").ContractAddresses; transactionTimeout: number; contracts: import("../Tinlake").Contracts; + ethersContracts: import("../Tinlake").Contracts; contractAbis: import("../Tinlake").ContractAbis; contractConfig: any; setProvider: (provider: any, ethOptions?: any) => void; setContracts: () => void; setEthConfig: (ethConfig: import("../Tinlake").EthConfig) => void; - createContract(address: string, abiName: string): void; + setEthersConfig: (ethersConfig: import("../Tinlake").EthersConfig | undefined) => void; + createEthContract(address: string, abiName: string): void; + createContract(address: string, abiName: string): ethers.Contract; + getContract(address: string, abiName: string): ethers.Contract; + getTransactionReceipt(tx: import("../Tinlake").PendingTransaction): Promise; getOperatorType: (tranche: string) => any; }; } & ActionsBase; diff --git a/dist/index.d.ts b/dist/index.d.ts index 3f57825..4c8357f 100644 --- a/dist/index.d.ts +++ b/dist/index.d.ts @@ -11,24 +11,35 @@ export declare const TinlakeWithActions: { proxyCount: () => Promise; checkProxyExists: (address: string) => Promise; proxyCreateNew: (address: string) => Promise; - proxyIssue: (proxyAddr: string, nftRegistryAddr: string, tokenId: string) => Promise; - proxyTransferIssue: (proxyAddr: string, nftRegistryAddr: string, tokenId: string) => Promise; + proxyIssue: (proxyAddr: string, nftRegistryAddr: string, tokenId: string) => Promise<{ + hash: any; + contractKey: string; + }>; + proxyTransferIssue: (proxyAddr: string, nftRegistryAddr: string, tokenId: string) => Promise<{ + hash: any; + contractKey: string; + }>; proxyLockBorrowWithdraw: (proxyAddr: string, loanId: string, amount: string, usr: string) => Promise; proxyRepayUnlockClose: (proxyAddr: string, tokenId: string, loanId: string, registry: string) => Promise; provider: any; - signer: import("ethers").Signer; eth: import("./services/ethereum").ethI; ethOptions: any; ethConfig: import("./Tinlake").EthConfig; + ethersConfig: import("./Tinlake").EthersConfig; contractAddresses: import("./Tinlake").ContractAddresses; transactionTimeout: number; contracts: import("./Tinlake").Contracts; + ethersContracts: import("./Tinlake").Contracts; contractAbis: import("./Tinlake").ContractAbis; contractConfig: any; setProvider: (provider: any, ethOptions?: any) => void; setContracts: () => void; setEthConfig: (ethConfig: import("./Tinlake").EthConfig) => void; - createContract(address: string, abiName: string): void; + setEthersConfig: (ethersConfig: import("./Tinlake").EthersConfig | undefined) => void; + createEthContract(address: string, abiName: string): void; + createContract(address: string, abiName: string): import("ethers").Contract; + getContract(address: string, abiName: string): import("ethers").Contract; + getTransactionReceipt(tx: import("./Tinlake").PendingTransaction): Promise; getOperatorType: (tranche: string) => any; }; } & { @@ -42,19 +53,24 @@ export declare const TinlakeWithActions: { withdraw: (loan: string, currencyAmount: string, usr: string) => Promise; repay: (loan: string, currencyAmount: string) => Promise; provider: any; - signer: import("ethers").Signer; eth: import("./services/ethereum").ethI; ethOptions: any; ethConfig: import("./Tinlake").EthConfig; + ethersConfig: import("./Tinlake").EthersConfig; contractAddresses: import("./Tinlake").ContractAddresses; transactionTimeout: number; contracts: import("./Tinlake").Contracts; + ethersContracts: import("./Tinlake").Contracts; contractAbis: import("./Tinlake").ContractAbis; contractConfig: any; setProvider: (provider: any, ethOptions?: any) => void; setContracts: () => void; setEthConfig: (ethConfig: import("./Tinlake").EthConfig) => void; - createContract(address: string, abiName: string): void; + setEthersConfig: (ethersConfig: import("./Tinlake").EthersConfig | undefined) => void; + createEthContract(address: string, abiName: string): void; + createContract(address: string, abiName: string): import("ethers").Contract; + getContract(address: string, abiName: string): import("ethers").Contract; + getTransactionReceipt(tx: import("./Tinlake").PendingTransaction): Promise; getOperatorType: (tranche: string) => any; }; } & { @@ -72,50 +88,70 @@ export declare const TinlakeWithActions: { initRate: (ratePerSecond: string) => Promise; changeRate: (loan: string, ratePerSecond: string) => Promise; setRate: (loan: string, ratePerSecond: string) => Promise; - setMinimumJuniorRatio: (ratio: string) => Promise; + setMinimumJuniorRatio: (ratio: string) => Promise<{ + hash: any; + contractKey: string; + timesOutAt: number; + }>; approveAllowanceJunior: (user: string, maxCurrency: string, maxToken: string) => Promise; approveAllowanceSenior: (user: string, maxCurrency: string, maxToken: string) => Promise; provider: any; - signer: import("ethers").Signer; eth: import("./services/ethereum").ethI; ethOptions: any; ethConfig: import("./Tinlake").EthConfig; + ethersConfig: import("./Tinlake").EthersConfig; contractAddresses: import("./Tinlake").ContractAddresses; transactionTimeout: number; contracts: import("./Tinlake").Contracts; + ethersContracts: import("./Tinlake").Contracts; contractAbis: import("./Tinlake").ContractAbis; contractConfig: any; setProvider: (provider: any, ethOptions?: any) => void; setContracts: () => void; setEthConfig: (ethConfig: import("./Tinlake").EthConfig) => void; - createContract(address: string, abiName: string): void; + setEthersConfig: (ethersConfig: import("./Tinlake").EthersConfig | undefined) => void; + createEthContract(address: string, abiName: string): void; + createContract(address: string, abiName: string): import("ethers").Contract; + getContract(address: string, abiName: string): import("ethers").Contract; + getTransactionReceipt(tx: import("./Tinlake").PendingTransaction): Promise; getOperatorType: (tranche: string) => any; }; } & { new (...args: any[]): { - supplySenior: (currencyAmount: string) => Promise; + supplySenior: (currencyAmount: string) => Promise<{ + hash: any; + contractKey: string; + }>; redeemSenior: (tokenAmount: string) => Promise; getSeniorTokenAllowance: (owner: string) => Promise; approveSeniorToken: (tokenAmount: string) => Promise; - supplyJunior: (currencyAmount: string) => Promise; + supplyJunior: (currencyAmount: string) => Promise<{ + hash: any; + contractKey: string; + }>; redeemJunior: (tokenAmount: string) => Promise; getJuniorTokenAllowance: (owner: string) => Promise; approveJuniorToken: (tokenAmount: string) => Promise; balance: () => Promise; provider: any; - signer: import("ethers").Signer; eth: import("./services/ethereum").ethI; ethOptions: any; ethConfig: import("./Tinlake").EthConfig; + ethersConfig: import("./Tinlake").EthersConfig; contractAddresses: import("./Tinlake").ContractAddresses; transactionTimeout: number; contracts: import("./Tinlake").Contracts; + ethersContracts: import("./Tinlake").Contracts; contractAbis: import("./Tinlake").ContractAbis; contractConfig: any; setProvider: (provider: any, ethOptions?: any) => void; setContracts: () => void; setEthConfig: (ethConfig: import("./Tinlake").EthConfig) => void; - createContract(address: string, abiName: string): void; + setEthersConfig: (ethersConfig: import("./Tinlake").EthersConfig | undefined) => void; + createEthContract(address: string, abiName: string): void; + createContract(address: string, abiName: string): import("ethers").Contract; + getContract(address: string, abiName: string): import("ethers").Contract; + getTransactionReceipt(tx: import("./Tinlake").PendingTransaction): Promise; getOperatorType: (tranche: string) => any; }; } & { @@ -152,91 +188,126 @@ export declare const TinlakeWithActions: { getSeniorDebt: () => Promise; getSeniorInterestRate: () => Promise; provider: any; - signer: import("ethers").Signer; eth: import("./services/ethereum").ethI; ethOptions: any; ethConfig: import("./Tinlake").EthConfig; + ethersConfig: import("./Tinlake").EthersConfig; contractAddresses: import("./Tinlake").ContractAddresses; transactionTimeout: number; contracts: import("./Tinlake").Contracts; + ethersContracts: import("./Tinlake").Contracts; contractAbis: import("./Tinlake").ContractAbis; contractConfig: any; setProvider: (provider: any, ethOptions?: any) => void; setContracts: () => void; setEthConfig: (ethConfig: import("./Tinlake").EthConfig) => void; - createContract(address: string, abiName: string): void; + setEthersConfig: (ethersConfig: import("./Tinlake").EthersConfig | undefined) => void; + createEthContract(address: string, abiName: string): void; + createContract(address: string, abiName: string): import("ethers").Contract; + getContract(address: string, abiName: string): import("ethers").Contract; + getTransactionReceipt(tx: import("./Tinlake").PendingTransaction): Promise; getOperatorType: (tranche: string) => any; }; } & { new (...args: any[]): { - mintCurrency: (usr: string, amount: string) => Promise; - getCurrencyAllowance: (owner: string, spender: string) => Promise; - getJuniorForCurrencyAllowance: (owner: string) => Promise; - getSeniorForCurrencyAllowance: (owner: string) => Promise; + mintCurrency: (usr: string, amount: string) => Promise; + getCurrencyAllowance: (owner: string, spender: string) => Promise; + getJuniorForCurrencyAllowance: (owner: string) => Promise; + getSeniorForCurrencyAllowance: (owner: string) => Promise; getCurrencyBalance: (user: string) => Promise; - approveCurrency: (usr: string, currencyAmount: string) => Promise; - approveSeniorForCurrency: (currencyAmount: string) => Promise; - approveJuniorForCurrency: (currencyAmount: string) => Promise; + approveCurrency: (usr: string, currencyAmount: string) => Promise<{ + hash: any; + contractKey: string; + }>; + approveSeniorForCurrency: (currencyAmount: string) => Promise<{ + hash: any; + contractKey: string; + } | undefined>; + approveJuniorForCurrency: (currencyAmount: string) => Promise<{ + hash: any; + contractKey: string; + } | undefined>; provider: any; - signer: import("ethers").Signer; eth: import("./services/ethereum").ethI; ethOptions: any; ethConfig: import("./Tinlake").EthConfig; + ethersConfig: import("./Tinlake").EthersConfig; contractAddresses: import("./Tinlake").ContractAddresses; transactionTimeout: number; contracts: import("./Tinlake").Contracts; + ethersContracts: import("./Tinlake").Contracts; contractAbis: import("./Tinlake").ContractAbis; contractConfig: any; setProvider: (provider: any, ethOptions?: any) => void; setContracts: () => void; setEthConfig: (ethConfig: import("./Tinlake").EthConfig) => void; - createContract(address: string, abiName: string): void; + setEthersConfig: (ethersConfig: import("./Tinlake").EthersConfig | undefined) => void; + createEthContract(address: string, abiName: string): void; + createContract(address: string, abiName: string): import("ethers").Contract; + getContract(address: string, abiName: string): import("ethers").Contract; + getTransactionReceipt(tx: import("./Tinlake").PendingTransaction): Promise; getOperatorType: (tranche: string) => any; }; } & { new (...args: any[]): { mintTitleNFT: (nftAddr: string, user: string) => Promise; - mintNFT: (nftAddr: string, owner: string, tokenId: string, ref: string, amount: string, asset: string) => Promise; + mintNFT: (nftAddr: string, owner: string, tokenId: string, ref: string, amount: string, asset: string) => Promise<{ + hash: any; + contractKey: string; + }>; approveNFT: (nftAddr: string, tokenId: string, to: string) => Promise; - setNFTApprovalForAll: (nftAddr: string, to: string, approved: boolean) => Promise; - isNFTApprovedForAll: (nftAddr: string, owner: string, operator: string) => Promise; + setNFTApprovalForAll: (nftAddr: string, to: string, approved: boolean) => Promise<{ + hash: any; + contractKey: string; + }>; + isNFTApprovedForAll: (nftAddr: string, owner: string, operator: string) => Promise; getNFTCount: (nftAddr: string) => Promise; getNFTData: (nftAddr: string, tokenId: string) => Promise; getNFTOwner: (nftAddr: string, tokenId: string) => Promise; transferNFT: (nftAddr: string, from: string, to: string, tokenId: string) => Promise; provider: any; - signer: import("ethers").Signer; eth: import("./services/ethereum").ethI; ethOptions: any; ethConfig: import("./Tinlake").EthConfig; + ethersConfig: import("./Tinlake").EthersConfig; contractAddresses: import("./Tinlake").ContractAddresses; transactionTimeout: number; contracts: import("./Tinlake").Contracts; + ethersContracts: import("./Tinlake").Contracts; contractAbis: import("./Tinlake").ContractAbis; contractConfig: any; setProvider: (provider: any, ethOptions?: any) => void; setContracts: () => void; setEthConfig: (ethConfig: import("./Tinlake").EthConfig) => void; - createContract(address: string, abiName: string): void; + setEthersConfig: (ethersConfig: import("./Tinlake").EthersConfig | undefined) => void; + createEthContract(address: string, abiName: string): void; + createContract(address: string, abiName: string): import("ethers").Contract; + getContract(address: string, abiName: string): import("ethers").Contract; + getTransactionReceipt(tx: import("./Tinlake").PendingTransaction): Promise; getOperatorType: (tranche: string) => any; }; } & { new (...args: any[]): { relyAddress: (usr: string, contractAddress: string) => Promise; provider: any; - signer: import("ethers").Signer; eth: import("./services/ethereum").ethI; ethOptions: any; ethConfig: import("./Tinlake").EthConfig; + ethersConfig: import("./Tinlake").EthersConfig; contractAddresses: import("./Tinlake").ContractAddresses; transactionTimeout: number; contracts: import("./Tinlake").Contracts; + ethersContracts: import("./Tinlake").Contracts; contractAbis: import("./Tinlake").ContractAbis; contractConfig: any; setProvider: (provider: any, ethOptions?: any) => void; setContracts: () => void; setEthConfig: (ethConfig: import("./Tinlake").EthConfig) => void; - createContract(address: string, abiName: string): void; + setEthersConfig: (ethersConfig: import("./Tinlake").EthersConfig | undefined) => void; + createEthContract(address: string, abiName: string): void; + createContract(address: string, abiName: string): import("ethers").Contract; + getContract(address: string, abiName: string): import("ethers").Contract; + getTransactionReceipt(tx: import("./Tinlake").PendingTransaction): Promise; getOperatorType: (tranche: string) => any; }; } & typeof Tinlake; diff --git a/dist/index.es.js b/dist/index.es.js index be16f5a..f7c83a3 100644 --- a/dist/index.es.js +++ b/dist/index.es.js @@ -10887,14 +10887,18 @@ function AdminActions(Base) { }); }; // ------------ admin functions lender-site ------------- _this.setMinimumJuniorRatio = function (ratio) { return __awaiter(_this, void 0, void 0, function () { - var txHash; + var tx; return __generator(this, function (_a) { switch (_a.label) { - case 0: return [4 /*yield*/, executeAndRetry(this.contracts['ASSESSOR'].file, [web3.fromAscii('minJuniorRatio'), ratio, this.ethConfig])]; + case 0: return [4 /*yield*/, this.ethersContracts['ASSESSOR'].connect(this.ethersConfig.signer).file(web3.fromAscii('minJuniorRatio').padEnd(66, '0'), ratio)]; case 1: - txHash = _a.sent(); - console.log("[Assessor file] txHash: " + txHash); - return [2 /*return*/, waitAndReturnEvents(this.eth, txHash, this.contracts['ASSESSOR'].abi, this.transactionTimeout)]; + tx = _a.sent(); + console.log(this.transactionTimeout); + return [2 /*return*/, { + hash: tx.hash, + contractKey: 'ASSESSOR', + timesOutAt: Date.now() + this.transactionTimeout * 1000, + }]; } }); }); }; @@ -29407,16 +29411,18 @@ function LenderActions(Base) { __extends(class_1, _super); function class_1() { var _this = _super !== null && _super.apply(this, arguments) || this; - // senior tranch functions + // senior tranche functions _this.supplySenior = function (currencyAmount) { return __awaiter(_this, void 0, void 0, function () { - var txHash; + var tx; return __generator(this, function (_a) { switch (_a.label) { - case 0: return [4 /*yield*/, executeAndRetry(this.contracts['SENIOR_OPERATOR'].supply, [currencyAmount, this.ethConfig])]; + case 0: return [4 /*yield*/, this.ethersContracts['SENIOR_OPERATOR'].connect(this.ethersConfig.signer).supply(currencyAmount)]; case 1: - txHash = _a.sent(); - console.log("[Supply] txHash: " + txHash); - return [2 /*return*/, waitAndReturnEvents(this.eth, txHash, this.contracts['SENIOR_OPERATOR'].abi, this.transactionTimeout)]; + tx = _a.sent(); + return [2 /*return*/, { + hash: tx.hash, + contractKey: 'SENIOR_OPERATOR', + }]; } }); }); }; @@ -29457,14 +29463,16 @@ function LenderActions(Base) { }); }; // junior tranche functions _this.supplyJunior = function (currencyAmount) { return __awaiter(_this, void 0, void 0, function () { - var txHash; + var tx; return __generator(this, function (_a) { switch (_a.label) { - case 0: return [4 /*yield*/, executeAndRetry(this.contracts['JUNIOR_OPERATOR'].supply, [currencyAmount, this.ethConfig])]; + case 0: return [4 /*yield*/, this.ethersContracts['JUNIOR_OPERATOR'].connect(this.ethersConfig.signer).supply(currencyAmount)]; case 1: - txHash = _a.sent(); - console.log("[Supply] txHash: " + txHash); - return [2 /*return*/, waitAndReturnEvents(this.eth, txHash, this.contracts['JUNIOR_OPERATOR'].abi, this.transactionTimeout)]; + tx = _a.sent(); + return [2 /*return*/, { + hash: tx.hash, + contractKey: 'JUNIOR_OPERATOR', + }]; } }); }); }; @@ -29541,13 +29549,15 @@ function CurrencyActions(Base) { }); }); }; _this.getCurrencyAllowance = function (owner, spender) { return __awaiter(_this, void 0, void 0, function () { - var res; + var currencyContract, allowance; return __generator(this, function (_a) { switch (_a.label) { - case 0: return [4 /*yield*/, executeAndRetry(this.contracts['TINLAKE_CURRENCY'].allowance, [owner, spender])]; + case 0: + currencyContract = this.getContract(this.contractAddresses['TINLAKE_CURRENCY'], 'TINLAKE_CURRENCY'); + return [4 /*yield*/, currencyContract.allowance(owner, spender)]; case 1: - res = _a.sent(); - return [2 /*return*/, res[0] || new bn(0)]; + allowance = _a.sent(); + return [2 /*return*/, allowance.toBN()]; } }); }); }; @@ -29577,14 +29587,18 @@ function CurrencyActions(Base) { }); }); }; _this.approveCurrency = function (usr, currencyAmount) { return __awaiter(_this, void 0, void 0, function () { - var txHash; + var currencyContract, tx; return __generator(this, function (_a) { switch (_a.label) { - case 0: return [4 /*yield*/, executeAndRetry(this.contracts['TINLAKE_CURRENCY'].approve, [usr, currencyAmount, this.ethConfig])]; + case 0: + currencyContract = this.getContract(this.contractAddresses['TINLAKE_CURRENCY'], 'TINLAKE_CURRENCY'); + return [4 /*yield*/, currencyContract.approve(usr, currencyAmount)]; case 1: - txHash = _a.sent(); - console.log("[Currency.approve] txHash: " + txHash); - return [2 /*return*/, waitAndReturnEvents(this.eth, txHash, this.contracts['TINLAKE_CURRENCY'].abi, this.transactionTimeout)]; + tx = _a.sent(); + return [2 /*return*/, { + hash: tx.hash, + contractKey: 'TINLAKE_CURRENCY', + }]; } }); }); }; @@ -29631,33 +29645,18 @@ function CollateralActions(Base) { }); }); }; _this.mintNFT = function (nftAddr, owner, tokenId, ref, amount, asset) { return __awaiter(_this, void 0, void 0, function () { - var nftContract, tx, error_1, nft, txHash; + var nftContract, tx; return __generator(this, function (_a) { switch (_a.label) { case 0: nftContract = this.getContract(nftAddr, 'COLLATERAL_NFT'); - if (!nftContract) return [3 /*break*/, 4]; - _a.label = 1; - case 1: - _a.trys.push([1, 3, , 4]); return [4 /*yield*/, nftContract.mint(owner, tokenId, ref, amount, asset)]; - case 2: + case 1: tx = _a.sent(); return [2 /*return*/, { hash: tx.hash, contractKey: 'COLLATERAL_NFT', - timesOutAt: 0, }]; - case 3: - error_1 = _a.sent(); - return [2 /*return*/, error_1]; - case 4: - nft = this.eth.contract(this.contractAbis['COLLATERAL_NFT']).at(nftAddr); - return [4 /*yield*/, executeAndRetry(nft.mint, [owner, tokenId, ref, amount, asset, this.ethConfig])]; - case 5: - txHash = _a.sent(); - console.log("[NFT.mint] txHash: " + txHash); - return [2 /*return*/, waitAndReturnEvents(this.eth, txHash, this.contractAbis['COLLATERAL_NFT'], this.transactionTimeout)]; } }); }); }; @@ -29676,28 +29675,26 @@ function CollateralActions(Base) { }); }); }; _this.setNFTApprovalForAll = function (nftAddr, to, approved) { return __awaiter(_this, void 0, void 0, function () { - var nft, txHash; + var nftContract, tx; return __generator(this, function (_a) { switch (_a.label) { case 0: - nft = this.eth.contract(this.contractAbis['COLLATERAL_NFT']).at(nftAddr); - return [4 /*yield*/, executeAndRetry(nft.setApprovalForAll, [to, approved, this.ethConfig])]; + nftContract = this.getContract(nftAddr, 'COLLATERAL_NFT'); + return [4 /*yield*/, nftContract.setApprovalForAll(to, approved)]; case 1: - txHash = _a.sent(); - return [2 /*return*/, waitAndReturnEvents(this.eth, txHash, this.contractAbis['COLLATERAL_NFT'], this.transactionTimeout)]; + tx = _a.sent(); + return [2 /*return*/, { + hash: tx.hash, + contractKey: 'COLLATERAL_NFT', + }]; } }); }); }; _this.isNFTApprovedForAll = function (nftAddr, owner, operator) { return __awaiter(_this, void 0, void 0, function () { - var nft, res; return __generator(this, function (_a) { switch (_a.label) { - case 0: - nft = this.eth.contract(this.contractAbis['COLLATERAL_NFT']).at(nftAddr); - return [4 /*yield*/, executeAndRetry(nft.isApprovedForAll, [owner, operator, this.ethConfig])]; - case 1: - res = _a.sent(); - return [2 /*return*/, res[0]]; + case 0: return [4 /*yield*/, this.getContract(nftAddr, 'COLLATERAL_NFT').isApprovedForAll(owner, operator)]; + case 1: return [2 /*return*/, _a.sent()]; } }); }); }; @@ -29715,28 +29712,15 @@ function CollateralActions(Base) { }); }); }; _this.getNFTData = function (nftAddr, tokenId) { return __awaiter(_this, void 0, void 0, function () { - var nft, res; return __generator(this, function (_a) { - switch (_a.label) { - case 0: - nft = this.eth.contract(this.contractAbis['COLLATERAL_NFT']).at(nftAddr); - return [4 /*yield*/, executeAndRetry(nft.data, [tokenId])]; - case 1: - res = _a.sent(); - return [2 /*return*/, res]; - } + return [2 /*return*/, this.getContract(nftAddr, 'COLLATERAL_NFT').data(tokenId)]; }); }); }; _this.getNFTOwner = function (nftAddr, tokenId) { return __awaiter(_this, void 0, void 0, function () { - var nft, res; return __generator(this, function (_a) { switch (_a.label) { - case 0: - nft = this.eth.contract(this.contractAbis['COLLATERAL_NFT']).at(nftAddr); - return [4 /*yield*/, executeAndRetry(nft.ownerOf, [tokenId])]; - case 1: - res = _a.sent(); - return [2 /*return*/, res[0]]; + case 0: return [4 /*yield*/, this.getContract(nftAddr, 'COLLATERAL_NFT').ownerOf(tokenId)]; + case 1: return [2 /*return*/, _a.sent()]; } }); }); }; @@ -29833,15 +29817,10 @@ function AnalyticsActions(Base) { }); }); }; _this.getOwnerOfCollateral = function (nftRegistryAddr, tokenId) { return __awaiter(_this, void 0, void 0, function () { - var nft, res; return __generator(this, function (_a) { switch (_a.label) { - case 0: - nft = this.eth.contract(this.contractAbis['COLLATERAL_NFT']).at(nftRegistryAddr); - return [4 /*yield*/, executeAndRetry(nft.ownerOf, [tokenId])]; - case 1: - res = _a.sent(); - return [2 /*return*/, res[0]]; + case 0: return [4 /*yield*/, this.getContract(nftRegistryAddr, 'COLLATERAL_NFT').ownerOf(tokenId)]; + case 1: return [2 /*return*/, _a.sent()]; } }); }); }; @@ -30327,13 +30306,10 @@ function ProxyActions(Base) { function class_1() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.getProxyAccessTokenOwner = function (tokenId) { return __awaiter(_this, void 0, void 0, function () { - var res; return __generator(this, function (_a) { switch (_a.label) { - case 0: return [4 /*yield*/, executeAndRetry(this.contracts['PROXY_REGISTRY'].ownerOf, [tokenId])]; - case 1: - res = _a.sent(); - return [2 /*return*/, res[0]]; + case 0: return [4 /*yield*/, this.ethersContracts['PROXY_REGISTRY'].ownerOf(tokenId)]; + case 1: return [2 /*return*/, _a.sent()]; } }); }); }; @@ -30364,15 +30340,15 @@ function ProxyActions(Base) { }); }); }; _this.getProxyAccessToken = function (proxyAddr) { return __awaiter(_this, void 0, void 0, function () { - var proxy, res; + var proxy, accessToken; return __generator(this, function (_a) { switch (_a.label) { case 0: - proxy = this.eth.contract(this.contractAbis['PROXY']).at(proxyAddr); - return [4 /*yield*/, executeAndRetry(proxy.accessToken, [])]; + proxy = this.getContract(proxyAddr, 'PROXY'); + return [4 /*yield*/, proxy.accessToken()]; case 1: - res = _a.sent(); - return [2 /*return*/, res[0].toNumber()]; + accessToken = _a.sent(); + return [2 /*return*/, accessToken.toNumber()]; } }); }); }; @@ -30450,11 +30426,11 @@ function ProxyActions(Base) { }); }); }; _this.proxyIssue = function (proxyAddr, nftRegistryAddr, tokenId) { return __awaiter(_this, void 0, void 0, function () { - var proxy, encoded, txHash; + var proxy, encoded, tx; return __generator(this, function (_a) { switch (_a.label) { case 0: - proxy = this.eth.contract(this.contractAbis['PROXY']).at(proxyAddr); + proxy = this.getContract(proxyAddr, 'PROXY'); encoded = abiCoder$2.encodeFunctionCall({ name: 'issue', type: 'function', @@ -30463,21 +30439,23 @@ function ProxyActions(Base) { { type: 'address', name: 'registry' }, { type: 'uint256', name: 'token' } ] - }, [this.contracts['SHELF'].address, nftRegistryAddr, tokenId]); - return [4 /*yield*/, executeAndRetry(proxy.execute, [this.contracts['ACTIONS'].address, encoded, this.ethConfig])]; + }, [this.ethersContracts['SHELF'].address, nftRegistryAddr, tokenId]); + return [4 /*yield*/, proxy.execute(this.ethersContracts['ACTIONS'].address, encoded)]; case 1: - txHash = _a.sent(); - console.log("[Proxy Issue Loan] txHash: " + txHash); - return [2 /*return*/, waitAndReturnEvents(this.eth, txHash, this.contractAbis['PROXY'], this.transactionTimeout)]; + tx = _a.sent(); + return [2 /*return*/, { + hash: tx.hash, + contractKey: 'PROXY', + }]; } }); }); }; _this.proxyTransferIssue = function (proxyAddr, nftRegistryAddr, tokenId) { return __awaiter(_this, void 0, void 0, function () { - var proxy, encoded, txHash; + var proxy, encoded, tx; return __generator(this, function (_a) { switch (_a.label) { case 0: - proxy = this.eth.contract(this.contractAbis['PROXY']).at(proxyAddr); + proxy = this.getContract(proxyAddr, 'PROXY'); encoded = abiCoder$2.encodeFunctionCall({ name: 'transferIssue', type: 'function', @@ -30486,12 +30464,14 @@ function ProxyActions(Base) { { type: 'address', name: 'registry' }, { type: 'uint256', name: 'token' } ] - }, [this.contracts['SHELF'].address, nftRegistryAddr, tokenId]); - return [4 /*yield*/, executeAndRetry(proxy.execute, [this.contracts['ACTIONS'].address, encoded, this.ethConfig])]; + }, [this.ethersContracts['SHELF'].address, nftRegistryAddr, tokenId]); + return [4 /*yield*/, proxy.execute(this.ethersContracts['ACTIONS'].address, encoded)]; case 1: - txHash = _a.sent(); - console.log("[Proxy Transfer Issue Loan] txHash: " + txHash); - return [2 /*return*/, waitAndReturnEvents(this.eth, txHash, this.contractAbis['PROXY'], this.transactionTimeout)]; + tx = _a.sent(); + return [2 /*return*/, { + hash: tx.hash, + contractKey: 'PROXY', + }]; } }); }); }; @@ -47419,10 +47399,14 @@ var contractNames = [ 'NFT_FEED', 'GOVERNANCE', ]; +ethers_2$1.utils.BigNumber.prototype.toBN = function () { + return new bn(this.toString()); +}; var Tinlake = /** @class */ (function () { function Tinlake(params) { var _this = this; this.contracts = {}; + this.ethersContracts = {}; this.contractAbis = {}; this.contractConfig = {}; this.setProvider = function (provider, ethOptions) { @@ -47435,18 +47419,24 @@ var Tinlake = /** @class */ (function () { // set root & proxy contracts contractNames.forEach(function (name) { if (_this.contractAbis[name] && _this.contractAddresses[name]) { - _this.contracts[name] = _this.eth.contract(_this.contractAbis[name]) - .at(_this.contractAddresses[name]); + _this.contracts[name] = _this.eth.contract(_this.contractAbis[name]).at(_this.contractAddresses[name]); + _this.ethersContracts[name] = _this.createContract(_this.contractAddresses[name], name); } }); // modular contracts if (_this.contractAddresses['JUNIOR_OPERATOR']) { _this.contracts['JUNIOR_OPERATOR'] = _this.contractConfig['JUNIOR_OPERATOR'] + ? _this.createEthContract(_this.contractAddresses['JUNIOR_OPERATOR'], _this.contractConfig['JUNIOR_OPERATOR']) + : _this.createEthContract(_this.contractAddresses['JUNIOR_OPERATOR'], 'ALLOWANCE_OPERATOR'); + _this.ethersContracts['JUNIOR_OPERATOR'] = _this.contractConfig['JUNIOR_OPERATOR'] ? _this.createContract(_this.contractAddresses['JUNIOR_OPERATOR'], _this.contractConfig['JUNIOR_OPERATOR']) : _this.createContract(_this.contractAddresses['JUNIOR_OPERATOR'], 'ALLOWANCE_OPERATOR'); } if (_this.contractAddresses['SENIOR_OPERATOR']) { _this.contracts['SENIOR_OPERATOR'] = _this.contractConfig['SENIOR_OPERATOR'] + ? _this.createEthContract(_this.contractAddresses['SENIOR_OPERATOR'], _this.contractConfig['SENIOR_OPERATOR']) + : _this.createEthContract(_this.contractAddresses['SENIOR_OPERATOR'], 'ALLOWANCE_OPERATOR'); + _this.ethersContracts['SENIOR_OPERATOR'] = _this.contractConfig['SENIOR_OPERATOR'] ? _this.createContract(_this.contractAddresses['SENIOR_OPERATOR'], _this.contractConfig['SENIOR_OPERATOR']) : _this.createContract(_this.contractAddresses['SENIOR_OPERATOR'], 'ALLOWANCE_OPERATOR'); } @@ -47476,14 +47466,17 @@ var Tinlake = /** @class */ (function () { this.transactionTimeout = transactionTimeout; this.setProvider(provider, ethOptions); this.setEthConfig(ethConfig || {}); - this.setEthersConfig(ethersConfig || {}); + this.setEthersConfig(ethersConfig); } - Tinlake.prototype.createContract = function (address, abiName) { + Tinlake.prototype.createEthContract = function (address, abiName) { var contract = this.eth.contract(this.contractAbis[abiName]).at(address); return contract; }; + Tinlake.prototype.createContract = function (address, abiName) { + return new ethers_2$1.Contract(address, this.contractAbis[abiName], this.ethersConfig.provider); + }; Tinlake.prototype.getContract = function (address, abiName) { - return this.ethersConfig.signer ? new ethers_2$1.Contract(address, this.contractAbis[abiName], this.ethersConfig.signer) : undefined; + return new ethers_2$1.Contract(address, this.contractAbis[abiName], this.ethersConfig.signer); }; Tinlake.prototype.getTransactionReceipt = function (tx) { return __awaiter(this, void 0, void 0, function () { diff --git a/dist/index.js b/dist/index.js index 675adec..0643dba 100644 --- a/dist/index.js +++ b/dist/index.js @@ -10893,14 +10893,18 @@ function AdminActions(Base) { }); }; // ------------ admin functions lender-site ------------- _this.setMinimumJuniorRatio = function (ratio) { return __awaiter(_this, void 0, void 0, function () { - var txHash; + var tx; return __generator(this, function (_a) { switch (_a.label) { - case 0: return [4 /*yield*/, executeAndRetry(this.contracts['ASSESSOR'].file, [web3.fromAscii('minJuniorRatio'), ratio, this.ethConfig])]; + case 0: return [4 /*yield*/, this.ethersContracts['ASSESSOR'].connect(this.ethersConfig.signer).file(web3.fromAscii('minJuniorRatio').padEnd(66, '0'), ratio)]; case 1: - txHash = _a.sent(); - console.log("[Assessor file] txHash: " + txHash); - return [2 /*return*/, waitAndReturnEvents(this.eth, txHash, this.contracts['ASSESSOR'].abi, this.transactionTimeout)]; + tx = _a.sent(); + console.log(this.transactionTimeout); + return [2 /*return*/, { + hash: tx.hash, + contractKey: 'ASSESSOR', + timesOutAt: Date.now() + this.transactionTimeout * 1000, + }]; } }); }); }; @@ -29413,16 +29417,18 @@ function LenderActions(Base) { __extends(class_1, _super); function class_1() { var _this = _super !== null && _super.apply(this, arguments) || this; - // senior tranch functions + // senior tranche functions _this.supplySenior = function (currencyAmount) { return __awaiter(_this, void 0, void 0, function () { - var txHash; + var tx; return __generator(this, function (_a) { switch (_a.label) { - case 0: return [4 /*yield*/, executeAndRetry(this.contracts['SENIOR_OPERATOR'].supply, [currencyAmount, this.ethConfig])]; + case 0: return [4 /*yield*/, this.ethersContracts['SENIOR_OPERATOR'].connect(this.ethersConfig.signer).supply(currencyAmount)]; case 1: - txHash = _a.sent(); - console.log("[Supply] txHash: " + txHash); - return [2 /*return*/, waitAndReturnEvents(this.eth, txHash, this.contracts['SENIOR_OPERATOR'].abi, this.transactionTimeout)]; + tx = _a.sent(); + return [2 /*return*/, { + hash: tx.hash, + contractKey: 'SENIOR_OPERATOR', + }]; } }); }); }; @@ -29463,14 +29469,16 @@ function LenderActions(Base) { }); }; // junior tranche functions _this.supplyJunior = function (currencyAmount) { return __awaiter(_this, void 0, void 0, function () { - var txHash; + var tx; return __generator(this, function (_a) { switch (_a.label) { - case 0: return [4 /*yield*/, executeAndRetry(this.contracts['JUNIOR_OPERATOR'].supply, [currencyAmount, this.ethConfig])]; + case 0: return [4 /*yield*/, this.ethersContracts['JUNIOR_OPERATOR'].connect(this.ethersConfig.signer).supply(currencyAmount)]; case 1: - txHash = _a.sent(); - console.log("[Supply] txHash: " + txHash); - return [2 /*return*/, waitAndReturnEvents(this.eth, txHash, this.contracts['JUNIOR_OPERATOR'].abi, this.transactionTimeout)]; + tx = _a.sent(); + return [2 /*return*/, { + hash: tx.hash, + contractKey: 'JUNIOR_OPERATOR', + }]; } }); }); }; @@ -29547,13 +29555,15 @@ function CurrencyActions(Base) { }); }); }; _this.getCurrencyAllowance = function (owner, spender) { return __awaiter(_this, void 0, void 0, function () { - var res; + var currencyContract, allowance; return __generator(this, function (_a) { switch (_a.label) { - case 0: return [4 /*yield*/, executeAndRetry(this.contracts['TINLAKE_CURRENCY'].allowance, [owner, spender])]; + case 0: + currencyContract = this.getContract(this.contractAddresses['TINLAKE_CURRENCY'], 'TINLAKE_CURRENCY'); + return [4 /*yield*/, currencyContract.allowance(owner, spender)]; case 1: - res = _a.sent(); - return [2 /*return*/, res[0] || new bn(0)]; + allowance = _a.sent(); + return [2 /*return*/, allowance.toBN()]; } }); }); }; @@ -29583,14 +29593,18 @@ function CurrencyActions(Base) { }); }); }; _this.approveCurrency = function (usr, currencyAmount) { return __awaiter(_this, void 0, void 0, function () { - var txHash; + var currencyContract, tx; return __generator(this, function (_a) { switch (_a.label) { - case 0: return [4 /*yield*/, executeAndRetry(this.contracts['TINLAKE_CURRENCY'].approve, [usr, currencyAmount, this.ethConfig])]; + case 0: + currencyContract = this.getContract(this.contractAddresses['TINLAKE_CURRENCY'], 'TINLAKE_CURRENCY'); + return [4 /*yield*/, currencyContract.approve(usr, currencyAmount)]; case 1: - txHash = _a.sent(); - console.log("[Currency.approve] txHash: " + txHash); - return [2 /*return*/, waitAndReturnEvents(this.eth, txHash, this.contracts['TINLAKE_CURRENCY'].abi, this.transactionTimeout)]; + tx = _a.sent(); + return [2 /*return*/, { + hash: tx.hash, + contractKey: 'TINLAKE_CURRENCY', + }]; } }); }); }; @@ -29637,33 +29651,18 @@ function CollateralActions(Base) { }); }); }; _this.mintNFT = function (nftAddr, owner, tokenId, ref, amount, asset) { return __awaiter(_this, void 0, void 0, function () { - var nftContract, tx, error_1, nft, txHash; + var nftContract, tx; return __generator(this, function (_a) { switch (_a.label) { case 0: nftContract = this.getContract(nftAddr, 'COLLATERAL_NFT'); - if (!nftContract) return [3 /*break*/, 4]; - _a.label = 1; - case 1: - _a.trys.push([1, 3, , 4]); return [4 /*yield*/, nftContract.mint(owner, tokenId, ref, amount, asset)]; - case 2: + case 1: tx = _a.sent(); return [2 /*return*/, { hash: tx.hash, contractKey: 'COLLATERAL_NFT', - timesOutAt: 0, }]; - case 3: - error_1 = _a.sent(); - return [2 /*return*/, error_1]; - case 4: - nft = this.eth.contract(this.contractAbis['COLLATERAL_NFT']).at(nftAddr); - return [4 /*yield*/, executeAndRetry(nft.mint, [owner, tokenId, ref, amount, asset, this.ethConfig])]; - case 5: - txHash = _a.sent(); - console.log("[NFT.mint] txHash: " + txHash); - return [2 /*return*/, waitAndReturnEvents(this.eth, txHash, this.contractAbis['COLLATERAL_NFT'], this.transactionTimeout)]; } }); }); }; @@ -29682,28 +29681,26 @@ function CollateralActions(Base) { }); }); }; _this.setNFTApprovalForAll = function (nftAddr, to, approved) { return __awaiter(_this, void 0, void 0, function () { - var nft, txHash; + var nftContract, tx; return __generator(this, function (_a) { switch (_a.label) { case 0: - nft = this.eth.contract(this.contractAbis['COLLATERAL_NFT']).at(nftAddr); - return [4 /*yield*/, executeAndRetry(nft.setApprovalForAll, [to, approved, this.ethConfig])]; + nftContract = this.getContract(nftAddr, 'COLLATERAL_NFT'); + return [4 /*yield*/, nftContract.setApprovalForAll(to, approved)]; case 1: - txHash = _a.sent(); - return [2 /*return*/, waitAndReturnEvents(this.eth, txHash, this.contractAbis['COLLATERAL_NFT'], this.transactionTimeout)]; + tx = _a.sent(); + return [2 /*return*/, { + hash: tx.hash, + contractKey: 'COLLATERAL_NFT', + }]; } }); }); }; _this.isNFTApprovedForAll = function (nftAddr, owner, operator) { return __awaiter(_this, void 0, void 0, function () { - var nft, res; return __generator(this, function (_a) { switch (_a.label) { - case 0: - nft = this.eth.contract(this.contractAbis['COLLATERAL_NFT']).at(nftAddr); - return [4 /*yield*/, executeAndRetry(nft.isApprovedForAll, [owner, operator, this.ethConfig])]; - case 1: - res = _a.sent(); - return [2 /*return*/, res[0]]; + case 0: return [4 /*yield*/, this.getContract(nftAddr, 'COLLATERAL_NFT').isApprovedForAll(owner, operator)]; + case 1: return [2 /*return*/, _a.sent()]; } }); }); }; @@ -29721,28 +29718,15 @@ function CollateralActions(Base) { }); }); }; _this.getNFTData = function (nftAddr, tokenId) { return __awaiter(_this, void 0, void 0, function () { - var nft, res; return __generator(this, function (_a) { - switch (_a.label) { - case 0: - nft = this.eth.contract(this.contractAbis['COLLATERAL_NFT']).at(nftAddr); - return [4 /*yield*/, executeAndRetry(nft.data, [tokenId])]; - case 1: - res = _a.sent(); - return [2 /*return*/, res]; - } + return [2 /*return*/, this.getContract(nftAddr, 'COLLATERAL_NFT').data(tokenId)]; }); }); }; _this.getNFTOwner = function (nftAddr, tokenId) { return __awaiter(_this, void 0, void 0, function () { - var nft, res; return __generator(this, function (_a) { switch (_a.label) { - case 0: - nft = this.eth.contract(this.contractAbis['COLLATERAL_NFT']).at(nftAddr); - return [4 /*yield*/, executeAndRetry(nft.ownerOf, [tokenId])]; - case 1: - res = _a.sent(); - return [2 /*return*/, res[0]]; + case 0: return [4 /*yield*/, this.getContract(nftAddr, 'COLLATERAL_NFT').ownerOf(tokenId)]; + case 1: return [2 /*return*/, _a.sent()]; } }); }); }; @@ -29839,15 +29823,10 @@ function AnalyticsActions(Base) { }); }); }; _this.getOwnerOfCollateral = function (nftRegistryAddr, tokenId) { return __awaiter(_this, void 0, void 0, function () { - var nft, res; return __generator(this, function (_a) { switch (_a.label) { - case 0: - nft = this.eth.contract(this.contractAbis['COLLATERAL_NFT']).at(nftRegistryAddr); - return [4 /*yield*/, executeAndRetry(nft.ownerOf, [tokenId])]; - case 1: - res = _a.sent(); - return [2 /*return*/, res[0]]; + case 0: return [4 /*yield*/, this.getContract(nftRegistryAddr, 'COLLATERAL_NFT').ownerOf(tokenId)]; + case 1: return [2 /*return*/, _a.sent()]; } }); }); }; @@ -30333,13 +30312,10 @@ function ProxyActions(Base) { function class_1() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.getProxyAccessTokenOwner = function (tokenId) { return __awaiter(_this, void 0, void 0, function () { - var res; return __generator(this, function (_a) { switch (_a.label) { - case 0: return [4 /*yield*/, executeAndRetry(this.contracts['PROXY_REGISTRY'].ownerOf, [tokenId])]; - case 1: - res = _a.sent(); - return [2 /*return*/, res[0]]; + case 0: return [4 /*yield*/, this.ethersContracts['PROXY_REGISTRY'].ownerOf(tokenId)]; + case 1: return [2 /*return*/, _a.sent()]; } }); }); }; @@ -30370,15 +30346,15 @@ function ProxyActions(Base) { }); }); }; _this.getProxyAccessToken = function (proxyAddr) { return __awaiter(_this, void 0, void 0, function () { - var proxy, res; + var proxy, accessToken; return __generator(this, function (_a) { switch (_a.label) { case 0: - proxy = this.eth.contract(this.contractAbis['PROXY']).at(proxyAddr); - return [4 /*yield*/, executeAndRetry(proxy.accessToken, [])]; + proxy = this.getContract(proxyAddr, 'PROXY'); + return [4 /*yield*/, proxy.accessToken()]; case 1: - res = _a.sent(); - return [2 /*return*/, res[0].toNumber()]; + accessToken = _a.sent(); + return [2 /*return*/, accessToken.toNumber()]; } }); }); }; @@ -30456,11 +30432,11 @@ function ProxyActions(Base) { }); }); }; _this.proxyIssue = function (proxyAddr, nftRegistryAddr, tokenId) { return __awaiter(_this, void 0, void 0, function () { - var proxy, encoded, txHash; + var proxy, encoded, tx; return __generator(this, function (_a) { switch (_a.label) { case 0: - proxy = this.eth.contract(this.contractAbis['PROXY']).at(proxyAddr); + proxy = this.getContract(proxyAddr, 'PROXY'); encoded = abiCoder$2.encodeFunctionCall({ name: 'issue', type: 'function', @@ -30469,21 +30445,23 @@ function ProxyActions(Base) { { type: 'address', name: 'registry' }, { type: 'uint256', name: 'token' } ] - }, [this.contracts['SHELF'].address, nftRegistryAddr, tokenId]); - return [4 /*yield*/, executeAndRetry(proxy.execute, [this.contracts['ACTIONS'].address, encoded, this.ethConfig])]; + }, [this.ethersContracts['SHELF'].address, nftRegistryAddr, tokenId]); + return [4 /*yield*/, proxy.execute(this.ethersContracts['ACTIONS'].address, encoded)]; case 1: - txHash = _a.sent(); - console.log("[Proxy Issue Loan] txHash: " + txHash); - return [2 /*return*/, waitAndReturnEvents(this.eth, txHash, this.contractAbis['PROXY'], this.transactionTimeout)]; + tx = _a.sent(); + return [2 /*return*/, { + hash: tx.hash, + contractKey: 'PROXY', + }]; } }); }); }; _this.proxyTransferIssue = function (proxyAddr, nftRegistryAddr, tokenId) { return __awaiter(_this, void 0, void 0, function () { - var proxy, encoded, txHash; + var proxy, encoded, tx; return __generator(this, function (_a) { switch (_a.label) { case 0: - proxy = this.eth.contract(this.contractAbis['PROXY']).at(proxyAddr); + proxy = this.getContract(proxyAddr, 'PROXY'); encoded = abiCoder$2.encodeFunctionCall({ name: 'transferIssue', type: 'function', @@ -30492,12 +30470,14 @@ function ProxyActions(Base) { { type: 'address', name: 'registry' }, { type: 'uint256', name: 'token' } ] - }, [this.contracts['SHELF'].address, nftRegistryAddr, tokenId]); - return [4 /*yield*/, executeAndRetry(proxy.execute, [this.contracts['ACTIONS'].address, encoded, this.ethConfig])]; + }, [this.ethersContracts['SHELF'].address, nftRegistryAddr, tokenId]); + return [4 /*yield*/, proxy.execute(this.ethersContracts['ACTIONS'].address, encoded)]; case 1: - txHash = _a.sent(); - console.log("[Proxy Transfer Issue Loan] txHash: " + txHash); - return [2 /*return*/, waitAndReturnEvents(this.eth, txHash, this.contractAbis['PROXY'], this.transactionTimeout)]; + tx = _a.sent(); + return [2 /*return*/, { + hash: tx.hash, + contractKey: 'PROXY', + }]; } }); }); }; @@ -47425,10 +47405,14 @@ var contractNames = [ 'NFT_FEED', 'GOVERNANCE', ]; +ethers_2$1.utils.BigNumber.prototype.toBN = function () { + return new bn(this.toString()); +}; var Tinlake = /** @class */ (function () { function Tinlake(params) { var _this = this; this.contracts = {}; + this.ethersContracts = {}; this.contractAbis = {}; this.contractConfig = {}; this.setProvider = function (provider, ethOptions) { @@ -47441,18 +47425,24 @@ var Tinlake = /** @class */ (function () { // set root & proxy contracts contractNames.forEach(function (name) { if (_this.contractAbis[name] && _this.contractAddresses[name]) { - _this.contracts[name] = _this.eth.contract(_this.contractAbis[name]) - .at(_this.contractAddresses[name]); + _this.contracts[name] = _this.eth.contract(_this.contractAbis[name]).at(_this.contractAddresses[name]); + _this.ethersContracts[name] = _this.createContract(_this.contractAddresses[name], name); } }); // modular contracts if (_this.contractAddresses['JUNIOR_OPERATOR']) { _this.contracts['JUNIOR_OPERATOR'] = _this.contractConfig['JUNIOR_OPERATOR'] + ? _this.createEthContract(_this.contractAddresses['JUNIOR_OPERATOR'], _this.contractConfig['JUNIOR_OPERATOR']) + : _this.createEthContract(_this.contractAddresses['JUNIOR_OPERATOR'], 'ALLOWANCE_OPERATOR'); + _this.ethersContracts['JUNIOR_OPERATOR'] = _this.contractConfig['JUNIOR_OPERATOR'] ? _this.createContract(_this.contractAddresses['JUNIOR_OPERATOR'], _this.contractConfig['JUNIOR_OPERATOR']) : _this.createContract(_this.contractAddresses['JUNIOR_OPERATOR'], 'ALLOWANCE_OPERATOR'); } if (_this.contractAddresses['SENIOR_OPERATOR']) { _this.contracts['SENIOR_OPERATOR'] = _this.contractConfig['SENIOR_OPERATOR'] + ? _this.createEthContract(_this.contractAddresses['SENIOR_OPERATOR'], _this.contractConfig['SENIOR_OPERATOR']) + : _this.createEthContract(_this.contractAddresses['SENIOR_OPERATOR'], 'ALLOWANCE_OPERATOR'); + _this.ethersContracts['SENIOR_OPERATOR'] = _this.contractConfig['SENIOR_OPERATOR'] ? _this.createContract(_this.contractAddresses['SENIOR_OPERATOR'], _this.contractConfig['SENIOR_OPERATOR']) : _this.createContract(_this.contractAddresses['SENIOR_OPERATOR'], 'ALLOWANCE_OPERATOR'); } @@ -47482,14 +47472,17 @@ var Tinlake = /** @class */ (function () { this.transactionTimeout = transactionTimeout; this.setProvider(provider, ethOptions); this.setEthConfig(ethConfig || {}); - this.setEthersConfig(ethersConfig || {}); + this.setEthersConfig(ethersConfig); } - Tinlake.prototype.createContract = function (address, abiName) { + Tinlake.prototype.createEthContract = function (address, abiName) { var contract = this.eth.contract(this.contractAbis[abiName]).at(address); return contract; }; + Tinlake.prototype.createContract = function (address, abiName) { + return new ethers_2$1.Contract(address, this.contractAbis[abiName], this.ethersConfig.provider); + }; Tinlake.prototype.getContract = function (address, abiName) { - return this.ethersConfig.signer ? new ethers_2$1.Contract(address, this.contractAbis[abiName], this.ethersConfig.signer) : undefined; + return new ethers_2$1.Contract(address, this.contractAbis[abiName], this.ethersConfig.signer); }; Tinlake.prototype.getTransactionReceipt = function (tx) { return __awaiter(this, void 0, void 0, function () { diff --git a/docs/assets/js/search.js b/docs/assets/js/search.js index af7ee17..d76bf65 100644 --- a/docs/assets/js/search.js +++ b/docs/assets/js/search.js @@ -1,3 +1,3 @@ var typedoc = typedoc || {}; typedoc.search = typedoc.search || {}; - typedoc.search.data = {"kinds":{"1":"Module","32":"Variable","64":"Function","128":"Class","256":"Interface","512":"Constructor","1024":"Property","2048":"Method","65536":"Type literal","4194304":"Type alias"},"rows":[{"id":0,"kind":1,"name":"\"services/ethereum\"","url":"modules/_services_ethereum_.html","classes":"tsd-kind-module"},{"id":1,"kind":256,"name":"ethI","url":"interfaces/_services_ethereum_.ethi.html","classes":"tsd-kind-interface tsd-parent-kind-module","parent":"\"services/ethereum\""},{"id":2,"kind":1024,"name":"send","url":"interfaces/_services_ethereum_.ethi.html#send","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"services/ethereum\".ethI"},{"id":3,"kind":1024,"name":"web3_sha3","url":"interfaces/_services_ethereum_.ethi.html#web3_sha3","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"services/ethereum\".ethI"},{"id":4,"kind":65536,"name":"__type","url":"interfaces/_services_ethereum_.ethi.html#web3_sha3.__type-3","classes":"tsd-kind-type-literal tsd-parent-kind-property","parent":"\"services/ethereum\".ethI.web3_sha3"},{"id":5,"kind":1024,"name":"getTransactionReceipt","url":"interfaces/_services_ethereum_.ethi.html#gettransactionreceipt","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"services/ethereum\".ethI"},{"id":6,"kind":65536,"name":"__type","url":"interfaces/_services_ethereum_.ethi.html#gettransactionreceipt.__type-2","classes":"tsd-kind-type-literal tsd-parent-kind-property","parent":"\"services/ethereum\".ethI.getTransactionReceipt"},{"id":7,"kind":1024,"name":"getTransactionByHash","url":"interfaces/_services_ethereum_.ethi.html#gettransactionbyhash","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"services/ethereum\".ethI"},{"id":8,"kind":65536,"name":"__type","url":"interfaces/_services_ethereum_.ethi.html#gettransactionbyhash.__type-1","classes":"tsd-kind-type-literal tsd-parent-kind-property","parent":"\"services/ethereum\".ethI.getTransactionByHash"},{"id":9,"kind":1024,"name":"contract","url":"interfaces/_services_ethereum_.ethi.html#contract","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"services/ethereum\".ethI"},{"id":10,"kind":65536,"name":"__type","url":"interfaces/_services_ethereum_.ethi.html#contract.__type","classes":"tsd-kind-type-literal tsd-parent-kind-property","parent":"\"services/ethereum\".ethI.contract"},{"id":11,"kind":1024,"name":"sendRawTransaction","url":"interfaces/_services_ethereum_.ethi.html#sendrawtransaction","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"services/ethereum\".ethI"},{"id":12,"kind":1024,"name":"getTransactionCount","url":"interfaces/_services_ethereum_.ethi.html#gettransactioncount","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"services/ethereum\".ethI"},{"id":13,"kind":1024,"name":"abi","url":"interfaces/_services_ethereum_.ethi.html#abi","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"services/ethereum\".ethI"},{"id":14,"kind":256,"name":"Events","url":"interfaces/_services_ethereum_.events.html","classes":"tsd-kind-interface tsd-parent-kind-module","parent":"\"services/ethereum\""},{"id":15,"kind":1024,"name":"txHash","url":"interfaces/_services_ethereum_.events.html#txhash","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"services/ethereum\".Events"},{"id":16,"kind":1024,"name":"status","url":"interfaces/_services_ethereum_.events.html#status","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"services/ethereum\".Events"},{"id":17,"kind":1024,"name":"events","url":"interfaces/_services_ethereum_.events.html#events","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"services/ethereum\".Events"},{"id":18,"kind":32,"name":"ZERO_ADDRESS","url":"modules/_services_ethereum_.html#zero_address","classes":"tsd-kind-variable tsd-parent-kind-module","parent":"\"services/ethereum\""},{"id":19,"kind":64,"name":"executeAndRetry","url":"modules/_services_ethereum_.html#executeandretry","classes":"tsd-kind-function tsd-parent-kind-module","parent":"\"services/ethereum\""},{"id":20,"kind":64,"name":"waitAndReturnEvents","url":"modules/_services_ethereum_.html#waitandreturnevents","classes":"tsd-kind-function tsd-parent-kind-module","parent":"\"services/ethereum\""},{"id":21,"kind":64,"name":"waitForTransaction","url":"modules/_services_ethereum_.html#waitfortransaction","classes":"tsd-kind-function tsd-parent-kind-module","parent":"\"services/ethereum\""},{"id":22,"kind":64,"name":"findEvent","url":"modules/_services_ethereum_.html#findevent","classes":"tsd-kind-function tsd-parent-kind-module","parent":"\"services/ethereum\""},{"id":23,"kind":1,"name":"\"Tinlake\"","url":"modules/_tinlake_.html","classes":"tsd-kind-module"},{"id":24,"kind":128,"name":"Tinlake","url":"classes/_tinlake_.tinlake.html","classes":"tsd-kind-class tsd-parent-kind-module","parent":"\"Tinlake\""},{"id":25,"kind":1024,"name":"provider","url":"classes/_tinlake_.tinlake.html#provider","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":26,"kind":1024,"name":"eth","url":"classes/_tinlake_.tinlake.html#eth","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":27,"kind":1024,"name":"ethOptions","url":"classes/_tinlake_.tinlake.html#ethoptions","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":28,"kind":1024,"name":"ethConfig","url":"classes/_tinlake_.tinlake.html#ethconfig","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":29,"kind":1024,"name":"ethersConfig","url":"classes/_tinlake_.tinlake.html#ethersconfig","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":30,"kind":1024,"name":"contractAddresses","url":"classes/_tinlake_.tinlake.html#contractaddresses","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":31,"kind":1024,"name":"transactionTimeout","url":"classes/_tinlake_.tinlake.html#transactiontimeout","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":32,"kind":1024,"name":"contracts","url":"classes/_tinlake_.tinlake.html#contracts","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":33,"kind":1024,"name":"contractAbis","url":"classes/_tinlake_.tinlake.html#contractabis","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":34,"kind":1024,"name":"contractConfig","url":"classes/_tinlake_.tinlake.html#contractconfig","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":35,"kind":512,"name":"constructor","url":"classes/_tinlake_.tinlake.html#constructor","classes":"tsd-kind-constructor tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":36,"kind":2048,"name":"setProvider","url":"classes/_tinlake_.tinlake.html#setprovider","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":37,"kind":2048,"name":"setContracts","url":"classes/_tinlake_.tinlake.html#setcontracts","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":38,"kind":2048,"name":"setEthConfig","url":"classes/_tinlake_.tinlake.html#setethconfig","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":39,"kind":2048,"name":"setEthersConfig","url":"classes/_tinlake_.tinlake.html#setethersconfig","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":40,"kind":2048,"name":"createContract","url":"classes/_tinlake_.tinlake.html#createcontract","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":41,"kind":2048,"name":"getContract","url":"classes/_tinlake_.tinlake.html#getcontract","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":42,"kind":2048,"name":"getTransactionReceipt","url":"classes/_tinlake_.tinlake.html#gettransactionreceipt","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":43,"kind":2048,"name":"getOperatorType","url":"classes/_tinlake_.tinlake.html#getoperatortype","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":44,"kind":4194304,"name":"PendingTransaction","url":"modules/_tinlake_.html#pendingtransaction","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"Tinlake\""},{"id":45,"kind":65536,"name":"__type","url":"modules/_tinlake_.html#pendingtransaction.__type-7","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"Tinlake\".PendingTransaction"},{"id":46,"kind":32,"name":"hash","url":"modules/_tinlake_.html#pendingtransaction.__type-7.hash","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".PendingTransaction.__type"},{"id":47,"kind":32,"name":"contractKey","url":"modules/_tinlake_.html#pendingtransaction.__type-7.contractkey","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".PendingTransaction.__type"},{"id":48,"kind":32,"name":"timesOutAt","url":"modules/_tinlake_.html#pendingtransaction.__type-7.timesoutat","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".PendingTransaction.__type"},{"id":49,"kind":4194304,"name":"EthConfig","url":"modules/_tinlake_.html#ethconfig","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"Tinlake\""},{"id":50,"kind":65536,"name":"__type","url":"modules/_tinlake_.html#ethconfig.__type-4","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"Tinlake\".EthConfig"},{"id":51,"kind":32,"name":"from","url":"modules/_tinlake_.html#ethconfig.__type-4.from","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".EthConfig.__type"},{"id":52,"kind":32,"name":"gasPrice","url":"modules/_tinlake_.html#ethconfig.__type-4.gasprice","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".EthConfig.__type"},{"id":53,"kind":32,"name":"gas","url":"modules/_tinlake_.html#ethconfig.__type-4.gas","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".EthConfig.__type"},{"id":54,"kind":4194304,"name":"EthersOverrides","url":"modules/_tinlake_.html#ethersoverrides","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"Tinlake\""},{"id":55,"kind":65536,"name":"__type","url":"modules/_tinlake_.html#ethersoverrides.__type-6","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"Tinlake\".EthersOverrides"},{"id":56,"kind":32,"name":"gasPrice","url":"modules/_tinlake_.html#ethersoverrides.__type-6.gasprice-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".EthersOverrides.__type"},{"id":57,"kind":32,"name":"gasLimit","url":"modules/_tinlake_.html#ethersoverrides.__type-6.gaslimit","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".EthersOverrides.__type"},{"id":58,"kind":4194304,"name":"EthersConfig","url":"modules/_tinlake_.html#ethersconfig","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"Tinlake\""},{"id":59,"kind":65536,"name":"__type","url":"modules/_tinlake_.html#ethersconfig.__type-5","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"Tinlake\".EthersConfig"},{"id":60,"kind":32,"name":"provider","url":"modules/_tinlake_.html#ethersconfig.__type-5.provider","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".EthersConfig.__type"},{"id":61,"kind":32,"name":"signer","url":"modules/_tinlake_.html#ethersconfig.__type-5.signer","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".EthersConfig.__type"},{"id":62,"kind":32,"name":"overrides","url":"modules/_tinlake_.html#ethersconfig.__type-5.overrides","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".EthersConfig.__type"},{"id":63,"kind":4194304,"name":"ContractNames","url":"modules/_tinlake_.html#contractnames","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"Tinlake\""},{"id":64,"kind":4194304,"name":"Contracts","url":"modules/_tinlake_.html#contracts","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"Tinlake\""},{"id":65,"kind":65536,"name":"__type","url":"modules/_tinlake_.html#contracts.__type-3","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"Tinlake\".Contracts"},{"id":66,"kind":4194304,"name":"ContractAbis","url":"modules/_tinlake_.html#contractabis","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"Tinlake\""},{"id":67,"kind":65536,"name":"__type","url":"modules/_tinlake_.html#contractabis.__type-1","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"Tinlake\".ContractAbis"},{"id":68,"kind":4194304,"name":"ContractAddresses","url":"modules/_tinlake_.html#contractaddresses","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"Tinlake\""},{"id":69,"kind":65536,"name":"__type","url":"modules/_tinlake_.html#contractaddresses.__type-2","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"Tinlake\".ContractAddresses"},{"id":70,"kind":4194304,"name":"TinlakeParams","url":"modules/_tinlake_.html#tinlakeparams","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"Tinlake\""},{"id":71,"kind":65536,"name":"__type","url":"modules/_tinlake_.html#tinlakeparams.__type-8","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"Tinlake\".TinlakeParams"},{"id":72,"kind":32,"name":"provider","url":"modules/_tinlake_.html#tinlakeparams.__type-8.provider-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".TinlakeParams.__type"},{"id":73,"kind":32,"name":"transactionTimeout","url":"modules/_tinlake_.html#tinlakeparams.__type-8.transactiontimeout","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".TinlakeParams.__type"},{"id":74,"kind":32,"name":"contractAddresses","url":"modules/_tinlake_.html#tinlakeparams.__type-8.contractaddresses-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".TinlakeParams.__type"},{"id":75,"kind":32,"name":"contractAbis","url":"modules/_tinlake_.html#tinlakeparams.__type-8.contractabis-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".TinlakeParams.__type"},{"id":76,"kind":32,"name":"ethConfig","url":"modules/_tinlake_.html#tinlakeparams.__type-8.ethconfig-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".TinlakeParams.__type"},{"id":77,"kind":32,"name":"ethersConfig","url":"modules/_tinlake_.html#tinlakeparams.__type-8.ethersconfig-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".TinlakeParams.__type"},{"id":78,"kind":32,"name":"ethOptions","url":"modules/_tinlake_.html#tinlakeparams.__type-8.ethoptions","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".TinlakeParams.__type"},{"id":79,"kind":32,"name":"contracts","url":"modules/_tinlake_.html#tinlakeparams.__type-8.contracts-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".TinlakeParams.__type"},{"id":80,"kind":32,"name":"contractConfig","url":"modules/_tinlake_.html#tinlakeparams.__type-8.contractconfig","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".TinlakeParams.__type"},{"id":81,"kind":4194304,"name":"Constructor","url":"modules/_tinlake_.html#constructor","classes":"tsd-kind-type-alias tsd-parent-kind-module tsd-has-type-parameter","parent":"\"Tinlake\""},{"id":82,"kind":65536,"name":"__type","url":"modules/_tinlake_.html#constructor.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"Tinlake\".Constructor"},{"id":83,"kind":1,"name":"\"actions/admin\"","url":"modules/_actions_admin_.html","classes":"tsd-kind-module"},{"id":84,"kind":64,"name":"AdminActions","url":"modules/_actions_admin_.html#adminactions","classes":"tsd-kind-function tsd-parent-kind-module tsd-has-type-parameter","parent":"\"actions/admin\""},{"id":85,"kind":4194304,"name":"IAdminActions","url":"modules/_actions_admin_.html#iadminactions","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"actions/admin\""},{"id":86,"kind":65536,"name":"__type","url":"modules/_actions_admin_.html#iadminactions.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"actions/admin\".IAdminActions"},{"id":87,"kind":64,"name":"isWard","url":"modules/_actions_admin_.html#iadminactions.__type.isward","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":88,"kind":64,"name":"canSetInterestRate","url":"modules/_actions_admin_.html#iadminactions.__type.cansetinterestrate","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":89,"kind":64,"name":"canSetSeniorTrancheInterest","url":"modules/_actions_admin_.html#iadminactions.__type.cansetseniortrancheinterest","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":90,"kind":64,"name":"canSetMinimumJuniorRatio","url":"modules/_actions_admin_.html#iadminactions.__type.cansetminimumjuniorratio","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":91,"kind":64,"name":"canSetRiskScore","url":"modules/_actions_admin_.html#iadminactions.__type.cansetriskscore","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":92,"kind":64,"name":"canSetInvestorAllowanceJunior","url":"modules/_actions_admin_.html#iadminactions.__type.cansetinvestorallowancejunior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":93,"kind":64,"name":"canSetInvestorAllowanceSenior","url":"modules/_actions_admin_.html#iadminactions.__type.cansetinvestorallowancesenior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":94,"kind":64,"name":"canSetLoanPrice","url":"modules/_actions_admin_.html#iadminactions.__type.cansetloanprice","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":95,"kind":64,"name":"initRate","url":"modules/_actions_admin_.html#iadminactions.__type.initrate","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":96,"kind":64,"name":"setRate","url":"modules/_actions_admin_.html#iadminactions.__type.setrate","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":97,"kind":64,"name":"setMinimumJuniorRatio","url":"modules/_actions_admin_.html#iadminactions.__type.setminimumjuniorratio","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":98,"kind":64,"name":"approveAllowanceJunior","url":"modules/_actions_admin_.html#iadminactions.__type.approveallowancejunior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":99,"kind":64,"name":"approveAllowanceSenior","url":"modules/_actions_admin_.html#iadminactions.__type.approveallowancesenior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":100,"kind":1,"name":"\"actions/borrower\"","url":"modules/_actions_borrower_.html","classes":"tsd-kind-module"},{"id":101,"kind":64,"name":"BorrowerActions","url":"modules/_actions_borrower_.html#borroweractions","classes":"tsd-kind-function tsd-parent-kind-module tsd-has-type-parameter","parent":"\"actions/borrower\""},{"id":102,"kind":4194304,"name":"IBorrowerActions","url":"modules/_actions_borrower_.html#iborroweractions","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"actions/borrower\""},{"id":103,"kind":65536,"name":"__type","url":"modules/_actions_borrower_.html#iborroweractions.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"actions/borrower\".IBorrowerActions"},{"id":104,"kind":64,"name":"issue","url":"modules/_actions_borrower_.html#iborroweractions.__type.issue","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/borrower\".IBorrowerActions.__type"},{"id":105,"kind":64,"name":"nftLookup","url":"modules/_actions_borrower_.html#iborroweractions.__type.nftlookup","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/borrower\".IBorrowerActions.__type"},{"id":106,"kind":64,"name":"lock","url":"modules/_actions_borrower_.html#iborroweractions.__type.lock","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/borrower\".IBorrowerActions.__type"},{"id":107,"kind":64,"name":"unlock","url":"modules/_actions_borrower_.html#iborroweractions.__type.unlock","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/borrower\".IBorrowerActions.__type"},{"id":108,"kind":64,"name":"close","url":"modules/_actions_borrower_.html#iborroweractions.__type.close","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/borrower\".IBorrowerActions.__type"},{"id":109,"kind":64,"name":"borrow","url":"modules/_actions_borrower_.html#iborroweractions.__type.borrow","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/borrower\".IBorrowerActions.__type"},{"id":110,"kind":64,"name":"withdraw","url":"modules/_actions_borrower_.html#iborroweractions.__type.withdraw","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/borrower\".IBorrowerActions.__type"},{"id":111,"kind":64,"name":"repay","url":"modules/_actions_borrower_.html#iborroweractions.__type.repay","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/borrower\".IBorrowerActions.__type"},{"id":112,"kind":1,"name":"\"actions/lender\"","url":"modules/_actions_lender_.html","classes":"tsd-kind-module"},{"id":113,"kind":64,"name":"LenderActions","url":"modules/_actions_lender_.html#lenderactions","classes":"tsd-kind-function tsd-parent-kind-module tsd-has-type-parameter","parent":"\"actions/lender\""},{"id":114,"kind":4194304,"name":"ILenderActions","url":"modules/_actions_lender_.html#ilenderactions","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"actions/lender\""},{"id":115,"kind":65536,"name":"__type","url":"modules/_actions_lender_.html#ilenderactions.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"actions/lender\".ILenderActions"},{"id":116,"kind":64,"name":"getSeniorTokenAllowance","url":"modules/_actions_lender_.html#ilenderactions.__type.getseniortokenallowance","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/lender\".ILenderActions.__type"},{"id":117,"kind":64,"name":"getJuniorTokenAllowance","url":"modules/_actions_lender_.html#ilenderactions.__type.getjuniortokenallowance","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/lender\".ILenderActions.__type"},{"id":118,"kind":64,"name":"supplyJunior","url":"modules/_actions_lender_.html#ilenderactions.__type.supplyjunior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/lender\".ILenderActions.__type"},{"id":119,"kind":32,"name":"approveJuniorToken","url":"modules/_actions_lender_.html#ilenderactions.__type.approvejuniortoken","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"actions/lender\".ILenderActions.__type"},{"id":120,"kind":65536,"name":"__type","url":"modules/_actions_lender_.html#ilenderactions.__type.approvejuniortoken.__type-1","classes":"tsd-kind-type-literal tsd-parent-kind-variable","parent":"\"actions/lender\".ILenderActions.__type.approveJuniorToken"},{"id":121,"kind":32,"name":"approveSeniorToken","url":"modules/_actions_lender_.html#ilenderactions.__type.approveseniortoken","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"actions/lender\".ILenderActions.__type"},{"id":122,"kind":65536,"name":"__type","url":"modules/_actions_lender_.html#ilenderactions.__type.approveseniortoken.__type-2","classes":"tsd-kind-type-literal tsd-parent-kind-variable","parent":"\"actions/lender\".ILenderActions.__type.approveSeniorToken"},{"id":123,"kind":64,"name":"redeemJunior","url":"modules/_actions_lender_.html#ilenderactions.__type.redeemjunior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/lender\".ILenderActions.__type"},{"id":124,"kind":64,"name":"supplySenior","url":"modules/_actions_lender_.html#ilenderactions.__type.supplysenior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/lender\".ILenderActions.__type"},{"id":125,"kind":64,"name":"redeemSenior","url":"modules/_actions_lender_.html#ilenderactions.__type.redeemsenior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/lender\".ILenderActions.__type"},{"id":126,"kind":64,"name":"balance","url":"modules/_actions_lender_.html#ilenderactions.__type.balance","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/lender\".ILenderActions.__type"},{"id":127,"kind":1,"name":"\"actions/currency\"","url":"modules/_actions_currency_.html","classes":"tsd-kind-module"},{"id":128,"kind":64,"name":"CurrencyActions","url":"modules/_actions_currency_.html#currencyactions","classes":"tsd-kind-function tsd-parent-kind-module tsd-has-type-parameter","parent":"\"actions/currency\""},{"id":129,"kind":4194304,"name":"ICurrencyActions","url":"modules/_actions_currency_.html#icurrencyactions","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"actions/currency\""},{"id":130,"kind":65536,"name":"__type","url":"modules/_actions_currency_.html#icurrencyactions.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"actions/currency\".ICurrencyActions"},{"id":131,"kind":64,"name":"mintCurrency","url":"modules/_actions_currency_.html#icurrencyactions.__type.mintcurrency","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/currency\".ICurrencyActions.__type"},{"id":132,"kind":64,"name":"getCurrencyBalance","url":"modules/_actions_currency_.html#icurrencyactions.__type.getcurrencybalance","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/currency\".ICurrencyActions.__type"},{"id":133,"kind":64,"name":"approveCurrency","url":"modules/_actions_currency_.html#icurrencyactions.__type.approvecurrency","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/currency\".ICurrencyActions.__type"},{"id":134,"kind":32,"name":"getCurrencyAllowance","url":"modules/_actions_currency_.html#icurrencyactions.__type.getcurrencyallowance","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"actions/currency\".ICurrencyActions.__type"},{"id":135,"kind":65536,"name":"__type","url":"modules/_actions_currency_.html#icurrencyactions.__type.getcurrencyallowance.__type-3","classes":"tsd-kind-type-literal tsd-parent-kind-variable","parent":"\"actions/currency\".ICurrencyActions.__type.getCurrencyAllowance"},{"id":136,"kind":32,"name":"getJuniorForCurrencyAllowance","url":"modules/_actions_currency_.html#icurrencyactions.__type.getjuniorforcurrencyallowance","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"actions/currency\".ICurrencyActions.__type"},{"id":137,"kind":65536,"name":"__type","url":"modules/_actions_currency_.html#icurrencyactions.__type.getjuniorforcurrencyallowance.__type-4","classes":"tsd-kind-type-literal tsd-parent-kind-variable","parent":"\"actions/currency\".ICurrencyActions.__type.getJuniorForCurrencyAllowance"},{"id":138,"kind":32,"name":"getSeniorForCurrencyAllowance","url":"modules/_actions_currency_.html#icurrencyactions.__type.getseniorforcurrencyallowance","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"actions/currency\".ICurrencyActions.__type"},{"id":139,"kind":65536,"name":"__type","url":"modules/_actions_currency_.html#icurrencyactions.__type.getseniorforcurrencyallowance.__type-5","classes":"tsd-kind-type-literal tsd-parent-kind-variable","parent":"\"actions/currency\".ICurrencyActions.__type.getSeniorForCurrencyAllowance"},{"id":140,"kind":32,"name":"approveSeniorForCurrency","url":"modules/_actions_currency_.html#icurrencyactions.__type.approveseniorforcurrency","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"actions/currency\".ICurrencyActions.__type"},{"id":141,"kind":65536,"name":"__type","url":"modules/_actions_currency_.html#icurrencyactions.__type.approveseniorforcurrency.__type-2","classes":"tsd-kind-type-literal tsd-parent-kind-variable","parent":"\"actions/currency\".ICurrencyActions.__type.approveSeniorForCurrency"},{"id":142,"kind":32,"name":"approveJuniorForCurrency","url":"modules/_actions_currency_.html#icurrencyactions.__type.approvejuniorforcurrency","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"actions/currency\".ICurrencyActions.__type"},{"id":143,"kind":65536,"name":"__type","url":"modules/_actions_currency_.html#icurrencyactions.__type.approvejuniorforcurrency.__type-1","classes":"tsd-kind-type-literal tsd-parent-kind-variable","parent":"\"actions/currency\".ICurrencyActions.__type.approveJuniorForCurrency"},{"id":144,"kind":1,"name":"\"actions/collateral\"","url":"modules/_actions_collateral_.html","classes":"tsd-kind-module"},{"id":145,"kind":64,"name":"CollateralActions","url":"modules/_actions_collateral_.html#collateralactions","classes":"tsd-kind-function tsd-parent-kind-module tsd-has-type-parameter","parent":"\"actions/collateral\""},{"id":146,"kind":4194304,"name":"ICollateralActions","url":"modules/_actions_collateral_.html#icollateralactions","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"actions/collateral\""},{"id":147,"kind":65536,"name":"__type","url":"modules/_actions_collateral_.html#icollateralactions.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"actions/collateral\".ICollateralActions"},{"id":148,"kind":64,"name":"mintTitleNFT","url":"modules/_actions_collateral_.html#icollateralactions.__type.minttitlenft","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/collateral\".ICollateralActions.__type"},{"id":149,"kind":64,"name":"mintNFT","url":"modules/_actions_collateral_.html#icollateralactions.__type.mintnft","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/collateral\".ICollateralActions.__type"},{"id":150,"kind":64,"name":"approveNFT","url":"modules/_actions_collateral_.html#icollateralactions.__type.approvenft","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/collateral\".ICollateralActions.__type"},{"id":151,"kind":64,"name":"setNFTApprovalForAll","url":"modules/_actions_collateral_.html#icollateralactions.__type.setnftapprovalforall","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/collateral\".ICollateralActions.__type"},{"id":152,"kind":64,"name":"isNFTApprovedForAll","url":"modules/_actions_collateral_.html#icollateralactions.__type.isnftapprovedforall","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/collateral\".ICollateralActions.__type"},{"id":153,"kind":64,"name":"getNFTCount","url":"modules/_actions_collateral_.html#icollateralactions.__type.getnftcount","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/collateral\".ICollateralActions.__type"},{"id":154,"kind":64,"name":"getNFTData","url":"modules/_actions_collateral_.html#icollateralactions.__type.getnftdata","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/collateral\".ICollateralActions.__type"},{"id":155,"kind":64,"name":"getNFTOwner","url":"modules/_actions_collateral_.html#icollateralactions.__type.getnftowner","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/collateral\".ICollateralActions.__type"},{"id":156,"kind":64,"name":"transferNFT","url":"modules/_actions_collateral_.html#icollateralactions.__type.transfernft","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/collateral\".ICollateralActions.__type"},{"id":157,"kind":1,"name":"\"actions/governance\"","url":"modules/_actions_governance_.html","classes":"tsd-kind-module"},{"id":158,"kind":4194304,"name":"IGovernanceActions","url":"modules/_actions_governance_.html#igovernanceactions","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"actions/governance\""},{"id":159,"kind":65536,"name":"__type","url":"modules/_actions_governance_.html#igovernanceactions.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"actions/governance\".IGovernanceActions"},{"id":160,"kind":64,"name":"relyAddress","url":"modules/_actions_governance_.html#igovernanceactions.__type.relyaddress","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/governance\".IGovernanceActions.__type"},{"id":161,"kind":1,"name":"\"actions/proxy\"","url":"modules/_actions_proxy_.html","classes":"tsd-kind-module"},{"id":162,"kind":64,"name":"ProxyActions","url":"modules/_actions_proxy_.html#proxyactions","classes":"tsd-kind-function tsd-parent-kind-module tsd-has-type-parameter","parent":"\"actions/proxy\""},{"id":163,"kind":4194304,"name":"IProxyActions","url":"modules/_actions_proxy_.html#iproxyactions","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"actions/proxy\""},{"id":164,"kind":65536,"name":"__type","url":"modules/_actions_proxy_.html#iproxyactions.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"actions/proxy\".IProxyActions"},{"id":165,"kind":64,"name":"buildProxy","url":"modules/_actions_proxy_.html#iproxyactions.__type.buildproxy","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":166,"kind":64,"name":"checkProxyExists","url":"modules/_actions_proxy_.html#iproxyactions.__type.checkproxyexists","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":167,"kind":64,"name":"getProxy","url":"modules/_actions_proxy_.html#iproxyactions.__type.getproxy","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":168,"kind":64,"name":"proxyCount","url":"modules/_actions_proxy_.html#iproxyactions.__type.proxycount","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":169,"kind":64,"name":"getProxyAccessToken","url":"modules/_actions_proxy_.html#iproxyactions.__type.getproxyaccesstoken","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":170,"kind":64,"name":"getProxyAccessTokenOwner","url":"modules/_actions_proxy_.html#iproxyactions.__type.getproxyaccesstokenowner","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":171,"kind":64,"name":"getProxyOwnerByLoan","url":"modules/_actions_proxy_.html#iproxyactions.__type.getproxyownerbyloan","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":172,"kind":64,"name":"getProxyOwnerByAddress","url":"modules/_actions_proxy_.html#iproxyactions.__type.getproxyownerbyaddress","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":173,"kind":64,"name":"proxyCreateNew","url":"modules/_actions_proxy_.html#iproxyactions.__type.proxycreatenew","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":174,"kind":64,"name":"proxyIssue","url":"modules/_actions_proxy_.html#iproxyactions.__type.proxyissue","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":175,"kind":64,"name":"proxyTransferIssue","url":"modules/_actions_proxy_.html#iproxyactions.__type.proxytransferissue","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":176,"kind":64,"name":"proxyLockBorrowWithdraw","url":"modules/_actions_proxy_.html#iproxyactions.__type.proxylockborrowwithdraw","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":177,"kind":64,"name":"proxyRepayUnlockClose","url":"modules/_actions_proxy_.html#iproxyactions.__type.proxyrepayunlockclose","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":178,"kind":1,"name":"\"actions/index\"","url":"modules/_actions_index_.html","classes":"tsd-kind-module"},{"id":179,"kind":4194304,"name":"TinlakeActions","url":"modules/_actions_index_.html#tinlakeactions","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"actions/index\""},{"id":180,"kind":1,"name":"\"types/tinlake\"","url":"modules/_types_tinlake_.html","classes":"tsd-kind-module"},{"id":181,"kind":4194304,"name":"Loan","url":"modules/_types_tinlake_.html#loan","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"types/tinlake\""},{"id":182,"kind":65536,"name":"__type","url":"modules/_types_tinlake_.html#loan.__type-3","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"types/tinlake\".Loan"},{"id":183,"kind":32,"name":"loanId","url":"modules/_types_tinlake_.html#loan.__type-3.loanid","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":184,"kind":32,"name":"registry","url":"modules/_types_tinlake_.html#loan.__type-3.registry","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":185,"kind":32,"name":"tokenId","url":"modules/_types_tinlake_.html#loan.__type-3.tokenid","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":186,"kind":32,"name":"ownerOf","url":"modules/_types_tinlake_.html#loan.__type-3.ownerof","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":187,"kind":32,"name":"principal","url":"modules/_types_tinlake_.html#loan.__type-3.principal","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":188,"kind":32,"name":"interestRate","url":"modules/_types_tinlake_.html#loan.__type-3.interestrate","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":189,"kind":32,"name":"debt","url":"modules/_types_tinlake_.html#loan.__type-3.debt","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":190,"kind":32,"name":"threshold","url":"modules/_types_tinlake_.html#loan.__type-3.threshold","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":191,"kind":32,"name":"price","url":"modules/_types_tinlake_.html#loan.__type-3.price","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":192,"kind":32,"name":"status","url":"modules/_types_tinlake_.html#loan.__type-3.status","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":193,"kind":32,"name":"nft","url":"modules/_types_tinlake_.html#loan.__type-3.nft","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":194,"kind":32,"name":"proxyOwner","url":"modules/_types_tinlake_.html#loan.__type-3.proxyowner","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":195,"kind":4194304,"name":"Tranche","url":"modules/_types_tinlake_.html#tranche","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"types/tinlake\""},{"id":196,"kind":65536,"name":"__type","url":"modules/_types_tinlake_.html#tranche.__type-5","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"types/tinlake\".Tranche"},{"id":197,"kind":32,"name":"availableFunds","url":"modules/_types_tinlake_.html#tranche.__type-5.availablefunds","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Tranche.__type"},{"id":198,"kind":32,"name":"tokenPrice","url":"modules/_types_tinlake_.html#tranche.__type-5.tokenprice","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Tranche.__type"},{"id":199,"kind":32,"name":"type","url":"modules/_types_tinlake_.html#tranche.__type-5.type","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Tranche.__type"},{"id":200,"kind":32,"name":"token","url":"modules/_types_tinlake_.html#tranche.__type-5.token","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Tranche.__type"},{"id":201,"kind":32,"name":"totalSupply","url":"modules/_types_tinlake_.html#tranche.__type-5.totalsupply","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Tranche.__type"},{"id":202,"kind":32,"name":"interestRate","url":"modules/_types_tinlake_.html#tranche.__type-5.interestrate-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Tranche.__type"},{"id":203,"kind":4194304,"name":"NFT","url":"modules/_types_tinlake_.html#nft-1","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"types/tinlake\""},{"id":204,"kind":65536,"name":"__type","url":"modules/_types_tinlake_.html#nft-1.__type-4","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"types/tinlake\".NFT"},{"id":205,"kind":32,"name":"registry","url":"modules/_types_tinlake_.html#nft-1.__type-4.registry-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".NFT.__type"},{"id":206,"kind":32,"name":"tokenId","url":"modules/_types_tinlake_.html#nft-1.__type-4.tokenid-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".NFT.__type"},{"id":207,"kind":32,"name":"nftOwner","url":"modules/_types_tinlake_.html#nft-1.__type-4.nftowner","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".NFT.__type"},{"id":208,"kind":32,"name":"nftData","url":"modules/_types_tinlake_.html#nft-1.__type-4.nftdata","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".NFT.__type"},{"id":209,"kind":4194304,"name":"Investor","url":"modules/_types_tinlake_.html#investor","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"types/tinlake\""},{"id":210,"kind":65536,"name":"__type","url":"modules/_types_tinlake_.html#investor.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"types/tinlake\".Investor"},{"id":211,"kind":32,"name":"junior","url":"modules/_types_tinlake_.html#investor.__type.junior","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Investor.__type"},{"id":212,"kind":65536,"name":"__type","url":"modules/_types_tinlake_.html#investor.__type.junior.__type-1","classes":"tsd-kind-type-literal tsd-parent-kind-variable","parent":"\"types/tinlake\".Investor.__type.junior"},{"id":213,"kind":32,"name":"maxSupply","url":"modules/_types_tinlake_.html#investor.__type.junior.__type-1.maxsupply","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Investor.__type.junior.__type"},{"id":214,"kind":32,"name":"tokenBalance","url":"modules/_types_tinlake_.html#investor.__type.junior.__type-1.tokenbalance","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Investor.__type.junior.__type"},{"id":215,"kind":32,"name":"maxRedeem","url":"modules/_types_tinlake_.html#investor.__type.junior.__type-1.maxredeem","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Investor.__type.junior.__type"},{"id":216,"kind":32,"name":"senior","url":"modules/_types_tinlake_.html#investor.__type.senior","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Investor.__type"},{"id":217,"kind":65536,"name":"__type","url":"modules/_types_tinlake_.html#investor.__type.senior.__type-2","classes":"tsd-kind-type-literal tsd-parent-kind-variable","parent":"\"types/tinlake\".Investor.__type.senior"},{"id":218,"kind":32,"name":"maxSupply","url":"modules/_types_tinlake_.html#investor.__type.senior.__type-2.maxsupply-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Investor.__type.senior.__type"},{"id":219,"kind":32,"name":"tokenBalance","url":"modules/_types_tinlake_.html#investor.__type.senior.__type-2.tokenbalance-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Investor.__type.senior.__type"},{"id":220,"kind":32,"name":"maxRedeem","url":"modules/_types_tinlake_.html#investor.__type.senior.__type-2.maxredeem-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Investor.__type.senior.__type"},{"id":221,"kind":32,"name":"address","url":"modules/_types_tinlake_.html#investor.__type.address","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Investor.__type"},{"id":222,"kind":4194304,"name":"ITinlake","url":"modules/_types_tinlake_.html#itinlake","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"types/tinlake\""},{"id":223,"kind":1,"name":"\"actions/analytics\"","url":"modules/_actions_analytics_.html","classes":"tsd-kind-module"},{"id":224,"kind":64,"name":"AnalyticsActions","url":"modules/_actions_analytics_.html#analyticsactions","classes":"tsd-kind-function tsd-parent-kind-module tsd-has-type-parameter","parent":"\"actions/analytics\""},{"id":225,"kind":4194304,"name":"IAnalyticsActions","url":"modules/_actions_analytics_.html#ianalyticsactions","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"actions/analytics\""},{"id":226,"kind":65536,"name":"__type","url":"modules/_actions_analytics_.html#ianalyticsactions.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"actions/analytics\".IAnalyticsActions"},{"id":227,"kind":64,"name":"getTotalDebt","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.gettotaldebt","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":228,"kind":64,"name":"getTotalBalance","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.gettotalbalance","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":229,"kind":64,"name":"getDebt","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getdebt","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":230,"kind":64,"name":"loanCount","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.loancount","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":231,"kind":64,"name":"getLoanList","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getloanlist","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":232,"kind":64,"name":"getLoan","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getloan","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":233,"kind":64,"name":"getCollateral","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getcollateral","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":234,"kind":64,"name":"getPrincipal","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getprincipal","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":235,"kind":64,"name":"getInterestRate","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getinterestrate","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":236,"kind":64,"name":"getOwnerOfLoan","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getownerofloan","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":237,"kind":64,"name":"getOwnerOfCollateral","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getownerofcollateral","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":238,"kind":64,"name":"existsSenior","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.existssenior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":239,"kind":64,"name":"getJuniorReserve","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getjuniorreserve","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":240,"kind":64,"name":"getSeniorReserve","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getseniorreserve","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":241,"kind":64,"name":"getJuniorTokenBalance","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getjuniortokenbalance","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":242,"kind":64,"name":"getSeniorTokenBalance","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getseniortokenbalance","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":243,"kind":64,"name":"getMaxSupplyAmountJunior","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getmaxsupplyamountjunior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":244,"kind":64,"name":"getMaxRedeemAmountJunior","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getmaxredeemamountjunior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":245,"kind":64,"name":"getMaxSupplyAmountSenior","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getmaxsupplyamountsenior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":246,"kind":64,"name":"getMaxRedeemAmountSenior","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getmaxredeemamountsenior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":247,"kind":64,"name":"getTokenPriceJunior","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.gettokenpricejunior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":248,"kind":64,"name":"getTokenPriceSenior","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.gettokenpricesenior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":249,"kind":64,"name":"getSeniorDebt","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getseniordebt","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":250,"kind":64,"name":"getSeniorInterestRate","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getseniorinterestrate","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":251,"kind":64,"name":"getMinJuniorRatio","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getminjuniorratio","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":252,"kind":64,"name":"getCurrentJuniorRatio","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getcurrentjuniorratio","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":253,"kind":64,"name":"getAssetValueJunior","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getassetvaluejunior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":254,"kind":64,"name":"getInvestor","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getinvestor","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":255,"kind":1,"name":"\"utils/baseToDisplay\"","url":"modules/_utils_basetodisplay_.html","classes":"tsd-kind-module"},{"id":256,"kind":64,"name":"baseToDisplay","url":"modules/_utils_basetodisplay_.html#basetodisplay","classes":"tsd-kind-function tsd-parent-kind-module","parent":"\"utils/baseToDisplay\""},{"id":257,"kind":1,"name":"\"utils/baseToDisplay.spec\"","url":"modules/_utils_basetodisplay_spec_.html","classes":"tsd-kind-module"},{"id":258,"kind":1,"name":"\"utils/bnToHex\"","url":"modules/_utils_bntohex_.html","classes":"tsd-kind-module"},{"id":259,"kind":64,"name":"bnToHex","url":"modules/_utils_bntohex_.html#bntohex","classes":"tsd-kind-function tsd-parent-kind-module","parent":"\"utils/bnToHex\""},{"id":260,"kind":1,"name":"\"utils/bnToHex.spec\"","url":"modules/_utils_bntohex_spec_.html","classes":"tsd-kind-module"},{"id":261,"kind":1,"name":"\"utils/displayToBase\"","url":"modules/_utils_displaytobase_.html","classes":"tsd-kind-module"},{"id":262,"kind":64,"name":"displayToBase","url":"modules/_utils_displaytobase_.html#displaytobase","classes":"tsd-kind-function tsd-parent-kind-module","parent":"\"utils/displayToBase\""},{"id":263,"kind":1,"name":"\"utils/displayToBase.spec\"","url":"modules/_utils_displaytobase_spec_.html","classes":"tsd-kind-module"},{"id":264,"kind":1,"name":"\"utils/feeToInterestRate\"","url":"modules/_utils_feetointerestrate_.html","classes":"tsd-kind-module"},{"id":265,"kind":64,"name":"feeToInterestRate","url":"modules/_utils_feetointerestrate_.html#feetointerestrate","classes":"tsd-kind-function tsd-parent-kind-module","parent":"\"utils/feeToInterestRate\""},{"id":266,"kind":1,"name":"\"utils/feeToInterestRate.spec\"","url":"modules/_utils_feetointerestrate_spec_.html","classes":"tsd-kind-module"},{"id":267,"kind":1,"name":"\"utils/getLoanStatus\"","url":"modules/_utils_getloanstatus_.html","classes":"tsd-kind-module"},{"id":268,"kind":4194304,"name":"LoanStatus","url":"modules/_utils_getloanstatus_.html#loanstatus","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"utils/getLoanStatus\""},{"id":269,"kind":64,"name":"getLoanStatus","url":"modules/_utils_getloanstatus_.html#getloanstatus","classes":"tsd-kind-function tsd-parent-kind-module","parent":"\"utils/getLoanStatus\""},{"id":270,"kind":1,"name":"\"utils/interestRateToFee\"","url":"modules/_utils_interestratetofee_.html","classes":"tsd-kind-module"},{"id":271,"kind":64,"name":"interestRateToFee","url":"modules/_utils_interestratetofee_.html#interestratetofee","classes":"tsd-kind-function tsd-parent-kind-module","parent":"\"utils/interestRateToFee\""},{"id":272,"kind":1,"name":"\"utils/interestRateToFee.spec\"","url":"modules/_utils_interestratetofee_spec_.html","classes":"tsd-kind-module"}]}; \ No newline at end of file + typedoc.search.data = {"kinds":{"1":"Module","32":"Variable","64":"Function","128":"Class","256":"Interface","512":"Constructor","1024":"Property","2048":"Method","65536":"Type literal","4194304":"Type alias"},"rows":[{"id":0,"kind":1,"name":"\"services/ethereum\"","url":"modules/_services_ethereum_.html","classes":"tsd-kind-module"},{"id":1,"kind":256,"name":"ethI","url":"interfaces/_services_ethereum_.ethi.html","classes":"tsd-kind-interface tsd-parent-kind-module","parent":"\"services/ethereum\""},{"id":2,"kind":1024,"name":"send","url":"interfaces/_services_ethereum_.ethi.html#send","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"services/ethereum\".ethI"},{"id":3,"kind":1024,"name":"web3_sha3","url":"interfaces/_services_ethereum_.ethi.html#web3_sha3","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"services/ethereum\".ethI"},{"id":4,"kind":65536,"name":"__type","url":"interfaces/_services_ethereum_.ethi.html#web3_sha3.__type-3","classes":"tsd-kind-type-literal tsd-parent-kind-property","parent":"\"services/ethereum\".ethI.web3_sha3"},{"id":5,"kind":1024,"name":"getTransactionReceipt","url":"interfaces/_services_ethereum_.ethi.html#gettransactionreceipt","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"services/ethereum\".ethI"},{"id":6,"kind":65536,"name":"__type","url":"interfaces/_services_ethereum_.ethi.html#gettransactionreceipt.__type-2","classes":"tsd-kind-type-literal tsd-parent-kind-property","parent":"\"services/ethereum\".ethI.getTransactionReceipt"},{"id":7,"kind":1024,"name":"getTransactionByHash","url":"interfaces/_services_ethereum_.ethi.html#gettransactionbyhash","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"services/ethereum\".ethI"},{"id":8,"kind":65536,"name":"__type","url":"interfaces/_services_ethereum_.ethi.html#gettransactionbyhash.__type-1","classes":"tsd-kind-type-literal tsd-parent-kind-property","parent":"\"services/ethereum\".ethI.getTransactionByHash"},{"id":9,"kind":1024,"name":"contract","url":"interfaces/_services_ethereum_.ethi.html#contract","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"services/ethereum\".ethI"},{"id":10,"kind":65536,"name":"__type","url":"interfaces/_services_ethereum_.ethi.html#contract.__type","classes":"tsd-kind-type-literal tsd-parent-kind-property","parent":"\"services/ethereum\".ethI.contract"},{"id":11,"kind":1024,"name":"sendRawTransaction","url":"interfaces/_services_ethereum_.ethi.html#sendrawtransaction","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"services/ethereum\".ethI"},{"id":12,"kind":1024,"name":"getTransactionCount","url":"interfaces/_services_ethereum_.ethi.html#gettransactioncount","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"services/ethereum\".ethI"},{"id":13,"kind":1024,"name":"abi","url":"interfaces/_services_ethereum_.ethi.html#abi","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"services/ethereum\".ethI"},{"id":14,"kind":256,"name":"Events","url":"interfaces/_services_ethereum_.events.html","classes":"tsd-kind-interface tsd-parent-kind-module","parent":"\"services/ethereum\""},{"id":15,"kind":1024,"name":"txHash","url":"interfaces/_services_ethereum_.events.html#txhash","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"services/ethereum\".Events"},{"id":16,"kind":1024,"name":"status","url":"interfaces/_services_ethereum_.events.html#status","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"services/ethereum\".Events"},{"id":17,"kind":1024,"name":"events","url":"interfaces/_services_ethereum_.events.html#events","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"services/ethereum\".Events"},{"id":18,"kind":32,"name":"ZERO_ADDRESS","url":"modules/_services_ethereum_.html#zero_address","classes":"tsd-kind-variable tsd-parent-kind-module","parent":"\"services/ethereum\""},{"id":19,"kind":64,"name":"executeAndRetry","url":"modules/_services_ethereum_.html#executeandretry","classes":"tsd-kind-function tsd-parent-kind-module","parent":"\"services/ethereum\""},{"id":20,"kind":64,"name":"waitAndReturnEvents","url":"modules/_services_ethereum_.html#waitandreturnevents","classes":"tsd-kind-function tsd-parent-kind-module","parent":"\"services/ethereum\""},{"id":21,"kind":64,"name":"waitForTransaction","url":"modules/_services_ethereum_.html#waitfortransaction","classes":"tsd-kind-function tsd-parent-kind-module","parent":"\"services/ethereum\""},{"id":22,"kind":64,"name":"findEvent","url":"modules/_services_ethereum_.html#findevent","classes":"tsd-kind-function tsd-parent-kind-module","parent":"\"services/ethereum\""},{"id":23,"kind":1,"name":"\"Tinlake\"","url":"modules/_tinlake_.html","classes":"tsd-kind-module"},{"id":24,"kind":128,"name":"Tinlake","url":"classes/_tinlake_.tinlake.html","classes":"tsd-kind-class tsd-parent-kind-module","parent":"\"Tinlake\""},{"id":25,"kind":1024,"name":"provider","url":"classes/_tinlake_.tinlake.html#provider","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":26,"kind":1024,"name":"eth","url":"classes/_tinlake_.tinlake.html#eth","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":27,"kind":1024,"name":"ethOptions","url":"classes/_tinlake_.tinlake.html#ethoptions","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":28,"kind":1024,"name":"ethConfig","url":"classes/_tinlake_.tinlake.html#ethconfig","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":29,"kind":1024,"name":"ethersConfig","url":"classes/_tinlake_.tinlake.html#ethersconfig","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":30,"kind":1024,"name":"contractAddresses","url":"classes/_tinlake_.tinlake.html#contractaddresses","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":31,"kind":1024,"name":"transactionTimeout","url":"classes/_tinlake_.tinlake.html#transactiontimeout","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":32,"kind":1024,"name":"contracts","url":"classes/_tinlake_.tinlake.html#contracts","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":33,"kind":1024,"name":"ethersContracts","url":"classes/_tinlake_.tinlake.html#etherscontracts","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":34,"kind":1024,"name":"contractAbis","url":"classes/_tinlake_.tinlake.html#contractabis","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":35,"kind":1024,"name":"contractConfig","url":"classes/_tinlake_.tinlake.html#contractconfig","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":36,"kind":512,"name":"constructor","url":"classes/_tinlake_.tinlake.html#constructor","classes":"tsd-kind-constructor tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":37,"kind":2048,"name":"setProvider","url":"classes/_tinlake_.tinlake.html#setprovider","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":38,"kind":2048,"name":"setContracts","url":"classes/_tinlake_.tinlake.html#setcontracts","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":39,"kind":2048,"name":"setEthConfig","url":"classes/_tinlake_.tinlake.html#setethconfig","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":40,"kind":2048,"name":"setEthersConfig","url":"classes/_tinlake_.tinlake.html#setethersconfig","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":41,"kind":2048,"name":"createEthContract","url":"classes/_tinlake_.tinlake.html#createethcontract","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":42,"kind":2048,"name":"createContract","url":"classes/_tinlake_.tinlake.html#createcontract","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":43,"kind":2048,"name":"getContract","url":"classes/_tinlake_.tinlake.html#getcontract","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":44,"kind":2048,"name":"getTransactionReceipt","url":"classes/_tinlake_.tinlake.html#gettransactionreceipt","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":45,"kind":2048,"name":"getOperatorType","url":"classes/_tinlake_.tinlake.html#getoperatortype","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":46,"kind":4194304,"name":"PendingTransaction","url":"modules/_tinlake_.html#pendingtransaction","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"Tinlake\""},{"id":47,"kind":65536,"name":"__type","url":"modules/_tinlake_.html#pendingtransaction.__type-7","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"Tinlake\".PendingTransaction"},{"id":48,"kind":32,"name":"hash","url":"modules/_tinlake_.html#pendingtransaction.__type-7.hash","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".PendingTransaction.__type"},{"id":49,"kind":32,"name":"contractKey","url":"modules/_tinlake_.html#pendingtransaction.__type-7.contractkey","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".PendingTransaction.__type"},{"id":50,"kind":32,"name":"timesOutAt","url":"modules/_tinlake_.html#pendingtransaction.__type-7.timesoutat","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".PendingTransaction.__type"},{"id":51,"kind":4194304,"name":"EthConfig","url":"modules/_tinlake_.html#ethconfig","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"Tinlake\""},{"id":52,"kind":65536,"name":"__type","url":"modules/_tinlake_.html#ethconfig.__type-4","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"Tinlake\".EthConfig"},{"id":53,"kind":32,"name":"from","url":"modules/_tinlake_.html#ethconfig.__type-4.from","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".EthConfig.__type"},{"id":54,"kind":32,"name":"gasPrice","url":"modules/_tinlake_.html#ethconfig.__type-4.gasprice","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".EthConfig.__type"},{"id":55,"kind":32,"name":"gas","url":"modules/_tinlake_.html#ethconfig.__type-4.gas","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".EthConfig.__type"},{"id":56,"kind":4194304,"name":"EthersOverrides","url":"modules/_tinlake_.html#ethersoverrides","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"Tinlake\""},{"id":57,"kind":65536,"name":"__type","url":"modules/_tinlake_.html#ethersoverrides.__type-6","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"Tinlake\".EthersOverrides"},{"id":58,"kind":32,"name":"gasPrice","url":"modules/_tinlake_.html#ethersoverrides.__type-6.gasprice-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".EthersOverrides.__type"},{"id":59,"kind":32,"name":"gasLimit","url":"modules/_tinlake_.html#ethersoverrides.__type-6.gaslimit","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".EthersOverrides.__type"},{"id":60,"kind":4194304,"name":"EthersConfig","url":"modules/_tinlake_.html#ethersconfig","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"Tinlake\""},{"id":61,"kind":65536,"name":"__type","url":"modules/_tinlake_.html#ethersconfig.__type-5","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"Tinlake\".EthersConfig"},{"id":62,"kind":32,"name":"provider","url":"modules/_tinlake_.html#ethersconfig.__type-5.provider","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".EthersConfig.__type"},{"id":63,"kind":32,"name":"signer","url":"modules/_tinlake_.html#ethersconfig.__type-5.signer","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".EthersConfig.__type"},{"id":64,"kind":32,"name":"overrides","url":"modules/_tinlake_.html#ethersconfig.__type-5.overrides","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".EthersConfig.__type"},{"id":65,"kind":4194304,"name":"ContractNames","url":"modules/_tinlake_.html#contractnames","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"Tinlake\""},{"id":66,"kind":4194304,"name":"Contracts","url":"modules/_tinlake_.html#contracts","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"Tinlake\""},{"id":67,"kind":65536,"name":"__type","url":"modules/_tinlake_.html#contracts.__type-3","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"Tinlake\".Contracts"},{"id":68,"kind":4194304,"name":"ContractAbis","url":"modules/_tinlake_.html#contractabis","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"Tinlake\""},{"id":69,"kind":65536,"name":"__type","url":"modules/_tinlake_.html#contractabis.__type-1","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"Tinlake\".ContractAbis"},{"id":70,"kind":4194304,"name":"ContractAddresses","url":"modules/_tinlake_.html#contractaddresses","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"Tinlake\""},{"id":71,"kind":65536,"name":"__type","url":"modules/_tinlake_.html#contractaddresses.__type-2","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"Tinlake\".ContractAddresses"},{"id":72,"kind":4194304,"name":"TinlakeParams","url":"modules/_tinlake_.html#tinlakeparams","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"Tinlake\""},{"id":73,"kind":65536,"name":"__type","url":"modules/_tinlake_.html#tinlakeparams.__type-8","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"Tinlake\".TinlakeParams"},{"id":74,"kind":32,"name":"provider","url":"modules/_tinlake_.html#tinlakeparams.__type-8.provider-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".TinlakeParams.__type"},{"id":75,"kind":32,"name":"transactionTimeout","url":"modules/_tinlake_.html#tinlakeparams.__type-8.transactiontimeout","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".TinlakeParams.__type"},{"id":76,"kind":32,"name":"contractAddresses","url":"modules/_tinlake_.html#tinlakeparams.__type-8.contractaddresses-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".TinlakeParams.__type"},{"id":77,"kind":32,"name":"contractAbis","url":"modules/_tinlake_.html#tinlakeparams.__type-8.contractabis-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".TinlakeParams.__type"},{"id":78,"kind":32,"name":"ethConfig","url":"modules/_tinlake_.html#tinlakeparams.__type-8.ethconfig-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".TinlakeParams.__type"},{"id":79,"kind":32,"name":"ethersConfig","url":"modules/_tinlake_.html#tinlakeparams.__type-8.ethersconfig-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".TinlakeParams.__type"},{"id":80,"kind":32,"name":"ethOptions","url":"modules/_tinlake_.html#tinlakeparams.__type-8.ethoptions","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".TinlakeParams.__type"},{"id":81,"kind":32,"name":"contracts","url":"modules/_tinlake_.html#tinlakeparams.__type-8.contracts-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".TinlakeParams.__type"},{"id":82,"kind":32,"name":"contractConfig","url":"modules/_tinlake_.html#tinlakeparams.__type-8.contractconfig","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".TinlakeParams.__type"},{"id":83,"kind":4194304,"name":"Constructor","url":"modules/_tinlake_.html#constructor","classes":"tsd-kind-type-alias tsd-parent-kind-module tsd-has-type-parameter","parent":"\"Tinlake\""},{"id":84,"kind":65536,"name":"__type","url":"modules/_tinlake_.html#constructor.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"Tinlake\".Constructor"},{"id":85,"kind":1,"name":"\"actions/admin\"","url":"modules/_actions_admin_.html","classes":"tsd-kind-module"},{"id":86,"kind":64,"name":"AdminActions","url":"modules/_actions_admin_.html#adminactions","classes":"tsd-kind-function tsd-parent-kind-module tsd-has-type-parameter","parent":"\"actions/admin\""},{"id":87,"kind":4194304,"name":"IAdminActions","url":"modules/_actions_admin_.html#iadminactions","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"actions/admin\""},{"id":88,"kind":65536,"name":"__type","url":"modules/_actions_admin_.html#iadminactions.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"actions/admin\".IAdminActions"},{"id":89,"kind":64,"name":"isWard","url":"modules/_actions_admin_.html#iadminactions.__type.isward","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":90,"kind":64,"name":"canSetInterestRate","url":"modules/_actions_admin_.html#iadminactions.__type.cansetinterestrate","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":91,"kind":64,"name":"canSetSeniorTrancheInterest","url":"modules/_actions_admin_.html#iadminactions.__type.cansetseniortrancheinterest","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":92,"kind":64,"name":"canSetMinimumJuniorRatio","url":"modules/_actions_admin_.html#iadminactions.__type.cansetminimumjuniorratio","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":93,"kind":64,"name":"canSetRiskScore","url":"modules/_actions_admin_.html#iadminactions.__type.cansetriskscore","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":94,"kind":64,"name":"canSetInvestorAllowanceJunior","url":"modules/_actions_admin_.html#iadminactions.__type.cansetinvestorallowancejunior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":95,"kind":64,"name":"canSetInvestorAllowanceSenior","url":"modules/_actions_admin_.html#iadminactions.__type.cansetinvestorallowancesenior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":96,"kind":64,"name":"canSetLoanPrice","url":"modules/_actions_admin_.html#iadminactions.__type.cansetloanprice","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":97,"kind":64,"name":"initRate","url":"modules/_actions_admin_.html#iadminactions.__type.initrate","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":98,"kind":64,"name":"setRate","url":"modules/_actions_admin_.html#iadminactions.__type.setrate","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":99,"kind":64,"name":"setMinimumJuniorRatio","url":"modules/_actions_admin_.html#iadminactions.__type.setminimumjuniorratio","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":100,"kind":64,"name":"approveAllowanceJunior","url":"modules/_actions_admin_.html#iadminactions.__type.approveallowancejunior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":101,"kind":64,"name":"approveAllowanceSenior","url":"modules/_actions_admin_.html#iadminactions.__type.approveallowancesenior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":102,"kind":1,"name":"\"actions/borrower\"","url":"modules/_actions_borrower_.html","classes":"tsd-kind-module"},{"id":103,"kind":64,"name":"BorrowerActions","url":"modules/_actions_borrower_.html#borroweractions","classes":"tsd-kind-function tsd-parent-kind-module tsd-has-type-parameter","parent":"\"actions/borrower\""},{"id":104,"kind":4194304,"name":"IBorrowerActions","url":"modules/_actions_borrower_.html#iborroweractions","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"actions/borrower\""},{"id":105,"kind":65536,"name":"__type","url":"modules/_actions_borrower_.html#iborroweractions.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"actions/borrower\".IBorrowerActions"},{"id":106,"kind":64,"name":"issue","url":"modules/_actions_borrower_.html#iborroweractions.__type.issue","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/borrower\".IBorrowerActions.__type"},{"id":107,"kind":64,"name":"nftLookup","url":"modules/_actions_borrower_.html#iborroweractions.__type.nftlookup","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/borrower\".IBorrowerActions.__type"},{"id":108,"kind":64,"name":"lock","url":"modules/_actions_borrower_.html#iborroweractions.__type.lock","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/borrower\".IBorrowerActions.__type"},{"id":109,"kind":64,"name":"unlock","url":"modules/_actions_borrower_.html#iborroweractions.__type.unlock","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/borrower\".IBorrowerActions.__type"},{"id":110,"kind":64,"name":"close","url":"modules/_actions_borrower_.html#iborroweractions.__type.close","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/borrower\".IBorrowerActions.__type"},{"id":111,"kind":64,"name":"borrow","url":"modules/_actions_borrower_.html#iborroweractions.__type.borrow","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/borrower\".IBorrowerActions.__type"},{"id":112,"kind":64,"name":"withdraw","url":"modules/_actions_borrower_.html#iborroweractions.__type.withdraw","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/borrower\".IBorrowerActions.__type"},{"id":113,"kind":64,"name":"repay","url":"modules/_actions_borrower_.html#iborroweractions.__type.repay","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/borrower\".IBorrowerActions.__type"},{"id":114,"kind":1,"name":"\"actions/lender\"","url":"modules/_actions_lender_.html","classes":"tsd-kind-module"},{"id":115,"kind":64,"name":"LenderActions","url":"modules/_actions_lender_.html#lenderactions","classes":"tsd-kind-function tsd-parent-kind-module tsd-has-type-parameter","parent":"\"actions/lender\""},{"id":116,"kind":4194304,"name":"ILenderActions","url":"modules/_actions_lender_.html#ilenderactions","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"actions/lender\""},{"id":117,"kind":65536,"name":"__type","url":"modules/_actions_lender_.html#ilenderactions.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"actions/lender\".ILenderActions"},{"id":118,"kind":64,"name":"getSeniorTokenAllowance","url":"modules/_actions_lender_.html#ilenderactions.__type.getseniortokenallowance","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/lender\".ILenderActions.__type"},{"id":119,"kind":64,"name":"getJuniorTokenAllowance","url":"modules/_actions_lender_.html#ilenderactions.__type.getjuniortokenallowance","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/lender\".ILenderActions.__type"},{"id":120,"kind":64,"name":"supplyJunior","url":"modules/_actions_lender_.html#ilenderactions.__type.supplyjunior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/lender\".ILenderActions.__type"},{"id":121,"kind":32,"name":"approveJuniorToken","url":"modules/_actions_lender_.html#ilenderactions.__type.approvejuniortoken","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"actions/lender\".ILenderActions.__type"},{"id":122,"kind":65536,"name":"__type","url":"modules/_actions_lender_.html#ilenderactions.__type.approvejuniortoken.__type-1","classes":"tsd-kind-type-literal tsd-parent-kind-variable","parent":"\"actions/lender\".ILenderActions.__type.approveJuniorToken"},{"id":123,"kind":32,"name":"approveSeniorToken","url":"modules/_actions_lender_.html#ilenderactions.__type.approveseniortoken","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"actions/lender\".ILenderActions.__type"},{"id":124,"kind":65536,"name":"__type","url":"modules/_actions_lender_.html#ilenderactions.__type.approveseniortoken.__type-2","classes":"tsd-kind-type-literal tsd-parent-kind-variable","parent":"\"actions/lender\".ILenderActions.__type.approveSeniorToken"},{"id":125,"kind":64,"name":"redeemJunior","url":"modules/_actions_lender_.html#ilenderactions.__type.redeemjunior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/lender\".ILenderActions.__type"},{"id":126,"kind":64,"name":"supplySenior","url":"modules/_actions_lender_.html#ilenderactions.__type.supplysenior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/lender\".ILenderActions.__type"},{"id":127,"kind":64,"name":"redeemSenior","url":"modules/_actions_lender_.html#ilenderactions.__type.redeemsenior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/lender\".ILenderActions.__type"},{"id":128,"kind":64,"name":"balance","url":"modules/_actions_lender_.html#ilenderactions.__type.balance","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/lender\".ILenderActions.__type"},{"id":129,"kind":1,"name":"\"actions/currency\"","url":"modules/_actions_currency_.html","classes":"tsd-kind-module"},{"id":130,"kind":64,"name":"CurrencyActions","url":"modules/_actions_currency_.html#currencyactions","classes":"tsd-kind-function tsd-parent-kind-module tsd-has-type-parameter","parent":"\"actions/currency\""},{"id":131,"kind":4194304,"name":"ICurrencyActions","url":"modules/_actions_currency_.html#icurrencyactions","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"actions/currency\""},{"id":132,"kind":65536,"name":"__type","url":"modules/_actions_currency_.html#icurrencyactions.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"actions/currency\".ICurrencyActions"},{"id":133,"kind":64,"name":"mintCurrency","url":"modules/_actions_currency_.html#icurrencyactions.__type.mintcurrency","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/currency\".ICurrencyActions.__type"},{"id":134,"kind":64,"name":"getCurrencyBalance","url":"modules/_actions_currency_.html#icurrencyactions.__type.getcurrencybalance","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/currency\".ICurrencyActions.__type"},{"id":135,"kind":32,"name":"getCurrencyAllowance","url":"modules/_actions_currency_.html#icurrencyactions.__type.getcurrencyallowance","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"actions/currency\".ICurrencyActions.__type"},{"id":136,"kind":65536,"name":"__type","url":"modules/_actions_currency_.html#icurrencyactions.__type.getcurrencyallowance.__type-3","classes":"tsd-kind-type-literal tsd-parent-kind-variable","parent":"\"actions/currency\".ICurrencyActions.__type.getCurrencyAllowance"},{"id":137,"kind":32,"name":"getJuniorForCurrencyAllowance","url":"modules/_actions_currency_.html#icurrencyactions.__type.getjuniorforcurrencyallowance","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"actions/currency\".ICurrencyActions.__type"},{"id":138,"kind":65536,"name":"__type","url":"modules/_actions_currency_.html#icurrencyactions.__type.getjuniorforcurrencyallowance.__type-4","classes":"tsd-kind-type-literal tsd-parent-kind-variable","parent":"\"actions/currency\".ICurrencyActions.__type.getJuniorForCurrencyAllowance"},{"id":139,"kind":32,"name":"getSeniorForCurrencyAllowance","url":"modules/_actions_currency_.html#icurrencyactions.__type.getseniorforcurrencyallowance","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"actions/currency\".ICurrencyActions.__type"},{"id":140,"kind":65536,"name":"__type","url":"modules/_actions_currency_.html#icurrencyactions.__type.getseniorforcurrencyallowance.__type-5","classes":"tsd-kind-type-literal tsd-parent-kind-variable","parent":"\"actions/currency\".ICurrencyActions.__type.getSeniorForCurrencyAllowance"},{"id":141,"kind":64,"name":"approveCurrency","url":"modules/_actions_currency_.html#icurrencyactions.__type.approvecurrency","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/currency\".ICurrencyActions.__type"},{"id":142,"kind":32,"name":"approveSeniorForCurrency","url":"modules/_actions_currency_.html#icurrencyactions.__type.approveseniorforcurrency","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"actions/currency\".ICurrencyActions.__type"},{"id":143,"kind":65536,"name":"__type","url":"modules/_actions_currency_.html#icurrencyactions.__type.approveseniorforcurrency.__type-2","classes":"tsd-kind-type-literal tsd-parent-kind-variable","parent":"\"actions/currency\".ICurrencyActions.__type.approveSeniorForCurrency"},{"id":144,"kind":32,"name":"approveJuniorForCurrency","url":"modules/_actions_currency_.html#icurrencyactions.__type.approvejuniorforcurrency","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"actions/currency\".ICurrencyActions.__type"},{"id":145,"kind":65536,"name":"__type","url":"modules/_actions_currency_.html#icurrencyactions.__type.approvejuniorforcurrency.__type-1","classes":"tsd-kind-type-literal tsd-parent-kind-variable","parent":"\"actions/currency\".ICurrencyActions.__type.approveJuniorForCurrency"},{"id":146,"kind":1,"name":"\"actions/collateral\"","url":"modules/_actions_collateral_.html","classes":"tsd-kind-module"},{"id":147,"kind":64,"name":"CollateralActions","url":"modules/_actions_collateral_.html#collateralactions","classes":"tsd-kind-function tsd-parent-kind-module tsd-has-type-parameter","parent":"\"actions/collateral\""},{"id":148,"kind":4194304,"name":"ICollateralActions","url":"modules/_actions_collateral_.html#icollateralactions","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"actions/collateral\""},{"id":149,"kind":65536,"name":"__type","url":"modules/_actions_collateral_.html#icollateralactions.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"actions/collateral\".ICollateralActions"},{"id":150,"kind":64,"name":"mintTitleNFT","url":"modules/_actions_collateral_.html#icollateralactions.__type.minttitlenft","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/collateral\".ICollateralActions.__type"},{"id":151,"kind":64,"name":"mintNFT","url":"modules/_actions_collateral_.html#icollateralactions.__type.mintnft","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/collateral\".ICollateralActions.__type"},{"id":152,"kind":64,"name":"approveNFT","url":"modules/_actions_collateral_.html#icollateralactions.__type.approvenft","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/collateral\".ICollateralActions.__type"},{"id":153,"kind":64,"name":"setNFTApprovalForAll","url":"modules/_actions_collateral_.html#icollateralactions.__type.setnftapprovalforall","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/collateral\".ICollateralActions.__type"},{"id":154,"kind":64,"name":"isNFTApprovedForAll","url":"modules/_actions_collateral_.html#icollateralactions.__type.isnftapprovedforall","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/collateral\".ICollateralActions.__type"},{"id":155,"kind":64,"name":"getNFTCount","url":"modules/_actions_collateral_.html#icollateralactions.__type.getnftcount","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/collateral\".ICollateralActions.__type"},{"id":156,"kind":64,"name":"getNFTData","url":"modules/_actions_collateral_.html#icollateralactions.__type.getnftdata","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/collateral\".ICollateralActions.__type"},{"id":157,"kind":64,"name":"getNFTOwner","url":"modules/_actions_collateral_.html#icollateralactions.__type.getnftowner","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/collateral\".ICollateralActions.__type"},{"id":158,"kind":64,"name":"transferNFT","url":"modules/_actions_collateral_.html#icollateralactions.__type.transfernft","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/collateral\".ICollateralActions.__type"},{"id":159,"kind":1,"name":"\"actions/governance\"","url":"modules/_actions_governance_.html","classes":"tsd-kind-module"},{"id":160,"kind":4194304,"name":"IGovernanceActions","url":"modules/_actions_governance_.html#igovernanceactions","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"actions/governance\""},{"id":161,"kind":65536,"name":"__type","url":"modules/_actions_governance_.html#igovernanceactions.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"actions/governance\".IGovernanceActions"},{"id":162,"kind":64,"name":"relyAddress","url":"modules/_actions_governance_.html#igovernanceactions.__type.relyaddress","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/governance\".IGovernanceActions.__type"},{"id":163,"kind":1,"name":"\"actions/proxy\"","url":"modules/_actions_proxy_.html","classes":"tsd-kind-module"},{"id":164,"kind":64,"name":"ProxyActions","url":"modules/_actions_proxy_.html#proxyactions","classes":"tsd-kind-function tsd-parent-kind-module tsd-has-type-parameter","parent":"\"actions/proxy\""},{"id":165,"kind":4194304,"name":"IProxyActions","url":"modules/_actions_proxy_.html#iproxyactions","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"actions/proxy\""},{"id":166,"kind":65536,"name":"__type","url":"modules/_actions_proxy_.html#iproxyactions.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"actions/proxy\".IProxyActions"},{"id":167,"kind":64,"name":"buildProxy","url":"modules/_actions_proxy_.html#iproxyactions.__type.buildproxy","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":168,"kind":64,"name":"checkProxyExists","url":"modules/_actions_proxy_.html#iproxyactions.__type.checkproxyexists","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":169,"kind":64,"name":"getProxy","url":"modules/_actions_proxy_.html#iproxyactions.__type.getproxy","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":170,"kind":64,"name":"proxyCount","url":"modules/_actions_proxy_.html#iproxyactions.__type.proxycount","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":171,"kind":64,"name":"getProxyAccessToken","url":"modules/_actions_proxy_.html#iproxyactions.__type.getproxyaccesstoken","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":172,"kind":64,"name":"getProxyAccessTokenOwner","url":"modules/_actions_proxy_.html#iproxyactions.__type.getproxyaccesstokenowner","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":173,"kind":64,"name":"getProxyOwnerByLoan","url":"modules/_actions_proxy_.html#iproxyactions.__type.getproxyownerbyloan","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":174,"kind":64,"name":"getProxyOwnerByAddress","url":"modules/_actions_proxy_.html#iproxyactions.__type.getproxyownerbyaddress","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":175,"kind":64,"name":"proxyCreateNew","url":"modules/_actions_proxy_.html#iproxyactions.__type.proxycreatenew","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":176,"kind":64,"name":"proxyIssue","url":"modules/_actions_proxy_.html#iproxyactions.__type.proxyissue","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":177,"kind":64,"name":"proxyTransferIssue","url":"modules/_actions_proxy_.html#iproxyactions.__type.proxytransferissue","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":178,"kind":64,"name":"proxyLockBorrowWithdraw","url":"modules/_actions_proxy_.html#iproxyactions.__type.proxylockborrowwithdraw","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":179,"kind":64,"name":"proxyRepayUnlockClose","url":"modules/_actions_proxy_.html#iproxyactions.__type.proxyrepayunlockclose","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":180,"kind":1,"name":"\"actions/index\"","url":"modules/_actions_index_.html","classes":"tsd-kind-module"},{"id":181,"kind":4194304,"name":"TinlakeActions","url":"modules/_actions_index_.html#tinlakeactions","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"actions/index\""},{"id":182,"kind":1,"name":"\"types/tinlake\"","url":"modules/_types_tinlake_.html","classes":"tsd-kind-module"},{"id":183,"kind":4194304,"name":"Loan","url":"modules/_types_tinlake_.html#loan","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"types/tinlake\""},{"id":184,"kind":65536,"name":"__type","url":"modules/_types_tinlake_.html#loan.__type-3","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"types/tinlake\".Loan"},{"id":185,"kind":32,"name":"loanId","url":"modules/_types_tinlake_.html#loan.__type-3.loanid","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":186,"kind":32,"name":"registry","url":"modules/_types_tinlake_.html#loan.__type-3.registry","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":187,"kind":32,"name":"tokenId","url":"modules/_types_tinlake_.html#loan.__type-3.tokenid","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":188,"kind":32,"name":"ownerOf","url":"modules/_types_tinlake_.html#loan.__type-3.ownerof","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":189,"kind":32,"name":"principal","url":"modules/_types_tinlake_.html#loan.__type-3.principal","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":190,"kind":32,"name":"interestRate","url":"modules/_types_tinlake_.html#loan.__type-3.interestrate","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":191,"kind":32,"name":"debt","url":"modules/_types_tinlake_.html#loan.__type-3.debt","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":192,"kind":32,"name":"threshold","url":"modules/_types_tinlake_.html#loan.__type-3.threshold","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":193,"kind":32,"name":"price","url":"modules/_types_tinlake_.html#loan.__type-3.price","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":194,"kind":32,"name":"status","url":"modules/_types_tinlake_.html#loan.__type-3.status","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":195,"kind":32,"name":"nft","url":"modules/_types_tinlake_.html#loan.__type-3.nft","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":196,"kind":32,"name":"proxyOwner","url":"modules/_types_tinlake_.html#loan.__type-3.proxyowner","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":197,"kind":4194304,"name":"Tranche","url":"modules/_types_tinlake_.html#tranche","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"types/tinlake\""},{"id":198,"kind":65536,"name":"__type","url":"modules/_types_tinlake_.html#tranche.__type-5","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"types/tinlake\".Tranche"},{"id":199,"kind":32,"name":"availableFunds","url":"modules/_types_tinlake_.html#tranche.__type-5.availablefunds","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Tranche.__type"},{"id":200,"kind":32,"name":"tokenPrice","url":"modules/_types_tinlake_.html#tranche.__type-5.tokenprice","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Tranche.__type"},{"id":201,"kind":32,"name":"type","url":"modules/_types_tinlake_.html#tranche.__type-5.type","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Tranche.__type"},{"id":202,"kind":32,"name":"token","url":"modules/_types_tinlake_.html#tranche.__type-5.token","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Tranche.__type"},{"id":203,"kind":32,"name":"totalSupply","url":"modules/_types_tinlake_.html#tranche.__type-5.totalsupply","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Tranche.__type"},{"id":204,"kind":32,"name":"interestRate","url":"modules/_types_tinlake_.html#tranche.__type-5.interestrate-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Tranche.__type"},{"id":205,"kind":4194304,"name":"NFT","url":"modules/_types_tinlake_.html#nft-1","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"types/tinlake\""},{"id":206,"kind":65536,"name":"__type","url":"modules/_types_tinlake_.html#nft-1.__type-4","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"types/tinlake\".NFT"},{"id":207,"kind":32,"name":"registry","url":"modules/_types_tinlake_.html#nft-1.__type-4.registry-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".NFT.__type"},{"id":208,"kind":32,"name":"tokenId","url":"modules/_types_tinlake_.html#nft-1.__type-4.tokenid-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".NFT.__type"},{"id":209,"kind":32,"name":"nftOwner","url":"modules/_types_tinlake_.html#nft-1.__type-4.nftowner","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".NFT.__type"},{"id":210,"kind":32,"name":"nftData","url":"modules/_types_tinlake_.html#nft-1.__type-4.nftdata","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".NFT.__type"},{"id":211,"kind":4194304,"name":"Investor","url":"modules/_types_tinlake_.html#investor","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"types/tinlake\""},{"id":212,"kind":65536,"name":"__type","url":"modules/_types_tinlake_.html#investor.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"types/tinlake\".Investor"},{"id":213,"kind":32,"name":"junior","url":"modules/_types_tinlake_.html#investor.__type.junior","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Investor.__type"},{"id":214,"kind":65536,"name":"__type","url":"modules/_types_tinlake_.html#investor.__type.junior.__type-1","classes":"tsd-kind-type-literal tsd-parent-kind-variable","parent":"\"types/tinlake\".Investor.__type.junior"},{"id":215,"kind":32,"name":"maxSupply","url":"modules/_types_tinlake_.html#investor.__type.junior.__type-1.maxsupply","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Investor.__type.junior.__type"},{"id":216,"kind":32,"name":"tokenBalance","url":"modules/_types_tinlake_.html#investor.__type.junior.__type-1.tokenbalance","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Investor.__type.junior.__type"},{"id":217,"kind":32,"name":"maxRedeem","url":"modules/_types_tinlake_.html#investor.__type.junior.__type-1.maxredeem","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Investor.__type.junior.__type"},{"id":218,"kind":32,"name":"senior","url":"modules/_types_tinlake_.html#investor.__type.senior","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Investor.__type"},{"id":219,"kind":65536,"name":"__type","url":"modules/_types_tinlake_.html#investor.__type.senior.__type-2","classes":"tsd-kind-type-literal tsd-parent-kind-variable","parent":"\"types/tinlake\".Investor.__type.senior"},{"id":220,"kind":32,"name":"maxSupply","url":"modules/_types_tinlake_.html#investor.__type.senior.__type-2.maxsupply-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Investor.__type.senior.__type"},{"id":221,"kind":32,"name":"tokenBalance","url":"modules/_types_tinlake_.html#investor.__type.senior.__type-2.tokenbalance-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Investor.__type.senior.__type"},{"id":222,"kind":32,"name":"maxRedeem","url":"modules/_types_tinlake_.html#investor.__type.senior.__type-2.maxredeem-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Investor.__type.senior.__type"},{"id":223,"kind":32,"name":"address","url":"modules/_types_tinlake_.html#investor.__type.address","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Investor.__type"},{"id":224,"kind":4194304,"name":"ITinlake","url":"modules/_types_tinlake_.html#itinlake","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"types/tinlake\""},{"id":225,"kind":1,"name":"\"actions/analytics\"","url":"modules/_actions_analytics_.html","classes":"tsd-kind-module"},{"id":226,"kind":64,"name":"AnalyticsActions","url":"modules/_actions_analytics_.html#analyticsactions","classes":"tsd-kind-function tsd-parent-kind-module tsd-has-type-parameter","parent":"\"actions/analytics\""},{"id":227,"kind":4194304,"name":"IAnalyticsActions","url":"modules/_actions_analytics_.html#ianalyticsactions","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"actions/analytics\""},{"id":228,"kind":65536,"name":"__type","url":"modules/_actions_analytics_.html#ianalyticsactions.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"actions/analytics\".IAnalyticsActions"},{"id":229,"kind":64,"name":"getTotalDebt","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.gettotaldebt","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":230,"kind":64,"name":"getTotalBalance","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.gettotalbalance","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":231,"kind":64,"name":"getDebt","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getdebt","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":232,"kind":64,"name":"loanCount","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.loancount","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":233,"kind":64,"name":"getLoanList","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getloanlist","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":234,"kind":64,"name":"getLoan","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getloan","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":235,"kind":64,"name":"getCollateral","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getcollateral","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":236,"kind":64,"name":"getPrincipal","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getprincipal","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":237,"kind":64,"name":"getInterestRate","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getinterestrate","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":238,"kind":64,"name":"getOwnerOfLoan","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getownerofloan","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":239,"kind":64,"name":"getOwnerOfCollateral","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getownerofcollateral","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":240,"kind":64,"name":"existsSenior","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.existssenior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":241,"kind":64,"name":"getJuniorReserve","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getjuniorreserve","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":242,"kind":64,"name":"getSeniorReserve","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getseniorreserve","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":243,"kind":64,"name":"getJuniorTokenBalance","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getjuniortokenbalance","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":244,"kind":64,"name":"getSeniorTokenBalance","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getseniortokenbalance","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":245,"kind":64,"name":"getMaxSupplyAmountJunior","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getmaxsupplyamountjunior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":246,"kind":64,"name":"getMaxRedeemAmountJunior","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getmaxredeemamountjunior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":247,"kind":64,"name":"getMaxSupplyAmountSenior","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getmaxsupplyamountsenior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":248,"kind":64,"name":"getMaxRedeemAmountSenior","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getmaxredeemamountsenior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":249,"kind":64,"name":"getTokenPriceJunior","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.gettokenpricejunior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":250,"kind":64,"name":"getTokenPriceSenior","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.gettokenpricesenior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":251,"kind":64,"name":"getSeniorDebt","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getseniordebt","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":252,"kind":64,"name":"getSeniorInterestRate","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getseniorinterestrate","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":253,"kind":64,"name":"getMinJuniorRatio","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getminjuniorratio","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":254,"kind":64,"name":"getCurrentJuniorRatio","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getcurrentjuniorratio","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":255,"kind":64,"name":"getAssetValueJunior","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getassetvaluejunior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":256,"kind":64,"name":"getInvestor","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getinvestor","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":257,"kind":1,"name":"\"utils/baseToDisplay\"","url":"modules/_utils_basetodisplay_.html","classes":"tsd-kind-module"},{"id":258,"kind":64,"name":"baseToDisplay","url":"modules/_utils_basetodisplay_.html#basetodisplay","classes":"tsd-kind-function tsd-parent-kind-module","parent":"\"utils/baseToDisplay\""},{"id":259,"kind":1,"name":"\"utils/baseToDisplay.spec\"","url":"modules/_utils_basetodisplay_spec_.html","classes":"tsd-kind-module"},{"id":260,"kind":1,"name":"\"utils/bnToHex\"","url":"modules/_utils_bntohex_.html","classes":"tsd-kind-module"},{"id":261,"kind":64,"name":"bnToHex","url":"modules/_utils_bntohex_.html#bntohex","classes":"tsd-kind-function tsd-parent-kind-module","parent":"\"utils/bnToHex\""},{"id":262,"kind":1,"name":"\"utils/bnToHex.spec\"","url":"modules/_utils_bntohex_spec_.html","classes":"tsd-kind-module"},{"id":263,"kind":1,"name":"\"utils/displayToBase\"","url":"modules/_utils_displaytobase_.html","classes":"tsd-kind-module"},{"id":264,"kind":64,"name":"displayToBase","url":"modules/_utils_displaytobase_.html#displaytobase","classes":"tsd-kind-function tsd-parent-kind-module","parent":"\"utils/displayToBase\""},{"id":265,"kind":1,"name":"\"utils/displayToBase.spec\"","url":"modules/_utils_displaytobase_spec_.html","classes":"tsd-kind-module"},{"id":266,"kind":1,"name":"\"utils/feeToInterestRate\"","url":"modules/_utils_feetointerestrate_.html","classes":"tsd-kind-module"},{"id":267,"kind":64,"name":"feeToInterestRate","url":"modules/_utils_feetointerestrate_.html#feetointerestrate","classes":"tsd-kind-function tsd-parent-kind-module","parent":"\"utils/feeToInterestRate\""},{"id":268,"kind":1,"name":"\"utils/feeToInterestRate.spec\"","url":"modules/_utils_feetointerestrate_spec_.html","classes":"tsd-kind-module"},{"id":269,"kind":1,"name":"\"utils/getLoanStatus\"","url":"modules/_utils_getloanstatus_.html","classes":"tsd-kind-module"},{"id":270,"kind":4194304,"name":"LoanStatus","url":"modules/_utils_getloanstatus_.html#loanstatus","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"utils/getLoanStatus\""},{"id":271,"kind":64,"name":"getLoanStatus","url":"modules/_utils_getloanstatus_.html#getloanstatus","classes":"tsd-kind-function tsd-parent-kind-module","parent":"\"utils/getLoanStatus\""},{"id":272,"kind":1,"name":"\"utils/interestRateToFee\"","url":"modules/_utils_interestratetofee_.html","classes":"tsd-kind-module"},{"id":273,"kind":64,"name":"interestRateToFee","url":"modules/_utils_interestratetofee_.html#interestratetofee","classes":"tsd-kind-function tsd-parent-kind-module","parent":"\"utils/interestRateToFee\""},{"id":274,"kind":1,"name":"\"utils/interestRateToFee.spec\"","url":"modules/_utils_interestratetofee_spec_.html","classes":"tsd-kind-module"}]}; \ No newline at end of file diff --git a/docs/classes/_tinlake_.tinlake.html b/docs/classes/_tinlake_.tinlake.html index 3b72a69..f9e1326 100644 --- a/docs/classes/_tinlake_.tinlake.html +++ b/docs/classes/_tinlake_.tinlake.html @@ -94,6 +94,7 @@

    Properties

  • ethConfig
  • ethOptions
  • ethersConfig
  • +
  • ethersContracts
  • provider
  • transactionTimeout
  • @@ -102,6 +103,7 @@

    Properties

    Methods

  • @@ -269,7 +269,7 @@

    mintTitleNFT: function
  • Parameters

    @@ -294,7 +294,7 @@
    setNFTApprovalForAll: fu
  • Parameters

    @@ -322,7 +322,7 @@
    transferNFT: function
  • Parameters

    @@ -360,7 +360,7 @@

    CollateralActions

  • Type parameters

    diff --git a/docs/modules/_actions_currency_.html b/docs/modules/_actions_currency_.html index 6b69c62..543f931 100644 --- a/docs/modules/_actions_currency_.html +++ b/docs/modules/_actions_currency_.html @@ -86,21 +86,21 @@

    Type aliases

    ICurrencyActions

    -
    ICurrencyActions: { approveJuniorForCurrency: (currencyAmount: string) => Promise<unknown>; approveSeniorForCurrency: (currencyAmount: string) => Promise<unknown>; getCurrencyAllowance: (owner: string, spender: string) => Promise<BN>; getJuniorForCurrencyAllowance: (owner: string) => Promise<BN | undefined>; getSeniorForCurrencyAllowance: (owner: string) => Promise<BN | undefined>; approveCurrency: any; getCurrencyBalance: any; mintCurrency: any }
    +
    ICurrencyActions: { approveJuniorForCurrency: (currencyAmount: string) => Promise<PendingTransaction | undefined>; approveSeniorForCurrency: (currencyAmount: string) => Promise<PendingTransaction | undefined>; getCurrencyAllowance: (owner: string, spender: string) => Promise<BN>; getJuniorForCurrencyAllowance: (owner: string) => Promise<BN | undefined>; getSeniorForCurrencyAllowance: (owner: string) => Promise<BN | undefined>; approveCurrency: any; getCurrencyBalance: any; mintCurrency: any }

    Type declaration

    • -
      approveJuniorForCurrency: (currencyAmount: string) => Promise<unknown>
      +
      approveJuniorForCurrency: (currencyAmount: string) => Promise<PendingTransaction | undefined>
        • -
        • (currencyAmount: string): Promise<unknown>
        • +
        • (currencyAmount: string): Promise<PendingTransaction | undefined>
        • @@ -110,18 +110,18 @@

          Parameters

          currencyAmount: string
        -

        Returns Promise<unknown>

        +

        Returns Promise<PendingTransaction | undefined>

  • -
    approveSeniorForCurrency: (currencyAmount: string) => Promise<unknown>
    +
    approveSeniorForCurrency: (currencyAmount: string) => Promise<PendingTransaction | undefined>
      • -
      • (currencyAmount: string): Promise<unknown>
      • +
      • (currencyAmount: string): Promise<PendingTransaction | undefined>
      • @@ -131,7 +131,7 @@

        Parameters

        currencyAmount: string
      -

      Returns Promise<unknown>

      +

      Returns Promise<PendingTransaction | undefined>

  • @@ -206,13 +206,13 @@

    Returns Promise
    approveCurrency: function
      -
    • approveCurrency(usr: string, amount: string): Promise<unknown>
    • +
    • approveCurrency(usr: string, amount: string): Promise<PendingTransaction>
    -

    Returns Promise<unknown>

    +

    Returns Promise<PendingTransaction>

  • @@ -237,7 +237,7 @@
    getCurrencyBalance: func
  • Parameters

    @@ -259,7 +259,7 @@
    mintCurrency: function
  • Parameters

    @@ -291,7 +291,7 @@

    CurrencyActions

  • Type parameters

    diff --git a/docs/modules/_actions_governance_.html b/docs/modules/_actions_governance_.html index 2d26fe4..4a53c3d 100644 --- a/docs/modules/_actions_governance_.html +++ b/docs/modules/_actions_governance_.html @@ -83,7 +83,7 @@

    IGovernanceActions

    IGovernanceActions: { relyAddress: any }
    @@ -98,7 +98,7 @@
    relyAddress: function
  • Parameters

    diff --git a/docs/modules/_actions_index_.html b/docs/modules/_actions_index_.html index 1ca134c..e7f2d97 100644 --- a/docs/modules/_actions_index_.html +++ b/docs/modules/_actions_index_.html @@ -83,7 +83,7 @@

    TinlakeActions

    diff --git a/docs/modules/_actions_lender_.html b/docs/modules/_actions_lender_.html index e30c01a..e217b82 100644 --- a/docs/modules/_actions_lender_.html +++ b/docs/modules/_actions_lender_.html @@ -89,7 +89,7 @@

    ILenderActions

    ILenderActions: { approveJuniorToken: (tokenAmount: string) => Promise<unknown>; approveSeniorToken: (tokenAmount: string) => Promise<unknown>; balance: any; getJuniorTokenAllowance: any; getSeniorTokenAllowance: any; redeemJunior: any; redeemSenior: any; supplyJunior: any; supplySenior: any }
    @@ -146,7 +146,7 @@
    balance: function
  • Returns Promise<any>

    @@ -162,7 +162,7 @@
    getJuniorTokenAllowance: <
  • Parameters

    @@ -184,7 +184,7 @@
    getSeniorTokenAllowance: <
  • Parameters

    @@ -206,7 +206,7 @@
    redeemJunior: function
  • Parameters

    @@ -228,7 +228,7 @@
    redeemSenior: function
  • Parameters

    @@ -244,13 +244,13 @@

    Returns Promise
    supplyJunior: function
      -
    • supplyJunior(currencyAmount: string): Promise<any>
    • +
    • supplyJunior(currencyAmount: string): Promise<PendingTransaction>
    -

    Returns Promise<any>

    +

    Returns Promise<PendingTransaction>

  • supplySenior: function
      -
    • supplySenior(currencyAmount: string): Promise<any>
    • +
    • supplySenior(currencyAmount: string): Promise<PendingTransaction>
    -

    Returns Promise<any>

    +

    Returns Promise<PendingTransaction>

  • @@ -301,7 +301,7 @@

    LenderActions

  • Type parameters

    diff --git a/docs/modules/_actions_proxy_.html b/docs/modules/_actions_proxy_.html index 1cdc176..532ffc5 100644 --- a/docs/modules/_actions_proxy_.html +++ b/docs/modules/_actions_proxy_.html @@ -89,7 +89,7 @@

    IProxyActions

    IProxyActions: { buildProxy: any; checkProxyExists: any; getProxy: any; getProxyAccessToken: any; getProxyAccessTokenOwner: any; getProxyOwnerByAddress: any; getProxyOwnerByLoan: any; proxyCount: any; proxyCreateNew: any; proxyIssue: any; proxyLockBorrowWithdraw: any; proxyRepayUnlockClose: any; proxyTransferIssue: any }
    @@ -104,7 +104,7 @@
    buildProxy: function
  • Parameters

    @@ -126,7 +126,7 @@
    checkProxyExists: functi
  • Parameters

    @@ -148,7 +148,7 @@
    getProxy: function
  • Parameters

    @@ -170,7 +170,7 @@
    getProxyAccessToken:

    Parameters

    @@ -192,7 +192,7 @@
    getProxyAccessTokenOwner

    Parameters

    @@ -214,7 +214,7 @@
    getProxyOwnerByAddress:

    Parameters

    @@ -236,7 +236,7 @@
    getProxyOwnerByLoan:

    Parameters

    @@ -258,7 +258,7 @@
    proxyCount: function
  • Returns Promise<any>

    @@ -274,7 +274,7 @@
    proxyCreateNew: function
  • Parameters

    @@ -296,7 +296,7 @@
    proxyIssue: function
  • Parameters

    @@ -324,7 +324,7 @@
    proxyLockBorrowWithdraw: <
  • Parameters

    @@ -355,7 +355,7 @@
    proxyRepayUnlockClose:

    Parameters

    @@ -386,7 +386,7 @@
    proxyTransferIssue: func
  • Parameters

    @@ -421,7 +421,7 @@

    ProxyActions

  • Type parameters

    diff --git a/docs/modules/_services_ethereum_.html b/docs/modules/_services_ethereum_.html index 594c941..92ae61c 100644 --- a/docs/modules/_services_ethereum_.html +++ b/docs/modules/_services_ethereum_.html @@ -99,7 +99,7 @@

    Const ZERO_ADDRESS

    ZERO_ADDRESS: "0x0000000000000000000000000000000000000000" = "0x0000000000000000000000000000000000000000"
    @@ -116,7 +116,7 @@

    executeAndRetry

  • Parameters

    @@ -142,7 +142,7 @@

    Const findEvent

  • Parameters

    @@ -209,7 +209,7 @@

    Const waitAndReturn

    Parameters

    @@ -241,7 +241,7 @@

    Const waitForTransactio
  • Parameters

    diff --git a/docs/modules/_tinlake_.html b/docs/modules/_tinlake_.html index da3b752..2ca9fe1 100644 --- a/docs/modules/_tinlake_.html +++ b/docs/modules/_tinlake_.html @@ -98,7 +98,7 @@

    Constructor

    Constructor<T>: {}

    Type parameters

    @@ -119,7 +119,7 @@

    ContractAbis

    ContractAbis: {}
    @@ -134,7 +134,7 @@

    ContractAddresses

    ContractAddresses: {}
    @@ -149,7 +149,7 @@

    ContractNames

    ContractNames: typeof contractNames[number]
    @@ -159,7 +159,7 @@

    Contracts

    Contracts: {}
    @@ -174,7 +174,7 @@

    EthConfig

    EthConfig: { from?: undefined | string; gas?: undefined | string; gasPrice?: undefined | string }
    @@ -195,10 +195,10 @@
    Optional gasPrice

    EthersConfig

    -
    EthersConfig: { overrides?: EthersOverrides; provider?: ethers.providers.Provider; signer?: ethers.Signer }
    +
    EthersConfig: { overrides?: EthersOverrides; provider: Provider; signer: Signer }
    @@ -208,10 +208,10 @@

    Type declaration

    Optional overrides?: EthersOverrides
  • -
    Optional provider?: ethers.providers.Provider
    +
    provider: Provider
  • -
    Optional signer?: ethers.Signer
    +
    signer: Signer
  • @@ -222,7 +222,7 @@

    EthersOverrides

    EthersOverrides: { gasLimit?: undefined | number; gasPrice?: undefined | number }
    @@ -240,10 +240,10 @@
    Optional gasPrice

    PendingTransaction

    -
    PendingTransaction: { contractKey: string; hash: string; timesOutAt: number }
    +
    PendingTransaction: { contractKey: string; hash: string; timesOutAt?: undefined | number }
    @@ -256,7 +256,7 @@
    contractKey: : string
  • -
    timesOutAt: number
    +
    Optional timesOutAt?: undefined | number
  • @@ -267,7 +267,7 @@

    TinlakeParams

    TinlakeParams: { contractAbis?: ContractAbis | {}; contractAddresses?: ContractAddresses | {}; contractConfig?: any | {}; contracts?: Contracts | {}; ethConfig?: EthConfig; ethOptions?: any | {}; ethersConfig?: EthersConfig; provider: any; transactionTimeout: number }
    diff --git a/docs/modules/_types_tinlake_.html b/docs/modules/_types_tinlake_.html index 7a04d52..ea47d62 100644 --- a/docs/modules/_types_tinlake_.html +++ b/docs/modules/_types_tinlake_.html @@ -87,7 +87,7 @@

    ITinlake

    @@ -97,7 +97,7 @@

    Investor

    Investor: { address: string; junior: { maxRedeem: BN; maxSupply: BN; tokenBalance: BN }; senior: { maxRedeem?: BN; maxSupply?: BN; tokenBalance?: BN } }
    @@ -143,7 +143,7 @@

    Loan

    Loan: { debt: BN; interestRate: BN; loanId: string; nft?: NFT; ownerOf: BN; price?: BN; principal: BN; proxyOwner?: undefined | string; registry: string; status?: undefined | string; threshold?: BN; tokenId: BN }
    @@ -194,7 +194,7 @@

    NFT

    NFT: { nftData: any; nftOwner: string; registry: string; tokenId: BN }
    @@ -221,7 +221,7 @@

    Tranche

    Tranche: { availableFunds: BN; interestRate?: BN; token: string; tokenPrice: BN; totalSupply: BN; type: string }
    diff --git a/docs/modules/_utils_basetodisplay_.html b/docs/modules/_utils_basetodisplay_.html index b1ddefd..8415402 100644 --- a/docs/modules/_utils_basetodisplay_.html +++ b/docs/modules/_utils_basetodisplay_.html @@ -87,7 +87,7 @@

    Const baseToDisplay

  • Parameters

    diff --git a/docs/modules/_utils_bntohex_.html b/docs/modules/_utils_bntohex_.html index 8354b5b..1147c66 100644 --- a/docs/modules/_utils_bntohex_.html +++ b/docs/modules/_utils_bntohex_.html @@ -87,7 +87,7 @@

    Const bnToHex

  • Parameters

    diff --git a/docs/modules/_utils_displaytobase_.html b/docs/modules/_utils_displaytobase_.html index f4d55f9..d00e164 100644 --- a/docs/modules/_utils_displaytobase_.html +++ b/docs/modules/_utils_displaytobase_.html @@ -87,7 +87,7 @@

    Const displayToBase

  • Parameters

    diff --git a/docs/modules/_utils_feetointerestrate_.html b/docs/modules/_utils_feetointerestrate_.html index 86e0200..9283e14 100644 --- a/docs/modules/_utils_feetointerestrate_.html +++ b/docs/modules/_utils_feetointerestrate_.html @@ -87,7 +87,7 @@

    Const feeToInterestRate
  • diff --git a/docs/modules/_utils_getloanstatus_.html b/docs/modules/_utils_getloanstatus_.html index d90ae1d..d988409 100644 --- a/docs/modules/_utils_getloanstatus_.html +++ b/docs/modules/_utils_getloanstatus_.html @@ -89,7 +89,7 @@

    LoanStatus

    LoanStatus: "Whitelisted" | "Ongoing" | "Repaid"
    @@ -106,7 +106,7 @@

    getLoanStatus

  • Parameters

    diff --git a/docs/modules/_utils_interestratetofee_.html b/docs/modules/_utils_interestratetofee_.html index 6aace65..9faf59e 100644 --- a/docs/modules/_utils_interestratetofee_.html +++ b/docs/modules/_utils_interestratetofee_.html @@ -87,7 +87,7 @@

    Const interestRateToFee
  • diff --git a/src/Tinlake.ts b/src/Tinlake.ts index 4179113..fa72925 100644 --- a/src/Tinlake.ts +++ b/src/Tinlake.ts @@ -2,6 +2,7 @@ import Eth from 'ethjs'; import { ethI } from './services/ethereum'; import abiDefinitions from './abi'; import { ethers } from 'ethers'; +import BN from 'bn.js'; const contractNames = [ 'TINLAKE_CURRENCY', @@ -40,7 +41,7 @@ type AbiOutput = { export type PendingTransaction = { hash: string contractKey: string - timesOutAt: number, + timesOutAt?: number, }; export type EthConfig = { @@ -55,8 +56,8 @@ export type EthersOverrides = { }; export type EthersConfig = { - provider?: ethers.providers.Provider - signer?: ethers.Signer, + provider: ethers.providers.Provider + signer: ethers.Signer, overrides?: EthersOverrides, }; @@ -88,6 +89,10 @@ export type TinlakeParams = { export type Constructor = new (...args: any[]) => Tinlake; +(ethers.utils.BigNumber as any).prototype.toBN = function () { + return new BN((this as any).toString()); +}; + export default class Tinlake { public provider: any; public eth: ethI; @@ -97,6 +102,7 @@ export default class Tinlake { public contractAddresses: ContractAddresses; public transactionTimeout: number; public contracts: Contracts = {}; + public ethersContracts: Contracts = {}; public contractAbis: ContractAbis = {}; public contractConfig: any = {}; @@ -111,7 +117,7 @@ export default class Tinlake { this.transactionTimeout = transactionTimeout; this.setProvider(provider, ethOptions); this.setEthConfig(ethConfig || {}); - this.setEthersConfig(ethersConfig || {}); + this.setEthersConfig(ethersConfig); } setProvider = (provider: any, ethOptions?: any) => { @@ -126,21 +132,29 @@ export default class Tinlake { // set root & proxy contracts contractNames.forEach((name) => { if (this.contractAbis[name] && this.contractAddresses[name]) { - this.contracts[name] = this.eth.contract(this.contractAbis[name]) - .at(this.contractAddresses[name]); + this.contracts[name] = this.eth.contract(this.contractAbis[name]).at(this.contractAddresses[name]); + this.ethersContracts[name] = this.createContract(this.contractAddresses[name]!, name) } }); // modular contracts if (this.contractAddresses['JUNIOR_OPERATOR']) { this.contracts['JUNIOR_OPERATOR'] = this.contractConfig['JUNIOR_OPERATOR'] - ? this.createContract(this.contractAddresses['JUNIOR_OPERATOR'], this.contractConfig['JUNIOR_OPERATOR']) - : this.createContract(this.contractAddresses['JUNIOR_OPERATOR'], 'ALLOWANCE_OPERATOR'); + ? this.createEthContract(this.contractAddresses['JUNIOR_OPERATOR'], this.contractConfig['JUNIOR_OPERATOR']) + : this.createEthContract(this.contractAddresses['JUNIOR_OPERATOR'], 'ALLOWANCE_OPERATOR'); + + this.ethersContracts['JUNIOR_OPERATOR'] = this.contractConfig['JUNIOR_OPERATOR'] + ? this.createContract(this.contractAddresses['JUNIOR_OPERATOR'], this.contractConfig['JUNIOR_OPERATOR']) + : this.createContract(this.contractAddresses['JUNIOR_OPERATOR'], 'ALLOWANCE_OPERATOR'); } if (this.contractAddresses['SENIOR_OPERATOR']) { this.contracts['SENIOR_OPERATOR'] = this.contractConfig['SENIOR_OPERATOR'] - ? this.createContract(this.contractAddresses['SENIOR_OPERATOR'], this.contractConfig['SENIOR_OPERATOR']) - : this.createContract(this.contractAddresses['SENIOR_OPERATOR'], 'ALLOWANCE_OPERATOR'); + ? this.createEthContract(this.contractAddresses['SENIOR_OPERATOR'], this.contractConfig['SENIOR_OPERATOR']) + : this.createEthContract(this.contractAddresses['SENIOR_OPERATOR'], 'ALLOWANCE_OPERATOR'); + + this.ethersContracts['SENIOR_OPERATOR'] = this.contractConfig['SENIOR_OPERATOR'] + ? this.createContract(this.contractAddresses['SENIOR_OPERATOR'], this.contractConfig['SENIOR_OPERATOR']) + : this.createContract(this.contractAddresses['SENIOR_OPERATOR'], 'ALLOWANCE_OPERATOR'); } } @@ -151,24 +165,32 @@ export default class Tinlake { }; } - setEthersConfig = (ethersConfig: EthersConfig) => { + setEthersConfig = (ethersConfig: EthersConfig | undefined) => { this.ethersConfig = { ...this.ethersConfig, ...ethersConfig, }; } - createContract(address: string, abiName: string) { + createEthContract(address: string, abiName: string) { const contract = this.eth.contract(this.contractAbis[abiName]).at(address); return contract; } - getContract(address: string, abiName: string): ethers.Contract | undefined { - return this.ethersConfig.signer ? new ethers.Contract( + createContract(address: string, abiName: string) { + return new ethers.Contract( + address, + this.contractAbis[abiName], + this.ethersConfig.provider, + ) + } + + getContract(address: string, abiName: string): ethers.Contract { + return new ethers.Contract( address, this.contractAbis[abiName], this.ethersConfig.signer, - ) : undefined; + ) } async getTransactionReceipt(tx: PendingTransaction): Promise { diff --git a/src/actions/admin.ts b/src/actions/admin.ts index f2b6e52..bd519ff 100644 --- a/src/actions/admin.ts +++ b/src/actions/admin.ts @@ -1,4 +1,4 @@ -import { ContractNames, Constructor, TinlakeParams } from '../Tinlake'; +import { ContractNames, Constructor, TinlakeParams, PendingTransaction } from '../Tinlake'; import { waitAndReturnEvents, executeAndRetry, ZERO_ADDRESS } from '../services/ethereum'; import BN from 'bn.js'; const web3 = require('web3-utils'); @@ -100,9 +100,16 @@ export function AdminActions>(Bas // ------------ admin functions lender-site ------------- setMinimumJuniorRatio = async (ratio: string) => { - const txHash = await executeAndRetry(this.contracts['ASSESSOR'].file, [web3.fromAscii('minJuniorRatio'), ratio, this.ethConfig]); - console.log(`[Assessor file] txHash: ${txHash}`); - return waitAndReturnEvents(this.eth, txHash, this.contracts['ASSESSOR'].abi, this.transactionTimeout); + // Source: https://github.com/ethereum/web3.js/issues/2256#issuecomment-462730550 + const tx = await this.ethersContracts['ASSESSOR'].connect(this.ethersConfig.signer).file(web3.fromAscii('minJuniorRatio').padEnd(66, '0'), ratio); + + console.log(this.transactionTimeout) + + return { + hash: tx.hash, + contractKey: 'ASSESSOR', + timesOutAt: Date.now() + this.transactionTimeout * 1000 + } } approveAllowanceJunior = async (user: string, maxCurrency: string, maxToken: string) => { @@ -144,7 +151,7 @@ export type IAdminActions = { canSetLoanPrice(user: string): Promise, initRate(rate: string): Promise, setRate(loan: string, rate: string): Promise, - setMinimumJuniorRatio(amount: string): Promise, + setMinimumJuniorRatio(amount: string): Promise, approveAllowanceJunior(user: string, maxCurrency: string, maxToken: string): Promise, approveAllowanceSenior(user: string, maxCurrency: string, maxToken: string): Promise, }; diff --git a/src/actions/analytics.ts b/src/actions/analytics.ts index 35b20bb..b4a1056 100644 --- a/src/actions/analytics.ts +++ b/src/actions/analytics.ts @@ -38,9 +38,11 @@ export function AnalyticsActions> } getOwnerOfCollateral = async (nftRegistryAddr:string, tokenId: string): Promise => { - const nft: any = this.eth.contract(this.contractAbis['COLLATERAL_NFT']).at(nftRegistryAddr); - const res : { 0: BN } = await executeAndRetry(nft.ownerOf, [tokenId]); - return res[0]; + return await this.getContract(nftRegistryAddr, 'COLLATERAL_NFT').ownerOf(tokenId) + + // const nft: any = this.eth.contract(this.contractAbis['COLLATERAL_NFT']).at(nftRegistryAddr); + // const res : { 0: BN } = await executeAndRetry(nft.ownerOf, [tokenId]); + // return res[0]; } getInterestRate = async (loanId: string): Promise => { diff --git a/src/actions/collateral.ts b/src/actions/collateral.ts index b7a91c8..0060266 100644 --- a/src/actions/collateral.ts +++ b/src/actions/collateral.ts @@ -1,4 +1,4 @@ -import { Constructor, TinlakeParams } from '../Tinlake'; +import { Constructor, TinlakeParams, PendingTransaction } from '../Tinlake'; import { waitAndReturnEvents, executeAndRetry } from '../services/ethereum'; import BN from 'bn.js'; @@ -13,26 +13,13 @@ export function CollateralActions return res.events[0].data[2].toString(); } - mintNFT = async (nftAddr: string, owner: string, tokenId: string, ref: string, amount: string, asset:string) => { + mintNFT = async (nftAddr: string, owner: string, tokenId: string, ref: string, amount: string, asset: string) => { const nftContract = this.getContract(nftAddr, 'COLLATERAL_NFT'); + const tx = await nftContract.mint(owner, tokenId, ref, amount, asset); - if (nftContract) { - try { - const tx = await nftContract.mint(owner, tokenId, ref, amount, asset); - - return { - hash: tx.hash, - contractKey: 'COLLATERAL_NFT', - timesOutAt: 0, - }; - } catch (error) { - return error; - } - } { - const nft: any = this.eth.contract(this.contractAbis['COLLATERAL_NFT']).at(nftAddr); - const txHash = await executeAndRetry(nft.mint, [owner, tokenId, ref, amount, asset, this.ethConfig]); - console.log(`[NFT.mint] txHash: ${txHash}`); - return waitAndReturnEvents(this.eth, txHash, this.contractAbis['COLLATERAL_NFT'], this.transactionTimeout); + return { + hash: tx.hash, + contractKey: 'COLLATERAL_NFT', } } @@ -44,15 +31,17 @@ export function CollateralActions } setNFTApprovalForAll = async (nftAddr: string, to: string, approved: boolean) => { - const nft: any = this.eth.contract(this.contractAbis['COLLATERAL_NFT']).at(nftAddr); - const txHash = await executeAndRetry(nft.setApprovalForAll, [to, approved, this.ethConfig]); - return waitAndReturnEvents(this.eth, txHash, this.contractAbis['COLLATERAL_NFT'], this.transactionTimeout); + const nftContract = this.getContract(nftAddr, 'COLLATERAL_NFT'); + const tx = await nftContract.setApprovalForAll(to, approved); + + return { + hash: tx.hash, + contractKey: 'COLLATERAL_NFT', + } } isNFTApprovedForAll = async (nftAddr: string, owner: string, operator: string) => { - const nft: any = this.eth.contract(this.contractAbis['COLLATERAL_NFT']).at(nftAddr); - const res: { 0: boolean } = await executeAndRetry(nft.isApprovedForAll, [owner, operator, this.ethConfig]); - return res[0]; + return await this.getContract(nftAddr, 'COLLATERAL_NFT').isApprovedForAll(owner, operator) } getNFTCount = async (nftAddr: string): Promise => { @@ -62,15 +51,18 @@ export function CollateralActions } getNFTData = async (nftAddr: string, tokenId: string): Promise => { - const nft: any = this.eth.contract(this.contractAbis['COLLATERAL_NFT']).at(nftAddr); - const res = await executeAndRetry(nft.data, [tokenId]); - return res; + return this.getContract(nftAddr, 'COLLATERAL_NFT').data(tokenId) + + // const nft: any = this.eth.contract(this.contractAbis['COLLATERAL_NFT']).at(nftAddr); + // const res = await executeAndRetry(nft.data, [tokenId]); + // return res; } getNFTOwner = async (nftAddr: string, tokenId: string): Promise => { - const nft: any = this.eth.contract(this.contractAbis['COLLATERAL_NFT']).at(nftAddr); - const res : { 0: BN } = await executeAndRetry(nft.ownerOf, [tokenId]); - return res[0]; + return await this.getContract(nftAddr, 'COLLATERAL_NFT').ownerOf(tokenId) + // const nft: any = this.eth.contract(this.contractAbis['COLLATERAL_NFT']).at(nftAddr); + // const res : { 0: BN } = await executeAndRetry(nft.ownerOf, [tokenId]); + // return res[0]; } transferNFT = async (nftAddr: string, from: string, to: string, tokenId: string) => { @@ -84,7 +76,7 @@ export function CollateralActions export type ICollateralActions = { mintTitleNFT(nftAddr:string, usr: string): Promise, - mintNFT(nftAddr:string, owner: string, tokenId: string, ref: string, amount: string, asset:string): Promise, + mintNFT(nftAddr: string, owner: string, tokenId: string, ref: string, amount: string, asset: string): Promise, approveNFT(nftAddr:string, tokenId: string, to: string) : Promise, setNFTApprovalForAll(nftAddr: string, to: string, approved: boolean): Promise, isNFTApprovedForAll(nftAddr: string, owner: string, operator: string): Promise, diff --git a/src/actions/currency.ts b/src/actions/currency.ts index ae8256a..c649db5 100644 --- a/src/actions/currency.ts +++ b/src/actions/currency.ts @@ -1,4 +1,4 @@ -import { Constructor, TinlakeParams } from '../Tinlake'; +import { Constructor, TinlakeParams, PendingTransaction } from '../Tinlake'; import { executeAndRetry, waitAndReturnEvents } from '../services/ethereum'; import BN from 'bn.js'; @@ -13,8 +13,9 @@ export function CurrencyActions>( } getCurrencyAllowance = async (owner: string, spender: string) => { - const res : { 0: BN } = await executeAndRetry(this.contracts['TINLAKE_CURRENCY'].allowance, [owner, spender]); - return res[0] || new BN(0); + const currencyContract = this.getContract(this.contractAddresses['TINLAKE_CURRENCY']!, 'TINLAKE_CURRENCY'); + const allowance = await currencyContract.allowance(owner, spender) + return allowance.toBN() } getJuniorForCurrencyAllowance = async (owner: string) => { @@ -33,9 +34,13 @@ export function CurrencyActions>( } approveCurrency = async (usr: string, currencyAmount: string) => { - const txHash = await executeAndRetry(this.contracts['TINLAKE_CURRENCY'].approve, [usr, currencyAmount, this.ethConfig]); - console.log(`[Currency.approve] txHash: ${txHash}`); - return waitAndReturnEvents(this.eth, txHash, this.contracts['TINLAKE_CURRENCY'].abi, this.transactionTimeout); + const currencyContract = this.getContract(this.contractAddresses['TINLAKE_CURRENCY']!, 'TINLAKE_CURRENCY'); + const tx = await currencyContract.approve(usr, currencyAmount); + + return { + hash: tx.hash, + contractKey: 'TINLAKE_CURRENCY', + } } approveSeniorForCurrency = async (currencyAmount: string) => { @@ -53,12 +58,12 @@ export function CurrencyActions>( export type ICurrencyActions = { mintCurrency(usr: string, amount: string): Promise, getCurrencyBalance(usr: string): Promise, - approveCurrency(usr: string, amount: string): Promise, getCurrencyAllowance: (owner: string, spender: string) => Promise; getJuniorForCurrencyAllowance: (owner: string) => Promise; getSeniorForCurrencyAllowance: (owner: string) => Promise; - approveSeniorForCurrency: (currencyAmount: string) => Promise; - approveJuniorForCurrency: (currencyAmount: string) => Promise; + approveCurrency(usr: string, amount: string): Promise, + approveSeniorForCurrency: (currencyAmount: string) => Promise; + approveJuniorForCurrency: (currencyAmount: string) => Promise; }; export default CurrencyActions; diff --git a/src/actions/lender.ts b/src/actions/lender.ts index 1939a5a..3bca7d7 100644 --- a/src/actions/lender.ts +++ b/src/actions/lender.ts @@ -1,15 +1,18 @@ -import { Constructor, TinlakeParams } from '../Tinlake'; +import { Constructor, TinlakeParams, PendingTransaction } from '../Tinlake'; import { executeAndRetry, waitAndReturnEvents } from '../services/ethereum'; import BN from 'bn.js'; export function LenderActions>(Base: ActionBase) { return class extends Base implements ILenderActions { - // senior tranch functions + // senior tranche functions supplySenior = async (currencyAmount: string) => { - const txHash = await executeAndRetry(this.contracts['SENIOR_OPERATOR'].supply, [currencyAmount, this.ethConfig]); - console.log(`[Supply] txHash: ${txHash}`); - return waitAndReturnEvents(this.eth, txHash, this.contracts['SENIOR_OPERATOR'].abi, this.transactionTimeout); + const tx = await this.ethersContracts['SENIOR_OPERATOR'].connect(this.ethersConfig.signer).supply(currencyAmount); + + return { + hash: tx.hash, + contractKey: 'SENIOR_OPERATOR', + } } redeemSenior = async (tokenAmount: string) => { @@ -31,9 +34,12 @@ export function LenderActions>(Bas // junior tranche functions supplyJunior = async (currencyAmount: string) => { - const txHash = await executeAndRetry(this.contracts['JUNIOR_OPERATOR'].supply, [currencyAmount, this.ethConfig]); - console.log(`[Supply] txHash: ${txHash}`); - return waitAndReturnEvents(this.eth, txHash, this.contracts['JUNIOR_OPERATOR'].abi, this.transactionTimeout); + const tx = await this.ethersContracts['JUNIOR_OPERATOR'].connect(this.ethersConfig.signer).supply(currencyAmount); + + return { + hash: tx.hash, + contractKey: 'JUNIOR_OPERATOR', + } } redeemJunior = async (tokenAmount: string) => { @@ -65,11 +71,11 @@ export function LenderActions>(Bas export type ILenderActions = { getSeniorTokenAllowance(owner: string): Promise, getJuniorTokenAllowance(owner: string): Promise; - supplyJunior(currencyAmount: string): Promise, + supplyJunior(currencyAmount: string): Promise, approveJuniorToken: (tokenAmount: string) => Promise; approveSeniorToken: (tokenAmount: string) => Promise; redeemJunior(tokenAmount: string): Promise, - supplySenior(currencyAmount: string): Promise, + supplySenior(currencyAmount: string): Promise, redeemSenior(tokenAmount: string): Promise, balance(): Promise, }; diff --git a/src/actions/proxy.ts b/src/actions/proxy.ts index fad4dc1..0db1556 100644 --- a/src/actions/proxy.ts +++ b/src/actions/proxy.ts @@ -9,8 +9,9 @@ export function ProxyActions>(Bas return class extends Base implements IProxyActions { getProxyAccessTokenOwner = async (tokenId: string): Promise => { - const res : { 0: BN } = await executeAndRetry(this.contracts['PROXY_REGISTRY'].ownerOf, [tokenId]); - return res[0]; + return await this.ethersContracts['PROXY_REGISTRY'].ownerOf(tokenId) + // const res : { 0: BN } = await executeAndRetry(this.contracts['PROXY_REGISTRY'].ownerOf, [tokenId]); + // return res[0]; } buildProxy = async (owner: string) => { @@ -26,9 +27,13 @@ export function ProxyActions>(Bas } getProxyAccessToken = async (proxyAddr: string) => { - const proxy: any = this.eth.contract(this.contractAbis['PROXY']).at(proxyAddr); - const res = await executeAndRetry(proxy.accessToken, []); - return res[0].toNumber(); + const proxy = this.getContract(proxyAddr, 'PROXY') + const accessToken = await proxy.accessToken() + return accessToken.toNumber() + + // const proxy: any = this.eth.contract(this.contractAbis['PROXY']).at(proxyAddr); + // const res = await executeAndRetry(proxy.accessToken, []); + // return res[0].toNumber(); } getProxyOwnerByLoan = async (loanId: string) => { @@ -66,7 +71,7 @@ export function ProxyActions>(Bas } proxyIssue = async (proxyAddr: string, nftRegistryAddr: string, tokenId: string) => { - const proxy: any = this.eth.contract(this.contractAbis['PROXY']).at(proxyAddr); + const proxy = this.getContract(proxyAddr, 'PROXY'); const encoded = abiCoder.encodeFunctionCall({ name: 'issue', @@ -74,16 +79,21 @@ export function ProxyActions>(Bas inputs: [ { type: 'address', name: 'shelf' }, { type: 'address', name: 'registry' }, - { type: 'uint256', name: 'token' }]}, [this.contracts['SHELF'].address, nftRegistryAddr, tokenId], + { type: 'uint256', name: 'token' }]}, [this.ethersContracts['SHELF'].address, nftRegistryAddr, tokenId], ); - const txHash = await executeAndRetry(proxy.execute, [this.contracts['ACTIONS'].address, encoded, this.ethConfig]); - console.log(`[Proxy Issue Loan] txHash: ${txHash}`); - return waitAndReturnEvents(this.eth, txHash, this.contractAbis['PROXY'], this.transactionTimeout); + const tx = await proxy.execute(this.ethersContracts['ACTIONS'].address, encoded); + + return { + hash: tx.hash, + contractKey: 'PROXY', + } } - proxyTransferIssue = async (proxyAddr: string, nftRegistryAddr: string, tokenId: string) => { - const proxy: any = this.eth.contract(this.contractAbis['PROXY']).at(proxyAddr); + proxyTransferIssue = async (proxyAddr: string, nftRegistryAddr: string, tokenId: string) => { + const proxy = this.getContract(proxyAddr, 'PROXY'); + + // const proxy: any = this.eth.contract(this.contractAbis['PROXY']).at(PROXY); const encoded = abiCoder.encodeFunctionCall({ name: 'transferIssue', @@ -91,12 +101,15 @@ export function ProxyActions>(Bas inputs: [ { type: 'address', name: 'shelf' }, { type: 'address', name: 'registry' }, - { type: 'uint256', name: 'token' }]}, [this.contracts['SHELF'].address, nftRegistryAddr, tokenId], + { type: 'uint256', name: 'token' }]}, [this.ethersContracts['SHELF'].address, nftRegistryAddr, tokenId], ); - const txHash = await executeAndRetry(proxy.execute, [this.contracts['ACTIONS'].address, encoded, this.ethConfig]); - console.log(`[Proxy Transfer Issue Loan] txHash: ${txHash}`); - return waitAndReturnEvents(this.eth, txHash, this.contractAbis['PROXY'], this.transactionTimeout); + const tx = await proxy.execute(this.ethersContracts['ACTIONS'].address, encoded); + + return { + hash: tx.hash, + contractKey: 'PROXY', + } } proxyLockBorrowWithdraw = async (proxyAddr: string, loanId: string, amount: string, usr: string) => { @@ -105,11 +118,11 @@ export function ProxyActions>(Bas name: 'lockBorrowWithdraw', type :'function', inputs: [ - { type: 'address', name: 'shelf' }, - { type: 'uint256', name: 'loan' }, - { type: 'uint256', name: 'amount' }, - { type: 'address', name: 'usr' }]}, - [this.contracts['SHELF'].address, loanId, amount, usr], + { type: 'address', name: 'shelf' }, + { type: 'uint256', name: 'loan' }, + { type: 'uint256', name: 'amount' }, + { type: 'address', name: 'usr' }]}, + [this.contracts['SHELF'].address, loanId, amount, usr], ); const txHash = await executeAndRetry(proxy.execute, [this.contracts['ACTIONS'].address, encoded, this.ethConfig]); console.log(`[Proxy Lock Borrow Withdraw] txHash: ${txHash}`); @@ -122,13 +135,13 @@ export function ProxyActions>(Bas name: 'repayUnlockClose', type :'function', inputs: [ - { type: 'address', name: 'shelf' }, - { type: 'address', name: 'pile' }, - { type: 'address', name: 'registry' }, - { type: 'uint256', name: 'token' }, - { type: 'address', name: 'erc20' }, - { type: 'uint256', name: 'loan' }]}, - [this.contracts['SHELF'].address, this.contracts['PILE'].address, registry, tokenId, this.contracts['TINLAKE_CURRENCY'].address, loanId], + { type: 'address', name: 'shelf' }, + { type: 'address', name: 'pile' }, + { type: 'address', name: 'registry' }, + { type: 'uint256', name: 'token' }, + { type: 'address', name: 'erc20' }, + { type: 'uint256', name: 'loan' }]}, + [this.contracts['SHELF'].address, this.contracts['PILE'].address, registry, tokenId, this.contracts['TINLAKE_CURRENCY'].address, loanId], ); const txHash = await executeAndRetry(proxy.execute, [this.contracts['ACTIONS'].address, encoded, this.ethConfig]); console.log(`[Proxy Repay Unlock Close] txHash: ${txHash}`); From ca944bd09db277543304cc4aac58265a2c5bd711 Mon Sep 17 00:00:00 2001 From: Jeroen Offerijns Date: Tue, 25 Aug 2020 20:51:17 +0200 Subject: [PATCH 05/65] chore: format --- docs/classes/_tinlake_.tinlake.html | 42 ++++++------- docs/interfaces/_services_ethereum_.ethi.html | 16 ++--- .../_services_ethereum_.events.html | 6 +- docs/modules/_actions_admin_.html | 30 +++++----- docs/modules/_actions_analytics_.html | 60 +++++++++---------- docs/modules/_actions_borrower_.html | 20 +++---- docs/modules/_actions_collateral_.html | 22 +++---- docs/modules/_actions_currency_.html | 10 ++-- docs/modules/_actions_governance_.html | 4 +- docs/modules/_actions_index_.html | 2 +- docs/modules/_actions_lender_.html | 18 +++--- docs/modules/_actions_proxy_.html | 30 +++++----- docs/modules/_services_ethereum_.html | 10 ++-- docs/modules/_tinlake_.html | 20 +++---- docs/modules/_types_tinlake_.html | 10 ++-- docs/modules/_utils_basetodisplay_.html | 2 +- docs/modules/_utils_bntohex_.html | 2 +- docs/modules/_utils_displaytobase_.html | 2 +- docs/modules/_utils_feetointerestrate_.html | 2 +- docs/modules/_utils_getloanstatus_.html | 4 +- docs/modules/_utils_interestratetofee_.html | 2 +- src/Tinlake.ts | 6 +- src/actions/admin.ts | 6 +- src/actions/analytics.ts | 2 +- src/actions/collateral.ts | 10 ++-- src/actions/currency.ts | 6 +- src/actions/lender.ts | 4 +- src/actions/proxy.ts | 16 ++--- 28 files changed, 182 insertions(+), 182 deletions(-) diff --git a/docs/classes/_tinlake_.tinlake.html b/docs/classes/_tinlake_.tinlake.html index f9e1326..3340353 100644 --- a/docs/classes/_tinlake_.tinlake.html +++ b/docs/classes/_tinlake_.tinlake.html @@ -128,7 +128,7 @@

    constructor

  • Parameters

    @@ -150,7 +150,7 @@

    contractAbis

    contractAbis: ContractAbis
    @@ -160,7 +160,7 @@

    contractAddresses

    contractAddresses: ContractAddresses
    @@ -170,7 +170,7 @@

    contractConfig

    contractConfig: any
    @@ -180,7 +180,7 @@

    contracts

    contracts: Contracts
    @@ -190,7 +190,7 @@

    eth

    eth: ethI
    @@ -200,7 +200,7 @@

    ethConfig

    ethConfig: EthConfig
    @@ -210,7 +210,7 @@

    ethOptions

    ethOptions: any
    @@ -220,7 +220,7 @@

    ethersConfig

    ethersConfig: EthersConfig
    @@ -230,7 +230,7 @@

    ethersContracts

    ethersContracts: Contracts
    @@ -240,7 +240,7 @@

    provider

    provider: any
    @@ -250,7 +250,7 @@

    transactionTimeout

    transactionTimeout: number
    @@ -267,7 +267,7 @@

    createContract

  • Parameters

    @@ -293,7 +293,7 @@

    createEthContract

  • Parameters

    @@ -319,7 +319,7 @@

    getContract

  • Parameters

    @@ -345,7 +345,7 @@

    getOperatorType

  • Parameters

    @@ -368,7 +368,7 @@

    getTransactionReceipt

  • Parameters

    @@ -391,7 +391,7 @@

    setContracts

  • Returns void

    @@ -408,7 +408,7 @@

    setEthConfig

  • Parameters

    @@ -431,7 +431,7 @@

    setEthersConfig

  • Parameters

    @@ -454,7 +454,7 @@

    setProvider

  • Parameters

    diff --git a/docs/interfaces/_services_ethereum_.ethi.html b/docs/interfaces/_services_ethereum_.ethi.html index a219e67..6044540 100644 --- a/docs/interfaces/_services_ethereum_.ethi.html +++ b/docs/interfaces/_services_ethereum_.ethi.html @@ -101,7 +101,7 @@

    abi

    abi: any
    @@ -111,7 +111,7 @@

    contract

    contract: (arg0: any) => { at: (arg0: any) => void }
    @@ -165,7 +165,7 @@

    getTransactionByHash

    getTransactionByHash: (arg0: any, arg1: (err: any, tx: any) => void) => void
    @@ -220,7 +220,7 @@

    getTransactionCount

    getTransactionCount: any
    @@ -230,7 +230,7 @@

    getTransactionReceipt

    getTransactionReceipt: (arg0: any, arg1: (err: any, receipt: any) => void) => void
    @@ -285,7 +285,7 @@

    send

    send: Function
    @@ -295,7 +295,7 @@

    sendRawTransaction

    sendRawTransaction: any
    @@ -305,7 +305,7 @@

    web3_sha3

    web3_sha3: (signature: string) => string
    diff --git a/docs/interfaces/_services_ethereum_.events.html b/docs/interfaces/_services_ethereum_.events.html index 4dafa21..144afde 100644 --- a/docs/interfaces/_services_ethereum_.events.html +++ b/docs/interfaces/_services_ethereum_.events.html @@ -96,7 +96,7 @@

    events

    events: { data: any[]; event: { name: any } }[]
    @@ -106,7 +106,7 @@

    status

    status: any
    @@ -116,7 +116,7 @@

    txHash

    txHash: string
    diff --git a/docs/modules/_actions_admin_.html b/docs/modules/_actions_admin_.html index 5a59920..11791f4 100644 --- a/docs/modules/_actions_admin_.html +++ b/docs/modules/_actions_admin_.html @@ -89,7 +89,7 @@

    IAdminActions

    IAdminActions: { approveAllowanceJunior: any; approveAllowanceSenior: any; canSetInterestRate: any; canSetInvestorAllowanceJunior: any; canSetInvestorAllowanceSenior: any; canSetLoanPrice: any; canSetMinimumJuniorRatio: any; canSetRiskScore: any; canSetSeniorTrancheInterest: any; initRate: any; isWard: any; setMinimumJuniorRatio: any; setRate: any }
    @@ -104,7 +104,7 @@
    approveAllowanceJunior:
  • Parameters

    @@ -132,7 +132,7 @@
    approveAllowanceSenior:
  • Parameters

    @@ -160,7 +160,7 @@
    canSetInterestRate:

    Parameters

    @@ -182,7 +182,7 @@
    canSetInvestorAllowanceJunior

    Parameters

    @@ -204,7 +204,7 @@
    canSetInvestorAllowanceSenior

    Parameters

    @@ -226,7 +226,7 @@
    canSetLoanPrice: fu
  • Parameters

    @@ -248,7 +248,7 @@
    canSetMinimumJuniorRatio

    Parameters

    @@ -270,7 +270,7 @@
    canSetRiskScore: fu
  • Parameters

    @@ -292,7 +292,7 @@
    canSetSeniorTrancheInterest

    Parameters

    @@ -314,7 +314,7 @@
    initRate: function
  • Parameters

    @@ -336,7 +336,7 @@
    isWard: function
  • Parameters

    @@ -361,7 +361,7 @@
    setMinimumJuniorRatio:

    Parameters

    @@ -383,7 +383,7 @@
    setRate: function
  • Parameters

    @@ -415,7 +415,7 @@

    AdminActions

  • Type parameters

    diff --git a/docs/modules/_actions_analytics_.html b/docs/modules/_actions_analytics_.html index b38961a..5d33c7d 100644 --- a/docs/modules/_actions_analytics_.html +++ b/docs/modules/_actions_analytics_.html @@ -89,7 +89,7 @@

    IAnalyticsActions

    IAnalyticsActions: { existsSenior: any; getAssetValueJunior: any; getCollateral: any; getCurrentJuniorRatio: any; getDebt: any; getInterestRate: any; getInvestor: any; getJuniorReserve: any; getJuniorTokenBalance: any; getLoan: any; getLoanList: any; getMaxRedeemAmountJunior: any; getMaxRedeemAmountSenior: any; getMaxSupplyAmountJunior: any; getMaxSupplyAmountSenior: any; getMinJuniorRatio: any; getOwnerOfCollateral: any; getOwnerOfLoan: any; getPrincipal: any; getSeniorDebt: any; getSeniorInterestRate: any; getSeniorReserve: any; getSeniorTokenBalance: any; getTokenPriceJunior: any; getTokenPriceSenior: any; getTotalBalance: any; getTotalDebt: any; loanCount: any }
    @@ -104,7 +104,7 @@
    existsSenior: function
  • Returns boolean

    @@ -120,7 +120,7 @@
    getAssetValueJunior:

    Returns Promise<BN>

    @@ -136,7 +136,7 @@
    getCollateral: function
  • Parameters

    @@ -158,7 +158,7 @@
    getCurrentJuniorRatio:

    Returns Promise<BN>

    @@ -174,7 +174,7 @@
    getDebt: function
  • Parameters

    @@ -196,7 +196,7 @@
    getInterestRate: functio
  • Parameters

    @@ -218,7 +218,7 @@
    getInvestor: function
  • Parameters

    @@ -240,7 +240,7 @@
    getJuniorReserve: functi
  • Returns Promise<BN>

    @@ -256,7 +256,7 @@
    getJuniorTokenBalance:

    Parameters

    @@ -278,7 +278,7 @@
    getLoan: function
  • Parameters

    @@ -300,7 +300,7 @@
    getLoanList: function

    Returns Promise<Loan[]>

    @@ -316,7 +316,7 @@
    getMaxRedeemAmountJunior

    Parameters

    @@ -338,7 +338,7 @@
    getMaxRedeemAmountSenior

    Parameters

    @@ -360,7 +360,7 @@
    getMaxSupplyAmountJunior

    Parameters

    @@ -382,7 +382,7 @@
    getMaxSupplyAmountSenior

    Parameters

    @@ -404,7 +404,7 @@
    getMinJuniorRatio:
  • Returns Promise<BN>

    @@ -420,7 +420,7 @@
    getOwnerOfCollateral: fu
  • Parameters

    @@ -448,7 +448,7 @@
    getOwnerOfLoan: function
  • Parameters

    @@ -470,7 +470,7 @@
    getPrincipal: function
  • Parameters

    @@ -492,7 +492,7 @@
    getSeniorDebt: function<
  • Returns Promise<BN>

    @@ -508,7 +508,7 @@
    getSeniorInterestRate:

    Returns Promise<BN>

    @@ -524,7 +524,7 @@
    getSeniorReserve: functi
  • Returns Promise<BN>

    @@ -540,7 +540,7 @@
    getSeniorTokenBalance:

    Parameters

    @@ -562,7 +562,7 @@
    getTokenPriceJunior:

    Returns Promise<BN>

    @@ -578,7 +578,7 @@
    getTokenPriceSenior:

    Parameters

    @@ -600,7 +600,7 @@
    getTotalBalance: functio
  • Returns Promise<BN>

    @@ -616,7 +616,7 @@
    getTotalDebt: function

    Returns Promise<BN>

    @@ -632,7 +632,7 @@
    loanCount: function
  • Returns Promise<BN>

    @@ -655,7 +655,7 @@

    AnalyticsActions

  • Type parameters

    diff --git a/docs/modules/_actions_borrower_.html b/docs/modules/_actions_borrower_.html index 4eae317..b1472d4 100644 --- a/docs/modules/_actions_borrower_.html +++ b/docs/modules/_actions_borrower_.html @@ -89,7 +89,7 @@

    IBorrowerActions

    IBorrowerActions: { borrow: any; close: any; issue: any; lock: any; nftLookup: any; repay: any; unlock: any; withdraw: any }
    @@ -104,7 +104,7 @@
    borrow: function
  • Parameters

    @@ -129,7 +129,7 @@
    close: function
  • Parameters

    @@ -151,7 +151,7 @@
    issue: function
  • Parameters

    @@ -176,7 +176,7 @@
    lock: function
  • Parameters

    @@ -198,7 +198,7 @@
    nftLookup: function
  • Parameters

    @@ -223,7 +223,7 @@
    repay: function
  • Parameters

    @@ -248,7 +248,7 @@
    unlock: function
  • Parameters

    @@ -270,7 +270,7 @@
    withdraw: function
  • Parameters

    @@ -305,7 +305,7 @@

    BorrowerActions

  • Type parameters

    diff --git a/docs/modules/_actions_collateral_.html b/docs/modules/_actions_collateral_.html index 4650f27..ccf9991 100644 --- a/docs/modules/_actions_collateral_.html +++ b/docs/modules/_actions_collateral_.html @@ -89,7 +89,7 @@

    ICollateralActions

    ICollateralActions: { approveNFT: any; getNFTCount: any; getNFTData: any; getNFTOwner: any; isNFTApprovedForAll: any; mintNFT: any; mintTitleNFT: any; setNFTApprovalForAll: any; transferNFT: any }
    @@ -104,7 +104,7 @@
    approveNFT: function
  • Parameters

    @@ -132,7 +132,7 @@
    getNFTCount: function
  • Parameters

    @@ -154,7 +154,7 @@
    getNFTData: function
  • Parameters

    @@ -179,7 +179,7 @@
    getNFTOwner: function
  • Parameters

    @@ -204,7 +204,7 @@
    isNFTApprovedForAll: fun
  • Parameters

    @@ -232,7 +232,7 @@
    mintNFT: function
  • Parameters

    @@ -269,7 +269,7 @@
    mintTitleNFT: function
  • Parameters

    @@ -294,7 +294,7 @@
    setNFTApprovalForAll: fu
  • Parameters

    @@ -322,7 +322,7 @@
    transferNFT: function
  • Parameters

    @@ -360,7 +360,7 @@

    CollateralActions

  • Type parameters

    diff --git a/docs/modules/_actions_currency_.html b/docs/modules/_actions_currency_.html index 543f931..d242200 100644 --- a/docs/modules/_actions_currency_.html +++ b/docs/modules/_actions_currency_.html @@ -89,7 +89,7 @@

    ICurrencyActions

    ICurrencyActions: { approveJuniorForCurrency: (currencyAmount: string) => Promise<PendingTransaction | undefined>; approveSeniorForCurrency: (currencyAmount: string) => Promise<PendingTransaction | undefined>; getCurrencyAllowance: (owner: string, spender: string) => Promise<BN>; getJuniorForCurrencyAllowance: (owner: string) => Promise<BN | undefined>; getSeniorForCurrencyAllowance: (owner: string) => Promise<BN | undefined>; approveCurrency: any; getCurrencyBalance: any; mintCurrency: any }
    @@ -212,7 +212,7 @@
    approveCurrency: function

    Parameters

    @@ -237,7 +237,7 @@
    getCurrencyBalance: func
  • Parameters

    @@ -259,7 +259,7 @@
    mintCurrency: function
  • Parameters

    @@ -291,7 +291,7 @@

    CurrencyActions

  • Type parameters

    diff --git a/docs/modules/_actions_governance_.html b/docs/modules/_actions_governance_.html index 4a53c3d..1241540 100644 --- a/docs/modules/_actions_governance_.html +++ b/docs/modules/_actions_governance_.html @@ -83,7 +83,7 @@

    IGovernanceActions

    IGovernanceActions: { relyAddress: any }
    @@ -98,7 +98,7 @@
    relyAddress: function
  • Parameters

    diff --git a/docs/modules/_actions_index_.html b/docs/modules/_actions_index_.html index e7f2d97..bdbaad0 100644 --- a/docs/modules/_actions_index_.html +++ b/docs/modules/_actions_index_.html @@ -83,7 +83,7 @@

    TinlakeActions

    diff --git a/docs/modules/_actions_lender_.html b/docs/modules/_actions_lender_.html index e217b82..ffeb1ed 100644 --- a/docs/modules/_actions_lender_.html +++ b/docs/modules/_actions_lender_.html @@ -89,7 +89,7 @@

    ILenderActions

    ILenderActions: { approveJuniorToken: (tokenAmount: string) => Promise<unknown>; approveSeniorToken: (tokenAmount: string) => Promise<unknown>; balance: any; getJuniorTokenAllowance: any; getSeniorTokenAllowance: any; redeemJunior: any; redeemSenior: any; supplyJunior: any; supplySenior: any }
    @@ -146,7 +146,7 @@
    balance: function
  • Returns Promise<any>

    @@ -162,7 +162,7 @@
    getJuniorTokenAllowance: <
  • Parameters

    @@ -184,7 +184,7 @@
    getSeniorTokenAllowance: <
  • Parameters

    @@ -206,7 +206,7 @@
    redeemJunior: function
  • Parameters

    @@ -228,7 +228,7 @@
    redeemSenior: function
  • Parameters

    @@ -250,7 +250,7 @@
    supplyJunior: function
  • Parameters

    @@ -272,7 +272,7 @@
    supplySenior: function
  • Parameters

    @@ -301,7 +301,7 @@

    LenderActions

  • Type parameters

    diff --git a/docs/modules/_actions_proxy_.html b/docs/modules/_actions_proxy_.html index 532ffc5..7abba0c 100644 --- a/docs/modules/_actions_proxy_.html +++ b/docs/modules/_actions_proxy_.html @@ -89,7 +89,7 @@

    IProxyActions

    IProxyActions: { buildProxy: any; checkProxyExists: any; getProxy: any; getProxyAccessToken: any; getProxyAccessTokenOwner: any; getProxyOwnerByAddress: any; getProxyOwnerByLoan: any; proxyCount: any; proxyCreateNew: any; proxyIssue: any; proxyLockBorrowWithdraw: any; proxyRepayUnlockClose: any; proxyTransferIssue: any }
    @@ -104,7 +104,7 @@
    buildProxy: function
  • Parameters

    @@ -126,7 +126,7 @@
    checkProxyExists: functi
  • Parameters

    @@ -148,7 +148,7 @@
    getProxy: function
  • Parameters

    @@ -170,7 +170,7 @@
    getProxyAccessToken:

    Parameters

    @@ -192,7 +192,7 @@
    getProxyAccessTokenOwner

    Parameters

    @@ -214,7 +214,7 @@
    getProxyOwnerByAddress:

    Parameters

    @@ -236,7 +236,7 @@
    getProxyOwnerByLoan:

    Parameters

    @@ -258,7 +258,7 @@
    proxyCount: function
  • Returns Promise<any>

    @@ -274,7 +274,7 @@
    proxyCreateNew: function
  • Parameters

    @@ -296,7 +296,7 @@
    proxyIssue: function
  • Parameters

    @@ -324,7 +324,7 @@
    proxyLockBorrowWithdraw: <
  • Parameters

    @@ -355,7 +355,7 @@
    proxyRepayUnlockClose:

    Parameters

    @@ -386,7 +386,7 @@
    proxyTransferIssue: func
  • Parameters

    @@ -421,7 +421,7 @@

    ProxyActions

  • Type parameters

    diff --git a/docs/modules/_services_ethereum_.html b/docs/modules/_services_ethereum_.html index 92ae61c..5e1f768 100644 --- a/docs/modules/_services_ethereum_.html +++ b/docs/modules/_services_ethereum_.html @@ -99,7 +99,7 @@

    Const ZERO_ADDRESS

    ZERO_ADDRESS: "0x0000000000000000000000000000000000000000" = "0x0000000000000000000000000000000000000000"
    @@ -116,7 +116,7 @@

    executeAndRetry

  • Parameters

    @@ -142,7 +142,7 @@

    Const findEvent

  • Parameters

    @@ -209,7 +209,7 @@

    Const waitAndReturn

    Parameters

    @@ -241,7 +241,7 @@

    Const waitForTransactio
  • Parameters

    diff --git a/docs/modules/_tinlake_.html b/docs/modules/_tinlake_.html index 2ca9fe1..de54a14 100644 --- a/docs/modules/_tinlake_.html +++ b/docs/modules/_tinlake_.html @@ -98,7 +98,7 @@

    Constructor

    Constructor<T>: {}

    Type parameters

    @@ -119,7 +119,7 @@

    ContractAbis

    ContractAbis: {}
    @@ -134,7 +134,7 @@

    ContractAddresses

    ContractAddresses: {}
    @@ -149,7 +149,7 @@

    ContractNames

    ContractNames: typeof contractNames[number]
    @@ -159,7 +159,7 @@

    Contracts

    Contracts: {}
    @@ -174,7 +174,7 @@

    EthConfig

    EthConfig: { from?: undefined | string; gas?: undefined | string; gasPrice?: undefined | string }
    @@ -198,7 +198,7 @@

    EthersConfig

    EthersConfig: { overrides?: EthersOverrides; provider: Provider; signer: Signer }
    @@ -222,7 +222,7 @@

    EthersOverrides

    EthersOverrides: { gasLimit?: undefined | number; gasPrice?: undefined | number }
    @@ -243,7 +243,7 @@

    PendingTransaction

    PendingTransaction: { contractKey: string; hash: string; timesOutAt?: undefined | number }
    @@ -267,7 +267,7 @@

    TinlakeParams

    TinlakeParams: { contractAbis?: ContractAbis | {}; contractAddresses?: ContractAddresses | {}; contractConfig?: any | {}; contracts?: Contracts | {}; ethConfig?: EthConfig; ethOptions?: any | {}; ethersConfig?: EthersConfig; provider: any; transactionTimeout: number }
    diff --git a/docs/modules/_types_tinlake_.html b/docs/modules/_types_tinlake_.html index ea47d62..41c2342 100644 --- a/docs/modules/_types_tinlake_.html +++ b/docs/modules/_types_tinlake_.html @@ -87,7 +87,7 @@

    ITinlake

    @@ -97,7 +97,7 @@

    Investor

    Investor: { address: string; junior: { maxRedeem: BN; maxSupply: BN; tokenBalance: BN }; senior: { maxRedeem?: BN; maxSupply?: BN; tokenBalance?: BN } }
    @@ -143,7 +143,7 @@

    Loan

    Loan: { debt: BN; interestRate: BN; loanId: string; nft?: NFT; ownerOf: BN; price?: BN; principal: BN; proxyOwner?: undefined | string; registry: string; status?: undefined | string; threshold?: BN; tokenId: BN }
    @@ -194,7 +194,7 @@

    NFT

    NFT: { nftData: any; nftOwner: string; registry: string; tokenId: BN }
    @@ -221,7 +221,7 @@

    Tranche

    Tranche: { availableFunds: BN; interestRate?: BN; token: string; tokenPrice: BN; totalSupply: BN; type: string }
    diff --git a/docs/modules/_utils_basetodisplay_.html b/docs/modules/_utils_basetodisplay_.html index 8415402..c602643 100644 --- a/docs/modules/_utils_basetodisplay_.html +++ b/docs/modules/_utils_basetodisplay_.html @@ -87,7 +87,7 @@

    Const baseToDisplay

  • Parameters

    diff --git a/docs/modules/_utils_bntohex_.html b/docs/modules/_utils_bntohex_.html index 1147c66..5be3f71 100644 --- a/docs/modules/_utils_bntohex_.html +++ b/docs/modules/_utils_bntohex_.html @@ -87,7 +87,7 @@

    Const bnToHex

  • Parameters

    diff --git a/docs/modules/_utils_displaytobase_.html b/docs/modules/_utils_displaytobase_.html index d00e164..7b1bc8c 100644 --- a/docs/modules/_utils_displaytobase_.html +++ b/docs/modules/_utils_displaytobase_.html @@ -87,7 +87,7 @@

    Const displayToBase

  • Parameters

    diff --git a/docs/modules/_utils_feetointerestrate_.html b/docs/modules/_utils_feetointerestrate_.html index 9283e14..68fe516 100644 --- a/docs/modules/_utils_feetointerestrate_.html +++ b/docs/modules/_utils_feetointerestrate_.html @@ -87,7 +87,7 @@

    Const feeToInterestRate
  • diff --git a/docs/modules/_utils_getloanstatus_.html b/docs/modules/_utils_getloanstatus_.html index d988409..03d8af1 100644 --- a/docs/modules/_utils_getloanstatus_.html +++ b/docs/modules/_utils_getloanstatus_.html @@ -89,7 +89,7 @@

    LoanStatus

    LoanStatus: "Whitelisted" | "Ongoing" | "Repaid"
    @@ -106,7 +106,7 @@

    getLoanStatus

  • Parameters

    diff --git a/docs/modules/_utils_interestratetofee_.html b/docs/modules/_utils_interestratetofee_.html index 9faf59e..ab9fb49 100644 --- a/docs/modules/_utils_interestratetofee_.html +++ b/docs/modules/_utils_interestratetofee_.html @@ -87,7 +87,7 @@

    Const interestRateToFee
  • diff --git a/src/Tinlake.ts b/src/Tinlake.ts index fa72925..14d7f59 100644 --- a/src/Tinlake.ts +++ b/src/Tinlake.ts @@ -133,7 +133,7 @@ export default class Tinlake { contractNames.forEach((name) => { if (this.contractAbis[name] && this.contractAddresses[name]) { this.contracts[name] = this.eth.contract(this.contractAbis[name]).at(this.contractAddresses[name]); - this.ethersContracts[name] = this.createContract(this.contractAddresses[name]!, name) + this.ethersContracts[name] = this.createContract(this.contractAddresses[name]!, name); } }); @@ -182,7 +182,7 @@ export default class Tinlake { address, this.contractAbis[abiName], this.ethersConfig.provider, - ) + ); } getContract(address: string, abiName: string): ethers.Contract { @@ -190,7 +190,7 @@ export default class Tinlake { address, this.contractAbis[abiName], this.ethersConfig.signer, - ) + ); } async getTransactionReceipt(tx: PendingTransaction): Promise { diff --git a/src/actions/admin.ts b/src/actions/admin.ts index bd519ff..b88b09e 100644 --- a/src/actions/admin.ts +++ b/src/actions/admin.ts @@ -103,13 +103,13 @@ export function AdminActions>(Bas // Source: https://github.com/ethereum/web3.js/issues/2256#issuecomment-462730550 const tx = await this.ethersContracts['ASSESSOR'].connect(this.ethersConfig.signer).file(web3.fromAscii('minJuniorRatio').padEnd(66, '0'), ratio); - console.log(this.transactionTimeout) + console.log(this.transactionTimeout); return { hash: tx.hash, contractKey: 'ASSESSOR', - timesOutAt: Date.now() + this.transactionTimeout * 1000 - } + timesOutAt: Date.now() + this.transactionTimeout * 1000, + }; } approveAllowanceJunior = async (user: string, maxCurrency: string, maxToken: string) => { diff --git a/src/actions/analytics.ts b/src/actions/analytics.ts index b4a1056..efdd6da 100644 --- a/src/actions/analytics.ts +++ b/src/actions/analytics.ts @@ -38,7 +38,7 @@ export function AnalyticsActions> } getOwnerOfCollateral = async (nftRegistryAddr:string, tokenId: string): Promise => { - return await this.getContract(nftRegistryAddr, 'COLLATERAL_NFT').ownerOf(tokenId) + return await this.getContract(nftRegistryAddr, 'COLLATERAL_NFT').ownerOf(tokenId); // const nft: any = this.eth.contract(this.contractAbis['COLLATERAL_NFT']).at(nftRegistryAddr); // const res : { 0: BN } = await executeAndRetry(nft.ownerOf, [tokenId]); diff --git a/src/actions/collateral.ts b/src/actions/collateral.ts index 0060266..7f9694e 100644 --- a/src/actions/collateral.ts +++ b/src/actions/collateral.ts @@ -20,7 +20,7 @@ export function CollateralActions return { hash: tx.hash, contractKey: 'COLLATERAL_NFT', - } + }; } approveNFT = async (nftAddr: string, tokenId: string, to: string) => { @@ -37,11 +37,11 @@ export function CollateralActions return { hash: tx.hash, contractKey: 'COLLATERAL_NFT', - } + }; } isNFTApprovedForAll = async (nftAddr: string, owner: string, operator: string) => { - return await this.getContract(nftAddr, 'COLLATERAL_NFT').isApprovedForAll(owner, operator) + return await this.getContract(nftAddr, 'COLLATERAL_NFT').isApprovedForAll(owner, operator); } getNFTCount = async (nftAddr: string): Promise => { @@ -51,7 +51,7 @@ export function CollateralActions } getNFTData = async (nftAddr: string, tokenId: string): Promise => { - return this.getContract(nftAddr, 'COLLATERAL_NFT').data(tokenId) + return this.getContract(nftAddr, 'COLLATERAL_NFT').data(tokenId); // const nft: any = this.eth.contract(this.contractAbis['COLLATERAL_NFT']).at(nftAddr); // const res = await executeAndRetry(nft.data, [tokenId]); @@ -59,7 +59,7 @@ export function CollateralActions } getNFTOwner = async (nftAddr: string, tokenId: string): Promise => { - return await this.getContract(nftAddr, 'COLLATERAL_NFT').ownerOf(tokenId) + return await this.getContract(nftAddr, 'COLLATERAL_NFT').ownerOf(tokenId); // const nft: any = this.eth.contract(this.contractAbis['COLLATERAL_NFT']).at(nftAddr); // const res : { 0: BN } = await executeAndRetry(nft.ownerOf, [tokenId]); // return res[0]; diff --git a/src/actions/currency.ts b/src/actions/currency.ts index c649db5..0327326 100644 --- a/src/actions/currency.ts +++ b/src/actions/currency.ts @@ -14,8 +14,8 @@ export function CurrencyActions>( getCurrencyAllowance = async (owner: string, spender: string) => { const currencyContract = this.getContract(this.contractAddresses['TINLAKE_CURRENCY']!, 'TINLAKE_CURRENCY'); - const allowance = await currencyContract.allowance(owner, spender) - return allowance.toBN() + const allowance = await currencyContract.allowance(owner, spender); + return allowance.toBN(); } getJuniorForCurrencyAllowance = async (owner: string) => { @@ -40,7 +40,7 @@ export function CurrencyActions>( return { hash: tx.hash, contractKey: 'TINLAKE_CURRENCY', - } + }; } approveSeniorForCurrency = async (currencyAmount: string) => { diff --git a/src/actions/lender.ts b/src/actions/lender.ts index 3bca7d7..f0b20d0 100644 --- a/src/actions/lender.ts +++ b/src/actions/lender.ts @@ -12,7 +12,7 @@ export function LenderActions>(Bas return { hash: tx.hash, contractKey: 'SENIOR_OPERATOR', - } + }; } redeemSenior = async (tokenAmount: string) => { @@ -39,7 +39,7 @@ export function LenderActions>(Bas return { hash: tx.hash, contractKey: 'JUNIOR_OPERATOR', - } + }; } redeemJunior = async (tokenAmount: string) => { diff --git a/src/actions/proxy.ts b/src/actions/proxy.ts index 0db1556..5d38032 100644 --- a/src/actions/proxy.ts +++ b/src/actions/proxy.ts @@ -9,7 +9,7 @@ export function ProxyActions>(Bas return class extends Base implements IProxyActions { getProxyAccessTokenOwner = async (tokenId: string): Promise => { - return await this.ethersContracts['PROXY_REGISTRY'].ownerOf(tokenId) + return await this.ethersContracts['PROXY_REGISTRY'].ownerOf(tokenId); // const res : { 0: BN } = await executeAndRetry(this.contracts['PROXY_REGISTRY'].ownerOf, [tokenId]); // return res[0]; } @@ -27,9 +27,9 @@ export function ProxyActions>(Bas } getProxyAccessToken = async (proxyAddr: string) => { - const proxy = this.getContract(proxyAddr, 'PROXY') - const accessToken = await proxy.accessToken() - return accessToken.toNumber() + const proxy = this.getContract(proxyAddr, 'PROXY'); + const accessToken = await proxy.accessToken(); + return accessToken.toNumber(); // const proxy: any = this.eth.contract(this.contractAbis['PROXY']).at(proxyAddr); // const res = await executeAndRetry(proxy.accessToken, []); @@ -87,7 +87,7 @@ export function ProxyActions>(Bas return { hash: tx.hash, contractKey: 'PROXY', - } + }; } proxyTransferIssue = async (proxyAddr: string, nftRegistryAddr: string, tokenId: string) => { @@ -109,7 +109,7 @@ export function ProxyActions>(Bas return { hash: tx.hash, contractKey: 'PROXY', - } + }; } proxyLockBorrowWithdraw = async (proxyAddr: string, loanId: string, amount: string, usr: string) => { @@ -122,7 +122,7 @@ export function ProxyActions>(Bas { type: 'uint256', name: 'loan' }, { type: 'uint256', name: 'amount' }, { type: 'address', name: 'usr' }]}, - [this.contracts['SHELF'].address, loanId, amount, usr], + [this.contracts['SHELF'].address, loanId, amount, usr], ); const txHash = await executeAndRetry(proxy.execute, [this.contracts['ACTIONS'].address, encoded, this.ethConfig]); console.log(`[Proxy Lock Borrow Withdraw] txHash: ${txHash}`); @@ -141,7 +141,7 @@ export function ProxyActions>(Bas { type: 'uint256', name: 'token' }, { type: 'address', name: 'erc20' }, { type: 'uint256', name: 'loan' }]}, - [this.contracts['SHELF'].address, this.contracts['PILE'].address, registry, tokenId, this.contracts['TINLAKE_CURRENCY'].address, loanId], + [this.contracts['SHELF'].address, this.contracts['PILE'].address, registry, tokenId, this.contracts['TINLAKE_CURRENCY'].address, loanId], ); const txHash = await executeAndRetry(proxy.execute, [this.contracts['ACTIONS'].address, encoded, this.ethConfig]); console.log(`[Proxy Repay Unlock Close] txHash: ${txHash}`); From eb5d0454bfe017ecbdd232c9562b5a1b00c69f6d Mon Sep 17 00:00:00 2001 From: Jeroen Offerijns Date: Wed, 26 Aug 2020 13:21:33 +0200 Subject: [PATCH 06/65] feat: improve transaction api --- dist/Tinlake.d.ts | 21 +-- dist/actions/admin.d.ts | 14 +- dist/actions/analytics.d.ts | 8 +- dist/actions/borrower.d.ts | 8 +- dist/actions/collateral.d.ts | 28 ++-- dist/actions/currency.d.ts | 8 +- dist/actions/governance.d.ts | 8 +- dist/actions/lender.d.ts | 8 +- dist/actions/proxy.d.ts | 8 +- dist/index.d.ts | 76 ++++++----- dist/index.es.js | 82 +++++++++--- dist/index.js | 82 +++++++++--- docs/assets/js/search.js | 2 +- docs/classes/_tinlake_.tinlake.html | 113 ++++++++++++---- docs/interfaces/_services_ethereum_.ethi.html | 16 +-- .../_services_ethereum_.events.html | 6 +- docs/modules/_actions_admin_.html | 34 ++--- docs/modules/_actions_analytics_.html | 60 ++++----- docs/modules/_actions_borrower_.html | 20 +-- docs/modules/_actions_collateral_.html | 38 ++++-- docs/modules/_actions_currency_.html | 10 +- docs/modules/_actions_governance_.html | 4 +- docs/modules/_actions_index_.html | 2 +- docs/modules/_actions_lender_.html | 18 +-- docs/modules/_actions_proxy_.html | 30 ++--- docs/modules/_services_ethereum_.html | 10 +- docs/modules/_tinlake_.html | 37 +++-- docs/modules/_types_tinlake_.html | 10 +- docs/modules/_utils_basetodisplay_.html | 2 +- docs/modules/_utils_bntohex_.html | 2 +- docs/modules/_utils_displaytobase_.html | 2 +- docs/modules/_utils_feetointerestrate_.html | 2 +- docs/modules/_utils_getloanstatus_.html | 4 +- docs/modules/_utils_interestratetofee_.html | 2 +- src/Tinlake.ts | 126 ++++++++++++++---- src/actions/admin.ts | 6 +- src/actions/collateral.ts | 27 ++-- 37 files changed, 592 insertions(+), 342 deletions(-) diff --git a/dist/Tinlake.d.ts b/dist/Tinlake.d.ts index 04d3000..e50520a 100644 --- a/dist/Tinlake.d.ts +++ b/dist/Tinlake.d.ts @@ -1,9 +1,8 @@ import { ethI } from './services/ethereum'; import { ethers } from 'ethers'; -declare const contractNames: string[]; +declare const contractNames: readonly ["TINLAKE_CURRENCY", "JUNIOR_OPERATOR", "JUNIOR", "JUNIOR_TOKEN", "SENIOR", "SENIOR_TOKEN", "SENIOR_OPERATOR", "DISTRIBUTOR", "ASSESSOR", "TITLE", "PILE", "SHELF", "CEILING", "COLLECTOR", "THRESHOLD", "PRICE_POOL", "COLLATERAL_NFT", "COLLATERAL_NFT_DATA", "ROOT_CONTRACT", "PROXY", "PROXY_REGISTRY", "ACTIONS", "BORROWER_DEPLOYER", "LENDER_DEPLOYER", "NFT_FEED", "GOVERNANCE", "ALLOWANCE_OPERATOR"]; export declare type PendingTransaction = { - hash: string; - contractKey: string; + hash: string | undefined; timesOutAt?: number; }; export declare type EthConfig = { @@ -20,15 +19,15 @@ export declare type EthersConfig = { signer: ethers.Signer; overrides?: EthersOverrides; }; -export declare type ContractNames = typeof contractNames[number]; +export declare type ContractName = typeof contractNames[number]; export declare type Contracts = { - [key in ContractNames]?: any; + [key in ContractName]?: any; }; export declare type ContractAbis = { - [key in ContractNames]?: any; + [key in ContractName]?: any; }; export declare type ContractAddresses = { - [key in ContractNames]?: string; + [key in ContractName]?: string; }; export declare type TinlakeParams = { provider: any; @@ -59,9 +58,11 @@ export default class Tinlake { setContracts: () => void; setEthConfig: (ethConfig: EthConfig) => void; setEthersConfig: (ethersConfig: EthersConfig | undefined) => void; - createEthContract(address: string, abiName: string): void; - createContract(address: string, abiName: string): ethers.Contract; - getContract(address: string, abiName: string): ethers.Contract; + createEthContract(address: string, abiName: ContractName): void; + createContract(address: string, abiName: ContractName): ethers.Contract; + getContract(address: string, abiName: ContractName): ethers.Contract; + contract(abiName: ContractName, address?: string): ethers.Contract; + pending(txPromise: Promise): Promise; getTransactionReceipt(tx: PendingTransaction): Promise; getOperatorType: (tranche: string) => any; } diff --git a/dist/actions/admin.d.ts b/dist/actions/admin.d.ts index fc12aea..d15dfe9 100644 --- a/dist/actions/admin.d.ts +++ b/dist/actions/admin.d.ts @@ -1,9 +1,9 @@ -import { ContractNames, Constructor, TinlakeParams, PendingTransaction } from '../Tinlake'; +import { ContractName, Constructor, TinlakeParams, PendingTransaction } from '../Tinlake'; import BN from 'bn.js'; export declare function AdminActions>(Base: ActionsBase): { new (...args: any[]): { canQueryPermissions: () => boolean; - isWard: (user: string, contractName: string) => Promise; + isWard: (user: string, contractName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR") => Promise; canSetInterestRate: (user: string) => Promise; canSetSeniorTrancheInterest: (user: string) => Promise; canSetRiskScore: (user: string) => Promise; @@ -37,15 +37,17 @@ export declare function AdminActions void; setEthConfig: (ethConfig: import("../Tinlake").EthConfig) => void; setEthersConfig: (ethersConfig: import("../Tinlake").EthersConfig | undefined) => void; - createEthContract(address: string, abiName: string): void; - createContract(address: string, abiName: string): import("ethers").Contract; - getContract(address: string, abiName: string): import("ethers").Contract; + createEthContract(address: string, abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR"): void; + createContract(address: string, abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR"): import("ethers").Contract; + getContract(address: string, abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR"): import("ethers").Contract; + contract(abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR", address?: string | undefined): import("ethers").Contract; + pending(txPromise: Promise): Promise; getTransactionReceipt(tx: PendingTransaction): Promise; getOperatorType: (tranche: string) => any; }; } & ActionsBase; export declare type IAdminActions = { - isWard(user: string, contractName: ContractNames): Promise; + isWard(user: string, contractName: ContractName): Promise; canSetInterestRate(user: string): Promise; canSetSeniorTrancheInterest(user: string): Promise; canSetMinimumJuniorRatio(user: string): Promise; diff --git a/dist/actions/analytics.d.ts b/dist/actions/analytics.d.ts index 9c2d4e9..4d6f827 100644 --- a/dist/actions/analytics.d.ts +++ b/dist/actions/analytics.d.ts @@ -49,9 +49,11 @@ export declare function AnalyticsActions void; setEthConfig: (ethConfig: import("../Tinlake").EthConfig) => void; setEthersConfig: (ethersConfig: import("../Tinlake").EthersConfig | undefined) => void; - createEthContract(address: string, abiName: string): void; - createContract(address: string, abiName: string): import("ethers").Contract; - getContract(address: string, abiName: string): import("ethers").Contract; + createEthContract(address: string, abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR"): void; + createContract(address: string, abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR"): import("ethers").Contract; + getContract(address: string, abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR"): import("ethers").Contract; + contract(abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR", address?: string | undefined): import("ethers").Contract; + pending(txPromise: Promise): Promise; getTransactionReceipt(tx: import("../Tinlake").PendingTransaction): Promise; getOperatorType: (tranche: string) => any; }; diff --git a/dist/actions/borrower.d.ts b/dist/actions/borrower.d.ts index 8ef172c..66e1d90 100644 --- a/dist/actions/borrower.d.ts +++ b/dist/actions/borrower.d.ts @@ -25,9 +25,11 @@ export declare function BorrowerActions void; setEthConfig: (ethConfig: import("../Tinlake").EthConfig) => void; setEthersConfig: (ethersConfig: import("../Tinlake").EthersConfig | undefined) => void; - createEthContract(address: string, abiName: string): void; - createContract(address: string, abiName: string): ethers.Contract; - getContract(address: string, abiName: string): ethers.Contract; + createEthContract(address: string, abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR"): void; + createContract(address: string, abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR"): ethers.Contract; + getContract(address: string, abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR"): ethers.Contract; + contract(abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR", address?: string | undefined): ethers.Contract; + pending(txPromise: Promise): Promise; getTransactionReceipt(tx: import("../Tinlake").PendingTransaction): Promise; getOperatorType: (tranche: string) => any; }; diff --git a/dist/actions/collateral.d.ts b/dist/actions/collateral.d.ts index a1debfb..4b2df86 100644 --- a/dist/actions/collateral.d.ts +++ b/dist/actions/collateral.d.ts @@ -1,17 +1,19 @@ import { Constructor, TinlakeParams, PendingTransaction } from '../Tinlake'; import BN from 'bn.js'; +/** + * - See if we can remove ICollateralActions, + * - Make sure all actions have a non-unkonwn/any return type +// * - Remove contractKey +// * - Remove timesOutAt from every action (use this.transactionTimeout) +// * - Create ticket for adding RetryProvider later in tinlake-ui + * - Create issue in ethers.js for window is undefined error + */ export declare function CollateralActions>(Base: ActionsBase): { new (...args: any[]): { mintTitleNFT: (nftAddr: string, user: string) => Promise; - mintNFT: (nftAddr: string, owner: string, tokenId: string, ref: string, amount: string, asset: string) => Promise<{ - hash: any; - contractKey: string; - }>; + mintNFT: (nftAddress: string, owner: string, tokenId: string, ref: string, amount: string, asset: string) => Promise; approveNFT: (nftAddr: string, tokenId: string, to: string) => Promise; - setNFTApprovalForAll: (nftAddr: string, to: string, approved: boolean) => Promise<{ - hash: any; - contractKey: string; - }>; + setNFTApprovalForAll: (nftAddr: string, to: string, approved: boolean) => Promise; isNFTApprovedForAll: (nftAddr: string, owner: string, operator: string) => Promise; getNFTCount: (nftAddr: string) => Promise; getNFTData: (nftAddr: string, tokenId: string) => Promise; @@ -32,9 +34,11 @@ export declare function CollateralActions void; setEthConfig: (ethConfig: import("../Tinlake").EthConfig) => void; setEthersConfig: (ethersConfig: import("../Tinlake").EthersConfig | undefined) => void; - createEthContract(address: string, abiName: string): void; - createContract(address: string, abiName: string): import("ethers").Contract; - getContract(address: string, abiName: string): import("ethers").Contract; + createEthContract(address: string, abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR"): void; + createContract(address: string, abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR"): import("ethers").Contract; + getContract(address: string, abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR"): import("ethers").Contract; + contract(abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR", address?: string | undefined): import("ethers").Contract; + pending(txPromise: Promise): Promise; getTransactionReceipt(tx: PendingTransaction): Promise; getOperatorType: (tranche: string) => any; }; @@ -43,7 +47,7 @@ export declare type ICollateralActions = { mintTitleNFT(nftAddr: string, usr: string): Promise; mintNFT(nftAddr: string, owner: string, tokenId: string, ref: string, amount: string, asset: string): Promise; approveNFT(nftAddr: string, tokenId: string, to: string): Promise; - setNFTApprovalForAll(nftAddr: string, to: string, approved: boolean): Promise; + setNFTApprovalForAll(nftAddr: string, to: string, approved: boolean): Promise; isNFTApprovedForAll(nftAddr: string, owner: string, operator: string): Promise; getNFTCount(nftAddr: string): Promise; getNFTData(nftAddr: string, tokenId: string): Promise; diff --git a/dist/actions/currency.d.ts b/dist/actions/currency.d.ts index 3da1062..c54629e 100644 --- a/dist/actions/currency.d.ts +++ b/dist/actions/currency.d.ts @@ -34,9 +34,11 @@ export declare function CurrencyActions void; setEthConfig: (ethConfig: import("../Tinlake").EthConfig) => void; setEthersConfig: (ethersConfig: import("../Tinlake").EthersConfig | undefined) => void; - createEthContract(address: string, abiName: string): void; - createContract(address: string, abiName: string): import("ethers").Contract; - getContract(address: string, abiName: string): import("ethers").Contract; + createEthContract(address: string, abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR"): void; + createContract(address: string, abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR"): import("ethers").Contract; + getContract(address: string, abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR"): import("ethers").Contract; + contract(abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR", address?: string | undefined): import("ethers").Contract; + pending(txPromise: Promise): Promise; getTransactionReceipt(tx: PendingTransaction): Promise; getOperatorType: (tranche: string) => any; }; diff --git a/dist/actions/governance.d.ts b/dist/actions/governance.d.ts index 4dacbef..9f8c815 100644 --- a/dist/actions/governance.d.ts +++ b/dist/actions/governance.d.ts @@ -17,9 +17,11 @@ declare function GovernanceActions void; setEthConfig: (ethConfig: import("../Tinlake").EthConfig) => void; setEthersConfig: (ethersConfig: import("../Tinlake").EthersConfig | undefined) => void; - createEthContract(address: string, abiName: string): void; - createContract(address: string, abiName: string): import("ethers").Contract; - getContract(address: string, abiName: string): import("ethers").Contract; + createEthContract(address: string, abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR"): void; + createContract(address: string, abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR"): import("ethers").Contract; + getContract(address: string, abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR"): import("ethers").Contract; + contract(abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR", address?: string | undefined): import("ethers").Contract; + pending(txPromise: Promise): Promise; getTransactionReceipt(tx: import("../Tinlake").PendingTransaction): Promise; getOperatorType: (tranche: string) => any; }; diff --git a/dist/actions/lender.d.ts b/dist/actions/lender.d.ts index bfc81ba..4177b65 100644 --- a/dist/actions/lender.d.ts +++ b/dist/actions/lender.d.ts @@ -32,9 +32,11 @@ export declare function LenderActions void; setEthConfig: (ethConfig: import("../Tinlake").EthConfig) => void; setEthersConfig: (ethersConfig: import("../Tinlake").EthersConfig | undefined) => void; - createEthContract(address: string, abiName: string): void; - createContract(address: string, abiName: string): import("ethers").Contract; - getContract(address: string, abiName: string): import("ethers").Contract; + createEthContract(address: string, abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR"): void; + createContract(address: string, abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR"): import("ethers").Contract; + getContract(address: string, abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR"): import("ethers").Contract; + contract(abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR", address?: string | undefined): import("ethers").Contract; + pending(txPromise: Promise): Promise; getTransactionReceipt(tx: PendingTransaction): Promise; getOperatorType: (tranche: string) => any; }; diff --git a/dist/actions/proxy.d.ts b/dist/actions/proxy.d.ts index ce352b7..941a82e 100644 --- a/dist/actions/proxy.d.ts +++ b/dist/actions/proxy.d.ts @@ -37,9 +37,11 @@ export declare function ProxyActions void; setEthConfig: (ethConfig: import("../Tinlake").EthConfig) => void; setEthersConfig: (ethersConfig: import("../Tinlake").EthersConfig | undefined) => void; - createEthContract(address: string, abiName: string): void; - createContract(address: string, abiName: string): ethers.Contract; - getContract(address: string, abiName: string): ethers.Contract; + createEthContract(address: string, abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR"): void; + createContract(address: string, abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR"): ethers.Contract; + getContract(address: string, abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR"): ethers.Contract; + contract(abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR", address?: string | undefined): ethers.Contract; + pending(txPromise: Promise): Promise; getTransactionReceipt(tx: import("../Tinlake").PendingTransaction): Promise; getOperatorType: (tranche: string) => any; }; diff --git a/dist/index.d.ts b/dist/index.d.ts index 4c8357f..97c178b 100644 --- a/dist/index.d.ts +++ b/dist/index.d.ts @@ -36,9 +36,11 @@ export declare const TinlakeWithActions: { setContracts: () => void; setEthConfig: (ethConfig: import("./Tinlake").EthConfig) => void; setEthersConfig: (ethersConfig: import("./Tinlake").EthersConfig | undefined) => void; - createEthContract(address: string, abiName: string): void; - createContract(address: string, abiName: string): import("ethers").Contract; - getContract(address: string, abiName: string): import("ethers").Contract; + createEthContract(address: string, abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR"): void; + createContract(address: string, abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR"): import("ethers").Contract; + getContract(address: string, abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR"): import("ethers").Contract; + contract(abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR", address?: string | undefined): import("ethers").Contract; + pending(txPromise: Promise): Promise; getTransactionReceipt(tx: import("./Tinlake").PendingTransaction): Promise; getOperatorType: (tranche: string) => any; }; @@ -67,16 +69,18 @@ export declare const TinlakeWithActions: { setContracts: () => void; setEthConfig: (ethConfig: import("./Tinlake").EthConfig) => void; setEthersConfig: (ethersConfig: import("./Tinlake").EthersConfig | undefined) => void; - createEthContract(address: string, abiName: string): void; - createContract(address: string, abiName: string): import("ethers").Contract; - getContract(address: string, abiName: string): import("ethers").Contract; + createEthContract(address: string, abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR"): void; + createContract(address: string, abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR"): import("ethers").Contract; + getContract(address: string, abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR"): import("ethers").Contract; + contract(abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR", address?: string | undefined): import("ethers").Contract; + pending(txPromise: Promise): Promise; getTransactionReceipt(tx: import("./Tinlake").PendingTransaction): Promise; getOperatorType: (tranche: string) => any; }; } & { new (...args: any[]): { canQueryPermissions: () => boolean; - isWard: (user: string, contractName: string) => Promise; + isWard: (user: string, contractName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR") => Promise; canSetInterestRate: (user: string) => Promise; canSetSeniorTrancheInterest: (user: string) => Promise; canSetRiskScore: (user: string) => Promise; @@ -110,9 +114,11 @@ export declare const TinlakeWithActions: { setContracts: () => void; setEthConfig: (ethConfig: import("./Tinlake").EthConfig) => void; setEthersConfig: (ethersConfig: import("./Tinlake").EthersConfig | undefined) => void; - createEthContract(address: string, abiName: string): void; - createContract(address: string, abiName: string): import("ethers").Contract; - getContract(address: string, abiName: string): import("ethers").Contract; + createEthContract(address: string, abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR"): void; + createContract(address: string, abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR"): import("ethers").Contract; + getContract(address: string, abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR"): import("ethers").Contract; + contract(abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR", address?: string | undefined): import("ethers").Contract; + pending(txPromise: Promise): Promise; getTransactionReceipt(tx: import("./Tinlake").PendingTransaction): Promise; getOperatorType: (tranche: string) => any; }; @@ -148,9 +154,11 @@ export declare const TinlakeWithActions: { setContracts: () => void; setEthConfig: (ethConfig: import("./Tinlake").EthConfig) => void; setEthersConfig: (ethersConfig: import("./Tinlake").EthersConfig | undefined) => void; - createEthContract(address: string, abiName: string): void; - createContract(address: string, abiName: string): import("ethers").Contract; - getContract(address: string, abiName: string): import("ethers").Contract; + createEthContract(address: string, abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR"): void; + createContract(address: string, abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR"): import("ethers").Contract; + getContract(address: string, abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR"): import("ethers").Contract; + contract(abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR", address?: string | undefined): import("ethers").Contract; + pending(txPromise: Promise): Promise; getTransactionReceipt(tx: import("./Tinlake").PendingTransaction): Promise; getOperatorType: (tranche: string) => any; }; @@ -202,9 +210,11 @@ export declare const TinlakeWithActions: { setContracts: () => void; setEthConfig: (ethConfig: import("./Tinlake").EthConfig) => void; setEthersConfig: (ethersConfig: import("./Tinlake").EthersConfig | undefined) => void; - createEthContract(address: string, abiName: string): void; - createContract(address: string, abiName: string): import("ethers").Contract; - getContract(address: string, abiName: string): import("ethers").Contract; + createEthContract(address: string, abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR"): void; + createContract(address: string, abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR"): import("ethers").Contract; + getContract(address: string, abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR"): import("ethers").Contract; + contract(abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR", address?: string | undefined): import("ethers").Contract; + pending(txPromise: Promise): Promise; getTransactionReceipt(tx: import("./Tinlake").PendingTransaction): Promise; getOperatorType: (tranche: string) => any; }; @@ -242,24 +252,20 @@ export declare const TinlakeWithActions: { setContracts: () => void; setEthConfig: (ethConfig: import("./Tinlake").EthConfig) => void; setEthersConfig: (ethersConfig: import("./Tinlake").EthersConfig | undefined) => void; - createEthContract(address: string, abiName: string): void; - createContract(address: string, abiName: string): import("ethers").Contract; - getContract(address: string, abiName: string): import("ethers").Contract; + createEthContract(address: string, abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR"): void; + createContract(address: string, abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR"): import("ethers").Contract; + getContract(address: string, abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR"): import("ethers").Contract; + contract(abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR", address?: string | undefined): import("ethers").Contract; + pending(txPromise: Promise): Promise; getTransactionReceipt(tx: import("./Tinlake").PendingTransaction): Promise; getOperatorType: (tranche: string) => any; }; } & { new (...args: any[]): { mintTitleNFT: (nftAddr: string, user: string) => Promise; - mintNFT: (nftAddr: string, owner: string, tokenId: string, ref: string, amount: string, asset: string) => Promise<{ - hash: any; - contractKey: string; - }>; + mintNFT: (nftAddress: string, owner: string, tokenId: string, ref: string, amount: string, asset: string) => Promise; approveNFT: (nftAddr: string, tokenId: string, to: string) => Promise; - setNFTApprovalForAll: (nftAddr: string, to: string, approved: boolean) => Promise<{ - hash: any; - contractKey: string; - }>; + setNFTApprovalForAll: (nftAddr: string, to: string, approved: boolean) => Promise; isNFTApprovedForAll: (nftAddr: string, owner: string, operator: string) => Promise; getNFTCount: (nftAddr: string) => Promise; getNFTData: (nftAddr: string, tokenId: string) => Promise; @@ -280,9 +286,11 @@ export declare const TinlakeWithActions: { setContracts: () => void; setEthConfig: (ethConfig: import("./Tinlake").EthConfig) => void; setEthersConfig: (ethersConfig: import("./Tinlake").EthersConfig | undefined) => void; - createEthContract(address: string, abiName: string): void; - createContract(address: string, abiName: string): import("ethers").Contract; - getContract(address: string, abiName: string): import("ethers").Contract; + createEthContract(address: string, abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR"): void; + createContract(address: string, abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR"): import("ethers").Contract; + getContract(address: string, abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR"): import("ethers").Contract; + contract(abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR", address?: string | undefined): import("ethers").Contract; + pending(txPromise: Promise): Promise; getTransactionReceipt(tx: import("./Tinlake").PendingTransaction): Promise; getOperatorType: (tranche: string) => any; }; @@ -304,9 +312,11 @@ export declare const TinlakeWithActions: { setContracts: () => void; setEthConfig: (ethConfig: import("./Tinlake").EthConfig) => void; setEthersConfig: (ethersConfig: import("./Tinlake").EthersConfig | undefined) => void; - createEthContract(address: string, abiName: string): void; - createContract(address: string, abiName: string): import("ethers").Contract; - getContract(address: string, abiName: string): import("ethers").Contract; + createEthContract(address: string, abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR"): void; + createContract(address: string, abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR"): import("ethers").Contract; + getContract(address: string, abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR"): import("ethers").Contract; + contract(abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR", address?: string | undefined): import("ethers").Contract; + pending(txPromise: Promise): Promise; getTransactionReceipt(tx: import("./Tinlake").PendingTransaction): Promise; getOperatorType: (tranche: string) => any; }; diff --git a/dist/index.es.js b/dist/index.es.js index f7c83a3..51e6175 100644 --- a/dist/index.es.js +++ b/dist/index.es.js @@ -29622,6 +29622,14 @@ function CurrencyActions(Base) { }(Base)); } +/** + * - See if we can remove ICollateralActions, + * - Make sure all actions have a non-unkonwn/any return type +// * - Remove contractKey +// * - Remove timesOutAt from every action (use this.transactionTimeout) +// * - Create ticket for adding RetryProvider later in tinlake-ui + * - Create issue in ethers.js for window is undefined error + */ function CollateralActions(Base) { return /** @class */ (function (_super) { __extends(class_1, _super); @@ -29644,20 +29652,11 @@ function CollateralActions(Base) { } }); }); }; - _this.mintNFT = function (nftAddr, owner, tokenId, ref, amount, asset) { return __awaiter(_this, void 0, void 0, function () { - var nftContract, tx; + _this.mintNFT = function (nftAddress, owner, tokenId, ref, amount, asset) { return __awaiter(_this, void 0, void 0, function () { + var nft; return __generator(this, function (_a) { - switch (_a.label) { - case 0: - nftContract = this.getContract(nftAddr, 'COLLATERAL_NFT'); - return [4 /*yield*/, nftContract.mint(owner, tokenId, ref, amount, asset)]; - case 1: - tx = _a.sent(); - return [2 /*return*/, { - hash: tx.hash, - contractKey: 'COLLATERAL_NFT', - }]; - } + nft = this.contract('COLLATERAL_NFT', nftAddress); + return [2 /*return*/, this.pending(nft.mint(owner, tokenId, ref, amount, asset))]; }); }); }; _this.approveNFT = function (nftAddr, tokenId, to) { return __awaiter(_this, void 0, void 0, function () { @@ -29683,10 +29682,7 @@ function CollateralActions(Base) { return [4 /*yield*/, nftContract.setApprovalForAll(to, approved)]; case 1: tx = _a.sent(); - return [2 /*return*/, { - hash: tx.hash, - contractKey: 'COLLATERAL_NFT', - }]; + return [2 /*return*/, this.pending(tx)]; } }); }); }; @@ -47398,6 +47394,7 @@ var contractNames = [ 'LENDER_DEPLOYER', 'NFT_FEED', 'GOVERNANCE', + 'ALLOWANCE_OPERATOR', ]; ethers_2$1.utils.BigNumber.prototype.toBN = function () { return new bn(this.toString()); @@ -47419,7 +47416,9 @@ var Tinlake = /** @class */ (function () { // set root & proxy contracts contractNames.forEach(function (name) { if (_this.contractAbis[name] && _this.contractAddresses[name]) { - _this.contracts[name] = _this.eth.contract(_this.contractAbis[name]).at(_this.contractAddresses[name]); + _this.contracts[name] = _this.eth + .contract(_this.contractAbis[name]) + .at(_this.contractAddresses[name]); _this.ethersContracts[name] = _this.createContract(_this.contractAddresses[name], name); } }); @@ -47478,16 +47477,57 @@ var Tinlake = /** @class */ (function () { Tinlake.prototype.getContract = function (address, abiName) { return new ethers_2$1.Contract(address, this.contractAbis[abiName], this.ethersConfig.signer); }; - Tinlake.prototype.getTransactionReceipt = function (tx) { + Tinlake.prototype.contract = function (abiName, address) { + if (address) { + return new ethers_2$1.Contract(address, this.contractAbis[abiName], this.ethersConfig.signer); + } + return this.ethersContracts[abiName]; + }; + Tinlake.prototype.pending = function (txPromise) { return __awaiter(this, void 0, void 0, function () { + var tx; return __generator(this, function (_a) { switch (_a.label) { - case 0: return [4 /*yield*/, this.ethersConfig.provider.waitForTransaction(tx.hash)]; - case 1: return [2 /*return*/, _a.sent()]; + case 0: return [4 /*yield*/, txPromise]; + case 1: + tx = _a.sent(); + return [2 /*return*/, { + hash: tx.hash, + timesOutAt: Date.now() + this.transactionTimeout * 1000, + }]; } }); }); }; + Tinlake.prototype.getTransactionReceipt = function (tx) { + return __awaiter(this, void 0, void 0, function () { + var _this = this; + return __generator(this, function (_a) { + return [2 /*return*/, new Promise(function (resolve, reject) { return __awaiter(_this, void 0, void 0, function () { + var timer, receipt; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + if (!tx.hash) + return [2 /*return*/, reject()]; + timer = undefined; + if (tx.timesOutAt) { + timer = setTimeout(function () { + return reject(); + }, tx.timesOutAt - Date.now()); + } + return [4 /*yield*/, this.ethersConfig.provider.waitForTransaction(tx.hash)]; + case 1: + receipt = _a.sent(); + if (timer) + clearTimeout(timer); + return [2 /*return*/, resolve(receipt)]; + } + }); + }); })]; + }); + }); + }; return Tinlake; }()); diff --git a/dist/index.js b/dist/index.js index 0643dba..acb90a5 100644 --- a/dist/index.js +++ b/dist/index.js @@ -29628,6 +29628,14 @@ function CurrencyActions(Base) { }(Base)); } +/** + * - See if we can remove ICollateralActions, + * - Make sure all actions have a non-unkonwn/any return type +// * - Remove contractKey +// * - Remove timesOutAt from every action (use this.transactionTimeout) +// * - Create ticket for adding RetryProvider later in tinlake-ui + * - Create issue in ethers.js for window is undefined error + */ function CollateralActions(Base) { return /** @class */ (function (_super) { __extends(class_1, _super); @@ -29650,20 +29658,11 @@ function CollateralActions(Base) { } }); }); }; - _this.mintNFT = function (nftAddr, owner, tokenId, ref, amount, asset) { return __awaiter(_this, void 0, void 0, function () { - var nftContract, tx; + _this.mintNFT = function (nftAddress, owner, tokenId, ref, amount, asset) { return __awaiter(_this, void 0, void 0, function () { + var nft; return __generator(this, function (_a) { - switch (_a.label) { - case 0: - nftContract = this.getContract(nftAddr, 'COLLATERAL_NFT'); - return [4 /*yield*/, nftContract.mint(owner, tokenId, ref, amount, asset)]; - case 1: - tx = _a.sent(); - return [2 /*return*/, { - hash: tx.hash, - contractKey: 'COLLATERAL_NFT', - }]; - } + nft = this.contract('COLLATERAL_NFT', nftAddress); + return [2 /*return*/, this.pending(nft.mint(owner, tokenId, ref, amount, asset))]; }); }); }; _this.approveNFT = function (nftAddr, tokenId, to) { return __awaiter(_this, void 0, void 0, function () { @@ -29689,10 +29688,7 @@ function CollateralActions(Base) { return [4 /*yield*/, nftContract.setApprovalForAll(to, approved)]; case 1: tx = _a.sent(); - return [2 /*return*/, { - hash: tx.hash, - contractKey: 'COLLATERAL_NFT', - }]; + return [2 /*return*/, this.pending(tx)]; } }); }); }; @@ -47404,6 +47400,7 @@ var contractNames = [ 'LENDER_DEPLOYER', 'NFT_FEED', 'GOVERNANCE', + 'ALLOWANCE_OPERATOR', ]; ethers_2$1.utils.BigNumber.prototype.toBN = function () { return new bn(this.toString()); @@ -47425,7 +47422,9 @@ var Tinlake = /** @class */ (function () { // set root & proxy contracts contractNames.forEach(function (name) { if (_this.contractAbis[name] && _this.contractAddresses[name]) { - _this.contracts[name] = _this.eth.contract(_this.contractAbis[name]).at(_this.contractAddresses[name]); + _this.contracts[name] = _this.eth + .contract(_this.contractAbis[name]) + .at(_this.contractAddresses[name]); _this.ethersContracts[name] = _this.createContract(_this.contractAddresses[name], name); } }); @@ -47484,16 +47483,57 @@ var Tinlake = /** @class */ (function () { Tinlake.prototype.getContract = function (address, abiName) { return new ethers_2$1.Contract(address, this.contractAbis[abiName], this.ethersConfig.signer); }; - Tinlake.prototype.getTransactionReceipt = function (tx) { + Tinlake.prototype.contract = function (abiName, address) { + if (address) { + return new ethers_2$1.Contract(address, this.contractAbis[abiName], this.ethersConfig.signer); + } + return this.ethersContracts[abiName]; + }; + Tinlake.prototype.pending = function (txPromise) { return __awaiter(this, void 0, void 0, function () { + var tx; return __generator(this, function (_a) { switch (_a.label) { - case 0: return [4 /*yield*/, this.ethersConfig.provider.waitForTransaction(tx.hash)]; - case 1: return [2 /*return*/, _a.sent()]; + case 0: return [4 /*yield*/, txPromise]; + case 1: + tx = _a.sent(); + return [2 /*return*/, { + hash: tx.hash, + timesOutAt: Date.now() + this.transactionTimeout * 1000, + }]; } }); }); }; + Tinlake.prototype.getTransactionReceipt = function (tx) { + return __awaiter(this, void 0, void 0, function () { + var _this = this; + return __generator(this, function (_a) { + return [2 /*return*/, new Promise(function (resolve, reject) { return __awaiter(_this, void 0, void 0, function () { + var timer, receipt; + return __generator(this, function (_a) { + switch (_a.label) { + case 0: + if (!tx.hash) + return [2 /*return*/, reject()]; + timer = undefined; + if (tx.timesOutAt) { + timer = setTimeout(function () { + return reject(); + }, tx.timesOutAt - Date.now()); + } + return [4 /*yield*/, this.ethersConfig.provider.waitForTransaction(tx.hash)]; + case 1: + receipt = _a.sent(); + if (timer) + clearTimeout(timer); + return [2 /*return*/, resolve(receipt)]; + } + }); + }); })]; + }); + }); + }; return Tinlake; }()); diff --git a/docs/assets/js/search.js b/docs/assets/js/search.js index d76bf65..8bc1fee 100644 --- a/docs/assets/js/search.js +++ b/docs/assets/js/search.js @@ -1,3 +1,3 @@ var typedoc = typedoc || {}; typedoc.search = typedoc.search || {}; - typedoc.search.data = {"kinds":{"1":"Module","32":"Variable","64":"Function","128":"Class","256":"Interface","512":"Constructor","1024":"Property","2048":"Method","65536":"Type literal","4194304":"Type alias"},"rows":[{"id":0,"kind":1,"name":"\"services/ethereum\"","url":"modules/_services_ethereum_.html","classes":"tsd-kind-module"},{"id":1,"kind":256,"name":"ethI","url":"interfaces/_services_ethereum_.ethi.html","classes":"tsd-kind-interface tsd-parent-kind-module","parent":"\"services/ethereum\""},{"id":2,"kind":1024,"name":"send","url":"interfaces/_services_ethereum_.ethi.html#send","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"services/ethereum\".ethI"},{"id":3,"kind":1024,"name":"web3_sha3","url":"interfaces/_services_ethereum_.ethi.html#web3_sha3","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"services/ethereum\".ethI"},{"id":4,"kind":65536,"name":"__type","url":"interfaces/_services_ethereum_.ethi.html#web3_sha3.__type-3","classes":"tsd-kind-type-literal tsd-parent-kind-property","parent":"\"services/ethereum\".ethI.web3_sha3"},{"id":5,"kind":1024,"name":"getTransactionReceipt","url":"interfaces/_services_ethereum_.ethi.html#gettransactionreceipt","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"services/ethereum\".ethI"},{"id":6,"kind":65536,"name":"__type","url":"interfaces/_services_ethereum_.ethi.html#gettransactionreceipt.__type-2","classes":"tsd-kind-type-literal tsd-parent-kind-property","parent":"\"services/ethereum\".ethI.getTransactionReceipt"},{"id":7,"kind":1024,"name":"getTransactionByHash","url":"interfaces/_services_ethereum_.ethi.html#gettransactionbyhash","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"services/ethereum\".ethI"},{"id":8,"kind":65536,"name":"__type","url":"interfaces/_services_ethereum_.ethi.html#gettransactionbyhash.__type-1","classes":"tsd-kind-type-literal tsd-parent-kind-property","parent":"\"services/ethereum\".ethI.getTransactionByHash"},{"id":9,"kind":1024,"name":"contract","url":"interfaces/_services_ethereum_.ethi.html#contract","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"services/ethereum\".ethI"},{"id":10,"kind":65536,"name":"__type","url":"interfaces/_services_ethereum_.ethi.html#contract.__type","classes":"tsd-kind-type-literal tsd-parent-kind-property","parent":"\"services/ethereum\".ethI.contract"},{"id":11,"kind":1024,"name":"sendRawTransaction","url":"interfaces/_services_ethereum_.ethi.html#sendrawtransaction","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"services/ethereum\".ethI"},{"id":12,"kind":1024,"name":"getTransactionCount","url":"interfaces/_services_ethereum_.ethi.html#gettransactioncount","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"services/ethereum\".ethI"},{"id":13,"kind":1024,"name":"abi","url":"interfaces/_services_ethereum_.ethi.html#abi","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"services/ethereum\".ethI"},{"id":14,"kind":256,"name":"Events","url":"interfaces/_services_ethereum_.events.html","classes":"tsd-kind-interface tsd-parent-kind-module","parent":"\"services/ethereum\""},{"id":15,"kind":1024,"name":"txHash","url":"interfaces/_services_ethereum_.events.html#txhash","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"services/ethereum\".Events"},{"id":16,"kind":1024,"name":"status","url":"interfaces/_services_ethereum_.events.html#status","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"services/ethereum\".Events"},{"id":17,"kind":1024,"name":"events","url":"interfaces/_services_ethereum_.events.html#events","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"services/ethereum\".Events"},{"id":18,"kind":32,"name":"ZERO_ADDRESS","url":"modules/_services_ethereum_.html#zero_address","classes":"tsd-kind-variable tsd-parent-kind-module","parent":"\"services/ethereum\""},{"id":19,"kind":64,"name":"executeAndRetry","url":"modules/_services_ethereum_.html#executeandretry","classes":"tsd-kind-function tsd-parent-kind-module","parent":"\"services/ethereum\""},{"id":20,"kind":64,"name":"waitAndReturnEvents","url":"modules/_services_ethereum_.html#waitandreturnevents","classes":"tsd-kind-function tsd-parent-kind-module","parent":"\"services/ethereum\""},{"id":21,"kind":64,"name":"waitForTransaction","url":"modules/_services_ethereum_.html#waitfortransaction","classes":"tsd-kind-function tsd-parent-kind-module","parent":"\"services/ethereum\""},{"id":22,"kind":64,"name":"findEvent","url":"modules/_services_ethereum_.html#findevent","classes":"tsd-kind-function tsd-parent-kind-module","parent":"\"services/ethereum\""},{"id":23,"kind":1,"name":"\"Tinlake\"","url":"modules/_tinlake_.html","classes":"tsd-kind-module"},{"id":24,"kind":128,"name":"Tinlake","url":"classes/_tinlake_.tinlake.html","classes":"tsd-kind-class tsd-parent-kind-module","parent":"\"Tinlake\""},{"id":25,"kind":1024,"name":"provider","url":"classes/_tinlake_.tinlake.html#provider","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":26,"kind":1024,"name":"eth","url":"classes/_tinlake_.tinlake.html#eth","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":27,"kind":1024,"name":"ethOptions","url":"classes/_tinlake_.tinlake.html#ethoptions","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":28,"kind":1024,"name":"ethConfig","url":"classes/_tinlake_.tinlake.html#ethconfig","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":29,"kind":1024,"name":"ethersConfig","url":"classes/_tinlake_.tinlake.html#ethersconfig","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":30,"kind":1024,"name":"contractAddresses","url":"classes/_tinlake_.tinlake.html#contractaddresses","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":31,"kind":1024,"name":"transactionTimeout","url":"classes/_tinlake_.tinlake.html#transactiontimeout","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":32,"kind":1024,"name":"contracts","url":"classes/_tinlake_.tinlake.html#contracts","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":33,"kind":1024,"name":"ethersContracts","url":"classes/_tinlake_.tinlake.html#etherscontracts","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":34,"kind":1024,"name":"contractAbis","url":"classes/_tinlake_.tinlake.html#contractabis","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":35,"kind":1024,"name":"contractConfig","url":"classes/_tinlake_.tinlake.html#contractconfig","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":36,"kind":512,"name":"constructor","url":"classes/_tinlake_.tinlake.html#constructor","classes":"tsd-kind-constructor tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":37,"kind":2048,"name":"setProvider","url":"classes/_tinlake_.tinlake.html#setprovider","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":38,"kind":2048,"name":"setContracts","url":"classes/_tinlake_.tinlake.html#setcontracts","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":39,"kind":2048,"name":"setEthConfig","url":"classes/_tinlake_.tinlake.html#setethconfig","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":40,"kind":2048,"name":"setEthersConfig","url":"classes/_tinlake_.tinlake.html#setethersconfig","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":41,"kind":2048,"name":"createEthContract","url":"classes/_tinlake_.tinlake.html#createethcontract","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":42,"kind":2048,"name":"createContract","url":"classes/_tinlake_.tinlake.html#createcontract","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":43,"kind":2048,"name":"getContract","url":"classes/_tinlake_.tinlake.html#getcontract","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":44,"kind":2048,"name":"getTransactionReceipt","url":"classes/_tinlake_.tinlake.html#gettransactionreceipt","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":45,"kind":2048,"name":"getOperatorType","url":"classes/_tinlake_.tinlake.html#getoperatortype","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":46,"kind":4194304,"name":"PendingTransaction","url":"modules/_tinlake_.html#pendingtransaction","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"Tinlake\""},{"id":47,"kind":65536,"name":"__type","url":"modules/_tinlake_.html#pendingtransaction.__type-7","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"Tinlake\".PendingTransaction"},{"id":48,"kind":32,"name":"hash","url":"modules/_tinlake_.html#pendingtransaction.__type-7.hash","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".PendingTransaction.__type"},{"id":49,"kind":32,"name":"contractKey","url":"modules/_tinlake_.html#pendingtransaction.__type-7.contractkey","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".PendingTransaction.__type"},{"id":50,"kind":32,"name":"timesOutAt","url":"modules/_tinlake_.html#pendingtransaction.__type-7.timesoutat","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".PendingTransaction.__type"},{"id":51,"kind":4194304,"name":"EthConfig","url":"modules/_tinlake_.html#ethconfig","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"Tinlake\""},{"id":52,"kind":65536,"name":"__type","url":"modules/_tinlake_.html#ethconfig.__type-4","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"Tinlake\".EthConfig"},{"id":53,"kind":32,"name":"from","url":"modules/_tinlake_.html#ethconfig.__type-4.from","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".EthConfig.__type"},{"id":54,"kind":32,"name":"gasPrice","url":"modules/_tinlake_.html#ethconfig.__type-4.gasprice","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".EthConfig.__type"},{"id":55,"kind":32,"name":"gas","url":"modules/_tinlake_.html#ethconfig.__type-4.gas","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".EthConfig.__type"},{"id":56,"kind":4194304,"name":"EthersOverrides","url":"modules/_tinlake_.html#ethersoverrides","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"Tinlake\""},{"id":57,"kind":65536,"name":"__type","url":"modules/_tinlake_.html#ethersoverrides.__type-6","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"Tinlake\".EthersOverrides"},{"id":58,"kind":32,"name":"gasPrice","url":"modules/_tinlake_.html#ethersoverrides.__type-6.gasprice-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".EthersOverrides.__type"},{"id":59,"kind":32,"name":"gasLimit","url":"modules/_tinlake_.html#ethersoverrides.__type-6.gaslimit","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".EthersOverrides.__type"},{"id":60,"kind":4194304,"name":"EthersConfig","url":"modules/_tinlake_.html#ethersconfig","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"Tinlake\""},{"id":61,"kind":65536,"name":"__type","url":"modules/_tinlake_.html#ethersconfig.__type-5","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"Tinlake\".EthersConfig"},{"id":62,"kind":32,"name":"provider","url":"modules/_tinlake_.html#ethersconfig.__type-5.provider","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".EthersConfig.__type"},{"id":63,"kind":32,"name":"signer","url":"modules/_tinlake_.html#ethersconfig.__type-5.signer","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".EthersConfig.__type"},{"id":64,"kind":32,"name":"overrides","url":"modules/_tinlake_.html#ethersconfig.__type-5.overrides","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".EthersConfig.__type"},{"id":65,"kind":4194304,"name":"ContractNames","url":"modules/_tinlake_.html#contractnames","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"Tinlake\""},{"id":66,"kind":4194304,"name":"Contracts","url":"modules/_tinlake_.html#contracts","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"Tinlake\""},{"id":67,"kind":65536,"name":"__type","url":"modules/_tinlake_.html#contracts.__type-3","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"Tinlake\".Contracts"},{"id":68,"kind":4194304,"name":"ContractAbis","url":"modules/_tinlake_.html#contractabis","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"Tinlake\""},{"id":69,"kind":65536,"name":"__type","url":"modules/_tinlake_.html#contractabis.__type-1","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"Tinlake\".ContractAbis"},{"id":70,"kind":4194304,"name":"ContractAddresses","url":"modules/_tinlake_.html#contractaddresses","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"Tinlake\""},{"id":71,"kind":65536,"name":"__type","url":"modules/_tinlake_.html#contractaddresses.__type-2","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"Tinlake\".ContractAddresses"},{"id":72,"kind":4194304,"name":"TinlakeParams","url":"modules/_tinlake_.html#tinlakeparams","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"Tinlake\""},{"id":73,"kind":65536,"name":"__type","url":"modules/_tinlake_.html#tinlakeparams.__type-8","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"Tinlake\".TinlakeParams"},{"id":74,"kind":32,"name":"provider","url":"modules/_tinlake_.html#tinlakeparams.__type-8.provider-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".TinlakeParams.__type"},{"id":75,"kind":32,"name":"transactionTimeout","url":"modules/_tinlake_.html#tinlakeparams.__type-8.transactiontimeout","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".TinlakeParams.__type"},{"id":76,"kind":32,"name":"contractAddresses","url":"modules/_tinlake_.html#tinlakeparams.__type-8.contractaddresses-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".TinlakeParams.__type"},{"id":77,"kind":32,"name":"contractAbis","url":"modules/_tinlake_.html#tinlakeparams.__type-8.contractabis-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".TinlakeParams.__type"},{"id":78,"kind":32,"name":"ethConfig","url":"modules/_tinlake_.html#tinlakeparams.__type-8.ethconfig-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".TinlakeParams.__type"},{"id":79,"kind":32,"name":"ethersConfig","url":"modules/_tinlake_.html#tinlakeparams.__type-8.ethersconfig-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".TinlakeParams.__type"},{"id":80,"kind":32,"name":"ethOptions","url":"modules/_tinlake_.html#tinlakeparams.__type-8.ethoptions","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".TinlakeParams.__type"},{"id":81,"kind":32,"name":"contracts","url":"modules/_tinlake_.html#tinlakeparams.__type-8.contracts-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".TinlakeParams.__type"},{"id":82,"kind":32,"name":"contractConfig","url":"modules/_tinlake_.html#tinlakeparams.__type-8.contractconfig","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".TinlakeParams.__type"},{"id":83,"kind":4194304,"name":"Constructor","url":"modules/_tinlake_.html#constructor","classes":"tsd-kind-type-alias tsd-parent-kind-module tsd-has-type-parameter","parent":"\"Tinlake\""},{"id":84,"kind":65536,"name":"__type","url":"modules/_tinlake_.html#constructor.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"Tinlake\".Constructor"},{"id":85,"kind":1,"name":"\"actions/admin\"","url":"modules/_actions_admin_.html","classes":"tsd-kind-module"},{"id":86,"kind":64,"name":"AdminActions","url":"modules/_actions_admin_.html#adminactions","classes":"tsd-kind-function tsd-parent-kind-module tsd-has-type-parameter","parent":"\"actions/admin\""},{"id":87,"kind":4194304,"name":"IAdminActions","url":"modules/_actions_admin_.html#iadminactions","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"actions/admin\""},{"id":88,"kind":65536,"name":"__type","url":"modules/_actions_admin_.html#iadminactions.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"actions/admin\".IAdminActions"},{"id":89,"kind":64,"name":"isWard","url":"modules/_actions_admin_.html#iadminactions.__type.isward","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":90,"kind":64,"name":"canSetInterestRate","url":"modules/_actions_admin_.html#iadminactions.__type.cansetinterestrate","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":91,"kind":64,"name":"canSetSeniorTrancheInterest","url":"modules/_actions_admin_.html#iadminactions.__type.cansetseniortrancheinterest","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":92,"kind":64,"name":"canSetMinimumJuniorRatio","url":"modules/_actions_admin_.html#iadminactions.__type.cansetminimumjuniorratio","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":93,"kind":64,"name":"canSetRiskScore","url":"modules/_actions_admin_.html#iadminactions.__type.cansetriskscore","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":94,"kind":64,"name":"canSetInvestorAllowanceJunior","url":"modules/_actions_admin_.html#iadminactions.__type.cansetinvestorallowancejunior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":95,"kind":64,"name":"canSetInvestorAllowanceSenior","url":"modules/_actions_admin_.html#iadminactions.__type.cansetinvestorallowancesenior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":96,"kind":64,"name":"canSetLoanPrice","url":"modules/_actions_admin_.html#iadminactions.__type.cansetloanprice","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":97,"kind":64,"name":"initRate","url":"modules/_actions_admin_.html#iadminactions.__type.initrate","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":98,"kind":64,"name":"setRate","url":"modules/_actions_admin_.html#iadminactions.__type.setrate","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":99,"kind":64,"name":"setMinimumJuniorRatio","url":"modules/_actions_admin_.html#iadminactions.__type.setminimumjuniorratio","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":100,"kind":64,"name":"approveAllowanceJunior","url":"modules/_actions_admin_.html#iadminactions.__type.approveallowancejunior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":101,"kind":64,"name":"approveAllowanceSenior","url":"modules/_actions_admin_.html#iadminactions.__type.approveallowancesenior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":102,"kind":1,"name":"\"actions/borrower\"","url":"modules/_actions_borrower_.html","classes":"tsd-kind-module"},{"id":103,"kind":64,"name":"BorrowerActions","url":"modules/_actions_borrower_.html#borroweractions","classes":"tsd-kind-function tsd-parent-kind-module tsd-has-type-parameter","parent":"\"actions/borrower\""},{"id":104,"kind":4194304,"name":"IBorrowerActions","url":"modules/_actions_borrower_.html#iborroweractions","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"actions/borrower\""},{"id":105,"kind":65536,"name":"__type","url":"modules/_actions_borrower_.html#iborroweractions.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"actions/borrower\".IBorrowerActions"},{"id":106,"kind":64,"name":"issue","url":"modules/_actions_borrower_.html#iborroweractions.__type.issue","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/borrower\".IBorrowerActions.__type"},{"id":107,"kind":64,"name":"nftLookup","url":"modules/_actions_borrower_.html#iborroweractions.__type.nftlookup","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/borrower\".IBorrowerActions.__type"},{"id":108,"kind":64,"name":"lock","url":"modules/_actions_borrower_.html#iborroweractions.__type.lock","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/borrower\".IBorrowerActions.__type"},{"id":109,"kind":64,"name":"unlock","url":"modules/_actions_borrower_.html#iborroweractions.__type.unlock","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/borrower\".IBorrowerActions.__type"},{"id":110,"kind":64,"name":"close","url":"modules/_actions_borrower_.html#iborroweractions.__type.close","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/borrower\".IBorrowerActions.__type"},{"id":111,"kind":64,"name":"borrow","url":"modules/_actions_borrower_.html#iborroweractions.__type.borrow","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/borrower\".IBorrowerActions.__type"},{"id":112,"kind":64,"name":"withdraw","url":"modules/_actions_borrower_.html#iborroweractions.__type.withdraw","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/borrower\".IBorrowerActions.__type"},{"id":113,"kind":64,"name":"repay","url":"modules/_actions_borrower_.html#iborroweractions.__type.repay","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/borrower\".IBorrowerActions.__type"},{"id":114,"kind":1,"name":"\"actions/lender\"","url":"modules/_actions_lender_.html","classes":"tsd-kind-module"},{"id":115,"kind":64,"name":"LenderActions","url":"modules/_actions_lender_.html#lenderactions","classes":"tsd-kind-function tsd-parent-kind-module tsd-has-type-parameter","parent":"\"actions/lender\""},{"id":116,"kind":4194304,"name":"ILenderActions","url":"modules/_actions_lender_.html#ilenderactions","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"actions/lender\""},{"id":117,"kind":65536,"name":"__type","url":"modules/_actions_lender_.html#ilenderactions.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"actions/lender\".ILenderActions"},{"id":118,"kind":64,"name":"getSeniorTokenAllowance","url":"modules/_actions_lender_.html#ilenderactions.__type.getseniortokenallowance","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/lender\".ILenderActions.__type"},{"id":119,"kind":64,"name":"getJuniorTokenAllowance","url":"modules/_actions_lender_.html#ilenderactions.__type.getjuniortokenallowance","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/lender\".ILenderActions.__type"},{"id":120,"kind":64,"name":"supplyJunior","url":"modules/_actions_lender_.html#ilenderactions.__type.supplyjunior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/lender\".ILenderActions.__type"},{"id":121,"kind":32,"name":"approveJuniorToken","url":"modules/_actions_lender_.html#ilenderactions.__type.approvejuniortoken","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"actions/lender\".ILenderActions.__type"},{"id":122,"kind":65536,"name":"__type","url":"modules/_actions_lender_.html#ilenderactions.__type.approvejuniortoken.__type-1","classes":"tsd-kind-type-literal tsd-parent-kind-variable","parent":"\"actions/lender\".ILenderActions.__type.approveJuniorToken"},{"id":123,"kind":32,"name":"approveSeniorToken","url":"modules/_actions_lender_.html#ilenderactions.__type.approveseniortoken","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"actions/lender\".ILenderActions.__type"},{"id":124,"kind":65536,"name":"__type","url":"modules/_actions_lender_.html#ilenderactions.__type.approveseniortoken.__type-2","classes":"tsd-kind-type-literal tsd-parent-kind-variable","parent":"\"actions/lender\".ILenderActions.__type.approveSeniorToken"},{"id":125,"kind":64,"name":"redeemJunior","url":"modules/_actions_lender_.html#ilenderactions.__type.redeemjunior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/lender\".ILenderActions.__type"},{"id":126,"kind":64,"name":"supplySenior","url":"modules/_actions_lender_.html#ilenderactions.__type.supplysenior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/lender\".ILenderActions.__type"},{"id":127,"kind":64,"name":"redeemSenior","url":"modules/_actions_lender_.html#ilenderactions.__type.redeemsenior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/lender\".ILenderActions.__type"},{"id":128,"kind":64,"name":"balance","url":"modules/_actions_lender_.html#ilenderactions.__type.balance","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/lender\".ILenderActions.__type"},{"id":129,"kind":1,"name":"\"actions/currency\"","url":"modules/_actions_currency_.html","classes":"tsd-kind-module"},{"id":130,"kind":64,"name":"CurrencyActions","url":"modules/_actions_currency_.html#currencyactions","classes":"tsd-kind-function tsd-parent-kind-module tsd-has-type-parameter","parent":"\"actions/currency\""},{"id":131,"kind":4194304,"name":"ICurrencyActions","url":"modules/_actions_currency_.html#icurrencyactions","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"actions/currency\""},{"id":132,"kind":65536,"name":"__type","url":"modules/_actions_currency_.html#icurrencyactions.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"actions/currency\".ICurrencyActions"},{"id":133,"kind":64,"name":"mintCurrency","url":"modules/_actions_currency_.html#icurrencyactions.__type.mintcurrency","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/currency\".ICurrencyActions.__type"},{"id":134,"kind":64,"name":"getCurrencyBalance","url":"modules/_actions_currency_.html#icurrencyactions.__type.getcurrencybalance","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/currency\".ICurrencyActions.__type"},{"id":135,"kind":32,"name":"getCurrencyAllowance","url":"modules/_actions_currency_.html#icurrencyactions.__type.getcurrencyallowance","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"actions/currency\".ICurrencyActions.__type"},{"id":136,"kind":65536,"name":"__type","url":"modules/_actions_currency_.html#icurrencyactions.__type.getcurrencyallowance.__type-3","classes":"tsd-kind-type-literal tsd-parent-kind-variable","parent":"\"actions/currency\".ICurrencyActions.__type.getCurrencyAllowance"},{"id":137,"kind":32,"name":"getJuniorForCurrencyAllowance","url":"modules/_actions_currency_.html#icurrencyactions.__type.getjuniorforcurrencyallowance","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"actions/currency\".ICurrencyActions.__type"},{"id":138,"kind":65536,"name":"__type","url":"modules/_actions_currency_.html#icurrencyactions.__type.getjuniorforcurrencyallowance.__type-4","classes":"tsd-kind-type-literal tsd-parent-kind-variable","parent":"\"actions/currency\".ICurrencyActions.__type.getJuniorForCurrencyAllowance"},{"id":139,"kind":32,"name":"getSeniorForCurrencyAllowance","url":"modules/_actions_currency_.html#icurrencyactions.__type.getseniorforcurrencyallowance","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"actions/currency\".ICurrencyActions.__type"},{"id":140,"kind":65536,"name":"__type","url":"modules/_actions_currency_.html#icurrencyactions.__type.getseniorforcurrencyallowance.__type-5","classes":"tsd-kind-type-literal tsd-parent-kind-variable","parent":"\"actions/currency\".ICurrencyActions.__type.getSeniorForCurrencyAllowance"},{"id":141,"kind":64,"name":"approveCurrency","url":"modules/_actions_currency_.html#icurrencyactions.__type.approvecurrency","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/currency\".ICurrencyActions.__type"},{"id":142,"kind":32,"name":"approveSeniorForCurrency","url":"modules/_actions_currency_.html#icurrencyactions.__type.approveseniorforcurrency","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"actions/currency\".ICurrencyActions.__type"},{"id":143,"kind":65536,"name":"__type","url":"modules/_actions_currency_.html#icurrencyactions.__type.approveseniorforcurrency.__type-2","classes":"tsd-kind-type-literal tsd-parent-kind-variable","parent":"\"actions/currency\".ICurrencyActions.__type.approveSeniorForCurrency"},{"id":144,"kind":32,"name":"approveJuniorForCurrency","url":"modules/_actions_currency_.html#icurrencyactions.__type.approvejuniorforcurrency","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"actions/currency\".ICurrencyActions.__type"},{"id":145,"kind":65536,"name":"__type","url":"modules/_actions_currency_.html#icurrencyactions.__type.approvejuniorforcurrency.__type-1","classes":"tsd-kind-type-literal tsd-parent-kind-variable","parent":"\"actions/currency\".ICurrencyActions.__type.approveJuniorForCurrency"},{"id":146,"kind":1,"name":"\"actions/collateral\"","url":"modules/_actions_collateral_.html","classes":"tsd-kind-module"},{"id":147,"kind":64,"name":"CollateralActions","url":"modules/_actions_collateral_.html#collateralactions","classes":"tsd-kind-function tsd-parent-kind-module tsd-has-type-parameter","parent":"\"actions/collateral\""},{"id":148,"kind":4194304,"name":"ICollateralActions","url":"modules/_actions_collateral_.html#icollateralactions","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"actions/collateral\""},{"id":149,"kind":65536,"name":"__type","url":"modules/_actions_collateral_.html#icollateralactions.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"actions/collateral\".ICollateralActions"},{"id":150,"kind":64,"name":"mintTitleNFT","url":"modules/_actions_collateral_.html#icollateralactions.__type.minttitlenft","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/collateral\".ICollateralActions.__type"},{"id":151,"kind":64,"name":"mintNFT","url":"modules/_actions_collateral_.html#icollateralactions.__type.mintnft","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/collateral\".ICollateralActions.__type"},{"id":152,"kind":64,"name":"approveNFT","url":"modules/_actions_collateral_.html#icollateralactions.__type.approvenft","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/collateral\".ICollateralActions.__type"},{"id":153,"kind":64,"name":"setNFTApprovalForAll","url":"modules/_actions_collateral_.html#icollateralactions.__type.setnftapprovalforall","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/collateral\".ICollateralActions.__type"},{"id":154,"kind":64,"name":"isNFTApprovedForAll","url":"modules/_actions_collateral_.html#icollateralactions.__type.isnftapprovedforall","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/collateral\".ICollateralActions.__type"},{"id":155,"kind":64,"name":"getNFTCount","url":"modules/_actions_collateral_.html#icollateralactions.__type.getnftcount","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/collateral\".ICollateralActions.__type"},{"id":156,"kind":64,"name":"getNFTData","url":"modules/_actions_collateral_.html#icollateralactions.__type.getnftdata","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/collateral\".ICollateralActions.__type"},{"id":157,"kind":64,"name":"getNFTOwner","url":"modules/_actions_collateral_.html#icollateralactions.__type.getnftowner","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/collateral\".ICollateralActions.__type"},{"id":158,"kind":64,"name":"transferNFT","url":"modules/_actions_collateral_.html#icollateralactions.__type.transfernft","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/collateral\".ICollateralActions.__type"},{"id":159,"kind":1,"name":"\"actions/governance\"","url":"modules/_actions_governance_.html","classes":"tsd-kind-module"},{"id":160,"kind":4194304,"name":"IGovernanceActions","url":"modules/_actions_governance_.html#igovernanceactions","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"actions/governance\""},{"id":161,"kind":65536,"name":"__type","url":"modules/_actions_governance_.html#igovernanceactions.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"actions/governance\".IGovernanceActions"},{"id":162,"kind":64,"name":"relyAddress","url":"modules/_actions_governance_.html#igovernanceactions.__type.relyaddress","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/governance\".IGovernanceActions.__type"},{"id":163,"kind":1,"name":"\"actions/proxy\"","url":"modules/_actions_proxy_.html","classes":"tsd-kind-module"},{"id":164,"kind":64,"name":"ProxyActions","url":"modules/_actions_proxy_.html#proxyactions","classes":"tsd-kind-function tsd-parent-kind-module tsd-has-type-parameter","parent":"\"actions/proxy\""},{"id":165,"kind":4194304,"name":"IProxyActions","url":"modules/_actions_proxy_.html#iproxyactions","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"actions/proxy\""},{"id":166,"kind":65536,"name":"__type","url":"modules/_actions_proxy_.html#iproxyactions.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"actions/proxy\".IProxyActions"},{"id":167,"kind":64,"name":"buildProxy","url":"modules/_actions_proxy_.html#iproxyactions.__type.buildproxy","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":168,"kind":64,"name":"checkProxyExists","url":"modules/_actions_proxy_.html#iproxyactions.__type.checkproxyexists","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":169,"kind":64,"name":"getProxy","url":"modules/_actions_proxy_.html#iproxyactions.__type.getproxy","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":170,"kind":64,"name":"proxyCount","url":"modules/_actions_proxy_.html#iproxyactions.__type.proxycount","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":171,"kind":64,"name":"getProxyAccessToken","url":"modules/_actions_proxy_.html#iproxyactions.__type.getproxyaccesstoken","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":172,"kind":64,"name":"getProxyAccessTokenOwner","url":"modules/_actions_proxy_.html#iproxyactions.__type.getproxyaccesstokenowner","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":173,"kind":64,"name":"getProxyOwnerByLoan","url":"modules/_actions_proxy_.html#iproxyactions.__type.getproxyownerbyloan","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":174,"kind":64,"name":"getProxyOwnerByAddress","url":"modules/_actions_proxy_.html#iproxyactions.__type.getproxyownerbyaddress","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":175,"kind":64,"name":"proxyCreateNew","url":"modules/_actions_proxy_.html#iproxyactions.__type.proxycreatenew","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":176,"kind":64,"name":"proxyIssue","url":"modules/_actions_proxy_.html#iproxyactions.__type.proxyissue","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":177,"kind":64,"name":"proxyTransferIssue","url":"modules/_actions_proxy_.html#iproxyactions.__type.proxytransferissue","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":178,"kind":64,"name":"proxyLockBorrowWithdraw","url":"modules/_actions_proxy_.html#iproxyactions.__type.proxylockborrowwithdraw","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":179,"kind":64,"name":"proxyRepayUnlockClose","url":"modules/_actions_proxy_.html#iproxyactions.__type.proxyrepayunlockclose","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":180,"kind":1,"name":"\"actions/index\"","url":"modules/_actions_index_.html","classes":"tsd-kind-module"},{"id":181,"kind":4194304,"name":"TinlakeActions","url":"modules/_actions_index_.html#tinlakeactions","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"actions/index\""},{"id":182,"kind":1,"name":"\"types/tinlake\"","url":"modules/_types_tinlake_.html","classes":"tsd-kind-module"},{"id":183,"kind":4194304,"name":"Loan","url":"modules/_types_tinlake_.html#loan","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"types/tinlake\""},{"id":184,"kind":65536,"name":"__type","url":"modules/_types_tinlake_.html#loan.__type-3","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"types/tinlake\".Loan"},{"id":185,"kind":32,"name":"loanId","url":"modules/_types_tinlake_.html#loan.__type-3.loanid","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":186,"kind":32,"name":"registry","url":"modules/_types_tinlake_.html#loan.__type-3.registry","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":187,"kind":32,"name":"tokenId","url":"modules/_types_tinlake_.html#loan.__type-3.tokenid","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":188,"kind":32,"name":"ownerOf","url":"modules/_types_tinlake_.html#loan.__type-3.ownerof","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":189,"kind":32,"name":"principal","url":"modules/_types_tinlake_.html#loan.__type-3.principal","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":190,"kind":32,"name":"interestRate","url":"modules/_types_tinlake_.html#loan.__type-3.interestrate","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":191,"kind":32,"name":"debt","url":"modules/_types_tinlake_.html#loan.__type-3.debt","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":192,"kind":32,"name":"threshold","url":"modules/_types_tinlake_.html#loan.__type-3.threshold","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":193,"kind":32,"name":"price","url":"modules/_types_tinlake_.html#loan.__type-3.price","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":194,"kind":32,"name":"status","url":"modules/_types_tinlake_.html#loan.__type-3.status","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":195,"kind":32,"name":"nft","url":"modules/_types_tinlake_.html#loan.__type-3.nft","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":196,"kind":32,"name":"proxyOwner","url":"modules/_types_tinlake_.html#loan.__type-3.proxyowner","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":197,"kind":4194304,"name":"Tranche","url":"modules/_types_tinlake_.html#tranche","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"types/tinlake\""},{"id":198,"kind":65536,"name":"__type","url":"modules/_types_tinlake_.html#tranche.__type-5","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"types/tinlake\".Tranche"},{"id":199,"kind":32,"name":"availableFunds","url":"modules/_types_tinlake_.html#tranche.__type-5.availablefunds","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Tranche.__type"},{"id":200,"kind":32,"name":"tokenPrice","url":"modules/_types_tinlake_.html#tranche.__type-5.tokenprice","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Tranche.__type"},{"id":201,"kind":32,"name":"type","url":"modules/_types_tinlake_.html#tranche.__type-5.type","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Tranche.__type"},{"id":202,"kind":32,"name":"token","url":"modules/_types_tinlake_.html#tranche.__type-5.token","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Tranche.__type"},{"id":203,"kind":32,"name":"totalSupply","url":"modules/_types_tinlake_.html#tranche.__type-5.totalsupply","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Tranche.__type"},{"id":204,"kind":32,"name":"interestRate","url":"modules/_types_tinlake_.html#tranche.__type-5.interestrate-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Tranche.__type"},{"id":205,"kind":4194304,"name":"NFT","url":"modules/_types_tinlake_.html#nft-1","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"types/tinlake\""},{"id":206,"kind":65536,"name":"__type","url":"modules/_types_tinlake_.html#nft-1.__type-4","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"types/tinlake\".NFT"},{"id":207,"kind":32,"name":"registry","url":"modules/_types_tinlake_.html#nft-1.__type-4.registry-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".NFT.__type"},{"id":208,"kind":32,"name":"tokenId","url":"modules/_types_tinlake_.html#nft-1.__type-4.tokenid-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".NFT.__type"},{"id":209,"kind":32,"name":"nftOwner","url":"modules/_types_tinlake_.html#nft-1.__type-4.nftowner","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".NFT.__type"},{"id":210,"kind":32,"name":"nftData","url":"modules/_types_tinlake_.html#nft-1.__type-4.nftdata","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".NFT.__type"},{"id":211,"kind":4194304,"name":"Investor","url":"modules/_types_tinlake_.html#investor","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"types/tinlake\""},{"id":212,"kind":65536,"name":"__type","url":"modules/_types_tinlake_.html#investor.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"types/tinlake\".Investor"},{"id":213,"kind":32,"name":"junior","url":"modules/_types_tinlake_.html#investor.__type.junior","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Investor.__type"},{"id":214,"kind":65536,"name":"__type","url":"modules/_types_tinlake_.html#investor.__type.junior.__type-1","classes":"tsd-kind-type-literal tsd-parent-kind-variable","parent":"\"types/tinlake\".Investor.__type.junior"},{"id":215,"kind":32,"name":"maxSupply","url":"modules/_types_tinlake_.html#investor.__type.junior.__type-1.maxsupply","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Investor.__type.junior.__type"},{"id":216,"kind":32,"name":"tokenBalance","url":"modules/_types_tinlake_.html#investor.__type.junior.__type-1.tokenbalance","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Investor.__type.junior.__type"},{"id":217,"kind":32,"name":"maxRedeem","url":"modules/_types_tinlake_.html#investor.__type.junior.__type-1.maxredeem","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Investor.__type.junior.__type"},{"id":218,"kind":32,"name":"senior","url":"modules/_types_tinlake_.html#investor.__type.senior","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Investor.__type"},{"id":219,"kind":65536,"name":"__type","url":"modules/_types_tinlake_.html#investor.__type.senior.__type-2","classes":"tsd-kind-type-literal tsd-parent-kind-variable","parent":"\"types/tinlake\".Investor.__type.senior"},{"id":220,"kind":32,"name":"maxSupply","url":"modules/_types_tinlake_.html#investor.__type.senior.__type-2.maxsupply-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Investor.__type.senior.__type"},{"id":221,"kind":32,"name":"tokenBalance","url":"modules/_types_tinlake_.html#investor.__type.senior.__type-2.tokenbalance-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Investor.__type.senior.__type"},{"id":222,"kind":32,"name":"maxRedeem","url":"modules/_types_tinlake_.html#investor.__type.senior.__type-2.maxredeem-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Investor.__type.senior.__type"},{"id":223,"kind":32,"name":"address","url":"modules/_types_tinlake_.html#investor.__type.address","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Investor.__type"},{"id":224,"kind":4194304,"name":"ITinlake","url":"modules/_types_tinlake_.html#itinlake","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"types/tinlake\""},{"id":225,"kind":1,"name":"\"actions/analytics\"","url":"modules/_actions_analytics_.html","classes":"tsd-kind-module"},{"id":226,"kind":64,"name":"AnalyticsActions","url":"modules/_actions_analytics_.html#analyticsactions","classes":"tsd-kind-function tsd-parent-kind-module tsd-has-type-parameter","parent":"\"actions/analytics\""},{"id":227,"kind":4194304,"name":"IAnalyticsActions","url":"modules/_actions_analytics_.html#ianalyticsactions","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"actions/analytics\""},{"id":228,"kind":65536,"name":"__type","url":"modules/_actions_analytics_.html#ianalyticsactions.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"actions/analytics\".IAnalyticsActions"},{"id":229,"kind":64,"name":"getTotalDebt","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.gettotaldebt","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":230,"kind":64,"name":"getTotalBalance","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.gettotalbalance","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":231,"kind":64,"name":"getDebt","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getdebt","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":232,"kind":64,"name":"loanCount","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.loancount","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":233,"kind":64,"name":"getLoanList","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getloanlist","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":234,"kind":64,"name":"getLoan","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getloan","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":235,"kind":64,"name":"getCollateral","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getcollateral","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":236,"kind":64,"name":"getPrincipal","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getprincipal","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":237,"kind":64,"name":"getInterestRate","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getinterestrate","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":238,"kind":64,"name":"getOwnerOfLoan","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getownerofloan","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":239,"kind":64,"name":"getOwnerOfCollateral","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getownerofcollateral","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":240,"kind":64,"name":"existsSenior","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.existssenior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":241,"kind":64,"name":"getJuniorReserve","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getjuniorreserve","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":242,"kind":64,"name":"getSeniorReserve","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getseniorreserve","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":243,"kind":64,"name":"getJuniorTokenBalance","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getjuniortokenbalance","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":244,"kind":64,"name":"getSeniorTokenBalance","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getseniortokenbalance","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":245,"kind":64,"name":"getMaxSupplyAmountJunior","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getmaxsupplyamountjunior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":246,"kind":64,"name":"getMaxRedeemAmountJunior","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getmaxredeemamountjunior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":247,"kind":64,"name":"getMaxSupplyAmountSenior","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getmaxsupplyamountsenior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":248,"kind":64,"name":"getMaxRedeemAmountSenior","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getmaxredeemamountsenior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":249,"kind":64,"name":"getTokenPriceJunior","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.gettokenpricejunior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":250,"kind":64,"name":"getTokenPriceSenior","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.gettokenpricesenior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":251,"kind":64,"name":"getSeniorDebt","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getseniordebt","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":252,"kind":64,"name":"getSeniorInterestRate","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getseniorinterestrate","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":253,"kind":64,"name":"getMinJuniorRatio","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getminjuniorratio","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":254,"kind":64,"name":"getCurrentJuniorRatio","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getcurrentjuniorratio","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":255,"kind":64,"name":"getAssetValueJunior","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getassetvaluejunior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":256,"kind":64,"name":"getInvestor","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getinvestor","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":257,"kind":1,"name":"\"utils/baseToDisplay\"","url":"modules/_utils_basetodisplay_.html","classes":"tsd-kind-module"},{"id":258,"kind":64,"name":"baseToDisplay","url":"modules/_utils_basetodisplay_.html#basetodisplay","classes":"tsd-kind-function tsd-parent-kind-module","parent":"\"utils/baseToDisplay\""},{"id":259,"kind":1,"name":"\"utils/baseToDisplay.spec\"","url":"modules/_utils_basetodisplay_spec_.html","classes":"tsd-kind-module"},{"id":260,"kind":1,"name":"\"utils/bnToHex\"","url":"modules/_utils_bntohex_.html","classes":"tsd-kind-module"},{"id":261,"kind":64,"name":"bnToHex","url":"modules/_utils_bntohex_.html#bntohex","classes":"tsd-kind-function tsd-parent-kind-module","parent":"\"utils/bnToHex\""},{"id":262,"kind":1,"name":"\"utils/bnToHex.spec\"","url":"modules/_utils_bntohex_spec_.html","classes":"tsd-kind-module"},{"id":263,"kind":1,"name":"\"utils/displayToBase\"","url":"modules/_utils_displaytobase_.html","classes":"tsd-kind-module"},{"id":264,"kind":64,"name":"displayToBase","url":"modules/_utils_displaytobase_.html#displaytobase","classes":"tsd-kind-function tsd-parent-kind-module","parent":"\"utils/displayToBase\""},{"id":265,"kind":1,"name":"\"utils/displayToBase.spec\"","url":"modules/_utils_displaytobase_spec_.html","classes":"tsd-kind-module"},{"id":266,"kind":1,"name":"\"utils/feeToInterestRate\"","url":"modules/_utils_feetointerestrate_.html","classes":"tsd-kind-module"},{"id":267,"kind":64,"name":"feeToInterestRate","url":"modules/_utils_feetointerestrate_.html#feetointerestrate","classes":"tsd-kind-function tsd-parent-kind-module","parent":"\"utils/feeToInterestRate\""},{"id":268,"kind":1,"name":"\"utils/feeToInterestRate.spec\"","url":"modules/_utils_feetointerestrate_spec_.html","classes":"tsd-kind-module"},{"id":269,"kind":1,"name":"\"utils/getLoanStatus\"","url":"modules/_utils_getloanstatus_.html","classes":"tsd-kind-module"},{"id":270,"kind":4194304,"name":"LoanStatus","url":"modules/_utils_getloanstatus_.html#loanstatus","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"utils/getLoanStatus\""},{"id":271,"kind":64,"name":"getLoanStatus","url":"modules/_utils_getloanstatus_.html#getloanstatus","classes":"tsd-kind-function tsd-parent-kind-module","parent":"\"utils/getLoanStatus\""},{"id":272,"kind":1,"name":"\"utils/interestRateToFee\"","url":"modules/_utils_interestratetofee_.html","classes":"tsd-kind-module"},{"id":273,"kind":64,"name":"interestRateToFee","url":"modules/_utils_interestratetofee_.html#interestratetofee","classes":"tsd-kind-function tsd-parent-kind-module","parent":"\"utils/interestRateToFee\""},{"id":274,"kind":1,"name":"\"utils/interestRateToFee.spec\"","url":"modules/_utils_interestratetofee_spec_.html","classes":"tsd-kind-module"}]}; \ No newline at end of file + typedoc.search.data = {"kinds":{"1":"Module","32":"Variable","64":"Function","128":"Class","256":"Interface","512":"Constructor","1024":"Property","2048":"Method","65536":"Type literal","4194304":"Type alias"},"rows":[{"id":0,"kind":1,"name":"\"services/ethereum\"","url":"modules/_services_ethereum_.html","classes":"tsd-kind-module"},{"id":1,"kind":256,"name":"ethI","url":"interfaces/_services_ethereum_.ethi.html","classes":"tsd-kind-interface tsd-parent-kind-module","parent":"\"services/ethereum\""},{"id":2,"kind":1024,"name":"send","url":"interfaces/_services_ethereum_.ethi.html#send","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"services/ethereum\".ethI"},{"id":3,"kind":1024,"name":"web3_sha3","url":"interfaces/_services_ethereum_.ethi.html#web3_sha3","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"services/ethereum\".ethI"},{"id":4,"kind":65536,"name":"__type","url":"interfaces/_services_ethereum_.ethi.html#web3_sha3.__type-3","classes":"tsd-kind-type-literal tsd-parent-kind-property","parent":"\"services/ethereum\".ethI.web3_sha3"},{"id":5,"kind":1024,"name":"getTransactionReceipt","url":"interfaces/_services_ethereum_.ethi.html#gettransactionreceipt","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"services/ethereum\".ethI"},{"id":6,"kind":65536,"name":"__type","url":"interfaces/_services_ethereum_.ethi.html#gettransactionreceipt.__type-2","classes":"tsd-kind-type-literal tsd-parent-kind-property","parent":"\"services/ethereum\".ethI.getTransactionReceipt"},{"id":7,"kind":1024,"name":"getTransactionByHash","url":"interfaces/_services_ethereum_.ethi.html#gettransactionbyhash","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"services/ethereum\".ethI"},{"id":8,"kind":65536,"name":"__type","url":"interfaces/_services_ethereum_.ethi.html#gettransactionbyhash.__type-1","classes":"tsd-kind-type-literal tsd-parent-kind-property","parent":"\"services/ethereum\".ethI.getTransactionByHash"},{"id":9,"kind":1024,"name":"contract","url":"interfaces/_services_ethereum_.ethi.html#contract","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"services/ethereum\".ethI"},{"id":10,"kind":65536,"name":"__type","url":"interfaces/_services_ethereum_.ethi.html#contract.__type","classes":"tsd-kind-type-literal tsd-parent-kind-property","parent":"\"services/ethereum\".ethI.contract"},{"id":11,"kind":1024,"name":"sendRawTransaction","url":"interfaces/_services_ethereum_.ethi.html#sendrawtransaction","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"services/ethereum\".ethI"},{"id":12,"kind":1024,"name":"getTransactionCount","url":"interfaces/_services_ethereum_.ethi.html#gettransactioncount","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"services/ethereum\".ethI"},{"id":13,"kind":1024,"name":"abi","url":"interfaces/_services_ethereum_.ethi.html#abi","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"services/ethereum\".ethI"},{"id":14,"kind":256,"name":"Events","url":"interfaces/_services_ethereum_.events.html","classes":"tsd-kind-interface tsd-parent-kind-module","parent":"\"services/ethereum\""},{"id":15,"kind":1024,"name":"txHash","url":"interfaces/_services_ethereum_.events.html#txhash","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"services/ethereum\".Events"},{"id":16,"kind":1024,"name":"status","url":"interfaces/_services_ethereum_.events.html#status","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"services/ethereum\".Events"},{"id":17,"kind":1024,"name":"events","url":"interfaces/_services_ethereum_.events.html#events","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"services/ethereum\".Events"},{"id":18,"kind":32,"name":"ZERO_ADDRESS","url":"modules/_services_ethereum_.html#zero_address","classes":"tsd-kind-variable tsd-parent-kind-module","parent":"\"services/ethereum\""},{"id":19,"kind":64,"name":"executeAndRetry","url":"modules/_services_ethereum_.html#executeandretry","classes":"tsd-kind-function tsd-parent-kind-module","parent":"\"services/ethereum\""},{"id":20,"kind":64,"name":"waitAndReturnEvents","url":"modules/_services_ethereum_.html#waitandreturnevents","classes":"tsd-kind-function tsd-parent-kind-module","parent":"\"services/ethereum\""},{"id":21,"kind":64,"name":"waitForTransaction","url":"modules/_services_ethereum_.html#waitfortransaction","classes":"tsd-kind-function tsd-parent-kind-module","parent":"\"services/ethereum\""},{"id":22,"kind":64,"name":"findEvent","url":"modules/_services_ethereum_.html#findevent","classes":"tsd-kind-function tsd-parent-kind-module","parent":"\"services/ethereum\""},{"id":23,"kind":1,"name":"\"Tinlake\"","url":"modules/_tinlake_.html","classes":"tsd-kind-module"},{"id":24,"kind":128,"name":"Tinlake","url":"classes/_tinlake_.tinlake.html","classes":"tsd-kind-class tsd-parent-kind-module","parent":"\"Tinlake\""},{"id":25,"kind":1024,"name":"provider","url":"classes/_tinlake_.tinlake.html#provider","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":26,"kind":1024,"name":"eth","url":"classes/_tinlake_.tinlake.html#eth","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":27,"kind":1024,"name":"ethOptions","url":"classes/_tinlake_.tinlake.html#ethoptions","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":28,"kind":1024,"name":"ethConfig","url":"classes/_tinlake_.tinlake.html#ethconfig","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":29,"kind":1024,"name":"ethersConfig","url":"classes/_tinlake_.tinlake.html#ethersconfig","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":30,"kind":1024,"name":"contractAddresses","url":"classes/_tinlake_.tinlake.html#contractaddresses","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":31,"kind":1024,"name":"transactionTimeout","url":"classes/_tinlake_.tinlake.html#transactiontimeout","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":32,"kind":1024,"name":"contracts","url":"classes/_tinlake_.tinlake.html#contracts","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":33,"kind":1024,"name":"ethersContracts","url":"classes/_tinlake_.tinlake.html#etherscontracts","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":34,"kind":1024,"name":"contractAbis","url":"classes/_tinlake_.tinlake.html#contractabis","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":35,"kind":1024,"name":"contractConfig","url":"classes/_tinlake_.tinlake.html#contractconfig","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":36,"kind":512,"name":"constructor","url":"classes/_tinlake_.tinlake.html#constructor","classes":"tsd-kind-constructor tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":37,"kind":2048,"name":"setProvider","url":"classes/_tinlake_.tinlake.html#setprovider","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":38,"kind":2048,"name":"setContracts","url":"classes/_tinlake_.tinlake.html#setcontracts","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":39,"kind":2048,"name":"setEthConfig","url":"classes/_tinlake_.tinlake.html#setethconfig","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":40,"kind":2048,"name":"setEthersConfig","url":"classes/_tinlake_.tinlake.html#setethersconfig","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":41,"kind":2048,"name":"createEthContract","url":"classes/_tinlake_.tinlake.html#createethcontract","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":42,"kind":2048,"name":"createContract","url":"classes/_tinlake_.tinlake.html#createcontract","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":43,"kind":2048,"name":"getContract","url":"classes/_tinlake_.tinlake.html#getcontract","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":44,"kind":2048,"name":"contract","url":"classes/_tinlake_.tinlake.html#contract","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":45,"kind":2048,"name":"pending","url":"classes/_tinlake_.tinlake.html#pending","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":46,"kind":2048,"name":"getTransactionReceipt","url":"classes/_tinlake_.tinlake.html#gettransactionreceipt","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":47,"kind":2048,"name":"getOperatorType","url":"classes/_tinlake_.tinlake.html#getoperatortype","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":48,"kind":4194304,"name":"PendingTransaction","url":"modules/_tinlake_.html#pendingtransaction","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"Tinlake\""},{"id":49,"kind":65536,"name":"__type","url":"modules/_tinlake_.html#pendingtransaction.__type-7","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"Tinlake\".PendingTransaction"},{"id":50,"kind":32,"name":"hash","url":"modules/_tinlake_.html#pendingtransaction.__type-7.hash","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".PendingTransaction.__type"},{"id":51,"kind":32,"name":"timesOutAt","url":"modules/_tinlake_.html#pendingtransaction.__type-7.timesoutat","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".PendingTransaction.__type"},{"id":52,"kind":4194304,"name":"EthConfig","url":"modules/_tinlake_.html#ethconfig","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"Tinlake\""},{"id":53,"kind":65536,"name":"__type","url":"modules/_tinlake_.html#ethconfig.__type-4","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"Tinlake\".EthConfig"},{"id":54,"kind":32,"name":"from","url":"modules/_tinlake_.html#ethconfig.__type-4.from","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".EthConfig.__type"},{"id":55,"kind":32,"name":"gasPrice","url":"modules/_tinlake_.html#ethconfig.__type-4.gasprice","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".EthConfig.__type"},{"id":56,"kind":32,"name":"gas","url":"modules/_tinlake_.html#ethconfig.__type-4.gas","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".EthConfig.__type"},{"id":57,"kind":4194304,"name":"EthersOverrides","url":"modules/_tinlake_.html#ethersoverrides","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"Tinlake\""},{"id":58,"kind":65536,"name":"__type","url":"modules/_tinlake_.html#ethersoverrides.__type-6","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"Tinlake\".EthersOverrides"},{"id":59,"kind":32,"name":"gasPrice","url":"modules/_tinlake_.html#ethersoverrides.__type-6.gasprice-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".EthersOverrides.__type"},{"id":60,"kind":32,"name":"gasLimit","url":"modules/_tinlake_.html#ethersoverrides.__type-6.gaslimit","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".EthersOverrides.__type"},{"id":61,"kind":4194304,"name":"EthersConfig","url":"modules/_tinlake_.html#ethersconfig","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"Tinlake\""},{"id":62,"kind":65536,"name":"__type","url":"modules/_tinlake_.html#ethersconfig.__type-5","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"Tinlake\".EthersConfig"},{"id":63,"kind":32,"name":"provider","url":"modules/_tinlake_.html#ethersconfig.__type-5.provider","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".EthersConfig.__type"},{"id":64,"kind":32,"name":"signer","url":"modules/_tinlake_.html#ethersconfig.__type-5.signer","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".EthersConfig.__type"},{"id":65,"kind":32,"name":"overrides","url":"modules/_tinlake_.html#ethersconfig.__type-5.overrides","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".EthersConfig.__type"},{"id":66,"kind":4194304,"name":"ContractName","url":"modules/_tinlake_.html#contractname","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"Tinlake\""},{"id":67,"kind":4194304,"name":"Contracts","url":"modules/_tinlake_.html#contracts","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"Tinlake\""},{"id":68,"kind":65536,"name":"__type","url":"modules/_tinlake_.html#contracts.__type-3","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"Tinlake\".Contracts"},{"id":69,"kind":4194304,"name":"ContractAbis","url":"modules/_tinlake_.html#contractabis","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"Tinlake\""},{"id":70,"kind":65536,"name":"__type","url":"modules/_tinlake_.html#contractabis.__type-1","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"Tinlake\".ContractAbis"},{"id":71,"kind":4194304,"name":"ContractAddresses","url":"modules/_tinlake_.html#contractaddresses","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"Tinlake\""},{"id":72,"kind":65536,"name":"__type","url":"modules/_tinlake_.html#contractaddresses.__type-2","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"Tinlake\".ContractAddresses"},{"id":73,"kind":4194304,"name":"TinlakeParams","url":"modules/_tinlake_.html#tinlakeparams","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"Tinlake\""},{"id":74,"kind":65536,"name":"__type","url":"modules/_tinlake_.html#tinlakeparams.__type-8","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"Tinlake\".TinlakeParams"},{"id":75,"kind":32,"name":"provider","url":"modules/_tinlake_.html#tinlakeparams.__type-8.provider-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".TinlakeParams.__type"},{"id":76,"kind":32,"name":"transactionTimeout","url":"modules/_tinlake_.html#tinlakeparams.__type-8.transactiontimeout","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".TinlakeParams.__type"},{"id":77,"kind":32,"name":"contractAddresses","url":"modules/_tinlake_.html#tinlakeparams.__type-8.contractaddresses-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".TinlakeParams.__type"},{"id":78,"kind":32,"name":"contractAbis","url":"modules/_tinlake_.html#tinlakeparams.__type-8.contractabis-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".TinlakeParams.__type"},{"id":79,"kind":32,"name":"ethConfig","url":"modules/_tinlake_.html#tinlakeparams.__type-8.ethconfig-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".TinlakeParams.__type"},{"id":80,"kind":32,"name":"ethersConfig","url":"modules/_tinlake_.html#tinlakeparams.__type-8.ethersconfig-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".TinlakeParams.__type"},{"id":81,"kind":32,"name":"ethOptions","url":"modules/_tinlake_.html#tinlakeparams.__type-8.ethoptions","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".TinlakeParams.__type"},{"id":82,"kind":32,"name":"contracts","url":"modules/_tinlake_.html#tinlakeparams.__type-8.contracts-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".TinlakeParams.__type"},{"id":83,"kind":32,"name":"contractConfig","url":"modules/_tinlake_.html#tinlakeparams.__type-8.contractconfig","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".TinlakeParams.__type"},{"id":84,"kind":4194304,"name":"Constructor","url":"modules/_tinlake_.html#constructor","classes":"tsd-kind-type-alias tsd-parent-kind-module tsd-has-type-parameter","parent":"\"Tinlake\""},{"id":85,"kind":65536,"name":"__type","url":"modules/_tinlake_.html#constructor.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"Tinlake\".Constructor"},{"id":86,"kind":1,"name":"\"actions/admin\"","url":"modules/_actions_admin_.html","classes":"tsd-kind-module"},{"id":87,"kind":64,"name":"AdminActions","url":"modules/_actions_admin_.html#adminactions","classes":"tsd-kind-function tsd-parent-kind-module tsd-has-type-parameter","parent":"\"actions/admin\""},{"id":88,"kind":4194304,"name":"IAdminActions","url":"modules/_actions_admin_.html#iadminactions","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"actions/admin\""},{"id":89,"kind":65536,"name":"__type","url":"modules/_actions_admin_.html#iadminactions.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"actions/admin\".IAdminActions"},{"id":90,"kind":64,"name":"isWard","url":"modules/_actions_admin_.html#iadminactions.__type.isward","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":91,"kind":64,"name":"canSetInterestRate","url":"modules/_actions_admin_.html#iadminactions.__type.cansetinterestrate","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":92,"kind":64,"name":"canSetSeniorTrancheInterest","url":"modules/_actions_admin_.html#iadminactions.__type.cansetseniortrancheinterest","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":93,"kind":64,"name":"canSetMinimumJuniorRatio","url":"modules/_actions_admin_.html#iadminactions.__type.cansetminimumjuniorratio","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":94,"kind":64,"name":"canSetRiskScore","url":"modules/_actions_admin_.html#iadminactions.__type.cansetriskscore","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":95,"kind":64,"name":"canSetInvestorAllowanceJunior","url":"modules/_actions_admin_.html#iadminactions.__type.cansetinvestorallowancejunior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":96,"kind":64,"name":"canSetInvestorAllowanceSenior","url":"modules/_actions_admin_.html#iadminactions.__type.cansetinvestorallowancesenior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":97,"kind":64,"name":"canSetLoanPrice","url":"modules/_actions_admin_.html#iadminactions.__type.cansetloanprice","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":98,"kind":64,"name":"initRate","url":"modules/_actions_admin_.html#iadminactions.__type.initrate","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":99,"kind":64,"name":"setRate","url":"modules/_actions_admin_.html#iadminactions.__type.setrate","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":100,"kind":64,"name":"setMinimumJuniorRatio","url":"modules/_actions_admin_.html#iadminactions.__type.setminimumjuniorratio","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":101,"kind":64,"name":"approveAllowanceJunior","url":"modules/_actions_admin_.html#iadminactions.__type.approveallowancejunior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":102,"kind":64,"name":"approveAllowanceSenior","url":"modules/_actions_admin_.html#iadminactions.__type.approveallowancesenior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":103,"kind":1,"name":"\"actions/borrower\"","url":"modules/_actions_borrower_.html","classes":"tsd-kind-module"},{"id":104,"kind":64,"name":"BorrowerActions","url":"modules/_actions_borrower_.html#borroweractions","classes":"tsd-kind-function tsd-parent-kind-module tsd-has-type-parameter","parent":"\"actions/borrower\""},{"id":105,"kind":4194304,"name":"IBorrowerActions","url":"modules/_actions_borrower_.html#iborroweractions","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"actions/borrower\""},{"id":106,"kind":65536,"name":"__type","url":"modules/_actions_borrower_.html#iborroweractions.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"actions/borrower\".IBorrowerActions"},{"id":107,"kind":64,"name":"issue","url":"modules/_actions_borrower_.html#iborroweractions.__type.issue","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/borrower\".IBorrowerActions.__type"},{"id":108,"kind":64,"name":"nftLookup","url":"modules/_actions_borrower_.html#iborroweractions.__type.nftlookup","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/borrower\".IBorrowerActions.__type"},{"id":109,"kind":64,"name":"lock","url":"modules/_actions_borrower_.html#iborroweractions.__type.lock","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/borrower\".IBorrowerActions.__type"},{"id":110,"kind":64,"name":"unlock","url":"modules/_actions_borrower_.html#iborroweractions.__type.unlock","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/borrower\".IBorrowerActions.__type"},{"id":111,"kind":64,"name":"close","url":"modules/_actions_borrower_.html#iborroweractions.__type.close","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/borrower\".IBorrowerActions.__type"},{"id":112,"kind":64,"name":"borrow","url":"modules/_actions_borrower_.html#iborroweractions.__type.borrow","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/borrower\".IBorrowerActions.__type"},{"id":113,"kind":64,"name":"withdraw","url":"modules/_actions_borrower_.html#iborroweractions.__type.withdraw","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/borrower\".IBorrowerActions.__type"},{"id":114,"kind":64,"name":"repay","url":"modules/_actions_borrower_.html#iborroweractions.__type.repay","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/borrower\".IBorrowerActions.__type"},{"id":115,"kind":1,"name":"\"actions/lender\"","url":"modules/_actions_lender_.html","classes":"tsd-kind-module"},{"id":116,"kind":64,"name":"LenderActions","url":"modules/_actions_lender_.html#lenderactions","classes":"tsd-kind-function tsd-parent-kind-module tsd-has-type-parameter","parent":"\"actions/lender\""},{"id":117,"kind":4194304,"name":"ILenderActions","url":"modules/_actions_lender_.html#ilenderactions","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"actions/lender\""},{"id":118,"kind":65536,"name":"__type","url":"modules/_actions_lender_.html#ilenderactions.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"actions/lender\".ILenderActions"},{"id":119,"kind":64,"name":"getSeniorTokenAllowance","url":"modules/_actions_lender_.html#ilenderactions.__type.getseniortokenallowance","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/lender\".ILenderActions.__type"},{"id":120,"kind":64,"name":"getJuniorTokenAllowance","url":"modules/_actions_lender_.html#ilenderactions.__type.getjuniortokenallowance","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/lender\".ILenderActions.__type"},{"id":121,"kind":64,"name":"supplyJunior","url":"modules/_actions_lender_.html#ilenderactions.__type.supplyjunior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/lender\".ILenderActions.__type"},{"id":122,"kind":32,"name":"approveJuniorToken","url":"modules/_actions_lender_.html#ilenderactions.__type.approvejuniortoken","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"actions/lender\".ILenderActions.__type"},{"id":123,"kind":65536,"name":"__type","url":"modules/_actions_lender_.html#ilenderactions.__type.approvejuniortoken.__type-1","classes":"tsd-kind-type-literal tsd-parent-kind-variable","parent":"\"actions/lender\".ILenderActions.__type.approveJuniorToken"},{"id":124,"kind":32,"name":"approveSeniorToken","url":"modules/_actions_lender_.html#ilenderactions.__type.approveseniortoken","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"actions/lender\".ILenderActions.__type"},{"id":125,"kind":65536,"name":"__type","url":"modules/_actions_lender_.html#ilenderactions.__type.approveseniortoken.__type-2","classes":"tsd-kind-type-literal tsd-parent-kind-variable","parent":"\"actions/lender\".ILenderActions.__type.approveSeniorToken"},{"id":126,"kind":64,"name":"redeemJunior","url":"modules/_actions_lender_.html#ilenderactions.__type.redeemjunior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/lender\".ILenderActions.__type"},{"id":127,"kind":64,"name":"supplySenior","url":"modules/_actions_lender_.html#ilenderactions.__type.supplysenior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/lender\".ILenderActions.__type"},{"id":128,"kind":64,"name":"redeemSenior","url":"modules/_actions_lender_.html#ilenderactions.__type.redeemsenior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/lender\".ILenderActions.__type"},{"id":129,"kind":64,"name":"balance","url":"modules/_actions_lender_.html#ilenderactions.__type.balance","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/lender\".ILenderActions.__type"},{"id":130,"kind":1,"name":"\"actions/currency\"","url":"modules/_actions_currency_.html","classes":"tsd-kind-module"},{"id":131,"kind":64,"name":"CurrencyActions","url":"modules/_actions_currency_.html#currencyactions","classes":"tsd-kind-function tsd-parent-kind-module tsd-has-type-parameter","parent":"\"actions/currency\""},{"id":132,"kind":4194304,"name":"ICurrencyActions","url":"modules/_actions_currency_.html#icurrencyactions","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"actions/currency\""},{"id":133,"kind":65536,"name":"__type","url":"modules/_actions_currency_.html#icurrencyactions.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"actions/currency\".ICurrencyActions"},{"id":134,"kind":64,"name":"mintCurrency","url":"modules/_actions_currency_.html#icurrencyactions.__type.mintcurrency","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/currency\".ICurrencyActions.__type"},{"id":135,"kind":64,"name":"getCurrencyBalance","url":"modules/_actions_currency_.html#icurrencyactions.__type.getcurrencybalance","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/currency\".ICurrencyActions.__type"},{"id":136,"kind":32,"name":"getCurrencyAllowance","url":"modules/_actions_currency_.html#icurrencyactions.__type.getcurrencyallowance","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"actions/currency\".ICurrencyActions.__type"},{"id":137,"kind":65536,"name":"__type","url":"modules/_actions_currency_.html#icurrencyactions.__type.getcurrencyallowance.__type-3","classes":"tsd-kind-type-literal tsd-parent-kind-variable","parent":"\"actions/currency\".ICurrencyActions.__type.getCurrencyAllowance"},{"id":138,"kind":32,"name":"getJuniorForCurrencyAllowance","url":"modules/_actions_currency_.html#icurrencyactions.__type.getjuniorforcurrencyallowance","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"actions/currency\".ICurrencyActions.__type"},{"id":139,"kind":65536,"name":"__type","url":"modules/_actions_currency_.html#icurrencyactions.__type.getjuniorforcurrencyallowance.__type-4","classes":"tsd-kind-type-literal tsd-parent-kind-variable","parent":"\"actions/currency\".ICurrencyActions.__type.getJuniorForCurrencyAllowance"},{"id":140,"kind":32,"name":"getSeniorForCurrencyAllowance","url":"modules/_actions_currency_.html#icurrencyactions.__type.getseniorforcurrencyallowance","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"actions/currency\".ICurrencyActions.__type"},{"id":141,"kind":65536,"name":"__type","url":"modules/_actions_currency_.html#icurrencyactions.__type.getseniorforcurrencyallowance.__type-5","classes":"tsd-kind-type-literal tsd-parent-kind-variable","parent":"\"actions/currency\".ICurrencyActions.__type.getSeniorForCurrencyAllowance"},{"id":142,"kind":64,"name":"approveCurrency","url":"modules/_actions_currency_.html#icurrencyactions.__type.approvecurrency","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/currency\".ICurrencyActions.__type"},{"id":143,"kind":32,"name":"approveSeniorForCurrency","url":"modules/_actions_currency_.html#icurrencyactions.__type.approveseniorforcurrency","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"actions/currency\".ICurrencyActions.__type"},{"id":144,"kind":65536,"name":"__type","url":"modules/_actions_currency_.html#icurrencyactions.__type.approveseniorforcurrency.__type-2","classes":"tsd-kind-type-literal tsd-parent-kind-variable","parent":"\"actions/currency\".ICurrencyActions.__type.approveSeniorForCurrency"},{"id":145,"kind":32,"name":"approveJuniorForCurrency","url":"modules/_actions_currency_.html#icurrencyactions.__type.approvejuniorforcurrency","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"actions/currency\".ICurrencyActions.__type"},{"id":146,"kind":65536,"name":"__type","url":"modules/_actions_currency_.html#icurrencyactions.__type.approvejuniorforcurrency.__type-1","classes":"tsd-kind-type-literal tsd-parent-kind-variable","parent":"\"actions/currency\".ICurrencyActions.__type.approveJuniorForCurrency"},{"id":147,"kind":1,"name":"\"actions/collateral\"","url":"modules/_actions_collateral_.html","classes":"tsd-kind-module"},{"id":148,"kind":64,"name":"CollateralActions","url":"modules/_actions_collateral_.html#collateralactions","classes":"tsd-kind-function tsd-parent-kind-module tsd-has-type-parameter","parent":"\"actions/collateral\""},{"id":149,"kind":4194304,"name":"ICollateralActions","url":"modules/_actions_collateral_.html#icollateralactions","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"actions/collateral\""},{"id":150,"kind":65536,"name":"__type","url":"modules/_actions_collateral_.html#icollateralactions.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"actions/collateral\".ICollateralActions"},{"id":151,"kind":64,"name":"mintTitleNFT","url":"modules/_actions_collateral_.html#icollateralactions.__type.minttitlenft","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/collateral\".ICollateralActions.__type"},{"id":152,"kind":64,"name":"mintNFT","url":"modules/_actions_collateral_.html#icollateralactions.__type.mintnft","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/collateral\".ICollateralActions.__type"},{"id":153,"kind":64,"name":"approveNFT","url":"modules/_actions_collateral_.html#icollateralactions.__type.approvenft","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/collateral\".ICollateralActions.__type"},{"id":154,"kind":64,"name":"setNFTApprovalForAll","url":"modules/_actions_collateral_.html#icollateralactions.__type.setnftapprovalforall","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/collateral\".ICollateralActions.__type"},{"id":155,"kind":64,"name":"isNFTApprovedForAll","url":"modules/_actions_collateral_.html#icollateralactions.__type.isnftapprovedforall","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/collateral\".ICollateralActions.__type"},{"id":156,"kind":64,"name":"getNFTCount","url":"modules/_actions_collateral_.html#icollateralactions.__type.getnftcount","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/collateral\".ICollateralActions.__type"},{"id":157,"kind":64,"name":"getNFTData","url":"modules/_actions_collateral_.html#icollateralactions.__type.getnftdata","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/collateral\".ICollateralActions.__type"},{"id":158,"kind":64,"name":"getNFTOwner","url":"modules/_actions_collateral_.html#icollateralactions.__type.getnftowner","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/collateral\".ICollateralActions.__type"},{"id":159,"kind":64,"name":"transferNFT","url":"modules/_actions_collateral_.html#icollateralactions.__type.transfernft","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/collateral\".ICollateralActions.__type"},{"id":160,"kind":1,"name":"\"actions/governance\"","url":"modules/_actions_governance_.html","classes":"tsd-kind-module"},{"id":161,"kind":4194304,"name":"IGovernanceActions","url":"modules/_actions_governance_.html#igovernanceactions","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"actions/governance\""},{"id":162,"kind":65536,"name":"__type","url":"modules/_actions_governance_.html#igovernanceactions.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"actions/governance\".IGovernanceActions"},{"id":163,"kind":64,"name":"relyAddress","url":"modules/_actions_governance_.html#igovernanceactions.__type.relyaddress","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/governance\".IGovernanceActions.__type"},{"id":164,"kind":1,"name":"\"actions/proxy\"","url":"modules/_actions_proxy_.html","classes":"tsd-kind-module"},{"id":165,"kind":64,"name":"ProxyActions","url":"modules/_actions_proxy_.html#proxyactions","classes":"tsd-kind-function tsd-parent-kind-module tsd-has-type-parameter","parent":"\"actions/proxy\""},{"id":166,"kind":4194304,"name":"IProxyActions","url":"modules/_actions_proxy_.html#iproxyactions","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"actions/proxy\""},{"id":167,"kind":65536,"name":"__type","url":"modules/_actions_proxy_.html#iproxyactions.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"actions/proxy\".IProxyActions"},{"id":168,"kind":64,"name":"buildProxy","url":"modules/_actions_proxy_.html#iproxyactions.__type.buildproxy","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":169,"kind":64,"name":"checkProxyExists","url":"modules/_actions_proxy_.html#iproxyactions.__type.checkproxyexists","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":170,"kind":64,"name":"getProxy","url":"modules/_actions_proxy_.html#iproxyactions.__type.getproxy","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":171,"kind":64,"name":"proxyCount","url":"modules/_actions_proxy_.html#iproxyactions.__type.proxycount","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":172,"kind":64,"name":"getProxyAccessToken","url":"modules/_actions_proxy_.html#iproxyactions.__type.getproxyaccesstoken","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":173,"kind":64,"name":"getProxyAccessTokenOwner","url":"modules/_actions_proxy_.html#iproxyactions.__type.getproxyaccesstokenowner","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":174,"kind":64,"name":"getProxyOwnerByLoan","url":"modules/_actions_proxy_.html#iproxyactions.__type.getproxyownerbyloan","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":175,"kind":64,"name":"getProxyOwnerByAddress","url":"modules/_actions_proxy_.html#iproxyactions.__type.getproxyownerbyaddress","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":176,"kind":64,"name":"proxyCreateNew","url":"modules/_actions_proxy_.html#iproxyactions.__type.proxycreatenew","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":177,"kind":64,"name":"proxyIssue","url":"modules/_actions_proxy_.html#iproxyactions.__type.proxyissue","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":178,"kind":64,"name":"proxyTransferIssue","url":"modules/_actions_proxy_.html#iproxyactions.__type.proxytransferissue","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":179,"kind":64,"name":"proxyLockBorrowWithdraw","url":"modules/_actions_proxy_.html#iproxyactions.__type.proxylockborrowwithdraw","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":180,"kind":64,"name":"proxyRepayUnlockClose","url":"modules/_actions_proxy_.html#iproxyactions.__type.proxyrepayunlockclose","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":181,"kind":1,"name":"\"actions/index\"","url":"modules/_actions_index_.html","classes":"tsd-kind-module"},{"id":182,"kind":4194304,"name":"TinlakeActions","url":"modules/_actions_index_.html#tinlakeactions","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"actions/index\""},{"id":183,"kind":1,"name":"\"types/tinlake\"","url":"modules/_types_tinlake_.html","classes":"tsd-kind-module"},{"id":184,"kind":4194304,"name":"Loan","url":"modules/_types_tinlake_.html#loan","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"types/tinlake\""},{"id":185,"kind":65536,"name":"__type","url":"modules/_types_tinlake_.html#loan.__type-3","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"types/tinlake\".Loan"},{"id":186,"kind":32,"name":"loanId","url":"modules/_types_tinlake_.html#loan.__type-3.loanid","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":187,"kind":32,"name":"registry","url":"modules/_types_tinlake_.html#loan.__type-3.registry","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":188,"kind":32,"name":"tokenId","url":"modules/_types_tinlake_.html#loan.__type-3.tokenid","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":189,"kind":32,"name":"ownerOf","url":"modules/_types_tinlake_.html#loan.__type-3.ownerof","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":190,"kind":32,"name":"principal","url":"modules/_types_tinlake_.html#loan.__type-3.principal","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":191,"kind":32,"name":"interestRate","url":"modules/_types_tinlake_.html#loan.__type-3.interestrate","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":192,"kind":32,"name":"debt","url":"modules/_types_tinlake_.html#loan.__type-3.debt","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":193,"kind":32,"name":"threshold","url":"modules/_types_tinlake_.html#loan.__type-3.threshold","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":194,"kind":32,"name":"price","url":"modules/_types_tinlake_.html#loan.__type-3.price","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":195,"kind":32,"name":"status","url":"modules/_types_tinlake_.html#loan.__type-3.status","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":196,"kind":32,"name":"nft","url":"modules/_types_tinlake_.html#loan.__type-3.nft","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":197,"kind":32,"name":"proxyOwner","url":"modules/_types_tinlake_.html#loan.__type-3.proxyowner","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":198,"kind":4194304,"name":"Tranche","url":"modules/_types_tinlake_.html#tranche","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"types/tinlake\""},{"id":199,"kind":65536,"name":"__type","url":"modules/_types_tinlake_.html#tranche.__type-5","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"types/tinlake\".Tranche"},{"id":200,"kind":32,"name":"availableFunds","url":"modules/_types_tinlake_.html#tranche.__type-5.availablefunds","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Tranche.__type"},{"id":201,"kind":32,"name":"tokenPrice","url":"modules/_types_tinlake_.html#tranche.__type-5.tokenprice","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Tranche.__type"},{"id":202,"kind":32,"name":"type","url":"modules/_types_tinlake_.html#tranche.__type-5.type","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Tranche.__type"},{"id":203,"kind":32,"name":"token","url":"modules/_types_tinlake_.html#tranche.__type-5.token","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Tranche.__type"},{"id":204,"kind":32,"name":"totalSupply","url":"modules/_types_tinlake_.html#tranche.__type-5.totalsupply","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Tranche.__type"},{"id":205,"kind":32,"name":"interestRate","url":"modules/_types_tinlake_.html#tranche.__type-5.interestrate-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Tranche.__type"},{"id":206,"kind":4194304,"name":"NFT","url":"modules/_types_tinlake_.html#nft-1","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"types/tinlake\""},{"id":207,"kind":65536,"name":"__type","url":"modules/_types_tinlake_.html#nft-1.__type-4","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"types/tinlake\".NFT"},{"id":208,"kind":32,"name":"registry","url":"modules/_types_tinlake_.html#nft-1.__type-4.registry-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".NFT.__type"},{"id":209,"kind":32,"name":"tokenId","url":"modules/_types_tinlake_.html#nft-1.__type-4.tokenid-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".NFT.__type"},{"id":210,"kind":32,"name":"nftOwner","url":"modules/_types_tinlake_.html#nft-1.__type-4.nftowner","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".NFT.__type"},{"id":211,"kind":32,"name":"nftData","url":"modules/_types_tinlake_.html#nft-1.__type-4.nftdata","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".NFT.__type"},{"id":212,"kind":4194304,"name":"Investor","url":"modules/_types_tinlake_.html#investor","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"types/tinlake\""},{"id":213,"kind":65536,"name":"__type","url":"modules/_types_tinlake_.html#investor.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"types/tinlake\".Investor"},{"id":214,"kind":32,"name":"junior","url":"modules/_types_tinlake_.html#investor.__type.junior","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Investor.__type"},{"id":215,"kind":65536,"name":"__type","url":"modules/_types_tinlake_.html#investor.__type.junior.__type-1","classes":"tsd-kind-type-literal tsd-parent-kind-variable","parent":"\"types/tinlake\".Investor.__type.junior"},{"id":216,"kind":32,"name":"maxSupply","url":"modules/_types_tinlake_.html#investor.__type.junior.__type-1.maxsupply","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Investor.__type.junior.__type"},{"id":217,"kind":32,"name":"tokenBalance","url":"modules/_types_tinlake_.html#investor.__type.junior.__type-1.tokenbalance","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Investor.__type.junior.__type"},{"id":218,"kind":32,"name":"maxRedeem","url":"modules/_types_tinlake_.html#investor.__type.junior.__type-1.maxredeem","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Investor.__type.junior.__type"},{"id":219,"kind":32,"name":"senior","url":"modules/_types_tinlake_.html#investor.__type.senior","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Investor.__type"},{"id":220,"kind":65536,"name":"__type","url":"modules/_types_tinlake_.html#investor.__type.senior.__type-2","classes":"tsd-kind-type-literal tsd-parent-kind-variable","parent":"\"types/tinlake\".Investor.__type.senior"},{"id":221,"kind":32,"name":"maxSupply","url":"modules/_types_tinlake_.html#investor.__type.senior.__type-2.maxsupply-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Investor.__type.senior.__type"},{"id":222,"kind":32,"name":"tokenBalance","url":"modules/_types_tinlake_.html#investor.__type.senior.__type-2.tokenbalance-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Investor.__type.senior.__type"},{"id":223,"kind":32,"name":"maxRedeem","url":"modules/_types_tinlake_.html#investor.__type.senior.__type-2.maxredeem-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Investor.__type.senior.__type"},{"id":224,"kind":32,"name":"address","url":"modules/_types_tinlake_.html#investor.__type.address","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Investor.__type"},{"id":225,"kind":4194304,"name":"ITinlake","url":"modules/_types_tinlake_.html#itinlake","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"types/tinlake\""},{"id":226,"kind":1,"name":"\"actions/analytics\"","url":"modules/_actions_analytics_.html","classes":"tsd-kind-module"},{"id":227,"kind":64,"name":"AnalyticsActions","url":"modules/_actions_analytics_.html#analyticsactions","classes":"tsd-kind-function tsd-parent-kind-module tsd-has-type-parameter","parent":"\"actions/analytics\""},{"id":228,"kind":4194304,"name":"IAnalyticsActions","url":"modules/_actions_analytics_.html#ianalyticsactions","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"actions/analytics\""},{"id":229,"kind":65536,"name":"__type","url":"modules/_actions_analytics_.html#ianalyticsactions.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"actions/analytics\".IAnalyticsActions"},{"id":230,"kind":64,"name":"getTotalDebt","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.gettotaldebt","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":231,"kind":64,"name":"getTotalBalance","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.gettotalbalance","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":232,"kind":64,"name":"getDebt","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getdebt","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":233,"kind":64,"name":"loanCount","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.loancount","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":234,"kind":64,"name":"getLoanList","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getloanlist","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":235,"kind":64,"name":"getLoan","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getloan","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":236,"kind":64,"name":"getCollateral","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getcollateral","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":237,"kind":64,"name":"getPrincipal","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getprincipal","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":238,"kind":64,"name":"getInterestRate","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getinterestrate","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":239,"kind":64,"name":"getOwnerOfLoan","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getownerofloan","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":240,"kind":64,"name":"getOwnerOfCollateral","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getownerofcollateral","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":241,"kind":64,"name":"existsSenior","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.existssenior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":242,"kind":64,"name":"getJuniorReserve","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getjuniorreserve","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":243,"kind":64,"name":"getSeniorReserve","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getseniorreserve","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":244,"kind":64,"name":"getJuniorTokenBalance","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getjuniortokenbalance","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":245,"kind":64,"name":"getSeniorTokenBalance","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getseniortokenbalance","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":246,"kind":64,"name":"getMaxSupplyAmountJunior","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getmaxsupplyamountjunior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":247,"kind":64,"name":"getMaxRedeemAmountJunior","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getmaxredeemamountjunior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":248,"kind":64,"name":"getMaxSupplyAmountSenior","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getmaxsupplyamountsenior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":249,"kind":64,"name":"getMaxRedeemAmountSenior","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getmaxredeemamountsenior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":250,"kind":64,"name":"getTokenPriceJunior","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.gettokenpricejunior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":251,"kind":64,"name":"getTokenPriceSenior","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.gettokenpricesenior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":252,"kind":64,"name":"getSeniorDebt","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getseniordebt","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":253,"kind":64,"name":"getSeniorInterestRate","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getseniorinterestrate","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":254,"kind":64,"name":"getMinJuniorRatio","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getminjuniorratio","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":255,"kind":64,"name":"getCurrentJuniorRatio","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getcurrentjuniorratio","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":256,"kind":64,"name":"getAssetValueJunior","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getassetvaluejunior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":257,"kind":64,"name":"getInvestor","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getinvestor","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":258,"kind":1,"name":"\"utils/baseToDisplay\"","url":"modules/_utils_basetodisplay_.html","classes":"tsd-kind-module"},{"id":259,"kind":64,"name":"baseToDisplay","url":"modules/_utils_basetodisplay_.html#basetodisplay","classes":"tsd-kind-function tsd-parent-kind-module","parent":"\"utils/baseToDisplay\""},{"id":260,"kind":1,"name":"\"utils/baseToDisplay.spec\"","url":"modules/_utils_basetodisplay_spec_.html","classes":"tsd-kind-module"},{"id":261,"kind":1,"name":"\"utils/bnToHex\"","url":"modules/_utils_bntohex_.html","classes":"tsd-kind-module"},{"id":262,"kind":64,"name":"bnToHex","url":"modules/_utils_bntohex_.html#bntohex","classes":"tsd-kind-function tsd-parent-kind-module","parent":"\"utils/bnToHex\""},{"id":263,"kind":1,"name":"\"utils/bnToHex.spec\"","url":"modules/_utils_bntohex_spec_.html","classes":"tsd-kind-module"},{"id":264,"kind":1,"name":"\"utils/displayToBase\"","url":"modules/_utils_displaytobase_.html","classes":"tsd-kind-module"},{"id":265,"kind":64,"name":"displayToBase","url":"modules/_utils_displaytobase_.html#displaytobase","classes":"tsd-kind-function tsd-parent-kind-module","parent":"\"utils/displayToBase\""},{"id":266,"kind":1,"name":"\"utils/displayToBase.spec\"","url":"modules/_utils_displaytobase_spec_.html","classes":"tsd-kind-module"},{"id":267,"kind":1,"name":"\"utils/feeToInterestRate\"","url":"modules/_utils_feetointerestrate_.html","classes":"tsd-kind-module"},{"id":268,"kind":64,"name":"feeToInterestRate","url":"modules/_utils_feetointerestrate_.html#feetointerestrate","classes":"tsd-kind-function tsd-parent-kind-module","parent":"\"utils/feeToInterestRate\""},{"id":269,"kind":1,"name":"\"utils/feeToInterestRate.spec\"","url":"modules/_utils_feetointerestrate_spec_.html","classes":"tsd-kind-module"},{"id":270,"kind":1,"name":"\"utils/getLoanStatus\"","url":"modules/_utils_getloanstatus_.html","classes":"tsd-kind-module"},{"id":271,"kind":4194304,"name":"LoanStatus","url":"modules/_utils_getloanstatus_.html#loanstatus","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"utils/getLoanStatus\""},{"id":272,"kind":64,"name":"getLoanStatus","url":"modules/_utils_getloanstatus_.html#getloanstatus","classes":"tsd-kind-function tsd-parent-kind-module","parent":"\"utils/getLoanStatus\""},{"id":273,"kind":1,"name":"\"utils/interestRateToFee\"","url":"modules/_utils_interestratetofee_.html","classes":"tsd-kind-module"},{"id":274,"kind":64,"name":"interestRateToFee","url":"modules/_utils_interestratetofee_.html#interestratetofee","classes":"tsd-kind-function tsd-parent-kind-module","parent":"\"utils/interestRateToFee\""},{"id":275,"kind":1,"name":"\"utils/interestRateToFee.spec\"","url":"modules/_utils_interestratetofee_spec_.html","classes":"tsd-kind-module"}]}; \ No newline at end of file diff --git a/docs/classes/_tinlake_.tinlake.html b/docs/classes/_tinlake_.tinlake.html index 3340353..569ddd4 100644 --- a/docs/classes/_tinlake_.tinlake.html +++ b/docs/classes/_tinlake_.tinlake.html @@ -102,11 +102,13 @@

    Properties

    Methods

    @@ -160,7 +162,7 @@

    contractAddresses

    contractAddresses: ContractAddresses
    @@ -170,7 +172,7 @@

    contractConfig

    contractConfig: any
    @@ -180,7 +182,7 @@

    contracts

    contracts: Contracts
    @@ -190,7 +192,7 @@

    eth

    eth: ethI
    @@ -200,7 +202,7 @@

    ethConfig

    ethConfig: EthConfig
    @@ -210,7 +212,7 @@

    ethOptions

    ethOptions: any
    @@ -220,7 +222,7 @@

    ethersConfig

    ethersConfig: EthersConfig
    @@ -230,7 +232,7 @@

    ethersContracts

    ethersContracts: Contracts
    @@ -240,7 +242,7 @@

    provider

    provider: any
    @@ -250,24 +252,50 @@

    transactionTimeout

    transactionTimeout: number

    Methods

    +
    + +

    contract

    +
      +
    • contract(abiName: ContractName, address?: undefined | string): Contract
    • +
    +
      +
    • + +

      Parameters

      +
        +
      • +
        abiName: ContractName
        +
      • +
      • +
        Optional address: undefined | string
        +
      • +
      +

      Returns Contract

      +
    • +
    +

    createContract

      -
    • createContract(address: string, abiName: string): Contract
    • +
    • createContract(address: string, abiName: ContractName): Contract

    Returns Contract

    @@ -287,13 +315,13 @@

    Returns Contract<

    createEthContract

      -
    • createEthContract(address: string, abiName: string): void
    • +
    • createEthContract(address: string, abiName: ContractName): void

    Returns void

    @@ -313,13 +341,13 @@

    Returns void

    getContract

      -
    • getContract(address: string, abiName: string): Contract
    • +
    • getContract(address: string, abiName: ContractName): Contract

    Returns Contract

    @@ -345,7 +373,7 @@

    getOperatorType

  • Parameters

    @@ -368,7 +396,7 @@

    getTransactionReceipt

  • Parameters

    @@ -381,6 +409,29 @@

    Returns Promise

  • +
    + +

    pending

    + + +

    setContracts

    @@ -391,7 +442,7 @@

    setContracts

  • Returns void

    @@ -408,7 +459,7 @@

    setEthConfig

  • Parameters

    @@ -431,7 +482,7 @@

    setEthersConfig

  • Parameters

    @@ -454,7 +505,7 @@

    setProvider

  • Parameters

    @@ -592,6 +643,9 @@

    Returns void transactionTimeout

  • +
  • + contract +
  • createContract
  • @@ -607,6 +661,9 @@

    Returns void getTransactionReceipt

  • +
  • + pending +
  • setContracts
  • @@ -633,7 +690,7 @@

    Returns voidContractAddresses

  • - ContractNames + ContractName
  • Contracts diff --git a/docs/interfaces/_services_ethereum_.ethi.html b/docs/interfaces/_services_ethereum_.ethi.html index 6044540..98bc09e 100644 --- a/docs/interfaces/_services_ethereum_.ethi.html +++ b/docs/interfaces/_services_ethereum_.ethi.html @@ -101,7 +101,7 @@

    abi

    abi: any
    @@ -111,7 +111,7 @@

    contract

    contract: (arg0: any) => { at: (arg0: any) => void }
    @@ -165,7 +165,7 @@

    getTransactionByHash

    getTransactionByHash: (arg0: any, arg1: (err: any, tx: any) => void) => void
    @@ -220,7 +220,7 @@

    getTransactionCount

    getTransactionCount: any
    @@ -230,7 +230,7 @@

    getTransactionReceipt

    getTransactionReceipt: (arg0: any, arg1: (err: any, receipt: any) => void) => void
    @@ -285,7 +285,7 @@

    send

    send: Function
    @@ -295,7 +295,7 @@

    sendRawTransaction

    sendRawTransaction: any
    @@ -305,7 +305,7 @@

    web3_sha3

    web3_sha3: (signature: string) => string
    diff --git a/docs/interfaces/_services_ethereum_.events.html b/docs/interfaces/_services_ethereum_.events.html index 144afde..4d73895 100644 --- a/docs/interfaces/_services_ethereum_.events.html +++ b/docs/interfaces/_services_ethereum_.events.html @@ -96,7 +96,7 @@

    events

    events: { data: any[]; event: { name: any } }[]
    @@ -106,7 +106,7 @@

    status

    status: any
    @@ -116,7 +116,7 @@

    txHash

    txHash: string
    diff --git a/docs/modules/_actions_admin_.html b/docs/modules/_actions_admin_.html index 11791f4..4f62d30 100644 --- a/docs/modules/_actions_admin_.html +++ b/docs/modules/_actions_admin_.html @@ -89,7 +89,7 @@

    IAdminActions

    IAdminActions: { approveAllowanceJunior: any; approveAllowanceSenior: any; canSetInterestRate: any; canSetInvestorAllowanceJunior: any; canSetInvestorAllowanceSenior: any; canSetLoanPrice: any; canSetMinimumJuniorRatio: any; canSetRiskScore: any; canSetSeniorTrancheInterest: any; initRate: any; isWard: any; setMinimumJuniorRatio: any; setRate: any }
    @@ -104,7 +104,7 @@
    approveAllowanceJunior:
  • Parameters

    @@ -132,7 +132,7 @@
    approveAllowanceSenior:
  • Parameters

    @@ -160,7 +160,7 @@
    canSetInterestRate:

    Parameters

    @@ -182,7 +182,7 @@
    canSetInvestorAllowanceJunior

    Parameters

    @@ -204,7 +204,7 @@
    canSetInvestorAllowanceSenior

    Parameters

    @@ -226,7 +226,7 @@
    canSetLoanPrice: fu
  • Parameters

    @@ -248,7 +248,7 @@
    canSetMinimumJuniorRatio

    Parameters

    @@ -270,7 +270,7 @@
    canSetRiskScore: fu
  • Parameters

    @@ -292,7 +292,7 @@
    canSetSeniorTrancheInterest

    Parameters

    @@ -314,7 +314,7 @@
    initRate: function
  • Parameters

    @@ -330,13 +330,13 @@

    Returns Promise
    isWard: function
      -
    • isWard(user: string, contractName: ContractNames): Promise<BN>
    • +
    • isWard(user: string, contractName: ContractName): Promise<BN>

    Returns Promise<BN>

    @@ -361,7 +361,7 @@
    setMinimumJuniorRatio:

    Parameters

    @@ -383,7 +383,7 @@
    setRate: function
  • Parameters

    @@ -415,7 +415,7 @@

    AdminActions

  • Type parameters

    diff --git a/docs/modules/_actions_analytics_.html b/docs/modules/_actions_analytics_.html index 5d33c7d..72ef4ae 100644 --- a/docs/modules/_actions_analytics_.html +++ b/docs/modules/_actions_analytics_.html @@ -89,7 +89,7 @@

    IAnalyticsActions

    IAnalyticsActions: { existsSenior: any; getAssetValueJunior: any; getCollateral: any; getCurrentJuniorRatio: any; getDebt: any; getInterestRate: any; getInvestor: any; getJuniorReserve: any; getJuniorTokenBalance: any; getLoan: any; getLoanList: any; getMaxRedeemAmountJunior: any; getMaxRedeemAmountSenior: any; getMaxSupplyAmountJunior: any; getMaxSupplyAmountSenior: any; getMinJuniorRatio: any; getOwnerOfCollateral: any; getOwnerOfLoan: any; getPrincipal: any; getSeniorDebt: any; getSeniorInterestRate: any; getSeniorReserve: any; getSeniorTokenBalance: any; getTokenPriceJunior: any; getTokenPriceSenior: any; getTotalBalance: any; getTotalDebt: any; loanCount: any }
    @@ -104,7 +104,7 @@
    existsSenior: function
  • Returns boolean

    @@ -120,7 +120,7 @@
    getAssetValueJunior:

    Returns Promise<BN>

    @@ -136,7 +136,7 @@
    getCollateral: function
  • Parameters

    @@ -158,7 +158,7 @@
    getCurrentJuniorRatio:

    Returns Promise<BN>

    @@ -174,7 +174,7 @@
    getDebt: function
  • Parameters

    @@ -196,7 +196,7 @@
    getInterestRate: functio
  • Parameters

    @@ -218,7 +218,7 @@
    getInvestor: function
  • Parameters

    @@ -240,7 +240,7 @@
    getJuniorReserve: functi
  • Returns Promise<BN>

    @@ -256,7 +256,7 @@
    getJuniorTokenBalance:

    Parameters

    @@ -278,7 +278,7 @@
    getLoan: function
  • Parameters

    @@ -300,7 +300,7 @@
    getLoanList: function

    Returns Promise<Loan[]>

    @@ -316,7 +316,7 @@
    getMaxRedeemAmountJunior

    Parameters

    @@ -338,7 +338,7 @@
    getMaxRedeemAmountSenior

    Parameters

    @@ -360,7 +360,7 @@
    getMaxSupplyAmountJunior

    Parameters

    @@ -382,7 +382,7 @@
    getMaxSupplyAmountSenior

    Parameters

    @@ -404,7 +404,7 @@
    getMinJuniorRatio:
  • Returns Promise<BN>

    @@ -420,7 +420,7 @@
    getOwnerOfCollateral: fu
  • Parameters

    @@ -448,7 +448,7 @@
    getOwnerOfLoan: function
  • Parameters

    @@ -470,7 +470,7 @@
    getPrincipal: function
  • Parameters

    @@ -492,7 +492,7 @@
    getSeniorDebt: function<
  • Returns Promise<BN>

    @@ -508,7 +508,7 @@
    getSeniorInterestRate:

    Returns Promise<BN>

    @@ -524,7 +524,7 @@
    getSeniorReserve: functi
  • Returns Promise<BN>

    @@ -540,7 +540,7 @@
    getSeniorTokenBalance:

    Parameters

    @@ -562,7 +562,7 @@
    getTokenPriceJunior:

    Returns Promise<BN>

    @@ -578,7 +578,7 @@
    getTokenPriceSenior:

    Parameters

    @@ -600,7 +600,7 @@
    getTotalBalance: functio
  • Returns Promise<BN>

    @@ -616,7 +616,7 @@
    getTotalDebt: function

    Returns Promise<BN>

    @@ -632,7 +632,7 @@
    loanCount: function
  • Returns Promise<BN>

    @@ -655,7 +655,7 @@

    AnalyticsActions

  • Type parameters

    diff --git a/docs/modules/_actions_borrower_.html b/docs/modules/_actions_borrower_.html index b1472d4..19eff0a 100644 --- a/docs/modules/_actions_borrower_.html +++ b/docs/modules/_actions_borrower_.html @@ -89,7 +89,7 @@

    IBorrowerActions

    IBorrowerActions: { borrow: any; close: any; issue: any; lock: any; nftLookup: any; repay: any; unlock: any; withdraw: any }
    @@ -104,7 +104,7 @@
    borrow: function
  • Parameters

    @@ -129,7 +129,7 @@
    close: function
  • Parameters

    @@ -151,7 +151,7 @@
    issue: function
  • Parameters

    @@ -176,7 +176,7 @@
    lock: function
  • Parameters

    @@ -198,7 +198,7 @@
    nftLookup: function
  • Parameters

    @@ -223,7 +223,7 @@
    repay: function
  • Parameters

    @@ -248,7 +248,7 @@
    unlock: function
  • Parameters

    @@ -270,7 +270,7 @@
    withdraw: function
  • Parameters

    @@ -305,7 +305,7 @@

    BorrowerActions

  • Type parameters

    diff --git a/docs/modules/_actions_collateral_.html b/docs/modules/_actions_collateral_.html index ccf9991..9449569 100644 --- a/docs/modules/_actions_collateral_.html +++ b/docs/modules/_actions_collateral_.html @@ -89,7 +89,7 @@

    ICollateralActions

    ICollateralActions: { approveNFT: any; getNFTCount: any; getNFTData: any; getNFTOwner: any; isNFTApprovedForAll: any; mintNFT: any; mintTitleNFT: any; setNFTApprovalForAll: any; transferNFT: any }
    @@ -104,7 +104,7 @@
    approveNFT: function
  • Parameters

    @@ -132,7 +132,7 @@
    getNFTCount: function
  • Parameters

    @@ -154,7 +154,7 @@
    getNFTData: function
  • Parameters

    @@ -179,7 +179,7 @@
    getNFTOwner: function
  • Parameters

    @@ -204,7 +204,7 @@
    isNFTApprovedForAll: fun
  • Parameters

    @@ -232,7 +232,7 @@
    mintNFT: function
  • Parameters

    @@ -269,7 +269,7 @@
    mintTitleNFT: function
  • Parameters

    @@ -288,13 +288,13 @@

    Returns Promise
    setNFTApprovalForAll: function
      -
    • setNFTApprovalForAll(nftAddr: string, to: string, approved: boolean): Promise<unknown>
    • +
    • setNFTApprovalForAll(nftAddr: string, to: string, approved: boolean): Promise<PendingTransaction>
    -

    Returns Promise<unknown>

    +

    Returns Promise<PendingTransaction>

  • @@ -322,7 +322,7 @@
    transferNFT: function
  • Parameters

    @@ -360,9 +360,21 @@

    CollateralActions

  • +
    +
    +
      +
    • See if we can remove ICollateralActions,
    • +
    • Make sure all actions have a non-unkonwn/any return type + // * - Remove contractKey + // * - Remove timesOutAt from every action (use this.transactionTimeout) + // * - Create ticket for adding RetryProvider later in tinlake-ui
    • +
    • Create issue in ethers.js for window is undefined error
    • +
    +
    +

    Type parameters

    • diff --git a/docs/modules/_actions_currency_.html b/docs/modules/_actions_currency_.html index d242200..14d1643 100644 --- a/docs/modules/_actions_currency_.html +++ b/docs/modules/_actions_currency_.html @@ -89,7 +89,7 @@

      ICurrencyActions

      ICurrencyActions: { approveJuniorForCurrency: (currencyAmount: string) => Promise<PendingTransaction | undefined>; approveSeniorForCurrency: (currencyAmount: string) => Promise<PendingTransaction | undefined>; getCurrencyAllowance: (owner: string, spender: string) => Promise<BN>; getJuniorForCurrencyAllowance: (owner: string) => Promise<BN | undefined>; getSeniorForCurrencyAllowance: (owner: string) => Promise<BN | undefined>; approveCurrency: any; getCurrencyBalance: any; mintCurrency: any }
      @@ -212,7 +212,7 @@
      approveCurrency: function

      Parameters

      @@ -237,7 +237,7 @@
      getCurrencyBalance: func
    • Parameters

      @@ -259,7 +259,7 @@
      mintCurrency: function
    • Parameters

      @@ -291,7 +291,7 @@

      CurrencyActions

    • Type parameters

      diff --git a/docs/modules/_actions_governance_.html b/docs/modules/_actions_governance_.html index 1241540..a2ecb4c 100644 --- a/docs/modules/_actions_governance_.html +++ b/docs/modules/_actions_governance_.html @@ -83,7 +83,7 @@

      IGovernanceActions

      IGovernanceActions: { relyAddress: any }
      @@ -98,7 +98,7 @@
      relyAddress: function
    • Parameters

      diff --git a/docs/modules/_actions_index_.html b/docs/modules/_actions_index_.html index bdbaad0..2c53459 100644 --- a/docs/modules/_actions_index_.html +++ b/docs/modules/_actions_index_.html @@ -83,7 +83,7 @@

      TinlakeActions

      diff --git a/docs/modules/_actions_lender_.html b/docs/modules/_actions_lender_.html index ffeb1ed..3500c69 100644 --- a/docs/modules/_actions_lender_.html +++ b/docs/modules/_actions_lender_.html @@ -89,7 +89,7 @@

      ILenderActions

      ILenderActions: { approveJuniorToken: (tokenAmount: string) => Promise<unknown>; approveSeniorToken: (tokenAmount: string) => Promise<unknown>; balance: any; getJuniorTokenAllowance: any; getSeniorTokenAllowance: any; redeemJunior: any; redeemSenior: any; supplyJunior: any; supplySenior: any }
      @@ -146,7 +146,7 @@
      balance: function
    • Returns Promise<any>

      @@ -162,7 +162,7 @@
      getJuniorTokenAllowance: <
    • Parameters

      @@ -184,7 +184,7 @@
      getSeniorTokenAllowance: <
    • Parameters

      @@ -206,7 +206,7 @@
      redeemJunior: function
    • Parameters

      @@ -228,7 +228,7 @@
      redeemSenior: function
    • Parameters

      @@ -250,7 +250,7 @@
      supplyJunior: function
    • Parameters

      @@ -272,7 +272,7 @@
      supplySenior: function
    • Parameters

      @@ -301,7 +301,7 @@

      LenderActions

    • Type parameters

      diff --git a/docs/modules/_actions_proxy_.html b/docs/modules/_actions_proxy_.html index 7abba0c..619e8ac 100644 --- a/docs/modules/_actions_proxy_.html +++ b/docs/modules/_actions_proxy_.html @@ -89,7 +89,7 @@

      IProxyActions

      IProxyActions: { buildProxy: any; checkProxyExists: any; getProxy: any; getProxyAccessToken: any; getProxyAccessTokenOwner: any; getProxyOwnerByAddress: any; getProxyOwnerByLoan: any; proxyCount: any; proxyCreateNew: any; proxyIssue: any; proxyLockBorrowWithdraw: any; proxyRepayUnlockClose: any; proxyTransferIssue: any }
      @@ -104,7 +104,7 @@
      buildProxy: function
    • Parameters

      @@ -126,7 +126,7 @@
      checkProxyExists: functi
    • Parameters

      @@ -148,7 +148,7 @@
      getProxy: function
    • Parameters

      @@ -170,7 +170,7 @@
      getProxyAccessToken:

      Parameters

      @@ -192,7 +192,7 @@
      getProxyAccessTokenOwner

      Parameters

      @@ -214,7 +214,7 @@
      getProxyOwnerByAddress:

      Parameters

      @@ -236,7 +236,7 @@
      getProxyOwnerByLoan:

      Parameters

      @@ -258,7 +258,7 @@
      proxyCount: function
    • Returns Promise<any>

      @@ -274,7 +274,7 @@
      proxyCreateNew: function
    • Parameters

      @@ -296,7 +296,7 @@
      proxyIssue: function
    • Parameters

      @@ -324,7 +324,7 @@
      proxyLockBorrowWithdraw: <
    • Parameters

      @@ -355,7 +355,7 @@
      proxyRepayUnlockClose:

      Parameters

      @@ -386,7 +386,7 @@
      proxyTransferIssue: func
    • Parameters

      @@ -421,7 +421,7 @@

      ProxyActions

    • Type parameters

      diff --git a/docs/modules/_services_ethereum_.html b/docs/modules/_services_ethereum_.html index 5e1f768..5a7b24a 100644 --- a/docs/modules/_services_ethereum_.html +++ b/docs/modules/_services_ethereum_.html @@ -99,7 +99,7 @@

      Const ZERO_ADDRESS

      ZERO_ADDRESS: "0x0000000000000000000000000000000000000000" = "0x0000000000000000000000000000000000000000"
      @@ -116,7 +116,7 @@

      executeAndRetry

    • Parameters

      @@ -142,7 +142,7 @@

      Const findEvent

    • Parameters

      @@ -209,7 +209,7 @@

      Const waitAndReturn

      Parameters

      @@ -241,7 +241,7 @@

      Const waitForTransactio
    • Parameters

      diff --git a/docs/modules/_tinlake_.html b/docs/modules/_tinlake_.html index de54a14..bb0e8fe 100644 --- a/docs/modules/_tinlake_.html +++ b/docs/modules/_tinlake_.html @@ -78,7 +78,7 @@

      Type aliases

    • Constructor
    • ContractAbis
    • ContractAddresses
    • -
    • ContractNames
    • +
    • ContractName
    • Contracts
    • EthConfig
    • EthersConfig
    • @@ -98,7 +98,7 @@

      Constructor

      Constructor<T>: {}

      Type parameters

      @@ -119,7 +119,7 @@

      ContractAbis

      ContractAbis: {}
      @@ -134,7 +134,7 @@

      ContractAddresses

      ContractAddresses: {}
      @@ -144,12 +144,12 @@

      Type declaration

      - -

      ContractNames

      -
      ContractNames: typeof contractNames[number]
      + +

      ContractName

      +
      ContractName: typeof contractNames[number]
      @@ -159,7 +159,7 @@

      Contracts

      Contracts: {}
      @@ -174,7 +174,7 @@

      EthConfig

      EthConfig: { from?: undefined | string; gas?: undefined | string; gasPrice?: undefined | string }
      @@ -198,7 +198,7 @@

      EthersConfig

      EthersConfig: { overrides?: EthersOverrides; provider: Provider; signer: Signer }
      @@ -222,7 +222,7 @@

      EthersOverrides

      EthersOverrides: { gasLimit?: undefined | number; gasPrice?: undefined | number }
      @@ -240,20 +240,17 @@
      Optional gasPrice

      PendingTransaction

      -
      PendingTransaction: { contractKey: string; hash: string; timesOutAt?: undefined | number }
      +
      PendingTransaction: { hash: string | undefined; timesOutAt?: undefined | number }

      Type declaration

      • -
        contractKey: string
        -
      • -
      • -
        hash: string
        +
        hash: string | undefined
      • Optional timesOutAt?: undefined | number
        @@ -267,7 +264,7 @@

        TinlakeParams

        TinlakeParams: { contractAbis?: ContractAbis | {}; contractAddresses?: ContractAddresses | {}; contractConfig?: any | {}; contracts?: Contracts | {}; ethConfig?: EthConfig; ethOptions?: any | {}; ethersConfig?: EthersConfig; provider: any; transactionTimeout: number }
        @@ -397,7 +394,7 @@
        transactionTimeout: ContractAddresses
      • - ContractNames + ContractName
      • Contracts diff --git a/docs/modules/_types_tinlake_.html b/docs/modules/_types_tinlake_.html index 41c2342..5f25c7f 100644 --- a/docs/modules/_types_tinlake_.html +++ b/docs/modules/_types_tinlake_.html @@ -87,7 +87,7 @@

        ITinlake

        @@ -97,7 +97,7 @@

        Investor

        Investor: { address: string; junior: { maxRedeem: BN; maxSupply: BN; tokenBalance: BN }; senior: { maxRedeem?: BN; maxSupply?: BN; tokenBalance?: BN } }
        @@ -143,7 +143,7 @@

        Loan

        Loan: { debt: BN; interestRate: BN; loanId: string; nft?: NFT; ownerOf: BN; price?: BN; principal: BN; proxyOwner?: undefined | string; registry: string; status?: undefined | string; threshold?: BN; tokenId: BN }
        @@ -194,7 +194,7 @@

        NFT

        NFT: { nftData: any; nftOwner: string; registry: string; tokenId: BN }
        @@ -221,7 +221,7 @@

        Tranche

        Tranche: { availableFunds: BN; interestRate?: BN; token: string; tokenPrice: BN; totalSupply: BN; type: string }
        diff --git a/docs/modules/_utils_basetodisplay_.html b/docs/modules/_utils_basetodisplay_.html index c602643..75b3b77 100644 --- a/docs/modules/_utils_basetodisplay_.html +++ b/docs/modules/_utils_basetodisplay_.html @@ -87,7 +87,7 @@

        Const baseToDisplay

      • Parameters

        diff --git a/docs/modules/_utils_bntohex_.html b/docs/modules/_utils_bntohex_.html index 5be3f71..6f0bd90 100644 --- a/docs/modules/_utils_bntohex_.html +++ b/docs/modules/_utils_bntohex_.html @@ -87,7 +87,7 @@

        Const bnToHex

      • Parameters

        diff --git a/docs/modules/_utils_displaytobase_.html b/docs/modules/_utils_displaytobase_.html index 7b1bc8c..ad4ac5d 100644 --- a/docs/modules/_utils_displaytobase_.html +++ b/docs/modules/_utils_displaytobase_.html @@ -87,7 +87,7 @@

        Const displayToBase

      • Parameters

        diff --git a/docs/modules/_utils_feetointerestrate_.html b/docs/modules/_utils_feetointerestrate_.html index 68fe516..3361952 100644 --- a/docs/modules/_utils_feetointerestrate_.html +++ b/docs/modules/_utils_feetointerestrate_.html @@ -87,7 +87,7 @@

        Const feeToInterestRate
      • diff --git a/docs/modules/_utils_getloanstatus_.html b/docs/modules/_utils_getloanstatus_.html index 03d8af1..eaad83e 100644 --- a/docs/modules/_utils_getloanstatus_.html +++ b/docs/modules/_utils_getloanstatus_.html @@ -89,7 +89,7 @@

        LoanStatus

        LoanStatus: "Whitelisted" | "Ongoing" | "Repaid"
        @@ -106,7 +106,7 @@

        getLoanStatus

      • Parameters

        diff --git a/docs/modules/_utils_interestratetofee_.html b/docs/modules/_utils_interestratetofee_.html index ab9fb49..86df442 100644 --- a/docs/modules/_utils_interestratetofee_.html +++ b/docs/modules/_utils_interestratetofee_.html @@ -87,7 +87,7 @@

        Const interestRateToFee
      • diff --git a/src/Tinlake.ts b/src/Tinlake.ts index 14d7f59..f2e38a6 100644 --- a/src/Tinlake.ts +++ b/src/Tinlake.ts @@ -31,7 +31,8 @@ const contractNames = [ 'LENDER_DEPLOYER', 'NFT_FEED', 'GOVERNANCE', -]; + 'ALLOWANCE_OPERATOR', +] as const; type AbiOutput = { name: string; @@ -39,8 +40,7 @@ type AbiOutput = { }; export type PendingTransaction = { - hash: string - contractKey: string + hash: string | undefined timesOutAt?: number, }; @@ -61,18 +61,18 @@ export type EthersConfig = { overrides?: EthersOverrides, }; -export type ContractNames = typeof contractNames[number]; +export type ContractName = typeof contractNames[number]; export type Contracts = { - [key in ContractNames]?: any; + [key in ContractName]?: any; }; export type ContractAbis = { - [key in ContractNames]?: any; + [key in ContractName]?: any; }; export type ContractAddresses = { - [key in ContractNames]?: string; + [key in ContractName]?: string; }; export type TinlakeParams = { @@ -107,7 +107,16 @@ export default class Tinlake { public contractConfig: any = {}; constructor(params: TinlakeParams) { - const { provider, contractAddresses, transactionTimeout, contractAbis, ethOptions, ethConfig, ethersConfig, contractConfig } = params; + const { + provider, + contractAddresses, + transactionTimeout, + contractAbis, + ethOptions, + ethConfig, + ethersConfig, + contractConfig, + } = params; if (!contractAbis) { this.contractAbis = abiDefinitions; } @@ -132,29 +141,60 @@ export default class Tinlake { // set root & proxy contracts contractNames.forEach((name) => { if (this.contractAbis[name] && this.contractAddresses[name]) { - this.contracts[name] = this.eth.contract(this.contractAbis[name]).at(this.contractAddresses[name]); - this.ethersContracts[name] = this.createContract(this.contractAddresses[name]!, name); + this.contracts[name] = this.eth + .contract(this.contractAbis[name]) + .at(this.contractAddresses[name]); + this.ethersContracts[name] = this.createContract( + this.contractAddresses[name]!, + name, + ); } }); // modular contracts if (this.contractAddresses['JUNIOR_OPERATOR']) { this.contracts['JUNIOR_OPERATOR'] = this.contractConfig['JUNIOR_OPERATOR'] - ? this.createEthContract(this.contractAddresses['JUNIOR_OPERATOR'], this.contractConfig['JUNIOR_OPERATOR']) - : this.createEthContract(this.contractAddresses['JUNIOR_OPERATOR'], 'ALLOWANCE_OPERATOR'); + ? this.createEthContract( + this.contractAddresses['JUNIOR_OPERATOR'], + this.contractConfig['JUNIOR_OPERATOR'], + ) + : this.createEthContract( + this.contractAddresses['JUNIOR_OPERATOR'], + 'ALLOWANCE_OPERATOR', + ); - this.ethersContracts['JUNIOR_OPERATOR'] = this.contractConfig['JUNIOR_OPERATOR'] - ? this.createContract(this.contractAddresses['JUNIOR_OPERATOR'], this.contractConfig['JUNIOR_OPERATOR']) - : this.createContract(this.contractAddresses['JUNIOR_OPERATOR'], 'ALLOWANCE_OPERATOR'); + this.ethersContracts['JUNIOR_OPERATOR'] = this.contractConfig[ 'JUNIOR_OPERATOR' +] + ? this.createContract( + this.contractAddresses['JUNIOR_OPERATOR'], + this.contractConfig['JUNIOR_OPERATOR'], + ) + : this.createContract( + this.contractAddresses['JUNIOR_OPERATOR'], + 'ALLOWANCE_OPERATOR', + ); } if (this.contractAddresses['SENIOR_OPERATOR']) { this.contracts['SENIOR_OPERATOR'] = this.contractConfig['SENIOR_OPERATOR'] - ? this.createEthContract(this.contractAddresses['SENIOR_OPERATOR'], this.contractConfig['SENIOR_OPERATOR']) - : this.createEthContract(this.contractAddresses['SENIOR_OPERATOR'], 'ALLOWANCE_OPERATOR'); + ? this.createEthContract( + this.contractAddresses['SENIOR_OPERATOR'], + this.contractConfig['SENIOR_OPERATOR'], + ) + : this.createEthContract( + this.contractAddresses['SENIOR_OPERATOR'], + 'ALLOWANCE_OPERATOR', + ); - this.ethersContracts['SENIOR_OPERATOR'] = this.contractConfig['SENIOR_OPERATOR'] - ? this.createContract(this.contractAddresses['SENIOR_OPERATOR'], this.contractConfig['SENIOR_OPERATOR']) - : this.createContract(this.contractAddresses['SENIOR_OPERATOR'], 'ALLOWANCE_OPERATOR'); + this.ethersContracts['SENIOR_OPERATOR'] = this.contractConfig[ 'SENIOR_OPERATOR' +] + ? this.createContract( + this.contractAddresses['SENIOR_OPERATOR'], + this.contractConfig['SENIOR_OPERATOR'], + ) + : this.createContract( + this.contractAddresses['SENIOR_OPERATOR'], + 'ALLOWANCE_OPERATOR', + ); } } @@ -172,12 +212,12 @@ export default class Tinlake { }; } - createEthContract(address: string, abiName: string) { + createEthContract(address: string, abiName: ContractName) { const contract = this.eth.contract(this.contractAbis[abiName]).at(address); return contract; } - createContract(address: string, abiName: string) { + createContract(address: string, abiName: ContractName) { return new ethers.Contract( address, this.contractAbis[abiName], @@ -185,7 +225,7 @@ export default class Tinlake { ); } - getContract(address: string, abiName: string): ethers.Contract { + getContract(address: string, abiName: ContractName): ethers.Contract { return new ethers.Contract( address, this.contractAbis[abiName], @@ -193,8 +233,43 @@ export default class Tinlake { ); } - async getTransactionReceipt(tx: PendingTransaction): Promise { - return await this.ethersConfig.provider!.waitForTransaction(tx.hash); + contract(abiName: ContractName, address?: string): ethers.Contract { + if (address) { + return new ethers.Contract( + address, + this.contractAbis[abiName], + this.ethersConfig.signer, + ); + } + return this.ethersContracts[abiName]; + + } + + async pending(txPromise: Promise): Promise { + const tx = await txPromise; + return { + hash: tx.hash, + timesOutAt: Date.now() + this.transactionTimeout * 1000, + }; + } + + async getTransactionReceipt( + tx: PendingTransaction, + ): Promise { + return new Promise(async (resolve, reject) => { + if (!tx.hash) return reject(); + + let timer: NodeJS.Timer | undefined = undefined; + if (tx.timesOutAt) { + timer = setTimeout(() => { + return reject(); + }, tx.timesOutAt - Date.now()); + } + + const receipt = await this.ethersConfig.provider!.waitForTransaction(tx.hash); + if (timer) clearTimeout(timer); + return resolve(receipt); + }); } getOperatorType = (tranche: string) => { @@ -207,5 +282,4 @@ export default class Tinlake { return 'ALLOWANCE_OPERATOR'; } } - } diff --git a/src/actions/admin.ts b/src/actions/admin.ts index b88b09e..fab3460 100644 --- a/src/actions/admin.ts +++ b/src/actions/admin.ts @@ -1,4 +1,4 @@ -import { ContractNames, Constructor, TinlakeParams, PendingTransaction } from '../Tinlake'; +import { ContractName, Constructor, TinlakeParams, PendingTransaction } from '../Tinlake'; import { waitAndReturnEvents, executeAndRetry, ZERO_ADDRESS } from '../services/ethereum'; import BN from 'bn.js'; const web3 = require('web3-utils'); @@ -16,7 +16,7 @@ export function AdminActions>(Bas !!this.contracts['COLLECTOR']?.wards; } - isWard = async (user: string, contractName: ContractNames) => { + isWard = async (user: string, contractName: ContractName) => { if (!this.contracts[contractName]?.wards) { return new BN(0); } const res : { 0: BN } = await executeAndRetry(this.contracts[contractName].wards, [user]); return res[0]; @@ -141,7 +141,7 @@ function getRateGroup(ratePerSecond: string) { } export type IAdminActions = { - isWard(user: string, contractName: ContractNames): Promise, + isWard(user: string, contractName: ContractName): Promise, canSetInterestRate(user: string): Promise, canSetSeniorTrancheInterest(user: string): Promise, canSetMinimumJuniorRatio(user: string): Promise, diff --git a/src/actions/collateral.ts b/src/actions/collateral.ts index 7f9694e..8c0c8d9 100644 --- a/src/actions/collateral.ts +++ b/src/actions/collateral.ts @@ -2,6 +2,15 @@ import { Constructor, TinlakeParams, PendingTransaction } from '../Tinlake'; import { waitAndReturnEvents, executeAndRetry } from '../services/ethereum'; import BN from 'bn.js'; +/** + * - See if we can remove ICollateralActions, + * - Make sure all actions have a non-unkonwn/any return type +// * - Remove contractKey +// * - Remove timesOutAt from every action (use this.transactionTimeout) +// * - Create ticket for adding RetryProvider later in tinlake-ui + * - Create issue in ethers.js for window is undefined error + */ + export function CollateralActions>(Base: ActionsBase) { return class extends Base implements ICollateralActions { @@ -13,14 +22,9 @@ export function CollateralActions return res.events[0].data[2].toString(); } - mintNFT = async (nftAddr: string, owner: string, tokenId: string, ref: string, amount: string, asset: string) => { - const nftContract = this.getContract(nftAddr, 'COLLATERAL_NFT'); - const tx = await nftContract.mint(owner, tokenId, ref, amount, asset); - - return { - hash: tx.hash, - contractKey: 'COLLATERAL_NFT', - }; + mintNFT = async (nftAddress: string, owner: string, tokenId: string, ref: string, amount: string, asset: string) => { + const nft = this.contract('COLLATERAL_NFT', nftAddress); + return this.pending(nft.mint(owner, tokenId, ref, amount, asset)); } approveNFT = async (nftAddr: string, tokenId: string, to: string) => { @@ -34,10 +38,7 @@ export function CollateralActions const nftContract = this.getContract(nftAddr, 'COLLATERAL_NFT'); const tx = await nftContract.setApprovalForAll(to, approved); - return { - hash: tx.hash, - contractKey: 'COLLATERAL_NFT', - }; + return this.pending(tx); } isNFTApprovedForAll = async (nftAddr: string, owner: string, operator: string) => { @@ -78,7 +79,7 @@ export type ICollateralActions = { mintTitleNFT(nftAddr:string, usr: string): Promise, mintNFT(nftAddr: string, owner: string, tokenId: string, ref: string, amount: string, asset: string): Promise, approveNFT(nftAddr:string, tokenId: string, to: string) : Promise, - setNFTApprovalForAll(nftAddr: string, to: string, approved: boolean): Promise, + setNFTApprovalForAll(nftAddr: string, to: string, approved: boolean): Promise, isNFTApprovedForAll(nftAddr: string, owner: string, operator: string): Promise, getNFTCount(nftAddr:string): Promise, getNFTData(nftAddr:string, tokenId: string): Promise, From dabab21b91ac3e30324d0fb958c83440963a99ad Mon Sep 17 00:00:00 2001 From: Jeroen Offerijns Date: Wed, 26 Aug 2020 13:22:30 +0200 Subject: [PATCH 07/65] chore: format --- docs/classes/_tinlake_.tinlake.html | 46 +++++++------- docs/interfaces/_services_ethereum_.ethi.html | 16 ++--- .../_services_ethereum_.events.html | 6 +- docs/modules/_actions_admin_.html | 30 +++++----- docs/modules/_actions_analytics_.html | 60 +++++++++---------- docs/modules/_actions_borrower_.html | 20 +++---- docs/modules/_actions_collateral_.html | 22 +++---- docs/modules/_actions_currency_.html | 10 ++-- docs/modules/_actions_governance_.html | 4 +- docs/modules/_actions_index_.html | 2 +- docs/modules/_actions_lender_.html | 18 +++--- docs/modules/_actions_proxy_.html | 30 +++++----- docs/modules/_services_ethereum_.html | 10 ++-- docs/modules/_tinlake_.html | 20 +++---- docs/modules/_types_tinlake_.html | 10 ++-- docs/modules/_utils_basetodisplay_.html | 2 +- docs/modules/_utils_bntohex_.html | 2 +- docs/modules/_utils_displaytobase_.html | 2 +- docs/modules/_utils_feetointerestrate_.html | 2 +- docs/modules/_utils_getloanstatus_.html | 4 +- docs/modules/_utils_interestratetofee_.html | 2 +- src/Tinlake.ts | 6 +- 22 files changed, 162 insertions(+), 162 deletions(-) diff --git a/docs/classes/_tinlake_.tinlake.html b/docs/classes/_tinlake_.tinlake.html index 569ddd4..f17909d 100644 --- a/docs/classes/_tinlake_.tinlake.html +++ b/docs/classes/_tinlake_.tinlake.html @@ -130,7 +130,7 @@

        constructor

      • Parameters

        @@ -152,7 +152,7 @@

        contractAbis

        contractAbis: ContractAbis
        @@ -162,7 +162,7 @@

        contractAddresses

        contractAddresses: ContractAddresses
        @@ -172,7 +172,7 @@

        contractConfig

        contractConfig: any
        @@ -182,7 +182,7 @@

        contracts

        contracts: Contracts
        @@ -192,7 +192,7 @@

        eth

        eth: ethI
        @@ -202,7 +202,7 @@

        ethConfig

        ethConfig: EthConfig
        @@ -212,7 +212,7 @@

        ethOptions

        ethOptions: any
        @@ -222,7 +222,7 @@

        ethersConfig

        ethersConfig: EthersConfig
        @@ -232,7 +232,7 @@

        ethersContracts

        ethersContracts: Contracts
        @@ -242,7 +242,7 @@

        provider

        provider: any
        @@ -252,7 +252,7 @@

        transactionTimeout

        transactionTimeout: number
        @@ -269,7 +269,7 @@

        contract

      • Parameters

        @@ -295,7 +295,7 @@

        createContract

      • Parameters

        @@ -321,7 +321,7 @@

        createEthContract

      • Parameters

        @@ -347,7 +347,7 @@

        getContract

      • Parameters

        @@ -373,7 +373,7 @@

        getOperatorType

      • Parameters

        @@ -396,7 +396,7 @@

        getTransactionReceipt

      • Parameters

        @@ -419,7 +419,7 @@

        pending

      • Parameters

        @@ -442,7 +442,7 @@

        setContracts

      • Returns void

        @@ -459,7 +459,7 @@

        setEthConfig

      • Parameters

        @@ -482,7 +482,7 @@

        setEthersConfig

      • Parameters

        @@ -505,7 +505,7 @@

        setProvider

      • Parameters

        diff --git a/docs/interfaces/_services_ethereum_.ethi.html b/docs/interfaces/_services_ethereum_.ethi.html index 98bc09e..14fbdcc 100644 --- a/docs/interfaces/_services_ethereum_.ethi.html +++ b/docs/interfaces/_services_ethereum_.ethi.html @@ -101,7 +101,7 @@

        abi

        abi: any
        @@ -111,7 +111,7 @@

        contract

        contract: (arg0: any) => { at: (arg0: any) => void }
        @@ -165,7 +165,7 @@

        getTransactionByHash

        getTransactionByHash: (arg0: any, arg1: (err: any, tx: any) => void) => void
        @@ -220,7 +220,7 @@

        getTransactionCount

        getTransactionCount: any
        @@ -230,7 +230,7 @@

        getTransactionReceipt

        getTransactionReceipt: (arg0: any, arg1: (err: any, receipt: any) => void) => void
        @@ -285,7 +285,7 @@

        send

        send: Function
        @@ -295,7 +295,7 @@

        sendRawTransaction

        sendRawTransaction: any
        @@ -305,7 +305,7 @@

        web3_sha3

        web3_sha3: (signature: string) => string
        diff --git a/docs/interfaces/_services_ethereum_.events.html b/docs/interfaces/_services_ethereum_.events.html index 4d73895..0ccf862 100644 --- a/docs/interfaces/_services_ethereum_.events.html +++ b/docs/interfaces/_services_ethereum_.events.html @@ -96,7 +96,7 @@

        events

        events: { data: any[]; event: { name: any } }[]
        @@ -106,7 +106,7 @@

        status

        status: any
        @@ -116,7 +116,7 @@

        txHash

        txHash: string
        diff --git a/docs/modules/_actions_admin_.html b/docs/modules/_actions_admin_.html index 4f62d30..154361d 100644 --- a/docs/modules/_actions_admin_.html +++ b/docs/modules/_actions_admin_.html @@ -89,7 +89,7 @@

        IAdminActions

        IAdminActions: { approveAllowanceJunior: any; approveAllowanceSenior: any; canSetInterestRate: any; canSetInvestorAllowanceJunior: any; canSetInvestorAllowanceSenior: any; canSetLoanPrice: any; canSetMinimumJuniorRatio: any; canSetRiskScore: any; canSetSeniorTrancheInterest: any; initRate: any; isWard: any; setMinimumJuniorRatio: any; setRate: any }
        @@ -104,7 +104,7 @@
        approveAllowanceJunior:
      • Parameters

        @@ -132,7 +132,7 @@
        approveAllowanceSenior:
      • Parameters

        @@ -160,7 +160,7 @@
        canSetInterestRate:

        Parameters

        @@ -182,7 +182,7 @@
        canSetInvestorAllowanceJunior

        Parameters

        @@ -204,7 +204,7 @@
        canSetInvestorAllowanceSenior

        Parameters

        @@ -226,7 +226,7 @@
        canSetLoanPrice: fu
      • Parameters

        @@ -248,7 +248,7 @@
        canSetMinimumJuniorRatio

        Parameters

        @@ -270,7 +270,7 @@
        canSetRiskScore: fu
      • Parameters

        @@ -292,7 +292,7 @@
        canSetSeniorTrancheInterest

        Parameters

        @@ -314,7 +314,7 @@
        initRate: function
      • Parameters

        @@ -336,7 +336,7 @@
        isWard: function
      • Parameters

        @@ -361,7 +361,7 @@
        setMinimumJuniorRatio:

        Parameters

        @@ -383,7 +383,7 @@
        setRate: function
      • Parameters

        @@ -415,7 +415,7 @@

        AdminActions

      • Type parameters

        diff --git a/docs/modules/_actions_analytics_.html b/docs/modules/_actions_analytics_.html index 72ef4ae..6f63322 100644 --- a/docs/modules/_actions_analytics_.html +++ b/docs/modules/_actions_analytics_.html @@ -89,7 +89,7 @@

        IAnalyticsActions

        IAnalyticsActions: { existsSenior: any; getAssetValueJunior: any; getCollateral: any; getCurrentJuniorRatio: any; getDebt: any; getInterestRate: any; getInvestor: any; getJuniorReserve: any; getJuniorTokenBalance: any; getLoan: any; getLoanList: any; getMaxRedeemAmountJunior: any; getMaxRedeemAmountSenior: any; getMaxSupplyAmountJunior: any; getMaxSupplyAmountSenior: any; getMinJuniorRatio: any; getOwnerOfCollateral: any; getOwnerOfLoan: any; getPrincipal: any; getSeniorDebt: any; getSeniorInterestRate: any; getSeniorReserve: any; getSeniorTokenBalance: any; getTokenPriceJunior: any; getTokenPriceSenior: any; getTotalBalance: any; getTotalDebt: any; loanCount: any }
        @@ -104,7 +104,7 @@
        existsSenior: function
      • Returns boolean

        @@ -120,7 +120,7 @@
        getAssetValueJunior:

        Returns Promise<BN>

        @@ -136,7 +136,7 @@
        getCollateral: function
      • Parameters

        @@ -158,7 +158,7 @@
        getCurrentJuniorRatio:

        Returns Promise<BN>

        @@ -174,7 +174,7 @@
        getDebt: function
      • Parameters

        @@ -196,7 +196,7 @@
        getInterestRate: functio
      • Parameters

        @@ -218,7 +218,7 @@
        getInvestor: function
      • Parameters

        @@ -240,7 +240,7 @@
        getJuniorReserve: functi
      • Returns Promise<BN>

        @@ -256,7 +256,7 @@
        getJuniorTokenBalance:

        Parameters

        @@ -278,7 +278,7 @@
        getLoan: function
      • Parameters

        @@ -300,7 +300,7 @@
        getLoanList: function

        Returns Promise<Loan[]>

        @@ -316,7 +316,7 @@
        getMaxRedeemAmountJunior

        Parameters

        @@ -338,7 +338,7 @@
        getMaxRedeemAmountSenior

        Parameters

        @@ -360,7 +360,7 @@
        getMaxSupplyAmountJunior

        Parameters

        @@ -382,7 +382,7 @@
        getMaxSupplyAmountSenior

        Parameters

        @@ -404,7 +404,7 @@
        getMinJuniorRatio:
      • Returns Promise<BN>

        @@ -420,7 +420,7 @@
        getOwnerOfCollateral: fu
      • Parameters

        @@ -448,7 +448,7 @@
        getOwnerOfLoan: function
      • Parameters

        @@ -470,7 +470,7 @@
        getPrincipal: function
      • Parameters

        @@ -492,7 +492,7 @@
        getSeniorDebt: function<
      • Returns Promise<BN>

        @@ -508,7 +508,7 @@
        getSeniorInterestRate:

        Returns Promise<BN>

        @@ -524,7 +524,7 @@
        getSeniorReserve: functi
      • Returns Promise<BN>

        @@ -540,7 +540,7 @@
        getSeniorTokenBalance:

        Parameters

        @@ -562,7 +562,7 @@
        getTokenPriceJunior:

        Returns Promise<BN>

        @@ -578,7 +578,7 @@
        getTokenPriceSenior:

        Parameters

        @@ -600,7 +600,7 @@
        getTotalBalance: functio
      • Returns Promise<BN>

        @@ -616,7 +616,7 @@
        getTotalDebt: function

        Returns Promise<BN>

        @@ -632,7 +632,7 @@
        loanCount: function
      • Returns Promise<BN>

        @@ -655,7 +655,7 @@

        AnalyticsActions

      • Type parameters

        diff --git a/docs/modules/_actions_borrower_.html b/docs/modules/_actions_borrower_.html index 19eff0a..5c1f774 100644 --- a/docs/modules/_actions_borrower_.html +++ b/docs/modules/_actions_borrower_.html @@ -89,7 +89,7 @@

        IBorrowerActions

        IBorrowerActions: { borrow: any; close: any; issue: any; lock: any; nftLookup: any; repay: any; unlock: any; withdraw: any }
        @@ -104,7 +104,7 @@
        borrow: function
      • Parameters

        @@ -129,7 +129,7 @@
        close: function
      • Parameters

        @@ -151,7 +151,7 @@
        issue: function
      • Parameters

        @@ -176,7 +176,7 @@
        lock: function
      • Parameters

        @@ -198,7 +198,7 @@
        nftLookup: function
      • Parameters

        @@ -223,7 +223,7 @@
        repay: function
      • Parameters

        @@ -248,7 +248,7 @@
        unlock: function
      • Parameters

        @@ -270,7 +270,7 @@
        withdraw: function
      • Parameters

        @@ -305,7 +305,7 @@

        BorrowerActions

      • Type parameters

        diff --git a/docs/modules/_actions_collateral_.html b/docs/modules/_actions_collateral_.html index 9449569..9d2a432 100644 --- a/docs/modules/_actions_collateral_.html +++ b/docs/modules/_actions_collateral_.html @@ -89,7 +89,7 @@

        ICollateralActions

        ICollateralActions: { approveNFT: any; getNFTCount: any; getNFTData: any; getNFTOwner: any; isNFTApprovedForAll: any; mintNFT: any; mintTitleNFT: any; setNFTApprovalForAll: any; transferNFT: any }
        @@ -104,7 +104,7 @@
        approveNFT: function
      • Parameters

        @@ -132,7 +132,7 @@
        getNFTCount: function
      • Parameters

        @@ -154,7 +154,7 @@
        getNFTData: function
      • Parameters

        @@ -179,7 +179,7 @@
        getNFTOwner: function
      • Parameters

        @@ -204,7 +204,7 @@
        isNFTApprovedForAll: fun
      • Parameters

        @@ -232,7 +232,7 @@
        mintNFT: function
      • Parameters

        @@ -269,7 +269,7 @@
        mintTitleNFT: function
      • Parameters

        @@ -294,7 +294,7 @@
        setNFTApprovalForAll: fu
      • Parameters

        @@ -322,7 +322,7 @@
        transferNFT: function
      • Parameters

        @@ -360,7 +360,7 @@

        CollateralActions

      • diff --git a/docs/modules/_actions_currency_.html b/docs/modules/_actions_currency_.html index 14d1643..007b9d6 100644 --- a/docs/modules/_actions_currency_.html +++ b/docs/modules/_actions_currency_.html @@ -89,7 +89,7 @@

        ICurrencyActions

        ICurrencyActions: { approveJuniorForCurrency: (currencyAmount: string) => Promise<PendingTransaction | undefined>; approveSeniorForCurrency: (currencyAmount: string) => Promise<PendingTransaction | undefined>; getCurrencyAllowance: (owner: string, spender: string) => Promise<BN>; getJuniorForCurrencyAllowance: (owner: string) => Promise<BN | undefined>; getSeniorForCurrencyAllowance: (owner: string) => Promise<BN | undefined>; approveCurrency: any; getCurrencyBalance: any; mintCurrency: any }
        @@ -212,7 +212,7 @@
        approveCurrency: function

        Parameters

        @@ -237,7 +237,7 @@
        getCurrencyBalance: func
      • Parameters

        @@ -259,7 +259,7 @@
        mintCurrency: function
      • Parameters

        @@ -291,7 +291,7 @@

        CurrencyActions

      • Type parameters

        diff --git a/docs/modules/_actions_governance_.html b/docs/modules/_actions_governance_.html index a2ecb4c..e8a90d8 100644 --- a/docs/modules/_actions_governance_.html +++ b/docs/modules/_actions_governance_.html @@ -83,7 +83,7 @@

        IGovernanceActions

        IGovernanceActions: { relyAddress: any }
        @@ -98,7 +98,7 @@
        relyAddress: function
      • Parameters

        diff --git a/docs/modules/_actions_index_.html b/docs/modules/_actions_index_.html index 2c53459..687405c 100644 --- a/docs/modules/_actions_index_.html +++ b/docs/modules/_actions_index_.html @@ -83,7 +83,7 @@

        TinlakeActions

        diff --git a/docs/modules/_actions_lender_.html b/docs/modules/_actions_lender_.html index 3500c69..cece4bf 100644 --- a/docs/modules/_actions_lender_.html +++ b/docs/modules/_actions_lender_.html @@ -89,7 +89,7 @@

        ILenderActions

        ILenderActions: { approveJuniorToken: (tokenAmount: string) => Promise<unknown>; approveSeniorToken: (tokenAmount: string) => Promise<unknown>; balance: any; getJuniorTokenAllowance: any; getSeniorTokenAllowance: any; redeemJunior: any; redeemSenior: any; supplyJunior: any; supplySenior: any }
        @@ -146,7 +146,7 @@
        balance: function
      • Returns Promise<any>

        @@ -162,7 +162,7 @@
        getJuniorTokenAllowance: <
      • Parameters

        @@ -184,7 +184,7 @@
        getSeniorTokenAllowance: <
      • Parameters

        @@ -206,7 +206,7 @@
        redeemJunior: function
      • Parameters

        @@ -228,7 +228,7 @@
        redeemSenior: function
      • Parameters

        @@ -250,7 +250,7 @@
        supplyJunior: function
      • Parameters

        @@ -272,7 +272,7 @@
        supplySenior: function
      • Parameters

        @@ -301,7 +301,7 @@

        LenderActions

      • Type parameters

        diff --git a/docs/modules/_actions_proxy_.html b/docs/modules/_actions_proxy_.html index 619e8ac..97ab964 100644 --- a/docs/modules/_actions_proxy_.html +++ b/docs/modules/_actions_proxy_.html @@ -89,7 +89,7 @@

        IProxyActions

        IProxyActions: { buildProxy: any; checkProxyExists: any; getProxy: any; getProxyAccessToken: any; getProxyAccessTokenOwner: any; getProxyOwnerByAddress: any; getProxyOwnerByLoan: any; proxyCount: any; proxyCreateNew: any; proxyIssue: any; proxyLockBorrowWithdraw: any; proxyRepayUnlockClose: any; proxyTransferIssue: any }
        @@ -104,7 +104,7 @@
        buildProxy: function
      • Parameters

        @@ -126,7 +126,7 @@
        checkProxyExists: functi
      • Parameters

        @@ -148,7 +148,7 @@
        getProxy: function
      • Parameters

        @@ -170,7 +170,7 @@
        getProxyAccessToken:

        Parameters

        @@ -192,7 +192,7 @@
        getProxyAccessTokenOwner

        Parameters

        @@ -214,7 +214,7 @@
        getProxyOwnerByAddress:

        Parameters

        @@ -236,7 +236,7 @@
        getProxyOwnerByLoan:

        Parameters

        @@ -258,7 +258,7 @@
        proxyCount: function
      • Returns Promise<any>

        @@ -274,7 +274,7 @@
        proxyCreateNew: function
      • Parameters

        @@ -296,7 +296,7 @@
        proxyIssue: function
      • Parameters

        @@ -324,7 +324,7 @@
        proxyLockBorrowWithdraw: <
      • Parameters

        @@ -355,7 +355,7 @@
        proxyRepayUnlockClose:

        Parameters

        @@ -386,7 +386,7 @@
        proxyTransferIssue: func
      • Parameters

        @@ -421,7 +421,7 @@

        ProxyActions

      • Type parameters

        diff --git a/docs/modules/_services_ethereum_.html b/docs/modules/_services_ethereum_.html index 5a7b24a..fafab26 100644 --- a/docs/modules/_services_ethereum_.html +++ b/docs/modules/_services_ethereum_.html @@ -99,7 +99,7 @@

        Const ZERO_ADDRESS

        ZERO_ADDRESS: "0x0000000000000000000000000000000000000000" = "0x0000000000000000000000000000000000000000"
        @@ -116,7 +116,7 @@

        executeAndRetry

      • Parameters

        @@ -142,7 +142,7 @@

        Const findEvent

      • Parameters

        @@ -209,7 +209,7 @@

        Const waitAndReturn

        Parameters

        @@ -241,7 +241,7 @@

        Const waitForTransactio
      • Parameters

        diff --git a/docs/modules/_tinlake_.html b/docs/modules/_tinlake_.html index bb0e8fe..b19bc98 100644 --- a/docs/modules/_tinlake_.html +++ b/docs/modules/_tinlake_.html @@ -98,7 +98,7 @@

        Constructor

        Constructor<T>: {}

        Type parameters

        @@ -119,7 +119,7 @@

        ContractAbis

        ContractAbis: {}
        @@ -134,7 +134,7 @@

        ContractAddresses

        ContractAddresses: {}
        @@ -149,7 +149,7 @@

        ContractName

        ContractName: typeof contractNames[number]
        @@ -159,7 +159,7 @@

        Contracts

        Contracts: {}
        @@ -174,7 +174,7 @@

        EthConfig

        EthConfig: { from?: undefined | string; gas?: undefined | string; gasPrice?: undefined | string }
        @@ -198,7 +198,7 @@

        EthersConfig

        EthersConfig: { overrides?: EthersOverrides; provider: Provider; signer: Signer }
        @@ -222,7 +222,7 @@

        EthersOverrides

        EthersOverrides: { gasLimit?: undefined | number; gasPrice?: undefined | number }
        @@ -243,7 +243,7 @@

        PendingTransaction

        PendingTransaction: { hash: string | undefined; timesOutAt?: undefined | number }
        @@ -264,7 +264,7 @@

        TinlakeParams

        TinlakeParams: { contractAbis?: ContractAbis | {}; contractAddresses?: ContractAddresses | {}; contractConfig?: any | {}; contracts?: Contracts | {}; ethConfig?: EthConfig; ethOptions?: any | {}; ethersConfig?: EthersConfig; provider: any; transactionTimeout: number }
        diff --git a/docs/modules/_types_tinlake_.html b/docs/modules/_types_tinlake_.html index 5f25c7f..1ff619e 100644 --- a/docs/modules/_types_tinlake_.html +++ b/docs/modules/_types_tinlake_.html @@ -87,7 +87,7 @@

        ITinlake

        @@ -97,7 +97,7 @@

        Investor

        Investor: { address: string; junior: { maxRedeem: BN; maxSupply: BN; tokenBalance: BN }; senior: { maxRedeem?: BN; maxSupply?: BN; tokenBalance?: BN } }
        @@ -143,7 +143,7 @@

        Loan

        Loan: { debt: BN; interestRate: BN; loanId: string; nft?: NFT; ownerOf: BN; price?: BN; principal: BN; proxyOwner?: undefined | string; registry: string; status?: undefined | string; threshold?: BN; tokenId: BN }
        @@ -194,7 +194,7 @@

        NFT

        NFT: { nftData: any; nftOwner: string; registry: string; tokenId: BN }
        @@ -221,7 +221,7 @@

        Tranche

        Tranche: { availableFunds: BN; interestRate?: BN; token: string; tokenPrice: BN; totalSupply: BN; type: string }
        diff --git a/docs/modules/_utils_basetodisplay_.html b/docs/modules/_utils_basetodisplay_.html index 75b3b77..3adbb29 100644 --- a/docs/modules/_utils_basetodisplay_.html +++ b/docs/modules/_utils_basetodisplay_.html @@ -87,7 +87,7 @@

        Const baseToDisplay

      • Parameters

        diff --git a/docs/modules/_utils_bntohex_.html b/docs/modules/_utils_bntohex_.html index 6f0bd90..a31a17b 100644 --- a/docs/modules/_utils_bntohex_.html +++ b/docs/modules/_utils_bntohex_.html @@ -87,7 +87,7 @@

        Const bnToHex

      • Parameters

        diff --git a/docs/modules/_utils_displaytobase_.html b/docs/modules/_utils_displaytobase_.html index ad4ac5d..1c17b2e 100644 --- a/docs/modules/_utils_displaytobase_.html +++ b/docs/modules/_utils_displaytobase_.html @@ -87,7 +87,7 @@

        Const displayToBase

      • Parameters

        diff --git a/docs/modules/_utils_feetointerestrate_.html b/docs/modules/_utils_feetointerestrate_.html index 3361952..c24bf9c 100644 --- a/docs/modules/_utils_feetointerestrate_.html +++ b/docs/modules/_utils_feetointerestrate_.html @@ -87,7 +87,7 @@

        Const feeToInterestRate
      • diff --git a/docs/modules/_utils_getloanstatus_.html b/docs/modules/_utils_getloanstatus_.html index eaad83e..ae51c35 100644 --- a/docs/modules/_utils_getloanstatus_.html +++ b/docs/modules/_utils_getloanstatus_.html @@ -89,7 +89,7 @@

        LoanStatus

        LoanStatus: "Whitelisted" | "Ongoing" | "Repaid"
        @@ -106,7 +106,7 @@

        getLoanStatus

      • Parameters

        diff --git a/docs/modules/_utils_interestratetofee_.html b/docs/modules/_utils_interestratetofee_.html index 86df442..daadfea 100644 --- a/docs/modules/_utils_interestratetofee_.html +++ b/docs/modules/_utils_interestratetofee_.html @@ -87,7 +87,7 @@

        Const interestRateToFee
      • diff --git a/src/Tinlake.ts b/src/Tinlake.ts index f2e38a6..abfaeeb 100644 --- a/src/Tinlake.ts +++ b/src/Tinlake.ts @@ -163,7 +163,7 @@ export default class Tinlake { 'ALLOWANCE_OPERATOR', ); - this.ethersContracts['JUNIOR_OPERATOR'] = this.contractConfig[ 'JUNIOR_OPERATOR' + this.ethersContracts['JUNIOR_OPERATOR'] = this.contractConfig['JUNIOR_OPERATOR' ] ? this.createContract( this.contractAddresses['JUNIOR_OPERATOR'], @@ -185,7 +185,7 @@ export default class Tinlake { 'ALLOWANCE_OPERATOR', ); - this.ethersContracts['SENIOR_OPERATOR'] = this.contractConfig[ 'SENIOR_OPERATOR' + this.ethersContracts['SENIOR_OPERATOR'] = this.contractConfig['SENIOR_OPERATOR' ] ? this.createContract( this.contractAddresses['SENIOR_OPERATOR'], @@ -241,7 +241,7 @@ export default class Tinlake { this.ethersConfig.signer, ); } - return this.ethersContracts[abiName]; + return this.ethersContracts[abiName]; } From 2a8155ee4b0ba074ba9d7cfa299e2bb7d4a7859f Mon Sep 17 00:00:00 2001 From: Jeroen Offerijns Date: Wed, 26 Aug 2020 13:52:27 +0200 Subject: [PATCH 08/65] fix: work on fixing tests --- dist/index.es.js | 19 +++--- dist/index.js | 19 +++--- docs/classes/_tinlake_.tinlake.html | 46 +++++++------- docs/interfaces/_services_ethereum_.ethi.html | 16 ++--- .../_services_ethereum_.events.html | 6 +- docs/modules/_actions_admin_.html | 30 +++++----- docs/modules/_actions_analytics_.html | 60 +++++++++---------- docs/modules/_actions_borrower_.html | 20 +++---- docs/modules/_actions_collateral_.html | 22 +++---- docs/modules/_actions_currency_.html | 10 ++-- docs/modules/_actions_governance_.html | 4 +- docs/modules/_actions_index_.html | 2 +- docs/modules/_actions_lender_.html | 18 +++--- docs/modules/_actions_proxy_.html | 30 +++++----- docs/modules/_services_ethereum_.html | 10 ++-- docs/modules/_tinlake_.html | 20 +++---- docs/modules/_types_tinlake_.html | 10 ++-- docs/modules/_utils_basetodisplay_.html | 2 +- docs/modules/_utils_bntohex_.html | 2 +- docs/modules/_utils_displaytobase_.html | 2 +- docs/modules/_utils_feetointerestrate_.html | 2 +- docs/modules/_utils_getloanstatus_.html | 4 +- docs/modules/_utils_interestratetofee_.html | 2 +- package.json | 2 +- src/Tinlake.ts | 20 ++++--- src/test/utils.ts | 8 +++ 26 files changed, 205 insertions(+), 181 deletions(-) diff --git a/dist/index.es.js b/dist/index.es.js index 1775532..153fd0b 100644 --- a/dist/index.es.js +++ b/dist/index.es.js @@ -47491,7 +47491,8 @@ var Tinlake = /** @class */ (function () { contractNames.forEach(function (name) { if (_this.contractAbis[name] && _this.contractAddresses[name]) { _this.contracts[name] = _this.eth.contract(_this.contractAbis[name]).at(_this.contractAddresses[name]); - _this.ethersContracts[name] = _this.createContract(_this.contractAddresses[name], name); + if (_this.ethersConfig) + _this.ethersContracts[name] = _this.createContract(_this.contractAddresses[name], name); } }); // modular contracts @@ -47499,17 +47500,21 @@ var Tinlake = /** @class */ (function () { _this.contracts['JUNIOR_OPERATOR'] = _this.contractConfig['JUNIOR_OPERATOR'] ? _this.createEthContract(_this.contractAddresses['JUNIOR_OPERATOR'], _this.contractConfig['JUNIOR_OPERATOR']) : _this.createEthContract(_this.contractAddresses['JUNIOR_OPERATOR'], 'ALLOWANCE_OPERATOR'); - _this.ethersContracts['JUNIOR_OPERATOR'] = _this.contractConfig['JUNIOR_OPERATOR'] - ? _this.createContract(_this.contractAddresses['JUNIOR_OPERATOR'], _this.contractConfig['JUNIOR_OPERATOR']) - : _this.createContract(_this.contractAddresses['JUNIOR_OPERATOR'], 'ALLOWANCE_OPERATOR'); + if (_this.ethersConfig) { + _this.ethersContracts['JUNIOR_OPERATOR'] = _this.contractConfig['JUNIOR_OPERATOR'] + ? _this.createContract(_this.contractAddresses['JUNIOR_OPERATOR'], _this.contractConfig['JUNIOR_OPERATOR']) + : _this.createContract(_this.contractAddresses['JUNIOR_OPERATOR'], 'ALLOWANCE_OPERATOR'); + } } if (_this.contractAddresses['SENIOR_OPERATOR']) { _this.contracts['SENIOR_OPERATOR'] = _this.contractConfig['SENIOR_OPERATOR'] ? _this.createEthContract(_this.contractAddresses['SENIOR_OPERATOR'], _this.contractConfig['SENIOR_OPERATOR']) : _this.createEthContract(_this.contractAddresses['SENIOR_OPERATOR'], 'ALLOWANCE_OPERATOR'); - _this.ethersContracts['SENIOR_OPERATOR'] = _this.contractConfig['SENIOR_OPERATOR'] - ? _this.createContract(_this.contractAddresses['SENIOR_OPERATOR'], _this.contractConfig['SENIOR_OPERATOR']) - : _this.createContract(_this.contractAddresses['SENIOR_OPERATOR'], 'ALLOWANCE_OPERATOR'); + if (_this.ethersConfig) { + _this.ethersContracts['SENIOR_OPERATOR'] = _this.contractConfig['SENIOR_OPERATOR'] + ? _this.createContract(_this.contractAddresses['SENIOR_OPERATOR'], _this.contractConfig['SENIOR_OPERATOR']) + : _this.createContract(_this.contractAddresses['SENIOR_OPERATOR'], 'ALLOWANCE_OPERATOR'); + } } }; this.setEthConfig = function (ethConfig) { diff --git a/dist/index.js b/dist/index.js index 0aabb52..277590e 100644 --- a/dist/index.js +++ b/dist/index.js @@ -47497,7 +47497,8 @@ var Tinlake = /** @class */ (function () { contractNames.forEach(function (name) { if (_this.contractAbis[name] && _this.contractAddresses[name]) { _this.contracts[name] = _this.eth.contract(_this.contractAbis[name]).at(_this.contractAddresses[name]); - _this.ethersContracts[name] = _this.createContract(_this.contractAddresses[name], name); + if (_this.ethersConfig) + _this.ethersContracts[name] = _this.createContract(_this.contractAddresses[name], name); } }); // modular contracts @@ -47505,17 +47506,21 @@ var Tinlake = /** @class */ (function () { _this.contracts['JUNIOR_OPERATOR'] = _this.contractConfig['JUNIOR_OPERATOR'] ? _this.createEthContract(_this.contractAddresses['JUNIOR_OPERATOR'], _this.contractConfig['JUNIOR_OPERATOR']) : _this.createEthContract(_this.contractAddresses['JUNIOR_OPERATOR'], 'ALLOWANCE_OPERATOR'); - _this.ethersContracts['JUNIOR_OPERATOR'] = _this.contractConfig['JUNIOR_OPERATOR'] - ? _this.createContract(_this.contractAddresses['JUNIOR_OPERATOR'], _this.contractConfig['JUNIOR_OPERATOR']) - : _this.createContract(_this.contractAddresses['JUNIOR_OPERATOR'], 'ALLOWANCE_OPERATOR'); + if (_this.ethersConfig) { + _this.ethersContracts['JUNIOR_OPERATOR'] = _this.contractConfig['JUNIOR_OPERATOR'] + ? _this.createContract(_this.contractAddresses['JUNIOR_OPERATOR'], _this.contractConfig['JUNIOR_OPERATOR']) + : _this.createContract(_this.contractAddresses['JUNIOR_OPERATOR'], 'ALLOWANCE_OPERATOR'); + } } if (_this.contractAddresses['SENIOR_OPERATOR']) { _this.contracts['SENIOR_OPERATOR'] = _this.contractConfig['SENIOR_OPERATOR'] ? _this.createEthContract(_this.contractAddresses['SENIOR_OPERATOR'], _this.contractConfig['SENIOR_OPERATOR']) : _this.createEthContract(_this.contractAddresses['SENIOR_OPERATOR'], 'ALLOWANCE_OPERATOR'); - _this.ethersContracts['SENIOR_OPERATOR'] = _this.contractConfig['SENIOR_OPERATOR'] - ? _this.createContract(_this.contractAddresses['SENIOR_OPERATOR'], _this.contractConfig['SENIOR_OPERATOR']) - : _this.createContract(_this.contractAddresses['SENIOR_OPERATOR'], 'ALLOWANCE_OPERATOR'); + if (_this.ethersConfig) { + _this.ethersContracts['SENIOR_OPERATOR'] = _this.contractConfig['SENIOR_OPERATOR'] + ? _this.createContract(_this.contractAddresses['SENIOR_OPERATOR'], _this.contractConfig['SENIOR_OPERATOR']) + : _this.createContract(_this.contractAddresses['SENIOR_OPERATOR'], 'ALLOWANCE_OPERATOR'); + } } }; this.setEthConfig = function (ethConfig) { diff --git a/docs/classes/_tinlake_.tinlake.html b/docs/classes/_tinlake_.tinlake.html index 1cd61d3..9d131d0 100644 --- a/docs/classes/_tinlake_.tinlake.html +++ b/docs/classes/_tinlake_.tinlake.html @@ -130,7 +130,7 @@

        constructor

      • Parameters

        @@ -152,7 +152,7 @@

        contractAbis

        contractAbis: ContractAbis
        @@ -162,7 +162,7 @@

        contractAddresses

        contractAddresses: ContractAddresses
        @@ -172,7 +172,7 @@

        contractConfig

        contractConfig: any
        @@ -182,7 +182,7 @@

        contracts

        contracts: Contracts
        @@ -192,7 +192,7 @@

        eth

        eth: ethI
        @@ -202,7 +202,7 @@

        ethConfig

        ethConfig: EthConfig
        @@ -212,7 +212,7 @@

        ethOptions

        ethOptions: any
        @@ -222,7 +222,7 @@

        ethersConfig

        ethersConfig: EthersConfig
        @@ -232,7 +232,7 @@

        ethersContracts

        ethersContracts: Contracts
        @@ -242,7 +242,7 @@

        provider

        provider: any
        @@ -252,7 +252,7 @@

        transactionTimeout

        transactionTimeout: number
        @@ -269,7 +269,7 @@

        contract

      • Parameters

        @@ -295,7 +295,7 @@

        createContract

      • Parameters

        @@ -321,7 +321,7 @@

        createEthContract

      • Parameters

        @@ -347,7 +347,7 @@

        getContract

      • Parameters

        @@ -373,7 +373,7 @@

        getOperatorType

      • Parameters

        @@ -396,7 +396,7 @@

        getTransactionReceipt

      • Parameters

        @@ -419,7 +419,7 @@

        pending

      • Parameters

        @@ -442,7 +442,7 @@

        setContracts

      • Returns void

        @@ -459,7 +459,7 @@

        setEthConfig

      • Parameters

        @@ -482,7 +482,7 @@

        setEthersConfig

      • Parameters

        @@ -505,7 +505,7 @@

        setProvider

      • Parameters

        diff --git a/docs/interfaces/_services_ethereum_.ethi.html b/docs/interfaces/_services_ethereum_.ethi.html index 4fa4132..d2f83ab 100644 --- a/docs/interfaces/_services_ethereum_.ethi.html +++ b/docs/interfaces/_services_ethereum_.ethi.html @@ -101,7 +101,7 @@

        abi

        abi: any
        @@ -111,7 +111,7 @@

        contract

        contract: (arg0: any) => { at: (arg0: any) => void }
        @@ -165,7 +165,7 @@

        getTransactionByHash

        getTransactionByHash: (arg0: any, arg1: (err: any, tx: any) => void) => void
        @@ -220,7 +220,7 @@

        getTransactionCount

        getTransactionCount: any
        @@ -230,7 +230,7 @@

        getTransactionReceipt

        getTransactionReceipt: (arg0: any, arg1: (err: any, receipt: any) => void) => void
        @@ -285,7 +285,7 @@

        send

        send: Function
        @@ -295,7 +295,7 @@

        sendRawTransaction

        sendRawTransaction: any
        @@ -305,7 +305,7 @@

        web3_sha3

        web3_sha3: (signature: string) => string
        diff --git a/docs/interfaces/_services_ethereum_.events.html b/docs/interfaces/_services_ethereum_.events.html index 961df74..efe5a8a 100644 --- a/docs/interfaces/_services_ethereum_.events.html +++ b/docs/interfaces/_services_ethereum_.events.html @@ -96,7 +96,7 @@

        events

        events: { data: any[]; event: { name: any } }[]
        @@ -106,7 +106,7 @@

        status

        status: any
        @@ -116,7 +116,7 @@

        txHash

        txHash: string
        diff --git a/docs/modules/_actions_admin_.html b/docs/modules/_actions_admin_.html index d4444a9..494a5a6 100644 --- a/docs/modules/_actions_admin_.html +++ b/docs/modules/_actions_admin_.html @@ -89,7 +89,7 @@

        IAdminActions

        IAdminActions: { approveAllowanceJunior: any; approveAllowanceSenior: any; canSetInterestRate: any; canSetInvestorAllowanceJunior: any; canSetInvestorAllowanceSenior: any; canSetLoanPrice: any; canSetMinimumJuniorRatio: any; canSetRiskScore: any; canSetSeniorTrancheInterest: any; initRate: any; isWard: any; setMinimumJuniorRatio: any; setRate: any }
        @@ -104,7 +104,7 @@
        approveAllowanceJunior:
      • Parameters

        @@ -132,7 +132,7 @@
        approveAllowanceSenior:
      • Parameters

        @@ -160,7 +160,7 @@
        canSetInterestRate:

        Parameters

        @@ -182,7 +182,7 @@
        canSetInvestorAllowanceJunior

        Parameters

        @@ -204,7 +204,7 @@
        canSetInvestorAllowanceSenior

        Parameters

        @@ -226,7 +226,7 @@
        canSetLoanPrice: fu
      • Parameters

        @@ -248,7 +248,7 @@
        canSetMinimumJuniorRatio

        Parameters

        @@ -270,7 +270,7 @@
        canSetRiskScore: fu
      • Parameters

        @@ -292,7 +292,7 @@
        canSetSeniorTrancheInterest

        Parameters

        @@ -314,7 +314,7 @@
        initRate: function
      • Parameters

        @@ -336,7 +336,7 @@
        isWard: function
      • Parameters

        @@ -361,7 +361,7 @@
        setMinimumJuniorRatio:

        Parameters

        @@ -383,7 +383,7 @@
        setRate: function
      • Parameters

        @@ -415,7 +415,7 @@

        AdminActions

      • Type parameters

        diff --git a/docs/modules/_actions_analytics_.html b/docs/modules/_actions_analytics_.html index 53f4b00..3ed946f 100644 --- a/docs/modules/_actions_analytics_.html +++ b/docs/modules/_actions_analytics_.html @@ -89,7 +89,7 @@

        IAnalyticsActions

        IAnalyticsActions: { existsSenior: any; getAssetValueJunior: any; getCollateral: any; getCurrentJuniorRatio: any; getDebt: any; getInterestRate: any; getInvestor: any; getJuniorReserve: any; getJuniorTokenBalance: any; getLoan: any; getLoanList: any; getMaxRedeemAmountJunior: any; getMaxRedeemAmountSenior: any; getMaxSupplyAmountJunior: any; getMaxSupplyAmountSenior: any; getMinJuniorRatio: any; getOwnerOfCollateral: any; getOwnerOfLoan: any; getPrincipal: any; getSeniorDebt: any; getSeniorInterestRate: any; getSeniorReserve: any; getSeniorTokenBalance: any; getTokenPriceJunior: any; getTokenPriceSenior: any; getTotalBalance: any; getTotalDebt: any; loanCount: any }
        @@ -104,7 +104,7 @@
        existsSenior: function
      • Returns boolean

        @@ -120,7 +120,7 @@
        getAssetValueJunior:

        Returns Promise<BN>

        @@ -136,7 +136,7 @@
        getCollateral: function
      • Parameters

        @@ -158,7 +158,7 @@
        getCurrentJuniorRatio:

        Returns Promise<BN>

        @@ -174,7 +174,7 @@
        getDebt: function
      • Parameters

        @@ -196,7 +196,7 @@
        getInterestRate: functio
      • Parameters

        @@ -218,7 +218,7 @@
        getInvestor: function
      • Parameters

        @@ -240,7 +240,7 @@
        getJuniorReserve: functi
      • Returns Promise<BN>

        @@ -256,7 +256,7 @@
        getJuniorTokenBalance:

        Parameters

        @@ -278,7 +278,7 @@
        getLoan: function
      • Parameters

        @@ -300,7 +300,7 @@
        getLoanList: function

        Returns Promise<Loan[]>

        @@ -316,7 +316,7 @@
        getMaxRedeemAmountJunior

        Parameters

        @@ -338,7 +338,7 @@
        getMaxRedeemAmountSenior

        Parameters

        @@ -360,7 +360,7 @@
        getMaxSupplyAmountJunior

        Parameters

        @@ -382,7 +382,7 @@
        getMaxSupplyAmountSenior

        Parameters

        @@ -404,7 +404,7 @@
        getMinJuniorRatio:
      • Returns Promise<BN>

        @@ -420,7 +420,7 @@
        getOwnerOfCollateral: fu
      • Parameters

        @@ -448,7 +448,7 @@
        getOwnerOfLoan: function
      • Parameters

        @@ -470,7 +470,7 @@
        getPrincipal: function
      • Parameters

        @@ -492,7 +492,7 @@
        getSeniorDebt: function<
      • Returns Promise<BN>

        @@ -508,7 +508,7 @@
        getSeniorInterestRate:

        Returns Promise<BN>

        @@ -524,7 +524,7 @@
        getSeniorReserve: functi
      • Returns Promise<BN>

        @@ -540,7 +540,7 @@
        getSeniorTokenBalance:

        Parameters

        @@ -562,7 +562,7 @@
        getTokenPriceJunior:

        Returns Promise<BN>

        @@ -578,7 +578,7 @@
        getTokenPriceSenior:

        Parameters

        @@ -600,7 +600,7 @@
        getTotalBalance: functio
      • Returns Promise<BN>

        @@ -616,7 +616,7 @@
        getTotalDebt: function

        Returns Promise<BN>

        @@ -632,7 +632,7 @@
        loanCount: function
      • Returns Promise<BN>

        @@ -655,7 +655,7 @@

        AnalyticsActions

      • Type parameters

        diff --git a/docs/modules/_actions_borrower_.html b/docs/modules/_actions_borrower_.html index 7758182..3af311e 100644 --- a/docs/modules/_actions_borrower_.html +++ b/docs/modules/_actions_borrower_.html @@ -89,7 +89,7 @@

        IBorrowerActions

        IBorrowerActions: { borrow: any; close: any; issue: any; lock: any; nftLookup: any; repay: any; unlock: any; withdraw: any }
        @@ -104,7 +104,7 @@
        borrow: function
      • Parameters

        @@ -129,7 +129,7 @@
        close: function
      • Parameters

        @@ -151,7 +151,7 @@
        issue: function
      • Parameters

        @@ -176,7 +176,7 @@
        lock: function
      • Parameters

        @@ -198,7 +198,7 @@
        nftLookup: function
      • Parameters

        @@ -223,7 +223,7 @@
        repay: function
      • Parameters

        @@ -248,7 +248,7 @@
        unlock: function
      • Parameters

        @@ -270,7 +270,7 @@
        withdraw: function
      • Parameters

        @@ -305,7 +305,7 @@

        BorrowerActions

      • Type parameters

        diff --git a/docs/modules/_actions_collateral_.html b/docs/modules/_actions_collateral_.html index 3629040..f8b3220 100644 --- a/docs/modules/_actions_collateral_.html +++ b/docs/modules/_actions_collateral_.html @@ -89,7 +89,7 @@

        ICollateralActions

        ICollateralActions: { approveNFT: any; getNFTCount: any; getNFTData: any; getNFTOwner: any; isNFTApprovedForAll: any; mintNFT: any; mintTitleNFT: any; setNFTApprovalForAll: any; transferNFT: any }
        @@ -104,7 +104,7 @@
        approveNFT: function
      • Parameters

        @@ -132,7 +132,7 @@
        getNFTCount: function
      • Parameters

        @@ -154,7 +154,7 @@
        getNFTData: function
      • Parameters

        @@ -179,7 +179,7 @@
        getNFTOwner: function
      • Parameters

        @@ -204,7 +204,7 @@
        isNFTApprovedForAll: fun
      • Parameters

        @@ -232,7 +232,7 @@
        mintNFT: function
      • Parameters

        @@ -269,7 +269,7 @@
        mintTitleNFT: function
      • Parameters

        @@ -294,7 +294,7 @@
        setNFTApprovalForAll: fu
      • Parameters

        @@ -322,7 +322,7 @@
        transferNFT: function
      • Parameters

        @@ -360,7 +360,7 @@

        CollateralActions

      • Type parameters

        diff --git a/docs/modules/_actions_currency_.html b/docs/modules/_actions_currency_.html index aea071e..425ddba 100644 --- a/docs/modules/_actions_currency_.html +++ b/docs/modules/_actions_currency_.html @@ -89,7 +89,7 @@

        ICurrencyActions

        ICurrencyActions: { approveJuniorForCurrency: (currencyAmount: string) => Promise<PendingTransaction | undefined>; approveSeniorForCurrency: (currencyAmount: string) => Promise<PendingTransaction | undefined>; getCurrencyAllowance: (owner: string, spender: string) => Promise<BN>; getJuniorForCurrencyAllowance: (owner: string) => Promise<BN | undefined>; getSeniorForCurrencyAllowance: (owner: string) => Promise<BN | undefined>; approveCurrency: any; getCurrencyBalance: any; mintCurrency: any }
        @@ -212,7 +212,7 @@
        approveCurrency: function

        Parameters

        @@ -237,7 +237,7 @@
        getCurrencyBalance: func
      • Parameters

        @@ -259,7 +259,7 @@
        mintCurrency: function
      • Parameters

        @@ -291,7 +291,7 @@

        CurrencyActions

      • Type parameters

        diff --git a/docs/modules/_actions_governance_.html b/docs/modules/_actions_governance_.html index 95cb2e3..12c3370 100644 --- a/docs/modules/_actions_governance_.html +++ b/docs/modules/_actions_governance_.html @@ -83,7 +83,7 @@

        IGovernanceActions

        IGovernanceActions: { relyAddress: any }
        @@ -98,7 +98,7 @@
        relyAddress: function
      • Parameters

        diff --git a/docs/modules/_actions_index_.html b/docs/modules/_actions_index_.html index c487971..5f5f49c 100644 --- a/docs/modules/_actions_index_.html +++ b/docs/modules/_actions_index_.html @@ -83,7 +83,7 @@

        TinlakeActions

        diff --git a/docs/modules/_actions_lender_.html b/docs/modules/_actions_lender_.html index ba59889..78adcf5 100644 --- a/docs/modules/_actions_lender_.html +++ b/docs/modules/_actions_lender_.html @@ -89,7 +89,7 @@

        ILenderActions

        ILenderActions: { approveJuniorToken: (tokenAmount: string) => Promise<unknown>; approveSeniorToken: (tokenAmount: string) => Promise<unknown>; balance: any; getJuniorTokenAllowance: any; getSeniorTokenAllowance: any; redeemJunior: any; redeemSenior: any; supplyJunior: any; supplySenior: any }
        @@ -146,7 +146,7 @@
        balance: function
      • Returns Promise<any>

        @@ -162,7 +162,7 @@
        getJuniorTokenAllowance: <
      • Parameters

        @@ -184,7 +184,7 @@
        getSeniorTokenAllowance: <
      • Parameters

        @@ -206,7 +206,7 @@
        redeemJunior: function
      • Parameters

        @@ -228,7 +228,7 @@
        redeemSenior: function
      • Parameters

        @@ -250,7 +250,7 @@
        supplyJunior: function
      • Parameters

        @@ -272,7 +272,7 @@
        supplySenior: function
      • Parameters

        @@ -301,7 +301,7 @@

        LenderActions

      • Type parameters

        diff --git a/docs/modules/_actions_proxy_.html b/docs/modules/_actions_proxy_.html index 7d18112..99540f3 100644 --- a/docs/modules/_actions_proxy_.html +++ b/docs/modules/_actions_proxy_.html @@ -89,7 +89,7 @@

        IProxyActions

        IProxyActions: { buildProxy: any; checkProxyExists: any; getProxy: any; getProxyAccessToken: any; getProxyAccessTokenOwner: any; getProxyOwnerByAddress: any; getProxyOwnerByLoan: any; proxyCount: any; proxyCreateNew: any; proxyIssue: any; proxyLockBorrowWithdraw: any; proxyRepayUnlockClose: any; proxyTransferIssue: any }
        @@ -104,7 +104,7 @@
        buildProxy: function
      • Parameters

        @@ -126,7 +126,7 @@
        checkProxyExists: functi
      • Parameters

        @@ -148,7 +148,7 @@
        getProxy: function
      • Parameters

        @@ -170,7 +170,7 @@
        getProxyAccessToken:

        Parameters

        @@ -192,7 +192,7 @@
        getProxyAccessTokenOwner

        Parameters

        @@ -214,7 +214,7 @@
        getProxyOwnerByAddress:

        Parameters

        @@ -236,7 +236,7 @@
        getProxyOwnerByLoan:

        Parameters

        @@ -258,7 +258,7 @@
        proxyCount: function
      • Returns Promise<any>

        @@ -274,7 +274,7 @@
        proxyCreateNew: function
      • Parameters

        @@ -296,7 +296,7 @@
        proxyIssue: function
      • Parameters

        @@ -324,7 +324,7 @@
        proxyLockBorrowWithdraw: <
      • Parameters

        @@ -355,7 +355,7 @@
        proxyRepayUnlockClose:

        Parameters

        @@ -386,7 +386,7 @@
        proxyTransferIssue: func
      • Parameters

        @@ -421,7 +421,7 @@

        ProxyActions

      • Type parameters

        diff --git a/docs/modules/_services_ethereum_.html b/docs/modules/_services_ethereum_.html index d6fef06..d402b5d 100644 --- a/docs/modules/_services_ethereum_.html +++ b/docs/modules/_services_ethereum_.html @@ -99,7 +99,7 @@

        Const ZERO_ADDRESS

        ZERO_ADDRESS: "0x0000000000000000000000000000000000000000" = "0x0000000000000000000000000000000000000000"
        @@ -116,7 +116,7 @@

        executeAndRetry

      • Parameters

        @@ -142,7 +142,7 @@

        Const findEvent

      • Parameters

        @@ -209,7 +209,7 @@

        Const waitAndReturn

        Parameters

        @@ -241,7 +241,7 @@

        Const waitForTransactio
      • Parameters

        diff --git a/docs/modules/_tinlake_.html b/docs/modules/_tinlake_.html index 9c6fad7..f002249 100644 --- a/docs/modules/_tinlake_.html +++ b/docs/modules/_tinlake_.html @@ -98,7 +98,7 @@

        Constructor

        Constructor<T>: {}

        Type parameters

        @@ -119,7 +119,7 @@

        ContractAbis

        ContractAbis: {}
        @@ -134,7 +134,7 @@

        ContractAddresses

        ContractAddresses: {}
        @@ -149,7 +149,7 @@

        ContractName

        ContractName: typeof contractNames[number]
        @@ -159,7 +159,7 @@

        Contracts

        Contracts: {}
        @@ -174,7 +174,7 @@

        EthConfig

        EthConfig: { from?: undefined | string; gas?: undefined | string; gasPrice?: undefined | string }
        @@ -198,7 +198,7 @@

        EthersConfig

        EthersConfig: { overrides?: EthersOverrides; provider: Provider; signer: Signer }
        @@ -222,7 +222,7 @@

        EthersOverrides

        EthersOverrides: { gasLimit?: undefined | number; gasPrice?: undefined | number }
        @@ -243,7 +243,7 @@

        PendingTransaction

        PendingTransaction: { hash: string | undefined; timesOutAt?: undefined | number }
        @@ -264,7 +264,7 @@

        TinlakeParams

        TinlakeParams: { contractAbis?: ContractAbis | {}; contractAddresses?: ContractAddresses | {}; contractConfig?: any | {}; contracts?: Contracts | {}; ethConfig?: EthConfig; ethOptions?: any | {}; ethersConfig?: EthersConfig; provider: any; transactionTimeout: number }
        diff --git a/docs/modules/_types_tinlake_.html b/docs/modules/_types_tinlake_.html index 22c23c9..486b034 100644 --- a/docs/modules/_types_tinlake_.html +++ b/docs/modules/_types_tinlake_.html @@ -87,7 +87,7 @@

        ITinlake

        @@ -97,7 +97,7 @@

        Investor

        Investor: { address: string; junior: { maxRedeem: BN; maxSupply: BN; tokenBalance: BN }; senior: { maxRedeem?: BN; maxSupply?: BN; tokenBalance?: BN } }
        @@ -143,7 +143,7 @@

        Loan

        Loan: { debt: BN; interestRate: BN; loanId: string; nft?: NFT; ownerOf: BN; price?: BN; principal: BN; proxyOwner?: undefined | string; registry: string; status?: undefined | string; threshold?: BN; tokenId: BN }
        @@ -194,7 +194,7 @@

        NFT

        NFT: { nftData: any; nftOwner: string; registry: string; tokenId: BN }
        @@ -221,7 +221,7 @@

        Tranche

        Tranche: { availableFunds: BN; interestRate?: BN; token: string; tokenPrice: BN; totalSupply: BN; type: string }
        diff --git a/docs/modules/_utils_basetodisplay_.html b/docs/modules/_utils_basetodisplay_.html index e5c8125..5f45c80 100644 --- a/docs/modules/_utils_basetodisplay_.html +++ b/docs/modules/_utils_basetodisplay_.html @@ -87,7 +87,7 @@

        Const baseToDisplay

      • Parameters

        diff --git a/docs/modules/_utils_bntohex_.html b/docs/modules/_utils_bntohex_.html index 2fd638e..87c0bc9 100644 --- a/docs/modules/_utils_bntohex_.html +++ b/docs/modules/_utils_bntohex_.html @@ -87,7 +87,7 @@

        Const bnToHex

      • Parameters

        diff --git a/docs/modules/_utils_displaytobase_.html b/docs/modules/_utils_displaytobase_.html index 1e5301d..78f0f6f 100644 --- a/docs/modules/_utils_displaytobase_.html +++ b/docs/modules/_utils_displaytobase_.html @@ -87,7 +87,7 @@

        Const displayToBase

      • Parameters

        diff --git a/docs/modules/_utils_feetointerestrate_.html b/docs/modules/_utils_feetointerestrate_.html index f688d92..bf3fcce 100644 --- a/docs/modules/_utils_feetointerestrate_.html +++ b/docs/modules/_utils_feetointerestrate_.html @@ -87,7 +87,7 @@

        Const feeToInterestRate
      • diff --git a/docs/modules/_utils_getloanstatus_.html b/docs/modules/_utils_getloanstatus_.html index a4785f3..5a614b2 100644 --- a/docs/modules/_utils_getloanstatus_.html +++ b/docs/modules/_utils_getloanstatus_.html @@ -89,7 +89,7 @@

        LoanStatus

        LoanStatus: "Whitelisted" | "Ongoing" | "Repaid"
        @@ -106,7 +106,7 @@

        getLoanStatus

      • Parameters

        diff --git a/docs/modules/_utils_interestratetofee_.html b/docs/modules/_utils_interestratetofee_.html index 925e3a9..67f51c3 100644 --- a/docs/modules/_utils_interestratetofee_.html +++ b/docs/modules/_utils_interestratetofee_.html @@ -87,7 +87,7 @@

        Const interestRateToFee
      • diff --git a/package.json b/package.json index ce1ef81..79f17f3 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,7 @@ }, "scripts": { "build": "rollup -c", - "watch": "rollup -cw", + "start": "rollup -cw", "test": "ts-mocha -p src/test/tsconfig.json src/**/*.spec.ts src/*.spec.ts --timeout 40000", "nodemon": "nodemon node inspect dist/Tinlake.js", "generate-docs": "typedoc --out docs --exclude \"./node_modules/**\" --exclude \"./src/abi/**\" --exclude \"./src/index.ts\" --exclude \"./src/actions/*.spec.ts\" --exclude \"./src/test/**\" --excludeExternals --excludeNotExported --ignoreCompilerErrors ./src", diff --git a/src/Tinlake.ts b/src/Tinlake.ts index 5adab78..58841b3 100644 --- a/src/Tinlake.ts +++ b/src/Tinlake.ts @@ -88,6 +88,7 @@ export type TinlakeParams = { } export type Constructor = new (...args: any[]) => Tinlake + ;(ethers.utils.BigNumber as any).prototype.toBN = function () { return new BN((this as any).toString()) } @@ -141,7 +142,8 @@ export default class Tinlake { contractNames.forEach((name) => { if (this.contractAbis[name] && this.contractAddresses[name]) { this.contracts[name] = this.eth.contract(this.contractAbis[name]).at(this.contractAddresses[name]) - this.ethersContracts[name] = this.createContract(this.contractAddresses[name]!, name) + + if (this.ethersConfig) this.ethersContracts[name] = this.createContract(this.contractAddresses[name]!, name) } }) @@ -151,18 +153,22 @@ export default class Tinlake { ? this.createEthContract(this.contractAddresses['JUNIOR_OPERATOR'], this.contractConfig['JUNIOR_OPERATOR']) : this.createEthContract(this.contractAddresses['JUNIOR_OPERATOR'], 'ALLOWANCE_OPERATOR') - this.ethersContracts['JUNIOR_OPERATOR'] = this.contractConfig['JUNIOR_OPERATOR'] - ? this.createContract(this.contractAddresses['JUNIOR_OPERATOR'], this.contractConfig['JUNIOR_OPERATOR']) - : this.createContract(this.contractAddresses['JUNIOR_OPERATOR'], 'ALLOWANCE_OPERATOR') + if (this.ethersConfig) { + this.ethersContracts['JUNIOR_OPERATOR'] = this.contractConfig['JUNIOR_OPERATOR'] + ? this.createContract(this.contractAddresses['JUNIOR_OPERATOR'], this.contractConfig['JUNIOR_OPERATOR']) + : this.createContract(this.contractAddresses['JUNIOR_OPERATOR'], 'ALLOWANCE_OPERATOR') + } } if (this.contractAddresses['SENIOR_OPERATOR']) { this.contracts['SENIOR_OPERATOR'] = this.contractConfig['SENIOR_OPERATOR'] ? this.createEthContract(this.contractAddresses['SENIOR_OPERATOR'], this.contractConfig['SENIOR_OPERATOR']) : this.createEthContract(this.contractAddresses['SENIOR_OPERATOR'], 'ALLOWANCE_OPERATOR') - this.ethersContracts['SENIOR_OPERATOR'] = this.contractConfig['SENIOR_OPERATOR'] - ? this.createContract(this.contractAddresses['SENIOR_OPERATOR'], this.contractConfig['SENIOR_OPERATOR']) - : this.createContract(this.contractAddresses['SENIOR_OPERATOR'], 'ALLOWANCE_OPERATOR') + if (this.ethersConfig) { + this.ethersContracts['SENIOR_OPERATOR'] = this.contractConfig['SENIOR_OPERATOR'] + ? this.createContract(this.contractAddresses['SENIOR_OPERATOR'], this.contractConfig['SENIOR_OPERATOR']) + : this.createContract(this.contractAddresses['SENIOR_OPERATOR'], 'ALLOWANCE_OPERATOR') + } } } diff --git a/src/test/utils.ts b/src/test/utils.ts index ef30aaf..6078335 100644 --- a/src/test/utils.ts +++ b/src/test/utils.ts @@ -39,6 +39,7 @@ export function createTinlake(usr: Account, testConfig: ProviderConfig): ITinlak transactionTimeout, provider: createSignerProvider(rpcUrl, usr), ethConfig: { gas, gasPrice, from: usr.address }, + ethersConfig: createEthersConfig(rpcUrl), }) return tinlake @@ -50,3 +51,10 @@ function createSignerProvider(rpcUrl: string, usr: Account) { accounts: (cb: (arg0: null, arg1: string[]) => void) => cb(null, [usr.address]), }) } + + +function createEthersConfig(rpcUrl: string) { + const provider = new ethers.providers.JsonRpcProvider(rpcUrl) + const signer = provider.getSigner() + return { provider, signer } +} From 8a70d79b79849eb7d39772edd68d954336b05401 Mon Sep 17 00:00:00 2001 From: Jeroen Offerijns Date: Wed, 26 Aug 2020 19:37:44 +0200 Subject: [PATCH 09/65] refactor: rewrite most of the analytics actions --- dist/Tinlake.d.ts | 1 - dist/actions/admin.d.ts | 7 +- dist/actions/analytics.d.ts | 27 +- dist/actions/collateral.d.ts | 15 +- dist/actions/currency.d.ts | 1 - dist/actions/lender.d.ts | 11 +- dist/actions/proxy.d.ts | 23 +- dist/index.es.js | 417 ++++++------------ dist/index.js | 417 ++++++------------ docs/assets/js/search.js | 2 +- docs/classes/_tinlake_.tinlake.html | 74 +--- docs/interfaces/_services_ethereum_.ethi.html | 16 +- .../_services_ethereum_.events.html | 6 +- docs/modules/_actions_admin_.html | 30 +- docs/modules/_actions_analytics_.html | 60 +-- docs/modules/_actions_borrower_.html | 20 +- docs/modules/_actions_collateral_.html | 26 +- docs/modules/_actions_currency_.html | 10 +- docs/modules/_actions_governance_.html | 4 +- docs/modules/_actions_index_.html | 2 +- docs/modules/_actions_lender_.html | 18 +- docs/modules/_actions_proxy_.html | 38 +- docs/modules/_services_ethereum_.html | 10 +- docs/modules/_tinlake_.html | 20 +- docs/modules/_types_tinlake_.html | 10 +- docs/modules/_utils_basetodisplay_.html | 2 +- docs/modules/_utils_bntohex_.html | 2 +- docs/modules/_utils_displaytobase_.html | 2 +- docs/modules/_utils_feetointerestrate_.html | 2 +- docs/modules/_utils_getloanstatus_.html | 4 +- docs/modules/_utils_interestratetofee_.html | 2 +- src/Tinlake.ts | 15 +- src/actions/admin.ts | 13 +- src/actions/analytics.ts | 107 ++--- src/actions/collateral.ts | 41 +- src/actions/currency.ts | 4 +- src/actions/lender.ts | 16 +- src/actions/proxy.ts | 48 +- src/test/utils.ts | 1 - 39 files changed, 538 insertions(+), 986 deletions(-) diff --git a/dist/Tinlake.d.ts b/dist/Tinlake.d.ts index e50520a..f3c20e9 100644 --- a/dist/Tinlake.d.ts +++ b/dist/Tinlake.d.ts @@ -60,7 +60,6 @@ export default class Tinlake { setEthersConfig: (ethersConfig: EthersConfig | undefined) => void; createEthContract(address: string, abiName: ContractName): void; createContract(address: string, abiName: ContractName): ethers.Contract; - getContract(address: string, abiName: ContractName): ethers.Contract; contract(abiName: ContractName, address?: string): ethers.Contract; pending(txPromise: Promise): Promise; getTransactionReceipt(tx: PendingTransaction): Promise; diff --git a/dist/actions/admin.d.ts b/dist/actions/admin.d.ts index d15dfe9..10a4c34 100644 --- a/dist/actions/admin.d.ts +++ b/dist/actions/admin.d.ts @@ -15,11 +15,7 @@ export declare function AdminActions Promise; changeRate: (loan: string, ratePerSecond: string) => Promise; setRate: (loan: string, ratePerSecond: string) => Promise; - setMinimumJuniorRatio: (ratio: string) => Promise<{ - hash: any; - contractKey: string; - timesOutAt: number; - }>; + setMinimumJuniorRatio: (ratio: string) => Promise; approveAllowanceJunior: (user: string, maxCurrency: string, maxToken: string) => Promise; approveAllowanceSenior: (user: string, maxCurrency: string, maxToken: string) => Promise; provider: any; @@ -39,7 +35,6 @@ export declare function AdminActions void; createEthContract(address: string, abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR"): void; createContract(address: string, abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR"): import("ethers").Contract; - getContract(address: string, abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR"): import("ethers").Contract; contract(abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR", address?: string | undefined): import("ethers").Contract; pending(txPromise: Promise): Promise; getTransactionReceipt(tx: PendingTransaction): Promise; diff --git a/dist/actions/analytics.d.ts b/dist/actions/analytics.d.ts index 4d6f827..31d2bc6 100644 --- a/dist/actions/analytics.d.ts +++ b/dist/actions/analytics.d.ts @@ -6,34 +6,34 @@ export declare function AnalyticsActions Promise; getTotalBalance: () => Promise; getPrincipal: (loanId: string) => Promise; - getDebt: (loanID: string) => Promise; + getDebt: (loanId: string) => Promise; loanCount: () => Promise; getCollateral: (loanId: string) => Promise; - getOwnerOfCollateral: (nftRegistryAddr: string, tokenId: string) => Promise; + getOwnerOfCollateral: (nftRegistryAddress: string, tokenId: string) => Promise; getInterestRate: (loanId: string) => Promise; getOwnerOfLoan: (loanId: string) => Promise; getStatus: (nftRegistryAddr: string, tokenId: string, loanId: string) => Promise; getLoan: (loanId: string) => Promise; getLoanList: () => Promise; getInvestor: (user: string) => Promise; - getJuniorTokenBalance: (user: string) => Promise; - getJuniorTotalSupply: (user: string) => Promise; - getMaxSupplyAmountJunior: (user: string) => Promise; + getJuniorTokenBalance: (user: string) => Promise; + getJuniorTotalSupply: () => Promise; + getMaxSupplyAmountJunior: (user: string) => Promise; getMaxRedeemAmountJunior: (user: string) => Promise; getTokenPriceJunior: () => Promise; existsSenior: () => boolean; - getSeniorTokenBalance: (user: string) => Promise; - getSeniorTotalSupply: (user: string) => Promise; + getSeniorTokenBalance: (user: string) => Promise; + getSeniorTotalSupply: () => Promise; getMaxSupplyAmountSenior: (user: string) => Promise; getMaxRedeemAmountSenior: (user: string) => Promise; getTokenPriceSenior: (user?: string | undefined) => Promise; getSeniorReserve: () => Promise; - getJuniorReserve: () => Promise; - getMinJuniorRatio: () => Promise; - getCurrentJuniorRatio: () => Promise; - getAssetValueJunior: () => Promise; - getSeniorDebt: () => Promise; - getSeniorInterestRate: () => Promise; + getJuniorReserve: () => Promise; + getMinJuniorRatio: () => Promise; + getCurrentJuniorRatio: () => Promise; + getAssetValueJunior: () => Promise; + getSeniorDebt: () => Promise; + getSeniorInterestRate: () => Promise; provider: any; eth: import("../services/ethereum").ethI; ethOptions: any; @@ -51,7 +51,6 @@ export declare function AnalyticsActions void; createEthContract(address: string, abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR"): void; createContract(address: string, abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR"): import("ethers").Contract; - getContract(address: string, abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR"): import("ethers").Contract; contract(abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR", address?: string | undefined): import("ethers").Contract; pending(txPromise: Promise): Promise; getTransactionReceipt(tx: import("../Tinlake").PendingTransaction): Promise; diff --git a/dist/actions/collateral.d.ts b/dist/actions/collateral.d.ts index 981786a..9e2b4b6 100644 --- a/dist/actions/collateral.d.ts +++ b/dist/actions/collateral.d.ts @@ -4,13 +4,13 @@ export declare function CollateralActions Promise; mintNFT: (nftAddress: string, owner: string, tokenId: string, ref: string, amount: string, asset: string) => Promise; - approveNFT: (nftAddr: string, tokenId: string, to: string) => Promise; - setNFTApprovalForAll: (nftAddr: string, to: string, approved: boolean) => Promise; - isNFTApprovedForAll: (nftAddr: string, owner: string, operator: string) => Promise; + approveNFT: (nftAddress: string, tokenId: string, to: string) => Promise; + setNFTApprovalForAll: (nftAddress: string, to: string, approved: boolean) => Promise; + isNFTApprovedForAll: (nftAddress: string, owner: string, operator: string) => Promise; getNFTCount: (nftAddr: string) => Promise; - getNFTData: (nftAddr: string, tokenId: string) => Promise; - getNFTOwner: (nftAddr: string, tokenId: string) => Promise; - transferNFT: (nftAddr: string, from: string, to: string, tokenId: string) => Promise; + getNFTData: (nftAddress: string, tokenId: string) => Promise; + getNFTOwner: (nftAddresss: string, tokenId: string) => Promise; + transferNFT: (nftAddress: string, from: string, to: string, tokenId: string) => Promise; provider: any; eth: import("../services/ethereum").ethI; ethOptions: any; @@ -28,7 +28,6 @@ export declare function CollateralActions void; createEthContract(address: string, abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR"): void; createContract(address: string, abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR"): import("ethers").Contract; - getContract(address: string, abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR"): import("ethers").Contract; contract(abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR", address?: string | undefined): import("ethers").Contract; pending(txPromise: Promise): Promise; getTransactionReceipt(tx: PendingTransaction): Promise; @@ -38,7 +37,7 @@ export declare function CollateralActions; mintNFT(nftAddr: string, owner: string, tokenId: string, ref: string, amount: string, asset: string): Promise; - approveNFT(nftAddr: string, tokenId: string, to: string): Promise; + approveNFT(nftAddr: string, tokenId: string, to: string): Promise; setNFTApprovalForAll(nftAddr: string, to: string, approved: boolean): Promise; isNFTApprovedForAll(nftAddr: string, owner: string, operator: string): Promise; getNFTCount(nftAddr: string): Promise; diff --git a/dist/actions/currency.d.ts b/dist/actions/currency.d.ts index c54629e..24eb8ad 100644 --- a/dist/actions/currency.d.ts +++ b/dist/actions/currency.d.ts @@ -36,7 +36,6 @@ export declare function CurrencyActions void; createEthContract(address: string, abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR"): void; createContract(address: string, abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR"): import("ethers").Contract; - getContract(address: string, abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR"): import("ethers").Contract; contract(abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR", address?: string | undefined): import("ethers").Contract; pending(txPromise: Promise): Promise; getTransactionReceipt(tx: PendingTransaction): Promise; diff --git a/dist/actions/lender.d.ts b/dist/actions/lender.d.ts index 4177b65..391985e 100644 --- a/dist/actions/lender.d.ts +++ b/dist/actions/lender.d.ts @@ -2,17 +2,11 @@ import { Constructor, TinlakeParams, PendingTransaction } from '../Tinlake'; import BN from 'bn.js'; export declare function LenderActions>(Base: ActionBase): { new (...args: any[]): { - supplySenior: (currencyAmount: string) => Promise<{ - hash: any; - contractKey: string; - }>; + supplySenior: (currencyAmount: string) => Promise; redeemSenior: (tokenAmount: string) => Promise; getSeniorTokenAllowance: (owner: string) => Promise; approveSeniorToken: (tokenAmount: string) => Promise; - supplyJunior: (currencyAmount: string) => Promise<{ - hash: any; - contractKey: string; - }>; + supplyJunior: (currencyAmount: string) => Promise; redeemJunior: (tokenAmount: string) => Promise; getJuniorTokenAllowance: (owner: string) => Promise; approveJuniorToken: (tokenAmount: string) => Promise; @@ -34,7 +28,6 @@ export declare function LenderActions void; createEthContract(address: string, abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR"): void; createContract(address: string, abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR"): import("ethers").Contract; - getContract(address: string, abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR"): import("ethers").Contract; contract(abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR", address?: string | undefined): import("ethers").Contract; pending(txPromise: Promise): Promise; getTransactionReceipt(tx: PendingTransaction): Promise; diff --git a/dist/actions/proxy.d.ts b/dist/actions/proxy.d.ts index 941a82e..d12daed 100644 --- a/dist/actions/proxy.d.ts +++ b/dist/actions/proxy.d.ts @@ -1,4 +1,4 @@ -import { Constructor, TinlakeParams } from '../Tinlake'; +import { Constructor, TinlakeParams, PendingTransaction } from '../Tinlake'; import BN from 'bn.js'; import { ethers } from 'ethers'; export declare function ProxyActions>(Base: ActionsBase): { @@ -6,20 +6,14 @@ export declare function ProxyActions Promise; buildProxy: (owner: string) => Promise; getProxy: (accessTokenId: string) => Promise; - getProxyAccessToken: (proxyAddr: string) => Promise; + getProxyAccessToken: (proxyAddress: string) => Promise; getProxyOwnerByLoan: (loanId: string) => Promise; getProxyOwnerByAddress: (proxyAddress: string) => Promise; proxyCount: () => Promise; checkProxyExists: (address: string) => Promise; proxyCreateNew: (address: string) => Promise; - proxyIssue: (proxyAddr: string, nftRegistryAddr: string, tokenId: string) => Promise<{ - hash: any; - contractKey: string; - }>; - proxyTransferIssue: (proxyAddr: string, nftRegistryAddr: string, tokenId: string) => Promise<{ - hash: any; - contractKey: string; - }>; + proxyIssue: (proxyAddress: string, nftRegistryAddress: string, tokenId: string) => Promise; + proxyTransferIssue: (proxyAddress: string, nftRegistryAddress: string, tokenId: string) => Promise; proxyLockBorrowWithdraw: (proxyAddr: string, loanId: string, amount: string, usr: string) => Promise; proxyRepayUnlockClose: (proxyAddr: string, tokenId: string, loanId: string, registry: string) => Promise; provider: any; @@ -39,10 +33,9 @@ export declare function ProxyActions void; createEthContract(address: string, abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR"): void; createContract(address: string, abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR"): ethers.Contract; - getContract(address: string, abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR"): ethers.Contract; contract(abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR", address?: string | undefined): ethers.Contract; - pending(txPromise: Promise): Promise; - getTransactionReceipt(tx: import("../Tinlake").PendingTransaction): Promise; + pending(txPromise: Promise): Promise; + getTransactionReceipt(tx: PendingTransaction): Promise; getOperatorType: (tranche: string) => any; }; } & ActionsBase; @@ -56,8 +49,8 @@ export declare type IProxyActions = { getProxyOwnerByLoan(loanId: string): Promise; getProxyOwnerByAddress(proxyAddr: string): Promise; proxyCreateNew(address: string): Promise; - proxyIssue(proxyAddr: string, nftRegistryAddr: string, tokenId: string): Promise; - proxyTransferIssue(proxyAddr: string, nftRegistryAddr: string, tokenId: string): Promise; + proxyIssue(proxyAddr: string, nftRegistryAddr: string, tokenId: string): Promise; + proxyTransferIssue(proxyAddr: string, nftRegistryAddr: string, tokenId: string): Promise; proxyLockBorrowWithdraw(proxyAddr: string, loanId: string, amount: string, usr: string): Promise; proxyRepayUnlockClose(proxyAddr: string, tokenId: string, loanId: string, registry: string): Promise; }; diff --git a/dist/index.es.js b/dist/index.es.js index 153fd0b..b980fa6 100644 --- a/dist/index.es.js +++ b/dist/index.es.js @@ -10893,21 +10893,11 @@ function AdminActions(Base) { }); }; // ------------ admin functions lender-site ------------- _this.setMinimumJuniorRatio = function (ratio) { return __awaiter(_this, void 0, void 0, function () { - var tx; + var assessor; return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, this.ethersContracts['ASSESSOR'] - .connect(this.ethersConfig.signer) - .file(web3.fromAscii('minJuniorRatio').padEnd(66, '0'), ratio)]; - case 1: - tx = _a.sent(); - console.log(this.transactionTimeout); - return [2 /*return*/, { - hash: tx.hash, - contractKey: 'ASSESSOR', - timesOutAt: Date.now() + this.transactionTimeout * 1000, - }]; - } + assessor = this.contract('ASSESSOR'); + // Source: https://github.com/ethereum/web3.js/issues/2256#issuecomment-462730550 + return [2 /*return*/, this.pending(assessor.file(web3.fromAscii('minJuniorRatio').padEnd(66, '0'), ratio))]; }); }); }; _this.approveAllowanceJunior = function (user, maxCurrency, maxToken) { return __awaiter(_this, void 0, void 0, function () { @@ -29436,17 +29426,10 @@ function LenderActions(Base) { var _this = _super !== null && _super.apply(this, arguments) || this; // senior tranche functions _this.supplySenior = function (currencyAmount) { return __awaiter(_this, void 0, void 0, function () { - var tx; + var seniorOperator; return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, this.ethersContracts['SENIOR_OPERATOR'].connect(this.ethersConfig.signer).supply(currencyAmount)]; - case 1: - tx = _a.sent(); - return [2 /*return*/, { - hash: tx.hash, - contractKey: 'SENIOR_OPERATOR', - }]; - } + seniorOperator = this.contract('SENIOR_OPERATOR'); + return [2 /*return*/, this.pending(seniorOperator.supply(currencyAmount))]; }); }); }; _this.redeemSenior = function (tokenAmount) { return __awaiter(_this, void 0, void 0, function () { @@ -29493,17 +29476,10 @@ function LenderActions(Base) { }); }; // junior tranche functions _this.supplyJunior = function (currencyAmount) { return __awaiter(_this, void 0, void 0, function () { - var tx; + var juniorOperator; return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, this.ethersContracts['JUNIOR_OPERATOR'].connect(this.ethersConfig.signer).supply(currencyAmount)]; - case 1: - tx = _a.sent(); - return [2 /*return*/, { - hash: tx.hash, - contractKey: 'JUNIOR_OPERATOR', - }]; - } + juniorOperator = this.contract('JUNIOR_OPERATOR'); + return [2 /*return*/, this.pending(juniorOperator.supply(currencyAmount))]; }); }); }; _this.redeemJunior = function (tokenAmount) { return __awaiter(_this, void 0, void 0, function () { @@ -29590,7 +29566,7 @@ function CurrencyActions(Base) { return __generator(this, function (_a) { switch (_a.label) { case 0: - currencyContract = this.getContract(this.contractAddresses['TINLAKE_CURRENCY'], 'TINLAKE_CURRENCY'); + currencyContract = this.contract('TINLAKE_CURRENCY'); return [4 /*yield*/, currencyContract.allowance(owner, spender)]; case 1: allowance = _a.sent(); @@ -29628,7 +29604,7 @@ function CurrencyActions(Base) { return __generator(this, function (_a) { switch (_a.label) { case 0: - currencyContract = this.getContract(this.contractAddresses['TINLAKE_CURRENCY'], 'TINLAKE_CURRENCY'); + currencyContract = this.contract('TINLAKE_CURRENCY'); return [4 /*yield*/, currencyContract.approve(usr, currencyAmount)]; case 1: tx = _a.sent(); @@ -29688,39 +29664,23 @@ function CollateralActions(Base) { return [2 /*return*/, this.pending(nft.mint(owner, tokenId, ref, amount, asset))]; }); }); }; - _this.approveNFT = function (nftAddr, tokenId, to) { return __awaiter(_this, void 0, void 0, function () { - var nft, txHash; + _this.approveNFT = function (nftAddress, tokenId, to) { return __awaiter(_this, void 0, void 0, function () { + var nft; return __generator(this, function (_a) { - switch (_a.label) { - case 0: - nft = this.eth.contract(this.contractAbis['COLLATERAL_NFT']).at(nftAddr); - return [4 /*yield*/, executeAndRetry(nft.approve, [to, tokenId, this.ethConfig])]; - case 1: - txHash = _a.sent(); - console.log("[NFT Approve] txHash: " + txHash); - return [2 /*return*/, waitAndReturnEvents(this.eth, txHash, this.contractAbis['COLLATERAL_NFT'], this.transactionTimeout)]; - } + nft = this.contract('COLLATERAL_NFT', nftAddress); + return [2 /*return*/, this.pending(nft.approve(to, tokenId))]; }); }); }; - _this.setNFTApprovalForAll = function (nftAddr, to, approved) { return __awaiter(_this, void 0, void 0, function () { - var nftContract, tx; + _this.setNFTApprovalForAll = function (nftAddress, to, approved) { return __awaiter(_this, void 0, void 0, function () { + var nft; return __generator(this, function (_a) { - switch (_a.label) { - case 0: - nftContract = this.getContract(nftAddr, 'COLLATERAL_NFT'); - return [4 /*yield*/, nftContract.setApprovalForAll(to, approved)]; - case 1: - tx = _a.sent(); - return [2 /*return*/, this.pending(tx)]; - } + nft = this.contract('COLLATERAL_NFT', nftAddress); + return [2 /*return*/, this.pending(nft.setApprovalForAll(to, approved))]; }); }); }; - _this.isNFTApprovedForAll = function (nftAddr, owner, operator) { return __awaiter(_this, void 0, void 0, function () { + _this.isNFTApprovedForAll = function (nftAddress, owner, operator) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, this.getContract(nftAddr, 'COLLATERAL_NFT').isApprovedForAll(owner, operator)]; - case 1: return [2 /*return*/, _a.sent()]; - } + return [2 /*return*/, this.contract('COLLATERAL_NFT', nftAddress).isApprovedForAll(owner, operator)]; }); }); }; _this.getNFTCount = function (nftAddr) { return __awaiter(_this, void 0, void 0, function () { @@ -29736,37 +29696,22 @@ function CollateralActions(Base) { } }); }); }; - _this.getNFTData = function (nftAddr, tokenId) { return __awaiter(_this, void 0, void 0, function () { + _this.getNFTData = function (nftAddress, tokenId) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) { - return [2 /*return*/, this.getContract(nftAddr, 'COLLATERAL_NFT').data(tokenId) - // const nft: any = this.eth.contract(this.contractAbis['COLLATERAL_NFT']).at(nftAddr); - // const res = await executeAndRetry(nft.data, [tokenId]); - // return res; - ]; + return [2 /*return*/, this.contract('COLLATERAL_NFT', nftAddress).data(tokenId)]; }); }); }; - _this.getNFTOwner = function (nftAddr, tokenId) { return __awaiter(_this, void 0, void 0, function () { + _this.getNFTOwner = function (nftAddresss, tokenId) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, this.getContract(nftAddr, 'COLLATERAL_NFT').ownerOf(tokenId) - // const nft: any = this.eth.contract(this.contractAbis['COLLATERAL_NFT']).at(nftAddr); - // const res : { 0: BN } = await executeAndRetry(nft.ownerOf, [tokenId]); - // return res[0]; - ]; - case 1: return [2 /*return*/, _a.sent() - // const nft: any = this.eth.contract(this.contractAbis['COLLATERAL_NFT']).at(nftAddr); - // const res : { 0: BN } = await executeAndRetry(nft.ownerOf, [tokenId]); - // return res[0]; - ]; - } + return [2 /*return*/, this.contract('COLLATERAL_NFT', nftAddresss).ownerOf(tokenId)]; }); }); }; - _this.transferNFT = function (nftAddr, from, to, tokenId) { return __awaiter(_this, void 0, void 0, function () { + _this.transferNFT = function (nftAddress, from, to, tokenId) { return __awaiter(_this, void 0, void 0, function () { var nft, txHash; return __generator(this, function (_a) { switch (_a.label) { case 0: - nft = this.eth.contract(this.contractAbis['COLLATERAL_NFT']).at(nftAddr); + nft = this.eth.contract(this.contractAbis['COLLATERAL_NFT']).at(nftAddress); return [4 /*yield*/, executeAndRetry(nft.transferFrom, [from, to, tokenId, this.ethConfig])]; case 1: txHash = _a.sent(); @@ -29788,115 +29733,92 @@ function AnalyticsActions(Base) { var _this = _super !== null && _super.apply(this, arguments) || this; // borrower analytics _this.getTotalDebt = function () { return __awaiter(_this, void 0, void 0, function () { - var res; return __generator(this, function (_a) { switch (_a.label) { - case 0: return [4 /*yield*/, executeAndRetry(this.contracts['PILE'].total, [])]; - case 1: - res = _a.sent(); - return [2 /*return*/, res[0]]; + case 0: return [4 /*yield*/, this.contract('PILE').total()]; + case 1: return [2 /*return*/, (_a.sent()).toBN()]; } }); }); }; _this.getTotalBalance = function () { return __awaiter(_this, void 0, void 0, function () { - var res; return __generator(this, function (_a) { switch (_a.label) { - case 0: return [4 /*yield*/, executeAndRetry(this.contracts['SHELF'].balance, [])]; - case 1: - res = _a.sent(); - return [2 /*return*/, res[0]]; + case 0: return [4 /*yield*/, this.contract('SHELF').balance()]; + case 1: return [2 /*return*/, (_a.sent()).toBN()]; } }); }); }; _this.getPrincipal = function (loanId) { return __awaiter(_this, void 0, void 0, function () { - var res; return __generator(this, function (_a) { switch (_a.label) { - case 0: return [4 /*yield*/, executeAndRetry(this.contracts['CEILING'].ceiling, [loanId])]; - case 1: - res = _a.sent(); - return [2 /*return*/, res ? res[0] : new bn(0)]; + case 0: return [4 /*yield*/, this.contract('CEILING').ceiling(loanId)]; + case 1: return [2 /*return*/, (_a.sent()).toBN()]; } }); }); }; - _this.getDebt = function (loanID) { return __awaiter(_this, void 0, void 0, function () { - var res; + _this.getDebt = function (loanId) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) { switch (_a.label) { - case 0: return [4 /*yield*/, executeAndRetry(this.contracts['PILE'].debt, [loanID])]; - case 1: - res = _a.sent(); - return [2 /*return*/, res ? res[0] : new bn(0)]; + case 0: return [4 /*yield*/, this.contract('PILE').debt(loanId)]; + case 1: return [2 /*return*/, (_a.sent()).toBN()]; } }); }); }; _this.loanCount = function () { return __awaiter(_this, void 0, void 0, function () { - var res; return __generator(this, function (_a) { switch (_a.label) { - case 0: return [4 /*yield*/, executeAndRetry(this.contracts['TITLE'].count, [])]; - case 1: - res = _a.sent(); - return [2 /*return*/, res[0]]; + case 0: return [4 /*yield*/, this.contract('TITLE').count()]; + case 1: return [2 /*return*/, (_a.sent()).toBN()]; } }); }); }; _this.getCollateral = function (loanId) { return __awaiter(_this, void 0, void 0, function () { - var res; return __generator(this, function (_a) { switch (_a.label) { - case 0: return [4 /*yield*/, executeAndRetry(this.contracts['SHELF'].shelf, [loanId])]; - case 1: - res = _a.sent(); - return [2 /*return*/, res]; + case 0: return [4 /*yield*/, this.contract('SHELF').shelf(loanId)]; + case 1: return [2 /*return*/, _a.sent()]; } }); }); }; - _this.getOwnerOfCollateral = function (nftRegistryAddr, tokenId) { return __awaiter(_this, void 0, void 0, function () { + _this.getOwnerOfCollateral = function (nftRegistryAddress, tokenId) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, this.getContract(nftRegistryAddr, 'COLLATERAL_NFT').ownerOf(tokenId) - // const nft: any = this.eth.contract(this.contractAbis['COLLATERAL_NFT']).at(nftRegistryAddr); - // const res : { 0: BN } = await executeAndRetry(nft.ownerOf, [tokenId]); - // return res[0]; - ]; - case 1: return [2 /*return*/, _a.sent() - // const nft: any = this.eth.contract(this.contractAbis['COLLATERAL_NFT']).at(nftRegistryAddr); - // const res : { 0: BN } = await executeAndRetry(nft.ownerOf, [tokenId]); - // return res[0]; - ]; - } + return [2 /*return*/, this.contract('COLLATERAL_NFT', nftRegistryAddress).ownerOf(tokenId)]; }); }); }; _this.getInterestRate = function (loanId) { return __awaiter(_this, void 0, void 0, function () { - var nftId, riskGroupRes, riskGroup, res; + var nftId, riskGroup, resEthers, res; return __generator(this, function (_a) { switch (_a.label) { - case 0: return [4 /*yield*/, executeAndRetry(this.contracts['NFT_FEED'].nftID, [loanId])]; + case 0: return [4 /*yield*/, this.contract('NFT_FEED').nftID(loanId) + // retrieve riskgroup from nft + ]; case 1: - nftId = (_a.sent())[0]; - return [4 /*yield*/, executeAndRetry(this.contracts['NFT_FEED'].risk, [nftId])]; + nftId = _a.sent(); + return [4 /*yield*/, this.contract('NFT_FEED').risk(nftId) + // retrieve rates for this risk group + ]; case 2: - riskGroupRes = _a.sent(); - riskGroup = riskGroupRes[0] || new bn(0); - return [4 /*yield*/, executeAndRetry(this.contracts['PILE'].rates, [riskGroup])]; + riskGroup = _a.sent(); + return [4 /*yield*/, this.contract('PILE').rates(riskGroup)]; case 3: + resEthers = _a.sent(); + console.log('getInterestRate res', resEthers); + return [4 /*yield*/, executeAndRetry(this.contracts['PILE'].rates, [riskGroup])]; + case 4: res = _a.sent(); return [2 /*return*/, res ? res[2] : new bn(0)]; } }); }); }; _this.getOwnerOfLoan = function (loanId) { return __awaiter(_this, void 0, void 0, function () { - var address, res, e_1; + var address, e_1; return __generator(this, function (_a) { switch (_a.label) { case 0: _a.trys.push([0, 2, , 3]); - return [4 /*yield*/, executeAndRetry(this.contracts['TITLE'].ownerOf, [loanId])]; + return [4 /*yield*/, this.contract('TITLE').ownerOf(loanId)]; case 1: - res = _a.sent(); - address = res[0]; + address = _a.sent(); return [3 /*break*/, 3]; case 2: e_1 = _a.sent(); @@ -30044,57 +29966,42 @@ function AnalyticsActions(Base) { }); }); }; _this.getJuniorTokenBalance = function (user) { return __awaiter(_this, void 0, void 0, function () { - var res; return __generator(this, function (_a) { switch (_a.label) { - case 0: return [4 /*yield*/, executeAndRetry(this.contracts['JUNIOR_TOKEN'].balanceOf, [user])]; - case 1: - res = _a.sent(); - return [2 /*return*/, res[0]]; + case 0: return [4 /*yield*/, this.contract('JUNIOR_TOKEN').balanceOf(user)]; + case 1: return [2 /*return*/, (_a.sent()).toBN()]; } }); }); }; - _this.getJuniorTotalSupply = function (user) { return __awaiter(_this, void 0, void 0, function () { - var res; + _this.getJuniorTotalSupply = function () { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) { switch (_a.label) { - case 0: return [4 /*yield*/, executeAndRetry(this.contracts['JUNIOR_TOKEN'].totalSupply, [])]; - case 1: - res = _a.sent(); - return [2 /*return*/, res[0]]; + case 0: return [4 /*yield*/, this.contract('JUNIOR_TOKEN').totalSupply()]; + case 1: return [2 /*return*/, (_a.sent()).toBN()]; } }); }); }; _this.getMaxSupplyAmountJunior = function (user) { return __awaiter(_this, void 0, void 0, function () { - var res; return __generator(this, function (_a) { switch (_a.label) { - case 0: return [4 /*yield*/, executeAndRetry(this.contracts['JUNIOR_OPERATOR'].maxCurrency, [user])]; - case 1: - res = _a.sent(); - return [2 /*return*/, res[0]]; + case 0: return [4 /*yield*/, this.contract('JUNIOR_TOKEN').maxCurrency(user)]; + case 1: return [2 /*return*/, (_a.sent()).toBN()]; } }); }); }; _this.getMaxRedeemAmountJunior = function (user) { return __awaiter(_this, void 0, void 0, function () { - var res; return __generator(this, function (_a) { switch (_a.label) { - case 0: return [4 /*yield*/, executeAndRetry(this.contracts['JUNIOR_OPERATOR'].maxToken, [user])]; - case 1: - res = _a.sent(); - return [2 /*return*/, res[0]]; + case 0: return [4 /*yield*/, this.contract('JUNIOR_TOKEN').maxToken(user)]; + case 1: return [2 /*return*/, (_a.sent()).toBN()]; } }); }); }; _this.getTokenPriceJunior = function () { return __awaiter(_this, void 0, void 0, function () { - var res; return __generator(this, function (_a) { switch (_a.label) { - case 0: return [4 /*yield*/, executeAndRetry(this.contracts['ASSESSOR'].calcTokenPrice, [this.contractAddresses['JUNIOR']])]; - case 1: - res = _a.sent(); - return [2 /*return*/, res[0]]; + case 0: return [4 /*yield*/, this.contract('ASSESSOR').calcTokenPrice(this.contractAddresses['JUNIOR'])]; + case 1: return [2 /*return*/, (_a.sent()).toBN()]; } }); }); }; @@ -30102,37 +30009,29 @@ function AnalyticsActions(Base) { return _this.contractAddresses['SENIOR_OPERATOR'] !== ZERO_ADDRESS; }; _this.getSeniorTokenBalance = function (user) { return __awaiter(_this, void 0, void 0, function () { - var res; return __generator(this, function (_a) { switch (_a.label) { case 0: - if (!this.existsSenior()) { + if (!this.existsSenior()) return [2 /*return*/, new bn(0)]; - } - return [4 /*yield*/, executeAndRetry(this.contracts['SENIOR_TOKEN'].balanceOf, [user])]; - case 1: - res = _a.sent(); - return [2 /*return*/, res[0]]; + return [4 /*yield*/, this.contract('SENIOR_TOKEN').balanceOf(user)]; + case 1: return [2 /*return*/, (_a.sent()).toBN()]; } }); }); }; - _this.getSeniorTotalSupply = function (user) { return __awaiter(_this, void 0, void 0, function () { - var res; + _this.getSeniorTotalSupply = function () { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) { switch (_a.label) { case 0: - if (!this.existsSenior()) { + if (!this.existsSenior()) return [2 /*return*/, new bn(0)]; - } - return [4 /*yield*/, executeAndRetry(this.contracts['SENIOR_TOKEN'].totalSupply, [])]; - case 1: - res = _a.sent(); - return [2 /*return*/, res[0]]; + return [4 /*yield*/, this.contract('SENIOR_TOKEN').totalSupply()]; + case 1: return [2 /*return*/, (_a.sent()).toBN()]; } }); }); }; _this.getMaxSupplyAmountSenior = function (user) { return __awaiter(_this, void 0, void 0, function () { - var operatorType, maxSupply, _a, supplyLimitRes, suppliedRes, res; + var operatorType, maxSupply, _a, supplyLimit, supplied; return __generator(this, function (_b) { switch (_b.label) { case 0: @@ -30145,20 +30044,17 @@ function AnalyticsActions(Base) { case 'ALLOWANCE_OPERATOR': return [3 /*break*/, 4]; } return [3 /*break*/, 6]; - case 1: return [4 /*yield*/, executeAndRetry(this.contracts['SENIOR_OPERATOR'].supplyMaximum, [ - user, - ])]; + case 1: return [4 /*yield*/, this.contract('SENIOR_OPERATOR').supplyMaximum(user)]; case 2: - supplyLimitRes = _b.sent(); - return [4 /*yield*/, executeAndRetry(this.contracts['SENIOR_OPERATOR'].tokenReceived, [user])]; + supplyLimit = (_b.sent()).toBN(); + return [4 /*yield*/, this.contract('SENIOR_OPERATOR').tokenReceived(user)]; case 3: - suppliedRes = _b.sent(); - maxSupply = supplyLimitRes[0].sub(suppliedRes[0]); + supplied = (_b.sent()).toBN(); + maxSupply = supplyLimit.sub(supplied); return [3 /*break*/, 7]; - case 4: return [4 /*yield*/, executeAndRetry(this.contracts['SENIOR_OPERATOR'].maxCurrency, [user])]; + case 4: return [4 /*yield*/, this.contract('SENIOR_OPERATOR').maxCurrency(user)]; case 5: - res = _b.sent(); - maxSupply = res[0]; + maxSupply = (_b.sent()).toBN(); return [3 /*break*/, 7]; case 6: maxSupply = new bn(0); @@ -30248,75 +30144,55 @@ function AnalyticsActions(Base) { }); }); }; _this.getJuniorReserve = function () { return __awaiter(_this, void 0, void 0, function () { - var res; return __generator(this, function (_a) { switch (_a.label) { - case 0: return [4 /*yield*/, executeAndRetry(this.contracts['JUNIOR'].balance, [])]; - case 1: - res = _a.sent(); - return [2 /*return*/, res[0] || new bn(0)]; + case 0: return [4 /*yield*/, this.contract('JUNIOR').balance()]; + case 1: return [2 /*return*/, (_a.sent()).toBN()]; } }); }); }; _this.getMinJuniorRatio = function () { return __awaiter(_this, void 0, void 0, function () { - var res; return __generator(this, function (_a) { switch (_a.label) { - case 0: return [4 /*yield*/, executeAndRetry(this.contracts['ASSESSOR'].minJuniorRatio, [])]; - case 1: - res = _a.sent(); - return [2 /*return*/, res[0] || new bn(0)]; + case 0: return [4 /*yield*/, this.contract('ASSESSOR').minJuniorRatio()]; + case 1: return [2 /*return*/, (_a.sent()).toBN()]; } }); }); }; _this.getCurrentJuniorRatio = function () { return __awaiter(_this, void 0, void 0, function () { - var res; return __generator(this, function (_a) { switch (_a.label) { - case 0: return [4 /*yield*/, executeAndRetry(this.contracts['ASSESSOR'].currentJuniorRatio, [])]; - case 1: - res = _a.sent(); - return [2 /*return*/, res[0] || new bn(0)]; + case 0: return [4 /*yield*/, this.contract('ASSESSOR').currentJuniorRatio()]; + case 1: return [2 /*return*/, (_a.sent()).toBN()]; } }); }); }; _this.getAssetValueJunior = function () { return __awaiter(_this, void 0, void 0, function () { - var res; return __generator(this, function (_a) { switch (_a.label) { - case 0: return [4 /*yield*/, executeAndRetry(this.contracts['ASSESSOR'].calcAssetValue, [ - this.contractAddresses['JUNIOR'], - ])]; - case 1: - res = _a.sent(); - return [2 /*return*/, res[0] || new bn(0)]; + case 0: return [4 /*yield*/, this.contract('ASSESSOR').calcAssetValue(this.contractAddresses['JUNIOR'])]; + case 1: return [2 /*return*/, (_a.sent()).toBN()]; } }); }); }; _this.getSeniorDebt = function () { return __awaiter(_this, void 0, void 0, function () { - var res; return __generator(this, function (_a) { switch (_a.label) { case 0: if (!(this.contractAddresses['SENIOR'] !== ZERO_ADDRESS)) return [3 /*break*/, 2]; - return [4 /*yield*/, executeAndRetry(this.contracts['SENIOR'].debt, [])]; - case 1: - res = _a.sent(); - return [2 /*return*/, res[0] || new bn(0)]; + return [4 /*yield*/, this.contract('SENIOR').debt()]; + case 1: return [2 /*return*/, (_a.sent()).toBN()]; case 2: return [2 /*return*/, new bn(0)]; } }); }); }; _this.getSeniorInterestRate = function () { return __awaiter(_this, void 0, void 0, function () { - var res; return __generator(this, function (_a) { switch (_a.label) { case 0: if (!(this.contractAddresses['SENIOR'] !== ZERO_ADDRESS)) return [3 /*break*/, 2]; - return [4 /*yield*/, executeAndRetry(this.contracts['SENIOR'].ratePerSecond, [])]; - case 1: - res = _a.sent(); - return [2 /*return*/, res[0] || new bn(0)]; + return [4 /*yield*/, this.contract('SENIOR').ratePerSecond()]; + case 1: return [2 /*return*/, (_a.sent()).toBN()]; case 2: return [2 /*return*/, new bn(0)]; } }); @@ -30360,16 +30236,7 @@ function ProxyActions(Base) { var _this = _super !== null && _super.apply(this, arguments) || this; _this.getProxyAccessTokenOwner = function (tokenId) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, this.ethersContracts['PROXY_REGISTRY'].ownerOf(tokenId) - // const res : { 0: BN } = await executeAndRetry(this.contracts['PROXY_REGISTRY'].ownerOf, [tokenId]); - // return res[0]; - ]; - case 1: return [2 /*return*/, _a.sent() - // const res : { 0: BN } = await executeAndRetry(this.contracts['PROXY_REGISTRY'].ownerOf, [tokenId]); - // return res[0]; - ]; - } + return [2 /*return*/, this.contract('PROXY_REGISTRY').ownerOf(tokenId)]; }); }); }; _this.buildProxy = function (owner) { return __awaiter(_this, void 0, void 0, function () { @@ -30398,20 +30265,16 @@ function ProxyActions(Base) { } }); }); }; - _this.getProxyAccessToken = function (proxyAddr) { return __awaiter(_this, void 0, void 0, function () { + _this.getProxyAccessToken = function (proxyAddress) { return __awaiter(_this, void 0, void 0, function () { var proxy, accessToken; return __generator(this, function (_a) { switch (_a.label) { case 0: - proxy = this.getContract(proxyAddr, 'PROXY'); + proxy = this.contract('PROXY', proxyAddress); return [4 /*yield*/, proxy.accessToken()]; case 1: accessToken = _a.sent(); - return [2 /*return*/, accessToken.toNumber() - // const proxy: any = this.eth.contract(this.contractAbis['PROXY']).at(proxyAddr); - // const res = await executeAndRetry(proxy.accessToken, []); - // return res[0].toNumber(); - ]; + return [2 /*return*/, accessToken.toNumber()]; } }); }); }; @@ -30488,54 +30351,36 @@ function ProxyActions(Base) { } }); }); }; - _this.proxyIssue = function (proxyAddr, nftRegistryAddr, tokenId) { return __awaiter(_this, void 0, void 0, function () { - var proxy, encoded, tx; + _this.proxyIssue = function (proxyAddress, nftRegistryAddress, tokenId) { return __awaiter(_this, void 0, void 0, function () { + var proxy, encoded; return __generator(this, function (_a) { - switch (_a.label) { - case 0: - proxy = this.getContract(proxyAddr, 'PROXY'); - encoded = abiCoder$2.encodeFunctionCall({ - name: 'issue', - type: 'function', - inputs: [ - { type: 'address', name: 'shelf' }, - { type: 'address', name: 'registry' }, - { type: 'uint256', name: 'token' }, - ], - }, [this.ethersContracts['SHELF'].address, nftRegistryAddr, tokenId]); - return [4 /*yield*/, proxy.execute(this.ethersContracts['ACTIONS'].address, encoded)]; - case 1: - tx = _a.sent(); - return [2 /*return*/, { - hash: tx.hash, - contractKey: 'PROXY', - }]; - } + proxy = this.contract('PROXY', proxyAddress); + encoded = abiCoder$2.encodeFunctionCall({ + name: 'issue', + type: 'function', + inputs: [ + { type: 'address', name: 'shelf' }, + { type: 'address', name: 'registry' }, + { type: 'uint256', name: 'token' }, + ], + }, [this.contract('SHELF').address, nftRegistryAddress, tokenId]); + return [2 /*return*/, this.pending(proxy.execute(this.contract('ACTIONS').address, encoded))]; }); }); }; - _this.proxyTransferIssue = function (proxyAddr, nftRegistryAddr, tokenId) { return __awaiter(_this, void 0, void 0, function () { - var proxy, encoded, tx; + _this.proxyTransferIssue = function (proxyAddress, nftRegistryAddress, tokenId) { return __awaiter(_this, void 0, void 0, function () { + var proxy, encoded; return __generator(this, function (_a) { - switch (_a.label) { - case 0: - proxy = this.getContract(proxyAddr, 'PROXY'); - encoded = abiCoder$2.encodeFunctionCall({ - name: 'transferIssue', - type: 'function', - inputs: [ - { type: 'address', name: 'shelf' }, - { type: 'address', name: 'registry' }, - { type: 'uint256', name: 'token' }, - ], - }, [this.ethersContracts['SHELF'].address, nftRegistryAddr, tokenId]); - return [4 /*yield*/, proxy.execute(this.ethersContracts['ACTIONS'].address, encoded)]; - case 1: - tx = _a.sent(); - return [2 /*return*/, { - hash: tx.hash, - contractKey: 'PROXY', - }]; - } + proxy = this.contract('PROXY', proxyAddress); + encoded = abiCoder$2.encodeFunctionCall({ + name: 'transferIssue', + type: 'function', + inputs: [ + { type: 'address', name: 'shelf' }, + { type: 'address', name: 'registry' }, + { type: 'uint256', name: 'token' }, + ], + }, [this.contract('SHELF').address, nftRegistryAddress, tokenId]); + return [2 /*return*/, this.pending(proxy.execute(this.contract('ACTIONS').address, encoded))]; }); }); }; _this.proxyLockBorrowWithdraw = function (proxyAddr, loanId, amount, usr) { return __awaiter(_this, void 0, void 0, function () { @@ -47551,13 +47396,13 @@ var Tinlake = /** @class */ (function () { Tinlake.prototype.createContract = function (address, abiName) { return new ethers_2$1.Contract(address, this.contractAbis[abiName], this.ethersConfig.provider); }; - Tinlake.prototype.getContract = function (address, abiName) { - return new ethers_2$1.Contract(address, this.contractAbis[abiName], this.ethersConfig.signer); - }; Tinlake.prototype.contract = function (abiName, address) { if (address) { return new ethers_2$1.Contract(address, this.contractAbis[abiName], this.ethersConfig.signer); } + if (this.ethersConfig.signer) { + return this.ethersContracts[abiName].connect(this.ethersConfig.signer); + } return this.ethersContracts[abiName]; }; Tinlake.prototype.pending = function (txPromise) { diff --git a/dist/index.js b/dist/index.js index 277590e..2fbfce6 100644 --- a/dist/index.js +++ b/dist/index.js @@ -10899,21 +10899,11 @@ function AdminActions(Base) { }); }; // ------------ admin functions lender-site ------------- _this.setMinimumJuniorRatio = function (ratio) { return __awaiter(_this, void 0, void 0, function () { - var tx; + var assessor; return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, this.ethersContracts['ASSESSOR'] - .connect(this.ethersConfig.signer) - .file(web3.fromAscii('minJuniorRatio').padEnd(66, '0'), ratio)]; - case 1: - tx = _a.sent(); - console.log(this.transactionTimeout); - return [2 /*return*/, { - hash: tx.hash, - contractKey: 'ASSESSOR', - timesOutAt: Date.now() + this.transactionTimeout * 1000, - }]; - } + assessor = this.contract('ASSESSOR'); + // Source: https://github.com/ethereum/web3.js/issues/2256#issuecomment-462730550 + return [2 /*return*/, this.pending(assessor.file(web3.fromAscii('minJuniorRatio').padEnd(66, '0'), ratio))]; }); }); }; _this.approveAllowanceJunior = function (user, maxCurrency, maxToken) { return __awaiter(_this, void 0, void 0, function () { @@ -29442,17 +29432,10 @@ function LenderActions(Base) { var _this = _super !== null && _super.apply(this, arguments) || this; // senior tranche functions _this.supplySenior = function (currencyAmount) { return __awaiter(_this, void 0, void 0, function () { - var tx; + var seniorOperator; return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, this.ethersContracts['SENIOR_OPERATOR'].connect(this.ethersConfig.signer).supply(currencyAmount)]; - case 1: - tx = _a.sent(); - return [2 /*return*/, { - hash: tx.hash, - contractKey: 'SENIOR_OPERATOR', - }]; - } + seniorOperator = this.contract('SENIOR_OPERATOR'); + return [2 /*return*/, this.pending(seniorOperator.supply(currencyAmount))]; }); }); }; _this.redeemSenior = function (tokenAmount) { return __awaiter(_this, void 0, void 0, function () { @@ -29499,17 +29482,10 @@ function LenderActions(Base) { }); }; // junior tranche functions _this.supplyJunior = function (currencyAmount) { return __awaiter(_this, void 0, void 0, function () { - var tx; + var juniorOperator; return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, this.ethersContracts['JUNIOR_OPERATOR'].connect(this.ethersConfig.signer).supply(currencyAmount)]; - case 1: - tx = _a.sent(); - return [2 /*return*/, { - hash: tx.hash, - contractKey: 'JUNIOR_OPERATOR', - }]; - } + juniorOperator = this.contract('JUNIOR_OPERATOR'); + return [2 /*return*/, this.pending(juniorOperator.supply(currencyAmount))]; }); }); }; _this.redeemJunior = function (tokenAmount) { return __awaiter(_this, void 0, void 0, function () { @@ -29596,7 +29572,7 @@ function CurrencyActions(Base) { return __generator(this, function (_a) { switch (_a.label) { case 0: - currencyContract = this.getContract(this.contractAddresses['TINLAKE_CURRENCY'], 'TINLAKE_CURRENCY'); + currencyContract = this.contract('TINLAKE_CURRENCY'); return [4 /*yield*/, currencyContract.allowance(owner, spender)]; case 1: allowance = _a.sent(); @@ -29634,7 +29610,7 @@ function CurrencyActions(Base) { return __generator(this, function (_a) { switch (_a.label) { case 0: - currencyContract = this.getContract(this.contractAddresses['TINLAKE_CURRENCY'], 'TINLAKE_CURRENCY'); + currencyContract = this.contract('TINLAKE_CURRENCY'); return [4 /*yield*/, currencyContract.approve(usr, currencyAmount)]; case 1: tx = _a.sent(); @@ -29694,39 +29670,23 @@ function CollateralActions(Base) { return [2 /*return*/, this.pending(nft.mint(owner, tokenId, ref, amount, asset))]; }); }); }; - _this.approveNFT = function (nftAddr, tokenId, to) { return __awaiter(_this, void 0, void 0, function () { - var nft, txHash; + _this.approveNFT = function (nftAddress, tokenId, to) { return __awaiter(_this, void 0, void 0, function () { + var nft; return __generator(this, function (_a) { - switch (_a.label) { - case 0: - nft = this.eth.contract(this.contractAbis['COLLATERAL_NFT']).at(nftAddr); - return [4 /*yield*/, executeAndRetry(nft.approve, [to, tokenId, this.ethConfig])]; - case 1: - txHash = _a.sent(); - console.log("[NFT Approve] txHash: " + txHash); - return [2 /*return*/, waitAndReturnEvents(this.eth, txHash, this.contractAbis['COLLATERAL_NFT'], this.transactionTimeout)]; - } + nft = this.contract('COLLATERAL_NFT', nftAddress); + return [2 /*return*/, this.pending(nft.approve(to, tokenId))]; }); }); }; - _this.setNFTApprovalForAll = function (nftAddr, to, approved) { return __awaiter(_this, void 0, void 0, function () { - var nftContract, tx; + _this.setNFTApprovalForAll = function (nftAddress, to, approved) { return __awaiter(_this, void 0, void 0, function () { + var nft; return __generator(this, function (_a) { - switch (_a.label) { - case 0: - nftContract = this.getContract(nftAddr, 'COLLATERAL_NFT'); - return [4 /*yield*/, nftContract.setApprovalForAll(to, approved)]; - case 1: - tx = _a.sent(); - return [2 /*return*/, this.pending(tx)]; - } + nft = this.contract('COLLATERAL_NFT', nftAddress); + return [2 /*return*/, this.pending(nft.setApprovalForAll(to, approved))]; }); }); }; - _this.isNFTApprovedForAll = function (nftAddr, owner, operator) { return __awaiter(_this, void 0, void 0, function () { + _this.isNFTApprovedForAll = function (nftAddress, owner, operator) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, this.getContract(nftAddr, 'COLLATERAL_NFT').isApprovedForAll(owner, operator)]; - case 1: return [2 /*return*/, _a.sent()]; - } + return [2 /*return*/, this.contract('COLLATERAL_NFT', nftAddress).isApprovedForAll(owner, operator)]; }); }); }; _this.getNFTCount = function (nftAddr) { return __awaiter(_this, void 0, void 0, function () { @@ -29742,37 +29702,22 @@ function CollateralActions(Base) { } }); }); }; - _this.getNFTData = function (nftAddr, tokenId) { return __awaiter(_this, void 0, void 0, function () { + _this.getNFTData = function (nftAddress, tokenId) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) { - return [2 /*return*/, this.getContract(nftAddr, 'COLLATERAL_NFT').data(tokenId) - // const nft: any = this.eth.contract(this.contractAbis['COLLATERAL_NFT']).at(nftAddr); - // const res = await executeAndRetry(nft.data, [tokenId]); - // return res; - ]; + return [2 /*return*/, this.contract('COLLATERAL_NFT', nftAddress).data(tokenId)]; }); }); }; - _this.getNFTOwner = function (nftAddr, tokenId) { return __awaiter(_this, void 0, void 0, function () { + _this.getNFTOwner = function (nftAddresss, tokenId) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, this.getContract(nftAddr, 'COLLATERAL_NFT').ownerOf(tokenId) - // const nft: any = this.eth.contract(this.contractAbis['COLLATERAL_NFT']).at(nftAddr); - // const res : { 0: BN } = await executeAndRetry(nft.ownerOf, [tokenId]); - // return res[0]; - ]; - case 1: return [2 /*return*/, _a.sent() - // const nft: any = this.eth.contract(this.contractAbis['COLLATERAL_NFT']).at(nftAddr); - // const res : { 0: BN } = await executeAndRetry(nft.ownerOf, [tokenId]); - // return res[0]; - ]; - } + return [2 /*return*/, this.contract('COLLATERAL_NFT', nftAddresss).ownerOf(tokenId)]; }); }); }; - _this.transferNFT = function (nftAddr, from, to, tokenId) { return __awaiter(_this, void 0, void 0, function () { + _this.transferNFT = function (nftAddress, from, to, tokenId) { return __awaiter(_this, void 0, void 0, function () { var nft, txHash; return __generator(this, function (_a) { switch (_a.label) { case 0: - nft = this.eth.contract(this.contractAbis['COLLATERAL_NFT']).at(nftAddr); + nft = this.eth.contract(this.contractAbis['COLLATERAL_NFT']).at(nftAddress); return [4 /*yield*/, executeAndRetry(nft.transferFrom, [from, to, tokenId, this.ethConfig])]; case 1: txHash = _a.sent(); @@ -29794,115 +29739,92 @@ function AnalyticsActions(Base) { var _this = _super !== null && _super.apply(this, arguments) || this; // borrower analytics _this.getTotalDebt = function () { return __awaiter(_this, void 0, void 0, function () { - var res; return __generator(this, function (_a) { switch (_a.label) { - case 0: return [4 /*yield*/, executeAndRetry(this.contracts['PILE'].total, [])]; - case 1: - res = _a.sent(); - return [2 /*return*/, res[0]]; + case 0: return [4 /*yield*/, this.contract('PILE').total()]; + case 1: return [2 /*return*/, (_a.sent()).toBN()]; } }); }); }; _this.getTotalBalance = function () { return __awaiter(_this, void 0, void 0, function () { - var res; return __generator(this, function (_a) { switch (_a.label) { - case 0: return [4 /*yield*/, executeAndRetry(this.contracts['SHELF'].balance, [])]; - case 1: - res = _a.sent(); - return [2 /*return*/, res[0]]; + case 0: return [4 /*yield*/, this.contract('SHELF').balance()]; + case 1: return [2 /*return*/, (_a.sent()).toBN()]; } }); }); }; _this.getPrincipal = function (loanId) { return __awaiter(_this, void 0, void 0, function () { - var res; return __generator(this, function (_a) { switch (_a.label) { - case 0: return [4 /*yield*/, executeAndRetry(this.contracts['CEILING'].ceiling, [loanId])]; - case 1: - res = _a.sent(); - return [2 /*return*/, res ? res[0] : new bn(0)]; + case 0: return [4 /*yield*/, this.contract('CEILING').ceiling(loanId)]; + case 1: return [2 /*return*/, (_a.sent()).toBN()]; } }); }); }; - _this.getDebt = function (loanID) { return __awaiter(_this, void 0, void 0, function () { - var res; + _this.getDebt = function (loanId) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) { switch (_a.label) { - case 0: return [4 /*yield*/, executeAndRetry(this.contracts['PILE'].debt, [loanID])]; - case 1: - res = _a.sent(); - return [2 /*return*/, res ? res[0] : new bn(0)]; + case 0: return [4 /*yield*/, this.contract('PILE').debt(loanId)]; + case 1: return [2 /*return*/, (_a.sent()).toBN()]; } }); }); }; _this.loanCount = function () { return __awaiter(_this, void 0, void 0, function () { - var res; return __generator(this, function (_a) { switch (_a.label) { - case 0: return [4 /*yield*/, executeAndRetry(this.contracts['TITLE'].count, [])]; - case 1: - res = _a.sent(); - return [2 /*return*/, res[0]]; + case 0: return [4 /*yield*/, this.contract('TITLE').count()]; + case 1: return [2 /*return*/, (_a.sent()).toBN()]; } }); }); }; _this.getCollateral = function (loanId) { return __awaiter(_this, void 0, void 0, function () { - var res; return __generator(this, function (_a) { switch (_a.label) { - case 0: return [4 /*yield*/, executeAndRetry(this.contracts['SHELF'].shelf, [loanId])]; - case 1: - res = _a.sent(); - return [2 /*return*/, res]; + case 0: return [4 /*yield*/, this.contract('SHELF').shelf(loanId)]; + case 1: return [2 /*return*/, _a.sent()]; } }); }); }; - _this.getOwnerOfCollateral = function (nftRegistryAddr, tokenId) { return __awaiter(_this, void 0, void 0, function () { + _this.getOwnerOfCollateral = function (nftRegistryAddress, tokenId) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, this.getContract(nftRegistryAddr, 'COLLATERAL_NFT').ownerOf(tokenId) - // const nft: any = this.eth.contract(this.contractAbis['COLLATERAL_NFT']).at(nftRegistryAddr); - // const res : { 0: BN } = await executeAndRetry(nft.ownerOf, [tokenId]); - // return res[0]; - ]; - case 1: return [2 /*return*/, _a.sent() - // const nft: any = this.eth.contract(this.contractAbis['COLLATERAL_NFT']).at(nftRegistryAddr); - // const res : { 0: BN } = await executeAndRetry(nft.ownerOf, [tokenId]); - // return res[0]; - ]; - } + return [2 /*return*/, this.contract('COLLATERAL_NFT', nftRegistryAddress).ownerOf(tokenId)]; }); }); }; _this.getInterestRate = function (loanId) { return __awaiter(_this, void 0, void 0, function () { - var nftId, riskGroupRes, riskGroup, res; + var nftId, riskGroup, resEthers, res; return __generator(this, function (_a) { switch (_a.label) { - case 0: return [4 /*yield*/, executeAndRetry(this.contracts['NFT_FEED'].nftID, [loanId])]; + case 0: return [4 /*yield*/, this.contract('NFT_FEED').nftID(loanId) + // retrieve riskgroup from nft + ]; case 1: - nftId = (_a.sent())[0]; - return [4 /*yield*/, executeAndRetry(this.contracts['NFT_FEED'].risk, [nftId])]; + nftId = _a.sent(); + return [4 /*yield*/, this.contract('NFT_FEED').risk(nftId) + // retrieve rates for this risk group + ]; case 2: - riskGroupRes = _a.sent(); - riskGroup = riskGroupRes[0] || new bn(0); - return [4 /*yield*/, executeAndRetry(this.contracts['PILE'].rates, [riskGroup])]; + riskGroup = _a.sent(); + return [4 /*yield*/, this.contract('PILE').rates(riskGroup)]; case 3: + resEthers = _a.sent(); + console.log('getInterestRate res', resEthers); + return [4 /*yield*/, executeAndRetry(this.contracts['PILE'].rates, [riskGroup])]; + case 4: res = _a.sent(); return [2 /*return*/, res ? res[2] : new bn(0)]; } }); }); }; _this.getOwnerOfLoan = function (loanId) { return __awaiter(_this, void 0, void 0, function () { - var address, res, e_1; + var address, e_1; return __generator(this, function (_a) { switch (_a.label) { case 0: _a.trys.push([0, 2, , 3]); - return [4 /*yield*/, executeAndRetry(this.contracts['TITLE'].ownerOf, [loanId])]; + return [4 /*yield*/, this.contract('TITLE').ownerOf(loanId)]; case 1: - res = _a.sent(); - address = res[0]; + address = _a.sent(); return [3 /*break*/, 3]; case 2: e_1 = _a.sent(); @@ -30050,57 +29972,42 @@ function AnalyticsActions(Base) { }); }); }; _this.getJuniorTokenBalance = function (user) { return __awaiter(_this, void 0, void 0, function () { - var res; return __generator(this, function (_a) { switch (_a.label) { - case 0: return [4 /*yield*/, executeAndRetry(this.contracts['JUNIOR_TOKEN'].balanceOf, [user])]; - case 1: - res = _a.sent(); - return [2 /*return*/, res[0]]; + case 0: return [4 /*yield*/, this.contract('JUNIOR_TOKEN').balanceOf(user)]; + case 1: return [2 /*return*/, (_a.sent()).toBN()]; } }); }); }; - _this.getJuniorTotalSupply = function (user) { return __awaiter(_this, void 0, void 0, function () { - var res; + _this.getJuniorTotalSupply = function () { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) { switch (_a.label) { - case 0: return [4 /*yield*/, executeAndRetry(this.contracts['JUNIOR_TOKEN'].totalSupply, [])]; - case 1: - res = _a.sent(); - return [2 /*return*/, res[0]]; + case 0: return [4 /*yield*/, this.contract('JUNIOR_TOKEN').totalSupply()]; + case 1: return [2 /*return*/, (_a.sent()).toBN()]; } }); }); }; _this.getMaxSupplyAmountJunior = function (user) { return __awaiter(_this, void 0, void 0, function () { - var res; return __generator(this, function (_a) { switch (_a.label) { - case 0: return [4 /*yield*/, executeAndRetry(this.contracts['JUNIOR_OPERATOR'].maxCurrency, [user])]; - case 1: - res = _a.sent(); - return [2 /*return*/, res[0]]; + case 0: return [4 /*yield*/, this.contract('JUNIOR_TOKEN').maxCurrency(user)]; + case 1: return [2 /*return*/, (_a.sent()).toBN()]; } }); }); }; _this.getMaxRedeemAmountJunior = function (user) { return __awaiter(_this, void 0, void 0, function () { - var res; return __generator(this, function (_a) { switch (_a.label) { - case 0: return [4 /*yield*/, executeAndRetry(this.contracts['JUNIOR_OPERATOR'].maxToken, [user])]; - case 1: - res = _a.sent(); - return [2 /*return*/, res[0]]; + case 0: return [4 /*yield*/, this.contract('JUNIOR_TOKEN').maxToken(user)]; + case 1: return [2 /*return*/, (_a.sent()).toBN()]; } }); }); }; _this.getTokenPriceJunior = function () { return __awaiter(_this, void 0, void 0, function () { - var res; return __generator(this, function (_a) { switch (_a.label) { - case 0: return [4 /*yield*/, executeAndRetry(this.contracts['ASSESSOR'].calcTokenPrice, [this.contractAddresses['JUNIOR']])]; - case 1: - res = _a.sent(); - return [2 /*return*/, res[0]]; + case 0: return [4 /*yield*/, this.contract('ASSESSOR').calcTokenPrice(this.contractAddresses['JUNIOR'])]; + case 1: return [2 /*return*/, (_a.sent()).toBN()]; } }); }); }; @@ -30108,37 +30015,29 @@ function AnalyticsActions(Base) { return _this.contractAddresses['SENIOR_OPERATOR'] !== ZERO_ADDRESS; }; _this.getSeniorTokenBalance = function (user) { return __awaiter(_this, void 0, void 0, function () { - var res; return __generator(this, function (_a) { switch (_a.label) { case 0: - if (!this.existsSenior()) { + if (!this.existsSenior()) return [2 /*return*/, new bn(0)]; - } - return [4 /*yield*/, executeAndRetry(this.contracts['SENIOR_TOKEN'].balanceOf, [user])]; - case 1: - res = _a.sent(); - return [2 /*return*/, res[0]]; + return [4 /*yield*/, this.contract('SENIOR_TOKEN').balanceOf(user)]; + case 1: return [2 /*return*/, (_a.sent()).toBN()]; } }); }); }; - _this.getSeniorTotalSupply = function (user) { return __awaiter(_this, void 0, void 0, function () { - var res; + _this.getSeniorTotalSupply = function () { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) { switch (_a.label) { case 0: - if (!this.existsSenior()) { + if (!this.existsSenior()) return [2 /*return*/, new bn(0)]; - } - return [4 /*yield*/, executeAndRetry(this.contracts['SENIOR_TOKEN'].totalSupply, [])]; - case 1: - res = _a.sent(); - return [2 /*return*/, res[0]]; + return [4 /*yield*/, this.contract('SENIOR_TOKEN').totalSupply()]; + case 1: return [2 /*return*/, (_a.sent()).toBN()]; } }); }); }; _this.getMaxSupplyAmountSenior = function (user) { return __awaiter(_this, void 0, void 0, function () { - var operatorType, maxSupply, _a, supplyLimitRes, suppliedRes, res; + var operatorType, maxSupply, _a, supplyLimit, supplied; return __generator(this, function (_b) { switch (_b.label) { case 0: @@ -30151,20 +30050,17 @@ function AnalyticsActions(Base) { case 'ALLOWANCE_OPERATOR': return [3 /*break*/, 4]; } return [3 /*break*/, 6]; - case 1: return [4 /*yield*/, executeAndRetry(this.contracts['SENIOR_OPERATOR'].supplyMaximum, [ - user, - ])]; + case 1: return [4 /*yield*/, this.contract('SENIOR_OPERATOR').supplyMaximum(user)]; case 2: - supplyLimitRes = _b.sent(); - return [4 /*yield*/, executeAndRetry(this.contracts['SENIOR_OPERATOR'].tokenReceived, [user])]; + supplyLimit = (_b.sent()).toBN(); + return [4 /*yield*/, this.contract('SENIOR_OPERATOR').tokenReceived(user)]; case 3: - suppliedRes = _b.sent(); - maxSupply = supplyLimitRes[0].sub(suppliedRes[0]); + supplied = (_b.sent()).toBN(); + maxSupply = supplyLimit.sub(supplied); return [3 /*break*/, 7]; - case 4: return [4 /*yield*/, executeAndRetry(this.contracts['SENIOR_OPERATOR'].maxCurrency, [user])]; + case 4: return [4 /*yield*/, this.contract('SENIOR_OPERATOR').maxCurrency(user)]; case 5: - res = _b.sent(); - maxSupply = res[0]; + maxSupply = (_b.sent()).toBN(); return [3 /*break*/, 7]; case 6: maxSupply = new bn(0); @@ -30254,75 +30150,55 @@ function AnalyticsActions(Base) { }); }); }; _this.getJuniorReserve = function () { return __awaiter(_this, void 0, void 0, function () { - var res; return __generator(this, function (_a) { switch (_a.label) { - case 0: return [4 /*yield*/, executeAndRetry(this.contracts['JUNIOR'].balance, [])]; - case 1: - res = _a.sent(); - return [2 /*return*/, res[0] || new bn(0)]; + case 0: return [4 /*yield*/, this.contract('JUNIOR').balance()]; + case 1: return [2 /*return*/, (_a.sent()).toBN()]; } }); }); }; _this.getMinJuniorRatio = function () { return __awaiter(_this, void 0, void 0, function () { - var res; return __generator(this, function (_a) { switch (_a.label) { - case 0: return [4 /*yield*/, executeAndRetry(this.contracts['ASSESSOR'].minJuniorRatio, [])]; - case 1: - res = _a.sent(); - return [2 /*return*/, res[0] || new bn(0)]; + case 0: return [4 /*yield*/, this.contract('ASSESSOR').minJuniorRatio()]; + case 1: return [2 /*return*/, (_a.sent()).toBN()]; } }); }); }; _this.getCurrentJuniorRatio = function () { return __awaiter(_this, void 0, void 0, function () { - var res; return __generator(this, function (_a) { switch (_a.label) { - case 0: return [4 /*yield*/, executeAndRetry(this.contracts['ASSESSOR'].currentJuniorRatio, [])]; - case 1: - res = _a.sent(); - return [2 /*return*/, res[0] || new bn(0)]; + case 0: return [4 /*yield*/, this.contract('ASSESSOR').currentJuniorRatio()]; + case 1: return [2 /*return*/, (_a.sent()).toBN()]; } }); }); }; _this.getAssetValueJunior = function () { return __awaiter(_this, void 0, void 0, function () { - var res; return __generator(this, function (_a) { switch (_a.label) { - case 0: return [4 /*yield*/, executeAndRetry(this.contracts['ASSESSOR'].calcAssetValue, [ - this.contractAddresses['JUNIOR'], - ])]; - case 1: - res = _a.sent(); - return [2 /*return*/, res[0] || new bn(0)]; + case 0: return [4 /*yield*/, this.contract('ASSESSOR').calcAssetValue(this.contractAddresses['JUNIOR'])]; + case 1: return [2 /*return*/, (_a.sent()).toBN()]; } }); }); }; _this.getSeniorDebt = function () { return __awaiter(_this, void 0, void 0, function () { - var res; return __generator(this, function (_a) { switch (_a.label) { case 0: if (!(this.contractAddresses['SENIOR'] !== ZERO_ADDRESS)) return [3 /*break*/, 2]; - return [4 /*yield*/, executeAndRetry(this.contracts['SENIOR'].debt, [])]; - case 1: - res = _a.sent(); - return [2 /*return*/, res[0] || new bn(0)]; + return [4 /*yield*/, this.contract('SENIOR').debt()]; + case 1: return [2 /*return*/, (_a.sent()).toBN()]; case 2: return [2 /*return*/, new bn(0)]; } }); }); }; _this.getSeniorInterestRate = function () { return __awaiter(_this, void 0, void 0, function () { - var res; return __generator(this, function (_a) { switch (_a.label) { case 0: if (!(this.contractAddresses['SENIOR'] !== ZERO_ADDRESS)) return [3 /*break*/, 2]; - return [4 /*yield*/, executeAndRetry(this.contracts['SENIOR'].ratePerSecond, [])]; - case 1: - res = _a.sent(); - return [2 /*return*/, res[0] || new bn(0)]; + return [4 /*yield*/, this.contract('SENIOR').ratePerSecond()]; + case 1: return [2 /*return*/, (_a.sent()).toBN()]; case 2: return [2 /*return*/, new bn(0)]; } }); @@ -30366,16 +30242,7 @@ function ProxyActions(Base) { var _this = _super !== null && _super.apply(this, arguments) || this; _this.getProxyAccessTokenOwner = function (tokenId) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, this.ethersContracts['PROXY_REGISTRY'].ownerOf(tokenId) - // const res : { 0: BN } = await executeAndRetry(this.contracts['PROXY_REGISTRY'].ownerOf, [tokenId]); - // return res[0]; - ]; - case 1: return [2 /*return*/, _a.sent() - // const res : { 0: BN } = await executeAndRetry(this.contracts['PROXY_REGISTRY'].ownerOf, [tokenId]); - // return res[0]; - ]; - } + return [2 /*return*/, this.contract('PROXY_REGISTRY').ownerOf(tokenId)]; }); }); }; _this.buildProxy = function (owner) { return __awaiter(_this, void 0, void 0, function () { @@ -30404,20 +30271,16 @@ function ProxyActions(Base) { } }); }); }; - _this.getProxyAccessToken = function (proxyAddr) { return __awaiter(_this, void 0, void 0, function () { + _this.getProxyAccessToken = function (proxyAddress) { return __awaiter(_this, void 0, void 0, function () { var proxy, accessToken; return __generator(this, function (_a) { switch (_a.label) { case 0: - proxy = this.getContract(proxyAddr, 'PROXY'); + proxy = this.contract('PROXY', proxyAddress); return [4 /*yield*/, proxy.accessToken()]; case 1: accessToken = _a.sent(); - return [2 /*return*/, accessToken.toNumber() - // const proxy: any = this.eth.contract(this.contractAbis['PROXY']).at(proxyAddr); - // const res = await executeAndRetry(proxy.accessToken, []); - // return res[0].toNumber(); - ]; + return [2 /*return*/, accessToken.toNumber()]; } }); }); }; @@ -30494,54 +30357,36 @@ function ProxyActions(Base) { } }); }); }; - _this.proxyIssue = function (proxyAddr, nftRegistryAddr, tokenId) { return __awaiter(_this, void 0, void 0, function () { - var proxy, encoded, tx; + _this.proxyIssue = function (proxyAddress, nftRegistryAddress, tokenId) { return __awaiter(_this, void 0, void 0, function () { + var proxy, encoded; return __generator(this, function (_a) { - switch (_a.label) { - case 0: - proxy = this.getContract(proxyAddr, 'PROXY'); - encoded = abiCoder$2.encodeFunctionCall({ - name: 'issue', - type: 'function', - inputs: [ - { type: 'address', name: 'shelf' }, - { type: 'address', name: 'registry' }, - { type: 'uint256', name: 'token' }, - ], - }, [this.ethersContracts['SHELF'].address, nftRegistryAddr, tokenId]); - return [4 /*yield*/, proxy.execute(this.ethersContracts['ACTIONS'].address, encoded)]; - case 1: - tx = _a.sent(); - return [2 /*return*/, { - hash: tx.hash, - contractKey: 'PROXY', - }]; - } + proxy = this.contract('PROXY', proxyAddress); + encoded = abiCoder$2.encodeFunctionCall({ + name: 'issue', + type: 'function', + inputs: [ + { type: 'address', name: 'shelf' }, + { type: 'address', name: 'registry' }, + { type: 'uint256', name: 'token' }, + ], + }, [this.contract('SHELF').address, nftRegistryAddress, tokenId]); + return [2 /*return*/, this.pending(proxy.execute(this.contract('ACTIONS').address, encoded))]; }); }); }; - _this.proxyTransferIssue = function (proxyAddr, nftRegistryAddr, tokenId) { return __awaiter(_this, void 0, void 0, function () { - var proxy, encoded, tx; + _this.proxyTransferIssue = function (proxyAddress, nftRegistryAddress, tokenId) { return __awaiter(_this, void 0, void 0, function () { + var proxy, encoded; return __generator(this, function (_a) { - switch (_a.label) { - case 0: - proxy = this.getContract(proxyAddr, 'PROXY'); - encoded = abiCoder$2.encodeFunctionCall({ - name: 'transferIssue', - type: 'function', - inputs: [ - { type: 'address', name: 'shelf' }, - { type: 'address', name: 'registry' }, - { type: 'uint256', name: 'token' }, - ], - }, [this.ethersContracts['SHELF'].address, nftRegistryAddr, tokenId]); - return [4 /*yield*/, proxy.execute(this.ethersContracts['ACTIONS'].address, encoded)]; - case 1: - tx = _a.sent(); - return [2 /*return*/, { - hash: tx.hash, - contractKey: 'PROXY', - }]; - } + proxy = this.contract('PROXY', proxyAddress); + encoded = abiCoder$2.encodeFunctionCall({ + name: 'transferIssue', + type: 'function', + inputs: [ + { type: 'address', name: 'shelf' }, + { type: 'address', name: 'registry' }, + { type: 'uint256', name: 'token' }, + ], + }, [this.contract('SHELF').address, nftRegistryAddress, tokenId]); + return [2 /*return*/, this.pending(proxy.execute(this.contract('ACTIONS').address, encoded))]; }); }); }; _this.proxyLockBorrowWithdraw = function (proxyAddr, loanId, amount, usr) { return __awaiter(_this, void 0, void 0, function () { @@ -47557,13 +47402,13 @@ var Tinlake = /** @class */ (function () { Tinlake.prototype.createContract = function (address, abiName) { return new ethers_2$1.Contract(address, this.contractAbis[abiName], this.ethersConfig.provider); }; - Tinlake.prototype.getContract = function (address, abiName) { - return new ethers_2$1.Contract(address, this.contractAbis[abiName], this.ethersConfig.signer); - }; Tinlake.prototype.contract = function (abiName, address) { if (address) { return new ethers_2$1.Contract(address, this.contractAbis[abiName], this.ethersConfig.signer); } + if (this.ethersConfig.signer) { + return this.ethersContracts[abiName].connect(this.ethersConfig.signer); + } return this.ethersContracts[abiName]; }; Tinlake.prototype.pending = function (txPromise) { diff --git a/docs/assets/js/search.js b/docs/assets/js/search.js index 8bc1fee..285b90d 100644 --- a/docs/assets/js/search.js +++ b/docs/assets/js/search.js @@ -1,3 +1,3 @@ var typedoc = typedoc || {}; typedoc.search = typedoc.search || {}; - typedoc.search.data = {"kinds":{"1":"Module","32":"Variable","64":"Function","128":"Class","256":"Interface","512":"Constructor","1024":"Property","2048":"Method","65536":"Type literal","4194304":"Type alias"},"rows":[{"id":0,"kind":1,"name":"\"services/ethereum\"","url":"modules/_services_ethereum_.html","classes":"tsd-kind-module"},{"id":1,"kind":256,"name":"ethI","url":"interfaces/_services_ethereum_.ethi.html","classes":"tsd-kind-interface tsd-parent-kind-module","parent":"\"services/ethereum\""},{"id":2,"kind":1024,"name":"send","url":"interfaces/_services_ethereum_.ethi.html#send","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"services/ethereum\".ethI"},{"id":3,"kind":1024,"name":"web3_sha3","url":"interfaces/_services_ethereum_.ethi.html#web3_sha3","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"services/ethereum\".ethI"},{"id":4,"kind":65536,"name":"__type","url":"interfaces/_services_ethereum_.ethi.html#web3_sha3.__type-3","classes":"tsd-kind-type-literal tsd-parent-kind-property","parent":"\"services/ethereum\".ethI.web3_sha3"},{"id":5,"kind":1024,"name":"getTransactionReceipt","url":"interfaces/_services_ethereum_.ethi.html#gettransactionreceipt","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"services/ethereum\".ethI"},{"id":6,"kind":65536,"name":"__type","url":"interfaces/_services_ethereum_.ethi.html#gettransactionreceipt.__type-2","classes":"tsd-kind-type-literal tsd-parent-kind-property","parent":"\"services/ethereum\".ethI.getTransactionReceipt"},{"id":7,"kind":1024,"name":"getTransactionByHash","url":"interfaces/_services_ethereum_.ethi.html#gettransactionbyhash","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"services/ethereum\".ethI"},{"id":8,"kind":65536,"name":"__type","url":"interfaces/_services_ethereum_.ethi.html#gettransactionbyhash.__type-1","classes":"tsd-kind-type-literal tsd-parent-kind-property","parent":"\"services/ethereum\".ethI.getTransactionByHash"},{"id":9,"kind":1024,"name":"contract","url":"interfaces/_services_ethereum_.ethi.html#contract","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"services/ethereum\".ethI"},{"id":10,"kind":65536,"name":"__type","url":"interfaces/_services_ethereum_.ethi.html#contract.__type","classes":"tsd-kind-type-literal tsd-parent-kind-property","parent":"\"services/ethereum\".ethI.contract"},{"id":11,"kind":1024,"name":"sendRawTransaction","url":"interfaces/_services_ethereum_.ethi.html#sendrawtransaction","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"services/ethereum\".ethI"},{"id":12,"kind":1024,"name":"getTransactionCount","url":"interfaces/_services_ethereum_.ethi.html#gettransactioncount","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"services/ethereum\".ethI"},{"id":13,"kind":1024,"name":"abi","url":"interfaces/_services_ethereum_.ethi.html#abi","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"services/ethereum\".ethI"},{"id":14,"kind":256,"name":"Events","url":"interfaces/_services_ethereum_.events.html","classes":"tsd-kind-interface tsd-parent-kind-module","parent":"\"services/ethereum\""},{"id":15,"kind":1024,"name":"txHash","url":"interfaces/_services_ethereum_.events.html#txhash","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"services/ethereum\".Events"},{"id":16,"kind":1024,"name":"status","url":"interfaces/_services_ethereum_.events.html#status","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"services/ethereum\".Events"},{"id":17,"kind":1024,"name":"events","url":"interfaces/_services_ethereum_.events.html#events","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"services/ethereum\".Events"},{"id":18,"kind":32,"name":"ZERO_ADDRESS","url":"modules/_services_ethereum_.html#zero_address","classes":"tsd-kind-variable tsd-parent-kind-module","parent":"\"services/ethereum\""},{"id":19,"kind":64,"name":"executeAndRetry","url":"modules/_services_ethereum_.html#executeandretry","classes":"tsd-kind-function tsd-parent-kind-module","parent":"\"services/ethereum\""},{"id":20,"kind":64,"name":"waitAndReturnEvents","url":"modules/_services_ethereum_.html#waitandreturnevents","classes":"tsd-kind-function tsd-parent-kind-module","parent":"\"services/ethereum\""},{"id":21,"kind":64,"name":"waitForTransaction","url":"modules/_services_ethereum_.html#waitfortransaction","classes":"tsd-kind-function tsd-parent-kind-module","parent":"\"services/ethereum\""},{"id":22,"kind":64,"name":"findEvent","url":"modules/_services_ethereum_.html#findevent","classes":"tsd-kind-function tsd-parent-kind-module","parent":"\"services/ethereum\""},{"id":23,"kind":1,"name":"\"Tinlake\"","url":"modules/_tinlake_.html","classes":"tsd-kind-module"},{"id":24,"kind":128,"name":"Tinlake","url":"classes/_tinlake_.tinlake.html","classes":"tsd-kind-class tsd-parent-kind-module","parent":"\"Tinlake\""},{"id":25,"kind":1024,"name":"provider","url":"classes/_tinlake_.tinlake.html#provider","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":26,"kind":1024,"name":"eth","url":"classes/_tinlake_.tinlake.html#eth","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":27,"kind":1024,"name":"ethOptions","url":"classes/_tinlake_.tinlake.html#ethoptions","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":28,"kind":1024,"name":"ethConfig","url":"classes/_tinlake_.tinlake.html#ethconfig","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":29,"kind":1024,"name":"ethersConfig","url":"classes/_tinlake_.tinlake.html#ethersconfig","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":30,"kind":1024,"name":"contractAddresses","url":"classes/_tinlake_.tinlake.html#contractaddresses","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":31,"kind":1024,"name":"transactionTimeout","url":"classes/_tinlake_.tinlake.html#transactiontimeout","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":32,"kind":1024,"name":"contracts","url":"classes/_tinlake_.tinlake.html#contracts","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":33,"kind":1024,"name":"ethersContracts","url":"classes/_tinlake_.tinlake.html#etherscontracts","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":34,"kind":1024,"name":"contractAbis","url":"classes/_tinlake_.tinlake.html#contractabis","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":35,"kind":1024,"name":"contractConfig","url":"classes/_tinlake_.tinlake.html#contractconfig","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":36,"kind":512,"name":"constructor","url":"classes/_tinlake_.tinlake.html#constructor","classes":"tsd-kind-constructor tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":37,"kind":2048,"name":"setProvider","url":"classes/_tinlake_.tinlake.html#setprovider","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":38,"kind":2048,"name":"setContracts","url":"classes/_tinlake_.tinlake.html#setcontracts","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":39,"kind":2048,"name":"setEthConfig","url":"classes/_tinlake_.tinlake.html#setethconfig","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":40,"kind":2048,"name":"setEthersConfig","url":"classes/_tinlake_.tinlake.html#setethersconfig","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":41,"kind":2048,"name":"createEthContract","url":"classes/_tinlake_.tinlake.html#createethcontract","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":42,"kind":2048,"name":"createContract","url":"classes/_tinlake_.tinlake.html#createcontract","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":43,"kind":2048,"name":"getContract","url":"classes/_tinlake_.tinlake.html#getcontract","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":44,"kind":2048,"name":"contract","url":"classes/_tinlake_.tinlake.html#contract","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":45,"kind":2048,"name":"pending","url":"classes/_tinlake_.tinlake.html#pending","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":46,"kind":2048,"name":"getTransactionReceipt","url":"classes/_tinlake_.tinlake.html#gettransactionreceipt","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":47,"kind":2048,"name":"getOperatorType","url":"classes/_tinlake_.tinlake.html#getoperatortype","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":48,"kind":4194304,"name":"PendingTransaction","url":"modules/_tinlake_.html#pendingtransaction","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"Tinlake\""},{"id":49,"kind":65536,"name":"__type","url":"modules/_tinlake_.html#pendingtransaction.__type-7","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"Tinlake\".PendingTransaction"},{"id":50,"kind":32,"name":"hash","url":"modules/_tinlake_.html#pendingtransaction.__type-7.hash","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".PendingTransaction.__type"},{"id":51,"kind":32,"name":"timesOutAt","url":"modules/_tinlake_.html#pendingtransaction.__type-7.timesoutat","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".PendingTransaction.__type"},{"id":52,"kind":4194304,"name":"EthConfig","url":"modules/_tinlake_.html#ethconfig","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"Tinlake\""},{"id":53,"kind":65536,"name":"__type","url":"modules/_tinlake_.html#ethconfig.__type-4","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"Tinlake\".EthConfig"},{"id":54,"kind":32,"name":"from","url":"modules/_tinlake_.html#ethconfig.__type-4.from","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".EthConfig.__type"},{"id":55,"kind":32,"name":"gasPrice","url":"modules/_tinlake_.html#ethconfig.__type-4.gasprice","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".EthConfig.__type"},{"id":56,"kind":32,"name":"gas","url":"modules/_tinlake_.html#ethconfig.__type-4.gas","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".EthConfig.__type"},{"id":57,"kind":4194304,"name":"EthersOverrides","url":"modules/_tinlake_.html#ethersoverrides","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"Tinlake\""},{"id":58,"kind":65536,"name":"__type","url":"modules/_tinlake_.html#ethersoverrides.__type-6","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"Tinlake\".EthersOverrides"},{"id":59,"kind":32,"name":"gasPrice","url":"modules/_tinlake_.html#ethersoverrides.__type-6.gasprice-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".EthersOverrides.__type"},{"id":60,"kind":32,"name":"gasLimit","url":"modules/_tinlake_.html#ethersoverrides.__type-6.gaslimit","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".EthersOverrides.__type"},{"id":61,"kind":4194304,"name":"EthersConfig","url":"modules/_tinlake_.html#ethersconfig","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"Tinlake\""},{"id":62,"kind":65536,"name":"__type","url":"modules/_tinlake_.html#ethersconfig.__type-5","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"Tinlake\".EthersConfig"},{"id":63,"kind":32,"name":"provider","url":"modules/_tinlake_.html#ethersconfig.__type-5.provider","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".EthersConfig.__type"},{"id":64,"kind":32,"name":"signer","url":"modules/_tinlake_.html#ethersconfig.__type-5.signer","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".EthersConfig.__type"},{"id":65,"kind":32,"name":"overrides","url":"modules/_tinlake_.html#ethersconfig.__type-5.overrides","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".EthersConfig.__type"},{"id":66,"kind":4194304,"name":"ContractName","url":"modules/_tinlake_.html#contractname","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"Tinlake\""},{"id":67,"kind":4194304,"name":"Contracts","url":"modules/_tinlake_.html#contracts","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"Tinlake\""},{"id":68,"kind":65536,"name":"__type","url":"modules/_tinlake_.html#contracts.__type-3","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"Tinlake\".Contracts"},{"id":69,"kind":4194304,"name":"ContractAbis","url":"modules/_tinlake_.html#contractabis","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"Tinlake\""},{"id":70,"kind":65536,"name":"__type","url":"modules/_tinlake_.html#contractabis.__type-1","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"Tinlake\".ContractAbis"},{"id":71,"kind":4194304,"name":"ContractAddresses","url":"modules/_tinlake_.html#contractaddresses","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"Tinlake\""},{"id":72,"kind":65536,"name":"__type","url":"modules/_tinlake_.html#contractaddresses.__type-2","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"Tinlake\".ContractAddresses"},{"id":73,"kind":4194304,"name":"TinlakeParams","url":"modules/_tinlake_.html#tinlakeparams","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"Tinlake\""},{"id":74,"kind":65536,"name":"__type","url":"modules/_tinlake_.html#tinlakeparams.__type-8","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"Tinlake\".TinlakeParams"},{"id":75,"kind":32,"name":"provider","url":"modules/_tinlake_.html#tinlakeparams.__type-8.provider-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".TinlakeParams.__type"},{"id":76,"kind":32,"name":"transactionTimeout","url":"modules/_tinlake_.html#tinlakeparams.__type-8.transactiontimeout","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".TinlakeParams.__type"},{"id":77,"kind":32,"name":"contractAddresses","url":"modules/_tinlake_.html#tinlakeparams.__type-8.contractaddresses-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".TinlakeParams.__type"},{"id":78,"kind":32,"name":"contractAbis","url":"modules/_tinlake_.html#tinlakeparams.__type-8.contractabis-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".TinlakeParams.__type"},{"id":79,"kind":32,"name":"ethConfig","url":"modules/_tinlake_.html#tinlakeparams.__type-8.ethconfig-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".TinlakeParams.__type"},{"id":80,"kind":32,"name":"ethersConfig","url":"modules/_tinlake_.html#tinlakeparams.__type-8.ethersconfig-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".TinlakeParams.__type"},{"id":81,"kind":32,"name":"ethOptions","url":"modules/_tinlake_.html#tinlakeparams.__type-8.ethoptions","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".TinlakeParams.__type"},{"id":82,"kind":32,"name":"contracts","url":"modules/_tinlake_.html#tinlakeparams.__type-8.contracts-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".TinlakeParams.__type"},{"id":83,"kind":32,"name":"contractConfig","url":"modules/_tinlake_.html#tinlakeparams.__type-8.contractconfig","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".TinlakeParams.__type"},{"id":84,"kind":4194304,"name":"Constructor","url":"modules/_tinlake_.html#constructor","classes":"tsd-kind-type-alias tsd-parent-kind-module tsd-has-type-parameter","parent":"\"Tinlake\""},{"id":85,"kind":65536,"name":"__type","url":"modules/_tinlake_.html#constructor.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"Tinlake\".Constructor"},{"id":86,"kind":1,"name":"\"actions/admin\"","url":"modules/_actions_admin_.html","classes":"tsd-kind-module"},{"id":87,"kind":64,"name":"AdminActions","url":"modules/_actions_admin_.html#adminactions","classes":"tsd-kind-function tsd-parent-kind-module tsd-has-type-parameter","parent":"\"actions/admin\""},{"id":88,"kind":4194304,"name":"IAdminActions","url":"modules/_actions_admin_.html#iadminactions","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"actions/admin\""},{"id":89,"kind":65536,"name":"__type","url":"modules/_actions_admin_.html#iadminactions.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"actions/admin\".IAdminActions"},{"id":90,"kind":64,"name":"isWard","url":"modules/_actions_admin_.html#iadminactions.__type.isward","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":91,"kind":64,"name":"canSetInterestRate","url":"modules/_actions_admin_.html#iadminactions.__type.cansetinterestrate","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":92,"kind":64,"name":"canSetSeniorTrancheInterest","url":"modules/_actions_admin_.html#iadminactions.__type.cansetseniortrancheinterest","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":93,"kind":64,"name":"canSetMinimumJuniorRatio","url":"modules/_actions_admin_.html#iadminactions.__type.cansetminimumjuniorratio","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":94,"kind":64,"name":"canSetRiskScore","url":"modules/_actions_admin_.html#iadminactions.__type.cansetriskscore","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":95,"kind":64,"name":"canSetInvestorAllowanceJunior","url":"modules/_actions_admin_.html#iadminactions.__type.cansetinvestorallowancejunior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":96,"kind":64,"name":"canSetInvestorAllowanceSenior","url":"modules/_actions_admin_.html#iadminactions.__type.cansetinvestorallowancesenior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":97,"kind":64,"name":"canSetLoanPrice","url":"modules/_actions_admin_.html#iadminactions.__type.cansetloanprice","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":98,"kind":64,"name":"initRate","url":"modules/_actions_admin_.html#iadminactions.__type.initrate","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":99,"kind":64,"name":"setRate","url":"modules/_actions_admin_.html#iadminactions.__type.setrate","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":100,"kind":64,"name":"setMinimumJuniorRatio","url":"modules/_actions_admin_.html#iadminactions.__type.setminimumjuniorratio","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":101,"kind":64,"name":"approveAllowanceJunior","url":"modules/_actions_admin_.html#iadminactions.__type.approveallowancejunior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":102,"kind":64,"name":"approveAllowanceSenior","url":"modules/_actions_admin_.html#iadminactions.__type.approveallowancesenior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":103,"kind":1,"name":"\"actions/borrower\"","url":"modules/_actions_borrower_.html","classes":"tsd-kind-module"},{"id":104,"kind":64,"name":"BorrowerActions","url":"modules/_actions_borrower_.html#borroweractions","classes":"tsd-kind-function tsd-parent-kind-module tsd-has-type-parameter","parent":"\"actions/borrower\""},{"id":105,"kind":4194304,"name":"IBorrowerActions","url":"modules/_actions_borrower_.html#iborroweractions","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"actions/borrower\""},{"id":106,"kind":65536,"name":"__type","url":"modules/_actions_borrower_.html#iborroweractions.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"actions/borrower\".IBorrowerActions"},{"id":107,"kind":64,"name":"issue","url":"modules/_actions_borrower_.html#iborroweractions.__type.issue","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/borrower\".IBorrowerActions.__type"},{"id":108,"kind":64,"name":"nftLookup","url":"modules/_actions_borrower_.html#iborroweractions.__type.nftlookup","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/borrower\".IBorrowerActions.__type"},{"id":109,"kind":64,"name":"lock","url":"modules/_actions_borrower_.html#iborroweractions.__type.lock","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/borrower\".IBorrowerActions.__type"},{"id":110,"kind":64,"name":"unlock","url":"modules/_actions_borrower_.html#iborroweractions.__type.unlock","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/borrower\".IBorrowerActions.__type"},{"id":111,"kind":64,"name":"close","url":"modules/_actions_borrower_.html#iborroweractions.__type.close","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/borrower\".IBorrowerActions.__type"},{"id":112,"kind":64,"name":"borrow","url":"modules/_actions_borrower_.html#iborroweractions.__type.borrow","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/borrower\".IBorrowerActions.__type"},{"id":113,"kind":64,"name":"withdraw","url":"modules/_actions_borrower_.html#iborroweractions.__type.withdraw","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/borrower\".IBorrowerActions.__type"},{"id":114,"kind":64,"name":"repay","url":"modules/_actions_borrower_.html#iborroweractions.__type.repay","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/borrower\".IBorrowerActions.__type"},{"id":115,"kind":1,"name":"\"actions/lender\"","url":"modules/_actions_lender_.html","classes":"tsd-kind-module"},{"id":116,"kind":64,"name":"LenderActions","url":"modules/_actions_lender_.html#lenderactions","classes":"tsd-kind-function tsd-parent-kind-module tsd-has-type-parameter","parent":"\"actions/lender\""},{"id":117,"kind":4194304,"name":"ILenderActions","url":"modules/_actions_lender_.html#ilenderactions","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"actions/lender\""},{"id":118,"kind":65536,"name":"__type","url":"modules/_actions_lender_.html#ilenderactions.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"actions/lender\".ILenderActions"},{"id":119,"kind":64,"name":"getSeniorTokenAllowance","url":"modules/_actions_lender_.html#ilenderactions.__type.getseniortokenallowance","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/lender\".ILenderActions.__type"},{"id":120,"kind":64,"name":"getJuniorTokenAllowance","url":"modules/_actions_lender_.html#ilenderactions.__type.getjuniortokenallowance","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/lender\".ILenderActions.__type"},{"id":121,"kind":64,"name":"supplyJunior","url":"modules/_actions_lender_.html#ilenderactions.__type.supplyjunior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/lender\".ILenderActions.__type"},{"id":122,"kind":32,"name":"approveJuniorToken","url":"modules/_actions_lender_.html#ilenderactions.__type.approvejuniortoken","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"actions/lender\".ILenderActions.__type"},{"id":123,"kind":65536,"name":"__type","url":"modules/_actions_lender_.html#ilenderactions.__type.approvejuniortoken.__type-1","classes":"tsd-kind-type-literal tsd-parent-kind-variable","parent":"\"actions/lender\".ILenderActions.__type.approveJuniorToken"},{"id":124,"kind":32,"name":"approveSeniorToken","url":"modules/_actions_lender_.html#ilenderactions.__type.approveseniortoken","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"actions/lender\".ILenderActions.__type"},{"id":125,"kind":65536,"name":"__type","url":"modules/_actions_lender_.html#ilenderactions.__type.approveseniortoken.__type-2","classes":"tsd-kind-type-literal tsd-parent-kind-variable","parent":"\"actions/lender\".ILenderActions.__type.approveSeniorToken"},{"id":126,"kind":64,"name":"redeemJunior","url":"modules/_actions_lender_.html#ilenderactions.__type.redeemjunior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/lender\".ILenderActions.__type"},{"id":127,"kind":64,"name":"supplySenior","url":"modules/_actions_lender_.html#ilenderactions.__type.supplysenior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/lender\".ILenderActions.__type"},{"id":128,"kind":64,"name":"redeemSenior","url":"modules/_actions_lender_.html#ilenderactions.__type.redeemsenior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/lender\".ILenderActions.__type"},{"id":129,"kind":64,"name":"balance","url":"modules/_actions_lender_.html#ilenderactions.__type.balance","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/lender\".ILenderActions.__type"},{"id":130,"kind":1,"name":"\"actions/currency\"","url":"modules/_actions_currency_.html","classes":"tsd-kind-module"},{"id":131,"kind":64,"name":"CurrencyActions","url":"modules/_actions_currency_.html#currencyactions","classes":"tsd-kind-function tsd-parent-kind-module tsd-has-type-parameter","parent":"\"actions/currency\""},{"id":132,"kind":4194304,"name":"ICurrencyActions","url":"modules/_actions_currency_.html#icurrencyactions","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"actions/currency\""},{"id":133,"kind":65536,"name":"__type","url":"modules/_actions_currency_.html#icurrencyactions.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"actions/currency\".ICurrencyActions"},{"id":134,"kind":64,"name":"mintCurrency","url":"modules/_actions_currency_.html#icurrencyactions.__type.mintcurrency","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/currency\".ICurrencyActions.__type"},{"id":135,"kind":64,"name":"getCurrencyBalance","url":"modules/_actions_currency_.html#icurrencyactions.__type.getcurrencybalance","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/currency\".ICurrencyActions.__type"},{"id":136,"kind":32,"name":"getCurrencyAllowance","url":"modules/_actions_currency_.html#icurrencyactions.__type.getcurrencyallowance","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"actions/currency\".ICurrencyActions.__type"},{"id":137,"kind":65536,"name":"__type","url":"modules/_actions_currency_.html#icurrencyactions.__type.getcurrencyallowance.__type-3","classes":"tsd-kind-type-literal tsd-parent-kind-variable","parent":"\"actions/currency\".ICurrencyActions.__type.getCurrencyAllowance"},{"id":138,"kind":32,"name":"getJuniorForCurrencyAllowance","url":"modules/_actions_currency_.html#icurrencyactions.__type.getjuniorforcurrencyallowance","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"actions/currency\".ICurrencyActions.__type"},{"id":139,"kind":65536,"name":"__type","url":"modules/_actions_currency_.html#icurrencyactions.__type.getjuniorforcurrencyallowance.__type-4","classes":"tsd-kind-type-literal tsd-parent-kind-variable","parent":"\"actions/currency\".ICurrencyActions.__type.getJuniorForCurrencyAllowance"},{"id":140,"kind":32,"name":"getSeniorForCurrencyAllowance","url":"modules/_actions_currency_.html#icurrencyactions.__type.getseniorforcurrencyallowance","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"actions/currency\".ICurrencyActions.__type"},{"id":141,"kind":65536,"name":"__type","url":"modules/_actions_currency_.html#icurrencyactions.__type.getseniorforcurrencyallowance.__type-5","classes":"tsd-kind-type-literal tsd-parent-kind-variable","parent":"\"actions/currency\".ICurrencyActions.__type.getSeniorForCurrencyAllowance"},{"id":142,"kind":64,"name":"approveCurrency","url":"modules/_actions_currency_.html#icurrencyactions.__type.approvecurrency","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/currency\".ICurrencyActions.__type"},{"id":143,"kind":32,"name":"approveSeniorForCurrency","url":"modules/_actions_currency_.html#icurrencyactions.__type.approveseniorforcurrency","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"actions/currency\".ICurrencyActions.__type"},{"id":144,"kind":65536,"name":"__type","url":"modules/_actions_currency_.html#icurrencyactions.__type.approveseniorforcurrency.__type-2","classes":"tsd-kind-type-literal tsd-parent-kind-variable","parent":"\"actions/currency\".ICurrencyActions.__type.approveSeniorForCurrency"},{"id":145,"kind":32,"name":"approveJuniorForCurrency","url":"modules/_actions_currency_.html#icurrencyactions.__type.approvejuniorforcurrency","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"actions/currency\".ICurrencyActions.__type"},{"id":146,"kind":65536,"name":"__type","url":"modules/_actions_currency_.html#icurrencyactions.__type.approvejuniorforcurrency.__type-1","classes":"tsd-kind-type-literal tsd-parent-kind-variable","parent":"\"actions/currency\".ICurrencyActions.__type.approveJuniorForCurrency"},{"id":147,"kind":1,"name":"\"actions/collateral\"","url":"modules/_actions_collateral_.html","classes":"tsd-kind-module"},{"id":148,"kind":64,"name":"CollateralActions","url":"modules/_actions_collateral_.html#collateralactions","classes":"tsd-kind-function tsd-parent-kind-module tsd-has-type-parameter","parent":"\"actions/collateral\""},{"id":149,"kind":4194304,"name":"ICollateralActions","url":"modules/_actions_collateral_.html#icollateralactions","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"actions/collateral\""},{"id":150,"kind":65536,"name":"__type","url":"modules/_actions_collateral_.html#icollateralactions.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"actions/collateral\".ICollateralActions"},{"id":151,"kind":64,"name":"mintTitleNFT","url":"modules/_actions_collateral_.html#icollateralactions.__type.minttitlenft","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/collateral\".ICollateralActions.__type"},{"id":152,"kind":64,"name":"mintNFT","url":"modules/_actions_collateral_.html#icollateralactions.__type.mintnft","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/collateral\".ICollateralActions.__type"},{"id":153,"kind":64,"name":"approveNFT","url":"modules/_actions_collateral_.html#icollateralactions.__type.approvenft","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/collateral\".ICollateralActions.__type"},{"id":154,"kind":64,"name":"setNFTApprovalForAll","url":"modules/_actions_collateral_.html#icollateralactions.__type.setnftapprovalforall","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/collateral\".ICollateralActions.__type"},{"id":155,"kind":64,"name":"isNFTApprovedForAll","url":"modules/_actions_collateral_.html#icollateralactions.__type.isnftapprovedforall","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/collateral\".ICollateralActions.__type"},{"id":156,"kind":64,"name":"getNFTCount","url":"modules/_actions_collateral_.html#icollateralactions.__type.getnftcount","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/collateral\".ICollateralActions.__type"},{"id":157,"kind":64,"name":"getNFTData","url":"modules/_actions_collateral_.html#icollateralactions.__type.getnftdata","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/collateral\".ICollateralActions.__type"},{"id":158,"kind":64,"name":"getNFTOwner","url":"modules/_actions_collateral_.html#icollateralactions.__type.getnftowner","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/collateral\".ICollateralActions.__type"},{"id":159,"kind":64,"name":"transferNFT","url":"modules/_actions_collateral_.html#icollateralactions.__type.transfernft","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/collateral\".ICollateralActions.__type"},{"id":160,"kind":1,"name":"\"actions/governance\"","url":"modules/_actions_governance_.html","classes":"tsd-kind-module"},{"id":161,"kind":4194304,"name":"IGovernanceActions","url":"modules/_actions_governance_.html#igovernanceactions","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"actions/governance\""},{"id":162,"kind":65536,"name":"__type","url":"modules/_actions_governance_.html#igovernanceactions.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"actions/governance\".IGovernanceActions"},{"id":163,"kind":64,"name":"relyAddress","url":"modules/_actions_governance_.html#igovernanceactions.__type.relyaddress","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/governance\".IGovernanceActions.__type"},{"id":164,"kind":1,"name":"\"actions/proxy\"","url":"modules/_actions_proxy_.html","classes":"tsd-kind-module"},{"id":165,"kind":64,"name":"ProxyActions","url":"modules/_actions_proxy_.html#proxyactions","classes":"tsd-kind-function tsd-parent-kind-module tsd-has-type-parameter","parent":"\"actions/proxy\""},{"id":166,"kind":4194304,"name":"IProxyActions","url":"modules/_actions_proxy_.html#iproxyactions","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"actions/proxy\""},{"id":167,"kind":65536,"name":"__type","url":"modules/_actions_proxy_.html#iproxyactions.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"actions/proxy\".IProxyActions"},{"id":168,"kind":64,"name":"buildProxy","url":"modules/_actions_proxy_.html#iproxyactions.__type.buildproxy","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":169,"kind":64,"name":"checkProxyExists","url":"modules/_actions_proxy_.html#iproxyactions.__type.checkproxyexists","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":170,"kind":64,"name":"getProxy","url":"modules/_actions_proxy_.html#iproxyactions.__type.getproxy","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":171,"kind":64,"name":"proxyCount","url":"modules/_actions_proxy_.html#iproxyactions.__type.proxycount","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":172,"kind":64,"name":"getProxyAccessToken","url":"modules/_actions_proxy_.html#iproxyactions.__type.getproxyaccesstoken","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":173,"kind":64,"name":"getProxyAccessTokenOwner","url":"modules/_actions_proxy_.html#iproxyactions.__type.getproxyaccesstokenowner","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":174,"kind":64,"name":"getProxyOwnerByLoan","url":"modules/_actions_proxy_.html#iproxyactions.__type.getproxyownerbyloan","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":175,"kind":64,"name":"getProxyOwnerByAddress","url":"modules/_actions_proxy_.html#iproxyactions.__type.getproxyownerbyaddress","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":176,"kind":64,"name":"proxyCreateNew","url":"modules/_actions_proxy_.html#iproxyactions.__type.proxycreatenew","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":177,"kind":64,"name":"proxyIssue","url":"modules/_actions_proxy_.html#iproxyactions.__type.proxyissue","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":178,"kind":64,"name":"proxyTransferIssue","url":"modules/_actions_proxy_.html#iproxyactions.__type.proxytransferissue","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":179,"kind":64,"name":"proxyLockBorrowWithdraw","url":"modules/_actions_proxy_.html#iproxyactions.__type.proxylockborrowwithdraw","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":180,"kind":64,"name":"proxyRepayUnlockClose","url":"modules/_actions_proxy_.html#iproxyactions.__type.proxyrepayunlockclose","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":181,"kind":1,"name":"\"actions/index\"","url":"modules/_actions_index_.html","classes":"tsd-kind-module"},{"id":182,"kind":4194304,"name":"TinlakeActions","url":"modules/_actions_index_.html#tinlakeactions","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"actions/index\""},{"id":183,"kind":1,"name":"\"types/tinlake\"","url":"modules/_types_tinlake_.html","classes":"tsd-kind-module"},{"id":184,"kind":4194304,"name":"Loan","url":"modules/_types_tinlake_.html#loan","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"types/tinlake\""},{"id":185,"kind":65536,"name":"__type","url":"modules/_types_tinlake_.html#loan.__type-3","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"types/tinlake\".Loan"},{"id":186,"kind":32,"name":"loanId","url":"modules/_types_tinlake_.html#loan.__type-3.loanid","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":187,"kind":32,"name":"registry","url":"modules/_types_tinlake_.html#loan.__type-3.registry","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":188,"kind":32,"name":"tokenId","url":"modules/_types_tinlake_.html#loan.__type-3.tokenid","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":189,"kind":32,"name":"ownerOf","url":"modules/_types_tinlake_.html#loan.__type-3.ownerof","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":190,"kind":32,"name":"principal","url":"modules/_types_tinlake_.html#loan.__type-3.principal","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":191,"kind":32,"name":"interestRate","url":"modules/_types_tinlake_.html#loan.__type-3.interestrate","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":192,"kind":32,"name":"debt","url":"modules/_types_tinlake_.html#loan.__type-3.debt","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":193,"kind":32,"name":"threshold","url":"modules/_types_tinlake_.html#loan.__type-3.threshold","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":194,"kind":32,"name":"price","url":"modules/_types_tinlake_.html#loan.__type-3.price","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":195,"kind":32,"name":"status","url":"modules/_types_tinlake_.html#loan.__type-3.status","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":196,"kind":32,"name":"nft","url":"modules/_types_tinlake_.html#loan.__type-3.nft","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":197,"kind":32,"name":"proxyOwner","url":"modules/_types_tinlake_.html#loan.__type-3.proxyowner","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":198,"kind":4194304,"name":"Tranche","url":"modules/_types_tinlake_.html#tranche","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"types/tinlake\""},{"id":199,"kind":65536,"name":"__type","url":"modules/_types_tinlake_.html#tranche.__type-5","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"types/tinlake\".Tranche"},{"id":200,"kind":32,"name":"availableFunds","url":"modules/_types_tinlake_.html#tranche.__type-5.availablefunds","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Tranche.__type"},{"id":201,"kind":32,"name":"tokenPrice","url":"modules/_types_tinlake_.html#tranche.__type-5.tokenprice","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Tranche.__type"},{"id":202,"kind":32,"name":"type","url":"modules/_types_tinlake_.html#tranche.__type-5.type","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Tranche.__type"},{"id":203,"kind":32,"name":"token","url":"modules/_types_tinlake_.html#tranche.__type-5.token","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Tranche.__type"},{"id":204,"kind":32,"name":"totalSupply","url":"modules/_types_tinlake_.html#tranche.__type-5.totalsupply","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Tranche.__type"},{"id":205,"kind":32,"name":"interestRate","url":"modules/_types_tinlake_.html#tranche.__type-5.interestrate-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Tranche.__type"},{"id":206,"kind":4194304,"name":"NFT","url":"modules/_types_tinlake_.html#nft-1","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"types/tinlake\""},{"id":207,"kind":65536,"name":"__type","url":"modules/_types_tinlake_.html#nft-1.__type-4","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"types/tinlake\".NFT"},{"id":208,"kind":32,"name":"registry","url":"modules/_types_tinlake_.html#nft-1.__type-4.registry-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".NFT.__type"},{"id":209,"kind":32,"name":"tokenId","url":"modules/_types_tinlake_.html#nft-1.__type-4.tokenid-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".NFT.__type"},{"id":210,"kind":32,"name":"nftOwner","url":"modules/_types_tinlake_.html#nft-1.__type-4.nftowner","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".NFT.__type"},{"id":211,"kind":32,"name":"nftData","url":"modules/_types_tinlake_.html#nft-1.__type-4.nftdata","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".NFT.__type"},{"id":212,"kind":4194304,"name":"Investor","url":"modules/_types_tinlake_.html#investor","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"types/tinlake\""},{"id":213,"kind":65536,"name":"__type","url":"modules/_types_tinlake_.html#investor.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"types/tinlake\".Investor"},{"id":214,"kind":32,"name":"junior","url":"modules/_types_tinlake_.html#investor.__type.junior","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Investor.__type"},{"id":215,"kind":65536,"name":"__type","url":"modules/_types_tinlake_.html#investor.__type.junior.__type-1","classes":"tsd-kind-type-literal tsd-parent-kind-variable","parent":"\"types/tinlake\".Investor.__type.junior"},{"id":216,"kind":32,"name":"maxSupply","url":"modules/_types_tinlake_.html#investor.__type.junior.__type-1.maxsupply","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Investor.__type.junior.__type"},{"id":217,"kind":32,"name":"tokenBalance","url":"modules/_types_tinlake_.html#investor.__type.junior.__type-1.tokenbalance","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Investor.__type.junior.__type"},{"id":218,"kind":32,"name":"maxRedeem","url":"modules/_types_tinlake_.html#investor.__type.junior.__type-1.maxredeem","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Investor.__type.junior.__type"},{"id":219,"kind":32,"name":"senior","url":"modules/_types_tinlake_.html#investor.__type.senior","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Investor.__type"},{"id":220,"kind":65536,"name":"__type","url":"modules/_types_tinlake_.html#investor.__type.senior.__type-2","classes":"tsd-kind-type-literal tsd-parent-kind-variable","parent":"\"types/tinlake\".Investor.__type.senior"},{"id":221,"kind":32,"name":"maxSupply","url":"modules/_types_tinlake_.html#investor.__type.senior.__type-2.maxsupply-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Investor.__type.senior.__type"},{"id":222,"kind":32,"name":"tokenBalance","url":"modules/_types_tinlake_.html#investor.__type.senior.__type-2.tokenbalance-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Investor.__type.senior.__type"},{"id":223,"kind":32,"name":"maxRedeem","url":"modules/_types_tinlake_.html#investor.__type.senior.__type-2.maxredeem-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Investor.__type.senior.__type"},{"id":224,"kind":32,"name":"address","url":"modules/_types_tinlake_.html#investor.__type.address","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Investor.__type"},{"id":225,"kind":4194304,"name":"ITinlake","url":"modules/_types_tinlake_.html#itinlake","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"types/tinlake\""},{"id":226,"kind":1,"name":"\"actions/analytics\"","url":"modules/_actions_analytics_.html","classes":"tsd-kind-module"},{"id":227,"kind":64,"name":"AnalyticsActions","url":"modules/_actions_analytics_.html#analyticsactions","classes":"tsd-kind-function tsd-parent-kind-module tsd-has-type-parameter","parent":"\"actions/analytics\""},{"id":228,"kind":4194304,"name":"IAnalyticsActions","url":"modules/_actions_analytics_.html#ianalyticsactions","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"actions/analytics\""},{"id":229,"kind":65536,"name":"__type","url":"modules/_actions_analytics_.html#ianalyticsactions.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"actions/analytics\".IAnalyticsActions"},{"id":230,"kind":64,"name":"getTotalDebt","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.gettotaldebt","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":231,"kind":64,"name":"getTotalBalance","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.gettotalbalance","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":232,"kind":64,"name":"getDebt","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getdebt","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":233,"kind":64,"name":"loanCount","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.loancount","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":234,"kind":64,"name":"getLoanList","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getloanlist","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":235,"kind":64,"name":"getLoan","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getloan","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":236,"kind":64,"name":"getCollateral","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getcollateral","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":237,"kind":64,"name":"getPrincipal","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getprincipal","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":238,"kind":64,"name":"getInterestRate","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getinterestrate","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":239,"kind":64,"name":"getOwnerOfLoan","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getownerofloan","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":240,"kind":64,"name":"getOwnerOfCollateral","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getownerofcollateral","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":241,"kind":64,"name":"existsSenior","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.existssenior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":242,"kind":64,"name":"getJuniorReserve","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getjuniorreserve","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":243,"kind":64,"name":"getSeniorReserve","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getseniorreserve","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":244,"kind":64,"name":"getJuniorTokenBalance","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getjuniortokenbalance","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":245,"kind":64,"name":"getSeniorTokenBalance","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getseniortokenbalance","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":246,"kind":64,"name":"getMaxSupplyAmountJunior","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getmaxsupplyamountjunior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":247,"kind":64,"name":"getMaxRedeemAmountJunior","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getmaxredeemamountjunior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":248,"kind":64,"name":"getMaxSupplyAmountSenior","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getmaxsupplyamountsenior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":249,"kind":64,"name":"getMaxRedeemAmountSenior","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getmaxredeemamountsenior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":250,"kind":64,"name":"getTokenPriceJunior","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.gettokenpricejunior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":251,"kind":64,"name":"getTokenPriceSenior","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.gettokenpricesenior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":252,"kind":64,"name":"getSeniorDebt","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getseniordebt","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":253,"kind":64,"name":"getSeniorInterestRate","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getseniorinterestrate","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":254,"kind":64,"name":"getMinJuniorRatio","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getminjuniorratio","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":255,"kind":64,"name":"getCurrentJuniorRatio","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getcurrentjuniorratio","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":256,"kind":64,"name":"getAssetValueJunior","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getassetvaluejunior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":257,"kind":64,"name":"getInvestor","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getinvestor","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":258,"kind":1,"name":"\"utils/baseToDisplay\"","url":"modules/_utils_basetodisplay_.html","classes":"tsd-kind-module"},{"id":259,"kind":64,"name":"baseToDisplay","url":"modules/_utils_basetodisplay_.html#basetodisplay","classes":"tsd-kind-function tsd-parent-kind-module","parent":"\"utils/baseToDisplay\""},{"id":260,"kind":1,"name":"\"utils/baseToDisplay.spec\"","url":"modules/_utils_basetodisplay_spec_.html","classes":"tsd-kind-module"},{"id":261,"kind":1,"name":"\"utils/bnToHex\"","url":"modules/_utils_bntohex_.html","classes":"tsd-kind-module"},{"id":262,"kind":64,"name":"bnToHex","url":"modules/_utils_bntohex_.html#bntohex","classes":"tsd-kind-function tsd-parent-kind-module","parent":"\"utils/bnToHex\""},{"id":263,"kind":1,"name":"\"utils/bnToHex.spec\"","url":"modules/_utils_bntohex_spec_.html","classes":"tsd-kind-module"},{"id":264,"kind":1,"name":"\"utils/displayToBase\"","url":"modules/_utils_displaytobase_.html","classes":"tsd-kind-module"},{"id":265,"kind":64,"name":"displayToBase","url":"modules/_utils_displaytobase_.html#displaytobase","classes":"tsd-kind-function tsd-parent-kind-module","parent":"\"utils/displayToBase\""},{"id":266,"kind":1,"name":"\"utils/displayToBase.spec\"","url":"modules/_utils_displaytobase_spec_.html","classes":"tsd-kind-module"},{"id":267,"kind":1,"name":"\"utils/feeToInterestRate\"","url":"modules/_utils_feetointerestrate_.html","classes":"tsd-kind-module"},{"id":268,"kind":64,"name":"feeToInterestRate","url":"modules/_utils_feetointerestrate_.html#feetointerestrate","classes":"tsd-kind-function tsd-parent-kind-module","parent":"\"utils/feeToInterestRate\""},{"id":269,"kind":1,"name":"\"utils/feeToInterestRate.spec\"","url":"modules/_utils_feetointerestrate_spec_.html","classes":"tsd-kind-module"},{"id":270,"kind":1,"name":"\"utils/getLoanStatus\"","url":"modules/_utils_getloanstatus_.html","classes":"tsd-kind-module"},{"id":271,"kind":4194304,"name":"LoanStatus","url":"modules/_utils_getloanstatus_.html#loanstatus","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"utils/getLoanStatus\""},{"id":272,"kind":64,"name":"getLoanStatus","url":"modules/_utils_getloanstatus_.html#getloanstatus","classes":"tsd-kind-function tsd-parent-kind-module","parent":"\"utils/getLoanStatus\""},{"id":273,"kind":1,"name":"\"utils/interestRateToFee\"","url":"modules/_utils_interestratetofee_.html","classes":"tsd-kind-module"},{"id":274,"kind":64,"name":"interestRateToFee","url":"modules/_utils_interestratetofee_.html#interestratetofee","classes":"tsd-kind-function tsd-parent-kind-module","parent":"\"utils/interestRateToFee\""},{"id":275,"kind":1,"name":"\"utils/interestRateToFee.spec\"","url":"modules/_utils_interestratetofee_spec_.html","classes":"tsd-kind-module"}]}; \ No newline at end of file + typedoc.search.data = {"kinds":{"1":"Module","32":"Variable","64":"Function","128":"Class","256":"Interface","512":"Constructor","1024":"Property","2048":"Method","65536":"Type literal","4194304":"Type alias"},"rows":[{"id":0,"kind":1,"name":"\"services/ethereum\"","url":"modules/_services_ethereum_.html","classes":"tsd-kind-module"},{"id":1,"kind":256,"name":"ethI","url":"interfaces/_services_ethereum_.ethi.html","classes":"tsd-kind-interface tsd-parent-kind-module","parent":"\"services/ethereum\""},{"id":2,"kind":1024,"name":"send","url":"interfaces/_services_ethereum_.ethi.html#send","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"services/ethereum\".ethI"},{"id":3,"kind":1024,"name":"web3_sha3","url":"interfaces/_services_ethereum_.ethi.html#web3_sha3","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"services/ethereum\".ethI"},{"id":4,"kind":65536,"name":"__type","url":"interfaces/_services_ethereum_.ethi.html#web3_sha3.__type-3","classes":"tsd-kind-type-literal tsd-parent-kind-property","parent":"\"services/ethereum\".ethI.web3_sha3"},{"id":5,"kind":1024,"name":"getTransactionReceipt","url":"interfaces/_services_ethereum_.ethi.html#gettransactionreceipt","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"services/ethereum\".ethI"},{"id":6,"kind":65536,"name":"__type","url":"interfaces/_services_ethereum_.ethi.html#gettransactionreceipt.__type-2","classes":"tsd-kind-type-literal tsd-parent-kind-property","parent":"\"services/ethereum\".ethI.getTransactionReceipt"},{"id":7,"kind":1024,"name":"getTransactionByHash","url":"interfaces/_services_ethereum_.ethi.html#gettransactionbyhash","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"services/ethereum\".ethI"},{"id":8,"kind":65536,"name":"__type","url":"interfaces/_services_ethereum_.ethi.html#gettransactionbyhash.__type-1","classes":"tsd-kind-type-literal tsd-parent-kind-property","parent":"\"services/ethereum\".ethI.getTransactionByHash"},{"id":9,"kind":1024,"name":"contract","url":"interfaces/_services_ethereum_.ethi.html#contract","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"services/ethereum\".ethI"},{"id":10,"kind":65536,"name":"__type","url":"interfaces/_services_ethereum_.ethi.html#contract.__type","classes":"tsd-kind-type-literal tsd-parent-kind-property","parent":"\"services/ethereum\".ethI.contract"},{"id":11,"kind":1024,"name":"sendRawTransaction","url":"interfaces/_services_ethereum_.ethi.html#sendrawtransaction","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"services/ethereum\".ethI"},{"id":12,"kind":1024,"name":"getTransactionCount","url":"interfaces/_services_ethereum_.ethi.html#gettransactioncount","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"services/ethereum\".ethI"},{"id":13,"kind":1024,"name":"abi","url":"interfaces/_services_ethereum_.ethi.html#abi","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"services/ethereum\".ethI"},{"id":14,"kind":256,"name":"Events","url":"interfaces/_services_ethereum_.events.html","classes":"tsd-kind-interface tsd-parent-kind-module","parent":"\"services/ethereum\""},{"id":15,"kind":1024,"name":"txHash","url":"interfaces/_services_ethereum_.events.html#txhash","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"services/ethereum\".Events"},{"id":16,"kind":1024,"name":"status","url":"interfaces/_services_ethereum_.events.html#status","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"services/ethereum\".Events"},{"id":17,"kind":1024,"name":"events","url":"interfaces/_services_ethereum_.events.html#events","classes":"tsd-kind-property tsd-parent-kind-interface","parent":"\"services/ethereum\".Events"},{"id":18,"kind":32,"name":"ZERO_ADDRESS","url":"modules/_services_ethereum_.html#zero_address","classes":"tsd-kind-variable tsd-parent-kind-module","parent":"\"services/ethereum\""},{"id":19,"kind":64,"name":"executeAndRetry","url":"modules/_services_ethereum_.html#executeandretry","classes":"tsd-kind-function tsd-parent-kind-module","parent":"\"services/ethereum\""},{"id":20,"kind":64,"name":"waitAndReturnEvents","url":"modules/_services_ethereum_.html#waitandreturnevents","classes":"tsd-kind-function tsd-parent-kind-module","parent":"\"services/ethereum\""},{"id":21,"kind":64,"name":"waitForTransaction","url":"modules/_services_ethereum_.html#waitfortransaction","classes":"tsd-kind-function tsd-parent-kind-module","parent":"\"services/ethereum\""},{"id":22,"kind":64,"name":"findEvent","url":"modules/_services_ethereum_.html#findevent","classes":"tsd-kind-function tsd-parent-kind-module","parent":"\"services/ethereum\""},{"id":23,"kind":1,"name":"\"Tinlake\"","url":"modules/_tinlake_.html","classes":"tsd-kind-module"},{"id":24,"kind":128,"name":"Tinlake","url":"classes/_tinlake_.tinlake.html","classes":"tsd-kind-class tsd-parent-kind-module","parent":"\"Tinlake\""},{"id":25,"kind":1024,"name":"provider","url":"classes/_tinlake_.tinlake.html#provider","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":26,"kind":1024,"name":"eth","url":"classes/_tinlake_.tinlake.html#eth","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":27,"kind":1024,"name":"ethOptions","url":"classes/_tinlake_.tinlake.html#ethoptions","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":28,"kind":1024,"name":"ethConfig","url":"classes/_tinlake_.tinlake.html#ethconfig","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":29,"kind":1024,"name":"ethersConfig","url":"classes/_tinlake_.tinlake.html#ethersconfig","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":30,"kind":1024,"name":"contractAddresses","url":"classes/_tinlake_.tinlake.html#contractaddresses","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":31,"kind":1024,"name":"transactionTimeout","url":"classes/_tinlake_.tinlake.html#transactiontimeout","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":32,"kind":1024,"name":"contracts","url":"classes/_tinlake_.tinlake.html#contracts","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":33,"kind":1024,"name":"ethersContracts","url":"classes/_tinlake_.tinlake.html#etherscontracts","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":34,"kind":1024,"name":"contractAbis","url":"classes/_tinlake_.tinlake.html#contractabis","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":35,"kind":1024,"name":"contractConfig","url":"classes/_tinlake_.tinlake.html#contractconfig","classes":"tsd-kind-property tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":36,"kind":512,"name":"constructor","url":"classes/_tinlake_.tinlake.html#constructor","classes":"tsd-kind-constructor tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":37,"kind":2048,"name":"setProvider","url":"classes/_tinlake_.tinlake.html#setprovider","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":38,"kind":2048,"name":"setContracts","url":"classes/_tinlake_.tinlake.html#setcontracts","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":39,"kind":2048,"name":"setEthConfig","url":"classes/_tinlake_.tinlake.html#setethconfig","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":40,"kind":2048,"name":"setEthersConfig","url":"classes/_tinlake_.tinlake.html#setethersconfig","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":41,"kind":2048,"name":"createEthContract","url":"classes/_tinlake_.tinlake.html#createethcontract","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":42,"kind":2048,"name":"createContract","url":"classes/_tinlake_.tinlake.html#createcontract","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":43,"kind":2048,"name":"contract","url":"classes/_tinlake_.tinlake.html#contract","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":44,"kind":2048,"name":"pending","url":"classes/_tinlake_.tinlake.html#pending","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":45,"kind":2048,"name":"getTransactionReceipt","url":"classes/_tinlake_.tinlake.html#gettransactionreceipt","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":46,"kind":2048,"name":"getOperatorType","url":"classes/_tinlake_.tinlake.html#getoperatortype","classes":"tsd-kind-method tsd-parent-kind-class","parent":"\"Tinlake\".Tinlake"},{"id":47,"kind":4194304,"name":"PendingTransaction","url":"modules/_tinlake_.html#pendingtransaction","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"Tinlake\""},{"id":48,"kind":65536,"name":"__type","url":"modules/_tinlake_.html#pendingtransaction.__type-7","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"Tinlake\".PendingTransaction"},{"id":49,"kind":32,"name":"hash","url":"modules/_tinlake_.html#pendingtransaction.__type-7.hash","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".PendingTransaction.__type"},{"id":50,"kind":32,"name":"timesOutAt","url":"modules/_tinlake_.html#pendingtransaction.__type-7.timesoutat","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".PendingTransaction.__type"},{"id":51,"kind":4194304,"name":"EthConfig","url":"modules/_tinlake_.html#ethconfig","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"Tinlake\""},{"id":52,"kind":65536,"name":"__type","url":"modules/_tinlake_.html#ethconfig.__type-4","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"Tinlake\".EthConfig"},{"id":53,"kind":32,"name":"from","url":"modules/_tinlake_.html#ethconfig.__type-4.from","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".EthConfig.__type"},{"id":54,"kind":32,"name":"gasPrice","url":"modules/_tinlake_.html#ethconfig.__type-4.gasprice","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".EthConfig.__type"},{"id":55,"kind":32,"name":"gas","url":"modules/_tinlake_.html#ethconfig.__type-4.gas","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".EthConfig.__type"},{"id":56,"kind":4194304,"name":"EthersOverrides","url":"modules/_tinlake_.html#ethersoverrides","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"Tinlake\""},{"id":57,"kind":65536,"name":"__type","url":"modules/_tinlake_.html#ethersoverrides.__type-6","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"Tinlake\".EthersOverrides"},{"id":58,"kind":32,"name":"gasPrice","url":"modules/_tinlake_.html#ethersoverrides.__type-6.gasprice-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".EthersOverrides.__type"},{"id":59,"kind":32,"name":"gasLimit","url":"modules/_tinlake_.html#ethersoverrides.__type-6.gaslimit","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".EthersOverrides.__type"},{"id":60,"kind":4194304,"name":"EthersConfig","url":"modules/_tinlake_.html#ethersconfig","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"Tinlake\""},{"id":61,"kind":65536,"name":"__type","url":"modules/_tinlake_.html#ethersconfig.__type-5","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"Tinlake\".EthersConfig"},{"id":62,"kind":32,"name":"provider","url":"modules/_tinlake_.html#ethersconfig.__type-5.provider","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".EthersConfig.__type"},{"id":63,"kind":32,"name":"signer","url":"modules/_tinlake_.html#ethersconfig.__type-5.signer","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".EthersConfig.__type"},{"id":64,"kind":32,"name":"overrides","url":"modules/_tinlake_.html#ethersconfig.__type-5.overrides","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".EthersConfig.__type"},{"id":65,"kind":4194304,"name":"ContractName","url":"modules/_tinlake_.html#contractname","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"Tinlake\""},{"id":66,"kind":4194304,"name":"Contracts","url":"modules/_tinlake_.html#contracts","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"Tinlake\""},{"id":67,"kind":65536,"name":"__type","url":"modules/_tinlake_.html#contracts.__type-3","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"Tinlake\".Contracts"},{"id":68,"kind":4194304,"name":"ContractAbis","url":"modules/_tinlake_.html#contractabis","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"Tinlake\""},{"id":69,"kind":65536,"name":"__type","url":"modules/_tinlake_.html#contractabis.__type-1","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"Tinlake\".ContractAbis"},{"id":70,"kind":4194304,"name":"ContractAddresses","url":"modules/_tinlake_.html#contractaddresses","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"Tinlake\""},{"id":71,"kind":65536,"name":"__type","url":"modules/_tinlake_.html#contractaddresses.__type-2","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"Tinlake\".ContractAddresses"},{"id":72,"kind":4194304,"name":"TinlakeParams","url":"modules/_tinlake_.html#tinlakeparams","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"Tinlake\""},{"id":73,"kind":65536,"name":"__type","url":"modules/_tinlake_.html#tinlakeparams.__type-8","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"Tinlake\".TinlakeParams"},{"id":74,"kind":32,"name":"provider","url":"modules/_tinlake_.html#tinlakeparams.__type-8.provider-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".TinlakeParams.__type"},{"id":75,"kind":32,"name":"transactionTimeout","url":"modules/_tinlake_.html#tinlakeparams.__type-8.transactiontimeout","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".TinlakeParams.__type"},{"id":76,"kind":32,"name":"contractAddresses","url":"modules/_tinlake_.html#tinlakeparams.__type-8.contractaddresses-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".TinlakeParams.__type"},{"id":77,"kind":32,"name":"contractAbis","url":"modules/_tinlake_.html#tinlakeparams.__type-8.contractabis-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".TinlakeParams.__type"},{"id":78,"kind":32,"name":"ethConfig","url":"modules/_tinlake_.html#tinlakeparams.__type-8.ethconfig-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".TinlakeParams.__type"},{"id":79,"kind":32,"name":"ethersConfig","url":"modules/_tinlake_.html#tinlakeparams.__type-8.ethersconfig-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".TinlakeParams.__type"},{"id":80,"kind":32,"name":"ethOptions","url":"modules/_tinlake_.html#tinlakeparams.__type-8.ethoptions","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".TinlakeParams.__type"},{"id":81,"kind":32,"name":"contracts","url":"modules/_tinlake_.html#tinlakeparams.__type-8.contracts-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".TinlakeParams.__type"},{"id":82,"kind":32,"name":"contractConfig","url":"modules/_tinlake_.html#tinlakeparams.__type-8.contractconfig","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"Tinlake\".TinlakeParams.__type"},{"id":83,"kind":4194304,"name":"Constructor","url":"modules/_tinlake_.html#constructor","classes":"tsd-kind-type-alias tsd-parent-kind-module tsd-has-type-parameter","parent":"\"Tinlake\""},{"id":84,"kind":65536,"name":"__type","url":"modules/_tinlake_.html#constructor.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"Tinlake\".Constructor"},{"id":85,"kind":1,"name":"\"actions/admin\"","url":"modules/_actions_admin_.html","classes":"tsd-kind-module"},{"id":86,"kind":64,"name":"AdminActions","url":"modules/_actions_admin_.html#adminactions","classes":"tsd-kind-function tsd-parent-kind-module tsd-has-type-parameter","parent":"\"actions/admin\""},{"id":87,"kind":4194304,"name":"IAdminActions","url":"modules/_actions_admin_.html#iadminactions","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"actions/admin\""},{"id":88,"kind":65536,"name":"__type","url":"modules/_actions_admin_.html#iadminactions.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"actions/admin\".IAdminActions"},{"id":89,"kind":64,"name":"isWard","url":"modules/_actions_admin_.html#iadminactions.__type.isward","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":90,"kind":64,"name":"canSetInterestRate","url":"modules/_actions_admin_.html#iadminactions.__type.cansetinterestrate","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":91,"kind":64,"name":"canSetSeniorTrancheInterest","url":"modules/_actions_admin_.html#iadminactions.__type.cansetseniortrancheinterest","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":92,"kind":64,"name":"canSetMinimumJuniorRatio","url":"modules/_actions_admin_.html#iadminactions.__type.cansetminimumjuniorratio","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":93,"kind":64,"name":"canSetRiskScore","url":"modules/_actions_admin_.html#iadminactions.__type.cansetriskscore","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":94,"kind":64,"name":"canSetInvestorAllowanceJunior","url":"modules/_actions_admin_.html#iadminactions.__type.cansetinvestorallowancejunior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":95,"kind":64,"name":"canSetInvestorAllowanceSenior","url":"modules/_actions_admin_.html#iadminactions.__type.cansetinvestorallowancesenior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":96,"kind":64,"name":"canSetLoanPrice","url":"modules/_actions_admin_.html#iadminactions.__type.cansetloanprice","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":97,"kind":64,"name":"initRate","url":"modules/_actions_admin_.html#iadminactions.__type.initrate","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":98,"kind":64,"name":"setRate","url":"modules/_actions_admin_.html#iadminactions.__type.setrate","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":99,"kind":64,"name":"setMinimumJuniorRatio","url":"modules/_actions_admin_.html#iadminactions.__type.setminimumjuniorratio","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":100,"kind":64,"name":"approveAllowanceJunior","url":"modules/_actions_admin_.html#iadminactions.__type.approveallowancejunior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":101,"kind":64,"name":"approveAllowanceSenior","url":"modules/_actions_admin_.html#iadminactions.__type.approveallowancesenior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/admin\".IAdminActions.__type"},{"id":102,"kind":1,"name":"\"actions/borrower\"","url":"modules/_actions_borrower_.html","classes":"tsd-kind-module"},{"id":103,"kind":64,"name":"BorrowerActions","url":"modules/_actions_borrower_.html#borroweractions","classes":"tsd-kind-function tsd-parent-kind-module tsd-has-type-parameter","parent":"\"actions/borrower\""},{"id":104,"kind":4194304,"name":"IBorrowerActions","url":"modules/_actions_borrower_.html#iborroweractions","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"actions/borrower\""},{"id":105,"kind":65536,"name":"__type","url":"modules/_actions_borrower_.html#iborroweractions.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"actions/borrower\".IBorrowerActions"},{"id":106,"kind":64,"name":"issue","url":"modules/_actions_borrower_.html#iborroweractions.__type.issue","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/borrower\".IBorrowerActions.__type"},{"id":107,"kind":64,"name":"nftLookup","url":"modules/_actions_borrower_.html#iborroweractions.__type.nftlookup","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/borrower\".IBorrowerActions.__type"},{"id":108,"kind":64,"name":"lock","url":"modules/_actions_borrower_.html#iborroweractions.__type.lock","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/borrower\".IBorrowerActions.__type"},{"id":109,"kind":64,"name":"unlock","url":"modules/_actions_borrower_.html#iborroweractions.__type.unlock","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/borrower\".IBorrowerActions.__type"},{"id":110,"kind":64,"name":"close","url":"modules/_actions_borrower_.html#iborroweractions.__type.close","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/borrower\".IBorrowerActions.__type"},{"id":111,"kind":64,"name":"borrow","url":"modules/_actions_borrower_.html#iborroweractions.__type.borrow","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/borrower\".IBorrowerActions.__type"},{"id":112,"kind":64,"name":"withdraw","url":"modules/_actions_borrower_.html#iborroweractions.__type.withdraw","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/borrower\".IBorrowerActions.__type"},{"id":113,"kind":64,"name":"repay","url":"modules/_actions_borrower_.html#iborroweractions.__type.repay","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/borrower\".IBorrowerActions.__type"},{"id":114,"kind":1,"name":"\"actions/lender\"","url":"modules/_actions_lender_.html","classes":"tsd-kind-module"},{"id":115,"kind":64,"name":"LenderActions","url":"modules/_actions_lender_.html#lenderactions","classes":"tsd-kind-function tsd-parent-kind-module tsd-has-type-parameter","parent":"\"actions/lender\""},{"id":116,"kind":4194304,"name":"ILenderActions","url":"modules/_actions_lender_.html#ilenderactions","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"actions/lender\""},{"id":117,"kind":65536,"name":"__type","url":"modules/_actions_lender_.html#ilenderactions.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"actions/lender\".ILenderActions"},{"id":118,"kind":64,"name":"getSeniorTokenAllowance","url":"modules/_actions_lender_.html#ilenderactions.__type.getseniortokenallowance","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/lender\".ILenderActions.__type"},{"id":119,"kind":64,"name":"getJuniorTokenAllowance","url":"modules/_actions_lender_.html#ilenderactions.__type.getjuniortokenallowance","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/lender\".ILenderActions.__type"},{"id":120,"kind":64,"name":"supplyJunior","url":"modules/_actions_lender_.html#ilenderactions.__type.supplyjunior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/lender\".ILenderActions.__type"},{"id":121,"kind":32,"name":"approveJuniorToken","url":"modules/_actions_lender_.html#ilenderactions.__type.approvejuniortoken","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"actions/lender\".ILenderActions.__type"},{"id":122,"kind":65536,"name":"__type","url":"modules/_actions_lender_.html#ilenderactions.__type.approvejuniortoken.__type-1","classes":"tsd-kind-type-literal tsd-parent-kind-variable","parent":"\"actions/lender\".ILenderActions.__type.approveJuniorToken"},{"id":123,"kind":32,"name":"approveSeniorToken","url":"modules/_actions_lender_.html#ilenderactions.__type.approveseniortoken","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"actions/lender\".ILenderActions.__type"},{"id":124,"kind":65536,"name":"__type","url":"modules/_actions_lender_.html#ilenderactions.__type.approveseniortoken.__type-2","classes":"tsd-kind-type-literal tsd-parent-kind-variable","parent":"\"actions/lender\".ILenderActions.__type.approveSeniorToken"},{"id":125,"kind":64,"name":"redeemJunior","url":"modules/_actions_lender_.html#ilenderactions.__type.redeemjunior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/lender\".ILenderActions.__type"},{"id":126,"kind":64,"name":"supplySenior","url":"modules/_actions_lender_.html#ilenderactions.__type.supplysenior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/lender\".ILenderActions.__type"},{"id":127,"kind":64,"name":"redeemSenior","url":"modules/_actions_lender_.html#ilenderactions.__type.redeemsenior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/lender\".ILenderActions.__type"},{"id":128,"kind":64,"name":"balance","url":"modules/_actions_lender_.html#ilenderactions.__type.balance","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/lender\".ILenderActions.__type"},{"id":129,"kind":1,"name":"\"actions/currency\"","url":"modules/_actions_currency_.html","classes":"tsd-kind-module"},{"id":130,"kind":64,"name":"CurrencyActions","url":"modules/_actions_currency_.html#currencyactions","classes":"tsd-kind-function tsd-parent-kind-module tsd-has-type-parameter","parent":"\"actions/currency\""},{"id":131,"kind":4194304,"name":"ICurrencyActions","url":"modules/_actions_currency_.html#icurrencyactions","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"actions/currency\""},{"id":132,"kind":65536,"name":"__type","url":"modules/_actions_currency_.html#icurrencyactions.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"actions/currency\".ICurrencyActions"},{"id":133,"kind":64,"name":"mintCurrency","url":"modules/_actions_currency_.html#icurrencyactions.__type.mintcurrency","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/currency\".ICurrencyActions.__type"},{"id":134,"kind":64,"name":"getCurrencyBalance","url":"modules/_actions_currency_.html#icurrencyactions.__type.getcurrencybalance","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/currency\".ICurrencyActions.__type"},{"id":135,"kind":32,"name":"getCurrencyAllowance","url":"modules/_actions_currency_.html#icurrencyactions.__type.getcurrencyallowance","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"actions/currency\".ICurrencyActions.__type"},{"id":136,"kind":65536,"name":"__type","url":"modules/_actions_currency_.html#icurrencyactions.__type.getcurrencyallowance.__type-3","classes":"tsd-kind-type-literal tsd-parent-kind-variable","parent":"\"actions/currency\".ICurrencyActions.__type.getCurrencyAllowance"},{"id":137,"kind":32,"name":"getJuniorForCurrencyAllowance","url":"modules/_actions_currency_.html#icurrencyactions.__type.getjuniorforcurrencyallowance","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"actions/currency\".ICurrencyActions.__type"},{"id":138,"kind":65536,"name":"__type","url":"modules/_actions_currency_.html#icurrencyactions.__type.getjuniorforcurrencyallowance.__type-4","classes":"tsd-kind-type-literal tsd-parent-kind-variable","parent":"\"actions/currency\".ICurrencyActions.__type.getJuniorForCurrencyAllowance"},{"id":139,"kind":32,"name":"getSeniorForCurrencyAllowance","url":"modules/_actions_currency_.html#icurrencyactions.__type.getseniorforcurrencyallowance","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"actions/currency\".ICurrencyActions.__type"},{"id":140,"kind":65536,"name":"__type","url":"modules/_actions_currency_.html#icurrencyactions.__type.getseniorforcurrencyallowance.__type-5","classes":"tsd-kind-type-literal tsd-parent-kind-variable","parent":"\"actions/currency\".ICurrencyActions.__type.getSeniorForCurrencyAllowance"},{"id":141,"kind":64,"name":"approveCurrency","url":"modules/_actions_currency_.html#icurrencyactions.__type.approvecurrency","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/currency\".ICurrencyActions.__type"},{"id":142,"kind":32,"name":"approveSeniorForCurrency","url":"modules/_actions_currency_.html#icurrencyactions.__type.approveseniorforcurrency","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"actions/currency\".ICurrencyActions.__type"},{"id":143,"kind":65536,"name":"__type","url":"modules/_actions_currency_.html#icurrencyactions.__type.approveseniorforcurrency.__type-2","classes":"tsd-kind-type-literal tsd-parent-kind-variable","parent":"\"actions/currency\".ICurrencyActions.__type.approveSeniorForCurrency"},{"id":144,"kind":32,"name":"approveJuniorForCurrency","url":"modules/_actions_currency_.html#icurrencyactions.__type.approvejuniorforcurrency","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"actions/currency\".ICurrencyActions.__type"},{"id":145,"kind":65536,"name":"__type","url":"modules/_actions_currency_.html#icurrencyactions.__type.approvejuniorforcurrency.__type-1","classes":"tsd-kind-type-literal tsd-parent-kind-variable","parent":"\"actions/currency\".ICurrencyActions.__type.approveJuniorForCurrency"},{"id":146,"kind":1,"name":"\"actions/collateral\"","url":"modules/_actions_collateral_.html","classes":"tsd-kind-module"},{"id":147,"kind":64,"name":"CollateralActions","url":"modules/_actions_collateral_.html#collateralactions","classes":"tsd-kind-function tsd-parent-kind-module tsd-has-type-parameter","parent":"\"actions/collateral\""},{"id":148,"kind":4194304,"name":"ICollateralActions","url":"modules/_actions_collateral_.html#icollateralactions","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"actions/collateral\""},{"id":149,"kind":65536,"name":"__type","url":"modules/_actions_collateral_.html#icollateralactions.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"actions/collateral\".ICollateralActions"},{"id":150,"kind":64,"name":"mintTitleNFT","url":"modules/_actions_collateral_.html#icollateralactions.__type.minttitlenft","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/collateral\".ICollateralActions.__type"},{"id":151,"kind":64,"name":"mintNFT","url":"modules/_actions_collateral_.html#icollateralactions.__type.mintnft","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/collateral\".ICollateralActions.__type"},{"id":152,"kind":64,"name":"approveNFT","url":"modules/_actions_collateral_.html#icollateralactions.__type.approvenft","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/collateral\".ICollateralActions.__type"},{"id":153,"kind":64,"name":"setNFTApprovalForAll","url":"modules/_actions_collateral_.html#icollateralactions.__type.setnftapprovalforall","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/collateral\".ICollateralActions.__type"},{"id":154,"kind":64,"name":"isNFTApprovedForAll","url":"modules/_actions_collateral_.html#icollateralactions.__type.isnftapprovedforall","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/collateral\".ICollateralActions.__type"},{"id":155,"kind":64,"name":"getNFTCount","url":"modules/_actions_collateral_.html#icollateralactions.__type.getnftcount","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/collateral\".ICollateralActions.__type"},{"id":156,"kind":64,"name":"getNFTData","url":"modules/_actions_collateral_.html#icollateralactions.__type.getnftdata","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/collateral\".ICollateralActions.__type"},{"id":157,"kind":64,"name":"getNFTOwner","url":"modules/_actions_collateral_.html#icollateralactions.__type.getnftowner","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/collateral\".ICollateralActions.__type"},{"id":158,"kind":64,"name":"transferNFT","url":"modules/_actions_collateral_.html#icollateralactions.__type.transfernft","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/collateral\".ICollateralActions.__type"},{"id":159,"kind":1,"name":"\"actions/governance\"","url":"modules/_actions_governance_.html","classes":"tsd-kind-module"},{"id":160,"kind":4194304,"name":"IGovernanceActions","url":"modules/_actions_governance_.html#igovernanceactions","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"actions/governance\""},{"id":161,"kind":65536,"name":"__type","url":"modules/_actions_governance_.html#igovernanceactions.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"actions/governance\".IGovernanceActions"},{"id":162,"kind":64,"name":"relyAddress","url":"modules/_actions_governance_.html#igovernanceactions.__type.relyaddress","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/governance\".IGovernanceActions.__type"},{"id":163,"kind":1,"name":"\"actions/proxy\"","url":"modules/_actions_proxy_.html","classes":"tsd-kind-module"},{"id":164,"kind":64,"name":"ProxyActions","url":"modules/_actions_proxy_.html#proxyactions","classes":"tsd-kind-function tsd-parent-kind-module tsd-has-type-parameter","parent":"\"actions/proxy\""},{"id":165,"kind":4194304,"name":"IProxyActions","url":"modules/_actions_proxy_.html#iproxyactions","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"actions/proxy\""},{"id":166,"kind":65536,"name":"__type","url":"modules/_actions_proxy_.html#iproxyactions.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"actions/proxy\".IProxyActions"},{"id":167,"kind":64,"name":"buildProxy","url":"modules/_actions_proxy_.html#iproxyactions.__type.buildproxy","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":168,"kind":64,"name":"checkProxyExists","url":"modules/_actions_proxy_.html#iproxyactions.__type.checkproxyexists","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":169,"kind":64,"name":"getProxy","url":"modules/_actions_proxy_.html#iproxyactions.__type.getproxy","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":170,"kind":64,"name":"proxyCount","url":"modules/_actions_proxy_.html#iproxyactions.__type.proxycount","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":171,"kind":64,"name":"getProxyAccessToken","url":"modules/_actions_proxy_.html#iproxyactions.__type.getproxyaccesstoken","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":172,"kind":64,"name":"getProxyAccessTokenOwner","url":"modules/_actions_proxy_.html#iproxyactions.__type.getproxyaccesstokenowner","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":173,"kind":64,"name":"getProxyOwnerByLoan","url":"modules/_actions_proxy_.html#iproxyactions.__type.getproxyownerbyloan","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":174,"kind":64,"name":"getProxyOwnerByAddress","url":"modules/_actions_proxy_.html#iproxyactions.__type.getproxyownerbyaddress","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":175,"kind":64,"name":"proxyCreateNew","url":"modules/_actions_proxy_.html#iproxyactions.__type.proxycreatenew","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":176,"kind":64,"name":"proxyIssue","url":"modules/_actions_proxy_.html#iproxyactions.__type.proxyissue","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":177,"kind":64,"name":"proxyTransferIssue","url":"modules/_actions_proxy_.html#iproxyactions.__type.proxytransferissue","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":178,"kind":64,"name":"proxyLockBorrowWithdraw","url":"modules/_actions_proxy_.html#iproxyactions.__type.proxylockborrowwithdraw","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":179,"kind":64,"name":"proxyRepayUnlockClose","url":"modules/_actions_proxy_.html#iproxyactions.__type.proxyrepayunlockclose","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/proxy\".IProxyActions.__type"},{"id":180,"kind":1,"name":"\"actions/index\"","url":"modules/_actions_index_.html","classes":"tsd-kind-module"},{"id":181,"kind":4194304,"name":"TinlakeActions","url":"modules/_actions_index_.html#tinlakeactions","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"actions/index\""},{"id":182,"kind":1,"name":"\"types/tinlake\"","url":"modules/_types_tinlake_.html","classes":"tsd-kind-module"},{"id":183,"kind":4194304,"name":"Loan","url":"modules/_types_tinlake_.html#loan","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"types/tinlake\""},{"id":184,"kind":65536,"name":"__type","url":"modules/_types_tinlake_.html#loan.__type-3","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"types/tinlake\".Loan"},{"id":185,"kind":32,"name":"loanId","url":"modules/_types_tinlake_.html#loan.__type-3.loanid","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":186,"kind":32,"name":"registry","url":"modules/_types_tinlake_.html#loan.__type-3.registry","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":187,"kind":32,"name":"tokenId","url":"modules/_types_tinlake_.html#loan.__type-3.tokenid","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":188,"kind":32,"name":"ownerOf","url":"modules/_types_tinlake_.html#loan.__type-3.ownerof","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":189,"kind":32,"name":"principal","url":"modules/_types_tinlake_.html#loan.__type-3.principal","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":190,"kind":32,"name":"interestRate","url":"modules/_types_tinlake_.html#loan.__type-3.interestrate","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":191,"kind":32,"name":"debt","url":"modules/_types_tinlake_.html#loan.__type-3.debt","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":192,"kind":32,"name":"threshold","url":"modules/_types_tinlake_.html#loan.__type-3.threshold","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":193,"kind":32,"name":"price","url":"modules/_types_tinlake_.html#loan.__type-3.price","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":194,"kind":32,"name":"status","url":"modules/_types_tinlake_.html#loan.__type-3.status","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":195,"kind":32,"name":"nft","url":"modules/_types_tinlake_.html#loan.__type-3.nft","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":196,"kind":32,"name":"proxyOwner","url":"modules/_types_tinlake_.html#loan.__type-3.proxyowner","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Loan.__type"},{"id":197,"kind":4194304,"name":"Tranche","url":"modules/_types_tinlake_.html#tranche","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"types/tinlake\""},{"id":198,"kind":65536,"name":"__type","url":"modules/_types_tinlake_.html#tranche.__type-5","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"types/tinlake\".Tranche"},{"id":199,"kind":32,"name":"availableFunds","url":"modules/_types_tinlake_.html#tranche.__type-5.availablefunds","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Tranche.__type"},{"id":200,"kind":32,"name":"tokenPrice","url":"modules/_types_tinlake_.html#tranche.__type-5.tokenprice","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Tranche.__type"},{"id":201,"kind":32,"name":"type","url":"modules/_types_tinlake_.html#tranche.__type-5.type","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Tranche.__type"},{"id":202,"kind":32,"name":"token","url":"modules/_types_tinlake_.html#tranche.__type-5.token","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Tranche.__type"},{"id":203,"kind":32,"name":"totalSupply","url":"modules/_types_tinlake_.html#tranche.__type-5.totalsupply","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Tranche.__type"},{"id":204,"kind":32,"name":"interestRate","url":"modules/_types_tinlake_.html#tranche.__type-5.interestrate-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Tranche.__type"},{"id":205,"kind":4194304,"name":"NFT","url":"modules/_types_tinlake_.html#nft-1","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"types/tinlake\""},{"id":206,"kind":65536,"name":"__type","url":"modules/_types_tinlake_.html#nft-1.__type-4","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"types/tinlake\".NFT"},{"id":207,"kind":32,"name":"registry","url":"modules/_types_tinlake_.html#nft-1.__type-4.registry-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".NFT.__type"},{"id":208,"kind":32,"name":"tokenId","url":"modules/_types_tinlake_.html#nft-1.__type-4.tokenid-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".NFT.__type"},{"id":209,"kind":32,"name":"nftOwner","url":"modules/_types_tinlake_.html#nft-1.__type-4.nftowner","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".NFT.__type"},{"id":210,"kind":32,"name":"nftData","url":"modules/_types_tinlake_.html#nft-1.__type-4.nftdata","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".NFT.__type"},{"id":211,"kind":4194304,"name":"Investor","url":"modules/_types_tinlake_.html#investor","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"types/tinlake\""},{"id":212,"kind":65536,"name":"__type","url":"modules/_types_tinlake_.html#investor.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"types/tinlake\".Investor"},{"id":213,"kind":32,"name":"junior","url":"modules/_types_tinlake_.html#investor.__type.junior","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Investor.__type"},{"id":214,"kind":65536,"name":"__type","url":"modules/_types_tinlake_.html#investor.__type.junior.__type-1","classes":"tsd-kind-type-literal tsd-parent-kind-variable","parent":"\"types/tinlake\".Investor.__type.junior"},{"id":215,"kind":32,"name":"maxSupply","url":"modules/_types_tinlake_.html#investor.__type.junior.__type-1.maxsupply","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Investor.__type.junior.__type"},{"id":216,"kind":32,"name":"tokenBalance","url":"modules/_types_tinlake_.html#investor.__type.junior.__type-1.tokenbalance","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Investor.__type.junior.__type"},{"id":217,"kind":32,"name":"maxRedeem","url":"modules/_types_tinlake_.html#investor.__type.junior.__type-1.maxredeem","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Investor.__type.junior.__type"},{"id":218,"kind":32,"name":"senior","url":"modules/_types_tinlake_.html#investor.__type.senior","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Investor.__type"},{"id":219,"kind":65536,"name":"__type","url":"modules/_types_tinlake_.html#investor.__type.senior.__type-2","classes":"tsd-kind-type-literal tsd-parent-kind-variable","parent":"\"types/tinlake\".Investor.__type.senior"},{"id":220,"kind":32,"name":"maxSupply","url":"modules/_types_tinlake_.html#investor.__type.senior.__type-2.maxsupply-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Investor.__type.senior.__type"},{"id":221,"kind":32,"name":"tokenBalance","url":"modules/_types_tinlake_.html#investor.__type.senior.__type-2.tokenbalance-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Investor.__type.senior.__type"},{"id":222,"kind":32,"name":"maxRedeem","url":"modules/_types_tinlake_.html#investor.__type.senior.__type-2.maxredeem-1","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Investor.__type.senior.__type"},{"id":223,"kind":32,"name":"address","url":"modules/_types_tinlake_.html#investor.__type.address","classes":"tsd-kind-variable tsd-parent-kind-type-literal","parent":"\"types/tinlake\".Investor.__type"},{"id":224,"kind":4194304,"name":"ITinlake","url":"modules/_types_tinlake_.html#itinlake","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"types/tinlake\""},{"id":225,"kind":1,"name":"\"actions/analytics\"","url":"modules/_actions_analytics_.html","classes":"tsd-kind-module"},{"id":226,"kind":64,"name":"AnalyticsActions","url":"modules/_actions_analytics_.html#analyticsactions","classes":"tsd-kind-function tsd-parent-kind-module tsd-has-type-parameter","parent":"\"actions/analytics\""},{"id":227,"kind":4194304,"name":"IAnalyticsActions","url":"modules/_actions_analytics_.html#ianalyticsactions","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"actions/analytics\""},{"id":228,"kind":65536,"name":"__type","url":"modules/_actions_analytics_.html#ianalyticsactions.__type","classes":"tsd-kind-type-literal tsd-parent-kind-type-alias","parent":"\"actions/analytics\".IAnalyticsActions"},{"id":229,"kind":64,"name":"getTotalDebt","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.gettotaldebt","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":230,"kind":64,"name":"getTotalBalance","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.gettotalbalance","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":231,"kind":64,"name":"getDebt","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getdebt","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":232,"kind":64,"name":"loanCount","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.loancount","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":233,"kind":64,"name":"getLoanList","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getloanlist","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":234,"kind":64,"name":"getLoan","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getloan","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":235,"kind":64,"name":"getCollateral","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getcollateral","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":236,"kind":64,"name":"getPrincipal","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getprincipal","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":237,"kind":64,"name":"getInterestRate","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getinterestrate","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":238,"kind":64,"name":"getOwnerOfLoan","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getownerofloan","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":239,"kind":64,"name":"getOwnerOfCollateral","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getownerofcollateral","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":240,"kind":64,"name":"existsSenior","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.existssenior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":241,"kind":64,"name":"getJuniorReserve","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getjuniorreserve","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":242,"kind":64,"name":"getSeniorReserve","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getseniorreserve","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":243,"kind":64,"name":"getJuniorTokenBalance","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getjuniortokenbalance","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":244,"kind":64,"name":"getSeniorTokenBalance","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getseniortokenbalance","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":245,"kind":64,"name":"getMaxSupplyAmountJunior","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getmaxsupplyamountjunior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":246,"kind":64,"name":"getMaxRedeemAmountJunior","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getmaxredeemamountjunior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":247,"kind":64,"name":"getMaxSupplyAmountSenior","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getmaxsupplyamountsenior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":248,"kind":64,"name":"getMaxRedeemAmountSenior","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getmaxredeemamountsenior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":249,"kind":64,"name":"getTokenPriceJunior","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.gettokenpricejunior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":250,"kind":64,"name":"getTokenPriceSenior","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.gettokenpricesenior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":251,"kind":64,"name":"getSeniorDebt","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getseniordebt","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":252,"kind":64,"name":"getSeniorInterestRate","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getseniorinterestrate","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":253,"kind":64,"name":"getMinJuniorRatio","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getminjuniorratio","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":254,"kind":64,"name":"getCurrentJuniorRatio","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getcurrentjuniorratio","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":255,"kind":64,"name":"getAssetValueJunior","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getassetvaluejunior","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":256,"kind":64,"name":"getInvestor","url":"modules/_actions_analytics_.html#ianalyticsactions.__type.getinvestor","classes":"tsd-kind-function tsd-parent-kind-type-literal","parent":"\"actions/analytics\".IAnalyticsActions.__type"},{"id":257,"kind":1,"name":"\"utils/baseToDisplay\"","url":"modules/_utils_basetodisplay_.html","classes":"tsd-kind-module"},{"id":258,"kind":64,"name":"baseToDisplay","url":"modules/_utils_basetodisplay_.html#basetodisplay","classes":"tsd-kind-function tsd-parent-kind-module","parent":"\"utils/baseToDisplay\""},{"id":259,"kind":1,"name":"\"utils/baseToDisplay.spec\"","url":"modules/_utils_basetodisplay_spec_.html","classes":"tsd-kind-module"},{"id":260,"kind":1,"name":"\"utils/bnToHex\"","url":"modules/_utils_bntohex_.html","classes":"tsd-kind-module"},{"id":261,"kind":64,"name":"bnToHex","url":"modules/_utils_bntohex_.html#bntohex","classes":"tsd-kind-function tsd-parent-kind-module","parent":"\"utils/bnToHex\""},{"id":262,"kind":1,"name":"\"utils/bnToHex.spec\"","url":"modules/_utils_bntohex_spec_.html","classes":"tsd-kind-module"},{"id":263,"kind":1,"name":"\"utils/displayToBase\"","url":"modules/_utils_displaytobase_.html","classes":"tsd-kind-module"},{"id":264,"kind":64,"name":"displayToBase","url":"modules/_utils_displaytobase_.html#displaytobase","classes":"tsd-kind-function tsd-parent-kind-module","parent":"\"utils/displayToBase\""},{"id":265,"kind":1,"name":"\"utils/displayToBase.spec\"","url":"modules/_utils_displaytobase_spec_.html","classes":"tsd-kind-module"},{"id":266,"kind":1,"name":"\"utils/feeToInterestRate\"","url":"modules/_utils_feetointerestrate_.html","classes":"tsd-kind-module"},{"id":267,"kind":64,"name":"feeToInterestRate","url":"modules/_utils_feetointerestrate_.html#feetointerestrate","classes":"tsd-kind-function tsd-parent-kind-module","parent":"\"utils/feeToInterestRate\""},{"id":268,"kind":1,"name":"\"utils/feeToInterestRate.spec\"","url":"modules/_utils_feetointerestrate_spec_.html","classes":"tsd-kind-module"},{"id":269,"kind":1,"name":"\"utils/getLoanStatus\"","url":"modules/_utils_getloanstatus_.html","classes":"tsd-kind-module"},{"id":270,"kind":4194304,"name":"LoanStatus","url":"modules/_utils_getloanstatus_.html#loanstatus","classes":"tsd-kind-type-alias tsd-parent-kind-module","parent":"\"utils/getLoanStatus\""},{"id":271,"kind":64,"name":"getLoanStatus","url":"modules/_utils_getloanstatus_.html#getloanstatus","classes":"tsd-kind-function tsd-parent-kind-module","parent":"\"utils/getLoanStatus\""},{"id":272,"kind":1,"name":"\"utils/interestRateToFee\"","url":"modules/_utils_interestratetofee_.html","classes":"tsd-kind-module"},{"id":273,"kind":64,"name":"interestRateToFee","url":"modules/_utils_interestratetofee_.html#interestratetofee","classes":"tsd-kind-function tsd-parent-kind-module","parent":"\"utils/interestRateToFee\""},{"id":274,"kind":1,"name":"\"utils/interestRateToFee.spec\"","url":"modules/_utils_interestratetofee_spec_.html","classes":"tsd-kind-module"}]}; \ No newline at end of file diff --git a/docs/classes/_tinlake_.tinlake.html b/docs/classes/_tinlake_.tinlake.html index 9d131d0..2420af2 100644 --- a/docs/classes/_tinlake_.tinlake.html +++ b/docs/classes/_tinlake_.tinlake.html @@ -105,7 +105,6 @@

        Methods

      • contract
      • createContract
      • createEthContract
      • -
      • getContract
      • getOperatorType
      • getTransactionReceipt
      • pending
      • @@ -130,7 +129,7 @@

        constructor

      • Parameters

        @@ -152,7 +151,7 @@

        contractAbis

        contractAbis: ContractAbis
        @@ -162,7 +161,7 @@

        contractAddresses

        contractAddresses: ContractAddresses
        @@ -172,7 +171,7 @@

        contractConfig

        contractConfig: any
        @@ -182,7 +181,7 @@

        contracts

        contracts: Contracts
        @@ -192,7 +191,7 @@

        eth

        eth: ethI
        @@ -202,7 +201,7 @@

        ethConfig

        ethConfig: EthConfig
        @@ -212,7 +211,7 @@

        ethOptions

        ethOptions: any
        @@ -222,7 +221,7 @@

        ethersConfig

        ethersConfig: EthersConfig
        @@ -232,7 +231,7 @@

        ethersContracts

        ethersContracts: Contracts
        @@ -242,7 +241,7 @@

        provider

        provider: any
        @@ -252,7 +251,7 @@

        transactionTimeout

        transactionTimeout: number
        @@ -269,7 +268,7 @@

        contract

      • Parameters

        @@ -295,7 +294,7 @@

        createContract

      • Parameters

        @@ -321,7 +320,7 @@

        createEthContract

      • Parameters

        @@ -337,32 +336,6 @@

        Returns void

      -
      - -

      getContract

      -
        -
      • getContract(address: string, abiName: ContractName): Contract
      • -
      - -

      getOperatorType

      @@ -373,7 +346,7 @@

      getOperatorType

    • Parameters

      @@ -396,7 +369,7 @@

      getTransactionReceipt

    • Parameters

      @@ -419,7 +392,7 @@

      pending

    • Parameters

      @@ -442,7 +415,7 @@

      setContracts

    • Returns void

      @@ -459,7 +432,7 @@

      setEthConfig

    • Parameters

      @@ -482,7 +455,7 @@

      setEthersConfig

    • Parameters

      @@ -505,7 +478,7 @@

      setProvider

    • Parameters

      @@ -652,9 +625,6 @@

      Returns void createEthContract

    • -
    • - getContract -
    • getOperatorType
    • diff --git a/docs/interfaces/_services_ethereum_.ethi.html b/docs/interfaces/_services_ethereum_.ethi.html index d2f83ab..458707a 100644 --- a/docs/interfaces/_services_ethereum_.ethi.html +++ b/docs/interfaces/_services_ethereum_.ethi.html @@ -101,7 +101,7 @@

      abi

      abi: any
      @@ -111,7 +111,7 @@

      contract

      contract: (arg0: any) => { at: (arg0: any) => void }
      @@ -165,7 +165,7 @@

      getTransactionByHash

      getTransactionByHash: (arg0: any, arg1: (err: any, tx: any) => void) => void
      @@ -220,7 +220,7 @@

      getTransactionCount

      getTransactionCount: any
      @@ -230,7 +230,7 @@

      getTransactionReceipt

      getTransactionReceipt: (arg0: any, arg1: (err: any, receipt: any) => void) => void
      @@ -285,7 +285,7 @@

      send

      send: Function
      @@ -295,7 +295,7 @@

      sendRawTransaction

      sendRawTransaction: any
      @@ -305,7 +305,7 @@

      web3_sha3

      web3_sha3: (signature: string) => string
      diff --git a/docs/interfaces/_services_ethereum_.events.html b/docs/interfaces/_services_ethereum_.events.html index efe5a8a..852e79b 100644 --- a/docs/interfaces/_services_ethereum_.events.html +++ b/docs/interfaces/_services_ethereum_.events.html @@ -96,7 +96,7 @@

      events

      events: { data: any[]; event: { name: any } }[]
      @@ -106,7 +106,7 @@

      status

      status: any
      @@ -116,7 +116,7 @@

      txHash

      txHash: string
      diff --git a/docs/modules/_actions_admin_.html b/docs/modules/_actions_admin_.html index 494a5a6..56d6c07 100644 --- a/docs/modules/_actions_admin_.html +++ b/docs/modules/_actions_admin_.html @@ -89,7 +89,7 @@

      IAdminActions

      IAdminActions: { approveAllowanceJunior: any; approveAllowanceSenior: any; canSetInterestRate: any; canSetInvestorAllowanceJunior: any; canSetInvestorAllowanceSenior: any; canSetLoanPrice: any; canSetMinimumJuniorRatio: any; canSetRiskScore: any; canSetSeniorTrancheInterest: any; initRate: any; isWard: any; setMinimumJuniorRatio: any; setRate: any }
      @@ -104,7 +104,7 @@
      approveAllowanceJunior:
    • Parameters

      @@ -132,7 +132,7 @@
      approveAllowanceSenior:
    • Parameters

      @@ -160,7 +160,7 @@
      canSetInterestRate:

      Parameters

      @@ -182,7 +182,7 @@
      canSetInvestorAllowanceJunior

      Parameters

      @@ -204,7 +204,7 @@
      canSetInvestorAllowanceSenior

      Parameters

      @@ -226,7 +226,7 @@
      canSetLoanPrice: fu
    • Parameters

      @@ -248,7 +248,7 @@
      canSetMinimumJuniorRatio

      Parameters

      @@ -270,7 +270,7 @@
      canSetRiskScore: fu
    • Parameters

      @@ -292,7 +292,7 @@
      canSetSeniorTrancheInterest

      Parameters

      @@ -314,7 +314,7 @@
      initRate: function
    • Parameters

      @@ -336,7 +336,7 @@
      isWard: function
    • Parameters

      @@ -361,7 +361,7 @@
      setMinimumJuniorRatio:

      Parameters

      @@ -383,7 +383,7 @@
      setRate: function
    • Parameters

      @@ -415,7 +415,7 @@

      AdminActions

    • Type parameters

      diff --git a/docs/modules/_actions_analytics_.html b/docs/modules/_actions_analytics_.html index 3ed946f..428a0c4 100644 --- a/docs/modules/_actions_analytics_.html +++ b/docs/modules/_actions_analytics_.html @@ -89,7 +89,7 @@

      IAnalyticsActions

      IAnalyticsActions: { existsSenior: any; getAssetValueJunior: any; getCollateral: any; getCurrentJuniorRatio: any; getDebt: any; getInterestRate: any; getInvestor: any; getJuniorReserve: any; getJuniorTokenBalance: any; getLoan: any; getLoanList: any; getMaxRedeemAmountJunior: any; getMaxRedeemAmountSenior: any; getMaxSupplyAmountJunior: any; getMaxSupplyAmountSenior: any; getMinJuniorRatio: any; getOwnerOfCollateral: any; getOwnerOfLoan: any; getPrincipal: any; getSeniorDebt: any; getSeniorInterestRate: any; getSeniorReserve: any; getSeniorTokenBalance: any; getTokenPriceJunior: any; getTokenPriceSenior: any; getTotalBalance: any; getTotalDebt: any; loanCount: any }
      @@ -104,7 +104,7 @@
      existsSenior: function
    • Returns boolean

      @@ -120,7 +120,7 @@
      getAssetValueJunior:

      Returns Promise<BN>

      @@ -136,7 +136,7 @@
      getCollateral: function
    • Parameters

      @@ -158,7 +158,7 @@
      getCurrentJuniorRatio:

      Returns Promise<BN>

      @@ -174,7 +174,7 @@
      getDebt: function
    • Parameters

      @@ -196,7 +196,7 @@
      getInterestRate: functio
    • Parameters

      @@ -218,7 +218,7 @@
      getInvestor: function
    • Parameters

      @@ -240,7 +240,7 @@
      getJuniorReserve: functi
    • Returns Promise<BN>

      @@ -256,7 +256,7 @@
      getJuniorTokenBalance:

      Parameters

      @@ -278,7 +278,7 @@
      getLoan: function
    • Parameters

      @@ -300,7 +300,7 @@
      getLoanList: function

      Returns Promise<Loan[]>

      @@ -316,7 +316,7 @@
      getMaxRedeemAmountJunior

      Parameters

      @@ -338,7 +338,7 @@
      getMaxRedeemAmountSenior

      Parameters

      @@ -360,7 +360,7 @@
      getMaxSupplyAmountJunior

      Parameters

      @@ -382,7 +382,7 @@
      getMaxSupplyAmountSenior

      Parameters

      @@ -404,7 +404,7 @@
      getMinJuniorRatio:
    • Returns Promise<BN>

      @@ -420,7 +420,7 @@
      getOwnerOfCollateral: fu
    • Parameters

      @@ -448,7 +448,7 @@
      getOwnerOfLoan: function
    • Parameters

      @@ -470,7 +470,7 @@
      getPrincipal: function
    • Parameters

      @@ -492,7 +492,7 @@
      getSeniorDebt: function<
    • Returns Promise<BN>

      @@ -508,7 +508,7 @@
      getSeniorInterestRate:

      Returns Promise<BN>

      @@ -524,7 +524,7 @@
      getSeniorReserve: functi
    • Returns Promise<BN>

      @@ -540,7 +540,7 @@
      getSeniorTokenBalance:

      Parameters

      @@ -562,7 +562,7 @@
      getTokenPriceJunior:

      Returns Promise<BN>

      @@ -578,7 +578,7 @@
      getTokenPriceSenior:

      Parameters

      @@ -600,7 +600,7 @@
      getTotalBalance: functio
    • Returns Promise<BN>

      @@ -616,7 +616,7 @@
      getTotalDebt: function

      Returns Promise<BN>

      @@ -632,7 +632,7 @@
      loanCount: function
    • Returns Promise<BN>

      @@ -655,7 +655,7 @@

      AnalyticsActions

    • Type parameters

      diff --git a/docs/modules/_actions_borrower_.html b/docs/modules/_actions_borrower_.html index 3af311e..864aa4c 100644 --- a/docs/modules/_actions_borrower_.html +++ b/docs/modules/_actions_borrower_.html @@ -89,7 +89,7 @@

      IBorrowerActions

      IBorrowerActions: { borrow: any; close: any; issue: any; lock: any; nftLookup: any; repay: any; unlock: any; withdraw: any }
      @@ -104,7 +104,7 @@
      borrow: function
    • Parameters

      @@ -129,7 +129,7 @@
      close: function
    • Parameters

      @@ -151,7 +151,7 @@
      issue: function
    • Parameters

      @@ -176,7 +176,7 @@
      lock: function
    • Parameters

      @@ -198,7 +198,7 @@
      nftLookup: function
    • Parameters

      @@ -223,7 +223,7 @@
      repay: function
    • Parameters

      @@ -248,7 +248,7 @@
      unlock: function
    • Parameters

      @@ -270,7 +270,7 @@
      withdraw: function
    • Parameters

      @@ -305,7 +305,7 @@

      BorrowerActions

    • Type parameters

      diff --git a/docs/modules/_actions_collateral_.html b/docs/modules/_actions_collateral_.html index f8b3220..05c86ba 100644 --- a/docs/modules/_actions_collateral_.html +++ b/docs/modules/_actions_collateral_.html @@ -89,7 +89,7 @@

      ICollateralActions

      ICollateralActions: { approveNFT: any; getNFTCount: any; getNFTData: any; getNFTOwner: any; isNFTApprovedForAll: any; mintNFT: any; mintTitleNFT: any; setNFTApprovalForAll: any; transferNFT: any }
      @@ -98,13 +98,13 @@

      Type declaration

    • approveNFT: function
        -
      • approveNFT(nftAddr: string, tokenId: string, to: string): Promise<any>
      • +
      • approveNFT(nftAddr: string, tokenId: string, to: string): Promise<PendingTransaction>
      -

      Returns Promise<any>

      +

      Returns Promise<PendingTransaction>

  • @@ -132,7 +132,7 @@
    getNFTCount: function
  • Parameters

    @@ -154,7 +154,7 @@
    getNFTData: function
  • Parameters

    @@ -179,7 +179,7 @@
    getNFTOwner: function
  • Parameters

    @@ -204,7 +204,7 @@
    isNFTApprovedForAll: fun
  • Parameters

    @@ -232,7 +232,7 @@
    mintNFT: function
  • Parameters

    @@ -269,7 +269,7 @@
    mintTitleNFT: function
  • Parameters

    @@ -294,7 +294,7 @@
    setNFTApprovalForAll: fu
  • Parameters

    @@ -322,7 +322,7 @@
    transferNFT: function
  • Parameters

    @@ -360,7 +360,7 @@

    CollateralActions

  • Type parameters

    diff --git a/docs/modules/_actions_currency_.html b/docs/modules/_actions_currency_.html index 425ddba..df3d275 100644 --- a/docs/modules/_actions_currency_.html +++ b/docs/modules/_actions_currency_.html @@ -89,7 +89,7 @@

    ICurrencyActions

    ICurrencyActions: { approveJuniorForCurrency: (currencyAmount: string) => Promise<PendingTransaction | undefined>; approveSeniorForCurrency: (currencyAmount: string) => Promise<PendingTransaction | undefined>; getCurrencyAllowance: (owner: string, spender: string) => Promise<BN>; getJuniorForCurrencyAllowance: (owner: string) => Promise<BN | undefined>; getSeniorForCurrencyAllowance: (owner: string) => Promise<BN | undefined>; approveCurrency: any; getCurrencyBalance: any; mintCurrency: any }
    @@ -212,7 +212,7 @@
    approveCurrency: function

    Parameters

    @@ -237,7 +237,7 @@
    getCurrencyBalance: func
  • Parameters

    @@ -259,7 +259,7 @@
    mintCurrency: function
  • Parameters

    @@ -291,7 +291,7 @@

    CurrencyActions

  • Type parameters

    diff --git a/docs/modules/_actions_governance_.html b/docs/modules/_actions_governance_.html index 12c3370..d6f1ce6 100644 --- a/docs/modules/_actions_governance_.html +++ b/docs/modules/_actions_governance_.html @@ -83,7 +83,7 @@

    IGovernanceActions

    IGovernanceActions: { relyAddress: any }
    @@ -98,7 +98,7 @@
    relyAddress: function
  • Parameters

    diff --git a/docs/modules/_actions_index_.html b/docs/modules/_actions_index_.html index 5f5f49c..bd3f834 100644 --- a/docs/modules/_actions_index_.html +++ b/docs/modules/_actions_index_.html @@ -83,7 +83,7 @@

    TinlakeActions

    diff --git a/docs/modules/_actions_lender_.html b/docs/modules/_actions_lender_.html index 78adcf5..7572bb7 100644 --- a/docs/modules/_actions_lender_.html +++ b/docs/modules/_actions_lender_.html @@ -89,7 +89,7 @@

    ILenderActions

    ILenderActions: { approveJuniorToken: (tokenAmount: string) => Promise<unknown>; approveSeniorToken: (tokenAmount: string) => Promise<unknown>; balance: any; getJuniorTokenAllowance: any; getSeniorTokenAllowance: any; redeemJunior: any; redeemSenior: any; supplyJunior: any; supplySenior: any }
    @@ -146,7 +146,7 @@
    balance: function
  • Returns Promise<any>

    @@ -162,7 +162,7 @@
    getJuniorTokenAllowance: <
  • Parameters

    @@ -184,7 +184,7 @@
    getSeniorTokenAllowance: <
  • Parameters

    @@ -206,7 +206,7 @@
    redeemJunior: function
  • Parameters

    @@ -228,7 +228,7 @@
    redeemSenior: function
  • Parameters

    @@ -250,7 +250,7 @@
    supplyJunior: function
  • Parameters

    @@ -272,7 +272,7 @@
    supplySenior: function
  • Parameters

    @@ -301,7 +301,7 @@

    LenderActions

  • Type parameters

    diff --git a/docs/modules/_actions_proxy_.html b/docs/modules/_actions_proxy_.html index 99540f3..574c342 100644 --- a/docs/modules/_actions_proxy_.html +++ b/docs/modules/_actions_proxy_.html @@ -89,7 +89,7 @@

    IProxyActions

    IProxyActions: { buildProxy: any; checkProxyExists: any; getProxy: any; getProxyAccessToken: any; getProxyAccessTokenOwner: any; getProxyOwnerByAddress: any; getProxyOwnerByLoan: any; proxyCount: any; proxyCreateNew: any; proxyIssue: any; proxyLockBorrowWithdraw: any; proxyRepayUnlockClose: any; proxyTransferIssue: any }
    @@ -104,7 +104,7 @@
    buildProxy: function
  • Parameters

    @@ -126,7 +126,7 @@
    checkProxyExists: functi
  • Parameters

    @@ -148,7 +148,7 @@
    getProxy: function
  • Parameters

    @@ -170,7 +170,7 @@
    getProxyAccessToken:

    Parameters

    @@ -192,7 +192,7 @@
    getProxyAccessTokenOwner

    Parameters

    @@ -214,7 +214,7 @@
    getProxyOwnerByAddress:

    Parameters

    @@ -236,7 +236,7 @@
    getProxyOwnerByLoan:

    Parameters

    @@ -258,7 +258,7 @@
    proxyCount: function
  • Returns Promise<any>

    @@ -274,7 +274,7 @@
    proxyCreateNew: function
  • Parameters

    @@ -290,13 +290,13 @@

    Returns Promise
    proxyIssue: function
      -
    • proxyIssue(proxyAddr: string, nftRegistryAddr: string, tokenId: string): Promise<any>
    • +
    • proxyIssue(proxyAddr: string, nftRegistryAddr: string, tokenId: string): Promise<PendingTransaction>
    -

    Returns Promise<any>

    +

    Returns Promise<PendingTransaction>

  • @@ -324,7 +324,7 @@
    proxyLockBorrowWithdraw: <
  • Parameters

    @@ -355,7 +355,7 @@
    proxyRepayUnlockClose:

    Parameters

    @@ -380,13 +380,13 @@

    Returns Promise
    proxyTransferIssue: function
      -
    • proxyTransferIssue(proxyAddr: string, nftRegistryAddr: string, tokenId: string): Promise<any>
    • +
    • proxyTransferIssue(proxyAddr: string, nftRegistryAddr: string, tokenId: string): Promise<PendingTransaction>
    -

    Returns Promise<any>

    +

    Returns Promise<PendingTransaction>

  • @@ -421,7 +421,7 @@

    ProxyActions

  • Type parameters

    diff --git a/docs/modules/_services_ethereum_.html b/docs/modules/_services_ethereum_.html index d402b5d..5787ea8 100644 --- a/docs/modules/_services_ethereum_.html +++ b/docs/modules/_services_ethereum_.html @@ -99,7 +99,7 @@

    Const ZERO_ADDRESS

    ZERO_ADDRESS: "0x0000000000000000000000000000000000000000" = "0x0000000000000000000000000000000000000000"
    @@ -116,7 +116,7 @@

    executeAndRetry

  • Parameters

    @@ -142,7 +142,7 @@

    Const findEvent

  • Parameters

    @@ -209,7 +209,7 @@

    Const waitAndReturn

    Parameters

    @@ -241,7 +241,7 @@

    Const waitForTransactio
  • Parameters

    diff --git a/docs/modules/_tinlake_.html b/docs/modules/_tinlake_.html index f002249..18850f9 100644 --- a/docs/modules/_tinlake_.html +++ b/docs/modules/_tinlake_.html @@ -98,7 +98,7 @@

    Constructor

    Constructor<T>: {}

    Type parameters

    @@ -119,7 +119,7 @@

    ContractAbis

    ContractAbis: {}
    @@ -134,7 +134,7 @@

    ContractAddresses

    ContractAddresses: {}
    @@ -149,7 +149,7 @@

    ContractName

    ContractName: typeof contractNames[number]
    @@ -159,7 +159,7 @@

    Contracts

    Contracts: {}
    @@ -174,7 +174,7 @@

    EthConfig

    EthConfig: { from?: undefined | string; gas?: undefined | string; gasPrice?: undefined | string }
    @@ -198,7 +198,7 @@

    EthersConfig

    EthersConfig: { overrides?: EthersOverrides; provider: Provider; signer: Signer }
    @@ -222,7 +222,7 @@

    EthersOverrides

    EthersOverrides: { gasLimit?: undefined | number; gasPrice?: undefined | number }
    @@ -243,7 +243,7 @@

    PendingTransaction

    PendingTransaction: { hash: string | undefined; timesOutAt?: undefined | number }
    @@ -264,7 +264,7 @@

    TinlakeParams

    TinlakeParams: { contractAbis?: ContractAbis | {}; contractAddresses?: ContractAddresses | {}; contractConfig?: any | {}; contracts?: Contracts | {}; ethConfig?: EthConfig; ethOptions?: any | {}; ethersConfig?: EthersConfig; provider: any; transactionTimeout: number }
    diff --git a/docs/modules/_types_tinlake_.html b/docs/modules/_types_tinlake_.html index 486b034..96b02f6 100644 --- a/docs/modules/_types_tinlake_.html +++ b/docs/modules/_types_tinlake_.html @@ -87,7 +87,7 @@

    ITinlake

    @@ -97,7 +97,7 @@

    Investor

    Investor: { address: string; junior: { maxRedeem: BN; maxSupply: BN; tokenBalance: BN }; senior: { maxRedeem?: BN; maxSupply?: BN; tokenBalance?: BN } }
    @@ -143,7 +143,7 @@

    Loan

    Loan: { debt: BN; interestRate: BN; loanId: string; nft?: NFT; ownerOf: BN; price?: BN; principal: BN; proxyOwner?: undefined | string; registry: string; status?: undefined | string; threshold?: BN; tokenId: BN }
    @@ -194,7 +194,7 @@

    NFT

    NFT: { nftData: any; nftOwner: string; registry: string; tokenId: BN }
    @@ -221,7 +221,7 @@

    Tranche

    Tranche: { availableFunds: BN; interestRate?: BN; token: string; tokenPrice: BN; totalSupply: BN; type: string }
    diff --git a/docs/modules/_utils_basetodisplay_.html b/docs/modules/_utils_basetodisplay_.html index 5f45c80..8af3601 100644 --- a/docs/modules/_utils_basetodisplay_.html +++ b/docs/modules/_utils_basetodisplay_.html @@ -87,7 +87,7 @@

    Const baseToDisplay

  • Parameters

    diff --git a/docs/modules/_utils_bntohex_.html b/docs/modules/_utils_bntohex_.html index 87c0bc9..9046bbe 100644 --- a/docs/modules/_utils_bntohex_.html +++ b/docs/modules/_utils_bntohex_.html @@ -87,7 +87,7 @@

    Const bnToHex

  • Parameters

    diff --git a/docs/modules/_utils_displaytobase_.html b/docs/modules/_utils_displaytobase_.html index 78f0f6f..ce91d7c 100644 --- a/docs/modules/_utils_displaytobase_.html +++ b/docs/modules/_utils_displaytobase_.html @@ -87,7 +87,7 @@

    Const displayToBase

  • Parameters

    diff --git a/docs/modules/_utils_feetointerestrate_.html b/docs/modules/_utils_feetointerestrate_.html index bf3fcce..37d6168 100644 --- a/docs/modules/_utils_feetointerestrate_.html +++ b/docs/modules/_utils_feetointerestrate_.html @@ -87,7 +87,7 @@

    Const feeToInterestRate
  • diff --git a/docs/modules/_utils_getloanstatus_.html b/docs/modules/_utils_getloanstatus_.html index 5a614b2..357748b 100644 --- a/docs/modules/_utils_getloanstatus_.html +++ b/docs/modules/_utils_getloanstatus_.html @@ -89,7 +89,7 @@

    LoanStatus

    LoanStatus: "Whitelisted" | "Ongoing" | "Repaid"
    @@ -106,7 +106,7 @@

    getLoanStatus

  • Parameters

    diff --git a/docs/modules/_utils_interestratetofee_.html b/docs/modules/_utils_interestratetofee_.html index 67f51c3..bf4afd9 100644 --- a/docs/modules/_utils_interestratetofee_.html +++ b/docs/modules/_utils_interestratetofee_.html @@ -87,7 +87,7 @@

    Const interestRateToFee
  • diff --git a/src/Tinlake.ts b/src/Tinlake.ts index 58841b3..393528e 100644 --- a/src/Tinlake.ts +++ b/src/Tinlake.ts @@ -34,11 +34,6 @@ const contractNames = [ 'ALLOWANCE_OPERATOR', ] as const -type AbiOutput = { - name: string - type: 'address' | 'uint256' -} - export type PendingTransaction = { hash: string | undefined timesOutAt?: number @@ -88,7 +83,6 @@ export type TinlakeParams = { } export type Constructor = new (...args: any[]) => Tinlake - ;(ethers.utils.BigNumber as any).prototype.toBN = function () { return new BN((this as any).toString()) } @@ -195,15 +189,14 @@ export default class Tinlake { return new ethers.Contract(address, this.contractAbis[abiName], this.ethersConfig.provider) } - getContract(address: string, abiName: ContractName): ethers.Contract { - return new ethers.Contract(address, this.contractAbis[abiName], this.ethersConfig.signer) - } - contract(abiName: ContractName, address?: string): ethers.Contract { if (address) { return new ethers.Contract(address, this.contractAbis[abiName], this.ethersConfig.signer) + } if (this.ethersConfig.signer) { + return this.ethersContracts[abiName].connect(this.ethersConfig.signer) + } else { + return this.ethersContracts[abiName] } - return this.ethersContracts[abiName] } async pending(txPromise: Promise): Promise { diff --git a/src/actions/admin.ts b/src/actions/admin.ts index b2d884e..c1b538a 100644 --- a/src/actions/admin.ts +++ b/src/actions/admin.ts @@ -123,18 +123,9 @@ export function AdminActions>(Bas // ------------ admin functions lender-site ------------- setMinimumJuniorRatio = async (ratio: string) => { + const assessor = this.contract('ASSESSOR') // Source: https://github.com/ethereum/web3.js/issues/2256#issuecomment-462730550 - const tx = await this.ethersContracts['ASSESSOR'] - .connect(this.ethersConfig.signer) - .file(web3.fromAscii('minJuniorRatio').padEnd(66, '0'), ratio) - - console.log(this.transactionTimeout) - - return { - hash: tx.hash, - contractKey: 'ASSESSOR', - timesOutAt: Date.now() + this.transactionTimeout * 1000, - } + return this.pending(assessor.file(web3.fromAscii('minJuniorRatio').padEnd(66, '0'), ratio)) } approveAllowanceJunior = async (user: string, maxCurrency: string, maxToken: string) => { diff --git a/src/actions/analytics.ts b/src/actions/analytics.ts index 42f1804..83d7daa 100644 --- a/src/actions/analytics.ts +++ b/src/actions/analytics.ts @@ -7,49 +7,43 @@ export function AnalyticsActions> return class extends Base implements IAnalyticsActions { // borrower analytics getTotalDebt = async (): Promise => { - const res: { 0: BN } = await executeAndRetry(this.contracts['PILE'].total, []) - return res[0] + return (await this.contract('PILE').total()).toBN() } getTotalBalance = async (): Promise => { - const res: { 0: BN } = await executeAndRetry(this.contracts['SHELF'].balance, []) - return res[0] + return (await this.contract('SHELF').balance()).toBN() } getPrincipal = async (loanId: string): Promise => { - const res = await executeAndRetry(this.contracts['CEILING'].ceiling, [loanId]) - return res ? res[0] : new BN(0) + return (await this.contract('CEILING').ceiling(loanId)).toBN() } - getDebt = async (loanID: string): Promise => { - const res = await executeAndRetry(this.contracts['PILE'].debt, [loanID]) - return res ? res[0] : new BN(0) + getDebt = async (loanId: string): Promise => { + return (await this.contract('PILE').debt(loanId)).toBN() } loanCount = async (): Promise => { - const res: { 0: BN } = await executeAndRetry(this.contracts['TITLE'].count, []) - return res[0] + return (await this.contract('TITLE').count()).toBN() } getCollateral = async (loanId: string): Promise => { - const res = await executeAndRetry(this.contracts['SHELF'].shelf, [loanId]) - return res + return await this.contract('SHELF').shelf(loanId) } - getOwnerOfCollateral = async (nftRegistryAddr: string, tokenId: string): Promise => { - return await this.getContract(nftRegistryAddr, 'COLLATERAL_NFT').ownerOf(tokenId) - - // const nft: any = this.eth.contract(this.contractAbis['COLLATERAL_NFT']).at(nftRegistryAddr); - // const res : { 0: BN } = await executeAndRetry(nft.ownerOf, [tokenId]); - // return res[0]; + getOwnerOfCollateral = async (nftRegistryAddress: string, tokenId: string): Promise => { + return this.contract('COLLATERAL_NFT', nftRegistryAddress).ownerOf(tokenId) } getInterestRate = async (loanId: string): Promise => { // retrieve nftId = hash from tokenID & registry - const nftId = (await executeAndRetry(this.contracts['NFT_FEED'].nftID, [loanId]))[0] - // retrieve riskgroup fro nft - const riskGroupRes: { 0: BN } = await executeAndRetry(this.contracts['NFT_FEED'].risk, [nftId]) - const riskGroup = riskGroupRes[0] || new BN(0) + const nftId = await this.contract('NFT_FEED').nftID(loanId) + + // retrieve riskgroup from nft + const riskGroup = await this.contract('NFT_FEED').risk(nftId) + + // retrieve rates for this risk group + const resEthers = await this.contract('PILE').rates(riskGroup) + console.log('getInterestRate res', resEthers) const res = await executeAndRetry(this.contracts['PILE'].rates, [riskGroup]) return res ? res[2] : new BN(0) } @@ -57,8 +51,7 @@ export function AnalyticsActions> getOwnerOfLoan = async (loanId: string): Promise => { let address try { - const res = await executeAndRetry(this.contracts['TITLE'].ownerOf, [loanId]) - address = res[0] + address = await this.contract('TITLE').ownerOf(loanId) } catch (e) { address = ZERO_ADDRESS } @@ -135,28 +128,23 @@ export function AnalyticsActions> } getJuniorTokenBalance = async (user: string) => { - const res: { 0: BN } = await executeAndRetry(this.contracts['JUNIOR_TOKEN'].balanceOf, [user]) - return res[0] + return (await this.contract('JUNIOR_TOKEN').balanceOf(user)).toBN() } - getJuniorTotalSupply = async (user: string) => { - const res: { 0: BN } = await executeAndRetry(this.contracts['JUNIOR_TOKEN'].totalSupply, []) - return res[0] + getJuniorTotalSupply = async () => { + return (await this.contract('JUNIOR_TOKEN').totalSupply()).toBN() } getMaxSupplyAmountJunior = async (user: string) => { - const res: { 0: BN } = await executeAndRetry(this.contracts['JUNIOR_OPERATOR'].maxCurrency, [user]) - return res[0] + return (await this.contract('JUNIOR_TOKEN').maxCurrency(user)).toBN() } getMaxRedeemAmountJunior = async (user: string) => { - const res = await executeAndRetry(this.contracts['JUNIOR_OPERATOR'].maxToken, [user]) - return res[0] + return (await this.contract('JUNIOR_TOKEN').maxToken(user)).toBN() } getTokenPriceJunior = async () => { - const res = await executeAndRetry(this.contracts['ASSESSOR'].calcTokenPrice, [this.contractAddresses['JUNIOR']]) - return res[0] + return (await this.contract('ASSESSOR').calcTokenPrice(this.contractAddresses['JUNIOR'])).toBN() } existsSenior = () => { @@ -164,19 +152,13 @@ export function AnalyticsActions> } getSeniorTokenBalance = async (user: string) => { - if (!this.existsSenior()) { - return new BN(0) - } - const res: { 0: BN } = await executeAndRetry(this.contracts['SENIOR_TOKEN'].balanceOf, [user]) - return res[0] + if (!this.existsSenior()) return new BN(0) + return (await this.contract('SENIOR_TOKEN').balanceOf(user)).toBN() } - getSeniorTotalSupply = async (user: string) => { - if (!this.existsSenior()) { - return new BN(0) - } - const res: { 0: BN } = await executeAndRetry(this.contracts['SENIOR_TOKEN'].totalSupply, []) - return res[0] + getSeniorTotalSupply = async () => { + if (!this.existsSenior()) return new BN(0) + return (await this.contract('SENIOR_TOKEN').totalSupply()).toBN() } getMaxSupplyAmountSenior = async (user: string) => { @@ -186,16 +168,13 @@ export function AnalyticsActions> let maxSupply: BN switch (operatorType) { case 'PROPORTIONAL_OPERATOR': - const supplyLimitRes: { 0: BN } = await executeAndRetry(this.contracts['SENIOR_OPERATOR'].supplyMaximum, [ - user, - ]) - const suppliedRes: { 0: BN } = await executeAndRetry(this.contracts['SENIOR_OPERATOR'].tokenReceived, [user]) - maxSupply = supplyLimitRes[0].sub(suppliedRes[0]) + const supplyLimit = (await this.contract('SENIOR_OPERATOR').supplyMaximum(user)).toBN() + const supplied = (await this.contract('SENIOR_OPERATOR').tokenReceived(user)).toBN() + maxSupply = supplyLimit.sub(supplied) break case 'ALLOWANCE_OPERATOR': - const res: { 0: BN } = await executeAndRetry(this.contracts['SENIOR_OPERATOR'].maxCurrency, [user]) - maxSupply = res[0] + maxSupply = (await this.contract('SENIOR_OPERATOR').maxCurrency(user)).toBN() break default: maxSupply = new BN(0) @@ -261,39 +240,31 @@ export function AnalyticsActions> } getJuniorReserve = async () => { - const res: { 0: BN } = await executeAndRetry(this.contracts['JUNIOR'].balance, []) - return res[0] || new BN(0) + return (await this.contract('JUNIOR').balance()).toBN() } getMinJuniorRatio = async () => { - const res: { 0: BN } = await executeAndRetry(this.contracts['ASSESSOR'].minJuniorRatio, []) - return res[0] || new BN(0) + return (await this.contract('ASSESSOR').minJuniorRatio()).toBN() } getCurrentJuniorRatio = async () => { - const res: { 0: BN } = await executeAndRetry(this.contracts['ASSESSOR'].currentJuniorRatio, []) - return res[0] || new BN(0) + return (await this.contract('ASSESSOR').currentJuniorRatio()).toBN() } getAssetValueJunior = async () => { - const res: { 0: BN } = await executeAndRetry(this.contracts['ASSESSOR'].calcAssetValue, [ - this.contractAddresses['JUNIOR'], - ]) - return res[0] || new BN(0) + return (await this.contract('ASSESSOR').calcAssetValue(this.contractAddresses['JUNIOR'])).toBN() } getSeniorDebt = async () => { if (this.contractAddresses['SENIOR'] !== ZERO_ADDRESS) { - const res: { 0: BN } = await executeAndRetry(this.contracts['SENIOR'].debt, []) - return res[0] || new BN(0) + return (await this.contract('SENIOR').debt()).toBN() } return new BN(0) } getSeniorInterestRate = async () => { if (this.contractAddresses['SENIOR'] !== ZERO_ADDRESS) { - const res: { 0: BN } = await executeAndRetry(this.contracts['SENIOR'].ratePerSecond, []) - return res[0] || new BN(0) + return (await this.contract('SENIOR').ratePerSecond()).toBN() } return new BN(0) } diff --git a/src/actions/collateral.ts b/src/actions/collateral.ts index 2bbb9d7..47a172b 100644 --- a/src/actions/collateral.ts +++ b/src/actions/collateral.ts @@ -29,22 +29,18 @@ export function CollateralActions return this.pending(nft.mint(owner, tokenId, ref, amount, asset)) } - approveNFT = async (nftAddr: string, tokenId: string, to: string) => { - const nft: any = this.eth.contract(this.contractAbis['COLLATERAL_NFT']).at(nftAddr) - const txHash = await executeAndRetry(nft.approve, [to, tokenId, this.ethConfig]) - console.log(`[NFT Approve] txHash: ${txHash}`) - return waitAndReturnEvents(this.eth, txHash, this.contractAbis['COLLATERAL_NFT'], this.transactionTimeout) + approveNFT = async (nftAddress: string, tokenId: string, to: string) => { + const nft = this.contract('COLLATERAL_NFT', nftAddress) + return this.pending(nft.approve(to, tokenId)) } - setNFTApprovalForAll = async (nftAddr: string, to: string, approved: boolean) => { - const nftContract = this.getContract(nftAddr, 'COLLATERAL_NFT') - const tx = await nftContract.setApprovalForAll(to, approved) - - return this.pending(tx) + setNFTApprovalForAll = async (nftAddress: string, to: string, approved: boolean) => { + const nft = this.contract('COLLATERAL_NFT', nftAddress) + return this.pending(nft.setApprovalForAll(to, approved)) } - isNFTApprovedForAll = async (nftAddr: string, owner: string, operator: string) => { - return await this.getContract(nftAddr, 'COLLATERAL_NFT').isApprovedForAll(owner, operator) + isNFTApprovedForAll = async (nftAddress: string, owner: string, operator: string) => { + return this.contract('COLLATERAL_NFT', nftAddress).isApprovedForAll(owner, operator) } getNFTCount = async (nftAddr: string): Promise => { @@ -53,23 +49,16 @@ export function CollateralActions return res[0] } - getNFTData = async (nftAddr: string, tokenId: string): Promise => { - return this.getContract(nftAddr, 'COLLATERAL_NFT').data(tokenId) - - // const nft: any = this.eth.contract(this.contractAbis['COLLATERAL_NFT']).at(nftAddr); - // const res = await executeAndRetry(nft.data, [tokenId]); - // return res; + getNFTData = async (nftAddress: string, tokenId: string): Promise => { + return this.contract('COLLATERAL_NFT', nftAddress).data(tokenId) } - getNFTOwner = async (nftAddr: string, tokenId: string): Promise => { - return await this.getContract(nftAddr, 'COLLATERAL_NFT').ownerOf(tokenId) - // const nft: any = this.eth.contract(this.contractAbis['COLLATERAL_NFT']).at(nftAddr); - // const res : { 0: BN } = await executeAndRetry(nft.ownerOf, [tokenId]); - // return res[0]; + getNFTOwner = async (nftAddresss: string, tokenId: string): Promise => { + return this.contract('COLLATERAL_NFT', nftAddresss).ownerOf(tokenId) } - transferNFT = async (nftAddr: string, from: string, to: string, tokenId: string) => { - const nft: any = this.eth.contract(this.contractAbis['COLLATERAL_NFT']).at(nftAddr) + transferNFT = async (nftAddress: string, from: string, to: string, tokenId: string) => { + const nft: any = this.eth.contract(this.contractAbis['COLLATERAL_NFT']).at(nftAddress) const txHash = await executeAndRetry(nft.transferFrom, [from, to, tokenId, this.ethConfig]) console.log(`[NFT Approve] txHash: ${txHash}`) return waitAndReturnEvents(this.eth, txHash, this.contractAbis['COLLATERAL_NFT'], this.transactionTimeout) @@ -87,7 +76,7 @@ export type ICollateralActions = { amount: string, asset: string ): Promise - approveNFT(nftAddr: string, tokenId: string, to: string): Promise + approveNFT(nftAddr: string, tokenId: string, to: string): Promise setNFTApprovalForAll(nftAddr: string, to: string, approved: boolean): Promise isNFTApprovedForAll(nftAddr: string, owner: string, operator: string): Promise getNFTCount(nftAddr: string): Promise diff --git a/src/actions/currency.ts b/src/actions/currency.ts index 5ffada9..0058996 100644 --- a/src/actions/currency.ts +++ b/src/actions/currency.ts @@ -12,7 +12,7 @@ export function CurrencyActions>( } getCurrencyAllowance = async (owner: string, spender: string) => { - const currencyContract = this.getContract(this.contractAddresses['TINLAKE_CURRENCY']!, 'TINLAKE_CURRENCY') + const currencyContract = this.contract('TINLAKE_CURRENCY') const allowance = await currencyContract.allowance(owner, spender) return allowance.toBN() } @@ -33,7 +33,7 @@ export function CurrencyActions>( } approveCurrency = async (usr: string, currencyAmount: string) => { - const currencyContract = this.getContract(this.contractAddresses['TINLAKE_CURRENCY']!, 'TINLAKE_CURRENCY') + const currencyContract = this.contract('TINLAKE_CURRENCY') const tx = await currencyContract.approve(usr, currencyAmount) return { diff --git a/src/actions/lender.ts b/src/actions/lender.ts index 154f34c..e1ad55d 100644 --- a/src/actions/lender.ts +++ b/src/actions/lender.ts @@ -6,12 +6,8 @@ export function LenderActions>(Bas return class extends Base implements ILenderActions { // senior tranche functions supplySenior = async (currencyAmount: string) => { - const tx = await this.ethersContracts['SENIOR_OPERATOR'].connect(this.ethersConfig.signer).supply(currencyAmount) - - return { - hash: tx.hash, - contractKey: 'SENIOR_OPERATOR', - } + const seniorOperator = this.contract('SENIOR_OPERATOR') + return this.pending(seniorOperator.supply(currencyAmount)) } redeemSenior = async (tokenAmount: string) => { @@ -40,12 +36,8 @@ export function LenderActions>(Bas // junior tranche functions supplyJunior = async (currencyAmount: string) => { - const tx = await this.ethersContracts['JUNIOR_OPERATOR'].connect(this.ethersConfig.signer).supply(currencyAmount) - - return { - hash: tx.hash, - contractKey: 'JUNIOR_OPERATOR', - } + const juniorOperator = this.contract('JUNIOR_OPERATOR') + return this.pending(juniorOperator.supply(currencyAmount)) } redeemJunior = async (tokenAmount: string) => { diff --git a/src/actions/proxy.ts b/src/actions/proxy.ts index be3620f..1374d70 100644 --- a/src/actions/proxy.ts +++ b/src/actions/proxy.ts @@ -1,4 +1,4 @@ -import { Constructor, TinlakeParams } from '../Tinlake' +import { Constructor, TinlakeParams, PendingTransaction } from '../Tinlake' import { waitAndReturnEvents, executeAndRetry } from '../services/ethereum' const abiCoder = require('web3-eth-abi') import BN from 'bn.js' @@ -7,9 +7,7 @@ import { ethers } from 'ethers' export function ProxyActions>(Base: ActionsBase) { return class extends Base implements IProxyActions { getProxyAccessTokenOwner = async (tokenId: string): Promise => { - return await this.ethersContracts['PROXY_REGISTRY'].ownerOf(tokenId) - // const res : { 0: BN } = await executeAndRetry(this.contracts['PROXY_REGISTRY'].ownerOf, [tokenId]); - // return res[0]; + return this.contract('PROXY_REGISTRY').ownerOf(tokenId) } buildProxy = async (owner: string) => { @@ -29,14 +27,10 @@ export function ProxyActions>(Bas return res[0] } - getProxyAccessToken = async (proxyAddr: string) => { - const proxy = this.getContract(proxyAddr, 'PROXY') + getProxyAccessToken = async (proxyAddress: string) => { + const proxy = this.contract('PROXY', proxyAddress) const accessToken = await proxy.accessToken() return accessToken.toNumber() - - // const proxy: any = this.eth.contract(this.contractAbis['PROXY']).at(proxyAddr); - // const res = await executeAndRetry(proxy.accessToken, []); - // return res[0].toNumber(); } getProxyOwnerByLoan = async (loanId: string) => { @@ -73,9 +67,8 @@ export function ProxyActions>(Bas return this.getProxy(accessToken) } - proxyIssue = async (proxyAddr: string, nftRegistryAddr: string, tokenId: string) => { - const proxy = this.getContract(proxyAddr, 'PROXY') - + proxyIssue = async (proxyAddress: string, nftRegistryAddress: string, tokenId: string) => { + const proxy = this.contract('PROXY', proxyAddress) const encoded = abiCoder.encodeFunctionCall( { name: 'issue', @@ -86,22 +79,14 @@ export function ProxyActions>(Bas { type: 'uint256', name: 'token' }, ], }, - [this.ethersContracts['SHELF'].address, nftRegistryAddr, tokenId] + [this.contract('SHELF').address, nftRegistryAddress, tokenId] ) - const tx = await proxy.execute(this.ethersContracts['ACTIONS'].address, encoded) - - return { - hash: tx.hash, - contractKey: 'PROXY', - } + return this.pending(proxy.execute(this.contract('ACTIONS').address, encoded)) } - proxyTransferIssue = async (proxyAddr: string, nftRegistryAddr: string, tokenId: string) => { - const proxy = this.getContract(proxyAddr, 'PROXY') - - // const proxy: any = this.eth.contract(this.contractAbis['PROXY']).at(PROXY); - + proxyTransferIssue = async (proxyAddress: string, nftRegistryAddress: string, tokenId: string) => { + const proxy = this.contract('PROXY', proxyAddress) const encoded = abiCoder.encodeFunctionCall( { name: 'transferIssue', @@ -112,15 +97,10 @@ export function ProxyActions>(Bas { type: 'uint256', name: 'token' }, ], }, - [this.ethersContracts['SHELF'].address, nftRegistryAddr, tokenId] + [this.contract('SHELF').address, nftRegistryAddress, tokenId] ) - const tx = await proxy.execute(this.ethersContracts['ACTIONS'].address, encoded) - - return { - hash: tx.hash, - contractKey: 'PROXY', - } + return this.pending(proxy.execute(this.contract('ACTIONS').address, encoded)) } proxyLockBorrowWithdraw = async (proxyAddr: string, loanId: string, amount: string, usr: string) => { @@ -184,8 +164,8 @@ export type IProxyActions = { getProxyOwnerByLoan(loanId: string): Promise getProxyOwnerByAddress(proxyAddr: string): Promise proxyCreateNew(address: string): Promise - proxyIssue(proxyAddr: string, nftRegistryAddr: string, tokenId: string): Promise - proxyTransferIssue(proxyAddr: string, nftRegistryAddr: string, tokenId: string): Promise + proxyIssue(proxyAddr: string, nftRegistryAddr: string, tokenId: string): Promise + proxyTransferIssue(proxyAddr: string, nftRegistryAddr: string, tokenId: string): Promise proxyLockBorrowWithdraw(proxyAddr: string, loanId: string, amount: string, usr: string): Promise proxyRepayUnlockClose(proxyAddr: string, tokenId: string, loanId: string, registry: string): Promise } diff --git a/src/test/utils.ts b/src/test/utils.ts index 6078335..bcda736 100644 --- a/src/test/utils.ts +++ b/src/test/utils.ts @@ -52,7 +52,6 @@ function createSignerProvider(rpcUrl: string, usr: Account) { }) } - function createEthersConfig(rpcUrl: string) { const provider = new ethers.providers.JsonRpcProvider(rpcUrl) const signer = provider.getSigner() From a219e89ace576803cb28704aaaf0a9ce5c3c3458 Mon Sep 17 00:00:00 2001 From: Jeroen Offerijns Date: Wed, 26 Aug 2020 19:46:13 +0200 Subject: [PATCH 10/65] chore: format --- docs/classes/_tinlake_.tinlake.html | 44 +++++++------- docs/interfaces/_services_ethereum_.ethi.html | 16 ++--- .../_services_ethereum_.events.html | 6 +- docs/modules/_actions_admin_.html | 30 +++++----- docs/modules/_actions_analytics_.html | 60 +++++++++---------- docs/modules/_actions_borrower_.html | 20 +++---- docs/modules/_actions_collateral_.html | 22 +++---- docs/modules/_actions_currency_.html | 10 ++-- docs/modules/_actions_governance_.html | 4 +- docs/modules/_actions_index_.html | 2 +- docs/modules/_actions_lender_.html | 18 +++--- docs/modules/_actions_proxy_.html | 30 +++++----- docs/modules/_services_ethereum_.html | 10 ++-- docs/modules/_tinlake_.html | 20 +++---- docs/modules/_types_tinlake_.html | 10 ++-- docs/modules/_utils_basetodisplay_.html | 2 +- docs/modules/_utils_bntohex_.html | 2 +- docs/modules/_utils_displaytobase_.html | 2 +- docs/modules/_utils_feetointerestrate_.html | 2 +- docs/modules/_utils_getloanstatus_.html | 4 +- docs/modules/_utils_interestratetofee_.html | 2 +- src/Tinlake.ts | 4 +- 22 files changed, 160 insertions(+), 160 deletions(-) diff --git a/docs/classes/_tinlake_.tinlake.html b/docs/classes/_tinlake_.tinlake.html index 2420af2..6c0d748 100644 --- a/docs/classes/_tinlake_.tinlake.html +++ b/docs/classes/_tinlake_.tinlake.html @@ -129,7 +129,7 @@

    constructor

  • Parameters

    @@ -151,7 +151,7 @@

    contractAbis

    contractAbis: ContractAbis
    @@ -161,7 +161,7 @@

    contractAddresses

    contractAddresses: ContractAddresses
    @@ -171,7 +171,7 @@

    contractConfig

    contractConfig: any
    @@ -181,7 +181,7 @@

    contracts

    contracts: Contracts
    @@ -191,7 +191,7 @@

    eth

    eth: ethI
    @@ -201,7 +201,7 @@

    ethConfig

    ethConfig: EthConfig
    @@ -211,7 +211,7 @@

    ethOptions

    ethOptions: any
    @@ -221,7 +221,7 @@

    ethersConfig

    ethersConfig: EthersConfig
    @@ -231,7 +231,7 @@

    ethersContracts

    ethersContracts: Contracts
    @@ -241,7 +241,7 @@

    provider

    provider: any
    @@ -251,7 +251,7 @@

    transactionTimeout

    transactionTimeout: number
    @@ -268,7 +268,7 @@

    contract

  • Parameters

    @@ -294,7 +294,7 @@

    createContract

  • Parameters

    @@ -320,7 +320,7 @@

    createEthContract

  • Parameters

    @@ -346,7 +346,7 @@

    getOperatorType

  • Parameters

    @@ -369,7 +369,7 @@

    getTransactionReceipt

  • Parameters

    @@ -392,7 +392,7 @@

    pending

  • Parameters

    @@ -415,7 +415,7 @@

    setContracts

  • Returns void

    @@ -432,7 +432,7 @@

    setEthConfig

  • Parameters

    @@ -455,7 +455,7 @@

    setEthersConfig

  • Parameters

    @@ -478,7 +478,7 @@

    setProvider

  • Parameters

    diff --git a/docs/interfaces/_services_ethereum_.ethi.html b/docs/interfaces/_services_ethereum_.ethi.html index 458707a..4d1c816 100644 --- a/docs/interfaces/_services_ethereum_.ethi.html +++ b/docs/interfaces/_services_ethereum_.ethi.html @@ -101,7 +101,7 @@

    abi

    abi: any
    @@ -111,7 +111,7 @@

    contract

    contract: (arg0: any) => { at: (arg0: any) => void }
    @@ -165,7 +165,7 @@

    getTransactionByHash

    getTransactionByHash: (arg0: any, arg1: (err: any, tx: any) => void) => void
    @@ -220,7 +220,7 @@

    getTransactionCount

    getTransactionCount: any
    @@ -230,7 +230,7 @@

    getTransactionReceipt

    getTransactionReceipt: (arg0: any, arg1: (err: any, receipt: any) => void) => void
    @@ -285,7 +285,7 @@

    send

    send: Function
    @@ -295,7 +295,7 @@

    sendRawTransaction

    sendRawTransaction: any
    @@ -305,7 +305,7 @@

    web3_sha3

    web3_sha3: (signature: string) => string
    diff --git a/docs/interfaces/_services_ethereum_.events.html b/docs/interfaces/_services_ethereum_.events.html index 852e79b..b963923 100644 --- a/docs/interfaces/_services_ethereum_.events.html +++ b/docs/interfaces/_services_ethereum_.events.html @@ -96,7 +96,7 @@

    events

    events: { data: any[]; event: { name: any } }[]
    @@ -106,7 +106,7 @@

    status

    status: any
    @@ -116,7 +116,7 @@

    txHash

    txHash: string
    diff --git a/docs/modules/_actions_admin_.html b/docs/modules/_actions_admin_.html index 56d6c07..e9ee7af 100644 --- a/docs/modules/_actions_admin_.html +++ b/docs/modules/_actions_admin_.html @@ -89,7 +89,7 @@

    IAdminActions

    IAdminActions: { approveAllowanceJunior: any; approveAllowanceSenior: any; canSetInterestRate: any; canSetInvestorAllowanceJunior: any; canSetInvestorAllowanceSenior: any; canSetLoanPrice: any; canSetMinimumJuniorRatio: any; canSetRiskScore: any; canSetSeniorTrancheInterest: any; initRate: any; isWard: any; setMinimumJuniorRatio: any; setRate: any }
    @@ -104,7 +104,7 @@
    approveAllowanceJunior:
  • Parameters

    @@ -132,7 +132,7 @@
    approveAllowanceSenior:
  • Parameters

    @@ -160,7 +160,7 @@
    canSetInterestRate:

    Parameters

    @@ -182,7 +182,7 @@
    canSetInvestorAllowanceJunior

    Parameters

    @@ -204,7 +204,7 @@
    canSetInvestorAllowanceSenior

    Parameters

    @@ -226,7 +226,7 @@
    canSetLoanPrice: fu
  • Parameters

    @@ -248,7 +248,7 @@
    canSetMinimumJuniorRatio

    Parameters

    @@ -270,7 +270,7 @@
    canSetRiskScore: fu
  • Parameters

    @@ -292,7 +292,7 @@
    canSetSeniorTrancheInterest

    Parameters

    @@ -314,7 +314,7 @@
    initRate: function
  • Parameters

    @@ -336,7 +336,7 @@
    isWard: function
  • Parameters

    @@ -361,7 +361,7 @@
    setMinimumJuniorRatio:

    Parameters

    @@ -383,7 +383,7 @@
    setRate: function
  • Parameters

    @@ -415,7 +415,7 @@

    AdminActions

  • Type parameters

    diff --git a/docs/modules/_actions_analytics_.html b/docs/modules/_actions_analytics_.html index 428a0c4..cb8c85b 100644 --- a/docs/modules/_actions_analytics_.html +++ b/docs/modules/_actions_analytics_.html @@ -89,7 +89,7 @@

    IAnalyticsActions

    IAnalyticsActions: { existsSenior: any; getAssetValueJunior: any; getCollateral: any; getCurrentJuniorRatio: any; getDebt: any; getInterestRate: any; getInvestor: any; getJuniorReserve: any; getJuniorTokenBalance: any; getLoan: any; getLoanList: any; getMaxRedeemAmountJunior: any; getMaxRedeemAmountSenior: any; getMaxSupplyAmountJunior: any; getMaxSupplyAmountSenior: any; getMinJuniorRatio: any; getOwnerOfCollateral: any; getOwnerOfLoan: any; getPrincipal: any; getSeniorDebt: any; getSeniorInterestRate: any; getSeniorReserve: any; getSeniorTokenBalance: any; getTokenPriceJunior: any; getTokenPriceSenior: any; getTotalBalance: any; getTotalDebt: any; loanCount: any }
    @@ -104,7 +104,7 @@
    existsSenior: function
  • Returns boolean

    @@ -120,7 +120,7 @@
    getAssetValueJunior:

    Returns Promise<BN>

    @@ -136,7 +136,7 @@
    getCollateral: function
  • Parameters

    @@ -158,7 +158,7 @@
    getCurrentJuniorRatio:

    Returns Promise<BN>

    @@ -174,7 +174,7 @@
    getDebt: function
  • Parameters

    @@ -196,7 +196,7 @@
    getInterestRate: functio
  • Parameters

    @@ -218,7 +218,7 @@
    getInvestor: function
  • Parameters

    @@ -240,7 +240,7 @@
    getJuniorReserve: functi
  • Returns Promise<BN>

    @@ -256,7 +256,7 @@
    getJuniorTokenBalance:

    Parameters

    @@ -278,7 +278,7 @@
    getLoan: function
  • Parameters

    @@ -300,7 +300,7 @@
    getLoanList: function

    Returns Promise<Loan[]>

    @@ -316,7 +316,7 @@
    getMaxRedeemAmountJunior

    Parameters

    @@ -338,7 +338,7 @@
    getMaxRedeemAmountSenior

    Parameters

    @@ -360,7 +360,7 @@
    getMaxSupplyAmountJunior

    Parameters

    @@ -382,7 +382,7 @@
    getMaxSupplyAmountSenior

    Parameters

    @@ -404,7 +404,7 @@
    getMinJuniorRatio:
  • Returns Promise<BN>

    @@ -420,7 +420,7 @@
    getOwnerOfCollateral: fu
  • Parameters

    @@ -448,7 +448,7 @@
    getOwnerOfLoan: function
  • Parameters

    @@ -470,7 +470,7 @@
    getPrincipal: function
  • Parameters

    @@ -492,7 +492,7 @@
    getSeniorDebt: function<
  • Returns Promise<BN>

    @@ -508,7 +508,7 @@
    getSeniorInterestRate:

    Returns Promise<BN>

    @@ -524,7 +524,7 @@
    getSeniorReserve: functi
  • Returns Promise<BN>

    @@ -540,7 +540,7 @@
    getSeniorTokenBalance:

    Parameters

    @@ -562,7 +562,7 @@
    getTokenPriceJunior:

    Returns Promise<BN>

    @@ -578,7 +578,7 @@
    getTokenPriceSenior:

    Parameters

    @@ -600,7 +600,7 @@
    getTotalBalance: functio
  • Returns Promise<BN>

    @@ -616,7 +616,7 @@
    getTotalDebt: function

    Returns Promise<BN>

    @@ -632,7 +632,7 @@
    loanCount: function
  • Returns Promise<BN>

    @@ -655,7 +655,7 @@

    AnalyticsActions

  • Type parameters

    diff --git a/docs/modules/_actions_borrower_.html b/docs/modules/_actions_borrower_.html index 864aa4c..dc92e31 100644 --- a/docs/modules/_actions_borrower_.html +++ b/docs/modules/_actions_borrower_.html @@ -89,7 +89,7 @@

    IBorrowerActions

    IBorrowerActions: { borrow: any; close: any; issue: any; lock: any; nftLookup: any; repay: any; unlock: any; withdraw: any }
    @@ -104,7 +104,7 @@
    borrow: function
  • Parameters

    @@ -129,7 +129,7 @@
    close: function
  • Parameters

    @@ -151,7 +151,7 @@
    issue: function
  • Parameters

    @@ -176,7 +176,7 @@
    lock: function
  • Parameters

    @@ -198,7 +198,7 @@
    nftLookup: function
  • Parameters

    @@ -223,7 +223,7 @@
    repay: function
  • Parameters

    @@ -248,7 +248,7 @@
    unlock: function
  • Parameters

    @@ -270,7 +270,7 @@
    withdraw: function
  • Parameters

    @@ -305,7 +305,7 @@

    BorrowerActions

  • Type parameters

    diff --git a/docs/modules/_actions_collateral_.html b/docs/modules/_actions_collateral_.html index 05c86ba..4e8499b 100644 --- a/docs/modules/_actions_collateral_.html +++ b/docs/modules/_actions_collateral_.html @@ -89,7 +89,7 @@

    ICollateralActions

    ICollateralActions: { approveNFT: any; getNFTCount: any; getNFTData: any; getNFTOwner: any; isNFTApprovedForAll: any; mintNFT: any; mintTitleNFT: any; setNFTApprovalForAll: any; transferNFT: any }
    @@ -104,7 +104,7 @@
    approveNFT: function
  • Parameters

    @@ -132,7 +132,7 @@
    getNFTCount: function
  • Parameters

    @@ -154,7 +154,7 @@
    getNFTData: function
  • Parameters

    @@ -179,7 +179,7 @@
    getNFTOwner: function
  • Parameters

    @@ -204,7 +204,7 @@
    isNFTApprovedForAll: fun
  • Parameters

    @@ -232,7 +232,7 @@
    mintNFT: function
  • Parameters

    @@ -269,7 +269,7 @@
    mintTitleNFT: function
  • Parameters

    @@ -294,7 +294,7 @@
    setNFTApprovalForAll: fu
  • Parameters

    @@ -322,7 +322,7 @@
    transferNFT: function
  • Parameters

    @@ -360,7 +360,7 @@

    CollateralActions

  • Type parameters

    diff --git a/docs/modules/_actions_currency_.html b/docs/modules/_actions_currency_.html index df3d275..f82f132 100644 --- a/docs/modules/_actions_currency_.html +++ b/docs/modules/_actions_currency_.html @@ -89,7 +89,7 @@

    ICurrencyActions

    ICurrencyActions: { approveJuniorForCurrency: (currencyAmount: string) => Promise<PendingTransaction | undefined>; approveSeniorForCurrency: (currencyAmount: string) => Promise<PendingTransaction | undefined>; getCurrencyAllowance: (owner: string, spender: string) => Promise<BN>; getJuniorForCurrencyAllowance: (owner: string) => Promise<BN | undefined>; getSeniorForCurrencyAllowance: (owner: string) => Promise<BN | undefined>; approveCurrency: any; getCurrencyBalance: any; mintCurrency: any }
    @@ -212,7 +212,7 @@
    approveCurrency: function

    Parameters

    @@ -237,7 +237,7 @@
    getCurrencyBalance: func
  • Parameters

    @@ -259,7 +259,7 @@
    mintCurrency: function
  • Parameters

    @@ -291,7 +291,7 @@

    CurrencyActions

  • Type parameters

    diff --git a/docs/modules/_actions_governance_.html b/docs/modules/_actions_governance_.html index d6f1ce6..5df9d37 100644 --- a/docs/modules/_actions_governance_.html +++ b/docs/modules/_actions_governance_.html @@ -83,7 +83,7 @@

    IGovernanceActions

    IGovernanceActions: { relyAddress: any }
    @@ -98,7 +98,7 @@
    relyAddress: function
  • Parameters

    diff --git a/docs/modules/_actions_index_.html b/docs/modules/_actions_index_.html index bd3f834..9fed7e5 100644 --- a/docs/modules/_actions_index_.html +++ b/docs/modules/_actions_index_.html @@ -83,7 +83,7 @@

    TinlakeActions

    diff --git a/docs/modules/_actions_lender_.html b/docs/modules/_actions_lender_.html index 7572bb7..1c93f36 100644 --- a/docs/modules/_actions_lender_.html +++ b/docs/modules/_actions_lender_.html @@ -89,7 +89,7 @@

    ILenderActions

    ILenderActions: { approveJuniorToken: (tokenAmount: string) => Promise<unknown>; approveSeniorToken: (tokenAmount: string) => Promise<unknown>; balance: any; getJuniorTokenAllowance: any; getSeniorTokenAllowance: any; redeemJunior: any; redeemSenior: any; supplyJunior: any; supplySenior: any }
    @@ -146,7 +146,7 @@
    balance: function
  • Returns Promise<any>

    @@ -162,7 +162,7 @@
    getJuniorTokenAllowance: <
  • Parameters

    @@ -184,7 +184,7 @@
    getSeniorTokenAllowance: <
  • Parameters

    @@ -206,7 +206,7 @@
    redeemJunior: function
  • Parameters

    @@ -228,7 +228,7 @@
    redeemSenior: function
  • Parameters

    @@ -250,7 +250,7 @@
    supplyJunior: function
  • Parameters

    @@ -272,7 +272,7 @@
    supplySenior: function
  • Parameters

    @@ -301,7 +301,7 @@

    LenderActions

  • Type parameters

    diff --git a/docs/modules/_actions_proxy_.html b/docs/modules/_actions_proxy_.html index 574c342..720d5ac 100644 --- a/docs/modules/_actions_proxy_.html +++ b/docs/modules/_actions_proxy_.html @@ -89,7 +89,7 @@

    IProxyActions

    IProxyActions: { buildProxy: any; checkProxyExists: any; getProxy: any; getProxyAccessToken: any; getProxyAccessTokenOwner: any; getProxyOwnerByAddress: any; getProxyOwnerByLoan: any; proxyCount: any; proxyCreateNew: any; proxyIssue: any; proxyLockBorrowWithdraw: any; proxyRepayUnlockClose: any; proxyTransferIssue: any }
    @@ -104,7 +104,7 @@
    buildProxy: function
  • Parameters

    @@ -126,7 +126,7 @@
    checkProxyExists: functi
  • Parameters

    @@ -148,7 +148,7 @@
    getProxy: function
  • Parameters

    @@ -170,7 +170,7 @@
    getProxyAccessToken:

    Parameters

    @@ -192,7 +192,7 @@
    getProxyAccessTokenOwner

    Parameters

    @@ -214,7 +214,7 @@
    getProxyOwnerByAddress:

    Parameters

    @@ -236,7 +236,7 @@
    getProxyOwnerByLoan:

    Parameters

    @@ -258,7 +258,7 @@
    proxyCount: function
  • Returns Promise<any>

    @@ -274,7 +274,7 @@
    proxyCreateNew: function
  • Parameters

    @@ -296,7 +296,7 @@
    proxyIssue: function
  • Parameters

    @@ -324,7 +324,7 @@
    proxyLockBorrowWithdraw: <
  • Parameters

    @@ -355,7 +355,7 @@
    proxyRepayUnlockClose:

    Parameters

    @@ -386,7 +386,7 @@
    proxyTransferIssue: func
  • Parameters

    @@ -421,7 +421,7 @@

    ProxyActions

  • Type parameters

    diff --git a/docs/modules/_services_ethereum_.html b/docs/modules/_services_ethereum_.html index 5787ea8..dc6c801 100644 --- a/docs/modules/_services_ethereum_.html +++ b/docs/modules/_services_ethereum_.html @@ -99,7 +99,7 @@

    Const ZERO_ADDRESS

    ZERO_ADDRESS: "0x0000000000000000000000000000000000000000" = "0x0000000000000000000000000000000000000000"
    @@ -116,7 +116,7 @@

    executeAndRetry

  • Parameters

    @@ -142,7 +142,7 @@

    Const findEvent

  • Parameters

    @@ -209,7 +209,7 @@

    Const waitAndReturn

    Parameters

    @@ -241,7 +241,7 @@

    Const waitForTransactio
  • Parameters

    diff --git a/docs/modules/_tinlake_.html b/docs/modules/_tinlake_.html index 18850f9..25b638d 100644 --- a/docs/modules/_tinlake_.html +++ b/docs/modules/_tinlake_.html @@ -98,7 +98,7 @@

    Constructor

    Constructor<T>: {}

    Type parameters

    @@ -119,7 +119,7 @@

    ContractAbis

    ContractAbis: {}
    @@ -134,7 +134,7 @@

    ContractAddresses

    ContractAddresses: {}
    @@ -149,7 +149,7 @@

    ContractName

    ContractName: typeof contractNames[number]
    @@ -159,7 +159,7 @@

    Contracts

    Contracts: {}
    @@ -174,7 +174,7 @@

    EthConfig

    EthConfig: { from?: undefined | string; gas?: undefined | string; gasPrice?: undefined | string }
    @@ -198,7 +198,7 @@

    EthersConfig

    EthersConfig: { overrides?: EthersOverrides; provider: Provider; signer: Signer }
    @@ -222,7 +222,7 @@

    EthersOverrides

    EthersOverrides: { gasLimit?: undefined | number; gasPrice?: undefined | number }
    @@ -243,7 +243,7 @@

    PendingTransaction

    PendingTransaction: { hash: string | undefined; timesOutAt?: undefined | number }
    @@ -264,7 +264,7 @@

    TinlakeParams

    TinlakeParams: { contractAbis?: ContractAbis | {}; contractAddresses?: ContractAddresses | {}; contractConfig?: any | {}; contracts?: Contracts | {}; ethConfig?: EthConfig; ethOptions?: any | {}; ethersConfig?: EthersConfig; provider: any; transactionTimeout: number }
    diff --git a/docs/modules/_types_tinlake_.html b/docs/modules/_types_tinlake_.html index 96b02f6..9611d29 100644 --- a/docs/modules/_types_tinlake_.html +++ b/docs/modules/_types_tinlake_.html @@ -87,7 +87,7 @@

    ITinlake

    @@ -97,7 +97,7 @@

    Investor

    Investor: { address: string; junior: { maxRedeem: BN; maxSupply: BN; tokenBalance: BN }; senior: { maxRedeem?: BN; maxSupply?: BN; tokenBalance?: BN } }
    @@ -143,7 +143,7 @@

    Loan

    Loan: { debt: BN; interestRate: BN; loanId: string; nft?: NFT; ownerOf: BN; price?: BN; principal: BN; proxyOwner?: undefined | string; registry: string; status?: undefined | string; threshold?: BN; tokenId: BN }
    @@ -194,7 +194,7 @@

    NFT

    NFT: { nftData: any; nftOwner: string; registry: string; tokenId: BN }
    @@ -221,7 +221,7 @@

    Tranche

    Tranche: { availableFunds: BN; interestRate?: BN; token: string; tokenPrice: BN; totalSupply: BN; type: string }
    diff --git a/docs/modules/_utils_basetodisplay_.html b/docs/modules/_utils_basetodisplay_.html index 8af3601..e408f67 100644 --- a/docs/modules/_utils_basetodisplay_.html +++ b/docs/modules/_utils_basetodisplay_.html @@ -87,7 +87,7 @@

    Const baseToDisplay

  • Parameters

    diff --git a/docs/modules/_utils_bntohex_.html b/docs/modules/_utils_bntohex_.html index 9046bbe..82ad9de 100644 --- a/docs/modules/_utils_bntohex_.html +++ b/docs/modules/_utils_bntohex_.html @@ -87,7 +87,7 @@

    Const bnToHex

  • Parameters

    diff --git a/docs/modules/_utils_displaytobase_.html b/docs/modules/_utils_displaytobase_.html index ce91d7c..ec8d341 100644 --- a/docs/modules/_utils_displaytobase_.html +++ b/docs/modules/_utils_displaytobase_.html @@ -87,7 +87,7 @@

    Const displayToBase

  • Parameters

    diff --git a/docs/modules/_utils_feetointerestrate_.html b/docs/modules/_utils_feetointerestrate_.html index 37d6168..f412b5c 100644 --- a/docs/modules/_utils_feetointerestrate_.html +++ b/docs/modules/_utils_feetointerestrate_.html @@ -87,7 +87,7 @@

    Const feeToInterestRate
  • diff --git a/docs/modules/_utils_getloanstatus_.html b/docs/modules/_utils_getloanstatus_.html index 357748b..cc74ec4 100644 --- a/docs/modules/_utils_getloanstatus_.html +++ b/docs/modules/_utils_getloanstatus_.html @@ -89,7 +89,7 @@

    LoanStatus

    LoanStatus: "Whitelisted" | "Ongoing" | "Repaid"
    @@ -106,7 +106,7 @@

    getLoanStatus

  • Parameters

    diff --git a/docs/modules/_utils_interestratetofee_.html b/docs/modules/_utils_interestratetofee_.html index bf4afd9..cac5893 100644 --- a/docs/modules/_utils_interestratetofee_.html +++ b/docs/modules/_utils_interestratetofee_.html @@ -87,7 +87,7 @@

    Const interestRateToFee
  • diff --git a/src/Tinlake.ts b/src/Tinlake.ts index 393528e..8b44a10 100644 --- a/src/Tinlake.ts +++ b/src/Tinlake.ts @@ -194,9 +194,9 @@ export default class Tinlake { return new ethers.Contract(address, this.contractAbis[abiName], this.ethersConfig.signer) } if (this.ethersConfig.signer) { return this.ethersContracts[abiName].connect(this.ethersConfig.signer) - } else { + } return this.ethersContracts[abiName] - } + } async pending(txPromise: Promise): Promise { From 97c32b1ca6ade4da2e745cff13550176339be144 Mon Sep 17 00:00:00 2001 From: Jeroen Offerijns Date: Wed, 26 Aug 2020 19:47:09 +0200 Subject: [PATCH 11/65] 0.0.17 --- docs/classes/_tinlake_.tinlake.html | 44 +++++++------- docs/interfaces/_services_ethereum_.ethi.html | 16 ++--- .../_services_ethereum_.events.html | 6 +- docs/modules/_actions_admin_.html | 30 +++++----- docs/modules/_actions_analytics_.html | 60 +++++++++---------- docs/modules/_actions_borrower_.html | 20 +++---- docs/modules/_actions_collateral_.html | 22 +++---- docs/modules/_actions_currency_.html | 10 ++-- docs/modules/_actions_governance_.html | 4 +- docs/modules/_actions_index_.html | 2 +- docs/modules/_actions_lender_.html | 18 +++--- docs/modules/_actions_proxy_.html | 30 +++++----- docs/modules/_services_ethereum_.html | 10 ++-- docs/modules/_tinlake_.html | 20 +++---- docs/modules/_types_tinlake_.html | 10 ++-- docs/modules/_utils_basetodisplay_.html | 2 +- docs/modules/_utils_bntohex_.html | 2 +- docs/modules/_utils_displaytobase_.html | 2 +- docs/modules/_utils_feetointerestrate_.html | 2 +- docs/modules/_utils_getloanstatus_.html | 4 +- docs/modules/_utils_interestratetofee_.html | 2 +- package-lock.json | 2 +- package.json | 2 +- 23 files changed, 160 insertions(+), 160 deletions(-) diff --git a/docs/classes/_tinlake_.tinlake.html b/docs/classes/_tinlake_.tinlake.html index 6c0d748..2c9eded 100644 --- a/docs/classes/_tinlake_.tinlake.html +++ b/docs/classes/_tinlake_.tinlake.html @@ -129,7 +129,7 @@

    constructor

  • Parameters

    @@ -151,7 +151,7 @@

    contractAbis

    contractAbis: ContractAbis
    @@ -161,7 +161,7 @@

    contractAddresses

    contractAddresses: ContractAddresses
    @@ -171,7 +171,7 @@

    contractConfig

    contractConfig: any
    @@ -181,7 +181,7 @@

    contracts

    contracts: Contracts
    @@ -191,7 +191,7 @@

    eth

    eth: ethI
    @@ -201,7 +201,7 @@

    ethConfig

    ethConfig: EthConfig
    @@ -211,7 +211,7 @@

    ethOptions

    ethOptions: any
    @@ -221,7 +221,7 @@

    ethersConfig

    ethersConfig: EthersConfig
    @@ -231,7 +231,7 @@

    ethersContracts

    ethersContracts: Contracts
    @@ -241,7 +241,7 @@

    provider

    provider: any
    @@ -251,7 +251,7 @@

    transactionTimeout

    transactionTimeout: number
    @@ -268,7 +268,7 @@

    contract

  • Parameters

    @@ -294,7 +294,7 @@

    createContract

  • Parameters

    @@ -320,7 +320,7 @@

    createEthContract

  • Parameters

    @@ -346,7 +346,7 @@

    getOperatorType

  • Parameters

    @@ -369,7 +369,7 @@

    getTransactionReceipt

  • Parameters

    @@ -392,7 +392,7 @@

    pending

  • Parameters

    @@ -415,7 +415,7 @@

    setContracts

  • Returns void

    @@ -432,7 +432,7 @@

    setEthConfig

  • Parameters

    @@ -455,7 +455,7 @@

    setEthersConfig

  • Parameters

    @@ -478,7 +478,7 @@

    setProvider

  • Parameters

    diff --git a/docs/interfaces/_services_ethereum_.ethi.html b/docs/interfaces/_services_ethereum_.ethi.html index 4d1c816..7e4cf79 100644 --- a/docs/interfaces/_services_ethereum_.ethi.html +++ b/docs/interfaces/_services_ethereum_.ethi.html @@ -101,7 +101,7 @@

    abi

    abi: any
    @@ -111,7 +111,7 @@

    contract

    contract: (arg0: any) => { at: (arg0: any) => void }
    @@ -165,7 +165,7 @@

    getTransactionByHash

    getTransactionByHash: (arg0: any, arg1: (err: any, tx: any) => void) => void
    @@ -220,7 +220,7 @@

    getTransactionCount

    getTransactionCount: any
    @@ -230,7 +230,7 @@

    getTransactionReceipt

    getTransactionReceipt: (arg0: any, arg1: (err: any, receipt: any) => void) => void
    @@ -285,7 +285,7 @@

    send

    send: Function
    @@ -295,7 +295,7 @@

    sendRawTransaction

    sendRawTransaction: any
    @@ -305,7 +305,7 @@

    web3_sha3

    web3_sha3: (signature: string) => string
    diff --git a/docs/interfaces/_services_ethereum_.events.html b/docs/interfaces/_services_ethereum_.events.html index b963923..9cc9e2d 100644 --- a/docs/interfaces/_services_ethereum_.events.html +++ b/docs/interfaces/_services_ethereum_.events.html @@ -96,7 +96,7 @@

    events

    events: { data: any[]; event: { name: any } }[]
    @@ -106,7 +106,7 @@

    status

    status: any
    @@ -116,7 +116,7 @@

    txHash

    txHash: string
    diff --git a/docs/modules/_actions_admin_.html b/docs/modules/_actions_admin_.html index e9ee7af..7945eda 100644 --- a/docs/modules/_actions_admin_.html +++ b/docs/modules/_actions_admin_.html @@ -89,7 +89,7 @@

    IAdminActions

    IAdminActions: { approveAllowanceJunior: any; approveAllowanceSenior: any; canSetInterestRate: any; canSetInvestorAllowanceJunior: any; canSetInvestorAllowanceSenior: any; canSetLoanPrice: any; canSetMinimumJuniorRatio: any; canSetRiskScore: any; canSetSeniorTrancheInterest: any; initRate: any; isWard: any; setMinimumJuniorRatio: any; setRate: any }
    @@ -104,7 +104,7 @@
    approveAllowanceJunior:
  • Parameters

    @@ -132,7 +132,7 @@
    approveAllowanceSenior:
  • Parameters

    @@ -160,7 +160,7 @@
    canSetInterestRate:

    Parameters

    @@ -182,7 +182,7 @@
    canSetInvestorAllowanceJunior

    Parameters

    @@ -204,7 +204,7 @@
    canSetInvestorAllowanceSenior

    Parameters

    @@ -226,7 +226,7 @@
    canSetLoanPrice: fu
  • Parameters

    @@ -248,7 +248,7 @@
    canSetMinimumJuniorRatio

    Parameters

    @@ -270,7 +270,7 @@
    canSetRiskScore: fu
  • Parameters

    @@ -292,7 +292,7 @@
    canSetSeniorTrancheInterest

    Parameters

    @@ -314,7 +314,7 @@
    initRate: function
  • Parameters

    @@ -336,7 +336,7 @@
    isWard: function
  • Parameters

    @@ -361,7 +361,7 @@
    setMinimumJuniorRatio:

    Parameters

    @@ -383,7 +383,7 @@
    setRate: function
  • Parameters

    @@ -415,7 +415,7 @@

    AdminActions

  • Type parameters

    diff --git a/docs/modules/_actions_analytics_.html b/docs/modules/_actions_analytics_.html index cb8c85b..1449c2c 100644 --- a/docs/modules/_actions_analytics_.html +++ b/docs/modules/_actions_analytics_.html @@ -89,7 +89,7 @@

    IAnalyticsActions

    IAnalyticsActions: { existsSenior: any; getAssetValueJunior: any; getCollateral: any; getCurrentJuniorRatio: any; getDebt: any; getInterestRate: any; getInvestor: any; getJuniorReserve: any; getJuniorTokenBalance: any; getLoan: any; getLoanList: any; getMaxRedeemAmountJunior: any; getMaxRedeemAmountSenior: any; getMaxSupplyAmountJunior: any; getMaxSupplyAmountSenior: any; getMinJuniorRatio: any; getOwnerOfCollateral: any; getOwnerOfLoan: any; getPrincipal: any; getSeniorDebt: any; getSeniorInterestRate: any; getSeniorReserve: any; getSeniorTokenBalance: any; getTokenPriceJunior: any; getTokenPriceSenior: any; getTotalBalance: any; getTotalDebt: any; loanCount: any }
    @@ -104,7 +104,7 @@
    existsSenior: function
  • Returns boolean

    @@ -120,7 +120,7 @@
    getAssetValueJunior:

    Returns Promise<BN>

    @@ -136,7 +136,7 @@
    getCollateral: function
  • Parameters

    @@ -158,7 +158,7 @@
    getCurrentJuniorRatio:

    Returns Promise<BN>

    @@ -174,7 +174,7 @@
    getDebt: function
  • Parameters

    @@ -196,7 +196,7 @@
    getInterestRate: functio
  • Parameters

    @@ -218,7 +218,7 @@
    getInvestor: function
  • Parameters

    @@ -240,7 +240,7 @@
    getJuniorReserve: functi
  • Returns Promise<BN>

    @@ -256,7 +256,7 @@
    getJuniorTokenBalance:

    Parameters

    @@ -278,7 +278,7 @@
    getLoan: function
  • Parameters

    @@ -300,7 +300,7 @@
    getLoanList: function

    Returns Promise<Loan[]>

    @@ -316,7 +316,7 @@
    getMaxRedeemAmountJunior

    Parameters

    @@ -338,7 +338,7 @@
    getMaxRedeemAmountSenior

    Parameters

    @@ -360,7 +360,7 @@
    getMaxSupplyAmountJunior

    Parameters

    @@ -382,7 +382,7 @@
    getMaxSupplyAmountSenior

    Parameters

    @@ -404,7 +404,7 @@
    getMinJuniorRatio:
  • Returns Promise<BN>

    @@ -420,7 +420,7 @@
    getOwnerOfCollateral: fu
  • Parameters

    @@ -448,7 +448,7 @@
    getOwnerOfLoan: function
  • Parameters

    @@ -470,7 +470,7 @@
    getPrincipal: function
  • Parameters

    @@ -492,7 +492,7 @@
    getSeniorDebt: function<
  • Returns Promise<BN>

    @@ -508,7 +508,7 @@
    getSeniorInterestRate:

    Returns Promise<BN>

    @@ -524,7 +524,7 @@
    getSeniorReserve: functi
  • Returns Promise<BN>

    @@ -540,7 +540,7 @@
    getSeniorTokenBalance:

    Parameters

    @@ -562,7 +562,7 @@
    getTokenPriceJunior:

    Returns Promise<BN>

    @@ -578,7 +578,7 @@
    getTokenPriceSenior:

    Parameters

    @@ -600,7 +600,7 @@
    getTotalBalance: functio
  • Returns Promise<BN>

    @@ -616,7 +616,7 @@
    getTotalDebt: function

    Returns Promise<BN>

    @@ -632,7 +632,7 @@
    loanCount: function
  • Returns Promise<BN>

    @@ -655,7 +655,7 @@

    AnalyticsActions

  • Type parameters

    diff --git a/docs/modules/_actions_borrower_.html b/docs/modules/_actions_borrower_.html index dc92e31..d1964b2 100644 --- a/docs/modules/_actions_borrower_.html +++ b/docs/modules/_actions_borrower_.html @@ -89,7 +89,7 @@

    IBorrowerActions

    IBorrowerActions: { borrow: any; close: any; issue: any; lock: any; nftLookup: any; repay: any; unlock: any; withdraw: any }
    @@ -104,7 +104,7 @@
    borrow: function
  • Parameters

    @@ -129,7 +129,7 @@
    close: function
  • Parameters

    @@ -151,7 +151,7 @@
    issue: function
  • Parameters

    @@ -176,7 +176,7 @@
    lock: function
  • Parameters

    @@ -198,7 +198,7 @@
    nftLookup: function
  • Parameters

    @@ -223,7 +223,7 @@
    repay: function
  • Parameters

    @@ -248,7 +248,7 @@
    unlock: function
  • Parameters

    @@ -270,7 +270,7 @@
    withdraw: function
  • Parameters

    @@ -305,7 +305,7 @@

    BorrowerActions

  • Type parameters

    diff --git a/docs/modules/_actions_collateral_.html b/docs/modules/_actions_collateral_.html index 4e8499b..44f598f 100644 --- a/docs/modules/_actions_collateral_.html +++ b/docs/modules/_actions_collateral_.html @@ -89,7 +89,7 @@

    ICollateralActions

    ICollateralActions: { approveNFT: any; getNFTCount: any; getNFTData: any; getNFTOwner: any; isNFTApprovedForAll: any; mintNFT: any; mintTitleNFT: any; setNFTApprovalForAll: any; transferNFT: any }
    @@ -104,7 +104,7 @@
    approveNFT: function
  • Parameters

    @@ -132,7 +132,7 @@
    getNFTCount: function
  • Parameters

    @@ -154,7 +154,7 @@
    getNFTData: function
  • Parameters

    @@ -179,7 +179,7 @@
    getNFTOwner: function
  • Parameters

    @@ -204,7 +204,7 @@
    isNFTApprovedForAll: fun
  • Parameters

    @@ -232,7 +232,7 @@
    mintNFT: function
  • Parameters

    @@ -269,7 +269,7 @@
    mintTitleNFT: function
  • Parameters

    @@ -294,7 +294,7 @@
    setNFTApprovalForAll: fu
  • Parameters

    @@ -322,7 +322,7 @@
    transferNFT: function
  • Parameters

    @@ -360,7 +360,7 @@

    CollateralActions

  • Type parameters

    diff --git a/docs/modules/_actions_currency_.html b/docs/modules/_actions_currency_.html index f82f132..3d83f6b 100644 --- a/docs/modules/_actions_currency_.html +++ b/docs/modules/_actions_currency_.html @@ -89,7 +89,7 @@

    ICurrencyActions

    ICurrencyActions: { approveJuniorForCurrency: (currencyAmount: string) => Promise<PendingTransaction | undefined>; approveSeniorForCurrency: (currencyAmount: string) => Promise<PendingTransaction | undefined>; getCurrencyAllowance: (owner: string, spender: string) => Promise<BN>; getJuniorForCurrencyAllowance: (owner: string) => Promise<BN | undefined>; getSeniorForCurrencyAllowance: (owner: string) => Promise<BN | undefined>; approveCurrency: any; getCurrencyBalance: any; mintCurrency: any }
    @@ -212,7 +212,7 @@
    approveCurrency: function

    Parameters

    @@ -237,7 +237,7 @@
    getCurrencyBalance: func
  • Parameters

    @@ -259,7 +259,7 @@
    mintCurrency: function
  • Parameters

    @@ -291,7 +291,7 @@

    CurrencyActions

  • Type parameters

    diff --git a/docs/modules/_actions_governance_.html b/docs/modules/_actions_governance_.html index 5df9d37..8864674 100644 --- a/docs/modules/_actions_governance_.html +++ b/docs/modules/_actions_governance_.html @@ -83,7 +83,7 @@

    IGovernanceActions

    IGovernanceActions: { relyAddress: any }
    @@ -98,7 +98,7 @@
    relyAddress: function
  • Parameters

    diff --git a/docs/modules/_actions_index_.html b/docs/modules/_actions_index_.html index 9fed7e5..a354aa3 100644 --- a/docs/modules/_actions_index_.html +++ b/docs/modules/_actions_index_.html @@ -83,7 +83,7 @@

    TinlakeActions

    diff --git a/docs/modules/_actions_lender_.html b/docs/modules/_actions_lender_.html index 1c93f36..457b233 100644 --- a/docs/modules/_actions_lender_.html +++ b/docs/modules/_actions_lender_.html @@ -89,7 +89,7 @@

    ILenderActions

    ILenderActions: { approveJuniorToken: (tokenAmount: string) => Promise<unknown>; approveSeniorToken: (tokenAmount: string) => Promise<unknown>; balance: any; getJuniorTokenAllowance: any; getSeniorTokenAllowance: any; redeemJunior: any; redeemSenior: any; supplyJunior: any; supplySenior: any }
    @@ -146,7 +146,7 @@
    balance: function
  • Returns Promise<any>

    @@ -162,7 +162,7 @@
    getJuniorTokenAllowance: <
  • Parameters

    @@ -184,7 +184,7 @@
    getSeniorTokenAllowance: <
  • Parameters

    @@ -206,7 +206,7 @@
    redeemJunior: function
  • Parameters

    @@ -228,7 +228,7 @@
    redeemSenior: function
  • Parameters

    @@ -250,7 +250,7 @@
    supplyJunior: function
  • Parameters

    @@ -272,7 +272,7 @@
    supplySenior: function
  • Parameters

    @@ -301,7 +301,7 @@

    LenderActions

  • Type parameters

    diff --git a/docs/modules/_actions_proxy_.html b/docs/modules/_actions_proxy_.html index 720d5ac..60058d7 100644 --- a/docs/modules/_actions_proxy_.html +++ b/docs/modules/_actions_proxy_.html @@ -89,7 +89,7 @@

    IProxyActions

    IProxyActions: { buildProxy: any; checkProxyExists: any; getProxy: any; getProxyAccessToken: any; getProxyAccessTokenOwner: any; getProxyOwnerByAddress: any; getProxyOwnerByLoan: any; proxyCount: any; proxyCreateNew: any; proxyIssue: any; proxyLockBorrowWithdraw: any; proxyRepayUnlockClose: any; proxyTransferIssue: any }
    @@ -104,7 +104,7 @@
    buildProxy: function
  • Parameters

    @@ -126,7 +126,7 @@
    checkProxyExists: functi
  • Parameters

    @@ -148,7 +148,7 @@
    getProxy: function
  • Parameters

    @@ -170,7 +170,7 @@
    getProxyAccessToken:

    Parameters

    @@ -192,7 +192,7 @@
    getProxyAccessTokenOwner

    Parameters

    @@ -214,7 +214,7 @@
    getProxyOwnerByAddress:

    Parameters

    @@ -236,7 +236,7 @@
    getProxyOwnerByLoan:

    Parameters

    @@ -258,7 +258,7 @@
    proxyCount: function
  • Returns Promise<any>

    @@ -274,7 +274,7 @@
    proxyCreateNew: function
  • Parameters

    @@ -296,7 +296,7 @@
    proxyIssue: function
  • Parameters

    @@ -324,7 +324,7 @@
    proxyLockBorrowWithdraw: <
  • Parameters

    @@ -355,7 +355,7 @@
    proxyRepayUnlockClose:

    Parameters

    @@ -386,7 +386,7 @@
    proxyTransferIssue: func
  • Parameters

    @@ -421,7 +421,7 @@

    ProxyActions

  • Type parameters

    diff --git a/docs/modules/_services_ethereum_.html b/docs/modules/_services_ethereum_.html index dc6c801..6260c51 100644 --- a/docs/modules/_services_ethereum_.html +++ b/docs/modules/_services_ethereum_.html @@ -99,7 +99,7 @@

    Const ZERO_ADDRESS

    ZERO_ADDRESS: "0x0000000000000000000000000000000000000000" = "0x0000000000000000000000000000000000000000"
    @@ -116,7 +116,7 @@

    executeAndRetry

  • Parameters

    @@ -142,7 +142,7 @@

    Const findEvent

  • Parameters

    @@ -209,7 +209,7 @@

    Const waitAndReturn

    Parameters

    @@ -241,7 +241,7 @@

    Const waitForTransactio
  • Parameters

    diff --git a/docs/modules/_tinlake_.html b/docs/modules/_tinlake_.html index 25b638d..69750c7 100644 --- a/docs/modules/_tinlake_.html +++ b/docs/modules/_tinlake_.html @@ -98,7 +98,7 @@

    Constructor

    Constructor<T>: {}

    Type parameters

    @@ -119,7 +119,7 @@

    ContractAbis

    ContractAbis: {}
    @@ -134,7 +134,7 @@

    ContractAddresses

    ContractAddresses: {}
    @@ -149,7 +149,7 @@

    ContractName

    ContractName: typeof contractNames[number]
    @@ -159,7 +159,7 @@

    Contracts

    Contracts: {}
    @@ -174,7 +174,7 @@

    EthConfig

    EthConfig: { from?: undefined | string; gas?: undefined | string; gasPrice?: undefined | string }
    @@ -198,7 +198,7 @@

    EthersConfig

    EthersConfig: { overrides?: EthersOverrides; provider: Provider; signer: Signer }
    @@ -222,7 +222,7 @@

    EthersOverrides

    EthersOverrides: { gasLimit?: undefined | number; gasPrice?: undefined | number }
    @@ -243,7 +243,7 @@

    PendingTransaction

    PendingTransaction: { hash: string | undefined; timesOutAt?: undefined | number }
    @@ -264,7 +264,7 @@

    TinlakeParams

    TinlakeParams: { contractAbis?: ContractAbis | {}; contractAddresses?: ContractAddresses | {}; contractConfig?: any | {}; contracts?: Contracts | {}; ethConfig?: EthConfig; ethOptions?: any | {}; ethersConfig?: EthersConfig; provider: any; transactionTimeout: number }
    diff --git a/docs/modules/_types_tinlake_.html b/docs/modules/_types_tinlake_.html index 9611d29..2fce6f0 100644 --- a/docs/modules/_types_tinlake_.html +++ b/docs/modules/_types_tinlake_.html @@ -87,7 +87,7 @@

    ITinlake

    @@ -97,7 +97,7 @@

    Investor

    Investor: { address: string; junior: { maxRedeem: BN; maxSupply: BN; tokenBalance: BN }; senior: { maxRedeem?: BN; maxSupply?: BN; tokenBalance?: BN } }
    @@ -143,7 +143,7 @@

    Loan

    Loan: { debt: BN; interestRate: BN; loanId: string; nft?: NFT; ownerOf: BN; price?: BN; principal: BN; proxyOwner?: undefined | string; registry: string; status?: undefined | string; threshold?: BN; tokenId: BN }
    @@ -194,7 +194,7 @@

    NFT

    NFT: { nftData: any; nftOwner: string; registry: string; tokenId: BN }
    @@ -221,7 +221,7 @@

    Tranche

    Tranche: { availableFunds: BN; interestRate?: BN; token: string; tokenPrice: BN; totalSupply: BN; type: string }
    diff --git a/docs/modules/_utils_basetodisplay_.html b/docs/modules/_utils_basetodisplay_.html index e408f67..2fc7dbf 100644 --- a/docs/modules/_utils_basetodisplay_.html +++ b/docs/modules/_utils_basetodisplay_.html @@ -87,7 +87,7 @@

    Const baseToDisplay

  • Parameters

    diff --git a/docs/modules/_utils_bntohex_.html b/docs/modules/_utils_bntohex_.html index 82ad9de..147f5b8 100644 --- a/docs/modules/_utils_bntohex_.html +++ b/docs/modules/_utils_bntohex_.html @@ -87,7 +87,7 @@

    Const bnToHex

  • Parameters

    diff --git a/docs/modules/_utils_displaytobase_.html b/docs/modules/_utils_displaytobase_.html index ec8d341..58d3d90 100644 --- a/docs/modules/_utils_displaytobase_.html +++ b/docs/modules/_utils_displaytobase_.html @@ -87,7 +87,7 @@

    Const displayToBase

  • Parameters

    diff --git a/docs/modules/_utils_feetointerestrate_.html b/docs/modules/_utils_feetointerestrate_.html index f412b5c..a8446eb 100644 --- a/docs/modules/_utils_feetointerestrate_.html +++ b/docs/modules/_utils_feetointerestrate_.html @@ -87,7 +87,7 @@

    Const feeToInterestRate
  • diff --git a/docs/modules/_utils_getloanstatus_.html b/docs/modules/_utils_getloanstatus_.html index cc74ec4..0ab69ad 100644 --- a/docs/modules/_utils_getloanstatus_.html +++ b/docs/modules/_utils_getloanstatus_.html @@ -89,7 +89,7 @@

    LoanStatus

    LoanStatus: "Whitelisted" | "Ongoing" | "Repaid"
    @@ -106,7 +106,7 @@

    getLoanStatus

  • Parameters

    diff --git a/docs/modules/_utils_interestratetofee_.html b/docs/modules/_utils_interestratetofee_.html index cac5893..6fad2b0 100644 --- a/docs/modules/_utils_interestratetofee_.html +++ b/docs/modules/_utils_interestratetofee_.html @@ -87,7 +87,7 @@

    Const interestRateToFee
  • diff --git a/package-lock.json b/package-lock.json index ab02afc..2baeb29 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "tinlake", - "version": "0.0.16", + "version": "0.0.17", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 79f17f3..4fb5e62 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "tinlake", - "version": "0.0.16", + "version": "0.0.17", "description": "Centrifuge Tinlake Contracts Client", "main": "dist/index.js", "types": "dist/index.d.ts", From b7fa44ce00df8b1bb4ebf55688cc5207d238804a Mon Sep 17 00:00:00 2001 From: Jeroen Offerijns Date: Thu, 27 Aug 2020 16:14:58 +0200 Subject: [PATCH 12/65] feat: rewrite most remaining actions required by tinlake UI --- dist/actions/admin.d.ts | 4 +- dist/actions/borrower.d.ts | 10 +- dist/actions/currency.d.ts | 17 +- dist/actions/governance.d.ts | 9 +- dist/actions/lender.d.ts | 8 +- dist/actions/proxy.d.ts | 4 +- dist/index.d.ts | 156 +++++++---- dist/index.es.js | 251 ++++++------------ dist/index.js | 251 ++++++------------ docs/classes/_tinlake_.tinlake.html | 44 +-- docs/interfaces/_services_ethereum_.ethi.html | 16 +- .../_services_ethereum_.events.html | 6 +- docs/modules/_actions_admin_.html | 30 +-- docs/modules/_actions_analytics_.html | 60 ++--- docs/modules/_actions_borrower_.html | 20 +- docs/modules/_actions_collateral_.html | 22 +- docs/modules/_actions_currency_.html | 10 +- docs/modules/_actions_governance_.html | 4 +- docs/modules/_actions_index_.html | 2 +- docs/modules/_actions_lender_.html | 18 +- docs/modules/_actions_proxy_.html | 30 +-- docs/modules/_services_ethereum_.html | 10 +- docs/modules/_tinlake_.html | 20 +- docs/modules/_types_tinlake_.html | 10 +- docs/modules/_utils_basetodisplay_.html | 2 +- docs/modules/_utils_bntohex_.html | 2 +- docs/modules/_utils_displaytobase_.html | 2 +- docs/modules/_utils_feetointerestrate_.html | 2 +- docs/modules/_utils_getloanstatus_.html | 4 +- docs/modules/_utils_interestratetofee_.html | 2 +- src/actions/admin.ts | 36 +-- src/actions/currency.ts | 13 +- src/actions/lender.ts | 28 +- src/actions/proxy.ts | 40 ++- 34 files changed, 491 insertions(+), 652 deletions(-) diff --git a/dist/actions/admin.d.ts b/dist/actions/admin.d.ts index 10a4c34..3132f05 100644 --- a/dist/actions/admin.d.ts +++ b/dist/actions/admin.d.ts @@ -16,8 +16,8 @@ export declare function AdminActions Promise; setRate: (loan: string, ratePerSecond: string) => Promise; setMinimumJuniorRatio: (ratio: string) => Promise; - approveAllowanceJunior: (user: string, maxCurrency: string, maxToken: string) => Promise; - approveAllowanceSenior: (user: string, maxCurrency: string, maxToken: string) => Promise; + approveAllowanceJunior: (user: string, maxCurrency: string, maxToken: string) => Promise; + approveAllowanceSenior: (user: string, maxCurrency: string, maxToken: string) => Promise; provider: any; eth: import("../services/ethereum").ethI; ethOptions: any; diff --git a/dist/actions/borrower.d.ts b/dist/actions/borrower.d.ts index 7cb28be..4fe4da7 100644 --- a/dist/actions/borrower.d.ts +++ b/dist/actions/borrower.d.ts @@ -1,4 +1,5 @@ import { Constructor, TinlakeParams } from '../Tinlake'; +import { ethers } from 'ethers'; export declare function BorrowerActions>(Base: ActionsBase): { new (...args: any[]): { issue: (registry: string, tokenId: string) => Promise; @@ -13,15 +14,22 @@ export declare function BorrowerActions void; setContracts: () => void; setEthConfig: (ethConfig: import("../Tinlake").EthConfig) => void; - createContract(address: string, abiName: string): void; + setEthersConfig: (ethersConfig: import("../Tinlake").EthersConfig | undefined) => void; + createEthContract(address: string, abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR"): void; + createContract(address: string, abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR"): ethers.Contract; + contract(abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR", address?: string | undefined): ethers.Contract; + pending(txPromise: Promise): Promise; + getTransactionReceipt(tx: import("../Tinlake").PendingTransaction): Promise; getOperatorType: (tranche: string) => any; }; } & ActionsBase; diff --git a/dist/actions/currency.d.ts b/dist/actions/currency.d.ts index 24eb8ad..cb28734 100644 --- a/dist/actions/currency.d.ts +++ b/dist/actions/currency.d.ts @@ -6,19 +6,10 @@ export declare function CurrencyActions Promise; getJuniorForCurrencyAllowance: (owner: string) => Promise; getSeniorForCurrencyAllowance: (owner: string) => Promise; - getCurrencyBalance: (user: string) => Promise; - approveCurrency: (usr: string, currencyAmount: string) => Promise<{ - hash: any; - contractKey: string; - }>; - approveSeniorForCurrency: (currencyAmount: string) => Promise<{ - hash: any; - contractKey: string; - } | undefined>; - approveJuniorForCurrency: (currencyAmount: string) => Promise<{ - hash: any; - contractKey: string; - } | undefined>; + getCurrencyBalance: (user: string) => Promise; + approveCurrency: (usr: string, currencyAmount: string) => Promise; + approveSeniorForCurrency: (currencyAmount: string) => Promise; + approveJuniorForCurrency: (currencyAmount: string) => Promise; provider: any; eth: import("../services/ethereum").ethI; ethOptions: any; diff --git a/dist/actions/governance.d.ts b/dist/actions/governance.d.ts index 8a1cd86..41b10bc 100644 --- a/dist/actions/governance.d.ts +++ b/dist/actions/governance.d.ts @@ -6,15 +6,22 @@ declare function GovernanceActions void; setContracts: () => void; setEthConfig: (ethConfig: import("../Tinlake").EthConfig) => void; - createContract(address: string, abiName: string): void; + setEthersConfig: (ethersConfig: import("../Tinlake").EthersConfig | undefined) => void; + createEthContract(address: string, abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR"): void; + createContract(address: string, abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR"): import("ethers").Contract; + contract(abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR", address?: string | undefined): import("ethers").Contract; + pending(txPromise: Promise): Promise; + getTransactionReceipt(tx: import("../Tinlake").PendingTransaction): Promise; getOperatorType: (tranche: string) => any; }; } & ActionsBase; diff --git a/dist/actions/lender.d.ts b/dist/actions/lender.d.ts index 391985e..0b02067 100644 --- a/dist/actions/lender.d.ts +++ b/dist/actions/lender.d.ts @@ -3,13 +3,13 @@ import BN from 'bn.js'; export declare function LenderActions>(Base: ActionBase): { new (...args: any[]): { supplySenior: (currencyAmount: string) => Promise; - redeemSenior: (tokenAmount: string) => Promise; + redeemSenior: (tokenAmount: string) => Promise; getSeniorTokenAllowance: (owner: string) => Promise; - approveSeniorToken: (tokenAmount: string) => Promise; + approveSeniorToken: (tokenAmount: string) => Promise; supplyJunior: (currencyAmount: string) => Promise; - redeemJunior: (tokenAmount: string) => Promise; + redeemJunior: (tokenAmount: string) => Promise; getJuniorTokenAllowance: (owner: string) => Promise; - approveJuniorToken: (tokenAmount: string) => Promise; + approveJuniorToken: (tokenAmount: string) => Promise; balance: () => Promise; provider: any; eth: import("../services/ethereum").ethI; diff --git a/dist/actions/proxy.d.ts b/dist/actions/proxy.d.ts index d12daed..f41cece 100644 --- a/dist/actions/proxy.d.ts +++ b/dist/actions/proxy.d.ts @@ -14,8 +14,8 @@ export declare function ProxyActions Promise; proxyIssue: (proxyAddress: string, nftRegistryAddress: string, tokenId: string) => Promise; proxyTransferIssue: (proxyAddress: string, nftRegistryAddress: string, tokenId: string) => Promise; - proxyLockBorrowWithdraw: (proxyAddr: string, loanId: string, amount: string, usr: string) => Promise; - proxyRepayUnlockClose: (proxyAddr: string, tokenId: string, loanId: string, registry: string) => Promise; + proxyLockBorrowWithdraw: (proxyAddress: string, loanId: string, amount: string, usr: string) => Promise; + proxyRepayUnlockClose: (proxyAddress: string, tokenId: string, loanId: string, registry: string) => Promise; provider: any; eth: import("../services/ethereum").ethI; ethOptions: any; diff --git a/dist/index.d.ts b/dist/index.d.ts index 7e1b103..231125e 100644 --- a/dist/index.d.ts +++ b/dist/index.d.ts @@ -5,29 +5,36 @@ export declare const TinlakeWithActions: { getProxyAccessTokenOwner: (tokenId: string) => Promise; buildProxy: (owner: string) => Promise; getProxy: (accessTokenId: string) => Promise; - getProxyAccessToken: (proxyAddr: string) => Promise; + getProxyAccessToken: (proxyAddress: string) => Promise; getProxyOwnerByLoan: (loanId: string) => Promise; getProxyOwnerByAddress: (proxyAddress: string) => Promise; proxyCount: () => Promise; checkProxyExists: (address: string) => Promise; proxyCreateNew: (address: string) => Promise; - proxyIssue: (proxyAddr: string, nftRegistryAddr: string, tokenId: string) => Promise; - proxyTransferIssue: (proxyAddr: string, nftRegistryAddr: string, tokenId: string) => Promise; - proxyLockBorrowWithdraw: (proxyAddr: string, loanId: string, amount: string, usr: string) => Promise; - proxyRepayUnlockClose: (proxyAddr: string, tokenId: string, loanId: string, registry: string) => Promise; + proxyIssue: (proxyAddress: string, nftRegistryAddress: string, tokenId: string) => Promise; + proxyTransferIssue: (proxyAddress: string, nftRegistryAddress: string, tokenId: string) => Promise; + proxyLockBorrowWithdraw: (proxyAddress: string, loanId: string, amount: string, usr: string) => Promise; + proxyRepayUnlockClose: (proxyAddress: string, tokenId: string, loanId: string, registry: string) => Promise; provider: any; eth: import("./services/ethereum").ethI; ethOptions: any; ethConfig: import("./Tinlake").EthConfig; + ethersConfig: import("./Tinlake").EthersConfig; contractAddresses: import("./Tinlake").ContractAddresses; transactionTimeout: number; contracts: import("./Tinlake").Contracts; + ethersContracts: import("./Tinlake").Contracts; contractAbis: import("./Tinlake").ContractAbis; contractConfig: any; setProvider: (provider: any, ethOptions?: any) => void; setContracts: () => void; setEthConfig: (ethConfig: import("./Tinlake").EthConfig) => void; - createContract(address: string, abiName: string): void; + setEthersConfig: (ethersConfig: import("./Tinlake").EthersConfig | undefined) => void; + createEthContract(address: string, abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR"): void; + createContract(address: string, abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR"): import("ethers").Contract; + contract(abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR", address?: string | undefined): import("ethers").Contract; + pending(txPromise: Promise): Promise; + getTransactionReceipt(tx: import("./Tinlake").PendingTransaction): Promise; getOperatorType: (tranche: string) => any; }; } & { @@ -44,21 +51,28 @@ export declare const TinlakeWithActions: { eth: import("./services/ethereum").ethI; ethOptions: any; ethConfig: import("./Tinlake").EthConfig; + ethersConfig: import("./Tinlake").EthersConfig; contractAddresses: import("./Tinlake").ContractAddresses; transactionTimeout: number; contracts: import("./Tinlake").Contracts; + ethersContracts: import("./Tinlake").Contracts; contractAbis: import("./Tinlake").ContractAbis; contractConfig: any; setProvider: (provider: any, ethOptions?: any) => void; setContracts: () => void; setEthConfig: (ethConfig: import("./Tinlake").EthConfig) => void; - createContract(address: string, abiName: string): void; + setEthersConfig: (ethersConfig: import("./Tinlake").EthersConfig | undefined) => void; + createEthContract(address: string, abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR"): void; + createContract(address: string, abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR"): import("ethers").Contract; + contract(abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR", address?: string | undefined): import("ethers").Contract; + pending(txPromise: Promise): Promise; + getTransactionReceipt(tx: import("./Tinlake").PendingTransaction): Promise; getOperatorType: (tranche: string) => any; }; } & { new (...args: any[]): { canQueryPermissions: () => boolean; - isWard: (user: string, contractName: string) => Promise; + isWard: (user: string, contractName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR") => Promise; canSetInterestRate: (user: string) => Promise; canSetSeniorTrancheInterest: (user: string) => Promise; canSetRiskScore: (user: string) => Promise; @@ -70,48 +84,62 @@ export declare const TinlakeWithActions: { initRate: (ratePerSecond: string) => Promise; changeRate: (loan: string, ratePerSecond: string) => Promise; setRate: (loan: string, ratePerSecond: string) => Promise; - setMinimumJuniorRatio: (ratio: string) => Promise; - approveAllowanceJunior: (user: string, maxCurrency: string, maxToken: string) => Promise; - approveAllowanceSenior: (user: string, maxCurrency: string, maxToken: string) => Promise; + setMinimumJuniorRatio: (ratio: string) => Promise; + approveAllowanceJunior: (user: string, maxCurrency: string, maxToken: string) => Promise; + approveAllowanceSenior: (user: string, maxCurrency: string, maxToken: string) => Promise; provider: any; eth: import("./services/ethereum").ethI; ethOptions: any; ethConfig: import("./Tinlake").EthConfig; + ethersConfig: import("./Tinlake").EthersConfig; contractAddresses: import("./Tinlake").ContractAddresses; transactionTimeout: number; contracts: import("./Tinlake").Contracts; + ethersContracts: import("./Tinlake").Contracts; contractAbis: import("./Tinlake").ContractAbis; contractConfig: any; setProvider: (provider: any, ethOptions?: any) => void; setContracts: () => void; setEthConfig: (ethConfig: import("./Tinlake").EthConfig) => void; - createContract(address: string, abiName: string): void; + setEthersConfig: (ethersConfig: import("./Tinlake").EthersConfig | undefined) => void; + createEthContract(address: string, abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR"): void; + createContract(address: string, abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR"): import("ethers").Contract; + contract(abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR", address?: string | undefined): import("ethers").Contract; + pending(txPromise: Promise): Promise; + getTransactionReceipt(tx: import("./Tinlake").PendingTransaction): Promise; getOperatorType: (tranche: string) => any; }; } & { new (...args: any[]): { - supplySenior: (currencyAmount: string) => Promise; - redeemSenior: (tokenAmount: string) => Promise; + supplySenior: (currencyAmount: string) => Promise; + redeemSenior: (tokenAmount: string) => Promise; getSeniorTokenAllowance: (owner: string) => Promise; - approveSeniorToken: (tokenAmount: string) => Promise; - supplyJunior: (currencyAmount: string) => Promise; - redeemJunior: (tokenAmount: string) => Promise; + approveSeniorToken: (tokenAmount: string) => Promise; + supplyJunior: (currencyAmount: string) => Promise; + redeemJunior: (tokenAmount: string) => Promise; getJuniorTokenAllowance: (owner: string) => Promise; - approveJuniorToken: (tokenAmount: string) => Promise; + approveJuniorToken: (tokenAmount: string) => Promise; balance: () => Promise; provider: any; eth: import("./services/ethereum").ethI; ethOptions: any; ethConfig: import("./Tinlake").EthConfig; + ethersConfig: import("./Tinlake").EthersConfig; contractAddresses: import("./Tinlake").ContractAddresses; transactionTimeout: number; contracts: import("./Tinlake").Contracts; + ethersContracts: import("./Tinlake").Contracts; contractAbis: import("./Tinlake").ContractAbis; contractConfig: any; setProvider: (provider: any, ethOptions?: any) => void; setContracts: () => void; setEthConfig: (ethConfig: import("./Tinlake").EthConfig) => void; - createContract(address: string, abiName: string): void; + setEthersConfig: (ethersConfig: import("./Tinlake").EthersConfig | undefined) => void; + createEthContract(address: string, abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR"): void; + createContract(address: string, abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR"): import("ethers").Contract; + contract(abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR", address?: string | undefined): import("ethers").Contract; + pending(txPromise: Promise): Promise; + getTransactionReceipt(tx: import("./Tinlake").PendingTransaction): Promise; getOperatorType: (tranche: string) => any; }; } & { @@ -119,98 +147,119 @@ export declare const TinlakeWithActions: { getTotalDebt: () => Promise; getTotalBalance: () => Promise; getPrincipal: (loanId: string) => Promise; - getDebt: (loanID: string) => Promise; + getDebt: (loanId: string) => Promise; loanCount: () => Promise; getCollateral: (loanId: string) => Promise; - getOwnerOfCollateral: (nftRegistryAddr: string, tokenId: string) => Promise; + getOwnerOfCollateral: (nftRegistryAddress: string, tokenId: string) => Promise; getInterestRate: (loanId: string) => Promise; getOwnerOfLoan: (loanId: string) => Promise; getStatus: (nftRegistryAddr: string, tokenId: string, loanId: string) => Promise; getLoan: (loanId: string) => Promise; getLoanList: () => Promise; getInvestor: (user: string) => Promise; - getJuniorTokenBalance: (user: string) => Promise; - getJuniorTotalSupply: (user: string) => Promise; - getMaxSupplyAmountJunior: (user: string) => Promise; + getJuniorTokenBalance: (user: string) => Promise; + getJuniorTotalSupply: () => Promise; + getMaxSupplyAmountJunior: (user: string) => Promise; getMaxRedeemAmountJunior: (user: string) => Promise; getTokenPriceJunior: () => Promise; existsSenior: () => boolean; - getSeniorTokenBalance: (user: string) => Promise; - getSeniorTotalSupply: (user: string) => Promise; + getSeniorTokenBalance: (user: string) => Promise; + getSeniorTotalSupply: () => Promise; getMaxSupplyAmountSenior: (user: string) => Promise; getMaxRedeemAmountSenior: (user: string) => Promise; getTokenPriceSenior: (user?: string | undefined) => Promise; getSeniorReserve: () => Promise; - getJuniorReserve: () => Promise; - getMinJuniorRatio: () => Promise; - getCurrentJuniorRatio: () => Promise; - getAssetValueJunior: () => Promise; - getSeniorDebt: () => Promise; - getSeniorInterestRate: () => Promise; + getJuniorReserve: () => Promise; + getMinJuniorRatio: () => Promise; + getCurrentJuniorRatio: () => Promise; + getAssetValueJunior: () => Promise; + getSeniorDebt: () => Promise; + getSeniorInterestRate: () => Promise; provider: any; eth: import("./services/ethereum").ethI; ethOptions: any; ethConfig: import("./Tinlake").EthConfig; + ethersConfig: import("./Tinlake").EthersConfig; contractAddresses: import("./Tinlake").ContractAddresses; transactionTimeout: number; contracts: import("./Tinlake").Contracts; + ethersContracts: import("./Tinlake").Contracts; contractAbis: import("./Tinlake").ContractAbis; contractConfig: any; setProvider: (provider: any, ethOptions?: any) => void; setContracts: () => void; setEthConfig: (ethConfig: import("./Tinlake").EthConfig) => void; - createContract(address: string, abiName: string): void; + setEthersConfig: (ethersConfig: import("./Tinlake").EthersConfig | undefined) => void; + createEthContract(address: string, abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR"): void; + createContract(address: string, abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR"): import("ethers").Contract; + contract(abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR", address?: string | undefined): import("ethers").Contract; + pending(txPromise: Promise): Promise; + getTransactionReceipt(tx: import("./Tinlake").PendingTransaction): Promise; getOperatorType: (tranche: string) => any; }; } & { new (...args: any[]): { mintCurrency: (usr: string, amount: string) => Promise; - getCurrencyAllowance: (owner: string, spender: string) => Promise; - getJuniorForCurrencyAllowance: (owner: string) => Promise; - getSeniorForCurrencyAllowance: (owner: string) => Promise; - getCurrencyBalance: (user: string) => Promise; - approveCurrency: (usr: string, currencyAmount: string) => Promise; - approveSeniorForCurrency: (currencyAmount: string) => Promise; - approveJuniorForCurrency: (currencyAmount: string) => Promise; + getCurrencyAllowance: (owner: string, spender: string) => Promise; + getJuniorForCurrencyAllowance: (owner: string) => Promise; + getSeniorForCurrencyAllowance: (owner: string) => Promise; + getCurrencyBalance: (user: string) => Promise; + approveCurrency: (usr: string, currencyAmount: string) => Promise; + approveSeniorForCurrency: (currencyAmount: string) => Promise; + approveJuniorForCurrency: (currencyAmount: string) => Promise; provider: any; eth: import("./services/ethereum").ethI; ethOptions: any; ethConfig: import("./Tinlake").EthConfig; + ethersConfig: import("./Tinlake").EthersConfig; contractAddresses: import("./Tinlake").ContractAddresses; transactionTimeout: number; contracts: import("./Tinlake").Contracts; + ethersContracts: import("./Tinlake").Contracts; contractAbis: import("./Tinlake").ContractAbis; contractConfig: any; setProvider: (provider: any, ethOptions?: any) => void; setContracts: () => void; setEthConfig: (ethConfig: import("./Tinlake").EthConfig) => void; - createContract(address: string, abiName: string): void; + setEthersConfig: (ethersConfig: import("./Tinlake").EthersConfig | undefined) => void; + createEthContract(address: string, abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR"): void; + createContract(address: string, abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR"): import("ethers").Contract; + contract(abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR", address?: string | undefined): import("ethers").Contract; + pending(txPromise: Promise): Promise; + getTransactionReceipt(tx: import("./Tinlake").PendingTransaction): Promise; getOperatorType: (tranche: string) => any; }; } & { new (...args: any[]): { mintTitleNFT: (nftAddr: string, user: string) => Promise; - mintNFT: (nftAddr: string, owner: string, tokenId: string, ref: string, amount: string, asset: string) => Promise; - approveNFT: (nftAddr: string, tokenId: string, to: string) => Promise; - setNFTApprovalForAll: (nftAddr: string, to: string, approved: boolean) => Promise; - isNFTApprovedForAll: (nftAddr: string, owner: string, operator: string) => Promise; + mintNFT: (nftAddress: string, owner: string, tokenId: string, ref: string, amount: string, asset: string) => Promise; + approveNFT: (nftAddress: string, tokenId: string, to: string) => Promise; + setNFTApprovalForAll: (nftAddress: string, to: string, approved: boolean) => Promise; + isNFTApprovedForAll: (nftAddress: string, owner: string, operator: string) => Promise; getNFTCount: (nftAddr: string) => Promise; - getNFTData: (nftAddr: string, tokenId: string) => Promise; - getNFTOwner: (nftAddr: string, tokenId: string) => Promise; - transferNFT: (nftAddr: string, from: string, to: string, tokenId: string) => Promise; + getNFTData: (nftAddress: string, tokenId: string) => Promise; + getNFTOwner: (nftAddresss: string, tokenId: string) => Promise; + transferNFT: (nftAddress: string, from: string, to: string, tokenId: string) => Promise; provider: any; eth: import("./services/ethereum").ethI; ethOptions: any; ethConfig: import("./Tinlake").EthConfig; + ethersConfig: import("./Tinlake").EthersConfig; contractAddresses: import("./Tinlake").ContractAddresses; transactionTimeout: number; contracts: import("./Tinlake").Contracts; + ethersContracts: import("./Tinlake").Contracts; contractAbis: import("./Tinlake").ContractAbis; contractConfig: any; setProvider: (provider: any, ethOptions?: any) => void; setContracts: () => void; setEthConfig: (ethConfig: import("./Tinlake").EthConfig) => void; - createContract(address: string, abiName: string): void; + setEthersConfig: (ethersConfig: import("./Tinlake").EthersConfig | undefined) => void; + createEthContract(address: string, abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR"): void; + createContract(address: string, abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR"): import("ethers").Contract; + contract(abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR", address?: string | undefined): import("ethers").Contract; + pending(txPromise: Promise): Promise; + getTransactionReceipt(tx: import("./Tinlake").PendingTransaction): Promise; getOperatorType: (tranche: string) => any; }; } & { @@ -220,15 +269,22 @@ export declare const TinlakeWithActions: { eth: import("./services/ethereum").ethI; ethOptions: any; ethConfig: import("./Tinlake").EthConfig; + ethersConfig: import("./Tinlake").EthersConfig; contractAddresses: import("./Tinlake").ContractAddresses; transactionTimeout: number; contracts: import("./Tinlake").Contracts; + ethersContracts: import("./Tinlake").Contracts; contractAbis: import("./Tinlake").ContractAbis; contractConfig: any; setProvider: (provider: any, ethOptions?: any) => void; setContracts: () => void; setEthConfig: (ethConfig: import("./Tinlake").EthConfig) => void; - createContract(address: string, abiName: string): void; + setEthersConfig: (ethersConfig: import("./Tinlake").EthersConfig | undefined) => void; + createEthContract(address: string, abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR"): void; + createContract(address: string, abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR"): import("ethers").Contract; + contract(abiName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR", address?: string | undefined): import("ethers").Contract; + pending(txPromise: Promise): Promise; + getTransactionReceipt(tx: import("./Tinlake").PendingTransaction): Promise; getOperatorType: (tranche: string) => any; }; } & typeof Tinlake; diff --git a/dist/index.es.js b/dist/index.es.js index b980fa6..a46fc1a 100644 --- a/dist/index.es.js +++ b/dist/index.es.js @@ -10832,15 +10832,15 @@ function AdminActions(Base) { }); }; // ------------ admin functions borrower-site ------------- _this.existsRateGroup = function (ratePerSecond) { return __awaiter(_this, void 0, void 0, function () { - var rateGroup, res; + var rateGroup, actualRate; return __generator(this, function (_a) { switch (_a.label) { case 0: rateGroup = getRateGroup(ratePerSecond); - return [4 /*yield*/, executeAndRetry(this.contracts['PILE'].rates, [rateGroup])]; + return [4 /*yield*/, this.contract('PILE').rates(rateGroup)]; case 1: - res = _a.sent(); - return [2 /*return*/, !res.ratePerSecond.isZero()]; + actualRate = (_a.sent()).toBN(); + return [2 /*return*/, !actualRate.isZero()]; } }); }); }; @@ -10901,50 +10901,20 @@ function AdminActions(Base) { }); }); }; _this.approveAllowanceJunior = function (user, maxCurrency, maxToken) { return __awaiter(_this, void 0, void 0, function () { - var txHash; + var juniorOperator; return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, executeAndRetry(this.contracts['JUNIOR_OPERATOR'].approve, [ - user, - maxCurrency, - maxToken, - this.ethConfig, - ])]; - case 1: - txHash = _a.sent(); - console.log("[Approve allowance Junior] txHash: " + txHash); - return [2 /*return*/, waitAndReturnEvents(this.eth, txHash, this.contracts['JUNIOR_OPERATOR'].abi, this.transactionTimeout)]; - } + juniorOperator = this.contract('JUNIOR_OPERATOR'); + return [2 /*return*/, this.pending(juniorOperator.approve(user, maxCurrency, maxToken))]; }); }); }; _this.approveAllowanceSenior = function (user, maxCurrency, maxToken) { return __awaiter(_this, void 0, void 0, function () { - var operatorType, txHash, _a; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: - operatorType = this.getOperatorType('senior'); - _a = operatorType; - switch (_a) { - case 'PROPORTIONAL_OPERATOR': return [3 /*break*/, 1]; - } - return [3 /*break*/, 3]; - case 1: return [4 /*yield*/, executeAndRetry(this.contracts['SENIOR_OPERATOR'].approve, [user, maxCurrency, this.ethConfig])]; - case 2: - txHash = _b.sent(); - return [3 /*break*/, 5]; - case 3: return [4 /*yield*/, executeAndRetry(this.contracts['SENIOR_OPERATOR'].approve, [ - user, - maxCurrency, - maxToken, - this.ethConfig, - ])]; - case 4: - txHash = _b.sent(); - _b.label = 5; - case 5: - console.log("[Approve allowance Senior] txHash: " + txHash); - return [2 /*return*/, waitAndReturnEvents(this.eth, txHash, this.contracts['SENIOR_OPERATOR'].abi, this.transactionTimeout)]; + var seniorOperator; + return __generator(this, function (_a) { + seniorOperator = this.contract('SENIOR_OPERATOR'); + if (this.getOperatorType('senior') === 'PROPERTIONAL_OPERATOR') { + return [2 /*return*/, this.pending(seniorOperator.approve(user, maxCurrency))]; } + return [2 /*return*/, this.pending(seniorOperator.approve(user, maxCurrency, maxToken))]; }); }); }; return _this; @@ -29433,15 +29403,10 @@ function LenderActions(Base) { }); }); }; _this.redeemSenior = function (tokenAmount) { return __awaiter(_this, void 0, void 0, function () { - var txHash; + var seniorOperator; return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, executeAndRetry(this.contracts['SENIOR_OPERATOR'].redeem, [tokenAmount, this.ethConfig])]; - case 1: - txHash = _a.sent(); - console.log("[Redeem] txHash: " + txHash); - return [2 /*return*/, waitAndReturnEvents(this.eth, txHash, this.contracts['SENIOR_OPERATOR'].abi, this.transactionTimeout)]; - } + seniorOperator = this.contract('SENIOR_OPERATOR'); + return [2 /*return*/, this.pending(seniorOperator.redeem(tokenAmount))]; }); }); }; _this.getSeniorTokenAllowance = function (owner) { return __awaiter(_this, void 0, void 0, function () { @@ -29459,19 +29424,10 @@ function LenderActions(Base) { }); }); }; _this.approveSeniorToken = function (tokenAmount) { return __awaiter(_this, void 0, void 0, function () { - var txHash; + var senior; return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, executeAndRetry(this.contracts['SENIOR_TOKEN'].approve, [ - this.contractAddresses['SENIOR'], - tokenAmount, - this.ethConfig, - ])]; - case 1: - txHash = _a.sent(); - console.log("[Currency.approve] txHash: " + txHash); - return [2 /*return*/, waitAndReturnEvents(this.eth, txHash, this.contracts['SENIOR_TOKEN'].abi, this.transactionTimeout)]; - } + senior = this.contract('SENIOR_TOKEN'); + return [2 /*return*/, this.pending(senior.approve(this.contractAddresses['SENIOR'], tokenAmount))]; }); }); }; // junior tranche functions @@ -29483,15 +29439,10 @@ function LenderActions(Base) { }); }); }; _this.redeemJunior = function (tokenAmount) { return __awaiter(_this, void 0, void 0, function () { - var txHash; + var juniorOperator; return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, executeAndRetry(this.contracts['JUNIOR_OPERATOR'].redeem, [tokenAmount, this.ethConfig])]; - case 1: - txHash = _a.sent(); - console.log("[Redeem] txHash: " + txHash); - return [2 /*return*/, waitAndReturnEvents(this.eth, txHash, this.contracts['JUNIOR_OPERATOR'].abi, this.transactionTimeout)]; - } + juniorOperator = this.contract('JUNIOR_OPERATOR'); + return [2 /*return*/, this.pending(juniorOperator.redeem(tokenAmount))]; }); }); }; _this.getJuniorTokenAllowance = function (owner) { return __awaiter(_this, void 0, void 0, function () { @@ -29509,19 +29460,10 @@ function LenderActions(Base) { }); }); }; _this.approveJuniorToken = function (tokenAmount) { return __awaiter(_this, void 0, void 0, function () { - var txHash; + var junior; return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, executeAndRetry(this.contracts['JUNIOR_TOKEN'].approve, [ - this.contractAddresses['JUNIOR'], - tokenAmount, - this.ethConfig, - ])]; - case 1: - txHash = _a.sent(); - console.log("[Currency.approve] txHash: " + txHash); - return [2 /*return*/, waitAndReturnEvents(this.eth, txHash, this.contracts['JUNIOR_TOKEN'].abi, this.transactionTimeout)]; - } + junior = this.contract('JUNIOR_TOKEN'); + return [2 /*return*/, this.pending(junior.approve(this.contractAddresses['JUNIOR'], tokenAmount))]; }); }); }; // general lender functions @@ -29562,15 +29504,13 @@ function CurrencyActions(Base) { }); }); }; _this.getCurrencyAllowance = function (owner, spender) { return __awaiter(_this, void 0, void 0, function () { - var currencyContract, allowance; + var currencyContract; return __generator(this, function (_a) { switch (_a.label) { case 0: currencyContract = this.contract('TINLAKE_CURRENCY'); return [4 /*yield*/, currencyContract.allowance(owner, spender)]; - case 1: - allowance = _a.sent(); - return [2 /*return*/, allowance.toBN()]; + case 1: return [2 /*return*/, (_a.sent()).toBN()]; } }); }); }; @@ -29589,30 +29529,18 @@ function CurrencyActions(Base) { }); }); }; _this.getCurrencyBalance = function (user) { return __awaiter(_this, void 0, void 0, function () { - var res; return __generator(this, function (_a) { switch (_a.label) { - case 0: return [4 /*yield*/, executeAndRetry(this.contracts['TINLAKE_CURRENCY'].balanceOf, [user])]; - case 1: - res = _a.sent(); - return [2 /*return*/, res[0] || new bn(0)]; + case 0: return [4 /*yield*/, this.contract('TINLAKE_CURRENCY').balanceOf(user)]; + case 1: return [2 /*return*/, (_a.sent()).toBN()]; } }); }); }; _this.approveCurrency = function (usr, currencyAmount) { return __awaiter(_this, void 0, void 0, function () { - var currencyContract, tx; + var currencyContract; return __generator(this, function (_a) { - switch (_a.label) { - case 0: - currencyContract = this.contract('TINLAKE_CURRENCY'); - return [4 /*yield*/, currencyContract.approve(usr, currencyAmount)]; - case 1: - tx = _a.sent(); - return [2 /*return*/, { - hash: tx.hash, - contractKey: 'TINLAKE_CURRENCY', - }]; - } + currencyContract = this.contract('TINLAKE_CURRENCY'); + return [2 /*return*/, this.pending(currencyContract.approve(usr, currencyAmount))]; }); }); }; _this.approveSeniorForCurrency = function (currencyAmount) { return __awaiter(_this, void 0, void 0, function () { @@ -30250,18 +30178,16 @@ function ProxyActions(Base) { return [4 /*yield*/, waitAndReturnEvents(this.eth, txHash, this.contracts['PROXY_REGISTRY'].abi, this.transactionTimeout)]; case 2: response = _a.sent(); + console.log('create proxy response', response); return [2 /*return*/, response.events[0].data[2].toString()]; } }); }); }; _this.getProxy = function (accessTokenId) { return __awaiter(_this, void 0, void 0, function () { - var res; return __generator(this, function (_a) { switch (_a.label) { - case 0: return [4 /*yield*/, executeAndRetry(this.contracts['PROXY_REGISTRY'].proxies, [accessTokenId, this.ethConfig])]; - case 1: - res = _a.sent(); - return [2 /*return*/, res[0]]; + case 0: return [4 /*yield*/, this.contract('PROXY_REGISTRY').proxies(accessTokenId)]; + case 1: return [2 /*return*/, _a.sent()]; } }); }); }; @@ -30273,21 +30199,19 @@ function ProxyActions(Base) { proxy = this.contract('PROXY', proxyAddress); return [4 /*yield*/, proxy.accessToken()]; case 1: - accessToken = _a.sent(); + accessToken = (_a.sent()).toBN(); return [2 /*return*/, accessToken.toNumber()]; } }); }); }; _this.getProxyOwnerByLoan = function (loanId) { return __awaiter(_this, void 0, void 0, function () { - var res, loanOwner, accessToken; + var loanOwner, accessToken; return __generator(this, function (_a) { switch (_a.label) { - case 0: return [4 /*yield*/, executeAndRetry(this.contracts['TITLE'].ownerOf, [loanId])]; - case 1: - res = _a.sent(); - loanOwner = res[0]; + case 0: + loanOwner = this.contract('TITLE').ownerOf(loanId); return [4 /*yield*/, this.getProxyAccessToken(loanOwner)]; - case 2: + case 1: accessToken = _a.sent(); return [2 /*return*/, this.getProxyAccessTokenOwner(accessToken)]; } @@ -30305,13 +30229,10 @@ function ProxyActions(Base) { }); }); }; _this.proxyCount = function () { return __awaiter(_this, void 0, void 0, function () { - var res; return __generator(this, function (_a) { switch (_a.label) { - case 0: return [4 /*yield*/, executeAndRetry(this.contracts['PROXY_REGISTRY'].count, [])]; - case 1: - res = _a.sent(); - return [2 /*return*/, res[0]]; + case 0: return [4 /*yield*/, this.contract('PROXY_REGISTRY').count()]; + case 1: return [2 /*return*/, (_a.sent()).toBN()]; } }); }); }; @@ -30383,61 +30304,47 @@ function ProxyActions(Base) { return [2 /*return*/, this.pending(proxy.execute(this.contract('ACTIONS').address, encoded))]; }); }); }; - _this.proxyLockBorrowWithdraw = function (proxyAddr, loanId, amount, usr) { return __awaiter(_this, void 0, void 0, function () { - var proxy, encoded, txHash; + _this.proxyLockBorrowWithdraw = function (proxyAddress, loanId, amount, usr) { return __awaiter(_this, void 0, void 0, function () { + var proxy, encoded; return __generator(this, function (_a) { - switch (_a.label) { - case 0: - proxy = this.eth.contract(this.contractAbis['PROXY']).at(proxyAddr); - encoded = abiCoder$2.encodeFunctionCall({ - name: 'lockBorrowWithdraw', - type: 'function', - inputs: [ - { type: 'address', name: 'shelf' }, - { type: 'uint256', name: 'loan' }, - { type: 'uint256', name: 'amount' }, - { type: 'address', name: 'usr' }, - ], - }, [this.contracts['SHELF'].address, loanId, amount, usr]); - return [4 /*yield*/, executeAndRetry(proxy.execute, [this.contracts['ACTIONS'].address, encoded, this.ethConfig])]; - case 1: - txHash = _a.sent(); - console.log("[Proxy Lock Borrow Withdraw] txHash: " + txHash); - return [2 /*return*/, waitAndReturnEvents(this.eth, txHash, this.contractAbis['PROXY'], this.transactionTimeout)]; - } + proxy = this.contract('PROXY', proxyAddress); + encoded = abiCoder$2.encodeFunctionCall({ + name: 'lockBorrowWithdraw', + type: 'function', + inputs: [ + { type: 'address', name: 'shelf' }, + { type: 'uint256', name: 'loan' }, + { type: 'uint256', name: 'amount' }, + { type: 'address', name: 'usr' }, + ], + }, [this.contract('SHELF').address, loanId, amount, usr]); + return [2 /*return*/, this.pending(proxy.execute(this.contract('ACTIONS').address, encoded))]; }); }); }; - _this.proxyRepayUnlockClose = function (proxyAddr, tokenId, loanId, registry) { return __awaiter(_this, void 0, void 0, function () { - var proxy, encoded, txHash; + _this.proxyRepayUnlockClose = function (proxyAddress, tokenId, loanId, registry) { return __awaiter(_this, void 0, void 0, function () { + var proxy, encoded; return __generator(this, function (_a) { - switch (_a.label) { - case 0: - proxy = this.eth.contract(this.contractAbis['PROXY']).at(proxyAddr); - encoded = abiCoder$2.encodeFunctionCall({ - name: 'repayUnlockClose', - type: 'function', - inputs: [ - { type: 'address', name: 'shelf' }, - { type: 'address', name: 'pile' }, - { type: 'address', name: 'registry' }, - { type: 'uint256', name: 'token' }, - { type: 'address', name: 'erc20' }, - { type: 'uint256', name: 'loan' }, - ], - }, [ - this.contracts['SHELF'].address, - this.contracts['PILE'].address, - registry, - tokenId, - this.contracts['TINLAKE_CURRENCY'].address, - loanId, - ]); - return [4 /*yield*/, executeAndRetry(proxy.execute, [this.contracts['ACTIONS'].address, encoded, this.ethConfig])]; - case 1: - txHash = _a.sent(); - console.log("[Proxy Repay Unlock Close] txHash: " + txHash); - return [2 /*return*/, waitAndReturnEvents(this.eth, txHash, this.contractAbis['PROXY'], this.transactionTimeout)]; - } + proxy = this.contract('PROXY', proxyAddress); + encoded = abiCoder$2.encodeFunctionCall({ + name: 'repayUnlockClose', + type: 'function', + inputs: [ + { type: 'address', name: 'shelf' }, + { type: 'address', name: 'pile' }, + { type: 'address', name: 'registry' }, + { type: 'uint256', name: 'token' }, + { type: 'address', name: 'erc20' }, + { type: 'uint256', name: 'loan' }, + ], + }, [ + this.contract('SHELF').address, + this.contract('PILE').address, + registry, + tokenId, + this.contract('TINLAKE_CURRENCY').address, + loanId, + ]); + return [2 /*return*/, this.pending(proxy.execute(this.contract('ACTIONS').address, encoded))]; }); }); }; return _this; diff --git a/dist/index.js b/dist/index.js index 2fbfce6..f6581f6 100644 --- a/dist/index.js +++ b/dist/index.js @@ -10838,15 +10838,15 @@ function AdminActions(Base) { }); }; // ------------ admin functions borrower-site ------------- _this.existsRateGroup = function (ratePerSecond) { return __awaiter(_this, void 0, void 0, function () { - var rateGroup, res; + var rateGroup, actualRate; return __generator(this, function (_a) { switch (_a.label) { case 0: rateGroup = getRateGroup(ratePerSecond); - return [4 /*yield*/, executeAndRetry(this.contracts['PILE'].rates, [rateGroup])]; + return [4 /*yield*/, this.contract('PILE').rates(rateGroup)]; case 1: - res = _a.sent(); - return [2 /*return*/, !res.ratePerSecond.isZero()]; + actualRate = (_a.sent()).toBN(); + return [2 /*return*/, !actualRate.isZero()]; } }); }); }; @@ -10907,50 +10907,20 @@ function AdminActions(Base) { }); }); }; _this.approveAllowanceJunior = function (user, maxCurrency, maxToken) { return __awaiter(_this, void 0, void 0, function () { - var txHash; + var juniorOperator; return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, executeAndRetry(this.contracts['JUNIOR_OPERATOR'].approve, [ - user, - maxCurrency, - maxToken, - this.ethConfig, - ])]; - case 1: - txHash = _a.sent(); - console.log("[Approve allowance Junior] txHash: " + txHash); - return [2 /*return*/, waitAndReturnEvents(this.eth, txHash, this.contracts['JUNIOR_OPERATOR'].abi, this.transactionTimeout)]; - } + juniorOperator = this.contract('JUNIOR_OPERATOR'); + return [2 /*return*/, this.pending(juniorOperator.approve(user, maxCurrency, maxToken))]; }); }); }; _this.approveAllowanceSenior = function (user, maxCurrency, maxToken) { return __awaiter(_this, void 0, void 0, function () { - var operatorType, txHash, _a; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: - operatorType = this.getOperatorType('senior'); - _a = operatorType; - switch (_a) { - case 'PROPORTIONAL_OPERATOR': return [3 /*break*/, 1]; - } - return [3 /*break*/, 3]; - case 1: return [4 /*yield*/, executeAndRetry(this.contracts['SENIOR_OPERATOR'].approve, [user, maxCurrency, this.ethConfig])]; - case 2: - txHash = _b.sent(); - return [3 /*break*/, 5]; - case 3: return [4 /*yield*/, executeAndRetry(this.contracts['SENIOR_OPERATOR'].approve, [ - user, - maxCurrency, - maxToken, - this.ethConfig, - ])]; - case 4: - txHash = _b.sent(); - _b.label = 5; - case 5: - console.log("[Approve allowance Senior] txHash: " + txHash); - return [2 /*return*/, waitAndReturnEvents(this.eth, txHash, this.contracts['SENIOR_OPERATOR'].abi, this.transactionTimeout)]; + var seniorOperator; + return __generator(this, function (_a) { + seniorOperator = this.contract('SENIOR_OPERATOR'); + if (this.getOperatorType('senior') === 'PROPERTIONAL_OPERATOR') { + return [2 /*return*/, this.pending(seniorOperator.approve(user, maxCurrency))]; } + return [2 /*return*/, this.pending(seniorOperator.approve(user, maxCurrency, maxToken))]; }); }); }; return _this; @@ -29439,15 +29409,10 @@ function LenderActions(Base) { }); }); }; _this.redeemSenior = function (tokenAmount) { return __awaiter(_this, void 0, void 0, function () { - var txHash; + var seniorOperator; return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, executeAndRetry(this.contracts['SENIOR_OPERATOR'].redeem, [tokenAmount, this.ethConfig])]; - case 1: - txHash = _a.sent(); - console.log("[Redeem] txHash: " + txHash); - return [2 /*return*/, waitAndReturnEvents(this.eth, txHash, this.contracts['SENIOR_OPERATOR'].abi, this.transactionTimeout)]; - } + seniorOperator = this.contract('SENIOR_OPERATOR'); + return [2 /*return*/, this.pending(seniorOperator.redeem(tokenAmount))]; }); }); }; _this.getSeniorTokenAllowance = function (owner) { return __awaiter(_this, void 0, void 0, function () { @@ -29465,19 +29430,10 @@ function LenderActions(Base) { }); }); }; _this.approveSeniorToken = function (tokenAmount) { return __awaiter(_this, void 0, void 0, function () { - var txHash; + var senior; return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, executeAndRetry(this.contracts['SENIOR_TOKEN'].approve, [ - this.contractAddresses['SENIOR'], - tokenAmount, - this.ethConfig, - ])]; - case 1: - txHash = _a.sent(); - console.log("[Currency.approve] txHash: " + txHash); - return [2 /*return*/, waitAndReturnEvents(this.eth, txHash, this.contracts['SENIOR_TOKEN'].abi, this.transactionTimeout)]; - } + senior = this.contract('SENIOR_TOKEN'); + return [2 /*return*/, this.pending(senior.approve(this.contractAddresses['SENIOR'], tokenAmount))]; }); }); }; // junior tranche functions @@ -29489,15 +29445,10 @@ function LenderActions(Base) { }); }); }; _this.redeemJunior = function (tokenAmount) { return __awaiter(_this, void 0, void 0, function () { - var txHash; + var juniorOperator; return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, executeAndRetry(this.contracts['JUNIOR_OPERATOR'].redeem, [tokenAmount, this.ethConfig])]; - case 1: - txHash = _a.sent(); - console.log("[Redeem] txHash: " + txHash); - return [2 /*return*/, waitAndReturnEvents(this.eth, txHash, this.contracts['JUNIOR_OPERATOR'].abi, this.transactionTimeout)]; - } + juniorOperator = this.contract('JUNIOR_OPERATOR'); + return [2 /*return*/, this.pending(juniorOperator.redeem(tokenAmount))]; }); }); }; _this.getJuniorTokenAllowance = function (owner) { return __awaiter(_this, void 0, void 0, function () { @@ -29515,19 +29466,10 @@ function LenderActions(Base) { }); }); }; _this.approveJuniorToken = function (tokenAmount) { return __awaiter(_this, void 0, void 0, function () { - var txHash; + var junior; return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, executeAndRetry(this.contracts['JUNIOR_TOKEN'].approve, [ - this.contractAddresses['JUNIOR'], - tokenAmount, - this.ethConfig, - ])]; - case 1: - txHash = _a.sent(); - console.log("[Currency.approve] txHash: " + txHash); - return [2 /*return*/, waitAndReturnEvents(this.eth, txHash, this.contracts['JUNIOR_TOKEN'].abi, this.transactionTimeout)]; - } + junior = this.contract('JUNIOR_TOKEN'); + return [2 /*return*/, this.pending(junior.approve(this.contractAddresses['JUNIOR'], tokenAmount))]; }); }); }; // general lender functions @@ -29568,15 +29510,13 @@ function CurrencyActions(Base) { }); }); }; _this.getCurrencyAllowance = function (owner, spender) { return __awaiter(_this, void 0, void 0, function () { - var currencyContract, allowance; + var currencyContract; return __generator(this, function (_a) { switch (_a.label) { case 0: currencyContract = this.contract('TINLAKE_CURRENCY'); return [4 /*yield*/, currencyContract.allowance(owner, spender)]; - case 1: - allowance = _a.sent(); - return [2 /*return*/, allowance.toBN()]; + case 1: return [2 /*return*/, (_a.sent()).toBN()]; } }); }); }; @@ -29595,30 +29535,18 @@ function CurrencyActions(Base) { }); }); }; _this.getCurrencyBalance = function (user) { return __awaiter(_this, void 0, void 0, function () { - var res; return __generator(this, function (_a) { switch (_a.label) { - case 0: return [4 /*yield*/, executeAndRetry(this.contracts['TINLAKE_CURRENCY'].balanceOf, [user])]; - case 1: - res = _a.sent(); - return [2 /*return*/, res[0] || new bn(0)]; + case 0: return [4 /*yield*/, this.contract('TINLAKE_CURRENCY').balanceOf(user)]; + case 1: return [2 /*return*/, (_a.sent()).toBN()]; } }); }); }; _this.approveCurrency = function (usr, currencyAmount) { return __awaiter(_this, void 0, void 0, function () { - var currencyContract, tx; + var currencyContract; return __generator(this, function (_a) { - switch (_a.label) { - case 0: - currencyContract = this.contract('TINLAKE_CURRENCY'); - return [4 /*yield*/, currencyContract.approve(usr, currencyAmount)]; - case 1: - tx = _a.sent(); - return [2 /*return*/, { - hash: tx.hash, - contractKey: 'TINLAKE_CURRENCY', - }]; - } + currencyContract = this.contract('TINLAKE_CURRENCY'); + return [2 /*return*/, this.pending(currencyContract.approve(usr, currencyAmount))]; }); }); }; _this.approveSeniorForCurrency = function (currencyAmount) { return __awaiter(_this, void 0, void 0, function () { @@ -30256,18 +30184,16 @@ function ProxyActions(Base) { return [4 /*yield*/, waitAndReturnEvents(this.eth, txHash, this.contracts['PROXY_REGISTRY'].abi, this.transactionTimeout)]; case 2: response = _a.sent(); + console.log('create proxy response', response); return [2 /*return*/, response.events[0].data[2].toString()]; } }); }); }; _this.getProxy = function (accessTokenId) { return __awaiter(_this, void 0, void 0, function () { - var res; return __generator(this, function (_a) { switch (_a.label) { - case 0: return [4 /*yield*/, executeAndRetry(this.contracts['PROXY_REGISTRY'].proxies, [accessTokenId, this.ethConfig])]; - case 1: - res = _a.sent(); - return [2 /*return*/, res[0]]; + case 0: return [4 /*yield*/, this.contract('PROXY_REGISTRY').proxies(accessTokenId)]; + case 1: return [2 /*return*/, _a.sent()]; } }); }); }; @@ -30279,21 +30205,19 @@ function ProxyActions(Base) { proxy = this.contract('PROXY', proxyAddress); return [4 /*yield*/, proxy.accessToken()]; case 1: - accessToken = _a.sent(); + accessToken = (_a.sent()).toBN(); return [2 /*return*/, accessToken.toNumber()]; } }); }); }; _this.getProxyOwnerByLoan = function (loanId) { return __awaiter(_this, void 0, void 0, function () { - var res, loanOwner, accessToken; + var loanOwner, accessToken; return __generator(this, function (_a) { switch (_a.label) { - case 0: return [4 /*yield*/, executeAndRetry(this.contracts['TITLE'].ownerOf, [loanId])]; - case 1: - res = _a.sent(); - loanOwner = res[0]; + case 0: + loanOwner = this.contract('TITLE').ownerOf(loanId); return [4 /*yield*/, this.getProxyAccessToken(loanOwner)]; - case 2: + case 1: accessToken = _a.sent(); return [2 /*return*/, this.getProxyAccessTokenOwner(accessToken)]; } @@ -30311,13 +30235,10 @@ function ProxyActions(Base) { }); }); }; _this.proxyCount = function () { return __awaiter(_this, void 0, void 0, function () { - var res; return __generator(this, function (_a) { switch (_a.label) { - case 0: return [4 /*yield*/, executeAndRetry(this.contracts['PROXY_REGISTRY'].count, [])]; - case 1: - res = _a.sent(); - return [2 /*return*/, res[0]]; + case 0: return [4 /*yield*/, this.contract('PROXY_REGISTRY').count()]; + case 1: return [2 /*return*/, (_a.sent()).toBN()]; } }); }); }; @@ -30389,61 +30310,47 @@ function ProxyActions(Base) { return [2 /*return*/, this.pending(proxy.execute(this.contract('ACTIONS').address, encoded))]; }); }); }; - _this.proxyLockBorrowWithdraw = function (proxyAddr, loanId, amount, usr) { return __awaiter(_this, void 0, void 0, function () { - var proxy, encoded, txHash; + _this.proxyLockBorrowWithdraw = function (proxyAddress, loanId, amount, usr) { return __awaiter(_this, void 0, void 0, function () { + var proxy, encoded; return __generator(this, function (_a) { - switch (_a.label) { - case 0: - proxy = this.eth.contract(this.contractAbis['PROXY']).at(proxyAddr); - encoded = abiCoder$2.encodeFunctionCall({ - name: 'lockBorrowWithdraw', - type: 'function', - inputs: [ - { type: 'address', name: 'shelf' }, - { type: 'uint256', name: 'loan' }, - { type: 'uint256', name: 'amount' }, - { type: 'address', name: 'usr' }, - ], - }, [this.contracts['SHELF'].address, loanId, amount, usr]); - return [4 /*yield*/, executeAndRetry(proxy.execute, [this.contracts['ACTIONS'].address, encoded, this.ethConfig])]; - case 1: - txHash = _a.sent(); - console.log("[Proxy Lock Borrow Withdraw] txHash: " + txHash); - return [2 /*return*/, waitAndReturnEvents(this.eth, txHash, this.contractAbis['PROXY'], this.transactionTimeout)]; - } + proxy = this.contract('PROXY', proxyAddress); + encoded = abiCoder$2.encodeFunctionCall({ + name: 'lockBorrowWithdraw', + type: 'function', + inputs: [ + { type: 'address', name: 'shelf' }, + { type: 'uint256', name: 'loan' }, + { type: 'uint256', name: 'amount' }, + { type: 'address', name: 'usr' }, + ], + }, [this.contract('SHELF').address, loanId, amount, usr]); + return [2 /*return*/, this.pending(proxy.execute(this.contract('ACTIONS').address, encoded))]; }); }); }; - _this.proxyRepayUnlockClose = function (proxyAddr, tokenId, loanId, registry) { return __awaiter(_this, void 0, void 0, function () { - var proxy, encoded, txHash; + _this.proxyRepayUnlockClose = function (proxyAddress, tokenId, loanId, registry) { return __awaiter(_this, void 0, void 0, function () { + var proxy, encoded; return __generator(this, function (_a) { - switch (_a.label) { - case 0: - proxy = this.eth.contract(this.contractAbis['PROXY']).at(proxyAddr); - encoded = abiCoder$2.encodeFunctionCall({ - name: 'repayUnlockClose', - type: 'function', - inputs: [ - { type: 'address', name: 'shelf' }, - { type: 'address', name: 'pile' }, - { type: 'address', name: 'registry' }, - { type: 'uint256', name: 'token' }, - { type: 'address', name: 'erc20' }, - { type: 'uint256', name: 'loan' }, - ], - }, [ - this.contracts['SHELF'].address, - this.contracts['PILE'].address, - registry, - tokenId, - this.contracts['TINLAKE_CURRENCY'].address, - loanId, - ]); - return [4 /*yield*/, executeAndRetry(proxy.execute, [this.contracts['ACTIONS'].address, encoded, this.ethConfig])]; - case 1: - txHash = _a.sent(); - console.log("[Proxy Repay Unlock Close] txHash: " + txHash); - return [2 /*return*/, waitAndReturnEvents(this.eth, txHash, this.contractAbis['PROXY'], this.transactionTimeout)]; - } + proxy = this.contract('PROXY', proxyAddress); + encoded = abiCoder$2.encodeFunctionCall({ + name: 'repayUnlockClose', + type: 'function', + inputs: [ + { type: 'address', name: 'shelf' }, + { type: 'address', name: 'pile' }, + { type: 'address', name: 'registry' }, + { type: 'uint256', name: 'token' }, + { type: 'address', name: 'erc20' }, + { type: 'uint256', name: 'loan' }, + ], + }, [ + this.contract('SHELF').address, + this.contract('PILE').address, + registry, + tokenId, + this.contract('TINLAKE_CURRENCY').address, + loanId, + ]); + return [2 /*return*/, this.pending(proxy.execute(this.contract('ACTIONS').address, encoded))]; }); }); }; return _this; diff --git a/docs/classes/_tinlake_.tinlake.html b/docs/classes/_tinlake_.tinlake.html index 2c9eded..40b6b36 100644 --- a/docs/classes/_tinlake_.tinlake.html +++ b/docs/classes/_tinlake_.tinlake.html @@ -129,7 +129,7 @@

    constructor

  • Parameters

    @@ -151,7 +151,7 @@

    contractAbis

    contractAbis: ContractAbis
    @@ -161,7 +161,7 @@

    contractAddresses

    contractAddresses: ContractAddresses
    @@ -171,7 +171,7 @@

    contractConfig

    contractConfig: any
    @@ -181,7 +181,7 @@

    contracts

    contracts: Contracts
    @@ -191,7 +191,7 @@

    eth

    eth: ethI
    @@ -201,7 +201,7 @@

    ethConfig

    ethConfig: EthConfig
    @@ -211,7 +211,7 @@

    ethOptions

    ethOptions: any
    @@ -221,7 +221,7 @@

    ethersConfig

    ethersConfig: EthersConfig
    @@ -231,7 +231,7 @@

    ethersContracts

    ethersContracts: Contracts
    @@ -241,7 +241,7 @@

    provider

    provider: any
    @@ -251,7 +251,7 @@

    transactionTimeout

    transactionTimeout: number
    @@ -268,7 +268,7 @@

    contract

  • Parameters

    @@ -294,7 +294,7 @@

    createContract

  • Parameters

    @@ -320,7 +320,7 @@

    createEthContract

  • Parameters

    @@ -346,7 +346,7 @@

    getOperatorType

  • Parameters

    @@ -369,7 +369,7 @@

    getTransactionReceipt

  • Parameters

    @@ -392,7 +392,7 @@

    pending

  • Parameters

    @@ -415,7 +415,7 @@

    setContracts

  • Returns void

    @@ -432,7 +432,7 @@

    setEthConfig

  • Parameters

    @@ -455,7 +455,7 @@

    setEthersConfig

  • Parameters

    @@ -478,7 +478,7 @@

    setProvider

  • Parameters

    diff --git a/docs/interfaces/_services_ethereum_.ethi.html b/docs/interfaces/_services_ethereum_.ethi.html index 7e4cf79..578ce00 100644 --- a/docs/interfaces/_services_ethereum_.ethi.html +++ b/docs/interfaces/_services_ethereum_.ethi.html @@ -101,7 +101,7 @@

    abi

    abi: any
    @@ -111,7 +111,7 @@

    contract

    contract: (arg0: any) => { at: (arg0: any) => void }
    @@ -165,7 +165,7 @@

    getTransactionByHash

    getTransactionByHash: (arg0: any, arg1: (err: any, tx: any) => void) => void
    @@ -220,7 +220,7 @@

    getTransactionCount

    getTransactionCount: any
    @@ -230,7 +230,7 @@

    getTransactionReceipt

    getTransactionReceipt: (arg0: any, arg1: (err: any, receipt: any) => void) => void
    @@ -285,7 +285,7 @@

    send

    send: Function
    @@ -295,7 +295,7 @@

    sendRawTransaction

    sendRawTransaction: any
    @@ -305,7 +305,7 @@

    web3_sha3

    web3_sha3: (signature: string) => string
    diff --git a/docs/interfaces/_services_ethereum_.events.html b/docs/interfaces/_services_ethereum_.events.html index 9cc9e2d..e61c2c0 100644 --- a/docs/interfaces/_services_ethereum_.events.html +++ b/docs/interfaces/_services_ethereum_.events.html @@ -96,7 +96,7 @@

    events

    events: { data: any[]; event: { name: any } }[]
    @@ -106,7 +106,7 @@

    status

    status: any
    @@ -116,7 +116,7 @@

    txHash

    txHash: string
    diff --git a/docs/modules/_actions_admin_.html b/docs/modules/_actions_admin_.html index 7945eda..9fbf985 100644 --- a/docs/modules/_actions_admin_.html +++ b/docs/modules/_actions_admin_.html @@ -89,7 +89,7 @@

    IAdminActions

    IAdminActions: { approveAllowanceJunior: any; approveAllowanceSenior: any; canSetInterestRate: any; canSetInvestorAllowanceJunior: any; canSetInvestorAllowanceSenior: any; canSetLoanPrice: any; canSetMinimumJuniorRatio: any; canSetRiskScore: any; canSetSeniorTrancheInterest: any; initRate: any; isWard: any; setMinimumJuniorRatio: any; setRate: any }
    @@ -104,7 +104,7 @@
    approveAllowanceJunior:
  • Parameters

    @@ -132,7 +132,7 @@
    approveAllowanceSenior:
  • Parameters

    @@ -160,7 +160,7 @@
    canSetInterestRate:

    Parameters

    @@ -182,7 +182,7 @@
    canSetInvestorAllowanceJunior

    Parameters

    @@ -204,7 +204,7 @@
    canSetInvestorAllowanceSenior

    Parameters

    @@ -226,7 +226,7 @@
    canSetLoanPrice: fu
  • Parameters

    @@ -248,7 +248,7 @@
    canSetMinimumJuniorRatio

    Parameters

    @@ -270,7 +270,7 @@
    canSetRiskScore: fu
  • Parameters

    @@ -292,7 +292,7 @@
    canSetSeniorTrancheInterest

    Parameters

    @@ -314,7 +314,7 @@
    initRate: function
  • Parameters

    @@ -336,7 +336,7 @@
    isWard: function
  • Parameters

    @@ -361,7 +361,7 @@
    setMinimumJuniorRatio:

    Parameters

    @@ -383,7 +383,7 @@
    setRate: function
  • Parameters

    @@ -415,7 +415,7 @@

    AdminActions

  • Type parameters

    diff --git a/docs/modules/_actions_analytics_.html b/docs/modules/_actions_analytics_.html index 1449c2c..0a06fad 100644 --- a/docs/modules/_actions_analytics_.html +++ b/docs/modules/_actions_analytics_.html @@ -89,7 +89,7 @@

    IAnalyticsActions

    IAnalyticsActions: { existsSenior: any; getAssetValueJunior: any; getCollateral: any; getCurrentJuniorRatio: any; getDebt: any; getInterestRate: any; getInvestor: any; getJuniorReserve: any; getJuniorTokenBalance: any; getLoan: any; getLoanList: any; getMaxRedeemAmountJunior: any; getMaxRedeemAmountSenior: any; getMaxSupplyAmountJunior: any; getMaxSupplyAmountSenior: any; getMinJuniorRatio: any; getOwnerOfCollateral: any; getOwnerOfLoan: any; getPrincipal: any; getSeniorDebt: any; getSeniorInterestRate: any; getSeniorReserve: any; getSeniorTokenBalance: any; getTokenPriceJunior: any; getTokenPriceSenior: any; getTotalBalance: any; getTotalDebt: any; loanCount: any }
    @@ -104,7 +104,7 @@
    existsSenior: function
  • Returns boolean

    @@ -120,7 +120,7 @@
    getAssetValueJunior:

    Returns Promise<BN>

    @@ -136,7 +136,7 @@
    getCollateral: function
  • Parameters

    @@ -158,7 +158,7 @@
    getCurrentJuniorRatio:

    Returns Promise<BN>

    @@ -174,7 +174,7 @@
    getDebt: function
  • Parameters

    @@ -196,7 +196,7 @@
    getInterestRate: functio
  • Parameters

    @@ -218,7 +218,7 @@
    getInvestor: function
  • Parameters

    @@ -240,7 +240,7 @@
    getJuniorReserve: functi
  • Returns Promise<BN>

    @@ -256,7 +256,7 @@
    getJuniorTokenBalance:

    Parameters

    @@ -278,7 +278,7 @@
    getLoan: function
  • Parameters

    @@ -300,7 +300,7 @@
    getLoanList: function

    Returns Promise<Loan[]>

    @@ -316,7 +316,7 @@
    getMaxRedeemAmountJunior

    Parameters

    @@ -338,7 +338,7 @@
    getMaxRedeemAmountSenior

    Parameters

    @@ -360,7 +360,7 @@
    getMaxSupplyAmountJunior

    Parameters

    @@ -382,7 +382,7 @@
    getMaxSupplyAmountSenior

    Parameters

    @@ -404,7 +404,7 @@
    getMinJuniorRatio:
  • Returns Promise<BN>

    @@ -420,7 +420,7 @@
    getOwnerOfCollateral: fu
  • Parameters

    @@ -448,7 +448,7 @@
    getOwnerOfLoan: function
  • Parameters

    @@ -470,7 +470,7 @@
    getPrincipal: function
  • Parameters

    @@ -492,7 +492,7 @@
    getSeniorDebt: function<
  • Returns Promise<BN>

    @@ -508,7 +508,7 @@
    getSeniorInterestRate:

    Returns Promise<BN>

    @@ -524,7 +524,7 @@
    getSeniorReserve: functi
  • Returns Promise<BN>

    @@ -540,7 +540,7 @@
    getSeniorTokenBalance:

    Parameters

    @@ -562,7 +562,7 @@
    getTokenPriceJunior:

    Returns Promise<BN>

    @@ -578,7 +578,7 @@
    getTokenPriceSenior:

    Parameters

    @@ -600,7 +600,7 @@
    getTotalBalance: functio
  • Returns Promise<BN>

    @@ -616,7 +616,7 @@
    getTotalDebt: function

    Returns Promise<BN>

    @@ -632,7 +632,7 @@
    loanCount: function
  • Returns Promise<BN>

    @@ -655,7 +655,7 @@

    AnalyticsActions

  • Type parameters

    diff --git a/docs/modules/_actions_borrower_.html b/docs/modules/_actions_borrower_.html index d1964b2..7acfd73 100644 --- a/docs/modules/_actions_borrower_.html +++ b/docs/modules/_actions_borrower_.html @@ -89,7 +89,7 @@

    IBorrowerActions

    IBorrowerActions: { borrow: any; close: any; issue: any; lock: any; nftLookup: any; repay: any; unlock: any; withdraw: any }
    @@ -104,7 +104,7 @@
    borrow: function
  • Parameters

    @@ -129,7 +129,7 @@
    close: function
  • Parameters

    @@ -151,7 +151,7 @@
    issue: function
  • Parameters

    @@ -176,7 +176,7 @@
    lock: function
  • Parameters

    @@ -198,7 +198,7 @@
    nftLookup: function
  • Parameters

    @@ -223,7 +223,7 @@
    repay: function
  • Parameters

    @@ -248,7 +248,7 @@
    unlock: function
  • Parameters

    @@ -270,7 +270,7 @@
    withdraw: function
  • Parameters

    @@ -305,7 +305,7 @@

    BorrowerActions

  • Type parameters

    diff --git a/docs/modules/_actions_collateral_.html b/docs/modules/_actions_collateral_.html index 44f598f..34ac8b4 100644 --- a/docs/modules/_actions_collateral_.html +++ b/docs/modules/_actions_collateral_.html @@ -89,7 +89,7 @@

    ICollateralActions

    ICollateralActions: { approveNFT: any; getNFTCount: any; getNFTData: any; getNFTOwner: any; isNFTApprovedForAll: any; mintNFT: any; mintTitleNFT: any; setNFTApprovalForAll: any; transferNFT: any }
    @@ -104,7 +104,7 @@
    approveNFT: function
  • Parameters

    @@ -132,7 +132,7 @@
    getNFTCount: function
  • Parameters

    @@ -154,7 +154,7 @@
    getNFTData: function
  • Parameters

    @@ -179,7 +179,7 @@
    getNFTOwner: function
  • Parameters

    @@ -204,7 +204,7 @@
    isNFTApprovedForAll: fun
  • Parameters

    @@ -232,7 +232,7 @@
    mintNFT: function
  • Parameters

    @@ -269,7 +269,7 @@
    mintTitleNFT: function
  • Parameters

    @@ -294,7 +294,7 @@
    setNFTApprovalForAll: fu
  • Parameters

    @@ -322,7 +322,7 @@
    transferNFT: function
  • Parameters

    @@ -360,7 +360,7 @@

    CollateralActions

  • Type parameters

    diff --git a/docs/modules/_actions_currency_.html b/docs/modules/_actions_currency_.html index 3d83f6b..680d727 100644 --- a/docs/modules/_actions_currency_.html +++ b/docs/modules/_actions_currency_.html @@ -89,7 +89,7 @@

    ICurrencyActions

    ICurrencyActions: { approveJuniorForCurrency: (currencyAmount: string) => Promise<PendingTransaction | undefined>; approveSeniorForCurrency: (currencyAmount: string) => Promise<PendingTransaction | undefined>; getCurrencyAllowance: (owner: string, spender: string) => Promise<BN>; getJuniorForCurrencyAllowance: (owner: string) => Promise<BN | undefined>; getSeniorForCurrencyAllowance: (owner: string) => Promise<BN | undefined>; approveCurrency: any; getCurrencyBalance: any; mintCurrency: any }
    @@ -212,7 +212,7 @@
    approveCurrency: function

    Parameters

    @@ -237,7 +237,7 @@
    getCurrencyBalance: func
  • Parameters

    @@ -259,7 +259,7 @@
    mintCurrency: function
  • Parameters

    @@ -291,7 +291,7 @@

    CurrencyActions

  • Type parameters

    diff --git a/docs/modules/_actions_governance_.html b/docs/modules/_actions_governance_.html index 8864674..b38acde 100644 --- a/docs/modules/_actions_governance_.html +++ b/docs/modules/_actions_governance_.html @@ -83,7 +83,7 @@

    IGovernanceActions

    IGovernanceActions: { relyAddress: any }
    @@ -98,7 +98,7 @@
    relyAddress: function
  • Parameters

    diff --git a/docs/modules/_actions_index_.html b/docs/modules/_actions_index_.html index a354aa3..28db4f2 100644 --- a/docs/modules/_actions_index_.html +++ b/docs/modules/_actions_index_.html @@ -83,7 +83,7 @@

    TinlakeActions

    diff --git a/docs/modules/_actions_lender_.html b/docs/modules/_actions_lender_.html index 457b233..7e8df74 100644 --- a/docs/modules/_actions_lender_.html +++ b/docs/modules/_actions_lender_.html @@ -89,7 +89,7 @@

    ILenderActions

    ILenderActions: { approveJuniorToken: (tokenAmount: string) => Promise<unknown>; approveSeniorToken: (tokenAmount: string) => Promise<unknown>; balance: any; getJuniorTokenAllowance: any; getSeniorTokenAllowance: any; redeemJunior: any; redeemSenior: any; supplyJunior: any; supplySenior: any }
    @@ -146,7 +146,7 @@
    balance: function
  • Returns Promise<any>

    @@ -162,7 +162,7 @@
    getJuniorTokenAllowance: <
  • Parameters

    @@ -184,7 +184,7 @@
    getSeniorTokenAllowance: <
  • Parameters

    @@ -206,7 +206,7 @@
    redeemJunior: function
  • Parameters

    @@ -228,7 +228,7 @@
    redeemSenior: function
  • Parameters

    @@ -250,7 +250,7 @@
    supplyJunior: function
  • Parameters

    @@ -272,7 +272,7 @@
    supplySenior: function
  • Parameters

    @@ -301,7 +301,7 @@

    LenderActions

  • Type parameters

    diff --git a/docs/modules/_actions_proxy_.html b/docs/modules/_actions_proxy_.html index 60058d7..a54e14e 100644 --- a/docs/modules/_actions_proxy_.html +++ b/docs/modules/_actions_proxy_.html @@ -89,7 +89,7 @@

    IProxyActions

    IProxyActions: { buildProxy: any; checkProxyExists: any; getProxy: any; getProxyAccessToken: any; getProxyAccessTokenOwner: any; getProxyOwnerByAddress: any; getProxyOwnerByLoan: any; proxyCount: any; proxyCreateNew: any; proxyIssue: any; proxyLockBorrowWithdraw: any; proxyRepayUnlockClose: any; proxyTransferIssue: any }
    @@ -104,7 +104,7 @@
    buildProxy: function
  • Parameters

    @@ -126,7 +126,7 @@
    checkProxyExists: functi
  • Parameters

    @@ -148,7 +148,7 @@
    getProxy: function
  • Parameters

    @@ -170,7 +170,7 @@
    getProxyAccessToken:

    Parameters

    @@ -192,7 +192,7 @@
    getProxyAccessTokenOwner

    Parameters

    @@ -214,7 +214,7 @@
    getProxyOwnerByAddress:

    Parameters

    @@ -236,7 +236,7 @@
    getProxyOwnerByLoan:

    Parameters

    @@ -258,7 +258,7 @@
    proxyCount: function
  • Returns Promise<any>

    @@ -274,7 +274,7 @@
    proxyCreateNew: function
  • Parameters

    @@ -296,7 +296,7 @@
    proxyIssue: function
  • Parameters

    @@ -324,7 +324,7 @@
    proxyLockBorrowWithdraw: <
  • Parameters

    @@ -355,7 +355,7 @@
    proxyRepayUnlockClose:

    Parameters

    @@ -386,7 +386,7 @@
    proxyTransferIssue: func
  • Parameters

    @@ -421,7 +421,7 @@

    ProxyActions

  • Type parameters

    diff --git a/docs/modules/_services_ethereum_.html b/docs/modules/_services_ethereum_.html index 6260c51..aa2085d 100644 --- a/docs/modules/_services_ethereum_.html +++ b/docs/modules/_services_ethereum_.html @@ -99,7 +99,7 @@

    Const ZERO_ADDRESS

    ZERO_ADDRESS: "0x0000000000000000000000000000000000000000" = "0x0000000000000000000000000000000000000000"
    @@ -116,7 +116,7 @@

    executeAndRetry

  • Parameters

    @@ -142,7 +142,7 @@

    Const findEvent

  • Parameters

    @@ -209,7 +209,7 @@

    Const waitAndReturn

    Parameters

    @@ -241,7 +241,7 @@

    Const waitForTransactio
  • Parameters

    diff --git a/docs/modules/_tinlake_.html b/docs/modules/_tinlake_.html index 69750c7..8c357ba 100644 --- a/docs/modules/_tinlake_.html +++ b/docs/modules/_tinlake_.html @@ -98,7 +98,7 @@

    Constructor

    Constructor<T>: {}

    Type parameters

    @@ -119,7 +119,7 @@

    ContractAbis

    ContractAbis: {}
    @@ -134,7 +134,7 @@

    ContractAddresses

    ContractAddresses: {}
    @@ -149,7 +149,7 @@

    ContractName

    ContractName: typeof contractNames[number]
    @@ -159,7 +159,7 @@

    Contracts

    Contracts: {}
    @@ -174,7 +174,7 @@

    EthConfig

    EthConfig: { from?: undefined | string; gas?: undefined | string; gasPrice?: undefined | string }
    @@ -198,7 +198,7 @@

    EthersConfig

    EthersConfig: { overrides?: EthersOverrides; provider: Provider; signer: Signer }
    @@ -222,7 +222,7 @@

    EthersOverrides

    EthersOverrides: { gasLimit?: undefined | number; gasPrice?: undefined | number }
    @@ -243,7 +243,7 @@

    PendingTransaction

    PendingTransaction: { hash: string | undefined; timesOutAt?: undefined | number }
    @@ -264,7 +264,7 @@

    TinlakeParams

    TinlakeParams: { contractAbis?: ContractAbis | {}; contractAddresses?: ContractAddresses | {}; contractConfig?: any | {}; contracts?: Contracts | {}; ethConfig?: EthConfig; ethOptions?: any | {}; ethersConfig?: EthersConfig; provider: any; transactionTimeout: number }
    diff --git a/docs/modules/_types_tinlake_.html b/docs/modules/_types_tinlake_.html index 2fce6f0..2ccffcc 100644 --- a/docs/modules/_types_tinlake_.html +++ b/docs/modules/_types_tinlake_.html @@ -87,7 +87,7 @@

    ITinlake

    @@ -97,7 +97,7 @@

    Investor

    Investor: { address: string; junior: { maxRedeem: BN; maxSupply: BN; tokenBalance: BN }; senior: { maxRedeem?: BN; maxSupply?: BN; tokenBalance?: BN } }
    @@ -143,7 +143,7 @@

    Loan

    Loan: { debt: BN; interestRate: BN; loanId: string; nft?: NFT; ownerOf: BN; price?: BN; principal: BN; proxyOwner?: undefined | string; registry: string; status?: undefined | string; threshold?: BN; tokenId: BN }
    @@ -194,7 +194,7 @@

    NFT

    NFT: { nftData: any; nftOwner: string; registry: string; tokenId: BN }
    @@ -221,7 +221,7 @@

    Tranche

    Tranche: { availableFunds: BN; interestRate?: BN; token: string; tokenPrice: BN; totalSupply: BN; type: string }
    diff --git a/docs/modules/_utils_basetodisplay_.html b/docs/modules/_utils_basetodisplay_.html index 2fc7dbf..5f3be40 100644 --- a/docs/modules/_utils_basetodisplay_.html +++ b/docs/modules/_utils_basetodisplay_.html @@ -87,7 +87,7 @@

    Const baseToDisplay

  • Parameters

    diff --git a/docs/modules/_utils_bntohex_.html b/docs/modules/_utils_bntohex_.html index 147f5b8..60076a4 100644 --- a/docs/modules/_utils_bntohex_.html +++ b/docs/modules/_utils_bntohex_.html @@ -87,7 +87,7 @@

    Const bnToHex

  • Parameters

    diff --git a/docs/modules/_utils_displaytobase_.html b/docs/modules/_utils_displaytobase_.html index 58d3d90..25be0e9 100644 --- a/docs/modules/_utils_displaytobase_.html +++ b/docs/modules/_utils_displaytobase_.html @@ -87,7 +87,7 @@

    Const displayToBase

  • Parameters

    diff --git a/docs/modules/_utils_feetointerestrate_.html b/docs/modules/_utils_feetointerestrate_.html index a8446eb..672972a 100644 --- a/docs/modules/_utils_feetointerestrate_.html +++ b/docs/modules/_utils_feetointerestrate_.html @@ -87,7 +87,7 @@

    Const feeToInterestRate
  • diff --git a/docs/modules/_utils_getloanstatus_.html b/docs/modules/_utils_getloanstatus_.html index 0ab69ad..c0d3ba3 100644 --- a/docs/modules/_utils_getloanstatus_.html +++ b/docs/modules/_utils_getloanstatus_.html @@ -89,7 +89,7 @@

    LoanStatus

    LoanStatus: "Whitelisted" | "Ongoing" | "Repaid"
    @@ -106,7 +106,7 @@

    getLoanStatus

  • Parameters

    diff --git a/docs/modules/_utils_interestratetofee_.html b/docs/modules/_utils_interestratetofee_.html index 6fad2b0..f81ef49 100644 --- a/docs/modules/_utils_interestratetofee_.html +++ b/docs/modules/_utils_interestratetofee_.html @@ -87,7 +87,7 @@

    Const interestRateToFee
  • diff --git a/src/actions/admin.ts b/src/actions/admin.ts index c1b538a..a37deb6 100644 --- a/src/actions/admin.ts +++ b/src/actions/admin.ts @@ -91,8 +91,8 @@ export function AdminActions>(Bas // ------------ admin functions borrower-site ------------- existsRateGroup = async (ratePerSecond: string) => { const rateGroup = getRateGroup(ratePerSecond) - const res: { ratePerSecond: BN } = await executeAndRetry(this.contracts['PILE'].rates, [rateGroup]) - return !res.ratePerSecond.isZero() + const actualRate = (await this.contract('PILE').rates(rateGroup)).toBN() + return !actualRate.isZero() } initRate = async (ratePerSecond: string) => { @@ -129,34 +129,18 @@ export function AdminActions>(Bas } approveAllowanceJunior = async (user: string, maxCurrency: string, maxToken: string) => { - const txHash = await executeAndRetry(this.contracts['JUNIOR_OPERATOR'].approve, [ - user, - maxCurrency, - maxToken, - this.ethConfig, - ]) - console.log(`[Approve allowance Junior] txHash: ${txHash}`) - return waitAndReturnEvents(this.eth, txHash, this.contracts['JUNIOR_OPERATOR'].abi, this.transactionTimeout) + const juniorOperator = this.contract('JUNIOR_OPERATOR') + return this.pending(juniorOperator.approve(user, maxCurrency, maxToken)) } approveAllowanceSenior = async (user: string, maxCurrency: string, maxToken: string) => { - const operatorType = this.getOperatorType('senior') - let txHash - switch (operatorType) { - case 'PROPORTIONAL_OPERATOR': - txHash = await executeAndRetry(this.contracts['SENIOR_OPERATOR'].approve, [user, maxCurrency, this.ethConfig]) - break - // ALLOWANCE_OPERATOR - default: - txHash = await executeAndRetry(this.contracts['SENIOR_OPERATOR'].approve, [ - user, - maxCurrency, - maxToken, - this.ethConfig, - ]) + const seniorOperator = this.contract('SENIOR_OPERATOR') + + if (this.getOperatorType('senior') === 'PROPERTIONAL_OPERATOR') { + return this.pending(seniorOperator.approve(user, maxCurrency)) + } else { + return this.pending(seniorOperator.approve(user, maxCurrency, maxToken)) } - console.log(`[Approve allowance Senior] txHash: ${txHash}`) - return waitAndReturnEvents(this.eth, txHash, this.contracts['SENIOR_OPERATOR'].abi, this.transactionTimeout) } } } diff --git a/src/actions/currency.ts b/src/actions/currency.ts index 0058996..fbb998d 100644 --- a/src/actions/currency.ts +++ b/src/actions/currency.ts @@ -13,8 +13,7 @@ export function CurrencyActions>( getCurrencyAllowance = async (owner: string, spender: string) => { const currencyContract = this.contract('TINLAKE_CURRENCY') - const allowance = await currencyContract.allowance(owner, spender) - return allowance.toBN() + return (await currencyContract.allowance(owner, spender)).toBN() } getJuniorForCurrencyAllowance = async (owner: string) => { @@ -28,18 +27,12 @@ export function CurrencyActions>( } getCurrencyBalance = async (user: string) => { - const res: { 0: BN } = await executeAndRetry(this.contracts['TINLAKE_CURRENCY'].balanceOf, [user]) - return res[0] || new BN(0) + return (await this.contract('TINLAKE_CURRENCY').balanceOf(user)).toBN() } approveCurrency = async (usr: string, currencyAmount: string) => { const currencyContract = this.contract('TINLAKE_CURRENCY') - const tx = await currencyContract.approve(usr, currencyAmount) - - return { - hash: tx.hash, - contractKey: 'TINLAKE_CURRENCY', - } + return this.pending(currencyContract.approve(usr, currencyAmount)) } approveSeniorForCurrency = async (currencyAmount: string) => { diff --git a/src/actions/lender.ts b/src/actions/lender.ts index e1ad55d..17cd9ab 100644 --- a/src/actions/lender.ts +++ b/src/actions/lender.ts @@ -11,9 +11,8 @@ export function LenderActions>(Bas } redeemSenior = async (tokenAmount: string) => { - const txHash = await executeAndRetry(this.contracts['SENIOR_OPERATOR'].redeem, [tokenAmount, this.ethConfig]) - console.log(`[Redeem] txHash: ${txHash}`) - return waitAndReturnEvents(this.eth, txHash, this.contracts['SENIOR_OPERATOR'].abi, this.transactionTimeout) + const seniorOperator = this.contract('SENIOR_OPERATOR') + return this.pending(seniorOperator.redeem(tokenAmount)) } getSeniorTokenAllowance = async (owner: string) => { @@ -25,13 +24,8 @@ export function LenderActions>(Bas } approveSeniorToken = async (tokenAmount: string) => { - const txHash = await executeAndRetry(this.contracts['SENIOR_TOKEN'].approve, [ - this.contractAddresses['SENIOR'], - tokenAmount, - this.ethConfig, - ]) - console.log(`[Currency.approve] txHash: ${txHash}`) - return waitAndReturnEvents(this.eth, txHash, this.contracts['SENIOR_TOKEN'].abi, this.transactionTimeout) + const senior = this.contract('SENIOR_TOKEN') + return this.pending(senior.approve(this.contractAddresses['SENIOR'], tokenAmount)) } // junior tranche functions @@ -41,9 +35,8 @@ export function LenderActions>(Bas } redeemJunior = async (tokenAmount: string) => { - const txHash = await executeAndRetry(this.contracts['JUNIOR_OPERATOR'].redeem, [tokenAmount, this.ethConfig]) - console.log(`[Redeem] txHash: ${txHash}`) - return waitAndReturnEvents(this.eth, txHash, this.contracts['JUNIOR_OPERATOR'].abi, this.transactionTimeout) + const juniorOperator = this.contract('JUNIOR_OPERATOR') + return this.pending(juniorOperator.redeem(tokenAmount)) } getJuniorTokenAllowance = async (owner: string) => { @@ -55,13 +48,8 @@ export function LenderActions>(Bas } approveJuniorToken = async (tokenAmount: string) => { - const txHash = await executeAndRetry(this.contracts['JUNIOR_TOKEN'].approve, [ - this.contractAddresses['JUNIOR'], - tokenAmount, - this.ethConfig, - ]) - console.log(`[Currency.approve] txHash: ${txHash}`) - return waitAndReturnEvents(this.eth, txHash, this.contracts['JUNIOR_TOKEN'].abi, this.transactionTimeout) + const junior = this.contract('JUNIOR_TOKEN') + return this.pending(junior.approve(this.contractAddresses['JUNIOR'], tokenAmount)) } // general lender functions diff --git a/src/actions/proxy.ts b/src/actions/proxy.ts index 1374d70..4a6a9cc 100644 --- a/src/actions/proxy.ts +++ b/src/actions/proxy.ts @@ -11,6 +11,8 @@ export function ProxyActions>(Bas } buildProxy = async (owner: string) => { + // const tx = await this.contract('PROXY_REGISTRY').proxies(accessTokenId) + const txHash = await executeAndRetry(this.contracts['PROXY_REGISTRY'].build, [owner, this.ethConfig]) console.log(`[Proxy created] txHash: ${txHash}`) const response: any = await waitAndReturnEvents( @@ -19,23 +21,22 @@ export function ProxyActions>(Bas this.contracts['PROXY_REGISTRY'].abi, this.transactionTimeout ) + console.log('create proxy response', response) return response.events[0].data[2].toString() } getProxy = async (accessTokenId: string) => { - const res = await executeAndRetry(this.contracts['PROXY_REGISTRY'].proxies, [accessTokenId, this.ethConfig]) - return res[0] + return await this.contract('PROXY_REGISTRY').proxies(accessTokenId) } getProxyAccessToken = async (proxyAddress: string) => { const proxy = this.contract('PROXY', proxyAddress) - const accessToken = await proxy.accessToken() + const accessToken = (await proxy.accessToken()).toBN() return accessToken.toNumber() } getProxyOwnerByLoan = async (loanId: string) => { - const res = await executeAndRetry(this.contracts['TITLE'].ownerOf, [loanId]) - const loanOwner = res[0] + const loanOwner = this.contract('TITLE').ownerOf(loanId) const accessToken = await this.getProxyAccessToken(loanOwner) return this.getProxyAccessTokenOwner(accessToken) } @@ -46,8 +47,7 @@ export function ProxyActions>(Bas } proxyCount = async (): Promise => { - const res: { 0: BN } = await executeAndRetry(this.contracts['PROXY_REGISTRY'].count, []) - return res[0] + return (await this.contract('PROXY_REGISTRY').count()).toBN() } checkProxyExists = async (address: string): Promise => { @@ -103,8 +103,8 @@ export function ProxyActions>(Bas return this.pending(proxy.execute(this.contract('ACTIONS').address, encoded)) } - proxyLockBorrowWithdraw = async (proxyAddr: string, loanId: string, amount: string, usr: string) => { - const proxy: any = this.eth.contract(this.contractAbis['PROXY']).at(proxyAddr) + proxyLockBorrowWithdraw = async (proxyAddress: string, loanId: string, amount: string, usr: string) => { + const proxy = this.contract('PROXY', proxyAddress) const encoded = abiCoder.encodeFunctionCall( { name: 'lockBorrowWithdraw', @@ -116,15 +116,14 @@ export function ProxyActions>(Bas { type: 'address', name: 'usr' }, ], }, - [this.contracts['SHELF'].address, loanId, amount, usr] + [this.contract('SHELF').address, loanId, amount, usr] ) - const txHash = await executeAndRetry(proxy.execute, [this.contracts['ACTIONS'].address, encoded, this.ethConfig]) - console.log(`[Proxy Lock Borrow Withdraw] txHash: ${txHash}`) - return waitAndReturnEvents(this.eth, txHash, this.contractAbis['PROXY'], this.transactionTimeout) + + return this.pending(proxy.execute(this.contract('ACTIONS').address, encoded)) } - proxyRepayUnlockClose = async (proxyAddr: string, tokenId: string, loanId: string, registry: string) => { - const proxy: any = this.eth.contract(this.contractAbis['PROXY']).at(proxyAddr) + proxyRepayUnlockClose = async (proxyAddress: string, tokenId: string, loanId: string, registry: string) => { + const proxy = this.contract('PROXY', proxyAddress) const encoded = abiCoder.encodeFunctionCall( { name: 'repayUnlockClose', @@ -139,17 +138,16 @@ export function ProxyActions>(Bas ], }, [ - this.contracts['SHELF'].address, - this.contracts['PILE'].address, + this.contract('SHELF').address, + this.contract('PILE').address, registry, tokenId, - this.contracts['TINLAKE_CURRENCY'].address, + this.contract('TINLAKE_CURRENCY').address, loanId, ] ) - const txHash = await executeAndRetry(proxy.execute, [this.contracts['ACTIONS'].address, encoded, this.ethConfig]) - console.log(`[Proxy Repay Unlock Close] txHash: ${txHash}`) - return waitAndReturnEvents(this.eth, txHash, this.contractAbis['PROXY'], this.transactionTimeout) + + return this.pending(proxy.execute(this.contract('ACTIONS').address, encoded)) } } } From d227b7144d5885cac4c6453c00f90f7170cf42cb Mon Sep 17 00:00:00 2001 From: Jeroen Offerijns Date: Thu, 27 Aug 2020 16:15:22 +0200 Subject: [PATCH 13/65] chore: format --- docs/classes/_tinlake_.tinlake.html | 44 +++++++------- docs/interfaces/_services_ethereum_.ethi.html | 16 ++--- .../_services_ethereum_.events.html | 6 +- docs/modules/_actions_admin_.html | 30 +++++----- docs/modules/_actions_analytics_.html | 60 +++++++++---------- docs/modules/_actions_borrower_.html | 20 +++---- docs/modules/_actions_collateral_.html | 22 +++---- docs/modules/_actions_currency_.html | 10 ++-- docs/modules/_actions_governance_.html | 4 +- docs/modules/_actions_index_.html | 2 +- docs/modules/_actions_lender_.html | 18 +++--- docs/modules/_actions_proxy_.html | 30 +++++----- docs/modules/_services_ethereum_.html | 10 ++-- docs/modules/_tinlake_.html | 20 +++---- docs/modules/_types_tinlake_.html | 10 ++-- docs/modules/_utils_basetodisplay_.html | 2 +- docs/modules/_utils_bntohex_.html | 2 +- docs/modules/_utils_displaytobase_.html | 2 +- docs/modules/_utils_feetointerestrate_.html | 2 +- docs/modules/_utils_getloanstatus_.html | 4 +- docs/modules/_utils_interestratetofee_.html | 2 +- src/actions/admin.ts | 4 +- 22 files changed, 160 insertions(+), 160 deletions(-) diff --git a/docs/classes/_tinlake_.tinlake.html b/docs/classes/_tinlake_.tinlake.html index 40b6b36..c9f350e 100644 --- a/docs/classes/_tinlake_.tinlake.html +++ b/docs/classes/_tinlake_.tinlake.html @@ -129,7 +129,7 @@

    constructor

  • Parameters

    @@ -151,7 +151,7 @@

    contractAbis

    contractAbis: ContractAbis
    @@ -161,7 +161,7 @@

    contractAddresses

    contractAddresses: ContractAddresses
    @@ -171,7 +171,7 @@

    contractConfig

    contractConfig: any
    @@ -181,7 +181,7 @@

    contracts

    contracts: Contracts
    @@ -191,7 +191,7 @@

    eth

    eth: ethI
    @@ -201,7 +201,7 @@

    ethConfig

    ethConfig: EthConfig
    @@ -211,7 +211,7 @@

    ethOptions

    ethOptions: any
    @@ -221,7 +221,7 @@

    ethersConfig

    ethersConfig: EthersConfig
    @@ -231,7 +231,7 @@

    ethersContracts

    ethersContracts: Contracts
    @@ -241,7 +241,7 @@

    provider

    provider: any
    @@ -251,7 +251,7 @@

    transactionTimeout

    transactionTimeout: number
    @@ -268,7 +268,7 @@

    contract

  • Parameters

    @@ -294,7 +294,7 @@

    createContract

  • Parameters

    @@ -320,7 +320,7 @@

    createEthContract

  • Parameters

    @@ -346,7 +346,7 @@

    getOperatorType

  • Parameters

    @@ -369,7 +369,7 @@

    getTransactionReceipt

  • Parameters

    @@ -392,7 +392,7 @@

    pending

  • Parameters

    @@ -415,7 +415,7 @@

    setContracts

  • Returns void

    @@ -432,7 +432,7 @@

    setEthConfig

  • Parameters

    @@ -455,7 +455,7 @@

    setEthersConfig

  • Parameters

    @@ -478,7 +478,7 @@

    setProvider

  • Parameters

    diff --git a/docs/interfaces/_services_ethereum_.ethi.html b/docs/interfaces/_services_ethereum_.ethi.html index 578ce00..dd2c1c9 100644 --- a/docs/interfaces/_services_ethereum_.ethi.html +++ b/docs/interfaces/_services_ethereum_.ethi.html @@ -101,7 +101,7 @@

    abi

    abi: any
    @@ -111,7 +111,7 @@

    contract

    contract: (arg0: any) => { at: (arg0: any) => void }
    @@ -165,7 +165,7 @@

    getTransactionByHash

    getTransactionByHash: (arg0: any, arg1: (err: any, tx: any) => void) => void
    @@ -220,7 +220,7 @@

    getTransactionCount

    getTransactionCount: any
    @@ -230,7 +230,7 @@

    getTransactionReceipt

    getTransactionReceipt: (arg0: any, arg1: (err: any, receipt: any) => void) => void
    @@ -285,7 +285,7 @@

    send

    send: Function
    @@ -295,7 +295,7 @@

    sendRawTransaction

    sendRawTransaction: any
    @@ -305,7 +305,7 @@

    web3_sha3

    web3_sha3: (signature: string) => string
    diff --git a/docs/interfaces/_services_ethereum_.events.html b/docs/interfaces/_services_ethereum_.events.html index e61c2c0..6620848 100644 --- a/docs/interfaces/_services_ethereum_.events.html +++ b/docs/interfaces/_services_ethereum_.events.html @@ -96,7 +96,7 @@

    events

    events: { data: any[]; event: { name: any } }[]
    @@ -106,7 +106,7 @@

    status

    status: any
    @@ -116,7 +116,7 @@

    txHash

    txHash: string
    diff --git a/docs/modules/_actions_admin_.html b/docs/modules/_actions_admin_.html index 9fbf985..eeb4d65 100644 --- a/docs/modules/_actions_admin_.html +++ b/docs/modules/_actions_admin_.html @@ -89,7 +89,7 @@

    IAdminActions

    IAdminActions: { approveAllowanceJunior: any; approveAllowanceSenior: any; canSetInterestRate: any; canSetInvestorAllowanceJunior: any; canSetInvestorAllowanceSenior: any; canSetLoanPrice: any; canSetMinimumJuniorRatio: any; canSetRiskScore: any; canSetSeniorTrancheInterest: any; initRate: any; isWard: any; setMinimumJuniorRatio: any; setRate: any }
    @@ -104,7 +104,7 @@
    approveAllowanceJunior:
  • Parameters

    @@ -132,7 +132,7 @@
    approveAllowanceSenior:
  • Parameters

    @@ -160,7 +160,7 @@
    canSetInterestRate:

    Parameters

    @@ -182,7 +182,7 @@
    canSetInvestorAllowanceJunior

    Parameters

    @@ -204,7 +204,7 @@
    canSetInvestorAllowanceSenior

    Parameters

    @@ -226,7 +226,7 @@
    canSetLoanPrice: fu
  • Parameters

    @@ -248,7 +248,7 @@
    canSetMinimumJuniorRatio

    Parameters

    @@ -270,7 +270,7 @@
    canSetRiskScore: fu
  • Parameters

    @@ -292,7 +292,7 @@
    canSetSeniorTrancheInterest

    Parameters

    @@ -314,7 +314,7 @@
    initRate: function
  • Parameters

    @@ -336,7 +336,7 @@
    isWard: function
  • Parameters

    @@ -361,7 +361,7 @@
    setMinimumJuniorRatio:

    Parameters

    @@ -383,7 +383,7 @@
    setRate: function
  • Parameters

    @@ -415,7 +415,7 @@

    AdminActions

  • Type parameters

    diff --git a/docs/modules/_actions_analytics_.html b/docs/modules/_actions_analytics_.html index 0a06fad..cfae163 100644 --- a/docs/modules/_actions_analytics_.html +++ b/docs/modules/_actions_analytics_.html @@ -89,7 +89,7 @@

    IAnalyticsActions

    IAnalyticsActions: { existsSenior: any; getAssetValueJunior: any; getCollateral: any; getCurrentJuniorRatio: any; getDebt: any; getInterestRate: any; getInvestor: any; getJuniorReserve: any; getJuniorTokenBalance: any; getLoan: any; getLoanList: any; getMaxRedeemAmountJunior: any; getMaxRedeemAmountSenior: any; getMaxSupplyAmountJunior: any; getMaxSupplyAmountSenior: any; getMinJuniorRatio: any; getOwnerOfCollateral: any; getOwnerOfLoan: any; getPrincipal: any; getSeniorDebt: any; getSeniorInterestRate: any; getSeniorReserve: any; getSeniorTokenBalance: any; getTokenPriceJunior: any; getTokenPriceSenior: any; getTotalBalance: any; getTotalDebt: any; loanCount: any }
    @@ -104,7 +104,7 @@
    existsSenior: function
  • Returns boolean

    @@ -120,7 +120,7 @@
    getAssetValueJunior:

    Returns Promise<BN>

    @@ -136,7 +136,7 @@
    getCollateral: function
  • Parameters

    @@ -158,7 +158,7 @@
    getCurrentJuniorRatio:

    Returns Promise<BN>

    @@ -174,7 +174,7 @@
    getDebt: function
  • Parameters

    @@ -196,7 +196,7 @@
    getInterestRate: functio
  • Parameters

    @@ -218,7 +218,7 @@
    getInvestor: function
  • Parameters

    @@ -240,7 +240,7 @@
    getJuniorReserve: functi
  • Returns Promise<BN>

    @@ -256,7 +256,7 @@
    getJuniorTokenBalance:

    Parameters

    @@ -278,7 +278,7 @@
    getLoan: function
  • Parameters

    @@ -300,7 +300,7 @@
    getLoanList: function

    Returns Promise<Loan[]>

    @@ -316,7 +316,7 @@
    getMaxRedeemAmountJunior

    Parameters

    @@ -338,7 +338,7 @@
    getMaxRedeemAmountSenior

    Parameters

    @@ -360,7 +360,7 @@
    getMaxSupplyAmountJunior

    Parameters

    @@ -382,7 +382,7 @@
    getMaxSupplyAmountSenior

    Parameters

    @@ -404,7 +404,7 @@
    getMinJuniorRatio:
  • Returns Promise<BN>

    @@ -420,7 +420,7 @@
    getOwnerOfCollateral: fu
  • Parameters

    @@ -448,7 +448,7 @@
    getOwnerOfLoan: function
  • Parameters

    @@ -470,7 +470,7 @@
    getPrincipal: function
  • Parameters

    @@ -492,7 +492,7 @@
    getSeniorDebt: function<
  • Returns Promise<BN>

    @@ -508,7 +508,7 @@
    getSeniorInterestRate:

    Returns Promise<BN>

    @@ -524,7 +524,7 @@
    getSeniorReserve: functi
  • Returns Promise<BN>

    @@ -540,7 +540,7 @@
    getSeniorTokenBalance:

    Parameters

    @@ -562,7 +562,7 @@
    getTokenPriceJunior:

    Returns Promise<BN>

    @@ -578,7 +578,7 @@
    getTokenPriceSenior:

    Parameters

    @@ -600,7 +600,7 @@
    getTotalBalance: functio
  • Returns Promise<BN>

    @@ -616,7 +616,7 @@
    getTotalDebt: function

    Returns Promise<BN>

    @@ -632,7 +632,7 @@
    loanCount: function
  • Returns Promise<BN>

    @@ -655,7 +655,7 @@

    AnalyticsActions

  • Type parameters

    diff --git a/docs/modules/_actions_borrower_.html b/docs/modules/_actions_borrower_.html index 7acfd73..db906fb 100644 --- a/docs/modules/_actions_borrower_.html +++ b/docs/modules/_actions_borrower_.html @@ -89,7 +89,7 @@

    IBorrowerActions

    IBorrowerActions: { borrow: any; close: any; issue: any; lock: any; nftLookup: any; repay: any; unlock: any; withdraw: any }
    @@ -104,7 +104,7 @@
    borrow: function
  • Parameters

    @@ -129,7 +129,7 @@
    close: function
  • Parameters

    @@ -151,7 +151,7 @@
    issue: function
  • Parameters

    @@ -176,7 +176,7 @@
    lock: function
  • Parameters

    @@ -198,7 +198,7 @@
    nftLookup: function
  • Parameters

    @@ -223,7 +223,7 @@
    repay: function
  • Parameters

    @@ -248,7 +248,7 @@
    unlock: function
  • Parameters

    @@ -270,7 +270,7 @@
    withdraw: function
  • Parameters

    @@ -305,7 +305,7 @@

    BorrowerActions

  • Type parameters

    diff --git a/docs/modules/_actions_collateral_.html b/docs/modules/_actions_collateral_.html index 34ac8b4..cd7ea4f 100644 --- a/docs/modules/_actions_collateral_.html +++ b/docs/modules/_actions_collateral_.html @@ -89,7 +89,7 @@

    ICollateralActions

    ICollateralActions: { approveNFT: any; getNFTCount: any; getNFTData: any; getNFTOwner: any; isNFTApprovedForAll: any; mintNFT: any; mintTitleNFT: any; setNFTApprovalForAll: any; transferNFT: any }
    @@ -104,7 +104,7 @@
    approveNFT: function
  • Parameters

    @@ -132,7 +132,7 @@
    getNFTCount: function
  • Parameters

    @@ -154,7 +154,7 @@
    getNFTData: function
  • Parameters

    @@ -179,7 +179,7 @@
    getNFTOwner: function
  • Parameters

    @@ -204,7 +204,7 @@
    isNFTApprovedForAll: fun
  • Parameters

    @@ -232,7 +232,7 @@
    mintNFT: function
  • Parameters

    @@ -269,7 +269,7 @@
    mintTitleNFT: function
  • Parameters

    @@ -294,7 +294,7 @@
    setNFTApprovalForAll: fu
  • Parameters

    @@ -322,7 +322,7 @@
    transferNFT: function
  • Parameters

    @@ -360,7 +360,7 @@

    CollateralActions

  • Type parameters

    diff --git a/docs/modules/_actions_currency_.html b/docs/modules/_actions_currency_.html index 680d727..3e2e5a3 100644 --- a/docs/modules/_actions_currency_.html +++ b/docs/modules/_actions_currency_.html @@ -89,7 +89,7 @@

    ICurrencyActions

    ICurrencyActions: { approveJuniorForCurrency: (currencyAmount: string) => Promise<PendingTransaction | undefined>; approveSeniorForCurrency: (currencyAmount: string) => Promise<PendingTransaction | undefined>; getCurrencyAllowance: (owner: string, spender: string) => Promise<BN>; getJuniorForCurrencyAllowance: (owner: string) => Promise<BN | undefined>; getSeniorForCurrencyAllowance: (owner: string) => Promise<BN | undefined>; approveCurrency: any; getCurrencyBalance: any; mintCurrency: any }
    @@ -212,7 +212,7 @@
    approveCurrency: function

    Parameters

    @@ -237,7 +237,7 @@
    getCurrencyBalance: func
  • Parameters

    @@ -259,7 +259,7 @@
    mintCurrency: function
  • Parameters

    @@ -291,7 +291,7 @@

    CurrencyActions

  • Type parameters

    diff --git a/docs/modules/_actions_governance_.html b/docs/modules/_actions_governance_.html index b38acde..828eff4 100644 --- a/docs/modules/_actions_governance_.html +++ b/docs/modules/_actions_governance_.html @@ -83,7 +83,7 @@

    IGovernanceActions

    IGovernanceActions: { relyAddress: any }
    @@ -98,7 +98,7 @@
    relyAddress: function
  • Parameters

    diff --git a/docs/modules/_actions_index_.html b/docs/modules/_actions_index_.html index 28db4f2..d6c5008 100644 --- a/docs/modules/_actions_index_.html +++ b/docs/modules/_actions_index_.html @@ -83,7 +83,7 @@

    TinlakeActions

    diff --git a/docs/modules/_actions_lender_.html b/docs/modules/_actions_lender_.html index 7e8df74..b7b1083 100644 --- a/docs/modules/_actions_lender_.html +++ b/docs/modules/_actions_lender_.html @@ -89,7 +89,7 @@

    ILenderActions

    ILenderActions: { approveJuniorToken: (tokenAmount: string) => Promise<unknown>; approveSeniorToken: (tokenAmount: string) => Promise<unknown>; balance: any; getJuniorTokenAllowance: any; getSeniorTokenAllowance: any; redeemJunior: any; redeemSenior: any; supplyJunior: any; supplySenior: any }
    @@ -146,7 +146,7 @@
    balance: function
  • Returns Promise<any>

    @@ -162,7 +162,7 @@
    getJuniorTokenAllowance: <
  • Parameters

    @@ -184,7 +184,7 @@
    getSeniorTokenAllowance: <
  • Parameters

    @@ -206,7 +206,7 @@
    redeemJunior: function
  • Parameters

    @@ -228,7 +228,7 @@
    redeemSenior: function
  • Parameters

    @@ -250,7 +250,7 @@
    supplyJunior: function
  • Parameters

    @@ -272,7 +272,7 @@
    supplySenior: function
  • Parameters

    @@ -301,7 +301,7 @@

    LenderActions

  • Type parameters

    diff --git a/docs/modules/_actions_proxy_.html b/docs/modules/_actions_proxy_.html index a54e14e..3093c00 100644 --- a/docs/modules/_actions_proxy_.html +++ b/docs/modules/_actions_proxy_.html @@ -89,7 +89,7 @@

    IProxyActions

    IProxyActions: { buildProxy: any; checkProxyExists: any; getProxy: any; getProxyAccessToken: any; getProxyAccessTokenOwner: any; getProxyOwnerByAddress: any; getProxyOwnerByLoan: any; proxyCount: any; proxyCreateNew: any; proxyIssue: any; proxyLockBorrowWithdraw: any; proxyRepayUnlockClose: any; proxyTransferIssue: any }
    @@ -104,7 +104,7 @@
    buildProxy: function
  • Parameters

    @@ -126,7 +126,7 @@
    checkProxyExists: functi
  • Parameters

    @@ -148,7 +148,7 @@
    getProxy: function
  • Parameters

    @@ -170,7 +170,7 @@
    getProxyAccessToken:

    Parameters

    @@ -192,7 +192,7 @@
    getProxyAccessTokenOwner

    Parameters

    @@ -214,7 +214,7 @@
    getProxyOwnerByAddress:

    Parameters

    @@ -236,7 +236,7 @@
    getProxyOwnerByLoan:

    Parameters

    @@ -258,7 +258,7 @@
    proxyCount: function
  • Returns Promise<any>

    @@ -274,7 +274,7 @@
    proxyCreateNew: function
  • Parameters

    @@ -296,7 +296,7 @@
    proxyIssue: function
  • Parameters

    @@ -324,7 +324,7 @@
    proxyLockBorrowWithdraw: <
  • Parameters

    @@ -355,7 +355,7 @@
    proxyRepayUnlockClose:

    Parameters

    @@ -386,7 +386,7 @@
    proxyTransferIssue: func
  • Parameters

    @@ -421,7 +421,7 @@

    ProxyActions

  • Type parameters

    diff --git a/docs/modules/_services_ethereum_.html b/docs/modules/_services_ethereum_.html index aa2085d..d5a7edd 100644 --- a/docs/modules/_services_ethereum_.html +++ b/docs/modules/_services_ethereum_.html @@ -99,7 +99,7 @@

    Const ZERO_ADDRESS

    ZERO_ADDRESS: "0x0000000000000000000000000000000000000000" = "0x0000000000000000000000000000000000000000"
    @@ -116,7 +116,7 @@

    executeAndRetry

  • Parameters

    @@ -142,7 +142,7 @@

    Const findEvent

  • Parameters

    @@ -209,7 +209,7 @@

    Const waitAndReturn

    Parameters

    @@ -241,7 +241,7 @@

    Const waitForTransactio
  • Parameters

    diff --git a/docs/modules/_tinlake_.html b/docs/modules/_tinlake_.html index 8c357ba..b795c2e 100644 --- a/docs/modules/_tinlake_.html +++ b/docs/modules/_tinlake_.html @@ -98,7 +98,7 @@

    Constructor

    Constructor<T>: {}

    Type parameters

    @@ -119,7 +119,7 @@

    ContractAbis

    ContractAbis: {}
    @@ -134,7 +134,7 @@

    ContractAddresses

    ContractAddresses: {}
    @@ -149,7 +149,7 @@

    ContractName

    ContractName: typeof contractNames[number]
    @@ -159,7 +159,7 @@

    Contracts

    Contracts: {}
    @@ -174,7 +174,7 @@

    EthConfig

    EthConfig: { from?: undefined | string; gas?: undefined | string; gasPrice?: undefined | string }
    @@ -198,7 +198,7 @@

    EthersConfig

    EthersConfig: { overrides?: EthersOverrides; provider: Provider; signer: Signer }
    @@ -222,7 +222,7 @@

    EthersOverrides

    EthersOverrides: { gasLimit?: undefined | number; gasPrice?: undefined | number }
    @@ -243,7 +243,7 @@

    PendingTransaction

    PendingTransaction: { hash: string | undefined; timesOutAt?: undefined | number }
    @@ -264,7 +264,7 @@

    TinlakeParams

    TinlakeParams: { contractAbis?: ContractAbis | {}; contractAddresses?: ContractAddresses | {}; contractConfig?: any | {}; contracts?: Contracts | {}; ethConfig?: EthConfig; ethOptions?: any | {}; ethersConfig?: EthersConfig; provider: any; transactionTimeout: number }
    diff --git a/docs/modules/_types_tinlake_.html b/docs/modules/_types_tinlake_.html index 2ccffcc..da6a3b1 100644 --- a/docs/modules/_types_tinlake_.html +++ b/docs/modules/_types_tinlake_.html @@ -87,7 +87,7 @@

    ITinlake

    @@ -97,7 +97,7 @@

    Investor

    Investor: { address: string; junior: { maxRedeem: BN; maxSupply: BN; tokenBalance: BN }; senior: { maxRedeem?: BN; maxSupply?: BN; tokenBalance?: BN } }
    @@ -143,7 +143,7 @@

    Loan

    Loan: { debt: BN; interestRate: BN; loanId: string; nft?: NFT; ownerOf: BN; price?: BN; principal: BN; proxyOwner?: undefined | string; registry: string; status?: undefined | string; threshold?: BN; tokenId: BN }
    @@ -194,7 +194,7 @@

    NFT

    NFT: { nftData: any; nftOwner: string; registry: string; tokenId: BN }
    @@ -221,7 +221,7 @@

    Tranche

    Tranche: { availableFunds: BN; interestRate?: BN; token: string; tokenPrice: BN; totalSupply: BN; type: string }
    diff --git a/docs/modules/_utils_basetodisplay_.html b/docs/modules/_utils_basetodisplay_.html index 5f3be40..6d8fc74 100644 --- a/docs/modules/_utils_basetodisplay_.html +++ b/docs/modules/_utils_basetodisplay_.html @@ -87,7 +87,7 @@

    Const baseToDisplay

  • Parameters

    diff --git a/docs/modules/_utils_bntohex_.html b/docs/modules/_utils_bntohex_.html index 60076a4..a855987 100644 --- a/docs/modules/_utils_bntohex_.html +++ b/docs/modules/_utils_bntohex_.html @@ -87,7 +87,7 @@

    Const bnToHex

  • Parameters

    diff --git a/docs/modules/_utils_displaytobase_.html b/docs/modules/_utils_displaytobase_.html index 25be0e9..a7feb0e 100644 --- a/docs/modules/_utils_displaytobase_.html +++ b/docs/modules/_utils_displaytobase_.html @@ -87,7 +87,7 @@

    Const displayToBase

  • Parameters

    diff --git a/docs/modules/_utils_feetointerestrate_.html b/docs/modules/_utils_feetointerestrate_.html index 672972a..17a4447 100644 --- a/docs/modules/_utils_feetointerestrate_.html +++ b/docs/modules/_utils_feetointerestrate_.html @@ -87,7 +87,7 @@

    Const feeToInterestRate
  • diff --git a/docs/modules/_utils_getloanstatus_.html b/docs/modules/_utils_getloanstatus_.html index c0d3ba3..19809d5 100644 --- a/docs/modules/_utils_getloanstatus_.html +++ b/docs/modules/_utils_getloanstatus_.html @@ -89,7 +89,7 @@

    LoanStatus

    LoanStatus: "Whitelisted" | "Ongoing" | "Repaid"
    @@ -106,7 +106,7 @@

    getLoanStatus

  • Parameters

    diff --git a/docs/modules/_utils_interestratetofee_.html b/docs/modules/_utils_interestratetofee_.html index f81ef49..93a5fa5 100644 --- a/docs/modules/_utils_interestratetofee_.html +++ b/docs/modules/_utils_interestratetofee_.html @@ -87,7 +87,7 @@

    Const interestRateToFee
  • diff --git a/src/actions/admin.ts b/src/actions/admin.ts index a37deb6..59f0929 100644 --- a/src/actions/admin.ts +++ b/src/actions/admin.ts @@ -138,9 +138,9 @@ export function AdminActions>(Bas if (this.getOperatorType('senior') === 'PROPERTIONAL_OPERATOR') { return this.pending(seniorOperator.approve(user, maxCurrency)) - } else { + } return this.pending(seniorOperator.approve(user, maxCurrency, maxToken)) - } + } } } From df4f40f3f12834d03c472004ca9f1602d3ed8a5e Mon Sep 17 00:00:00 2001 From: Jeroen Offerijns Date: Mon, 31 Aug 2020 10:44:03 +0200 Subject: [PATCH 14/65] feat: work on admin function port --- dist/Tinlake.d.ts | 2 +- dist/actions/admin.d.ts | 18 +- dist/actions/analytics.d.ts | 2 +- dist/index.es.js | 191 ++++++------------ dist/index.js | 191 ++++++------------ docs/classes/_tinlake_.tinlake.html | 49 ++--- docs/interfaces/_services_ethereum_.ethi.html | 16 +- .../_services_ethereum_.events.html | 6 +- docs/modules/_actions_admin_.html | 46 ++--- docs/modules/_actions_analytics_.html | 60 +++--- docs/modules/_actions_borrower_.html | 20 +- docs/modules/_actions_collateral_.html | 22 +- docs/modules/_actions_currency_.html | 10 +- docs/modules/_actions_governance_.html | 4 +- docs/modules/_actions_index_.html | 2 +- docs/modules/_actions_lender_.html | 18 +- docs/modules/_actions_proxy_.html | 30 +-- docs/modules/_services_ethereum_.html | 10 +- docs/modules/_tinlake_.html | 20 +- docs/modules/_types_tinlake_.html | 10 +- docs/modules/_utils_basetodisplay_.html | 2 +- docs/modules/_utils_bntohex_.html | 2 +- docs/modules/_utils_displaytobase_.html | 2 +- docs/modules/_utils_feetointerestrate_.html | 2 +- docs/modules/_utils_getloanstatus_.html | 4 +- docs/modules/_utils_interestratetofee_.html | 2 +- src/Tinlake.ts | 24 +-- src/actions/admin.ts | 123 ++++------- src/actions/analytics.ts | 4 +- 29 files changed, 364 insertions(+), 528 deletions(-) diff --git a/dist/Tinlake.d.ts b/dist/Tinlake.d.ts index f3c20e9..5f59b4e 100644 --- a/dist/Tinlake.d.ts +++ b/dist/Tinlake.d.ts @@ -54,7 +54,7 @@ export default class Tinlake { contractAbis: ContractAbis; contractConfig: any; constructor(params: TinlakeParams); - setProvider: (provider: any, ethOptions?: any) => void; + setProvider: (provider: any, ethOptions?: any, ethersConfig?: EthersConfig | undefined) => void; setContracts: () => void; setEthConfig: (ethConfig: EthConfig) => void; setEthersConfig: (ethersConfig: EthersConfig | undefined) => void; diff --git a/dist/actions/admin.d.ts b/dist/actions/admin.d.ts index 3132f05..0c74479 100644 --- a/dist/actions/admin.d.ts +++ b/dist/actions/admin.d.ts @@ -3,7 +3,7 @@ import BN from 'bn.js'; export declare function AdminActions>(Base: ActionsBase): { new (...args: any[]): { canQueryPermissions: () => boolean; - isWard: (user: string, contractName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR") => Promise; + isWard: (user: string, contractName: "TINLAKE_CURRENCY" | "JUNIOR_OPERATOR" | "JUNIOR" | "JUNIOR_TOKEN" | "SENIOR" | "SENIOR_TOKEN" | "SENIOR_OPERATOR" | "DISTRIBUTOR" | "ASSESSOR" | "TITLE" | "PILE" | "SHELF" | "CEILING" | "COLLECTOR" | "THRESHOLD" | "PRICE_POOL" | "COLLATERAL_NFT" | "COLLATERAL_NFT_DATA" | "ROOT_CONTRACT" | "PROXY" | "PROXY_REGISTRY" | "ACTIONS" | "BORROWER_DEPLOYER" | "LENDER_DEPLOYER" | "NFT_FEED" | "GOVERNANCE" | "ALLOWANCE_OPERATOR") => Promise; canSetInterestRate: (user: string) => Promise; canSetSeniorTrancheInterest: (user: string) => Promise; canSetRiskScore: (user: string) => Promise; @@ -12,9 +12,9 @@ export declare function AdminActions Promise; canSetLoanPrice: (user: string) => Promise; existsRateGroup: (ratePerSecond: string) => Promise; - initRate: (ratePerSecond: string) => Promise; - changeRate: (loan: string, ratePerSecond: string) => Promise; - setRate: (loan: string, ratePerSecond: string) => Promise; + initRate: (ratePerSecond: string) => Promise; + changeRate: (loan: string, ratePerSecond: string) => Promise; + setRate: (loan: string, ratePerSecond: string) => Promise; setMinimumJuniorRatio: (ratio: string) => Promise; approveAllowanceJunior: (user: string, maxCurrency: string, maxToken: string) => Promise; approveAllowanceSenior: (user: string, maxCurrency: string, maxToken: string) => Promise; @@ -29,7 +29,7 @@ export declare function AdminActions void; + setProvider: (provider: any, ethOptions?: any, ethersConfig?: import("../Tinlake").EthersConfig | undefined) => void; setContracts: () => void; setEthConfig: (ethConfig: import("../Tinlake").EthConfig) => void; setEthersConfig: (ethersConfig: import("../Tinlake").EthersConfig | undefined) => void; @@ -50,10 +50,10 @@ export declare type IAdminActions = { canSetInvestorAllowanceJunior(user: string): Promise; canSetInvestorAllowanceSenior(user: string): Promise; canSetLoanPrice(user: string): Promise; - initRate(rate: string): Promise; - setRate(loan: string, rate: string): Promise; + initRate(rate: string): Promise; + setRate(loan: string, rate: string): Promise; setMinimumJuniorRatio(amount: string): Promise; - approveAllowanceJunior(user: string, maxCurrency: string, maxToken: string): Promise; - approveAllowanceSenior(user: string, maxCurrency: string, maxToken: string): Promise; + approveAllowanceJunior(user: string, maxCurrency: string, maxToken: string): Promise; + approveAllowanceSenior(user: string, maxCurrency: string, maxToken: string): Promise; }; export default AdminActions; diff --git a/dist/actions/analytics.d.ts b/dist/actions/analytics.d.ts index 31d2bc6..ca686ba 100644 --- a/dist/actions/analytics.d.ts +++ b/dist/actions/analytics.d.ts @@ -45,7 +45,7 @@ export declare function AnalyticsActions void; + setProvider: (provider: any, ethOptions?: any, ethersConfig?: import("../Tinlake").EthersConfig | undefined) => void; setContracts: () => void; setEthConfig: (ethConfig: import("../Tinlake").EthConfig) => void; setEthersConfig: (ethersConfig: import("../Tinlake").EthersConfig | undefined) => void; diff --git a/dist/index.es.js b/dist/index.es.js index a46fc1a..8730f8d 100644 --- a/dist/index.es.js +++ b/dist/index.es.js @@ -10689,144 +10689,112 @@ function AdminActions(Base) { var _this = _super !== null && _super.apply(this, arguments) || this; _this.canQueryPermissions = function () { var _a, _b, _c, _d, _e, _f, _g; - return (!!((_a = _this.contracts['PILE']) === null || _a === void 0 ? void 0 : _a.wards) && - !!((_b = _this.contracts['SENIOR']) === null || _b === void 0 ? void 0 : _b.wards) && - !!((_c = _this.contracts['PRICE_POOL']) === null || _c === void 0 ? void 0 : _c.wards) && - !!((_d = _this.contracts['ASSESSOR']) === null || _d === void 0 ? void 0 : _d.wards) && - !!((_e = _this.contracts['JUNIOR_OPERATOR']) === null || _e === void 0 ? void 0 : _e.wards) && - !!((_f = _this.contracts['SENIOR_OPERATOR']) === null || _f === void 0 ? void 0 : _f.wards) && - !!((_g = _this.contracts['COLLECTOR']) === null || _g === void 0 ? void 0 : _g.wards)); + return (!!((_a = _this.contract('PILE')) === null || _a === void 0 ? void 0 : _a.wards) && + !!((_b = _this.contract('SENIOR')) === null || _b === void 0 ? void 0 : _b.wards) && + !!((_c = _this.contract('PRICE_POOL')) === null || _c === void 0 ? void 0 : _c.wards) && + !!((_d = _this.contract('ASSESSOR')) === null || _d === void 0 ? void 0 : _d.wards) && + !!((_e = _this.contract('JUNIOR_OPERATOR')) === null || _e === void 0 ? void 0 : _e.wards) && + !!((_f = _this.contract('SENIOR_OPERATOR')) === null || _f === void 0 ? void 0 : _f.wards) && + !!((_g = _this.contract('COLLECTOR')) === null || _g === void 0 ? void 0 : _g.wards)); }; _this.isWard = function (user, contractName) { return __awaiter(_this, void 0, void 0, function () { - var res; var _a; return __generator(this, function (_b) { switch (_b.label) { case 0: - if (!((_a = this.contracts[contractName]) === null || _a === void 0 ? void 0 : _a.wards)) { + if (!((_a = this.contract(contractName)) === null || _a === void 0 ? void 0 : _a.wards)) return [2 /*return*/, new bn(0)]; - } - return [4 /*yield*/, executeAndRetry(this.contracts[contractName].wards, [user])]; - case 1: - res = _b.sent(); - return [2 /*return*/, res[0]]; + return [4 /*yield*/, this.contract(contractName).wards(user)]; + case 1: return [2 /*return*/, (_b.sent()).toBN()]; } }); }); }; _this.canSetInterestRate = function (user) { return __awaiter(_this, void 0, void 0, function () { - var res; var _a; return __generator(this, function (_b) { switch (_b.label) { case 0: - if (!((_a = this.contracts['PILE']) === null || _a === void 0 ? void 0 : _a.wards)) { + if (!((_a = this.contract('PILE')) === null || _a === void 0 ? void 0 : _a.wards)) return [2 /*return*/, false]; - } - return [4 /*yield*/, executeAndRetry(this.contracts['PILE'].wards, [user])]; - case 1: - res = _b.sent(); - return [2 /*return*/, res[0].toNumber() === 1]; + return [4 /*yield*/, this.contract('PILE').wards(user)]; + case 1: return [2 /*return*/, (_b.sent()).toBN().toNumber() === 1]; } }); }); }; _this.canSetSeniorTrancheInterest = function (user) { return __awaiter(_this, void 0, void 0, function () { - var res; var _a; return __generator(this, function (_b) { switch (_b.label) { case 0: - if (!(this.contractAddresses['SENIOR'] !== ZERO_ADDRESS)) return [3 /*break*/, 2]; - if (!((_a = this.contracts['SENIOR']) === null || _a === void 0 ? void 0 : _a.wards)) { + if (!(this.contractAddresses['SENIOR'] !== ZERO_ADDRESS)) return [2 /*return*/, false]; - } - return [4 /*yield*/, executeAndRetry(this.contracts['SENIOR'].wards, [user])]; - case 1: - res = _b.sent(); - return [2 /*return*/, res[0].toNumber() === 1]; - case 2: return [2 /*return*/, false]; + if (!((_a = this.contract('SENIOR')) === null || _a === void 0 ? void 0 : _a.wards)) + return [2 /*return*/, false]; + return [4 /*yield*/, this.contract('SENIOR').wards(user)]; + case 1: return [2 /*return*/, (_b.sent()).toBN().toNumber() === 1]; } }); }); }; _this.canSetRiskScore = function (user) { return __awaiter(_this, void 0, void 0, function () { - var res; var _a; return __generator(this, function (_b) { switch (_b.label) { case 0: - if (!((_a = this.contracts['PRICE_POOL']) === null || _a === void 0 ? void 0 : _a.wards)) { + if (!((_a = this.contract('PRICE_POOL')) === null || _a === void 0 ? void 0 : _a.wards)) return [2 /*return*/, false]; - } - return [4 /*yield*/, executeAndRetry(this.contracts['PRICE_POOL'].wards, [user])]; - case 1: - res = _b.sent(); - return [2 /*return*/, res[0].toNumber() === 1]; + return [4 /*yield*/, this.contract('PRICE_POOL').wards(user)]; + case 1: return [2 /*return*/, (_b.sent()).toBN().toNumber() === 1]; } }); }); }; // lender permissions (note: allowance operator for default deployment) _this.canSetMinimumJuniorRatio = function (user) { return __awaiter(_this, void 0, void 0, function () { - var res; var _a; return __generator(this, function (_b) { switch (_b.label) { case 0: - if (!((_a = this.contracts['ASSESSOR']) === null || _a === void 0 ? void 0 : _a.wards)) { + if (!((_a = this.contract('ASSESSOR')) === null || _a === void 0 ? void 0 : _a.wards)) return [2 /*return*/, false]; - } - return [4 /*yield*/, executeAndRetry(this.contracts['ASSESSOR'].wards, [user])]; - case 1: - res = _b.sent(); - return [2 /*return*/, res[0].toNumber() === 1]; + return [4 /*yield*/, this.contract('ASSESSOR').wards(user)]; + case 1: return [2 /*return*/, (_b.sent()).toBN().toNumber() === 1]; } }); }); }; _this.canSetInvestorAllowanceJunior = function (user) { return __awaiter(_this, void 0, void 0, function () { - var res; var _a; return __generator(this, function (_b) { switch (_b.label) { case 0: - if (!((_a = this.contracts['JUNIOR_OPERATOR']) === null || _a === void 0 ? void 0 : _a.wards)) { + if (!((_a = this.contract('JUNIOR_OPERATOR')) === null || _a === void 0 ? void 0 : _a.wards)) return [2 /*return*/, false]; - } - return [4 /*yield*/, executeAndRetry(this.contracts['JUNIOR_OPERATOR'].wards, [user])]; - case 1: - res = _b.sent(); - return [2 /*return*/, res[0].toNumber() === 1]; + return [4 /*yield*/, this.contract('JUNIOR_OPERATOR').wards(user)]; + case 1: return [2 /*return*/, (_b.sent()).toBN().toNumber() === 1]; } }); }); }; _this.canSetInvestorAllowanceSenior = function (user) { return __awaiter(_this, void 0, void 0, function () { - var res; var _a; return __generator(this, function (_b) { switch (_b.label) { case 0: - if (!((_a = this.contracts['SENIOR_OPERATOR']) === null || _a === void 0 ? void 0 : _a.wards)) { + if (!((_a = this.contract('SENIOR_OPERATOR')) === null || _a === void 0 ? void 0 : _a.wards)) return [2 /*return*/, false]; - } - if (!(this.contractAddresses['SENIOR_OPERATOR'] !== ZERO_ADDRESS)) return [3 /*break*/, 2]; - return [4 /*yield*/, executeAndRetry(this.contracts['SENIOR_OPERATOR'].wards, [user])]; - case 1: - res = _b.sent(); - return [2 /*return*/, res[0].toNumber() === 1]; - case 2: return [2 /*return*/, false]; + if (!(this.contractAddresses['SENIOR_OPERATOR'] !== ZERO_ADDRESS)) + return [2 /*return*/, false]; + return [4 /*yield*/, this.contract('SENIOR_OPERATOR').wards(user)]; + case 1: return [2 /*return*/, (_b.sent()).toBN().toNumber() === 1]; } }); }); }; _this.canSetLoanPrice = function (user) { return __awaiter(_this, void 0, void 0, function () { - var res; var _a; return __generator(this, function (_b) { switch (_b.label) { case 0: - if (!((_a = this.contracts['COLLECTOR']) === null || _a === void 0 ? void 0 : _a.wards)) { + if (!((_a = this.contract('COLLECTOR')) === null || _a === void 0 ? void 0 : _a.wards)) return [2 /*return*/, false]; - } - return [4 /*yield*/, executeAndRetry(this.contracts['COLLECTOR'].wards, [user])]; - case 1: - res = _b.sent(); - return [2 /*return*/, res[0].toNumber() === 1]; + return [4 /*yield*/, this.contract('COLLECTOR').wards(user)]; + case 1: return [2 /*return*/, (_b.sent()).toBN().toNumber() === 1]; } }); }); }; @@ -10845,76 +10813,45 @@ function AdminActions(Base) { }); }); }; _this.initRate = function (ratePerSecond) { return __awaiter(_this, void 0, void 0, function () { - var rateGroup, txHash; + var rateGroup; return __generator(this, function (_a) { - switch (_a.label) { - case 0: - rateGroup = getRateGroup(ratePerSecond); - return [4 /*yield*/, executeAndRetry(this.contracts['PILE'].file, [ - web3.fromAscii('rate'), - rateGroup, - ratePerSecond, - this.ethConfig, - ])]; - case 1: - txHash = _a.sent(); - console.log("[Initialising rate] txHash: " + txHash); - return [2 /*return*/, waitAndReturnEvents(this.eth, txHash, this.contracts['PILE'].abi, this.transactionTimeout)]; - } + rateGroup = getRateGroup(ratePerSecond); + // Source: https://github.com/ethereum/web3.js/issues/2256#issuecomment-462730550 + return [2 /*return*/, this.pending(this.contract('PILE').file(web3.fromAscii('rate').padEnd(66, '0'), rateGroup, ratePerSecond))]; }); }); }; _this.changeRate = function (loan, ratePerSecond) { return __awaiter(_this, void 0, void 0, function () { - var rateGroup, txHash; + var rateGroup; return __generator(this, function (_a) { - switch (_a.label) { - case 0: - rateGroup = getRateGroup(ratePerSecond); - return [4 /*yield*/, executeAndRetry(this.contracts['PILE'].changeRate, [loan, rateGroup, this.ethConfig])]; - case 1: - txHash = _a.sent(); - console.log("[Initialising rate] txHash: " + txHash); - return [2 /*return*/, waitAndReturnEvents(this.eth, txHash, this.contracts['PILE'].abi, this.transactionTimeout)]; - } + rateGroup = getRateGroup(ratePerSecond); + return [2 /*return*/, this.pending(this.contract('PILE').changeRate(loan, rateGroup))]; }); }); }; _this.setRate = function (loan, ratePerSecond) { return __awaiter(_this, void 0, void 0, function () { - var rateGroup, txHash; + var rateGroup; return __generator(this, function (_a) { - switch (_a.label) { - case 0: - rateGroup = getRateGroup(ratePerSecond); - return [4 /*yield*/, executeAndRetry(this.contracts['PILE'].setRate, [loan, rateGroup, this.ethConfig])]; - case 1: - txHash = _a.sent(); - console.log("[Setting rate] txHash: " + txHash); - return [2 /*return*/, waitAndReturnEvents(this.eth, txHash, this.contracts['PILE'].abi, this.transactionTimeout)]; - } + rateGroup = getRateGroup(ratePerSecond); + return [2 /*return*/, this.pending(this.contract('PILE').setRatet(loan, rateGroup))]; }); }); }; // ------------ admin functions lender-site ------------- _this.setMinimumJuniorRatio = function (ratio) { return __awaiter(_this, void 0, void 0, function () { - var assessor; return __generator(this, function (_a) { - assessor = this.contract('ASSESSOR'); // Source: https://github.com/ethereum/web3.js/issues/2256#issuecomment-462730550 - return [2 /*return*/, this.pending(assessor.file(web3.fromAscii('minJuniorRatio').padEnd(66, '0'), ratio))]; + return [2 /*return*/, this.pending(this.contract('ASSESSOR').file(web3.fromAscii('minJuniorRatio').padEnd(66, '0'), ratio))]; }); }); }; _this.approveAllowanceJunior = function (user, maxCurrency, maxToken) { return __awaiter(_this, void 0, void 0, function () { - var juniorOperator; return __generator(this, function (_a) { - juniorOperator = this.contract('JUNIOR_OPERATOR'); - return [2 /*return*/, this.pending(juniorOperator.approve(user, maxCurrency, maxToken))]; + return [2 /*return*/, this.pending(this.contract('JUNIOR_OPERATOR').approve(user, maxCurrency, maxToken))]; }); }); }; _this.approveAllowanceSenior = function (user, maxCurrency, maxToken) { return __awaiter(_this, void 0, void 0, function () { - var seniorOperator; return __generator(this, function (_a) { - seniorOperator = this.contract('SENIOR_OPERATOR'); - if (this.getOperatorType('senior') === 'PROPERTIONAL_OPERATOR') { - return [2 /*return*/, this.pending(seniorOperator.approve(user, maxCurrency))]; + if (this.getOperatorType('senior') === 'PROPORTIONAL_OPERATOR') { + return [2 /*return*/, this.pending(this.contract('SENIOR_OPERATOR').approve(user, maxCurrency))]; } - return [2 /*return*/, this.pending(seniorOperator.approve(user, maxCurrency, maxToken))]; + return [2 /*return*/, this.pending(this.contract('SENIOR_OPERATOR').approve(user, maxCurrency, maxToken))]; }); }); }; return _this; @@ -29912,7 +29849,7 @@ function AnalyticsActions(Base) { _this.getMaxSupplyAmountJunior = function (user) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) { switch (_a.label) { - case 0: return [4 /*yield*/, this.contract('JUNIOR_TOKEN').maxCurrency(user)]; + case 0: return [4 /*yield*/, this.contract('JUNIOR_OPERATOR').maxCurrency(user)]; case 1: return [2 /*return*/, (_a.sent()).toBN()]; } }); @@ -29920,7 +29857,7 @@ function AnalyticsActions(Base) { _this.getMaxRedeemAmountJunior = function (user) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) { switch (_a.label) { - case 0: return [4 /*yield*/, this.contract('JUNIOR_TOKEN').maxToken(user)]; + case 0: return [4 /*yield*/, this.contract('JUNIOR_OPERATOR').maxToken(user)]; case 1: return [2 /*return*/, (_a.sent()).toBN()]; } }); @@ -47232,10 +47169,13 @@ var Tinlake = /** @class */ (function () { this.ethersContracts = {}; this.contractAbis = {}; this.contractConfig = {}; - this.setProvider = function (provider, ethOptions) { + this.setProvider = function (provider, ethOptions, ethersConfig) { _this.provider = provider; _this.ethOptions = ethOptions || {}; _this.eth = new lib$a(_this.provider, _this.ethOptions); + console.log('set provider', ethersConfig); + if (ethersConfig) + _this.ethersConfig = ethersConfig; _this.setContracts(); }; this.setContracts = function () { @@ -47252,21 +47192,17 @@ var Tinlake = /** @class */ (function () { _this.contracts['JUNIOR_OPERATOR'] = _this.contractConfig['JUNIOR_OPERATOR'] ? _this.createEthContract(_this.contractAddresses['JUNIOR_OPERATOR'], _this.contractConfig['JUNIOR_OPERATOR']) : _this.createEthContract(_this.contractAddresses['JUNIOR_OPERATOR'], 'ALLOWANCE_OPERATOR'); - if (_this.ethersConfig) { - _this.ethersContracts['JUNIOR_OPERATOR'] = _this.contractConfig['JUNIOR_OPERATOR'] - ? _this.createContract(_this.contractAddresses['JUNIOR_OPERATOR'], _this.contractConfig['JUNIOR_OPERATOR']) - : _this.createContract(_this.contractAddresses['JUNIOR_OPERATOR'], 'ALLOWANCE_OPERATOR'); - } + _this.ethersContracts['JUNIOR_OPERATOR'] = _this.contractConfig['JUNIOR_OPERATOR'] + ? _this.createContract(_this.contractAddresses['JUNIOR_OPERATOR'], _this.contractConfig['JUNIOR_OPERATOR']) + : _this.createContract(_this.contractAddresses['JUNIOR_OPERATOR'], 'ALLOWANCE_OPERATOR'); } if (_this.contractAddresses['SENIOR_OPERATOR']) { _this.contracts['SENIOR_OPERATOR'] = _this.contractConfig['SENIOR_OPERATOR'] ? _this.createEthContract(_this.contractAddresses['SENIOR_OPERATOR'], _this.contractConfig['SENIOR_OPERATOR']) : _this.createEthContract(_this.contractAddresses['SENIOR_OPERATOR'], 'ALLOWANCE_OPERATOR'); - if (_this.ethersConfig) { - _this.ethersContracts['SENIOR_OPERATOR'] = _this.contractConfig['SENIOR_OPERATOR'] - ? _this.createContract(_this.contractAddresses['SENIOR_OPERATOR'], _this.contractConfig['SENIOR_OPERATOR']) - : _this.createContract(_this.contractAddresses['SENIOR_OPERATOR'], 'ALLOWANCE_OPERATOR'); - } + _this.ethersContracts['SENIOR_OPERATOR'] = _this.contractConfig['SENIOR_OPERATOR'] + ? _this.createContract(_this.contractAddresses['SENIOR_OPERATOR'], _this.contractConfig['SENIOR_OPERATOR']) + : _this.createContract(_this.contractAddresses['SENIOR_OPERATOR'], 'ALLOWANCE_OPERATOR'); } }; this.setEthConfig = function (ethConfig) { @@ -47292,7 +47228,7 @@ var Tinlake = /** @class */ (function () { this.contractConfig = contractConfig || {}; this.contractAddresses = contractAddresses || {}; this.transactionTimeout = transactionTimeout; - this.setProvider(provider, ethOptions); + this.setProvider(provider, ethOptions, ethersConfig); this.setEthConfig(ethConfig || {}); this.setEthersConfig(ethersConfig); } @@ -47304,6 +47240,7 @@ var Tinlake = /** @class */ (function () { return new ethers_2$1.Contract(address, this.contractAbis[abiName], this.ethersConfig.provider); }; Tinlake.prototype.contract = function (abiName, address) { + console.log("Looking up contract " + abiName, this.ethersContracts); if (address) { return new ethers_2$1.Contract(address, this.contractAbis[abiName], this.ethersConfig.signer); } diff --git a/dist/index.js b/dist/index.js index f6581f6..8640927 100644 --- a/dist/index.js +++ b/dist/index.js @@ -10695,144 +10695,112 @@ function AdminActions(Base) { var _this = _super !== null && _super.apply(this, arguments) || this; _this.canQueryPermissions = function () { var _a, _b, _c, _d, _e, _f, _g; - return (!!((_a = _this.contracts['PILE']) === null || _a === void 0 ? void 0 : _a.wards) && - !!((_b = _this.contracts['SENIOR']) === null || _b === void 0 ? void 0 : _b.wards) && - !!((_c = _this.contracts['PRICE_POOL']) === null || _c === void 0 ? void 0 : _c.wards) && - !!((_d = _this.contracts['ASSESSOR']) === null || _d === void 0 ? void 0 : _d.wards) && - !!((_e = _this.contracts['JUNIOR_OPERATOR']) === null || _e === void 0 ? void 0 : _e.wards) && - !!((_f = _this.contracts['SENIOR_OPERATOR']) === null || _f === void 0 ? void 0 : _f.wards) && - !!((_g = _this.contracts['COLLECTOR']) === null || _g === void 0 ? void 0 : _g.wards)); + return (!!((_a = _this.contract('PILE')) === null || _a === void 0 ? void 0 : _a.wards) && + !!((_b = _this.contract('SENIOR')) === null || _b === void 0 ? void 0 : _b.wards) && + !!((_c = _this.contract('PRICE_POOL')) === null || _c === void 0 ? void 0 : _c.wards) && + !!((_d = _this.contract('ASSESSOR')) === null || _d === void 0 ? void 0 : _d.wards) && + !!((_e = _this.contract('JUNIOR_OPERATOR')) === null || _e === void 0 ? void 0 : _e.wards) && + !!((_f = _this.contract('SENIOR_OPERATOR')) === null || _f === void 0 ? void 0 : _f.wards) && + !!((_g = _this.contract('COLLECTOR')) === null || _g === void 0 ? void 0 : _g.wards)); }; _this.isWard = function (user, contractName) { return __awaiter(_this, void 0, void 0, function () { - var res; var _a; return __generator(this, function (_b) { switch (_b.label) { case 0: - if (!((_a = this.contracts[contractName]) === null || _a === void 0 ? void 0 : _a.wards)) { + if (!((_a = this.contract(contractName)) === null || _a === void 0 ? void 0 : _a.wards)) return [2 /*return*/, new bn(0)]; - } - return [4 /*yield*/, executeAndRetry(this.contracts[contractName].wards, [user])]; - case 1: - res = _b.sent(); - return [2 /*return*/, res[0]]; + return [4 /*yield*/, this.contract(contractName).wards(user)]; + case 1: return [2 /*return*/, (_b.sent()).toBN()]; } }); }); }; _this.canSetInterestRate = function (user) { return __awaiter(_this, void 0, void 0, function () { - var res; var _a; return __generator(this, function (_b) { switch (_b.label) { case 0: - if (!((_a = this.contracts['PILE']) === null || _a === void 0 ? void 0 : _a.wards)) { + if (!((_a = this.contract('PILE')) === null || _a === void 0 ? void 0 : _a.wards)) return [2 /*return*/, false]; - } - return [4 /*yield*/, executeAndRetry(this.contracts['PILE'].wards, [user])]; - case 1: - res = _b.sent(); - return [2 /*return*/, res[0].toNumber() === 1]; + return [4 /*yield*/, this.contract('PILE').wards(user)]; + case 1: return [2 /*return*/, (_b.sent()).toBN().toNumber() === 1]; } }); }); }; _this.canSetSeniorTrancheInterest = function (user) { return __awaiter(_this, void 0, void 0, function () { - var res; var _a; return __generator(this, function (_b) { switch (_b.label) { case 0: - if (!(this.contractAddresses['SENIOR'] !== ZERO_ADDRESS)) return [3 /*break*/, 2]; - if (!((_a = this.contracts['SENIOR']) === null || _a === void 0 ? void 0 : _a.wards)) { + if (!(this.contractAddresses['SENIOR'] !== ZERO_ADDRESS)) return [2 /*return*/, false]; - } - return [4 /*yield*/, executeAndRetry(this.contracts['SENIOR'].wards, [user])]; - case 1: - res = _b.sent(); - return [2 /*return*/, res[0].toNumber() === 1]; - case 2: return [2 /*return*/, false]; + if (!((_a = this.contract('SENIOR')) === null || _a === void 0 ? void 0 : _a.wards)) + return [2 /*return*/, false]; + return [4 /*yield*/, this.contract('SENIOR').wards(user)]; + case 1: return [2 /*return*/, (_b.sent()).toBN().toNumber() === 1]; } }); }); }; _this.canSetRiskScore = function (user) { return __awaiter(_this, void 0, void 0, function () { - var res; var _a; return __generator(this, function (_b) { switch (_b.label) { case 0: - if (!((_a = this.contracts['PRICE_POOL']) === null || _a === void 0 ? void 0 : _a.wards)) { + if (!((_a = this.contract('PRICE_POOL')) === null || _a === void 0 ? void 0 : _a.wards)) return [2 /*return*/, false]; - } - return [4 /*yield*/, executeAndRetry(this.contracts['PRICE_POOL'].wards, [user])]; - case 1: - res = _b.sent(); - return [2 /*return*/, res[0].toNumber() === 1]; + return [4 /*yield*/, this.contract('PRICE_POOL').wards(user)]; + case 1: return [2 /*return*/, (_b.sent()).toBN().toNumber() === 1]; } }); }); }; // lender permissions (note: allowance operator for default deployment) _this.canSetMinimumJuniorRatio = function (user) { return __awaiter(_this, void 0, void 0, function () { - var res; var _a; return __generator(this, function (_b) { switch (_b.label) { case 0: - if (!((_a = this.contracts['ASSESSOR']) === null || _a === void 0 ? void 0 : _a.wards)) { + if (!((_a = this.contract('ASSESSOR')) === null || _a === void 0 ? void 0 : _a.wards)) return [2 /*return*/, false]; - } - return [4 /*yield*/, executeAndRetry(this.contracts['ASSESSOR'].wards, [user])]; - case 1: - res = _b.sent(); - return [2 /*return*/, res[0].toNumber() === 1]; + return [4 /*yield*/, this.contract('ASSESSOR').wards(user)]; + case 1: return [2 /*return*/, (_b.sent()).toBN().toNumber() === 1]; } }); }); }; _this.canSetInvestorAllowanceJunior = function (user) { return __awaiter(_this, void 0, void 0, function () { - var res; var _a; return __generator(this, function (_b) { switch (_b.label) { case 0: - if (!((_a = this.contracts['JUNIOR_OPERATOR']) === null || _a === void 0 ? void 0 : _a.wards)) { + if (!((_a = this.contract('JUNIOR_OPERATOR')) === null || _a === void 0 ? void 0 : _a.wards)) return [2 /*return*/, false]; - } - return [4 /*yield*/, executeAndRetry(this.contracts['JUNIOR_OPERATOR'].wards, [user])]; - case 1: - res = _b.sent(); - return [2 /*return*/, res[0].toNumber() === 1]; + return [4 /*yield*/, this.contract('JUNIOR_OPERATOR').wards(user)]; + case 1: return [2 /*return*/, (_b.sent()).toBN().toNumber() === 1]; } }); }); }; _this.canSetInvestorAllowanceSenior = function (user) { return __awaiter(_this, void 0, void 0, function () { - var res; var _a; return __generator(this, function (_b) { switch (_b.label) { case 0: - if (!((_a = this.contracts['SENIOR_OPERATOR']) === null || _a === void 0 ? void 0 : _a.wards)) { + if (!((_a = this.contract('SENIOR_OPERATOR')) === null || _a === void 0 ? void 0 : _a.wards)) return [2 /*return*/, false]; - } - if (!(this.contractAddresses['SENIOR_OPERATOR'] !== ZERO_ADDRESS)) return [3 /*break*/, 2]; - return [4 /*yield*/, executeAndRetry(this.contracts['SENIOR_OPERATOR'].wards, [user])]; - case 1: - res = _b.sent(); - return [2 /*return*/, res[0].toNumber() === 1]; - case 2: return [2 /*return*/, false]; + if (!(this.contractAddresses['SENIOR_OPERATOR'] !== ZERO_ADDRESS)) + return [2 /*return*/, false]; + return [4 /*yield*/, this.contract('SENIOR_OPERATOR').wards(user)]; + case 1: return [2 /*return*/, (_b.sent()).toBN().toNumber() === 1]; } }); }); }; _this.canSetLoanPrice = function (user) { return __awaiter(_this, void 0, void 0, function () { - var res; var _a; return __generator(this, function (_b) { switch (_b.label) { case 0: - if (!((_a = this.contracts['COLLECTOR']) === null || _a === void 0 ? void 0 : _a.wards)) { + if (!((_a = this.contract('COLLECTOR')) === null || _a === void 0 ? void 0 : _a.wards)) return [2 /*return*/, false]; - } - return [4 /*yield*/, executeAndRetry(this.contracts['COLLECTOR'].wards, [user])]; - case 1: - res = _b.sent(); - return [2 /*return*/, res[0].toNumber() === 1]; + return [4 /*yield*/, this.contract('COLLECTOR').wards(user)]; + case 1: return [2 /*return*/, (_b.sent()).toBN().toNumber() === 1]; } }); }); }; @@ -10851,76 +10819,45 @@ function AdminActions(Base) { }); }); }; _this.initRate = function (ratePerSecond) { return __awaiter(_this, void 0, void 0, function () { - var rateGroup, txHash; + var rateGroup; return __generator(this, function (_a) { - switch (_a.label) { - case 0: - rateGroup = getRateGroup(ratePerSecond); - return [4 /*yield*/, executeAndRetry(this.contracts['PILE'].file, [ - web3.fromAscii('rate'), - rateGroup, - ratePerSecond, - this.ethConfig, - ])]; - case 1: - txHash = _a.sent(); - console.log("[Initialising rate] txHash: " + txHash); - return [2 /*return*/, waitAndReturnEvents(this.eth, txHash, this.contracts['PILE'].abi, this.transactionTimeout)]; - } + rateGroup = getRateGroup(ratePerSecond); + // Source: https://github.com/ethereum/web3.js/issues/2256#issuecomment-462730550 + return [2 /*return*/, this.pending(this.contract('PILE').file(web3.fromAscii('rate').padEnd(66, '0'), rateGroup, ratePerSecond))]; }); }); }; _this.changeRate = function (loan, ratePerSecond) { return __awaiter(_this, void 0, void 0, function () { - var rateGroup, txHash; + var rateGroup; return __generator(this, function (_a) { - switch (_a.label) { - case 0: - rateGroup = getRateGroup(ratePerSecond); - return [4 /*yield*/, executeAndRetry(this.contracts['PILE'].changeRate, [loan, rateGroup, this.ethConfig])]; - case 1: - txHash = _a.sent(); - console.log("[Initialising rate] txHash: " + txHash); - return [2 /*return*/, waitAndReturnEvents(this.eth, txHash, this.contracts['PILE'].abi, this.transactionTimeout)]; - } + rateGroup = getRateGroup(ratePerSecond); + return [2 /*return*/, this.pending(this.contract('PILE').changeRate(loan, rateGroup))]; }); }); }; _this.setRate = function (loan, ratePerSecond) { return __awaiter(_this, void 0, void 0, function () { - var rateGroup, txHash; + var rateGroup; return __generator(this, function (_a) { - switch (_a.label) { - case 0: - rateGroup = getRateGroup(ratePerSecond); - return [4 /*yield*/, executeAndRetry(this.contracts['PILE'].setRate, [loan, rateGroup, this.ethConfig])]; - case 1: - txHash = _a.sent(); - console.log("[Setting rate] txHash: " + txHash); - return [2 /*return*/, waitAndReturnEvents(this.eth, txHash, this.contracts['PILE'].abi, this.transactionTimeout)]; - } + rateGroup = getRateGroup(ratePerSecond); + return [2 /*return*/, this.pending(this.contract('PILE').setRatet(loan, rateGroup))]; }); }); }; // ------------ admin functions lender-site ------------- _this.setMinimumJuniorRatio = function (ratio) { return __awaiter(_this, void 0, void 0, function () { - var assessor; return __generator(this, function (_a) { - assessor = this.contract('ASSESSOR'); // Source: https://github.com/ethereum/web3.js/issues/2256#issuecomment-462730550 - return [2 /*return*/, this.pending(assessor.file(web3.fromAscii('minJuniorRatio').padEnd(66, '0'), ratio))]; + return [2 /*return*/, this.pending(this.contract('ASSESSOR').file(web3.fromAscii('minJuniorRatio').padEnd(66, '0'), ratio))]; }); }); }; _this.approveAllowanceJunior = function (user, maxCurrency, maxToken) { return __awaiter(_this, void 0, void 0, function () { - var juniorOperator; return __generator(this, function (_a) { - juniorOperator = this.contract('JUNIOR_OPERATOR'); - return [2 /*return*/, this.pending(juniorOperator.approve(user, maxCurrency, maxToken))]; + return [2 /*return*/, this.pending(this.contract('JUNIOR_OPERATOR').approve(user, maxCurrency, maxToken))]; }); }); }; _this.approveAllowanceSenior = function (user, maxCurrency, maxToken) { return __awaiter(_this, void 0, void 0, function () { - var seniorOperator; return __generator(this, function (_a) { - seniorOperator = this.contract('SENIOR_OPERATOR'); - if (this.getOperatorType('senior') === 'PROPERTIONAL_OPERATOR') { - return [2 /*return*/, this.pending(seniorOperator.approve(user, maxCurrency))]; + if (this.getOperatorType('senior') === 'PROPORTIONAL_OPERATOR') { + return [2 /*return*/, this.pending(this.contract('SENIOR_OPERATOR').approve(user, maxCurrency))]; } - return [2 /*return*/, this.pending(seniorOperator.approve(user, maxCurrency, maxToken))]; + return [2 /*return*/, this.pending(this.contract('SENIOR_OPERATOR').approve(user, maxCurrency, maxToken))]; }); }); }; return _this; @@ -29918,7 +29855,7 @@ function AnalyticsActions(Base) { _this.getMaxSupplyAmountJunior = function (user) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) { switch (_a.label) { - case 0: return [4 /*yield*/, this.contract('JUNIOR_TOKEN').maxCurrency(user)]; + case 0: return [4 /*yield*/, this.contract('JUNIOR_OPERATOR').maxCurrency(user)]; case 1: return [2 /*return*/, (_a.sent()).toBN()]; } }); @@ -29926,7 +29863,7 @@ function AnalyticsActions(Base) { _this.getMaxRedeemAmountJunior = function (user) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) { switch (_a.label) { - case 0: return [4 /*yield*/, this.contract('JUNIOR_TOKEN').maxToken(user)]; + case 0: return [4 /*yield*/, this.contract('JUNIOR_OPERATOR').maxToken(user)]; case 1: return [2 /*return*/, (_a.sent()).toBN()]; } }); @@ -47238,10 +47175,13 @@ var Tinlake = /** @class */ (function () { this.ethersContracts = {}; this.contractAbis = {}; this.contractConfig = {}; - this.setProvider = function (provider, ethOptions) { + this.setProvider = function (provider, ethOptions, ethersConfig) { _this.provider = provider; _this.ethOptions = ethOptions || {}; _this.eth = new lib$a(_this.provider, _this.ethOptions); + console.log('set provider', ethersConfig); + if (ethersConfig) + _this.ethersConfig = ethersConfig; _this.setContracts(); }; this.setContracts = function () { @@ -47258,21 +47198,17 @@ var Tinlake = /** @class */ (function () { _this.contracts['JUNIOR_OPERATOR'] = _this.contractConfig['JUNIOR_OPERATOR'] ? _this.createEthContract(_this.contractAddresses['JUNIOR_OPERATOR'], _this.contractConfig['JUNIOR_OPERATOR']) : _this.createEthContract(_this.contractAddresses['JUNIOR_OPERATOR'], 'ALLOWANCE_OPERATOR'); - if (_this.ethersConfig) { - _this.ethersContracts['JUNIOR_OPERATOR'] = _this.contractConfig['JUNIOR_OPERATOR'] - ? _this.createContract(_this.contractAddresses['JUNIOR_OPERATOR'], _this.contractConfig['JUNIOR_OPERATOR']) - : _this.createContract(_this.contractAddresses['JUNIOR_OPERATOR'], 'ALLOWANCE_OPERATOR'); - } + _this.ethersContracts['JUNIOR_OPERATOR'] = _this.contractConfig['JUNIOR_OPERATOR'] + ? _this.createContract(_this.contractAddresses['JUNIOR_OPERATOR'], _this.contractConfig['JUNIOR_OPERATOR']) + : _this.createContract(_this.contractAddresses['JUNIOR_OPERATOR'], 'ALLOWANCE_OPERATOR'); } if (_this.contractAddresses['SENIOR_OPERATOR']) { _this.contracts['SENIOR_OPERATOR'] = _this.contractConfig['SENIOR_OPERATOR'] ? _this.createEthContract(_this.contractAddresses['SENIOR_OPERATOR'], _this.contractConfig['SENIOR_OPERATOR']) : _this.createEthContract(_this.contractAddresses['SENIOR_OPERATOR'], 'ALLOWANCE_OPERATOR'); - if (_this.ethersConfig) { - _this.ethersContracts['SENIOR_OPERATOR'] = _this.contractConfig['SENIOR_OPERATOR'] - ? _this.createContract(_this.contractAddresses['SENIOR_OPERATOR'], _this.contractConfig['SENIOR_OPERATOR']) - : _this.createContract(_this.contractAddresses['SENIOR_OPERATOR'], 'ALLOWANCE_OPERATOR'); - } + _this.ethersContracts['SENIOR_OPERATOR'] = _this.contractConfig['SENIOR_OPERATOR'] + ? _this.createContract(_this.contractAddresses['SENIOR_OPERATOR'], _this.contractConfig['SENIOR_OPERATOR']) + : _this.createContract(_this.contractAddresses['SENIOR_OPERATOR'], 'ALLOWANCE_OPERATOR'); } }; this.setEthConfig = function (ethConfig) { @@ -47298,7 +47234,7 @@ var Tinlake = /** @class */ (function () { this.contractConfig = contractConfig || {}; this.contractAddresses = contractAddresses || {}; this.transactionTimeout = transactionTimeout; - this.setProvider(provider, ethOptions); + this.setProvider(provider, ethOptions, ethersConfig); this.setEthConfig(ethConfig || {}); this.setEthersConfig(ethersConfig); } @@ -47310,6 +47246,7 @@ var Tinlake = /** @class */ (function () { return new ethers_2$1.Contract(address, this.contractAbis[abiName], this.ethersConfig.provider); }; Tinlake.prototype.contract = function (abiName, address) { + console.log("Looking up contract " + abiName, this.ethersContracts); if (address) { return new ethers_2$1.Contract(address, this.contractAbis[abiName], this.ethersConfig.signer); } diff --git a/docs/classes/_tinlake_.tinlake.html b/docs/classes/_tinlake_.tinlake.html index c9f350e..f8e4eb4 100644 --- a/docs/classes/_tinlake_.tinlake.html +++ b/docs/classes/_tinlake_.tinlake.html @@ -129,7 +129,7 @@

    constructor

  • Parameters

    @@ -151,7 +151,7 @@

    contractAbis

    contractAbis: ContractAbis
    @@ -161,7 +161,7 @@

    contractAddresses

    contractAddresses: ContractAddresses
    @@ -171,7 +171,7 @@

    contractConfig

    contractConfig: any
    @@ -181,7 +181,7 @@

    contracts

    contracts: Contracts
    @@ -191,7 +191,7 @@

    eth

    eth: ethI
    @@ -201,7 +201,7 @@

    ethConfig

    ethConfig: EthConfig
    @@ -211,7 +211,7 @@

    ethOptions

    ethOptions: any
    @@ -221,7 +221,7 @@

    ethersConfig

    ethersConfig: EthersConfig
    @@ -231,7 +231,7 @@

    ethersContracts

    ethersContracts: Contracts
    @@ -241,7 +241,7 @@

    provider

    provider: any
    @@ -251,7 +251,7 @@

    transactionTimeout

    transactionTimeout: number
    @@ -268,7 +268,7 @@

    contract

  • Parameters

    @@ -294,7 +294,7 @@

    createContract

  • Parameters

    @@ -320,7 +320,7 @@

    createEthContract

  • Parameters

    @@ -346,7 +346,7 @@

    getOperatorType

  • Parameters

    @@ -369,7 +369,7 @@

    getTransactionReceipt

  • Parameters

    @@ -392,7 +392,7 @@

    pending

  • Parameters

    @@ -415,7 +415,7 @@

    setContracts

  • Returns void

    @@ -432,7 +432,7 @@

    setEthConfig

  • Parameters

    @@ -455,7 +455,7 @@

    setEthersConfig

  • Parameters

    @@ -472,13 +472,13 @@

    Returns void

    setProvider

      -
    • setProvider(provider: any, ethOptions?: any): void
    • +
    • setProvider(provider: any, ethOptions?: any, ethersConfig?: EthersConfig): void

    Returns void

  • diff --git a/docs/interfaces/_services_ethereum_.ethi.html b/docs/interfaces/_services_ethereum_.ethi.html index dd2c1c9..2e80762 100644 --- a/docs/interfaces/_services_ethereum_.ethi.html +++ b/docs/interfaces/_services_ethereum_.ethi.html @@ -101,7 +101,7 @@

    abi

    abi: any
    @@ -111,7 +111,7 @@

    contract

    contract: (arg0: any) => { at: (arg0: any) => void }
    @@ -165,7 +165,7 @@

    getTransactionByHash

    getTransactionByHash: (arg0: any, arg1: (err: any, tx: any) => void) => void
    @@ -220,7 +220,7 @@

    getTransactionCount

    getTransactionCount: any
    @@ -230,7 +230,7 @@

    getTransactionReceipt

    getTransactionReceipt: (arg0: any, arg1: (err: any, receipt: any) => void) => void
    @@ -285,7 +285,7 @@

    send

    send: Function
    @@ -295,7 +295,7 @@

    sendRawTransaction

    sendRawTransaction: any
    @@ -305,7 +305,7 @@

    web3_sha3

    web3_sha3: (signature: string) => string
    diff --git a/docs/interfaces/_services_ethereum_.events.html b/docs/interfaces/_services_ethereum_.events.html index 6620848..fd077c0 100644 --- a/docs/interfaces/_services_ethereum_.events.html +++ b/docs/interfaces/_services_ethereum_.events.html @@ -96,7 +96,7 @@

    events

    events: { data: any[]; event: { name: any } }[]
    @@ -106,7 +106,7 @@

    status

    status: any
    @@ -116,7 +116,7 @@

    txHash

    txHash: string
    diff --git a/docs/modules/_actions_admin_.html b/docs/modules/_actions_admin_.html index eeb4d65..4f64aa7 100644 --- a/docs/modules/_actions_admin_.html +++ b/docs/modules/_actions_admin_.html @@ -89,7 +89,7 @@

    IAdminActions

    IAdminActions: { approveAllowanceJunior: any; approveAllowanceSenior: any; canSetInterestRate: any; canSetInvestorAllowanceJunior: any; canSetInvestorAllowanceSenior: any; canSetLoanPrice: any; canSetMinimumJuniorRatio: any; canSetRiskScore: any; canSetSeniorTrancheInterest: any; initRate: any; isWard: any; setMinimumJuniorRatio: any; setRate: any }
    @@ -98,13 +98,13 @@

    Type declaration

  • approveAllowanceJunior: function
      -
    • approveAllowanceJunior(user: string, maxCurrency: string, maxToken: string): Promise<any>
    • +
    • approveAllowanceJunior(user: string, maxCurrency: string, maxToken: string): Promise<PendingTransaction>
    -

    Returns Promise<any>

    +

    Returns Promise<PendingTransaction>

  • approveAllowanceSenior: function
      -
    • approveAllowanceSenior(user: string, maxCurrency: string, maxToken: string): Promise<any>
    • +
    • approveAllowanceSenior(user: string, maxCurrency: string, maxToken: string): Promise<PendingTransaction>
    -

    Returns Promise<any>

    +

    Returns Promise<PendingTransaction>

  • @@ -160,7 +160,7 @@
    canSetInterestRate:

    Parameters

    @@ -182,7 +182,7 @@
    canSetInvestorAllowanceJunior

    Parameters

    @@ -204,7 +204,7 @@
    canSetInvestorAllowanceSenior

    Parameters

    @@ -226,7 +226,7 @@
    canSetLoanPrice: fu
  • Parameters

    @@ -248,7 +248,7 @@
    canSetMinimumJuniorRatio

    Parameters

    @@ -270,7 +270,7 @@
    canSetRiskScore: fu
  • Parameters

    @@ -292,7 +292,7 @@
    canSetSeniorTrancheInterest

    Parameters

    @@ -308,13 +308,13 @@

    Returns Promise
    initRate: function
      -
    • initRate(rate: string): Promise<any>
    • +
    • initRate(rate: string): Promise<PendingTransaction>
    -

    Returns Promise<any>

    +

    Returns Promise<PendingTransaction>

  • @@ -336,7 +336,7 @@
    isWard: function
  • Parameters

    @@ -361,7 +361,7 @@
    setMinimumJuniorRatio:

    Parameters

    @@ -377,13 +377,13 @@

    Returns Promise
    setRate: function
      -
    • setRate(loan: string, rate: string): Promise<any>
    • +
    • setRate(loan: string, rate: string): Promise<PendingTransaction>
    -

    Returns Promise<any>

    +

    Returns Promise<PendingTransaction>

  • @@ -415,7 +415,7 @@

    AdminActions

  • Type parameters

    diff --git a/docs/modules/_actions_analytics_.html b/docs/modules/_actions_analytics_.html index cfae163..403c882 100644 --- a/docs/modules/_actions_analytics_.html +++ b/docs/modules/_actions_analytics_.html @@ -89,7 +89,7 @@

    IAnalyticsActions

    IAnalyticsActions: { existsSenior: any; getAssetValueJunior: any; getCollateral: any; getCurrentJuniorRatio: any; getDebt: any; getInterestRate: any; getInvestor: any; getJuniorReserve: any; getJuniorTokenBalance: any; getLoan: any; getLoanList: any; getMaxRedeemAmountJunior: any; getMaxRedeemAmountSenior: any; getMaxSupplyAmountJunior: any; getMaxSupplyAmountSenior: any; getMinJuniorRatio: any; getOwnerOfCollateral: any; getOwnerOfLoan: any; getPrincipal: any; getSeniorDebt: any; getSeniorInterestRate: any; getSeniorReserve: any; getSeniorTokenBalance: any; getTokenPriceJunior: any; getTokenPriceSenior: any; getTotalBalance: any; getTotalDebt: any; loanCount: any }
    @@ -104,7 +104,7 @@
    existsSenior: function
  • Returns boolean

    @@ -120,7 +120,7 @@
    getAssetValueJunior:

    Returns Promise<BN>

    @@ -136,7 +136,7 @@
    getCollateral: function
  • Parameters

    @@ -158,7 +158,7 @@
    getCurrentJuniorRatio:

    Returns Promise<BN>

    @@ -174,7 +174,7 @@
    getDebt: function
  • Parameters

    @@ -196,7 +196,7 @@
    getInterestRate: functio
  • Parameters

    @@ -218,7 +218,7 @@
    getInvestor: function
  • Parameters

    @@ -240,7 +240,7 @@
    getJuniorReserve: functi
  • Returns Promise<BN>

    @@ -256,7 +256,7 @@
    getJuniorTokenBalance:

    Parameters

    @@ -278,7 +278,7 @@
    getLoan: function
  • Parameters

    @@ -300,7 +300,7 @@
    getLoanList: function

    Returns Promise<Loan[]>

    @@ -316,7 +316,7 @@
    getMaxRedeemAmountJunior

    Parameters

    @@ -338,7 +338,7 @@
    getMaxRedeemAmountSenior

    Parameters

    @@ -360,7 +360,7 @@
    getMaxSupplyAmountJunior

    Parameters

    @@ -382,7 +382,7 @@
    getMaxSupplyAmountSenior

    Parameters

    @@ -404,7 +404,7 @@
    getMinJuniorRatio:
  • Returns Promise<BN>

    @@ -420,7 +420,7 @@
    getOwnerOfCollateral: fu
  • Parameters

    @@ -448,7 +448,7 @@
    getOwnerOfLoan: function
  • Parameters

    @@ -470,7 +470,7 @@
    getPrincipal: function
  • Parameters

    @@ -492,7 +492,7 @@
    getSeniorDebt: function<
  • Returns Promise<BN>

    @@ -508,7 +508,7 @@
    getSeniorInterestRate:

    Returns Promise<BN>

    @@ -524,7 +524,7 @@
    getSeniorReserve: functi
  • Returns Promise<BN>

    @@ -540,7 +540,7 @@
    getSeniorTokenBalance:

    Parameters

    @@ -562,7 +562,7 @@
    getTokenPriceJunior:

    Returns Promise<BN>

    @@ -578,7 +578,7 @@
    getTokenPriceSenior:

    Parameters

    @@ -600,7 +600,7 @@
    getTotalBalance: functio
  • Returns Promise<BN>

    @@ -616,7 +616,7 @@
    getTotalDebt: function

    Returns Promise<BN>

    @@ -632,7 +632,7 @@
    loanCount: function
  • Returns Promise<BN>

    @@ -655,7 +655,7 @@

    AnalyticsActions

  • Type parameters

    diff --git a/docs/modules/_actions_borrower_.html b/docs/modules/_actions_borrower_.html index db906fb..902562b 100644 --- a/docs/modules/_actions_borrower_.html +++ b/docs/modules/_actions_borrower_.html @@ -89,7 +89,7 @@

    IBorrowerActions

    IBorrowerActions: { borrow: any; close: any; issue: any; lock: any; nftLookup: any; repay: any; unlock: any; withdraw: any }
    @@ -104,7 +104,7 @@
    borrow: function
  • Parameters

    @@ -129,7 +129,7 @@
    close: function
  • Parameters

    @@ -151,7 +151,7 @@
    issue: function
  • Parameters

    @@ -176,7 +176,7 @@
    lock: function
  • Parameters

    @@ -198,7 +198,7 @@
    nftLookup: function
  • Parameters

    @@ -223,7 +223,7 @@
    repay: function
  • Parameters

    @@ -248,7 +248,7 @@
    unlock: function
  • Parameters

    @@ -270,7 +270,7 @@
    withdraw: function
  • Parameters

    @@ -305,7 +305,7 @@

    BorrowerActions

  • Type parameters

    diff --git a/docs/modules/_actions_collateral_.html b/docs/modules/_actions_collateral_.html index cd7ea4f..12db831 100644 --- a/docs/modules/_actions_collateral_.html +++ b/docs/modules/_actions_collateral_.html @@ -89,7 +89,7 @@

    ICollateralActions

    ICollateralActions: { approveNFT: any; getNFTCount: any; getNFTData: any; getNFTOwner: any; isNFTApprovedForAll: any; mintNFT: any; mintTitleNFT: any; setNFTApprovalForAll: any; transferNFT: any }
    @@ -104,7 +104,7 @@
    approveNFT: function
  • Parameters

    @@ -132,7 +132,7 @@
    getNFTCount: function
  • Parameters

    @@ -154,7 +154,7 @@
    getNFTData: function
  • Parameters

    @@ -179,7 +179,7 @@
    getNFTOwner: function
  • Parameters

    @@ -204,7 +204,7 @@
    isNFTApprovedForAll: fun
  • Parameters

    @@ -232,7 +232,7 @@
    mintNFT: function
  • Parameters

    @@ -269,7 +269,7 @@
    mintTitleNFT: function
  • Parameters

    @@ -294,7 +294,7 @@
    setNFTApprovalForAll: fu
  • Parameters

    @@ -322,7 +322,7 @@
    transferNFT: function
  • Parameters

    @@ -360,7 +360,7 @@

    CollateralActions

  • Type parameters

    diff --git a/docs/modules/_actions_currency_.html b/docs/modules/_actions_currency_.html index 3e2e5a3..3188a44 100644 --- a/docs/modules/_actions_currency_.html +++ b/docs/modules/_actions_currency_.html @@ -89,7 +89,7 @@

    ICurrencyActions

    ICurrencyActions: { approveJuniorForCurrency: (currencyAmount: string) => Promise<PendingTransaction | undefined>; approveSeniorForCurrency: (currencyAmount: string) => Promise<PendingTransaction | undefined>; getCurrencyAllowance: (owner: string, spender: string) => Promise<BN>; getJuniorForCurrencyAllowance: (owner: string) => Promise<BN | undefined>; getSeniorForCurrencyAllowance: (owner: string) => Promise<BN | undefined>; approveCurrency: any; getCurrencyBalance: any; mintCurrency: any }
    @@ -212,7 +212,7 @@
    approveCurrency: function

    Parameters

    @@ -237,7 +237,7 @@
    getCurrencyBalance: func
  • Parameters

    @@ -259,7 +259,7 @@
    mintCurrency: function
  • Parameters

    @@ -291,7 +291,7 @@

    CurrencyActions

  • Type parameters

    diff --git a/docs/modules/_actions_governance_.html b/docs/modules/_actions_governance_.html index 828eff4..9f63e92 100644 --- a/docs/modules/_actions_governance_.html +++ b/docs/modules/_actions_governance_.html @@ -83,7 +83,7 @@

    IGovernanceActions

    IGovernanceActions: { relyAddress: any }
    @@ -98,7 +98,7 @@
    relyAddress: function
  • Parameters

    diff --git a/docs/modules/_actions_index_.html b/docs/modules/_actions_index_.html index d6c5008..4b3650d 100644 --- a/docs/modules/_actions_index_.html +++ b/docs/modules/_actions_index_.html @@ -83,7 +83,7 @@

    TinlakeActions

    diff --git a/docs/modules/_actions_lender_.html b/docs/modules/_actions_lender_.html index b7b1083..80ac288 100644 --- a/docs/modules/_actions_lender_.html +++ b/docs/modules/_actions_lender_.html @@ -89,7 +89,7 @@

    ILenderActions

    ILenderActions: { approveJuniorToken: (tokenAmount: string) => Promise<unknown>; approveSeniorToken: (tokenAmount: string) => Promise<unknown>; balance: any; getJuniorTokenAllowance: any; getSeniorTokenAllowance: any; redeemJunior: any; redeemSenior: any; supplyJunior: any; supplySenior: any }
    @@ -146,7 +146,7 @@
    balance: function
  • Returns Promise<any>

    @@ -162,7 +162,7 @@
    getJuniorTokenAllowance: <
  • Parameters

    @@ -184,7 +184,7 @@
    getSeniorTokenAllowance: <
  • Parameters

    @@ -206,7 +206,7 @@
    redeemJunior: function
  • Parameters

    @@ -228,7 +228,7 @@
    redeemSenior: function
  • Parameters

    @@ -250,7 +250,7 @@
    supplyJunior: function
  • Parameters

    @@ -272,7 +272,7 @@
    supplySenior: function
  • Parameters

    @@ -301,7 +301,7 @@

    LenderActions

  • Type parameters

    diff --git a/docs/modules/_actions_proxy_.html b/docs/modules/_actions_proxy_.html index 3093c00..79b99c1 100644 --- a/docs/modules/_actions_proxy_.html +++ b/docs/modules/_actions_proxy_.html @@ -89,7 +89,7 @@

    IProxyActions

    IProxyActions: { buildProxy: any; checkProxyExists: any; getProxy: any; getProxyAccessToken: any; getProxyAccessTokenOwner: any; getProxyOwnerByAddress: any; getProxyOwnerByLoan: any; proxyCount: any; proxyCreateNew: any; proxyIssue: any; proxyLockBorrowWithdraw: any; proxyRepayUnlockClose: any; proxyTransferIssue: any }
    @@ -104,7 +104,7 @@
    buildProxy: function
  • Parameters

    @@ -126,7 +126,7 @@
    checkProxyExists: functi
  • Parameters

    @@ -148,7 +148,7 @@
    getProxy: function
  • Parameters

    @@ -170,7 +170,7 @@
    getProxyAccessToken:

    Parameters

    @@ -192,7 +192,7 @@
    getProxyAccessTokenOwner

    Parameters

    @@ -214,7 +214,7 @@
    getProxyOwnerByAddress:

    Parameters

    @@ -236,7 +236,7 @@
    getProxyOwnerByLoan:

    Parameters

    @@ -258,7 +258,7 @@
    proxyCount: function
  • Returns Promise<any>

    @@ -274,7 +274,7 @@
    proxyCreateNew: function
  • Parameters

    @@ -296,7 +296,7 @@
    proxyIssue: function
  • Parameters

    @@ -324,7 +324,7 @@
    proxyLockBorrowWithdraw: <
  • Parameters

    @@ -355,7 +355,7 @@
    proxyRepayUnlockClose:

    Parameters

    @@ -386,7 +386,7 @@
    proxyTransferIssue: func
  • Parameters

    @@ -421,7 +421,7 @@

    ProxyActions

  • Type parameters

    diff --git a/docs/modules/_services_ethereum_.html b/docs/modules/_services_ethereum_.html index d5a7edd..e368262 100644 --- a/docs/modules/_services_ethereum_.html +++ b/docs/modules/_services_ethereum_.html @@ -99,7 +99,7 @@

    Const ZERO_ADDRESS

    ZERO_ADDRESS: "0x0000000000000000000000000000000000000000" = "0x0000000000000000000000000000000000000000"
    @@ -116,7 +116,7 @@

    executeAndRetry

  • Parameters

    @@ -142,7 +142,7 @@

    Const findEvent

  • Parameters

    @@ -209,7 +209,7 @@

    Const waitAndReturn

    Parameters

    @@ -241,7 +241,7 @@

    Const waitForTransactio
  • Parameters

    diff --git a/docs/modules/_tinlake_.html b/docs/modules/_tinlake_.html index b795c2e..80a38ec 100644 --- a/docs/modules/_tinlake_.html +++ b/docs/modules/_tinlake_.html @@ -98,7 +98,7 @@

    Constructor

    Constructor<T>: {}

    Type parameters

    @@ -119,7 +119,7 @@

    ContractAbis

    ContractAbis: {}
    @@ -134,7 +134,7 @@

    ContractAddresses

    ContractAddresses: {}
    @@ -149,7 +149,7 @@

    ContractName

    ContractName: typeof contractNames[number]
    @@ -159,7 +159,7 @@

    Contracts

    Contracts: {}
    @@ -174,7 +174,7 @@

    EthConfig

    EthConfig: { from?: undefined | string; gas?: undefined | string; gasPrice?: undefined | string }
    @@ -198,7 +198,7 @@

    EthersConfig

    EthersConfig: { overrides?: EthersOverrides; provider: Provider; signer: Signer }
    @@ -222,7 +222,7 @@

    EthersOverrides

    EthersOverrides: { gasLimit?: undefined | number; gasPrice?: undefined | number }
    @@ -243,7 +243,7 @@

    PendingTransaction

    PendingTransaction: { hash: string | undefined; timesOutAt?: undefined | number }
    @@ -264,7 +264,7 @@

    TinlakeParams

    TinlakeParams: { contractAbis?: ContractAbis | {}; contractAddresses?: ContractAddresses | {}; contractConfig?: any | {}; contracts?: Contracts | {}; ethConfig?: EthConfig; ethOptions?: any | {}; ethersConfig?: EthersConfig; provider: any; transactionTimeout: number }
    diff --git a/docs/modules/_types_tinlake_.html b/docs/modules/_types_tinlake_.html index da6a3b1..f4ee725 100644 --- a/docs/modules/_types_tinlake_.html +++ b/docs/modules/_types_tinlake_.html @@ -87,7 +87,7 @@

    ITinlake

    @@ -97,7 +97,7 @@

    Investor

    Investor: { address: string; junior: { maxRedeem: BN; maxSupply: BN; tokenBalance: BN }; senior: { maxRedeem?: BN; maxSupply?: BN; tokenBalance?: BN } }
    @@ -143,7 +143,7 @@

    Loan

    Loan: { debt: BN; interestRate: BN; loanId: string; nft?: NFT; ownerOf: BN; price?: BN; principal: BN; proxyOwner?: undefined | string; registry: string; status?: undefined | string; threshold?: BN; tokenId: BN }
    @@ -194,7 +194,7 @@

    NFT

    NFT: { nftData: any; nftOwner: string; registry: string; tokenId: BN }
    @@ -221,7 +221,7 @@

    Tranche

    Tranche: { availableFunds: BN; interestRate?: BN; token: string; tokenPrice: BN; totalSupply: BN; type: string }
    diff --git a/docs/modules/_utils_basetodisplay_.html b/docs/modules/_utils_basetodisplay_.html index 6d8fc74..3c6d165 100644 --- a/docs/modules/_utils_basetodisplay_.html +++ b/docs/modules/_utils_basetodisplay_.html @@ -87,7 +87,7 @@

    Const baseToDisplay

  • Parameters

    diff --git a/docs/modules/_utils_bntohex_.html b/docs/modules/_utils_bntohex_.html index a855987..88e1534 100644 --- a/docs/modules/_utils_bntohex_.html +++ b/docs/modules/_utils_bntohex_.html @@ -87,7 +87,7 @@

    Const bnToHex

  • Parameters

    diff --git a/docs/modules/_utils_displaytobase_.html b/docs/modules/_utils_displaytobase_.html index a7feb0e..cd35f5a 100644 --- a/docs/modules/_utils_displaytobase_.html +++ b/docs/modules/_utils_displaytobase_.html @@ -87,7 +87,7 @@

    Const displayToBase

  • Parameters

    diff --git a/docs/modules/_utils_feetointerestrate_.html b/docs/modules/_utils_feetointerestrate_.html index 17a4447..aca8206 100644 --- a/docs/modules/_utils_feetointerestrate_.html +++ b/docs/modules/_utils_feetointerestrate_.html @@ -87,7 +87,7 @@

    Const feeToInterestRate
  • diff --git a/docs/modules/_utils_getloanstatus_.html b/docs/modules/_utils_getloanstatus_.html index 19809d5..cbc8208 100644 --- a/docs/modules/_utils_getloanstatus_.html +++ b/docs/modules/_utils_getloanstatus_.html @@ -89,7 +89,7 @@

    LoanStatus

    LoanStatus: "Whitelisted" | "Ongoing" | "Repaid"
    @@ -106,7 +106,7 @@

    getLoanStatus

  • Parameters

    diff --git a/docs/modules/_utils_interestratetofee_.html b/docs/modules/_utils_interestratetofee_.html index 93a5fa5..4b09326 100644 --- a/docs/modules/_utils_interestratetofee_.html +++ b/docs/modules/_utils_interestratetofee_.html @@ -87,7 +87,7 @@

    Const interestRateToFee
  • diff --git a/src/Tinlake.ts b/src/Tinlake.ts index 8b44a10..8503d4d 100644 --- a/src/Tinlake.ts +++ b/src/Tinlake.ts @@ -118,16 +118,19 @@ export default class Tinlake { this.contractConfig = contractConfig || {} this.contractAddresses = contractAddresses || {} this.transactionTimeout = transactionTimeout - this.setProvider(provider, ethOptions) + this.setProvider(provider, ethOptions, ethersConfig) this.setEthConfig(ethConfig || {}) this.setEthersConfig(ethersConfig) } - setProvider = (provider: any, ethOptions?: any) => { + setProvider = (provider: any, ethOptions?: any, ethersConfig?: EthersConfig) => { this.provider = provider this.ethOptions = ethOptions || {} this.eth = new Eth(this.provider, this.ethOptions) as ethI + console.log('set provider', ethersConfig) + if (ethersConfig) this.ethersConfig = ethersConfig + this.setContracts() } @@ -147,22 +150,18 @@ export default class Tinlake { ? this.createEthContract(this.contractAddresses['JUNIOR_OPERATOR'], this.contractConfig['JUNIOR_OPERATOR']) : this.createEthContract(this.contractAddresses['JUNIOR_OPERATOR'], 'ALLOWANCE_OPERATOR') - if (this.ethersConfig) { - this.ethersContracts['JUNIOR_OPERATOR'] = this.contractConfig['JUNIOR_OPERATOR'] - ? this.createContract(this.contractAddresses['JUNIOR_OPERATOR'], this.contractConfig['JUNIOR_OPERATOR']) - : this.createContract(this.contractAddresses['JUNIOR_OPERATOR'], 'ALLOWANCE_OPERATOR') - } + this.ethersContracts['JUNIOR_OPERATOR'] = this.contractConfig['JUNIOR_OPERATOR'] + ? this.createContract(this.contractAddresses['JUNIOR_OPERATOR'], this.contractConfig['JUNIOR_OPERATOR']) + : this.createContract(this.contractAddresses['JUNIOR_OPERATOR'], 'ALLOWANCE_OPERATOR') } if (this.contractAddresses['SENIOR_OPERATOR']) { this.contracts['SENIOR_OPERATOR'] = this.contractConfig['SENIOR_OPERATOR'] ? this.createEthContract(this.contractAddresses['SENIOR_OPERATOR'], this.contractConfig['SENIOR_OPERATOR']) : this.createEthContract(this.contractAddresses['SENIOR_OPERATOR'], 'ALLOWANCE_OPERATOR') - if (this.ethersConfig) { - this.ethersContracts['SENIOR_OPERATOR'] = this.contractConfig['SENIOR_OPERATOR'] - ? this.createContract(this.contractAddresses['SENIOR_OPERATOR'], this.contractConfig['SENIOR_OPERATOR']) - : this.createContract(this.contractAddresses['SENIOR_OPERATOR'], 'ALLOWANCE_OPERATOR') - } + this.ethersContracts['SENIOR_OPERATOR'] = this.contractConfig['SENIOR_OPERATOR'] + ? this.createContract(this.contractAddresses['SENIOR_OPERATOR'], this.contractConfig['SENIOR_OPERATOR']) + : this.createContract(this.contractAddresses['SENIOR_OPERATOR'], 'ALLOWANCE_OPERATOR') } } @@ -190,6 +189,7 @@ export default class Tinlake { } contract(abiName: ContractName, address?: string): ethers.Contract { + console.log(`Looking up contract ${abiName}`, this.ethersContracts) if (address) { return new ethers.Contract(address, this.contractAbis[abiName], this.ethersConfig.signer) } if (this.ethersConfig.signer) { diff --git a/src/actions/admin.ts b/src/actions/admin.ts index 59f0929..ca0600a 100644 --- a/src/actions/admin.ts +++ b/src/actions/admin.ts @@ -1,5 +1,5 @@ import { ContractName, Constructor, TinlakeParams, PendingTransaction } from '../Tinlake' -import { waitAndReturnEvents, executeAndRetry, ZERO_ADDRESS } from '../services/ethereum' +import { ZERO_ADDRESS } from '../services/ethereum' import BN from 'bn.js' const web3 = require('web3-utils') @@ -7,85 +7,57 @@ export function AdminActions>(Bas return class extends Base implements IAdminActions { canQueryPermissions = () => { return ( - !!this.contracts['PILE']?.wards && - !!this.contracts['SENIOR']?.wards && - !!this.contracts['PRICE_POOL']?.wards && - !!this.contracts['ASSESSOR']?.wards && - !!this.contracts['JUNIOR_OPERATOR']?.wards && - !!this.contracts['SENIOR_OPERATOR']?.wards && - !!this.contracts['COLLECTOR']?.wards + !!this.contract('PILE')?.wards && + !!this.contract('SENIOR')?.wards && + !!this.contract('PRICE_POOL')?.wards && + !!this.contract('ASSESSOR')?.wards && + !!this.contract('JUNIOR_OPERATOR')?.wards && + !!this.contract('SENIOR_OPERATOR')?.wards && + !!this.contract('COLLECTOR')?.wards ) } isWard = async (user: string, contractName: ContractName) => { - if (!this.contracts[contractName]?.wards) { - return new BN(0) - } - const res: { 0: BN } = await executeAndRetry(this.contracts[contractName].wards, [user]) - return res[0] + if (!this.contract(contractName)?.wards) return new BN(0) + return (await this.contract(contractName).wards(user)).toBN() } canSetInterestRate = async (user: string) => { - if (!this.contracts['PILE']?.wards) { - return false - } - const res: { 0: BN } = await executeAndRetry(this.contracts['PILE'].wards, [user]) - return res[0].toNumber() === 1 + if (!this.contract('PILE')?.wards) return false + return (await this.contract('PILE').wards(user)).toBN().toNumber() === 1 } canSetSeniorTrancheInterest = async (user: string) => { - if (this.contractAddresses['SENIOR'] !== ZERO_ADDRESS) { - if (!this.contracts['SENIOR']?.wards) { - return false - } - const res: { 0: BN } = await executeAndRetry(this.contracts['SENIOR'].wards, [user]) - return res[0].toNumber() === 1 - } - return false + if (!(this.contractAddresses['SENIOR'] !== ZERO_ADDRESS)) return false + if (!this.contract('SENIOR')?.wards) return false + return (await this.contract('SENIOR').wards(user)).toBN().toNumber() === 1 } canSetRiskScore = async (user: string) => { - if (!this.contracts['PRICE_POOL']?.wards) { - return false - } - const res: { 0: BN } = await executeAndRetry(this.contracts['PRICE_POOL'].wards, [user]) - return res[0].toNumber() === 1 + if (!this.contract('PRICE_POOL')?.wards) return false + return (await this.contract('PRICE_POOL').wards(user)).toBN().toNumber() === 1 } // lender permissions (note: allowance operator for default deployment) canSetMinimumJuniorRatio = async (user: string) => { - if (!this.contracts['ASSESSOR']?.wards) { - return false - } - const res: { 0: BN } = await executeAndRetry(this.contracts['ASSESSOR'].wards, [user]) - return res[0].toNumber() === 1 + if (!this.contract('ASSESSOR')?.wards) return false + return (await this.contract('ASSESSOR').wards(user)).toBN().toNumber() === 1 } canSetInvestorAllowanceJunior = async (user: string) => { - if (!this.contracts['JUNIOR_OPERATOR']?.wards) { - return false - } - const res: { 0: BN } = await executeAndRetry(this.contracts['JUNIOR_OPERATOR'].wards, [user]) - return res[0].toNumber() === 1 + if (!this.contract('JUNIOR_OPERATOR')?.wards) return false + return (await this.contract('JUNIOR_OPERATOR').wards(user)).toBN().toNumber() === 1 } canSetInvestorAllowanceSenior = async (user: string) => { - if (!this.contracts['SENIOR_OPERATOR']?.wards) { - return false - } - if (this.contractAddresses['SENIOR_OPERATOR'] !== ZERO_ADDRESS) { - const res: { 0: BN } = await executeAndRetry(this.contracts['SENIOR_OPERATOR'].wards, [user]) - return res[0].toNumber() === 1 - } - return false + if (!this.contract('SENIOR_OPERATOR')?.wards) return false + if (!(this.contractAddresses['SENIOR_OPERATOR'] !== ZERO_ADDRESS)) return false + return (await this.contract('SENIOR_OPERATOR').wards(user)).toBN().toNumber() === 1 } canSetLoanPrice = async (user: string) => { - if (!this.contracts['COLLECTOR']?.wards) { - return false - } - const res: { 0: BN } = await executeAndRetry(this.contracts['COLLECTOR'].wards, [user]) - return res[0].toNumber() === 1 + if (!this.contract('COLLECTOR')?.wards) return false + return (await this.contract('COLLECTOR').wards(user)).toBN().toNumber() === 1 } // ------------ admin functions borrower-site ------------- @@ -97,49 +69,36 @@ export function AdminActions>(Bas initRate = async (ratePerSecond: string) => { const rateGroup = getRateGroup(ratePerSecond) - const txHash = await executeAndRetry(this.contracts['PILE'].file, [ - web3.fromAscii('rate'), - rateGroup, - ratePerSecond, - this.ethConfig, - ]) - console.log(`[Initialising rate] txHash: ${txHash}`) - return waitAndReturnEvents(this.eth, txHash, this.contracts['PILE'].abi, this.transactionTimeout) + // Source: https://github.com/ethereum/web3.js/issues/2256#issuecomment-462730550 + return this.pending(this.contract('PILE').file(web3.fromAscii('rate').padEnd(66, '0'), rateGroup, ratePerSecond)) } changeRate = async (loan: string, ratePerSecond: string) => { const rateGroup = getRateGroup(ratePerSecond) - const txHash = await executeAndRetry(this.contracts['PILE'].changeRate, [loan, rateGroup, this.ethConfig]) - console.log(`[Initialising rate] txHash: ${txHash}`) - return waitAndReturnEvents(this.eth, txHash, this.contracts['PILE'].abi, this.transactionTimeout) + return this.pending(this.contract('PILE').changeRate(loan, rateGroup)) } setRate = async (loan: string, ratePerSecond: string) => { const rateGroup = getRateGroup(ratePerSecond) - const txHash = await executeAndRetry(this.contracts['PILE'].setRate, [loan, rateGroup, this.ethConfig]) - console.log(`[Setting rate] txHash: ${txHash}`) - return waitAndReturnEvents(this.eth, txHash, this.contracts['PILE'].abi, this.transactionTimeout) + return this.pending(this.contract('PILE').setRatet(loan, rateGroup)) } // ------------ admin functions lender-site ------------- setMinimumJuniorRatio = async (ratio: string) => { - const assessor = this.contract('ASSESSOR') // Source: https://github.com/ethereum/web3.js/issues/2256#issuecomment-462730550 - return this.pending(assessor.file(web3.fromAscii('minJuniorRatio').padEnd(66, '0'), ratio)) + return this.pending(this.contract('ASSESSOR').file(web3.fromAscii('minJuniorRatio').padEnd(66, '0'), ratio)) } approveAllowanceJunior = async (user: string, maxCurrency: string, maxToken: string) => { - const juniorOperator = this.contract('JUNIOR_OPERATOR') - return this.pending(juniorOperator.approve(user, maxCurrency, maxToken)) + return this.pending(this.contract('JUNIOR_OPERATOR').approve(user, maxCurrency, maxToken)) } approveAllowanceSenior = async (user: string, maxCurrency: string, maxToken: string) => { - const seniorOperator = this.contract('SENIOR_OPERATOR') - - if (this.getOperatorType('senior') === 'PROPERTIONAL_OPERATOR') { - return this.pending(seniorOperator.approve(user, maxCurrency)) - } - return this.pending(seniorOperator.approve(user, maxCurrency, maxToken)) + if (this.getOperatorType('senior') === 'PROPORTIONAL_OPERATOR') { + return this.pending(this.contract('SENIOR_OPERATOR').approve(user, maxCurrency)) + } else { + return this.pending(this.contract('SENIOR_OPERATOR').approve(user, maxCurrency, maxToken)) + } } } @@ -159,11 +118,11 @@ export type IAdminActions = { canSetInvestorAllowanceJunior(user: string): Promise canSetInvestorAllowanceSenior(user: string): Promise canSetLoanPrice(user: string): Promise - initRate(rate: string): Promise - setRate(loan: string, rate: string): Promise + initRate(rate: string): Promise + setRate(loan: string, rate: string): Promise setMinimumJuniorRatio(amount: string): Promise - approveAllowanceJunior(user: string, maxCurrency: string, maxToken: string): Promise - approveAllowanceSenior(user: string, maxCurrency: string, maxToken: string): Promise + approveAllowanceJunior(user: string, maxCurrency: string, maxToken: string): Promise + approveAllowanceSenior(user: string, maxCurrency: string, maxToken: string): Promise } export default AdminActions diff --git a/src/actions/analytics.ts b/src/actions/analytics.ts index 83d7daa..8672fd9 100644 --- a/src/actions/analytics.ts +++ b/src/actions/analytics.ts @@ -136,11 +136,11 @@ export function AnalyticsActions> } getMaxSupplyAmountJunior = async (user: string) => { - return (await this.contract('JUNIOR_TOKEN').maxCurrency(user)).toBN() + return (await this.contract('JUNIOR_OPERATOR').maxCurrency(user)).toBN() } getMaxRedeemAmountJunior = async (user: string) => { - return (await this.contract('JUNIOR_TOKEN').maxToken(user)).toBN() + return (await this.contract('JUNIOR_OPERATOR').maxToken(user)).toBN() } getTokenPriceJunior = async () => { From f64a9cf9924b56cca471cada5097c0b232ddd931 Mon Sep 17 00:00:00 2001 From: Jeroen Offerijns Date: Mon, 31 Aug 2020 10:44:35 +0200 Subject: [PATCH 15/65] chore: format --- docs/classes/_tinlake_.tinlake.html | 44 +++++++------- docs/interfaces/_services_ethereum_.ethi.html | 16 ++--- .../_services_ethereum_.events.html | 6 +- docs/modules/_actions_admin_.html | 30 +++++----- docs/modules/_actions_analytics_.html | 60 +++++++++---------- docs/modules/_actions_borrower_.html | 20 +++---- docs/modules/_actions_collateral_.html | 22 +++---- docs/modules/_actions_currency_.html | 10 ++-- docs/modules/_actions_governance_.html | 4 +- docs/modules/_actions_index_.html | 2 +- docs/modules/_actions_lender_.html | 18 +++--- docs/modules/_actions_proxy_.html | 30 +++++----- docs/modules/_services_ethereum_.html | 10 ++-- docs/modules/_tinlake_.html | 20 +++---- docs/modules/_types_tinlake_.html | 10 ++-- docs/modules/_utils_basetodisplay_.html | 2 +- docs/modules/_utils_bntohex_.html | 2 +- docs/modules/_utils_displaytobase_.html | 2 +- docs/modules/_utils_feetointerestrate_.html | 2 +- docs/modules/_utils_getloanstatus_.html | 4 +- docs/modules/_utils_interestratetofee_.html | 2 +- src/actions/admin.ts | 4 +- 22 files changed, 160 insertions(+), 160 deletions(-) diff --git a/docs/classes/_tinlake_.tinlake.html b/docs/classes/_tinlake_.tinlake.html index f8e4eb4..a4a3075 100644 --- a/docs/classes/_tinlake_.tinlake.html +++ b/docs/classes/_tinlake_.tinlake.html @@ -129,7 +129,7 @@

    constructor

  • Parameters

    @@ -151,7 +151,7 @@

    contractAbis

    contractAbis: ContractAbis
    @@ -161,7 +161,7 @@

    contractAddresses

    contractAddresses: ContractAddresses
    @@ -171,7 +171,7 @@

    contractConfig

    contractConfig: any
    @@ -181,7 +181,7 @@

    contracts

    contracts: Contracts
    @@ -191,7 +191,7 @@

    eth

    eth: ethI
    @@ -201,7 +201,7 @@

    ethConfig

    ethConfig: EthConfig
    @@ -211,7 +211,7 @@

    ethOptions

    ethOptions: any
    @@ -221,7 +221,7 @@

    ethersConfig

    ethersConfig: EthersConfig
    @@ -231,7 +231,7 @@

    ethersContracts

    ethersContracts: Contracts
    @@ -241,7 +241,7 @@

    provider

    provider: any
    @@ -251,7 +251,7 @@

    transactionTimeout

    transactionTimeout: number
    @@ -268,7 +268,7 @@

    contract

  • Parameters

    @@ -294,7 +294,7 @@

    createContract

  • Parameters

    @@ -320,7 +320,7 @@

    createEthContract

  • Parameters

    @@ -346,7 +346,7 @@

    getOperatorType

  • Parameters

    @@ -369,7 +369,7 @@

    getTransactionReceipt

  • Parameters

    @@ -392,7 +392,7 @@

    pending

  • Parameters

    @@ -415,7 +415,7 @@

    setContracts

  • Returns void

    @@ -432,7 +432,7 @@

    setEthConfig

  • Parameters

    @@ -455,7 +455,7 @@

    setEthersConfig

  • Parameters

    @@ -478,7 +478,7 @@

    setProvider

  • Parameters

    diff --git a/docs/interfaces/_services_ethereum_.ethi.html b/docs/interfaces/_services_ethereum_.ethi.html index 2e80762..76af2b6 100644 --- a/docs/interfaces/_services_ethereum_.ethi.html +++ b/docs/interfaces/_services_ethereum_.ethi.html @@ -101,7 +101,7 @@

    abi

    abi: any
    @@ -111,7 +111,7 @@

    contract

    contract: (arg0: any) => { at: (arg0: any) => void }
    @@ -165,7 +165,7 @@

    getTransactionByHash

    getTransactionByHash: (arg0: any, arg1: (err: any, tx: any) => void) => void
    @@ -220,7 +220,7 @@

    getTransactionCount

    getTransactionCount: any
    @@ -230,7 +230,7 @@

    getTransactionReceipt

    getTransactionReceipt: (arg0: any, arg1: (err: any, receipt: any) => void) => void
    @@ -285,7 +285,7 @@

    send

    send: Function
    @@ -295,7 +295,7 @@

    sendRawTransaction

    sendRawTransaction: any
    @@ -305,7 +305,7 @@

    web3_sha3

    web3_sha3: (signature: string) => string
    diff --git a/docs/interfaces/_services_ethereum_.events.html b/docs/interfaces/_services_ethereum_.events.html index fd077c0..eab4a3c 100644 --- a/docs/interfaces/_services_ethereum_.events.html +++ b/docs/interfaces/_services_ethereum_.events.html @@ -96,7 +96,7 @@

    events

    events: { data: any[]; event: { name: any } }[]
    @@ -106,7 +106,7 @@

    status

    status: any
    @@ -116,7 +116,7 @@

    txHash

    txHash: string
    diff --git a/docs/modules/_actions_admin_.html b/docs/modules/_actions_admin_.html index 4f64aa7..09e1482 100644 --- a/docs/modules/_actions_admin_.html +++ b/docs/modules/_actions_admin_.html @@ -89,7 +89,7 @@

    IAdminActions

    IAdminActions: { approveAllowanceJunior: any; approveAllowanceSenior: any; canSetInterestRate: any; canSetInvestorAllowanceJunior: any; canSetInvestorAllowanceSenior: any; canSetLoanPrice: any; canSetMinimumJuniorRatio: any; canSetRiskScore: any; canSetSeniorTrancheInterest: any; initRate: any; isWard: any; setMinimumJuniorRatio: any; setRate: any }
    @@ -104,7 +104,7 @@
    approveAllowanceJunior:
  • Parameters

    @@ -132,7 +132,7 @@
    approveAllowanceSenior:
  • Parameters

    @@ -160,7 +160,7 @@
    canSetInterestRate:

    Parameters

    @@ -182,7 +182,7 @@
    canSetInvestorAllowanceJunior

    Parameters

    @@ -204,7 +204,7 @@
    canSetInvestorAllowanceSenior

    Parameters

    @@ -226,7 +226,7 @@
    canSetLoanPrice: fu
  • Parameters

    @@ -248,7 +248,7 @@
    canSetMinimumJuniorRatio

    Parameters

    @@ -270,7 +270,7 @@
    canSetRiskScore: fu
  • Parameters

    @@ -292,7 +292,7 @@
    canSetSeniorTrancheInterest

    Parameters

    @@ -314,7 +314,7 @@
    initRate: function
  • Parameters

    @@ -336,7 +336,7 @@
    isWard: function
  • Parameters

    @@ -361,7 +361,7 @@
    setMinimumJuniorRatio:

    Parameters

    @@ -383,7 +383,7 @@
    setRate: function
  • Parameters

    @@ -415,7 +415,7 @@

    AdminActions

  • Type parameters

    diff --git a/docs/modules/_actions_analytics_.html b/docs/modules/_actions_analytics_.html index 403c882..ae99cdf 100644 --- a/docs/modules/_actions_analytics_.html +++ b/docs/modules/_actions_analytics_.html @@ -89,7 +89,7 @@

    IAnalyticsActions

    IAnalyticsActions: { existsSenior: any; getAssetValueJunior: any; getCollateral: any; getCurrentJuniorRatio: any; getDebt: any; getInterestRate: any; getInvestor: any; getJuniorReserve: any; getJuniorTokenBalance: any; getLoan: any; getLoanList: any; getMaxRedeemAmountJunior: any; getMaxRedeemAmountSenior: any; getMaxSupplyAmountJunior: any; getMaxSupplyAmountSenior: any; getMinJuniorRatio: any; getOwnerOfCollateral: any; getOwnerOfLoan: any; getPrincipal: any; getSeniorDebt: any; getSeniorInterestRate: any; getSeniorReserve: any; getSeniorTokenBalance: any; getTokenPriceJunior: any; getTokenPriceSenior: any; getTotalBalance: any; getTotalDebt: any; loanCount: any }
    @@ -104,7 +104,7 @@
    existsSenior: function
  • Returns boolean

    @@ -120,7 +120,7 @@
    getAssetValueJunior:

    Returns Promise<BN>

    @@ -136,7 +136,7 @@
    getCollateral: function
  • Parameters

    @@ -158,7 +158,7 @@
    getCurrentJuniorRatio:

    Returns Promise<BN>

    @@ -174,7 +174,7 @@
    getDebt: function
  • Parameters

    @@ -196,7 +196,7 @@
    getInterestRate: functio
  • Parameters

    @@ -218,7 +218,7 @@
    getInvestor: function
  • Parameters

    @@ -240,7 +240,7 @@
    getJuniorReserve: functi
  • Returns Promise<BN>

    @@ -256,7 +256,7 @@
    getJuniorTokenBalance:

    Parameters

    @@ -278,7 +278,7 @@
    getLoan: function
  • Parameters

    @@ -300,7 +300,7 @@
    getLoanList: function

    Returns Promise<Loan[]>

    @@ -316,7 +316,7 @@
    getMaxRedeemAmountJunior

    Parameters

    @@ -338,7 +338,7 @@
    getMaxRedeemAmountSenior

    Parameters

    @@ -360,7 +360,7 @@
    getMaxSupplyAmountJunior

    Parameters

    @@ -382,7 +382,7 @@
    getMaxSupplyAmountSenior

    Parameters

    @@ -404,7 +404,7 @@
    getMinJuniorRatio:
  • Returns Promise<BN>

    @@ -420,7 +420,7 @@
    getOwnerOfCollateral: fu
  • Parameters

    @@ -448,7 +448,7 @@
    getOwnerOfLoan: function
  • Parameters

    @@ -470,7 +470,7 @@
    getPrincipal: function
  • Parameters

    @@ -492,7 +492,7 @@
    getSeniorDebt: function<
  • Returns Promise<BN>

    @@ -508,7 +508,7 @@
    getSeniorInterestRate:

    Returns Promise<BN>

    @@ -524,7 +524,7 @@
    getSeniorReserve: functi
  • Returns Promise<BN>

    @@ -540,7 +540,7 @@
    getSeniorTokenBalance:

    Parameters

    @@ -562,7 +562,7 @@
    getTokenPriceJunior:

    Returns Promise<BN>

    @@ -578,7 +578,7 @@
    getTokenPriceSenior:

    Parameters

    @@ -600,7 +600,7 @@
    getTotalBalance: functio
  • Returns Promise<BN>

    @@ -616,7 +616,7 @@
    getTotalDebt: function

    Returns Promise<BN>

    @@ -632,7 +632,7 @@
    loanCount: function
  • Returns Promise<BN>

    @@ -655,7 +655,7 @@

    AnalyticsActions

  • Type parameters

    diff --git a/docs/modules/_actions_borrower_.html b/docs/modules/_actions_borrower_.html index 902562b..8779a83 100644 --- a/docs/modules/_actions_borrower_.html +++ b/docs/modules/_actions_borrower_.html @@ -89,7 +89,7 @@

    IBorrowerActions

    IBorrowerActions: { borrow: any; close: any; issue: any; lock: any; nftLookup: any; repay: any; unlock: any; withdraw: any }
    @@ -104,7 +104,7 @@
    borrow: function
  • Parameters

    @@ -129,7 +129,7 @@
    close: function
  • Parameters

    @@ -151,7 +151,7 @@
    issue: function
  • Parameters

    @@ -176,7 +176,7 @@
    lock: function
  • Parameters

    @@ -198,7 +198,7 @@
    nftLookup: function
  • Parameters

    @@ -223,7 +223,7 @@
    repay: function
  • Parameters

    @@ -248,7 +248,7 @@
    unlock: function
  • Parameters

    @@ -270,7 +270,7 @@
    withdraw: function
  • Parameters

    @@ -305,7 +305,7 @@

    BorrowerActions

  • Type parameters

    diff --git a/docs/modules/_actions_collateral_.html b/docs/modules/_actions_collateral_.html index 12db831..486a80d 100644 --- a/docs/modules/_actions_collateral_.html +++ b/docs/modules/_actions_collateral_.html @@ -89,7 +89,7 @@

    ICollateralActions

    ICollateralActions: { approveNFT: any; getNFTCount: any; getNFTData: any; getNFTOwner: any; isNFTApprovedForAll: any; mintNFT: any; mintTitleNFT: any; setNFTApprovalForAll: any; transferNFT: any }
    @@ -104,7 +104,7 @@
    approveNFT: function
  • Parameters

    @@ -132,7 +132,7 @@
    getNFTCount: function
  • Parameters

    @@ -154,7 +154,7 @@
    getNFTData: function
  • Parameters

    @@ -179,7 +179,7 @@
    getNFTOwner: function
  • Parameters

    @@ -204,7 +204,7 @@
    isNFTApprovedForAll: fun
  • Parameters

    @@ -232,7 +232,7 @@
    mintNFT: function
  • Parameters

    @@ -269,7 +269,7 @@
    mintTitleNFT: function
  • Parameters

    @@ -294,7 +294,7 @@
    setNFTApprovalForAll: fu
  • Parameters

    @@ -322,7 +322,7 @@
    transferNFT: function
  • Parameters

    @@ -360,7 +360,7 @@

    CollateralActions

  • Type parameters

    diff --git a/docs/modules/_actions_currency_.html b/docs/modules/_actions_currency_.html index 3188a44..3f8bb7c 100644 --- a/docs/modules/_actions_currency_.html +++ b/docs/modules/_actions_currency_.html @@ -89,7 +89,7 @@

    ICurrencyActions

    ICurrencyActions: { approveJuniorForCurrency: (currencyAmount: string) => Promise<PendingTransaction | undefined>; approveSeniorForCurrency: (currencyAmount: string) => Promise<PendingTransaction | undefined>; getCurrencyAllowance: (owner: string, spender: string) => Promise<BN>; getJuniorForCurrencyAllowance: (owner: string) => Promise<BN | undefined>; getSeniorForCurrencyAllowance: (owner: string) => Promise<BN | undefined>; approveCurrency: any; getCurrencyBalance: any; mintCurrency: any }
    @@ -212,7 +212,7 @@
    approveCurrency: function

    Parameters

    @@ -237,7 +237,7 @@
    getCurrencyBalance: func
  • Parameters

    @@ -259,7 +259,7 @@
    mintCurrency: function
  • Parameters

    @@ -291,7 +291,7 @@

    CurrencyActions

  • Type parameters

    diff --git a/docs/modules/_actions_governance_.html b/docs/modules/_actions_governance_.html index 9f63e92..709cf5f 100644 --- a/docs/modules/_actions_governance_.html +++ b/docs/modules/_actions_governance_.html @@ -83,7 +83,7 @@

    IGovernanceActions

    IGovernanceActions: { relyAddress: any }
    @@ -98,7 +98,7 @@
    relyAddress: function
  • Parameters

    diff --git a/docs/modules/_actions_index_.html b/docs/modules/_actions_index_.html index 4b3650d..c3a57a6 100644 --- a/docs/modules/_actions_index_.html +++ b/docs/modules/_actions_index_.html @@ -83,7 +83,7 @@

    TinlakeActions

    diff --git a/docs/modules/_actions_lender_.html b/docs/modules/_actions_lender_.html index 80ac288..fa227ad 100644 --- a/docs/modules/_actions_lender_.html +++ b/docs/modules/_actions_lender_.html @@ -89,7 +89,7 @@

    ILenderActions

    ILenderActions: { approveJuniorToken: (tokenAmount: string) => Promise<unknown>; approveSeniorToken: (tokenAmount: string) => Promise<unknown>; balance: any; getJuniorTokenAllowance: any; getSeniorTokenAllowance: any; redeemJunior: any; redeemSenior: any; supplyJunior: any; supplySenior: any }
    @@ -146,7 +146,7 @@
    balance: function
  • Returns Promise<any>

    @@ -162,7 +162,7 @@
    getJuniorTokenAllowance: <
  • Parameters

    @@ -184,7 +184,7 @@
    getSeniorTokenAllowance: <
  • Parameters

    @@ -206,7 +206,7 @@
    redeemJunior: function
  • Parameters

    @@ -228,7 +228,7 @@
    redeemSenior: function
  • Parameters

    @@ -250,7 +250,7 @@
    supplyJunior: function
  • Parameters

    @@ -272,7 +272,7 @@
    supplySenior: function
  • Parameters

    @@ -301,7 +301,7 @@

    LenderActions

  • Type parameters

    diff --git a/docs/modules/_actions_proxy_.html b/docs/modules/_actions_proxy_.html index 79b99c1..17f34d6 100644 --- a/docs/modules/_actions_proxy_.html +++ b/docs/modules/_actions_proxy_.html @@ -89,7 +89,7 @@

    IProxyActions

    IProxyActions: { buildProxy: any; checkProxyExists: any; getProxy: any; getProxyAccessToken: any; getProxyAccessTokenOwner: any; getProxyOwnerByAddress: any; getProxyOwnerByLoan: any; proxyCount: any; proxyCreateNew: any; proxyIssue: any; proxyLockBorrowWithdraw: any; proxyRepayUnlockClose: any; proxyTransferIssue: any }
    @@ -104,7 +104,7 @@
    buildProxy: function
  • Parameters

    @@ -126,7 +126,7 @@
    checkProxyExists: functi
  • Parameters

    @@ -148,7 +148,7 @@
    getProxy: function
  • Parameters

    @@ -170,7 +170,7 @@
    getProxyAccessToken:

    Parameters

    @@ -192,7 +192,7 @@
    getProxyAccessTokenOwner

    Parameters

    @@ -214,7 +214,7 @@
    getProxyOwnerByAddress:

    Parameters

    @@ -236,7 +236,7 @@
    getProxyOwnerByLoan:

    Parameters

    @@ -258,7 +258,7 @@
    proxyCount: function
  • Returns Promise<any>

    @@ -274,7 +274,7 @@
    proxyCreateNew: function
  • Parameters

    @@ -296,7 +296,7 @@
    proxyIssue: function
  • Parameters

    @@ -324,7 +324,7 @@
    proxyLockBorrowWithdraw: <
  • Parameters

    @@ -355,7 +355,7 @@
    proxyRepayUnlockClose:

    Parameters

    @@ -386,7 +386,7 @@
    proxyTransferIssue: func
  • Parameters

    @@ -421,7 +421,7 @@

    ProxyActions

  • Type parameters

    diff --git a/docs/modules/_services_ethereum_.html b/docs/modules/_services_ethereum_.html index e368262..50da29b 100644 --- a/docs/modules/_services_ethereum_.html +++ b/docs/modules/_services_ethereum_.html @@ -99,7 +99,7 @@

    Const ZERO_ADDRESS

    ZERO_ADDRESS: "0x0000000000000000000000000000000000000000" = "0x0000000000000000000000000000000000000000"
    @@ -116,7 +116,7 @@

    executeAndRetry

  • Parameters

    @@ -142,7 +142,7 @@

    Const findEvent

  • Parameters

    @@ -209,7 +209,7 @@

    Const waitAndReturn

    Parameters

    @@ -241,7 +241,7 @@

    Const waitForTransactio
  • Parameters

    diff --git a/docs/modules/_tinlake_.html b/docs/modules/_tinlake_.html index 80a38ec..bc33f3e 100644 --- a/docs/modules/_tinlake_.html +++ b/docs/modules/_tinlake_.html @@ -98,7 +98,7 @@

    Constructor

    Constructor<T>: {}

    Type parameters

    @@ -119,7 +119,7 @@

    ContractAbis

    ContractAbis: {}
    @@ -134,7 +134,7 @@

    ContractAddresses

    ContractAddresses: {}
    @@ -149,7 +149,7 @@

    ContractName

    ContractName: typeof contractNames[number]
    @@ -159,7 +159,7 @@

    Contracts

    Contracts: {}
    @@ -174,7 +174,7 @@

    EthConfig

    EthConfig: { from?: undefined | string; gas?: undefined | string; gasPrice?: undefined | string }
    @@ -198,7 +198,7 @@

    EthersConfig

    EthersConfig: { overrides?: EthersOverrides; provider: Provider; signer: Signer }
    @@ -222,7 +222,7 @@

    EthersOverrides

    EthersOverrides: { gasLimit?: undefined | number; gasPrice?: undefined | number }
    @@ -243,7 +243,7 @@

    PendingTransaction

    PendingTransaction: { hash: string | undefined; timesOutAt?: undefined | number }
    @@ -264,7 +264,7 @@

    TinlakeParams

    TinlakeParams: { contractAbis?: ContractAbis | {}; contractAddresses?: ContractAddresses | {}; contractConfig?: any | {}; contracts?: Contracts | {}; ethConfig?: EthConfig; ethOptions?: any | {}; ethersConfig?: EthersConfig; provider: any; transactionTimeout: number }
    diff --git a/docs/modules/_types_tinlake_.html b/docs/modules/_types_tinlake_.html index f4ee725..519060c 100644 --- a/docs/modules/_types_tinlake_.html +++ b/docs/modules/_types_tinlake_.html @@ -87,7 +87,7 @@

    ITinlake

    @@ -97,7 +97,7 @@

    Investor

    Investor: { address: string; junior: { maxRedeem: BN; maxSupply: BN; tokenBalance: BN }; senior: { maxRedeem?: BN; maxSupply?: BN; tokenBalance?: BN } }
    @@ -143,7 +143,7 @@

    Loan

    Loan: { debt: BN; interestRate: BN; loanId: string; nft?: NFT; ownerOf: BN; price?: BN; principal: BN; proxyOwner?: undefined | string; registry: string; status?: undefined | string; threshold?: BN; tokenId: BN }
    @@ -194,7 +194,7 @@

    NFT

    NFT: { nftData: any; nftOwner: string; registry: string; tokenId: BN }
    @@ -221,7 +221,7 @@

    Tranche

    Tranche: { availableFunds: BN; interestRate?: BN; token: string; tokenPrice: BN; totalSupply: BN; type: string }
    diff --git a/docs/modules/_utils_basetodisplay_.html b/docs/modules/_utils_basetodisplay_.html index 3c6d165..5f60ffb 100644 --- a/docs/modules/_utils_basetodisplay_.html +++ b/docs/modules/_utils_basetodisplay_.html @@ -87,7 +87,7 @@

    Const baseToDisplay

  • Parameters

    diff --git a/docs/modules/_utils_bntohex_.html b/docs/modules/_utils_bntohex_.html index 88e1534..715482e 100644 --- a/docs/modules/_utils_bntohex_.html +++ b/docs/modules/_utils_bntohex_.html @@ -87,7 +87,7 @@

    Const bnToHex

  • Parameters

    diff --git a/docs/modules/_utils_displaytobase_.html b/docs/modules/_utils_displaytobase_.html index cd35f5a..f39eb71 100644 --- a/docs/modules/_utils_displaytobase_.html +++ b/docs/modules/_utils_displaytobase_.html @@ -87,7 +87,7 @@

    Const displayToBase

  • Parameters

    diff --git a/docs/modules/_utils_feetointerestrate_.html b/docs/modules/_utils_feetointerestrate_.html index aca8206..21bb220 100644 --- a/docs/modules/_utils_feetointerestrate_.html +++ b/docs/modules/_utils_feetointerestrate_.html @@ -87,7 +87,7 @@

    Const feeToInterestRate
  • diff --git a/docs/modules/_utils_getloanstatus_.html b/docs/modules/_utils_getloanstatus_.html index cbc8208..0ee6fc7 100644 --- a/docs/modules/_utils_getloanstatus_.html +++ b/docs/modules/_utils_getloanstatus_.html @@ -89,7 +89,7 @@

    LoanStatus

    LoanStatus: "Whitelisted" | "Ongoing" | "Repaid"
    @@ -106,7 +106,7 @@

    getLoanStatus

  • Parameters

    diff --git a/docs/modules/_utils_interestratetofee_.html b/docs/modules/_utils_interestratetofee_.html index 4b09326..c70c894 100644 --- a/docs/modules/_utils_interestratetofee_.html +++ b/docs/modules/_utils_interestratetofee_.html @@ -87,7 +87,7 @@

    Const interestRateToFee
  • diff --git a/src/actions/admin.ts b/src/actions/admin.ts index ca0600a..71002cf 100644 --- a/src/actions/admin.ts +++ b/src/actions/admin.ts @@ -96,9 +96,9 @@ export function AdminActions>(Bas approveAllowanceSenior = async (user: string, maxCurrency: string, maxToken: string) => { if (this.getOperatorType('senior') === 'PROPORTIONAL_OPERATOR') { return this.pending(this.contract('SENIOR_OPERATOR').approve(user, maxCurrency)) - } else { + } return this.pending(this.contract('SENIOR_OPERATOR').approve(user, maxCurrency, maxToken)) - } + } } From 0ebce59e79c5c5de2ed88930e20aa5806bc3dbb9 Mon Sep 17 00:00:00 2001 From: Jeroen Offerijns Date: Mon, 31 Aug 2020 10:46:05 +0200 Subject: [PATCH 16/65] chore: update docs --- docs/classes/_tinlake_.tinlake.html | 44 +++++++------- docs/interfaces/_services_ethereum_.ethi.html | 16 ++--- .../_services_ethereum_.events.html | 6 +- docs/modules/_actions_admin_.html | 30 +++++----- docs/modules/_actions_analytics_.html | 60 +++++++++---------- docs/modules/_actions_borrower_.html | 20 +++---- docs/modules/_actions_collateral_.html | 22 +++---- docs/modules/_actions_currency_.html | 10 ++-- docs/modules/_actions_governance_.html | 4 +- docs/modules/_actions_index_.html | 2 +- docs/modules/_actions_lender_.html | 18 +++--- docs/modules/_actions_proxy_.html | 30 +++++----- docs/modules/_services_ethereum_.html | 10 ++-- docs/modules/_tinlake_.html | 20 +++---- docs/modules/_types_tinlake_.html | 10 ++-- docs/modules/_utils_basetodisplay_.html | 2 +- docs/modules/_utils_bntohex_.html | 2 +- docs/modules/_utils_displaytobase_.html | 2 +- docs/modules/_utils_feetointerestrate_.html | 2 +- docs/modules/_utils_getloanstatus_.html | 4 +- docs/modules/_utils_interestratetofee_.html | 2 +- 21 files changed, 158 insertions(+), 158 deletions(-) diff --git a/docs/classes/_tinlake_.tinlake.html b/docs/classes/_tinlake_.tinlake.html index a4a3075..55deeab 100644 --- a/docs/classes/_tinlake_.tinlake.html +++ b/docs/classes/_tinlake_.tinlake.html @@ -129,7 +129,7 @@

    constructor

  • Parameters

    @@ -151,7 +151,7 @@

    contractAbis

    contractAbis: ContractAbis
    @@ -161,7 +161,7 @@

    contractAddresses

    contractAddresses: ContractAddresses
    @@ -171,7 +171,7 @@

    contractConfig

    contractConfig: any
    @@ -181,7 +181,7 @@

    contracts

    contracts: Contracts
    @@ -191,7 +191,7 @@

    eth

    eth: ethI
    @@ -201,7 +201,7 @@

    ethConfig

    ethConfig: EthConfig
    @@ -211,7 +211,7 @@

    ethOptions

    ethOptions: any
    @@ -221,7 +221,7 @@

    ethersConfig

    ethersConfig: EthersConfig
    @@ -231,7 +231,7 @@

    ethersContracts

    ethersContracts: Contracts
    @@ -241,7 +241,7 @@

    provider

    provider: any
    @@ -251,7 +251,7 @@

    transactionTimeout

    transactionTimeout: number
    @@ -268,7 +268,7 @@

    contract

  • Parameters

    @@ -294,7 +294,7 @@

    createContract

  • Parameters

    @@ -320,7 +320,7 @@

    createEthContract

  • Parameters

    @@ -346,7 +346,7 @@

    getOperatorType

  • Parameters

    @@ -369,7 +369,7 @@

    getTransactionReceipt

  • Parameters

    @@ -392,7 +392,7 @@

    pending

  • Parameters

    @@ -415,7 +415,7 @@

    setContracts

  • Returns void

    @@ -432,7 +432,7 @@

    setEthConfig

  • Parameters

    @@ -455,7 +455,7 @@

    setEthersConfig

  • Parameters

    @@ -478,7 +478,7 @@

    setProvider

  • Parameters

    diff --git a/docs/interfaces/_services_ethereum_.ethi.html b/docs/interfaces/_services_ethereum_.ethi.html index 76af2b6..fa161b3 100644 --- a/docs/interfaces/_services_ethereum_.ethi.html +++ b/docs/interfaces/_services_ethereum_.ethi.html @@ -101,7 +101,7 @@

    abi

    abi: any
    @@ -111,7 +111,7 @@

    contract

    contract: (arg0: any) => { at: (arg0: any) => void }
    @@ -165,7 +165,7 @@

    getTransactionByHash

    getTransactionByHash: (arg0: any, arg1: (err: any, tx: any) => void) => void
    @@ -220,7 +220,7 @@

    getTransactionCount

    getTransactionCount: any
    @@ -230,7 +230,7 @@

    getTransactionReceipt

    getTransactionReceipt: (arg0: any, arg1: (err: any, receipt: any) => void) => void
    @@ -285,7 +285,7 @@

    send

    send: Function
    @@ -295,7 +295,7 @@

    sendRawTransaction

    sendRawTransaction: any
    @@ -305,7 +305,7 @@

    web3_sha3

    web3_sha3: (signature: string) => string
    diff --git a/docs/interfaces/_services_ethereum_.events.html b/docs/interfaces/_services_ethereum_.events.html index eab4a3c..096b73b 100644 --- a/docs/interfaces/_services_ethereum_.events.html +++ b/docs/interfaces/_services_ethereum_.events.html @@ -96,7 +96,7 @@

    events

    events: { data: any[]; event: { name: any } }[]
    @@ -106,7 +106,7 @@

    status

    status: any
    @@ -116,7 +116,7 @@

    txHash

    txHash: string
    diff --git a/docs/modules/_actions_admin_.html b/docs/modules/_actions_admin_.html index 09e1482..0c68aef 100644 --- a/docs/modules/_actions_admin_.html +++ b/docs/modules/_actions_admin_.html @@ -89,7 +89,7 @@

    IAdminActions

    IAdminActions: { approveAllowanceJunior: any; approveAllowanceSenior: any; canSetInterestRate: any; canSetInvestorAllowanceJunior: any; canSetInvestorAllowanceSenior: any; canSetLoanPrice: any; canSetMinimumJuniorRatio: any; canSetRiskScore: any; canSetSeniorTrancheInterest: any; initRate: any; isWard: any; setMinimumJuniorRatio: any; setRate: any }
    @@ -104,7 +104,7 @@
    approveAllowanceJunior:
  • Parameters

    @@ -132,7 +132,7 @@
    approveAllowanceSenior:
  • Parameters

    @@ -160,7 +160,7 @@
    canSetInterestRate:

    Parameters

    @@ -182,7 +182,7 @@
    canSetInvestorAllowanceJunior

    Parameters

    @@ -204,7 +204,7 @@
    canSetInvestorAllowanceSenior

    Parameters

    @@ -226,7 +226,7 @@
    canSetLoanPrice: fu
  • Parameters

    @@ -248,7 +248,7 @@
    canSetMinimumJuniorRatio

    Parameters

    @@ -270,7 +270,7 @@
    canSetRiskScore: fu
  • Parameters

    @@ -292,7 +292,7 @@
    canSetSeniorTrancheInterest

    Parameters

    @@ -314,7 +314,7 @@
    initRate: function
  • Parameters

    @@ -336,7 +336,7 @@
    isWard: function
  • Parameters

    @@ -361,7 +361,7 @@
    setMinimumJuniorRatio:

    Parameters

    @@ -383,7 +383,7 @@
    setRate: function
  • Parameters

    @@ -415,7 +415,7 @@

    AdminActions

  • Type parameters

    diff --git a/docs/modules/_actions_analytics_.html b/docs/modules/_actions_analytics_.html index ae99cdf..09c853d 100644 --- a/docs/modules/_actions_analytics_.html +++ b/docs/modules/_actions_analytics_.html @@ -89,7 +89,7 @@

    IAnalyticsActions

    IAnalyticsActions: { existsSenior: any; getAssetValueJunior: any; getCollateral: any; getCurrentJuniorRatio: any; getDebt: any; getInterestRate: any; getInvestor: any; getJuniorReserve: any; getJuniorTokenBalance: any; getLoan: any; getLoanList: any; getMaxRedeemAmountJunior: any; getMaxRedeemAmountSenior: any; getMaxSupplyAmountJunior: any; getMaxSupplyAmountSenior: any; getMinJuniorRatio: any; getOwnerOfCollateral: any; getOwnerOfLoan: any; getPrincipal: any; getSeniorDebt: any; getSeniorInterestRate: any; getSeniorReserve: any; getSeniorTokenBalance: any; getTokenPriceJunior: any; getTokenPriceSenior: any; getTotalBalance: any; getTotalDebt: any; loanCount: any }
    @@ -104,7 +104,7 @@
    existsSenior: function
  • Returns boolean

    @@ -120,7 +120,7 @@
    getAssetValueJunior:

    Returns Promise<BN>

    @@ -136,7 +136,7 @@
    getCollateral: function
  • Parameters

    @@ -158,7 +158,7 @@
    getCurrentJuniorRatio:

    Returns Promise<BN>

    @@ -174,7 +174,7 @@
    getDebt: function
  • Parameters

    @@ -196,7 +196,7 @@
    getInterestRate: functio
  • Parameters

    @@ -218,7 +218,7 @@
    getInvestor: function
  • Parameters

    @@ -240,7 +240,7 @@
    getJuniorReserve: functi
  • Returns Promise<BN>

    @@ -256,7 +256,7 @@
    getJuniorTokenBalance:

    Parameters

    @@ -278,7 +278,7 @@
    getLoan: function
  • Parameters

    @@ -300,7 +300,7 @@
    getLoanList: function

    Returns Promise<Loan[]>

    @@ -316,7 +316,7 @@
    getMaxRedeemAmountJunior

    Parameters

    @@ -338,7 +338,7 @@
    getMaxRedeemAmountSenior

    Parameters

    @@ -360,7 +360,7 @@
    getMaxSupplyAmountJunior

    Parameters

    @@ -382,7 +382,7 @@
    getMaxSupplyAmountSenior

    Parameters

    @@ -404,7 +404,7 @@
    getMinJuniorRatio:
  • Returns Promise<BN>

    @@ -420,7 +420,7 @@
    getOwnerOfCollateral: fu
  • Parameters

    @@ -448,7 +448,7 @@
    getOwnerOfLoan: function
  • Parameters

    @@ -470,7 +470,7 @@
    getPrincipal: function
  • Parameters

    @@ -492,7 +492,7 @@
    getSeniorDebt: function<
  • Returns Promise<BN>

    @@ -508,7 +508,7 @@
    getSeniorInterestRate:

    Returns Promise<BN>

    @@ -524,7 +524,7 @@
    getSeniorReserve: functi
  • Returns Promise<BN>

    @@ -540,7 +540,7 @@
    getSeniorTokenBalance:

    Parameters

    @@ -562,7 +562,7 @@
    getTokenPriceJunior:

    Returns Promise<BN>

    @@ -578,7 +578,7 @@
    getTokenPriceSenior:

    Parameters

    @@ -600,7 +600,7 @@
    getTotalBalance: functio
  • Returns Promise<BN>

    @@ -616,7 +616,7 @@
    getTotalDebt: function

    Returns Promise<BN>

    @@ -632,7 +632,7 @@
    loanCount: function
  • Returns Promise<BN>

    @@ -655,7 +655,7 @@

    AnalyticsActions

  • Type parameters

    diff --git a/docs/modules/_actions_borrower_.html b/docs/modules/_actions_borrower_.html index 8779a83..59c7ef8 100644 --- a/docs/modules/_actions_borrower_.html +++ b/docs/modules/_actions_borrower_.html @@ -89,7 +89,7 @@

    IBorrowerActions

    IBorrowerActions: { borrow: any; close: any; issue: any; lock: any; nftLookup: any; repay: any; unlock: any; withdraw: any }
    @@ -104,7 +104,7 @@
    borrow: function
  • Parameters

    @@ -129,7 +129,7 @@
    close: function
  • Parameters

    @@ -151,7 +151,7 @@
    issue: function
  • Parameters

    @@ -176,7 +176,7 @@
    lock: function
  • Parameters

    @@ -198,7 +198,7 @@
    nftLookup: function
  • Parameters

    @@ -223,7 +223,7 @@
    repay: function
  • Parameters

    @@ -248,7 +248,7 @@
    unlock: function
  • Parameters

    @@ -270,7 +270,7 @@
    withdraw: function
  • Parameters

    @@ -305,7 +305,7 @@

    BorrowerActions

  • Type parameters

    diff --git a/docs/modules/_actions_collateral_.html b/docs/modules/_actions_collateral_.html index 486a80d..2fb74a7 100644 --- a/docs/modules/_actions_collateral_.html +++ b/docs/modules/_actions_collateral_.html @@ -89,7 +89,7 @@

    ICollateralActions

    ICollateralActions: { approveNFT: any; getNFTCount: any; getNFTData: any; getNFTOwner: any; isNFTApprovedForAll: any; mintNFT: any; mintTitleNFT: any; setNFTApprovalForAll: any; transferNFT: any }
    @@ -104,7 +104,7 @@
    approveNFT: function
  • Parameters

    @@ -132,7 +132,7 @@
    getNFTCount: function
  • Parameters

    @@ -154,7 +154,7 @@
    getNFTData: function
  • Parameters

    @@ -179,7 +179,7 @@
    getNFTOwner: function
  • Parameters

    @@ -204,7 +204,7 @@
    isNFTApprovedForAll: fun
  • Parameters

    @@ -232,7 +232,7 @@
    mintNFT: function
  • Parameters

    @@ -269,7 +269,7 @@
    mintTitleNFT: function
  • Parameters

    @@ -294,7 +294,7 @@
    setNFTApprovalForAll: fu
  • Parameters

    @@ -322,7 +322,7 @@
    transferNFT: function
  • Parameters

    @@ -360,7 +360,7 @@

    CollateralActions

  • Type parameters

    diff --git a/docs/modules/_actions_currency_.html b/docs/modules/_actions_currency_.html index 3f8bb7c..e21a4c9 100644 --- a/docs/modules/_actions_currency_.html +++ b/docs/modules/_actions_currency_.html @@ -89,7 +89,7 @@

    ICurrencyActions

    ICurrencyActions: { approveJuniorForCurrency: (currencyAmount: string) => Promise<PendingTransaction | undefined>; approveSeniorForCurrency: (currencyAmount: string) => Promise<PendingTransaction | undefined>; getCurrencyAllowance: (owner: string, spender: string) => Promise<BN>; getJuniorForCurrencyAllowance: (owner: string) => Promise<BN | undefined>; getSeniorForCurrencyAllowance: (owner: string) => Promise<BN | undefined>; approveCurrency: any; getCurrencyBalance: any; mintCurrency: any }
    @@ -212,7 +212,7 @@
    approveCurrency: function

    Parameters

    @@ -237,7 +237,7 @@
    getCurrencyBalance: func
  • Parameters

    @@ -259,7 +259,7 @@
    mintCurrency: function
  • Parameters

    @@ -291,7 +291,7 @@

    CurrencyActions

  • Type parameters

    diff --git a/docs/modules/_actions_governance_.html b/docs/modules/_actions_governance_.html index 709cf5f..882391f 100644 --- a/docs/modules/_actions_governance_.html +++ b/docs/modules/_actions_governance_.html @@ -83,7 +83,7 @@

    IGovernanceActions

    IGovernanceActions: { relyAddress: any }
    @@ -98,7 +98,7 @@
    relyAddress: function
  • Parameters

    diff --git a/docs/modules/_actions_index_.html b/docs/modules/_actions_index_.html index c3a57a6..16701c3 100644 --- a/docs/modules/_actions_index_.html +++ b/docs/modules/_actions_index_.html @@ -83,7 +83,7 @@

    TinlakeActions

    diff --git a/docs/modules/_actions_lender_.html b/docs/modules/_actions_lender_.html index fa227ad..563766f 100644 --- a/docs/modules/_actions_lender_.html +++ b/docs/modules/_actions_lender_.html @@ -89,7 +89,7 @@

    ILenderActions

    ILenderActions: { approveJuniorToken: (tokenAmount: string) => Promise<unknown>; approveSeniorToken: (tokenAmount: string) => Promise<unknown>; balance: any; getJuniorTokenAllowance: any; getSeniorTokenAllowance: any; redeemJunior: any; redeemSenior: any; supplyJunior: any; supplySenior: any }
    @@ -146,7 +146,7 @@
    balance: function
  • Returns Promise<any>

    @@ -162,7 +162,7 @@
    getJuniorTokenAllowance: <
  • Parameters

    @@ -184,7 +184,7 @@
    getSeniorTokenAllowance: <
  • Parameters

    @@ -206,7 +206,7 @@
    redeemJunior: function
  • Parameters

    @@ -228,7 +228,7 @@
    redeemSenior: function
  • Parameters

    @@ -250,7 +250,7 @@
    supplyJunior: function
  • Parameters

    @@ -272,7 +272,7 @@
    supplySenior: function
  • Parameters

    @@ -301,7 +301,7 @@

    LenderActions

  • Type parameters

    diff --git a/docs/modules/_actions_proxy_.html b/docs/modules/_actions_proxy_.html index 17f34d6..1adf0ba 100644 --- a/docs/modules/_actions_proxy_.html +++ b/docs/modules/_actions_proxy_.html @@ -89,7 +89,7 @@

    IProxyActions

    IProxyActions: { buildProxy: any; checkProxyExists: any; getProxy: any; getProxyAccessToken: any; getProxyAccessTokenOwner: any; getProxyOwnerByAddress: any; getProxyOwnerByLoan: any; proxyCount: any; proxyCreateNew: any; proxyIssue: any; proxyLockBorrowWithdraw: any; proxyRepayUnlockClose: any; proxyTransferIssue: any }
    @@ -104,7 +104,7 @@
    buildProxy: function
  • Parameters

    @@ -126,7 +126,7 @@
    checkProxyExists: functi
  • Parameters

    @@ -148,7 +148,7 @@
    getProxy: function
  • Parameters

    @@ -170,7 +170,7 @@
    getProxyAccessToken:

    Parameters

    @@ -192,7 +192,7 @@
    getProxyAccessTokenOwner

    Parameters

    @@ -214,7 +214,7 @@
    getProxyOwnerByAddress:

    Parameters

    @@ -236,7 +236,7 @@
    getProxyOwnerByLoan:

    Parameters

    @@ -258,7 +258,7 @@
    proxyCount: function
  • Returns Promise<any>

    @@ -274,7 +274,7 @@
    proxyCreateNew: function
  • Parameters

    @@ -296,7 +296,7 @@
    proxyIssue: function
  • Parameters

    @@ -324,7 +324,7 @@
    proxyLockBorrowWithdraw: <
  • Parameters

    @@ -355,7 +355,7 @@
    proxyRepayUnlockClose:

    Parameters

    @@ -386,7 +386,7 @@
    proxyTransferIssue: func
  • Parameters

    @@ -421,7 +421,7 @@

    ProxyActions

  • Type parameters

    diff --git a/docs/modules/_services_ethereum_.html b/docs/modules/_services_ethereum_.html index 50da29b..0da56e7 100644 --- a/docs/modules/_services_ethereum_.html +++ b/docs/modules/_services_ethereum_.html @@ -99,7 +99,7 @@

    Const ZERO_ADDRESS

    ZERO_ADDRESS: "0x0000000000000000000000000000000000000000" = "0x0000000000000000000000000000000000000000"
    @@ -116,7 +116,7 @@

    executeAndRetry

  • Parameters

    @@ -142,7 +142,7 @@

    Const findEvent

  • Parameters

    @@ -209,7 +209,7 @@

    Const waitAndReturn

    Parameters

    @@ -241,7 +241,7 @@

    Const waitForTransactio
  • Parameters

    diff --git a/docs/modules/_tinlake_.html b/docs/modules/_tinlake_.html index bc33f3e..13be3ce 100644 --- a/docs/modules/_tinlake_.html +++ b/docs/modules/_tinlake_.html @@ -98,7 +98,7 @@

    Constructor

    Constructor<T>: {}

    Type parameters

    @@ -119,7 +119,7 @@

    ContractAbis

    ContractAbis: {}
    @@ -134,7 +134,7 @@

    ContractAddresses

    ContractAddresses: {}
    @@ -149,7 +149,7 @@

    ContractName

    ContractName: typeof contractNames[number]
    @@ -159,7 +159,7 @@

    Contracts

    Contracts: {}
    @@ -174,7 +174,7 @@

    EthConfig

    EthConfig: { from?: undefined | string; gas?: undefined | string; gasPrice?: undefined | string }
    @@ -198,7 +198,7 @@

    EthersConfig

    EthersConfig: { overrides?: EthersOverrides; provider: Provider; signer: Signer }
    @@ -222,7 +222,7 @@

    EthersOverrides

    EthersOverrides: { gasLimit?: undefined | number; gasPrice?: undefined | number }
    @@ -243,7 +243,7 @@

    PendingTransaction

    PendingTransaction: { hash: string | undefined; timesOutAt?: undefined | number }
    @@ -264,7 +264,7 @@

    TinlakeParams

    TinlakeParams: { contractAbis?: ContractAbis | {}; contractAddresses?: ContractAddresses | {}; contractConfig?: any | {}; contracts?: Contracts | {}; ethConfig?: EthConfig; ethOptions?: any | {}; ethersConfig?: EthersConfig; provider: any; transactionTimeout: number }
    diff --git a/docs/modules/_types_tinlake_.html b/docs/modules/_types_tinlake_.html index 519060c..5a0eb79 100644 --- a/docs/modules/_types_tinlake_.html +++ b/docs/modules/_types_tinlake_.html @@ -87,7 +87,7 @@

    ITinlake

    @@ -97,7 +97,7 @@

    Investor

    Investor: { address: string; junior: { maxRedeem: BN; maxSupply: BN; tokenBalance: BN }; senior: { maxRedeem?: BN; maxSupply?: BN; tokenBalance?: BN } }
    @@ -143,7 +143,7 @@

    Loan

    Loan: { debt: BN; interestRate: BN; loanId: string; nft?: NFT; ownerOf: BN; price?: BN; principal: BN; proxyOwner?: undefined | string; registry: string; status?: undefined | string; threshold?: BN; tokenId: BN }
    @@ -194,7 +194,7 @@

    NFT

    NFT: { nftData: any; nftOwner: string; registry: string; tokenId: BN }
    @@ -221,7 +221,7 @@

    Tranche

    Tranche: { availableFunds: BN; interestRate?: BN; token: string; tokenPrice: BN; totalSupply: BN; type: string }
    diff --git a/docs/modules/_utils_basetodisplay_.html b/docs/modules/_utils_basetodisplay_.html index 5f60ffb..05c015e 100644 --- a/docs/modules/_utils_basetodisplay_.html +++ b/docs/modules/_utils_basetodisplay_.html @@ -87,7 +87,7 @@

    Const baseToDisplay

  • Parameters

    diff --git a/docs/modules/_utils_bntohex_.html b/docs/modules/_utils_bntohex_.html index 715482e..56f7cbc 100644 --- a/docs/modules/_utils_bntohex_.html +++ b/docs/modules/_utils_bntohex_.html @@ -87,7 +87,7 @@

    Const bnToHex

  • Parameters

    diff --git a/docs/modules/_utils_displaytobase_.html b/docs/modules/_utils_displaytobase_.html index f39eb71..afb597d 100644 --- a/docs/modules/_utils_displaytobase_.html +++ b/docs/modules/_utils_displaytobase_.html @@ -87,7 +87,7 @@

    Const displayToBase

  • Parameters

    diff --git a/docs/modules/_utils_feetointerestrate_.html b/docs/modules/_utils_feetointerestrate_.html index 21bb220..c99d407 100644 --- a/docs/modules/_utils_feetointerestrate_.html +++ b/docs/modules/_utils_feetointerestrate_.html @@ -87,7 +87,7 @@

    Const feeToInterestRate
  • diff --git a/docs/modules/_utils_getloanstatus_.html b/docs/modules/_utils_getloanstatus_.html index 0ee6fc7..71ab0ed 100644 --- a/docs/modules/_utils_getloanstatus_.html +++ b/docs/modules/_utils_getloanstatus_.html @@ -89,7 +89,7 @@

    LoanStatus

    LoanStatus: "Whitelisted" | "Ongoing" | "Repaid"
    @@ -106,7 +106,7 @@

    getLoanStatus

  • Parameters

    diff --git a/docs/modules/_utils_interestratetofee_.html b/docs/modules/_utils_interestratetofee_.html index c70c894..04badec 100644 --- a/docs/modules/_utils_interestratetofee_.html +++ b/docs/modules/_utils_interestratetofee_.html @@ -87,7 +87,7 @@

    Const interestRateToFee
  • From 15db82d79f1c9895bca59ea865d74912761109b4 Mon Sep 17 00:00:00 2001 From: Jeroen Offerijns Date: Mon, 31 Aug 2020 14:51:13 +0200 Subject: [PATCH 17/65] chore: update package lock name --- package-lock.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package-lock.json b/package-lock.json index d8c538f..821573a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,5 +1,5 @@ { - "name": "tinlake", + "name": "@centrifuge/tinlake-js", "version": "0.0.19-develop.5", "lockfileVersion": 1, "requires": true, From 88476a535f368e70c264d4568d8fcebb78f8ba26 Mon Sep 17 00:00:00 2001 From: Jeroen Offerijns Date: Mon, 31 Aug 2020 19:01:40 +0200 Subject: [PATCH 18/65] feat: set up ethers.js signer for tests --- src/Tinlake.ts | 2 -- src/actions/governance.spec.ts | 4 ++-- src/test/utils.ts | 6 +++--- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/Tinlake.ts b/src/Tinlake.ts index 8503d4d..86ebb44 100644 --- a/src/Tinlake.ts +++ b/src/Tinlake.ts @@ -128,7 +128,6 @@ export default class Tinlake { this.ethOptions = ethOptions || {} this.eth = new Eth(this.provider, this.ethOptions) as ethI - console.log('set provider', ethersConfig) if (ethersConfig) this.ethersConfig = ethersConfig this.setContracts() @@ -189,7 +188,6 @@ export default class Tinlake { } contract(abiName: ContractName, address?: string): ethers.Contract { - console.log(`Looking up contract ${abiName}`, this.ethersContracts) if (address) { return new ethers.Contract(address, this.contractAbis[abiName], this.ethersConfig.signer) } if (this.ethersConfig.signer) { diff --git a/src/actions/governance.spec.ts b/src/actions/governance.spec.ts index 9c93775..885417e 100644 --- a/src/actions/governance.spec.ts +++ b/src/actions/governance.spec.ts @@ -5,7 +5,7 @@ import { ITinlake } from '../types/tinlake' import { createTinlake, TestProvider } from '../test/utils' import testConfig from '../test/config' import { Account } from '../test/types' -import { ContractNames } from '../Tinlake' +import { ContractName } from '../Tinlake' // god account = governance address for the tinlake test deployment const userAccount = account.generate(randomString.generate(32)) @@ -46,7 +46,7 @@ describe('governance tests', async () => { }) }) -async function relyAddress(usr: string, contractName: ContractNames) { +async function relyAddress(usr: string, contractName: ContractName) { const res = await governanceTinlake.relyAddress(usr, testConfig.contractAddresses[contractName]) const isWard = await governanceTinlake.isWard(usr, contractName) assert.equal(isWard, 1) diff --git a/src/test/utils.ts b/src/test/utils.ts index bcda736..0f91712 100644 --- a/src/test/utils.ts +++ b/src/test/utils.ts @@ -39,7 +39,7 @@ export function createTinlake(usr: Account, testConfig: ProviderConfig): ITinlak transactionTimeout, provider: createSignerProvider(rpcUrl, usr), ethConfig: { gas, gasPrice, from: usr.address }, - ethersConfig: createEthersConfig(rpcUrl), + ethersConfig: createEthersConfig(rpcUrl, usr), }) return tinlake @@ -52,8 +52,8 @@ function createSignerProvider(rpcUrl: string, usr: Account) { }) } -function createEthersConfig(rpcUrl: string) { +function createEthersConfig(rpcUrl: string, usr: Account) { const provider = new ethers.providers.JsonRpcProvider(rpcUrl) - const signer = provider.getSigner() + const signer = new ethers.Wallet(usr.privateKey).connect(provider) return { provider, signer } } From 08f67266e6656072a3369aa192f758ad304b013e Mon Sep 17 00:00:00 2001 From: Jeroen Offerijns Date: Tue, 1 Sep 2020 12:11:23 +0200 Subject: [PATCH 19/65] feat: work on fixing tests --- src/actions/currency.ts | 7 ++----- src/actions/governance.ts | 10 +++------- src/actions/lender.spec.ts | 9 +++++++-- src/actions/lender.ts | 8 ++++---- src/test/config.ts | 2 +- src/test/utils.ts | 10 +++++++--- 6 files changed, 24 insertions(+), 22 deletions(-) diff --git a/src/actions/currency.ts b/src/actions/currency.ts index fbb998d..99c5a28 100644 --- a/src/actions/currency.ts +++ b/src/actions/currency.ts @@ -1,14 +1,11 @@ import { Constructor, TinlakeParams, PendingTransaction } from '../Tinlake' -import { executeAndRetry, waitAndReturnEvents } from '../services/ethereum' import BN from 'bn.js' export function CurrencyActions>(Base: ActionsBase) { return class extends Base implements ICurrencyActions { // move out for tests only mintCurrency = async (usr: string, amount: string) => { - const txHash = await executeAndRetry(this.contracts['TINLAKE_CURRENCY'].mint, [usr, amount, this.ethConfig]) - console.log(`[Mint currency] txHash: ${txHash}`) - return waitAndReturnEvents(this.eth, txHash, this.contracts['TINLAKE_CURRENCY'].abi, this.transactionTimeout) + return this.pending(this.contract('TINLAKE_CURRENCY').mint(usr, amount)) } getCurrencyAllowance = async (owner: string, spender: string) => { @@ -48,7 +45,7 @@ export function CurrencyActions>( } export type ICurrencyActions = { - mintCurrency(usr: string, amount: string): Promise + mintCurrency(usr: string, amount: string): Promise getCurrencyBalance(usr: string): Promise getCurrencyAllowance: (owner: string, spender: string) => Promise getJuniorForCurrencyAllowance: (owner: string) => Promise diff --git a/src/actions/governance.ts b/src/actions/governance.ts index 1eee581..9e7345d 100644 --- a/src/actions/governance.ts +++ b/src/actions/governance.ts @@ -1,19 +1,15 @@ -import { Constructor, TinlakeParams } from '../Tinlake' -import { executeAndRetry, waitAndReturnEvents } from '../services/ethereum' +import { Constructor, TinlakeParams, PendingTransaction } from '../Tinlake' function GovernanceActions>(Base: ActionsBase) { return class extends Base implements IGovernanceActions { relyAddress = async (usr: string, contractAddress: string) => { - const rootContract = this.contracts['ROOT_CONTRACT'] - const txHash = await executeAndRetry(rootContract.relyContract, [contractAddress, usr, this.ethConfig]) - console.log(`[Rely usr ${usr}] txHash: ${txHash} on contract ${contractAddress}`) - return waitAndReturnEvents(this.eth, txHash, rootContract.abi, this.transactionTimeout) + return this.pending(this.contract('ROOT_CONTRACT').relyContract(contractAddress, usr)) } } } export type IGovernanceActions = { - relyAddress(usr: string, contractAddress: string): Promise + relyAddress(usr: string, contractAddress: string): Promise } export default GovernanceActions diff --git a/src/actions/lender.spec.ts b/src/actions/lender.spec.ts index 95601a6..4afc0a8 100644 --- a/src/actions/lender.spec.ts +++ b/src/actions/lender.spec.ts @@ -30,7 +30,7 @@ describe('lender functions', async () => { beforeEach(async () => { lenderAccount = account.generate(randomString.generate(32)) lenderTinlake = createTinlake(lenderAccount, testConfig) - await testProvider.fundAccountWithETH(lenderAccount.address, FAUCET_AMOUNT) + return await testProvider.fundAccountWithETH(lenderAccount.address, FAUCET_AMOUNT) }) it('success: supply junior', async () => { @@ -49,7 +49,9 @@ describe('lender functions', async () => { await governanceTinlake.mintCurrency(lenderAccount.address, currencyAmount) // do not set allowance for lender - const supplyResult = await lenderTinlake.supplyJunior(currencyAmount) + const supplyTx = await lenderTinlake.supplyJunior(currencyAmount) + const supplyResult = await lenderTinlake.getTransactionReceipt(supplyTx) + console.log('supplyResult', supplyResult) // assert result successful assert.equal(supplyResult.status, FAIL_STATUS) @@ -70,6 +72,7 @@ describe('lender functions', async () => { const initialJuniorTokenBalance = await lenderTinlake.getJuniorTokenBalance(lenderAccount.address) const redeemResult = await lenderTinlake.redeemJunior(tokenAmount) + console.log('redeemResult', redeemResult) const newTrancheCurrencyBalance = await lenderTinlake.getCurrencyBalance(contractAddresses['JUNIOR']) const newLenderCurrencyBalance = await lenderTinlake.getCurrencyBalance(lenderAccount.address) @@ -97,6 +100,7 @@ describe('lender functions', async () => { // approve junior tranche to take tokens await lenderTinlake.approveJuniorToken(tokenAmount) const redeemResult = await lenderTinlake.redeemJunior(tokenAmount) + console.log('redeemResult line 102', redeemResult) assert.equal(redeemResult.status, FAIL_STATUS) }) }) @@ -111,6 +115,7 @@ async function supply(investor: string, currencyAmount: string, tinlake: ITinlak const initialJuniorTokenBalance = await tinlake.getJuniorTokenBalance(investor) const supplyResult = await tinlake.supplyJunior(currencyAmount) + console.log('supplyResult line 117', redeemResult) const newTrancheCurrencyBalance = await tinlake.getCurrencyBalance(contractAddresses['JUNIOR']) const newLenderCurrencyBalance = await tinlake.getCurrencyBalance(investor) const newJuniorTokenBalance = await tinlake.getJuniorTokenBalance(investor) diff --git a/src/actions/lender.ts b/src/actions/lender.ts index 17cd9ab..c3db385 100644 --- a/src/actions/lender.ts +++ b/src/actions/lender.ts @@ -65,11 +65,11 @@ export type ILenderActions = { getSeniorTokenAllowance(owner: string): Promise getJuniorTokenAllowance(owner: string): Promise supplyJunior(currencyAmount: string): Promise - approveJuniorToken: (tokenAmount: string) => Promise - approveSeniorToken: (tokenAmount: string) => Promise - redeemJunior(tokenAmount: string): Promise + approveJuniorToken: (tokenAmount: string) => Promise + approveSeniorToken: (tokenAmount: string) => Promise + redeemJunior(tokenAmount: string): Promise supplySenior(currencyAmount: string): Promise - redeemSenior(tokenAmount: string): Promise + redeemSenior(tokenAmount: string): Promise balance(): Promise } diff --git a/src/test/config.ts b/src/test/config.ts index d5b9708..7f88996 100644 --- a/src/test/config.ts +++ b/src/test/config.ts @@ -12,7 +12,7 @@ const GWEI = 1000 * MWEI const MILLI_ETH = 1e15 // 0.001 ETH const FAUCET_AMOUNT = 5000 * MILLI_ETH -const GAS_PRICE = 5 * GWEI +const GAS_PRICE = 100 * GWEI const GAS = 1000000 const testConfig: ProviderConfig = { diff --git a/src/test/utils.ts b/src/test/utils.ts index 0f91712..aa688d5 100644 --- a/src/test/utils.ts +++ b/src/test/utils.ts @@ -8,14 +8,15 @@ const SignerProvider = require('ethjs-provider-signer') const { sign } = require('ethjs-signer') export class TestProvider { + public provider: ethers.providers.Provider public wallet: ethers.Wallet public ethConfig: EthConfig public transactionTimeout: number constructor(testConfig: ProviderConfig) { const { rpcUrl, godAccount, transactionTimeout } = testConfig - const provider = new ethers.providers.JsonRpcProvider(rpcUrl) - this.wallet = new ethers.Wallet(godAccount.privateKey, provider) + this.provider = new ethers.providers.JsonRpcProvider(rpcUrl) + this.wallet = new ethers.Wallet(godAccount.privateKey, this.provider) this.ethConfig = { from: godAccount.address } this.transactionTimeout = transactionTimeout } @@ -27,7 +28,10 @@ export class TestProvider { } const res = await this.wallet.sendTransaction(transaction) - await res.wait(1) + console.log('res', res) + const receipt = await this.provider.waitForTransaction(res.hash!) + console.log('receipt', receipt) + return receipt } } From 2075e10f686d685d4892558c78e4962446c27b03 Mon Sep 17 00:00:00 2001 From: Jeroen Offerijns Date: Tue, 1 Sep 2020 13:39:14 +0200 Subject: [PATCH 20/65] fix: most of the lender and governance tests --- package.json | 2 +- src/Tinlake.ts | 32 ++++++++++++---- src/actions/governance.spec.ts | 9 ++++- src/actions/lender.spec.ts | 67 ++++++++++++++++++++++++---------- src/actions/lender.ts | 37 +++++-------------- src/test/config.ts | 10 ++--- src/test/utils.ts | 5 +-- 7 files changed, 95 insertions(+), 67 deletions(-) diff --git a/package.json b/package.json index 3787351..2f34be2 100644 --- a/package.json +++ b/package.json @@ -48,7 +48,7 @@ "scripts": { "build": "rollup -c", "start": "rollup -cw", - "test": "ts-mocha -p src/test/tsconfig.json src/**/*.spec.ts src/*.spec.ts --timeout 40000", + "test": "ts-mocha -p src/test/tsconfig.json src/**/*.spec.ts --timeout 40000", "nodemon": "nodemon node inspect dist/Tinlake.js", "generate-docs": "typedoc --out docs --exclude \"./node_modules/**\" --exclude \"./src/abi/**\" --exclude \"./src/index.ts\" --exclude \"./src/actions/*.spec.ts\" --exclude \"./src/test/**\" --excludeExternals --excludeNotExported --ignoreCompilerErrors ./src", "lint": "tslint --project .", diff --git a/src/Tinlake.ts b/src/Tinlake.ts index 86ebb44..a43dd6b 100644 --- a/src/Tinlake.ts +++ b/src/Tinlake.ts @@ -35,7 +35,9 @@ const contractNames = [ ] as const export type PendingTransaction = { - hash: string | undefined + hash?: string + status: number + error?: string timesOutAt?: number } @@ -198,10 +200,19 @@ export default class Tinlake { } async pending(txPromise: Promise): Promise { - const tx = await txPromise - return { - hash: tx.hash, - timesOutAt: Date.now() + this.transactionTimeout * 1000, + try { + const tx = await txPromise + return { + status: 1, + hash: tx.hash, + timesOutAt: Date.now() + this.transactionTimeout * 1000, + } + } catch(e) { + console.error(`Error caught in tinlake.pending(): ${e}`) + return { + status: 0, + error: e.message + } } } @@ -216,9 +227,14 @@ export default class Tinlake { }, tx.timesOutAt - Date.now()) } - const receipt = await this.ethersConfig.provider!.waitForTransaction(tx.hash) - if (timer) clearTimeout(timer) - return resolve(receipt) + try { + const receipt = await this.ethersConfig.provider!.waitForTransaction(tx.hash) + if (timer) clearTimeout(timer) + return resolve(receipt) + } catch (e) { + console.error(`Error caught in tinlake.getTransactionReceipt(): ${e}`) + return reject() + } }) } diff --git a/src/actions/governance.spec.ts b/src/actions/governance.spec.ts index 885417e..bebbdc0 100644 --- a/src/actions/governance.spec.ts +++ b/src/actions/governance.spec.ts @@ -40,15 +40,20 @@ describe('governance tests', async () => { await testProvider.fundAccountWithETH(randomAccount.address, FAUCET_AMOUNT) const randomTinlake = createTinlake(randomAccount, testConfig) - const res = await randomTinlake.relyAddress(userAccount.address, testConfig.contractAddresses['PILE']) + + const tx = await randomTinlake.relyAddress(userAccount.address, testConfig.contractAddresses['PILE']) + const res = await randomTinlake.getTransactionReceipt(tx) assert.equal(res.status, FAIL_STATUS) }) }) }) async function relyAddress(usr: string, contractName: ContractName) { - const res = await governanceTinlake.relyAddress(usr, testConfig.contractAddresses[contractName]) + const tx = await governanceTinlake.relyAddress(usr, testConfig.contractAddresses[contractName]) + const res = await governanceTinlake.getTransactionReceipt(tx) + const isWard = await governanceTinlake.isWard(usr, contractName) + assert.equal(isWard, 1) assert.equal(res.status, SUCCESS_STATUS) } diff --git a/src/actions/lender.spec.ts b/src/actions/lender.spec.ts index 4afc0a8..f6a43a8 100644 --- a/src/actions/lender.spec.ts +++ b/src/actions/lender.spec.ts @@ -21,10 +21,13 @@ describe('lender functions', async () => { before(async () => { adminTinlake = createTinlake(adminAccount, testConfig) governanceTinlake = createTinlake(testConfig.godAccount, testConfig) + // fund lender & admin accounts with currency await testProvider.fundAccountWithETH(adminAccount.address, FAUCET_AMOUNT) + // rely admin on junior operator - await governanceTinlake.relyAddress(adminAccount.address, contractAddresses['JUNIOR_OPERATOR']) + const relyTx = await governanceTinlake.relyAddress(adminAccount.address, contractAddresses['JUNIOR_OPERATOR']) + await governanceTinlake.getTransactionReceipt(relyTx) }) beforeEach(async () => { @@ -36,47 +39,58 @@ describe('lender functions', async () => { it('success: supply junior', async () => { const currencyAmount = '100000' const tokenAmount = '100' + // whitelist investor - await adminTinlake.approveAllowanceJunior(lenderAccount.address, currencyAmount, tokenAmount) + const approveTx = await adminTinlake.approveAllowanceJunior(lenderAccount.address, currencyAmount, tokenAmount) + await adminTinlake.getTransactionReceipt(approveTx) + await supply(lenderAccount.address, `${currencyAmount}`, lenderTinlake) }) it('fail: supply junior - no allowance', async () => { const currencyAmount = '1000' // approve junior tranche to take currency - await lenderTinlake.approveCurrency(contractAddresses['JUNIOR'], currencyAmount) + const approveTx = await lenderTinlake.approveCurrency(contractAddresses['JUNIOR'], currencyAmount) + const approval = await lenderTinlake.getTransactionReceipt(approveTx) + console.log('approval', approval) + // fund investor with tinlake currency - await governanceTinlake.mintCurrency(lenderAccount.address, currencyAmount) + const mintTx = await governanceTinlake.mintCurrency(lenderAccount.address, currencyAmount) + const mint = await governanceTinlake.getTransactionReceipt(mintTx) + console.log('mint', mint) // do not set allowance for lender const supplyTx = await lenderTinlake.supplyJunior(currencyAmount) - const supplyResult = await lenderTinlake.getTransactionReceipt(supplyTx) - console.log('supplyResult', supplyResult) // assert result successful - assert.equal(supplyResult.status, FAIL_STATUS) + assert.equal(supplyTx.status, FAIL_STATUS) }) it('success: redeem junior', async () => { const currencyAmount = '10000' const tokenAmount = '100' // whitelist investor - await adminTinlake.approveAllowanceJunior(lenderAccount.address, currencyAmount, tokenAmount) + const approveTx = await adminTinlake.approveAllowanceJunior(lenderAccount.address, currencyAmount, tokenAmount) + await adminTinlake.getTransactionReceipt(approveTx) + // supply currency - receive tokens await supply(lenderAccount.address, `${currencyAmount}`, lenderTinlake) + // approve junior tranche to take tokens - await lenderTinlake.approveJuniorToken(tokenAmount) + const lenderApproveTx = await lenderTinlake.approveJuniorToken(tokenAmount) + await lenderTinlake.getTransactionReceipt(lenderApproveTx) const initialLenderCurrencyBalance: BN = await lenderTinlake.getCurrencyBalance(lenderAccount.address) const initialTrancheCurrencyBalance: BN = await lenderTinlake.getCurrencyBalance(contractAddresses['JUNIOR']) const initialJuniorTokenBalance = await lenderTinlake.getJuniorTokenBalance(lenderAccount.address) - const redeemResult = await lenderTinlake.redeemJunior(tokenAmount) - console.log('redeemResult', redeemResult) + const redeemTx = await lenderTinlake.redeemJunior(tokenAmount) + const redeemResult = await lenderTinlake.getTransactionReceipt(redeemTx) const newTrancheCurrencyBalance = await lenderTinlake.getCurrencyBalance(contractAddresses['JUNIOR']) const newLenderCurrencyBalance = await lenderTinlake.getCurrencyBalance(lenderAccount.address) const newJuniorTokenBalance = await lenderTinlake.getJuniorTokenBalance(lenderAccount.address) + assert.equal(redeemResult.status, SUCCESS_STATUS) assert.equal( initialTrancheCurrencyBalance.sub(new BN(tokenAmount)).subn(1).toString(), @@ -94,28 +108,41 @@ describe('lender functions', async () => { const tokenAmount = '100' // whitelist investor with no allowance to redeem - await adminTinlake.approveAllowanceJunior(lenderAccount.address, currencyAmount, '0') + const approveTx = await adminTinlake.approveAllowanceJunior(lenderAccount.address, currencyAmount, '0') + await adminTinlake.getTransactionReceipt(approveTx) + // supply currency - receive tokens await supply(lenderAccount.address, `${currencyAmount}`, lenderTinlake) + // approve junior tranche to take tokens - await lenderTinlake.approveJuniorToken(tokenAmount) - const redeemResult = await lenderTinlake.redeemJunior(tokenAmount) - console.log('redeemResult line 102', redeemResult) - assert.equal(redeemResult.status, FAIL_STATUS) + const lenderApproveTx = await lenderTinlake.approveJuniorToken(tokenAmount) + await lenderTinlake.getTransactionReceipt(lenderApproveTx) + + const redeemTx = await lenderTinlake.redeemJunior(tokenAmount) + console.log(redeemTx) + + assert.equal(redeemTx.status, FAIL_STATUS) }) }) async function supply(investor: string, currencyAmount: string, tinlake: ITinlake) { // approve junior tranche to take currency - await tinlake.approveCurrency(contractAddresses['JUNIOR'], currencyAmount) + const approveTx = await tinlake.approveCurrency(contractAddresses['JUNIOR'], currencyAmount) + await tinlake.getTransactionReceipt(approveTx) + // fund investor with tinlake currency - const res = await governanceTinlake.mintCurrency(investor, currencyAmount) + const mintTx = await governanceTinlake.mintCurrency(investor, currencyAmount) + await governanceTinlake.getTransactionReceipt(mintTx) + const initialLenderCurrencyBalance = await tinlake.getCurrencyBalance(investor) const initialTrancheCurrencyBalance = await tinlake.getCurrencyBalance(contractAddresses['JUNIOR']) const initialJuniorTokenBalance = await tinlake.getJuniorTokenBalance(investor) - const supplyResult = await tinlake.supplyJunior(currencyAmount) - console.log('supplyResult line 117', redeemResult) + const supplyTx = await tinlake.supplyJunior(currencyAmount) + console.log('supplyTx', supplyTx) + const supplyResult = await tinlake.getTransactionReceipt(supplyTx) + console.log('supplyResult', supplyResult) + const newTrancheCurrencyBalance = await tinlake.getCurrencyBalance(contractAddresses['JUNIOR']) const newLenderCurrencyBalance = await tinlake.getCurrencyBalance(investor) const newJuniorTokenBalance = await tinlake.getJuniorTokenBalance(investor) diff --git a/src/actions/lender.ts b/src/actions/lender.ts index c3db385..3a3659f 100644 --- a/src/actions/lender.ts +++ b/src/actions/lender.ts @@ -1,62 +1,45 @@ import { Constructor, TinlakeParams, PendingTransaction } from '../Tinlake' -import { executeAndRetry, waitAndReturnEvents } from '../services/ethereum' import BN from 'bn.js' export function LenderActions>(Base: ActionBase) { return class extends Base implements ILenderActions { // senior tranche functions supplySenior = async (currencyAmount: string) => { - const seniorOperator = this.contract('SENIOR_OPERATOR') - return this.pending(seniorOperator.supply(currencyAmount)) + return this.pending(this.contract('SENIOR_OPERATOR').supply(currencyAmount)) } redeemSenior = async (tokenAmount: string) => { - const seniorOperator = this.contract('SENIOR_OPERATOR') - return this.pending(seniorOperator.redeem(tokenAmount)) + return this.pending(this.contract('SENIOR_OPERATOR').redeem(tokenAmount)) } getSeniorTokenAllowance = async (owner: string) => { - const res: { 0: BN } = await executeAndRetry(this.contracts['SENIOR_TOKEN'].allowance, [ - owner, - this.contractAddresses['SENIOR'], - ]) - return res[0] || new BN(0) + return (await this.contract('SENIOR_TOKEN').allowance(owner, this.contractAddresses['SENIOR'])).toBN() } approveSeniorToken = async (tokenAmount: string) => { - const senior = this.contract('SENIOR_TOKEN') - return this.pending(senior.approve(this.contractAddresses['SENIOR'], tokenAmount)) + return this.pending(this.contract('SENIOR_TOKEN').approve(this.contractAddresses['SENIOR'], tokenAmount)) } // junior tranche functions supplyJunior = async (currencyAmount: string) => { - const juniorOperator = this.contract('JUNIOR_OPERATOR') - return this.pending(juniorOperator.supply(currencyAmount)) + return this.pending(this.contract('JUNIOR_OPERATOR').supply(currencyAmount)) } redeemJunior = async (tokenAmount: string) => { - const juniorOperator = this.contract('JUNIOR_OPERATOR') - return this.pending(juniorOperator.redeem(tokenAmount)) + return this.pending(this.contract('JUNIOR_OPERATOR').redeem(tokenAmount)) } getJuniorTokenAllowance = async (owner: string) => { - const res: { 0: BN } = await executeAndRetry(this.contracts['JUNIOR_TOKEN'].allowance, [ - owner, - this.contractAddresses['JUNIOR'], - ]) - return res[0] || new BN(0) + return (await this.contract('JUNIOR_TOKEN').allowance(owner, this.contractAddresses['JUNIOR'])).toBN() } approveJuniorToken = async (tokenAmount: string) => { - const junior = this.contract('JUNIOR_TOKEN') - return this.pending(junior.approve(this.contractAddresses['JUNIOR'], tokenAmount)) + return this.pending(this.contract('JUNIOR_TOKEN').approve(this.contractAddresses['JUNIOR'], tokenAmount)) } // general lender functions balance = async () => { - const txHash = await executeAndRetry(this.contracts['DISTRIBUTOR'].balance, [this.ethConfig]) - console.log(`[Balance] txHash: ${txHash}`) - return waitAndReturnEvents(this.eth, txHash, this.contracts['DISTRIBUTOR'].abi, this.transactionTimeout) + return this.pending(this.contract('DISTRIBUTOR').balance()) } } } @@ -70,7 +53,7 @@ export type ILenderActions = { redeemJunior(tokenAmount: string): Promise supplySenior(currencyAmount: string): Promise redeemSenior(tokenAmount: string): Promise - balance(): Promise + balance(): Promise } export default LenderActions diff --git a/src/test/config.ts b/src/test/config.ts index 7f88996..d7f4d9b 100644 --- a/src/test/config.ts +++ b/src/test/config.ts @@ -12,7 +12,7 @@ const GWEI = 1000 * MWEI const MILLI_ETH = 1e15 // 0.001 ETH const FAUCET_AMOUNT = 5000 * MILLI_ETH -const GAS_PRICE = 100 * GWEI +const GAS_PRICE = 5 * GWEI const GAS = 1000000 const testConfig: ProviderConfig = { @@ -29,8 +29,8 @@ const testConfig: ProviderConfig = { rpcUrl: process.env.RPC_URL || 'http://127.0.0.1:8545', isRealTestnet: false, contractAbis: abiDefinitions, - SUCCESS_STATUS: '0x1', - FAIL_STATUS: '0x0', + SUCCESS_STATUS: 1, + FAIL_STATUS: 0, FAUCET_AMOUNT: `${FAUCET_AMOUNT}`, } @@ -46,8 +46,8 @@ export type ProviderConfig = { transactionTimeout: number contractAddresses: ContractAddresses contractAbis: ContractAbis - SUCCESS_STATUS: '0x1' - FAIL_STATUS: '0x0' + SUCCESS_STATUS: 1 + FAIL_STATUS: 0 FAUCET_AMOUNT: string } diff --git a/src/test/utils.ts b/src/test/utils.ts index aa688d5..e11da7e 100644 --- a/src/test/utils.ts +++ b/src/test/utils.ts @@ -28,10 +28,7 @@ export class TestProvider { } const res = await this.wallet.sendTransaction(transaction) - console.log('res', res) - const receipt = await this.provider.waitForTransaction(res.hash!) - console.log('receipt', receipt) - return receipt + await this.provider.waitForTransaction(res.hash!) } } From db3f51ff3b40709868af26da5bdd0c9160603274 Mon Sep 17 00:00:00 2001 From: Jeroen Offerijns Date: Wed, 2 Sep 2020 10:04:56 +0200 Subject: [PATCH 21/65] fix: admin tests --- src/actions/admin.spec.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/actions/admin.spec.ts b/src/actions/admin.spec.ts index 0cb67d1..1d49f41 100644 --- a/src/actions/admin.spec.ts +++ b/src/actions/admin.spec.ts @@ -4,7 +4,6 @@ import { ITinlake } from '../types/tinlake' import assert from 'assert' import { createTinlake, TestProvider } from '../test/utils' import testConfig from '../test/config' -import { interestRateToFee } from '../utils/interestRateToFee' const testProvider = new TestProvider(testConfig) const adminAccount = account.generate(randomString.generate(32)) @@ -28,19 +27,23 @@ describe('admin tests', async () => { describe('operator', async () => { it('success: set allowance for junior investor', async () => { // rely admin on junior operator - await governanceTinlake.relyAddress(adminAccount.address, contractAddresses['JUNIOR_OPERATOR']) + const relyTx = await governanceTinlake.relyAddress(adminAccount.address, contractAddresses['JUNIOR_OPERATOR']) + await governanceTinlake.getTransactionReceipt(relyTx) + const maxCurrency = '1000' const maxToken = '100' // set allowance for lender address - const allowanceResult: any = await adminTinlake.approveAllowanceJunior( + const allowanceTx = await adminTinlake.approveAllowanceJunior( lenderAccount.address, maxCurrency, maxToken ) + const allowanceResult = await adminTinlake.getTransactionReceipt(allowanceTx) const maxSupplyAmount = await adminTinlake.getMaxSupplyAmountJunior(lenderAccount.address) const maxRedeemAmount = await adminTinlake.getMaxRedeemAmountJunior(lenderAccount.address) + assert.equal(allowanceResult.status, SUCCESS_STATUS) assert.equal(maxRedeemAmount, maxToken) assert.equal(maxSupplyAmount, maxCurrency) From 62d1388ac7f7185da9857954e4e9899a9e927bb9 Mon Sep 17 00:00:00 2001 From: Jeroen Offerijns Date: Wed, 2 Sep 2020 10:56:12 +0200 Subject: [PATCH 22/65] feat: work on fixing the proxy tests --- src/actions/governance.spec.ts | 2 ++ src/actions/lender.spec.ts | 1 + src/actions/proxy.spec.ts | 25 +++++++++++++++++++------ src/actions/proxy.ts | 14 +++++++++++--- 4 files changed, 33 insertions(+), 9 deletions(-) diff --git a/src/actions/governance.spec.ts b/src/actions/governance.spec.ts index bebbdc0..a4bea87 100644 --- a/src/actions/governance.spec.ts +++ b/src/actions/governance.spec.ts @@ -42,7 +42,9 @@ describe('governance tests', async () => { const randomTinlake = createTinlake(randomAccount, testConfig) const tx = await randomTinlake.relyAddress(userAccount.address, testConfig.contractAddresses['PILE']) + console.log('tx', tx) const res = await randomTinlake.getTransactionReceipt(tx) + console.log('res', res) assert.equal(res.status, FAIL_STATUS) }) }) diff --git a/src/actions/lender.spec.ts b/src/actions/lender.spec.ts index f6a43a8..cb0c84b 100644 --- a/src/actions/lender.spec.ts +++ b/src/actions/lender.spec.ts @@ -69,6 +69,7 @@ describe('lender functions', async () => { it('success: redeem junior', async () => { const currencyAmount = '10000' const tokenAmount = '100' + // whitelist investor const approveTx = await adminTinlake.approveAllowanceJunior(lenderAccount.address, currencyAmount, tokenAmount) await adminTinlake.getTransactionReceipt(approveTx) diff --git a/src/actions/proxy.spec.ts b/src/actions/proxy.spec.ts index 4b4796f..8f097f3 100644 --- a/src/actions/proxy.spec.ts +++ b/src/actions/proxy.spec.ts @@ -32,10 +32,17 @@ describe('proxy tests', async () => { // create new proxy and mint collateral NFT to borrower const proxyAddr = await borrowerTinlake.proxyCreateNew(borrowerAccount.address) const tokenId = `${Math.floor(Math.random() * 10e15) + 1}` - await governanceTinlake.mintNFT(testConfig.nftRegistry, borrowerAccount.address, tokenId, '234', '345', '456') - await borrowerTinlake.approveNFT(testConfig.nftRegistry, tokenId, proxyAddr) + + const mintTx = await governanceTinlake.mintNFT(testConfig.nftRegistry, borrowerAccount.address, tokenId, '234', '345', '456') + await governanceTinlake.getTransactionReceipt(mintTx) + + const approveTx = await borrowerTinlake.approveNFT(testConfig.nftRegistry, tokenId, proxyAddr) + await borrowerTinlake.getTransactionReceipt(approveTx) + // issue loan from collateral NFT - const issueResult = await borrowerTinlake.proxyTransferIssue(proxyAddr, testConfig.nftRegistry, tokenId) + const issueTx = await borrowerTinlake.proxyTransferIssue(proxyAddr, testConfig.nftRegistry, tokenId) + const issueResult = await borrowerTinlake.getTransactionReceipt(issueTx) + assert.equal(issueResult.status, SUCCESS_STATUS) assert.equal(await borrowerTinlake.getNFTOwner(testConfig.nftRegistry, tokenId), proxyAddr) @@ -72,9 +79,15 @@ describe('proxy tests', async () => { it('fail: does not succeed if the proxy is not approved to take the NFT', async () => { const proxyAddr = await borrowerTinlake.proxyCreateNew(borrowerAccount.address) const tokenId = `${Math.floor(Math.random() * 10e15) + 1}` - await governanceTinlake.mintNFT(testConfig.nftRegistry, borrowerAccount.address, tokenId, '234', '345', '456') - const res = await borrowerTinlake.proxyTransferIssue(testConfig.nftRegistry, proxyAddr, tokenId) - assert.equal(res.status, FAIL_STATUS) + + const mintTx = await governanceTinlake.mintNFT(testConfig.nftRegistry, borrowerAccount.address, tokenId, '234', '345', '456') + console.log('mintTx', mintTx) + await governanceTinlake.getTransactionReceipt(mintTx) + + const issueTx = await borrowerTinlake.proxyTransferIssue(testConfig.nftRegistry, proxyAddr, tokenId) + console.log('issueTx', issueTx) + const issueResult = await borrowerTinlake.getTransactionReceipt(issueTx) + assert.equal(issueResult.status, FAIL_STATUS) }) // TODO: update with v3, ceiling does currently not exist, need to use NFT Feed diff --git a/src/actions/proxy.ts b/src/actions/proxy.ts index 4a6a9cc..0952886 100644 --- a/src/actions/proxy.ts +++ b/src/actions/proxy.ts @@ -11,7 +11,11 @@ export function ProxyActions>(Bas } buildProxy = async (owner: string) => { - // const tx = await this.contract('PROXY_REGISTRY').proxies(accessTokenId) + // const tx = await this.contract('PROXY_REGISTRY')['build(address)'](owner, {}) + // const result = await this.getTransactionReceipt(tx) + // console.log(' create proxy new result.topics', result.logs?.map((log: any) => log.topics)) + + const txHash = await executeAndRetry(this.contracts['PROXY_REGISTRY'].build, [owner, this.ethConfig]) console.log(`[Proxy created] txHash: ${txHash}`) @@ -21,7 +25,8 @@ export function ProxyActions>(Bas this.contracts['PROXY_REGISTRY'].abi, this.transactionTimeout ) - console.log('create proxy response', response) + console.log('create proxy response', response.events[0]) + console.log('create proxy return data', response.events[0].data[2].toString()) return response.events[0].data[2].toString() } @@ -64,7 +69,10 @@ export function ProxyActions>(Bas proxyCreateNew = async (address: string) => { const accessToken = await this.buildProxy(address) - return this.getProxy(accessToken) + console.log('accessToken', accessToken) + const proxy = await this.getProxy(accessToken) + console.log('new proxy', proxy) + return proxy } proxyIssue = async (proxyAddress: string, nftRegistryAddress: string, tokenId: string) => { From 35298cb79001fb5b90b8f77c1f2122ea696c9b40 Mon Sep 17 00:00:00 2001 From: Jeroen Offerijns Date: Wed, 2 Sep 2020 13:32:29 +0200 Subject: [PATCH 23/65] feat: work on implementing remaining proxy methods using ethers --- src/actions/governance.ts | 6 +++++- src/actions/proxy.spec.ts | 2 +- src/actions/proxy.ts | 25 ++++++++++--------------- 3 files changed, 16 insertions(+), 17 deletions(-) diff --git a/src/actions/governance.ts b/src/actions/governance.ts index 9e7345d..d2438e0 100644 --- a/src/actions/governance.ts +++ b/src/actions/governance.ts @@ -3,7 +3,11 @@ import { Constructor, TinlakeParams, PendingTransaction } from '../Tinlake' function GovernanceActions>(Base: ActionsBase) { return class extends Base implements IGovernanceActions { relyAddress = async (usr: string, contractAddress: string) => { - return this.pending(this.contract('ROOT_CONTRACT').relyContract(contractAddress, usr)) + console.log('usr', usr) + console.log('contractAddress', contractAddress) + const contract = this.contract('ROOT_CONTRACT') + const tx = contract.relyContract(contractAddress, usr) + return this.pending(tx) } } } diff --git a/src/actions/proxy.spec.ts b/src/actions/proxy.spec.ts index 8f097f3..f653335 100644 --- a/src/actions/proxy.spec.ts +++ b/src/actions/proxy.spec.ts @@ -84,7 +84,7 @@ describe('proxy tests', async () => { console.log('mintTx', mintTx) await governanceTinlake.getTransactionReceipt(mintTx) - const issueTx = await borrowerTinlake.proxyTransferIssue(testConfig.nftRegistry, proxyAddr, tokenId) + const issueTx = await borrowerTinlake.proxyTransferIssue(proxyAddr, testConfig.nftRegistry, tokenId) console.log('issueTx', issueTx) const issueResult = await borrowerTinlake.getTransactionReceipt(issueTx) assert.equal(issueResult.status, FAIL_STATUS) diff --git a/src/actions/proxy.ts b/src/actions/proxy.ts index 0952886..fb466a1 100644 --- a/src/actions/proxy.ts +++ b/src/actions/proxy.ts @@ -1,5 +1,4 @@ import { Constructor, TinlakeParams, PendingTransaction } from '../Tinlake' -import { waitAndReturnEvents, executeAndRetry } from '../services/ethereum' const abiCoder = require('web3-eth-abi') import BN from 'bn.js' import { ethers } from 'ethers' @@ -11,23 +10,19 @@ export function ProxyActions>(Bas } buildProxy = async (owner: string) => { - // const tx = await this.contract('PROXY_REGISTRY')['build(address)'](owner, {}) - // const result = await this.getTransactionReceipt(tx) - // console.log(' create proxy new result.topics', result.logs?.map((log: any) => log.topics)) + const tx = await this.contract('PROXY_REGISTRY')['build(address)'](owner) + const receipt = await this.getTransactionReceipt(tx) + if (!(receipt.logs && receipt.logs[1])) { + throw new Error('Created() event missing in proxyRegistry.build(address) receipt') + } + // Two events are emitted: Transfer() (from the ERC721 contract mint method) and Created() (from the ProxyRegistry contract) + // We parse the 4th arg of the Created() event, to grab the access token + const parsedLog = this.contract('PROXY_REGISTRY').interface.parseLog(receipt.logs[1]) + const accessToken = parsedLog.values['3'].toNumber() - const txHash = await executeAndRetry(this.contracts['PROXY_REGISTRY'].build, [owner, this.ethConfig]) - console.log(`[Proxy created] txHash: ${txHash}`) - const response: any = await waitAndReturnEvents( - this.eth, - txHash, - this.contracts['PROXY_REGISTRY'].abi, - this.transactionTimeout - ) - console.log('create proxy response', response.events[0]) - console.log('create proxy return data', response.events[0].data[2].toString()) - return response.events[0].data[2].toString() + return accessToken } getProxy = async (accessTokenId: string) => { From 9568246d6f593138701654165f919738e8954d72 Mon Sep 17 00:00:00 2001 From: Jeroen Offerijns Date: Wed, 2 Sep 2020 13:54:12 +0200 Subject: [PATCH 24/65] feat: work on fixing the governance tests --- src/Tinlake.ts | 3 +++ src/actions/governance.ts | 7 +++++++ src/actions/proxy.spec.ts | 42 +++++++++++++++++++-------------------- src/actions/proxy.ts | 25 ++++++++++------------- 4 files changed, 41 insertions(+), 36 deletions(-) diff --git a/src/Tinlake.ts b/src/Tinlake.ts index a43dd6b..31e578b 100644 --- a/src/Tinlake.ts +++ b/src/Tinlake.ts @@ -85,6 +85,9 @@ export type TinlakeParams = { } export type Constructor = new (...args: any[]) => Tinlake + +ethers.errors.setLogLevel('error') + ;(ethers.utils.BigNumber as any).prototype.toBN = function () { return new BN((this as any).toString()) } diff --git a/src/actions/governance.ts b/src/actions/governance.ts index d2438e0..95dd8ac 100644 --- a/src/actions/governance.ts +++ b/src/actions/governance.ts @@ -1,8 +1,15 @@ import { Constructor, TinlakeParams, PendingTransaction } from '../Tinlake' +import { executeAndRetry, waitAndReturnEvents } from '../services/ethereum' function GovernanceActions>(Base: ActionsBase) { return class extends Base implements IGovernanceActions { relyAddress = async (usr: string, contractAddress: string) => { + // const rootContract = this.contracts['ROOT_CONTRACT'] + // const txHash = await executeAndRetry(rootContract.relyContract, [contractAddress, usr, this.ethConfig]) + // console.log(`[Rely usr ${usr}] txHash: ${txHash} on contract ${contractAddress}`) + // const result = await waitAndReturnEvents(this.eth, txHash, rootContract.abi, this.transactionTimeout) + // console.log('ethjs result', result) + console.log('usr', usr) console.log('contractAddress', contractAddress) const contract = this.contract('ROOT_CONTRACT') diff --git a/src/actions/proxy.spec.ts b/src/actions/proxy.spec.ts index f653335..a03b6f4 100644 --- a/src/actions/proxy.spec.ts +++ b/src/actions/proxy.spec.ts @@ -3,16 +3,13 @@ const account = require('ethjs-account') import assert from 'assert' import { createTinlake, TestProvider } from '../test/utils' import testConfig from '../test/config' -import { ethers } from 'ethers' import { ITinlake } from '../types/tinlake' -import { EthConfig } from '../Tinlake' -import BN from 'bn.js' const testProvider = new TestProvider(testConfig) const borrowerAccount = account.generate(randomString.generate(32)) const adminAccount = account.generate(randomString.generate(32)) let borrowerTinlake: ITinlake -let adminTinlake: ITinlake +// let adminTinlake: ITinlake let governanceTinlake: ITinlake const { SUCCESS_STATUS, FAIL_STATUS, FAUCET_AMOUNT, contractAddresses } = testConfig @@ -20,7 +17,7 @@ const { SUCCESS_STATUS, FAIL_STATUS, FAUCET_AMOUNT, contractAddresses } = testCo describe('proxy tests', async () => { before(async () => { borrowerTinlake = createTinlake(borrowerAccount, testConfig) - adminTinlake = createTinlake(adminAccount, testConfig) + // adminTinlake = createTinlake(adminAccount, testConfig) governanceTinlake = createTinlake(testConfig.godAccount, testConfig) // fund accounts with ETH await testProvider.fundAccountWithETH(adminAccount.address, FAUCET_AMOUNT) @@ -81,12 +78,13 @@ describe('proxy tests', async () => { const tokenId = `${Math.floor(Math.random() * 10e15) + 1}` const mintTx = await governanceTinlake.mintNFT(testConfig.nftRegistry, borrowerAccount.address, tokenId, '234', '345', '456') - console.log('mintTx', mintTx) await governanceTinlake.getTransactionReceipt(mintTx) + // TODO: the next line fails with this error: "Error caught in tinlake.pending(): Error: The execution failed due to an exception." const issueTx = await borrowerTinlake.proxyTransferIssue(proxyAddr, testConfig.nftRegistry, tokenId) console.log('issueTx', issueTx) const issueResult = await borrowerTinlake.getTransactionReceipt(issueTx) + assert.equal(issueResult.status, FAIL_STATUS) }) @@ -119,19 +117,19 @@ describe('proxy tests', async () => { }) // TODO: move to utils -async function fundTranche(amount: string) { - const lenderAccount = account.generate(randomString.generate(32)) - const lenderTinlake = createTinlake(lenderAccount, testConfig) - // fund lender accoutn with eth - await testProvider.fundAccountWithETH(lenderAccount.address, FAUCET_AMOUNT) - // make admin adress ward on tranche operator - await governanceTinlake.relyAddress(adminAccount.address, contractAddresses['JUNIOR_OPERATOR']) - // whitelist lender - await adminTinlake.approveAllowanceJunior(lenderAccount.address, amount, amount) - // lender approves tranche to take currency - await lenderTinlake.approveCurrency(contractAddresses['JUNIOR'], amount) - // mint currency for lender - await governanceTinlake.mintCurrency(lenderAccount.address, amount) - // lender supplies tranche with funds - await lenderTinlake.supplyJunior(amount) -} +// async function fundTranche(amount: string) { +// const lenderAccount = account.generate(randomString.generate(32)) +// const lenderTinlake = createTinlake(lenderAccount, testConfig) +// // fund lender accoutn with eth +// await testProvider.fundAccountWithETH(lenderAccount.address, FAUCET_AMOUNT) +// // make admin adress ward on tranche operator +// await governanceTinlake.relyAddress(adminAccount.address, contractAddresses['JUNIOR_OPERATOR']) +// // whitelist lender +// await adminTinlake.approveAllowanceJunior(lenderAccount.address, amount, amount) +// // lender approves tranche to take currency +// await lenderTinlake.approveCurrency(contractAddresses['JUNIOR'], amount) +// // mint currency for lender +// await governanceTinlake.mintCurrency(lenderAccount.address, amount) +// // lender supplies tranche with funds +// await lenderTinlake.supplyJunior(amount) +// } diff --git a/src/actions/proxy.ts b/src/actions/proxy.ts index fb466a1..57b7d58 100644 --- a/src/actions/proxy.ts +++ b/src/actions/proxy.ts @@ -64,10 +64,7 @@ export function ProxyActions>(Bas proxyCreateNew = async (address: string) => { const accessToken = await this.buildProxy(address) - console.log('accessToken', accessToken) - const proxy = await this.getProxy(accessToken) - console.log('new proxy', proxy) - return proxy + return await this.getProxy(accessToken) } proxyIssue = async (proxyAddress: string, nftRegistryAddress: string, tokenId: string) => { @@ -156,19 +153,19 @@ export function ProxyActions>(Bas } export type IProxyActions = { - buildProxy(owner: string): Promise + buildProxy(owner: string): Promise checkProxyExists(address: string): Promise - getProxy(accessTokenId: string): Promise - proxyCount(): Promise - getProxyAccessToken(proxyAddr: string): Promise - getProxyAccessTokenOwner(tokenId: string): Promise - getProxyOwnerByLoan(loanId: string): Promise - getProxyOwnerByAddress(proxyAddr: string): Promise - proxyCreateNew(address: string): Promise + getProxy(accessTokenId: string): Promise + proxyCount(): Promise + getProxyAccessToken(proxyAddr: string): Promise + getProxyAccessTokenOwner(tokenId: string): Promise + getProxyOwnerByLoan(loanId: string): Promise + getProxyOwnerByAddress(proxyAddr: string): Promise + proxyCreateNew(address: string): Promise proxyIssue(proxyAddr: string, nftRegistryAddr: string, tokenId: string): Promise proxyTransferIssue(proxyAddr: string, nftRegistryAddr: string, tokenId: string): Promise - proxyLockBorrowWithdraw(proxyAddr: string, loanId: string, amount: string, usr: string): Promise - proxyRepayUnlockClose(proxyAddr: string, tokenId: string, loanId: string, registry: string): Promise + proxyLockBorrowWithdraw(proxyAddr: string, loanId: string, amount: string, usr: string): Promise + proxyRepayUnlockClose(proxyAddr: string, tokenId: string, loanId: string, registry: string): Promise } export default ProxyActions From 8fb330c5b1952799ac9a2a4634a14f586a612058 Mon Sep 17 00:00:00 2001 From: Jeroen Offerijns Date: Wed, 2 Sep 2020 15:02:48 +0200 Subject: [PATCH 25/65] fix: borrower tests --- package.json | 2 +- src/Tinlake.ts | 4 ++ src/actions/borrower.spec.ts | 90 +++++++++++++++++++++++++++--------- src/actions/borrower.ts | 57 ++++++++--------------- src/actions/collateral.ts | 4 +- src/actions/governance.ts | 4 +- src/test/config.ts | 2 +- 7 files changed, 96 insertions(+), 67 deletions(-) diff --git a/package.json b/package.json index c3e078a..6efff7d 100644 --- a/package.json +++ b/package.json @@ -49,7 +49,7 @@ "scripts": { "build": "rollup -c", "start": "rollup -cw", - "test": "ts-mocha -p src/test/tsconfig.json src/**/*.spec.ts --timeout 40000", + "test": "ts-mocha -p src/test/tsconfig.json src/**/*.spec.ts --timeout 80000", "nodemon": "nodemon node inspect dist/Tinlake.js", "generate-docs": "typedoc --out docs --exclude \"./node_modules/**\" --exclude \"./src/abi/**\" --exclude \"./src/index.ts\" --exclude \"./src/actions/*.spec.ts\" --exclude \"./src/test/**\" --excludeExternals --excludeNotExported --ignoreCompilerErrors ./src", "lint": "tslint --project .", diff --git a/src/Tinlake.ts b/src/Tinlake.ts index 31e578b..1938fe7 100644 --- a/src/Tinlake.ts +++ b/src/Tinlake.ts @@ -233,6 +233,10 @@ export default class Tinlake { try { const receipt = await this.ethersConfig.provider!.waitForTransaction(tx.hash) if (timer) clearTimeout(timer) + + // TODO: if receipt.status === 0, use this to get the revert reason: + // https://gist.github.com/gluk64/fdea559472d957f1138ed93bcbc6f78a#file-reason-js + return resolve(receipt) } catch (e) { console.error(`Error caught in tinlake.getTransactionReceipt(): ${e}`) diff --git a/src/actions/borrower.spec.ts b/src/actions/borrower.spec.ts index e985933..678be1f 100644 --- a/src/actions/borrower.spec.ts +++ b/src/actions/borrower.spec.ts @@ -5,6 +5,7 @@ import testConfig from '../test/config' import { ITinlake } from '../types/tinlake' import { createTinlake, TestProvider } from '../test/utils' import { Account } from '../test/types' +import { ethers } from 'ethers' import BN from 'bn.js' const adminAccount = account.generate(randomString.generate(32)) @@ -23,10 +24,12 @@ describe('borrower tests', async () => { before(async () => { governanceTinlake = createTinlake(testConfig.godAccount, testConfig) adminTinlake = createTinlake(adminAccount, testConfig) + // fund borrowerAccount with ETH await testProvider.fundAccountWithETH(adminAccount.address, FAUCET_AMOUNT) - const amount = '5000' + // supply tranche with money + const amount = '5000' await fundTranche(amount) }) @@ -42,19 +45,25 @@ describe('borrower tests', async () => { it('success: close loan', async () => { const { loanId } = await mintIssue(borrowerAccount.address, borrowerTinlake) - const closeResult = await borrowerTinlake.close(loanId) + + const closeTx = await borrowerTinlake.close(loanId) + const closeResult = await borrowerTinlake.getTransactionReceipt(closeTx) + assert.equal(closeResult.status, SUCCESS_STATUS) }) it('success: lock nft', async () => { // mint nft & issue loan const { tokenId, loanId } = await mintIssue(borrowerAccount.address, borrowerTinlake) - await borrowerTinlake.approveNFT(testConfig.nftRegistry, tokenId, contractAddresses['SHELF']) + const approveTx = await borrowerTinlake.approveNFT(testConfig.nftRegistry, tokenId, contractAddresses['SHELF']) + await borrowerTinlake.getTransactionReceipt(approveTx) // lock nft - await borrowerTinlake.lock(loanId) + const lockTx = await borrowerTinlake.lock(loanId) + await borrowerTinlake.getTransactionReceipt(lockTx) + assert.equal( - await borrowerTinlake.getNFTOwner(testConfig.nftRegistry, tokenId), + (await borrowerTinlake.getNFTOwner(testConfig.nftRegistry, tokenId)).toLowerCase(), contractAddresses['SHELF'].toLowerCase() ) }) @@ -62,13 +71,16 @@ describe('borrower tests', async () => { it('success: unlock nft', async () => { // mint nft & issue loan const { tokenId, loanId } = await mintIssue(borrowerAccount.address, borrowerTinlake) - await borrowerTinlake.approveNFT(testConfig.nftRegistry, tokenId, contractAddresses['SHELF']) + const approveTx = await borrowerTinlake.approveNFT(testConfig.nftRegistry, tokenId, contractAddresses['SHELF']) + await borrowerTinlake.getTransactionReceipt(approveTx) // lock nft - await borrowerTinlake.lock(loanId) + const lockTx = await borrowerTinlake.lock(loanId) + await borrowerTinlake.getTransactionReceipt(lockTx) // unlock nft - await borrowerTinlake.unlock(loanId) + const unlockTx = await borrowerTinlake.unlock(loanId) + await borrowerTinlake.getTransactionReceipt(unlockTx) }) // TODO: does not work because NFT feed does not have value this NFT @@ -81,15 +93,24 @@ describe('borrower tests', async () => { it.skip('success: repay', async () => { const amount = '1000' const { loanId } = await mintIssueBorrow(borrowerAccount.address, borrowerTinlake, amount) + // wait to secs so that interest can accrue await new Promise((r) => setTimeout(r, 3000)) + // mint extra currency so that borrower can repay loan with interest - await governanceTinlake.mintCurrency(borrowerAccount.address, FAUCET_AMOUNT) + const mintTx = await governanceTinlake.mintCurrency(borrowerAccount.address, FAUCET_AMOUNT) + await governanceTinlake.getTransactionReceipt(mintTx) + // repay loan const initialDebt = await borrowerTinlake.getDebt(loanId) + // approve shelf to take currency - await borrowerTinlake.approveCurrency(contractAddresses['SHELF'], initialDebt.toString()) - const repayResult = await borrowerTinlake.repay(loanId, initialDebt.toString()) + const approveTx = await borrowerTinlake.approveCurrency(contractAddresses['SHELF'], initialDebt.toString()) + await borrowerTinlake.getTransactionReceipt(approveTx) + + const repayTx = await borrowerTinlake.repay(loanId, initialDebt.toString()) + const repayResult = await borrowerTinlake.getTransactionReceipt(repayTx) + const newDebt = await borrowerTinlake.getDebt(loanId) assert.equal(newDebt.toString(), '0') @@ -100,16 +121,21 @@ describe('borrower tests', async () => { async function mintIssue(usr: string, tinlake: ITinlake) { // super user mints nft for borrower const tokenId = `${Math.floor(Math.random() * 10e15) + 1}` - await governanceTinlake.mintNFT(testConfig.nftRegistry, usr, tokenId, '234', '345', '456') + const mintTx = await governanceTinlake.mintNFT(testConfig.nftRegistry, usr, tokenId, '234', '345', '456') + await governanceTinlake.getTransactionReceipt(mintTx) // assert usr = nftOwner const nftOwner = await tinlake.getNFTOwner(testConfig.nftRegistry, tokenId) assert.equal(`${nftOwner}`.toLowerCase(), usr.toLowerCase()) - const issueResult: any = await tinlake.issue(testConfig.nftRegistry, tokenId) + const issueTx = await tinlake.issue(testConfig.nftRegistry, tokenId) + const issueResult = await tinlake.getTransactionReceipt(issueTx) + const loanId = `${(await tinlake.loanCount()).toNumber() - 1}` + // assert loan successfully issued assert.equal(issueResult.status, SUCCESS_STATUS) + // assert usr = loanOwner const titleOwner = `${await tinlake.getOwnerOfLoan(loanId)}` assert.equal(titleOwner.toLowerCase(), usr.toLowerCase()) @@ -119,17 +145,26 @@ async function mintIssue(usr: string, tinlake: ITinlake) { async function mintIssueBorrow(usr: string, tinlake: ITinlake, amount: string) { const { tokenId, loanId } = await mintIssue(usr, tinlake) + // approve shelf to take nft - await borrowerTinlake.approveNFT(testConfig.nftRegistry, tokenId, contractAddresses['SHELF']) + const approveTx = await borrowerTinlake.approveNFT(testConfig.nftRegistry, tokenId, contractAddresses['SHELF']) + await borrowerTinlake.getTransactionReceipt(approveTx) + // lock nft - await borrowerTinlake.lock(loanId) + const lockTx = await borrowerTinlake.lock(loanId) + await borrowerTinlake.getTransactionReceipt(lockTx) const initialBorrowerCurrencyBalance = await borrowerTinlake.getCurrencyBalance(borrowerAccount.address) + // supply tranche with money console.log({ initialBorrowerCurrencyBalance }) - const borrowResult = await borrowerTinlake.borrow(loanId, amount) + + const borrowTx = await borrowerTinlake.borrow(loanId, amount) + const borrowResult = await borrowerTinlake.getTransactionReceipt(borrowTx) console.log({ borrowResult }) - const withdrawResult = await borrowerTinlake.withdraw(loanId, amount, borrowerAccount.address) + + const withdrawTx = await borrowerTinlake.withdraw(loanId, amount, borrowerAccount.address) + const withdrawResult = await borrowerTinlake.getTransactionReceipt(withdrawTx) console.log({ withdrawResult }) const newBorrowerCurrencyBalance = await borrowerTinlake.getCurrencyBalance(borrowerAccount.address) @@ -145,16 +180,27 @@ async function mintIssueBorrow(usr: string, tinlake: ITinlake, amount: string) { async function fundTranche(amount: string) { const lenderAccount = account.generate(randomString.generate(32)) const lenderTinlake = createTinlake(lenderAccount, testConfig) + // fund lender accoutn with eth await testProvider.fundAccountWithETH(lenderAccount.address, FAUCET_AMOUNT) + // make admin adress ward on tranche operator - await governanceTinlake.relyAddress(adminAccount.address, contractAddresses['JUNIOR_OPERATOR']) + const relyTx = await governanceTinlake.relyAddress(adminAccount.address, contractAddresses['JUNIOR_OPERATOR']) + await governanceTinlake.getTransactionReceipt(relyTx) + // whitelist lender - await adminTinlake.approveAllowanceJunior(lenderAccount.address, amount, amount) + const approveAllowanceTx = await adminTinlake.approveAllowanceJunior(lenderAccount.address, amount, amount) + await adminTinlake.getTransactionReceipt(approveAllowanceTx) + // lender approves tranche to take currency - await lenderTinlake.approveCurrency(contractAddresses['JUNIOR'], amount) + const approveCurrencyTx = await lenderTinlake.approveCurrency(contractAddresses['JUNIOR'], amount) + await lenderTinlake.getTransactionReceipt(approveCurrencyTx) + // mint currency for lender - await governanceTinlake.mintCurrency(lenderAccount.address, amount) + const mintTx = await governanceTinlake.mintCurrency(lenderAccount.address, amount) + await governanceTinlake.getTransactionReceipt(mintTx) + // lender supplies tranche with funds - await lenderTinlake.supplyJunior(amount) + const supplyTx = await lenderTinlake.supplyJunior(amount) + await lenderTinlake.getTransactionReceipt(supplyTx) } diff --git a/src/actions/borrower.ts b/src/actions/borrower.ts index 057ed01..ce629b6 100644 --- a/src/actions/borrower.ts +++ b/src/actions/borrower.ts @@ -1,74 +1,53 @@ -import { Constructor, TinlakeParams } from '../Tinlake' -import { waitAndReturnEvents, executeAndRetry } from '../services/ethereum' +import { Constructor, TinlakeParams, PendingTransaction } from '../Tinlake' import { ethers } from 'ethers' export function BorrowerActions>(Base: ActionsBase) { return class extends Base implements IBorrowerActions { issue = async (registry: string, tokenId: string) => { - const txHash = await executeAndRetry(this.contracts['SHELF'].issue, [registry, tokenId, this.ethConfig]) - console.log(`[Issue Loan] txHash: ${txHash}`) - return waitAndReturnEvents(this.eth, txHash, this.contracts['SHELF'].abi, this.transactionTimeout) + return this.pending(this.contract('SHELF').issue(registry, tokenId)) } nftLookup = async (registry: string, tokenId: string) => { const nft = ethers.utils.solidityKeccak256(['address', 'uint'], [registry, tokenId]) - console.log('NFT Look Up]') - const res = await executeAndRetry(this.contracts['SHELF'].nftlookup, [nft, this.ethConfig]) - return res[0].toString() + const loanId = await this.contract('SHELF').nftlookup(nft) + return loanId } lock = async (loan: string) => { - const txHash = await executeAndRetry(this.contracts['SHELF'].lock, [loan, this.ethConfig]) - console.log(`[Collateral NFT lock] txHash: ${txHash}`) - return waitAndReturnEvents(this.eth, txHash, this.contracts['SHELF'].abi, this.transactionTimeout) + return this.pending(this.contract('SHELF').lock(loan)) } unlock = async (loan: string) => { - const txHash = await executeAndRetry(this.contracts['SHELF'].unlock, [loan, this.ethConfig]) - console.log(`[Collateral NFT unlock] txHash: ${txHash}`) - return waitAndReturnEvents(this.eth, txHash, this.contracts['SHELF'].abi, this.transactionTimeout) + return this.pending(this.contract('SHELF').unlock(loan)) } close = async (loan: string) => { - const txHash = await executeAndRetry(this.contracts['SHELF'].close, [loan, this.ethConfig]) - console.log(`[Loan close] txHash: ${txHash}`) - return waitAndReturnEvents(this.eth, txHash, this.contracts['SHELF'].abi, this.transactionTimeout) + return this.pending(this.contract('SHELF').close(loan)) } borrow = async (loan: string, currencyAmount: string) => { - const txHash = await executeAndRetry(this.contracts['SHELF'].borrow, [loan, currencyAmount, this.ethConfig]) - console.log(`[Borrow] txHash: ${txHash}`) - return waitAndReturnEvents(this.eth, txHash, this.contracts['SHELF'].abi, this.transactionTimeout) + return this.pending(this.contract('SHELF').borrow(loan, currencyAmount)) } withdraw = async (loan: string, currencyAmount: string, usr: string) => { - const txHash = await executeAndRetry(this.contracts['SHELF'].withdraw, [ - loan, - currencyAmount, - usr, - this.ethConfig, - ]) - console.log(`[Withdraw] txHash: ${txHash}`) - return waitAndReturnEvents(this.eth, txHash, this.contracts['SHELF'].abi, this.transactionTimeout) + return this.pending(this.contract('SHELF').withdraw(loan, currencyAmount, usr)) } repay = async (loan: string, currencyAmount: string) => { - const txHash = await executeAndRetry(this.contracts['SHELF'].repay, [loan, currencyAmount, this.ethConfig]) - console.log(`[Repay] txHash: ${txHash}`) - return waitAndReturnEvents(this.eth, txHash, this.contracts['SHELF'].abi, this.transactionTimeout) + return this.pending(this.contract('SHELF').repay(loan, currencyAmount)) } } } export type IBorrowerActions = { - issue(registry: string, tokenId: string): Promise - nftLookup(registry: string, tokenId: string): Promise - lock(loan: string): Promise - unlock(loan: string): Promise - close(loan: string): Promise - borrow(loan: string, currencyAmount: string): Promise - withdraw(loan: string, currencyAmount: string, usr: string): Promise - repay(loan: string, currencyAmount: string): Promise + issue(registry: string, tokenId: string): Promise + nftLookup(registry: string, tokenId: string): Promise + lock(loan: string): Promise + unlock(loan: string): Promise + close(loan: string): Promise + borrow(loan: string, currencyAmount: string): Promise + withdraw(loan: string, currencyAmount: string, usr: string): Promise + repay(loan: string, currencyAmount: string): Promise } export default BorrowerActions diff --git a/src/actions/collateral.ts b/src/actions/collateral.ts index 47a172b..eaf67ea 100644 --- a/src/actions/collateral.ts +++ b/src/actions/collateral.ts @@ -53,7 +53,7 @@ export function CollateralActions return this.contract('COLLATERAL_NFT', nftAddress).data(tokenId) } - getNFTOwner = async (nftAddresss: string, tokenId: string): Promise => { + getNFTOwner = async (nftAddresss: string, tokenId: string): Promise => { return this.contract('COLLATERAL_NFT', nftAddresss).ownerOf(tokenId) } @@ -81,7 +81,7 @@ export type ICollateralActions = { isNFTApprovedForAll(nftAddr: string, owner: string, operator: string): Promise getNFTCount(nftAddr: string): Promise getNFTData(nftAddr: string, tokenId: string): Promise - getNFTOwner(nftAddr: string, tokenId: string): Promise + getNFTOwner(nftAddr: string, tokenId: string): Promise transferNFT(nftAddr: string, from: string, to: string, tokenId: string): Promise } diff --git a/src/actions/governance.ts b/src/actions/governance.ts index 95dd8ac..a02d4d8 100644 --- a/src/actions/governance.ts +++ b/src/actions/governance.ts @@ -10,8 +10,8 @@ function GovernanceActions>(Base: // const result = await waitAndReturnEvents(this.eth, txHash, rootContract.abi, this.transactionTimeout) // console.log('ethjs result', result) - console.log('usr', usr) - console.log('contractAddress', contractAddress) + // console.log('usr', usr) + // console.log('contractAddress', contractAddress) const contract = this.contract('ROOT_CONTRACT') const tx = contract.relyContract(contractAddress, usr) return this.pending(tx) diff --git a/src/test/config.ts b/src/test/config.ts index d7f4d9b..f02fdc3 100644 --- a/src/test/config.ts +++ b/src/test/config.ts @@ -12,7 +12,7 @@ const GWEI = 1000 * MWEI const MILLI_ETH = 1e15 // 0.001 ETH const FAUCET_AMOUNT = 5000 * MILLI_ETH -const GAS_PRICE = 5 * GWEI +const GAS_PRICE = 10 * GWEI const GAS = 1000000 const testConfig: ProviderConfig = { From 61ae69e80ae8176633f21af5bdf03bc2a5eb3412 Mon Sep 17 00:00:00 2001 From: Jeroen Offerijns Date: Wed, 2 Sep 2020 15:48:54 +0200 Subject: [PATCH 26/65] fix: pass gas limit override for all test transactions --- src/Tinlake.ts | 19 ++++++++------- src/actions/admin.ts | 18 ++++++++------ src/actions/borrower.spec.ts | 1 - src/actions/borrower.ts | 16 ++++++------- src/actions/collateral.ts | 43 +++++++++++++++------------------- src/actions/currency.ts | 4 ++-- src/actions/governance.spec.ts | 3 +-- src/actions/governance.ts | 11 +-------- src/actions/lender.ts | 26 +++++++++++++------- src/actions/proxy.ts | 10 ++++---- src/test/config.ts | 6 +++-- src/test/utils.ts | 1 + 12 files changed, 80 insertions(+), 78 deletions(-) diff --git a/src/Tinlake.ts b/src/Tinlake.ts index 1938fe7..fc9525c 100644 --- a/src/Tinlake.ts +++ b/src/Tinlake.ts @@ -47,7 +47,7 @@ export type EthConfig = { gas?: string } -export type EthersOverrides = { +export type Overrides = { gasPrice?: number gasLimit?: number } @@ -55,7 +55,6 @@ export type EthersOverrides = { export type EthersConfig = { provider: ethers.providers.Provider signer: ethers.Signer - overrides?: EthersOverrides } export type ContractName = typeof contractNames[number] @@ -79,6 +78,7 @@ export type TinlakeParams = { contractAbis?: ContractAbis | {} ethConfig?: EthConfig ethersConfig?: EthersConfig + overrides?: Overrides ethOptions?: any | {} contracts?: Contracts | {} contractConfig?: any | {} @@ -98,6 +98,7 @@ export default class Tinlake { public ethOptions: any public ethConfig: EthConfig public ethersConfig: EthersConfig + public overrides: Overrides = {} public contractAddresses: ContractAddresses public transactionTimeout: number public contracts: Contracts = {} @@ -114,6 +115,7 @@ export default class Tinlake { ethOptions, ethConfig, ethersConfig, + overrides, contractConfig, } = params if (!contractAbis) { @@ -123,6 +125,7 @@ export default class Tinlake { this.contractConfig = contractConfig || {} this.contractAddresses = contractAddresses || {} this.transactionTimeout = transactionTimeout + this.overrides = overrides || {} this.setProvider(provider, ethOptions, ethersConfig) this.setEthConfig(ethConfig || {}) this.setEthersConfig(ethersConfig) @@ -195,11 +198,11 @@ export default class Tinlake { contract(abiName: ContractName, address?: string): ethers.Contract { if (address) { return new ethers.Contract(address, this.contractAbis[abiName], this.ethersConfig.signer) - } if (this.ethersConfig.signer) { + } + if (this.ethersConfig.signer) { return this.ethersContracts[abiName].connect(this.ethersConfig.signer) - } - return this.ethersContracts[abiName] - + } + return this.ethersContracts[abiName] } async pending(txPromise: Promise): Promise { @@ -210,11 +213,11 @@ export default class Tinlake { hash: tx.hash, timesOutAt: Date.now() + this.transactionTimeout * 1000, } - } catch(e) { + } catch (e) { console.error(`Error caught in tinlake.pending(): ${e}`) return { status: 0, - error: e.message + error: e.message, } } } diff --git a/src/actions/admin.ts b/src/actions/admin.ts index 71002cf..8d0367b 100644 --- a/src/actions/admin.ts +++ b/src/actions/admin.ts @@ -70,34 +70,38 @@ export function AdminActions>(Bas initRate = async (ratePerSecond: string) => { const rateGroup = getRateGroup(ratePerSecond) // Source: https://github.com/ethereum/web3.js/issues/2256#issuecomment-462730550 - return this.pending(this.contract('PILE').file(web3.fromAscii('rate').padEnd(66, '0'), rateGroup, ratePerSecond)) + return this.pending( + this.contract('PILE').file(web3.fromAscii('rate').padEnd(66, '0'), rateGroup, ratePerSecond, this.overrides) + ) } changeRate = async (loan: string, ratePerSecond: string) => { const rateGroup = getRateGroup(ratePerSecond) - return this.pending(this.contract('PILE').changeRate(loan, rateGroup)) + return this.pending(this.contract('PILE').changeRate(loan, rateGroup, this.overrides)) } setRate = async (loan: string, ratePerSecond: string) => { const rateGroup = getRateGroup(ratePerSecond) - return this.pending(this.contract('PILE').setRatet(loan, rateGroup)) + return this.pending(this.contract('PILE').setRatet(loan, rateGroup, this.overrides)) } // ------------ admin functions lender-site ------------- setMinimumJuniorRatio = async (ratio: string) => { // Source: https://github.com/ethereum/web3.js/issues/2256#issuecomment-462730550 - return this.pending(this.contract('ASSESSOR').file(web3.fromAscii('minJuniorRatio').padEnd(66, '0'), ratio)) + return this.pending( + this.contract('ASSESSOR').file(web3.fromAscii('minJuniorRatio').padEnd(66, '0'), ratio, this.overrides) + ) } approveAllowanceJunior = async (user: string, maxCurrency: string, maxToken: string) => { - return this.pending(this.contract('JUNIOR_OPERATOR').approve(user, maxCurrency, maxToken)) + return this.pending(this.contract('JUNIOR_OPERATOR').approve(user, maxCurrency, maxToken, this.overrides)) } approveAllowanceSenior = async (user: string, maxCurrency: string, maxToken: string) => { if (this.getOperatorType('senior') === 'PROPORTIONAL_OPERATOR') { - return this.pending(this.contract('SENIOR_OPERATOR').approve(user, maxCurrency)) + return this.pending(this.contract('SENIOR_OPERATOR').approve(user, maxCurrency, this.overrides)) } - return this.pending(this.contract('SENIOR_OPERATOR').approve(user, maxCurrency, maxToken)) + return this.pending(this.contract('SENIOR_OPERATOR').approve(user, maxCurrency, maxToken, this.overrides)) } diff --git a/src/actions/borrower.spec.ts b/src/actions/borrower.spec.ts index 678be1f..7cfd1be 100644 --- a/src/actions/borrower.spec.ts +++ b/src/actions/borrower.spec.ts @@ -5,7 +5,6 @@ import testConfig from '../test/config' import { ITinlake } from '../types/tinlake' import { createTinlake, TestProvider } from '../test/utils' import { Account } from '../test/types' -import { ethers } from 'ethers' import BN from 'bn.js' const adminAccount = account.generate(randomString.generate(32)) diff --git a/src/actions/borrower.ts b/src/actions/borrower.ts index ce629b6..9c9ceea 100644 --- a/src/actions/borrower.ts +++ b/src/actions/borrower.ts @@ -4,37 +4,37 @@ import { ethers } from 'ethers' export function BorrowerActions>(Base: ActionsBase) { return class extends Base implements IBorrowerActions { issue = async (registry: string, tokenId: string) => { - return this.pending(this.contract('SHELF').issue(registry, tokenId)) + return this.pending(this.contract('SHELF').issue(registry, tokenId, this.overrides)) } nftLookup = async (registry: string, tokenId: string) => { const nft = ethers.utils.solidityKeccak256(['address', 'uint'], [registry, tokenId]) - const loanId = await this.contract('SHELF').nftlookup(nft) + const loanId = await this.contract('SHELF').nftlookup(nft, this.overrides) return loanId } lock = async (loan: string) => { - return this.pending(this.contract('SHELF').lock(loan)) + return this.pending(this.contract('SHELF').lock(loan, this.overrides)) } unlock = async (loan: string) => { - return this.pending(this.contract('SHELF').unlock(loan)) + return this.pending(this.contract('SHELF').unlock(loan, this.overrides)) } close = async (loan: string) => { - return this.pending(this.contract('SHELF').close(loan)) + return this.pending(this.contract('SHELF').close(loan, this.overrides)) } borrow = async (loan: string, currencyAmount: string) => { - return this.pending(this.contract('SHELF').borrow(loan, currencyAmount)) + return this.pending(this.contract('SHELF').borrow(loan, currencyAmount, this.overrides)) } withdraw = async (loan: string, currencyAmount: string, usr: string) => { - return this.pending(this.contract('SHELF').withdraw(loan, currencyAmount, usr)) + return this.pending(this.contract('SHELF').withdraw(loan, currencyAmount, usr, this.overrides)) } repay = async (loan: string, currencyAmount: string) => { - return this.pending(this.contract('SHELF').repay(loan, currencyAmount)) + return this.pending(this.contract('SHELF').repay(loan, currencyAmount, this.overrides)) } } } diff --git a/src/actions/collateral.ts b/src/actions/collateral.ts index eaf67ea..229a6bc 100644 --- a/src/actions/collateral.ts +++ b/src/actions/collateral.ts @@ -1,20 +1,19 @@ import { Constructor, TinlakeParams, PendingTransaction } from '../Tinlake' -import { waitAndReturnEvents, executeAndRetry } from '../services/ethereum' import BN from 'bn.js' export function CollateralActions>(Base: ActionsBase) { return class extends Base implements ICollateralActions { mintTitleNFT = async (nftAddr: string, user: string) => { - const nft: any = this.eth.contract(this.contractAbis['COLLATERAL_NFT']).at(nftAddr) - const txHash = await executeAndRetry(nft.issue, [user, this.ethConfig]) - console.log(`[Mint NFT] txHash: ${txHash}`) - const res: any = await waitAndReturnEvents( - this.eth, - txHash, - this.contractAbis['COLLATERAL_NFT'], - this.transactionTimeout - ) - return res.events[0].data[2].toString() + // TODO: this is untested right now + const tx = await this.contract('COLLATERAL_NFT', nftAddr).issue(user, this.overrides) + const receipt = await this.getTransactionReceipt(tx) + + if (!(receipt.logs && receipt.logs[0])) { + throw new Error('Event missing in collateralNft.issue(user) receipt') + } + + const parsedLog = this.contract('PROXY_REGISTRY').interface.parseLog(receipt.logs[0]) + return parsedLog.values['2'].toString() } mintNFT = async ( @@ -26,27 +25,25 @@ export function CollateralActions asset: string ) => { const nft = this.contract('COLLATERAL_NFT', nftAddress) - return this.pending(nft.mint(owner, tokenId, ref, amount, asset)) + return this.pending(nft.mint(owner, tokenId, ref, amount, asset, this.overrides)) } approveNFT = async (nftAddress: string, tokenId: string, to: string) => { const nft = this.contract('COLLATERAL_NFT', nftAddress) - return this.pending(nft.approve(to, tokenId)) + return this.pending(nft.approve(to, tokenId, this.overrides)) } setNFTApprovalForAll = async (nftAddress: string, to: string, approved: boolean) => { const nft = this.contract('COLLATERAL_NFT', nftAddress) - return this.pending(nft.setApprovalForAll(to, approved)) + return this.pending(nft.setApprovalForAll(to, approved, this.overrides)) } isNFTApprovedForAll = async (nftAddress: string, owner: string, operator: string) => { return this.contract('COLLATERAL_NFT', nftAddress).isApprovedForAll(owner, operator) } - getNFTCount = async (nftAddr: string): Promise => { - const nft: any = this.eth.contract(this.contractAbis['COLLATERAL_NFT']).at(nftAddr) - const res: { 0: BN } = await executeAndRetry(nft.count, []) - return res[0] + getNFTCount = async (nftAddress: string): Promise => { + return (await this.contract('COLLATERAL_NFT', nftAddress).count()).toBN() } getNFTData = async (nftAddress: string, tokenId: string): Promise => { @@ -58,16 +55,14 @@ export function CollateralActions } transferNFT = async (nftAddress: string, from: string, to: string, tokenId: string) => { - const nft: any = this.eth.contract(this.contractAbis['COLLATERAL_NFT']).at(nftAddress) - const txHash = await executeAndRetry(nft.transferFrom, [from, to, tokenId, this.ethConfig]) - console.log(`[NFT Approve] txHash: ${txHash}`) - return waitAndReturnEvents(this.eth, txHash, this.contractAbis['COLLATERAL_NFT'], this.transactionTimeout) + const nft = this.contract('COLLATERAL_NFT', nftAddress) + return this.pending(nft.transferFrom(from, to, tokenId, this.overrides)) } } } export type ICollateralActions = { - mintTitleNFT(nftAddr: string, usr: string): Promise + mintTitleNFT(nftAddr: string, usr: string): Promise mintNFT( nftAddr: string, owner: string, @@ -82,7 +77,7 @@ export type ICollateralActions = { getNFTCount(nftAddr: string): Promise getNFTData(nftAddr: string, tokenId: string): Promise getNFTOwner(nftAddr: string, tokenId: string): Promise - transferNFT(nftAddr: string, from: string, to: string, tokenId: string): Promise + transferNFT(nftAddr: string, from: string, to: string, tokenId: string): Promise } export default CollateralActions diff --git a/src/actions/currency.ts b/src/actions/currency.ts index 99c5a28..b9fd3d0 100644 --- a/src/actions/currency.ts +++ b/src/actions/currency.ts @@ -5,7 +5,7 @@ export function CurrencyActions>( return class extends Base implements ICurrencyActions { // move out for tests only mintCurrency = async (usr: string, amount: string) => { - return this.pending(this.contract('TINLAKE_CURRENCY').mint(usr, amount)) + return this.pending(this.contract('TINLAKE_CURRENCY').mint(usr, amount, this.overrides)) } getCurrencyAllowance = async (owner: string, spender: string) => { @@ -29,7 +29,7 @@ export function CurrencyActions>( approveCurrency = async (usr: string, currencyAmount: string) => { const currencyContract = this.contract('TINLAKE_CURRENCY') - return this.pending(currencyContract.approve(usr, currencyAmount)) + return this.pending(currencyContract.approve(usr, currencyAmount, this.overrides)) } approveSeniorForCurrency = async (currencyAmount: string) => { diff --git a/src/actions/governance.spec.ts b/src/actions/governance.spec.ts index a4bea87..e365fc7 100644 --- a/src/actions/governance.spec.ts +++ b/src/actions/governance.spec.ts @@ -42,9 +42,8 @@ describe('governance tests', async () => { const randomTinlake = createTinlake(randomAccount, testConfig) const tx = await randomTinlake.relyAddress(userAccount.address, testConfig.contractAddresses['PILE']) - console.log('tx', tx) const res = await randomTinlake.getTransactionReceipt(tx) - console.log('res', res) + assert.equal(res.status, FAIL_STATUS) }) }) diff --git a/src/actions/governance.ts b/src/actions/governance.ts index a02d4d8..2fb4c9b 100644 --- a/src/actions/governance.ts +++ b/src/actions/governance.ts @@ -1,19 +1,10 @@ import { Constructor, TinlakeParams, PendingTransaction } from '../Tinlake' -import { executeAndRetry, waitAndReturnEvents } from '../services/ethereum' function GovernanceActions>(Base: ActionsBase) { return class extends Base implements IGovernanceActions { relyAddress = async (usr: string, contractAddress: string) => { - // const rootContract = this.contracts['ROOT_CONTRACT'] - // const txHash = await executeAndRetry(rootContract.relyContract, [contractAddress, usr, this.ethConfig]) - // console.log(`[Rely usr ${usr}] txHash: ${txHash} on contract ${contractAddress}`) - // const result = await waitAndReturnEvents(this.eth, txHash, rootContract.abi, this.transactionTimeout) - // console.log('ethjs result', result) - - // console.log('usr', usr) - // console.log('contractAddress', contractAddress) const contract = this.contract('ROOT_CONTRACT') - const tx = contract.relyContract(contractAddress, usr) + const tx = contract.relyContract(contractAddress, usr, this.overrides) return this.pending(tx) } } diff --git a/src/actions/lender.ts b/src/actions/lender.ts index 3a3659f..d1160bc 100644 --- a/src/actions/lender.ts +++ b/src/actions/lender.ts @@ -5,41 +5,49 @@ export function LenderActions>(Bas return class extends Base implements ILenderActions { // senior tranche functions supplySenior = async (currencyAmount: string) => { - return this.pending(this.contract('SENIOR_OPERATOR').supply(currencyAmount)) + return this.pending(this.contract('SENIOR_OPERATOR').supply(currencyAmount, this.overrides)) } redeemSenior = async (tokenAmount: string) => { - return this.pending(this.contract('SENIOR_OPERATOR').redeem(tokenAmount)) + return this.pending(this.contract('SENIOR_OPERATOR').redeem(tokenAmount, this.overrides)) } getSeniorTokenAllowance = async (owner: string) => { - return (await this.contract('SENIOR_TOKEN').allowance(owner, this.contractAddresses['SENIOR'])).toBN() + return ( + await this.contract('SENIOR_TOKEN').allowance(owner, this.contractAddresses['SENIOR'], this.overrides) + ).toBN() } approveSeniorToken = async (tokenAmount: string) => { - return this.pending(this.contract('SENIOR_TOKEN').approve(this.contractAddresses['SENIOR'], tokenAmount)) + return this.pending( + this.contract('SENIOR_TOKEN').approve(this.contractAddresses['SENIOR'], tokenAmount, this.overrides) + ) } // junior tranche functions supplyJunior = async (currencyAmount: string) => { - return this.pending(this.contract('JUNIOR_OPERATOR').supply(currencyAmount)) + return this.pending(this.contract('JUNIOR_OPERATOR').supply(currencyAmount, this.overrides)) } redeemJunior = async (tokenAmount: string) => { - return this.pending(this.contract('JUNIOR_OPERATOR').redeem(tokenAmount)) + return this.pending(this.contract('JUNIOR_OPERATOR').redeem(tokenAmount, this.overrides)) } getJuniorTokenAllowance = async (owner: string) => { - return (await this.contract('JUNIOR_TOKEN').allowance(owner, this.contractAddresses['JUNIOR'])).toBN() + return ( + await this.contract('JUNIOR_TOKEN').allowance(owner, this.contractAddresses['JUNIOR'], this.overrides) + ).toBN() } approveJuniorToken = async (tokenAmount: string) => { - return this.pending(this.contract('JUNIOR_TOKEN').approve(this.contractAddresses['JUNIOR'], tokenAmount)) + return this.pending( + this.contract('JUNIOR_TOKEN').approve(this.contractAddresses['JUNIOR'], tokenAmount, this.overrides) + ) } // general lender functions balance = async () => { - return this.pending(this.contract('DISTRIBUTOR').balance()) + return this.pending(this.contract('DISTRIBUTOR').balance(this.overrides)) } } } diff --git a/src/actions/proxy.ts b/src/actions/proxy.ts index 57b7d58..1b4611e 100644 --- a/src/actions/proxy.ts +++ b/src/actions/proxy.ts @@ -10,7 +10,7 @@ export function ProxyActions>(Bas } buildProxy = async (owner: string) => { - const tx = await this.contract('PROXY_REGISTRY')['build(address)'](owner) + const tx = await this.contract('PROXY_REGISTRY')['build(address)'](owner, this.overrides) const receipt = await this.getTransactionReceipt(tx) if (!(receipt.logs && receipt.logs[1])) { @@ -82,7 +82,7 @@ export function ProxyActions>(Bas [this.contract('SHELF').address, nftRegistryAddress, tokenId] ) - return this.pending(proxy.execute(this.contract('ACTIONS').address, encoded)) + return this.pending(proxy.execute(this.contract('ACTIONS').address, encoded, this.overrides)) } proxyTransferIssue = async (proxyAddress: string, nftRegistryAddress: string, tokenId: string) => { @@ -100,7 +100,7 @@ export function ProxyActions>(Bas [this.contract('SHELF').address, nftRegistryAddress, tokenId] ) - return this.pending(proxy.execute(this.contract('ACTIONS').address, encoded)) + return this.pending(proxy.execute(this.contract('ACTIONS').address, encoded, this.overrides)) } proxyLockBorrowWithdraw = async (proxyAddress: string, loanId: string, amount: string, usr: string) => { @@ -119,7 +119,7 @@ export function ProxyActions>(Bas [this.contract('SHELF').address, loanId, amount, usr] ) - return this.pending(proxy.execute(this.contract('ACTIONS').address, encoded)) + return this.pending(proxy.execute(this.contract('ACTIONS').address, encoded, this.overrides)) } proxyRepayUnlockClose = async (proxyAddress: string, tokenId: string, loanId: string, registry: string) => { @@ -147,7 +147,7 @@ export function ProxyActions>(Bas ] ) - return this.pending(proxy.execute(this.contract('ACTIONS').address, encoded)) + return this.pending(proxy.execute(this.contract('ACTIONS').address, encoded, this.overrides)) } } } diff --git a/src/test/config.ts b/src/test/config.ts index f02fdc3..cdb2553 100644 --- a/src/test/config.ts +++ b/src/test/config.ts @@ -13,7 +13,7 @@ const MILLI_ETH = 1e15 // 0.001 ETH const FAUCET_AMOUNT = 5000 * MILLI_ETH const GAS_PRICE = 10 * GWEI -const GAS = 1000000 +const GAS_LIMIT = 1000000 const testConfig: ProviderConfig = { contractAddresses: (process.env.CONTRACTS && JSON.parse(process.env.CONTRACTS)) || contractAddresses, @@ -25,7 +25,8 @@ const testConfig: ProviderConfig = { nftRegistry: process.env.NFT_REGISTRY || '0xac0c1ef395290288028a0a9fdfc8fdebebe54a24', transactionTimeout: 50000, gasPrice: `${GAS_PRICE}`, - gas: `${GAS}`, + gas: `${GAS_LIMIT}`, + overrides: { gasLimit: GAS_LIMIT }, rpcUrl: process.env.RPC_URL || 'http://127.0.0.1:8545', isRealTestnet: false, contractAbis: abiDefinitions, @@ -49,6 +50,7 @@ export type ProviderConfig = { SUCCESS_STATUS: 1 FAIL_STATUS: 0 FAUCET_AMOUNT: string + overrides: any } export default testConfig diff --git a/src/test/utils.ts b/src/test/utils.ts index e11da7e..ae68e38 100644 --- a/src/test/utils.ts +++ b/src/test/utils.ts @@ -40,6 +40,7 @@ export function createTinlake(usr: Account, testConfig: ProviderConfig): ITinlak transactionTimeout, provider: createSignerProvider(rpcUrl, usr), ethConfig: { gas, gasPrice, from: usr.address }, + overrides: testConfig.overrides, ethersConfig: createEthersConfig(rpcUrl, usr), }) From 3ab37ee2158a0a7432100f187824c4d182d95ef6 Mon Sep 17 00:00:00 2001 From: Jeroen Offerijns Date: Wed, 2 Sep 2020 16:06:57 +0200 Subject: [PATCH 27/65] =?UTF-8?q?fix:=20remaining=20tests=20=F0=9F=8E=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/actions/analytics.ts | 9 ++------- src/actions/lender.spec.ts | 18 ++++++++++-------- 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/src/actions/analytics.ts b/src/actions/analytics.ts index 8672fd9..795ade0 100644 --- a/src/actions/analytics.ts +++ b/src/actions/analytics.ts @@ -189,15 +189,10 @@ export function AnalyticsActions> let maxRedeem: BN switch (operatorType) { case 'PROPORTIONAL_OPERATOR': - const redeemLimitRes: { 0: BN } = await executeAndRetry( - this.contracts['SENIOR_OPERATOR'].calcMaxRedeemToken, - [user] - ) - maxRedeem = redeemLimitRes[0] + maxRedeem = (await this.contract('SENIOR_OPERATOR').calcMaxRedeemToken(user)).toBN() break case 'ALLOWANCE_OPERATOR': - const res: { 0: BN } = await executeAndRetry(this.contracts['SENIOR_OPERATOR'].maxToken, [user]) - maxRedeem = res[0] + maxRedeem = (await this.contract('SENIOR_OPERATOR').maxToken(user)).toBN() break default: maxRedeem = new BN(0) diff --git a/src/actions/lender.spec.ts b/src/actions/lender.spec.ts index cb0c84b..95ef0df 100644 --- a/src/actions/lender.spec.ts +++ b/src/actions/lender.spec.ts @@ -52,18 +52,19 @@ describe('lender functions', async () => { // approve junior tranche to take currency const approveTx = await lenderTinlake.approveCurrency(contractAddresses['JUNIOR'], currencyAmount) const approval = await lenderTinlake.getTransactionReceipt(approveTx) - console.log('approval', approval) + // console.log('approval', approval) // fund investor with tinlake currency const mintTx = await governanceTinlake.mintCurrency(lenderAccount.address, currencyAmount) const mint = await governanceTinlake.getTransactionReceipt(mintTx) - console.log('mint', mint) + // console.log('mint', mint) // do not set allowance for lender const supplyTx = await lenderTinlake.supplyJunior(currencyAmount) + const supplyResult = await lenderTinlake.getTransactionReceipt(supplyTx) - // assert result successful - assert.equal(supplyTx.status, FAIL_STATUS) + // assert result failed + assert.equal(supplyResult.status, FAIL_STATUS) }) it('success: redeem junior', async () => { @@ -120,9 +121,10 @@ describe('lender functions', async () => { await lenderTinlake.getTransactionReceipt(lenderApproveTx) const redeemTx = await lenderTinlake.redeemJunior(tokenAmount) - console.log(redeemTx) + const redeemResult = await lenderTinlake.getTransactionReceipt(redeemTx) + // console.log(redeemTx) - assert.equal(redeemTx.status, FAIL_STATUS) + assert.equal(redeemResult.status, FAIL_STATUS) }) }) @@ -140,9 +142,9 @@ async function supply(investor: string, currencyAmount: string, tinlake: ITinlak const initialJuniorTokenBalance = await tinlake.getJuniorTokenBalance(investor) const supplyTx = await tinlake.supplyJunior(currencyAmount) - console.log('supplyTx', supplyTx) + // console.log('supplyTx', supplyTx) const supplyResult = await tinlake.getTransactionReceipt(supplyTx) - console.log('supplyResult', supplyResult) + // console.log('supplyResult', supplyResult) const newTrancheCurrencyBalance = await tinlake.getCurrencyBalance(contractAddresses['JUNIOR']) const newLenderCurrencyBalance = await tinlake.getCurrencyBalance(investor) From 1f6c8aa3d5b9ff493e65cd7c664dd10084461827 Mon Sep 17 00:00:00 2001 From: Jeroen Offerijns Date: Wed, 2 Sep 2020 18:26:23 +0200 Subject: [PATCH 28/65] fix: remove eth.js --- package-lock.json | 273 --------------------------------------- package.json | 5 - src/Tinlake.ts | 68 ++-------- src/actions/analytics.ts | 27 ++-- src/actions/proxy.ts | 4 + src/services/ethereum.ts | 78 ----------- src/types/tinlake.ts | 3 +- 7 files changed, 29 insertions(+), 429 deletions(-) diff --git a/package-lock.json b/package-lock.json index f0468a9..931e28a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -102,15 +102,6 @@ "integrity": "sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==", "dev": true }, - "@types/ethjs-signer": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/@types/ethjs-signer/-/ethjs-signer-0.1.0.tgz", - "integrity": "sha512-Bom/6SlljFQexWsxYnMLcR18kQxUcqqfXWct7c1ZMNXYzyNNsF5RP60x7cdAhURnlYEmiTGCTO58YEhe063YbA==", - "dev": true, - "requires": { - "@types/node": "*" - } - }, "@types/json5": { "version": "0.0.29", "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", @@ -277,15 +268,6 @@ "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==", "dev": true }, - "babel-runtime": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz", - "integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=", - "requires": { - "core-js": "^2.4.0", - "regenerator-runtime": "^0.11.0" - } - }, "balanced-match": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", @@ -623,11 +605,6 @@ "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=", "dev": true }, - "core-js": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.9.tgz", - "integrity": "sha512-HOpZf6eXmnl7la+cUdMnLvUxKNqLUzJvgIziQ0DiF3JwSImNphIqdGqzj6hIKyX04MmV0poclQ7+wjWvxQyR2A==" - }, "core-util-is": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", @@ -833,17 +810,6 @@ "integrity": "sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI=", "dev": true }, - "elliptic": { - "version": "6.3.2", - "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.3.2.tgz", - "integrity": "sha1-5MgeCCnPCmWrcOmYuCMnI7XBvEg=", - "requires": { - "bn.js": "^4.4.0", - "brorand": "^1.0.1", - "hash.js": "^1.0.0", - "inherits": "^2.0.1" - } - }, "emoji-regex": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", @@ -998,197 +964,6 @@ } } }, - "ethjs": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/ethjs/-/ethjs-0.4.0.tgz", - "integrity": "sha512-UnQeRMpQ+JETN2FviexEskUwByid+eO8rybjPnk2DNUzjUn0VKNrUbiCAud7Es6otDFwjUeOS58vMZwkZxIIog==", - "requires": { - "bn.js": "4.11.6", - "ethjs-abi": "0.2.1", - "ethjs-contract": "0.2.3", - "ethjs-filter": "0.1.8", - "ethjs-provider-http": "0.1.6", - "ethjs-query": "0.3.8", - "ethjs-unit": "0.1.6", - "ethjs-util": "0.1.3", - "js-sha3": "0.5.5", - "number-to-bn": "1.7.0" - } - }, - "ethjs-abi": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/ethjs-abi/-/ethjs-abi-0.2.1.tgz", - "integrity": "sha1-4KepOn6BFjqUR3utVu3lJKtt5TM=", - "requires": { - "bn.js": "4.11.6", - "js-sha3": "0.5.5", - "number-to-bn": "1.7.0" - } - }, - "ethjs-account": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/ethjs-account/-/ethjs-account-0.1.4.tgz", - "integrity": "sha1-J6g3hr0MM7FiW+hgjcIrAJ2/e4c=", - "requires": { - "elliptic": "6.3.2", - "ethjs-sha3": "0.1.2", - "randomhex": "0.1.5", - "strip-hex-prefix": "^1.0.0" - } - }, - "ethjs-contract": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/ethjs-contract/-/ethjs-contract-0.2.3.tgz", - "integrity": "sha512-fKsHm57wxwHrZhVlD8AHU2lC2G3c1fmvoEz15BpqIkuGWiTbjuvrQo2Avc+3EQpSsTFWNdyxC0h1WKRcn5kkyQ==", - "requires": { - "babel-runtime": "^6.26.0", - "ethjs-abi": "0.2.0", - "ethjs-filter": "0.1.8", - "ethjs-util": "0.1.3", - "js-sha3": "0.5.5" - }, - "dependencies": { - "ethjs-abi": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/ethjs-abi/-/ethjs-abi-0.2.0.tgz", - "integrity": "sha1-0+LCIQEVIPxJm3FoIDbBT8wvWyU=", - "requires": { - "bn.js": "4.11.6", - "js-sha3": "0.5.5", - "number-to-bn": "1.7.0" - } - } - } - }, - "ethjs-filter": { - "version": "0.1.8", - "resolved": "https://registry.npmjs.org/ethjs-filter/-/ethjs-filter-0.1.8.tgz", - "integrity": "sha512-qTDPskDL2UadHwjvM8A+WG9HwM4/FoSY3p3rMJORkHltYcAuiQZd2otzOYKcL5w2Q3sbAkW/E3yt/FPFL/AVXA==" - }, - "ethjs-format": { - "version": "0.2.7", - "resolved": "https://registry.npmjs.org/ethjs-format/-/ethjs-format-0.2.7.tgz", - "integrity": "sha512-uNYAi+r3/mvR3xYu2AfSXx5teP4ovy9z2FrRsblU+h2logsaIKZPi9V3bn3V7wuRcnG0HZ3QydgZuVaRo06C4Q==", - "requires": { - "bn.js": "4.11.6", - "ethjs-schema": "0.2.1", - "ethjs-util": "0.1.3", - "is-hex-prefixed": "1.0.0", - "number-to-bn": "1.7.0", - "strip-hex-prefix": "1.0.0" - } - }, - "ethjs-provider-http": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/ethjs-provider-http/-/ethjs-provider-http-0.1.6.tgz", - "integrity": "sha1-HsXZtL4lfvHValALIqdBmF6IlCA=", - "requires": { - "xhr2": "0.1.3" - } - }, - "ethjs-provider-signer": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/ethjs-provider-signer/-/ethjs-provider-signer-0.1.4.tgz", - "integrity": "sha1-a9XLOKjVsN30asHiOmDuoXFhca4=", - "requires": { - "ethjs-provider-http": "0.1.6", - "ethjs-rpc": "0.1.2" - }, - "dependencies": { - "ethjs-format": { - "version": "0.1.8", - "resolved": "https://registry.npmjs.org/ethjs-format/-/ethjs-format-0.1.8.tgz", - "integrity": "sha1-kl7N2WXqcqKi2vKhIuW/gLWtUio=", - "requires": { - "bn.js": "4.11.6", - "ethjs-schema": "0.1.4", - "ethjs-util": "0.1.3", - "is-hex-prefixed": "1.0.0", - "number-to-bn": "1.7.0", - "strip-hex-prefix": "1.0.0" - } - }, - "ethjs-rpc": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/ethjs-rpc/-/ethjs-rpc-0.1.2.tgz", - "integrity": "sha1-OaNFa1HFmu6vtbpVZYmlny2ojSY=", - "requires": { - "ethjs-format": "0.1.8" - } - }, - "ethjs-schema": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/ethjs-schema/-/ethjs-schema-0.1.4.tgz", - "integrity": "sha1-AyOhYzOxrOmo8daWpu5jRI/dRV8=" - } - } - }, - "ethjs-query": { - "version": "0.3.8", - "resolved": "https://registry.npmjs.org/ethjs-query/-/ethjs-query-0.3.8.tgz", - "integrity": "sha512-/J5JydqrOzU8O7VBOwZKUWXxHDGr46VqNjBCJgBVNNda+tv7Xc8Y2uJc6aMHHVbeN3YOQ7YRElgIc0q1CI02lQ==", - "requires": { - "babel-runtime": "^6.26.0", - "ethjs-format": "0.2.7", - "ethjs-rpc": "0.2.0", - "promise-to-callback": "^1.0.0" - } - }, - "ethjs-rpc": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/ethjs-rpc/-/ethjs-rpc-0.2.0.tgz", - "integrity": "sha512-RINulkNZTKnj4R/cjYYtYMnFFaBcVALzbtEJEONrrka8IeoarNB9Jbzn+2rT00Cv8y/CxAI+GgY1d0/i2iQeOg==", - "requires": { - "promise-to-callback": "^1.0.0" - } - }, - "ethjs-schema": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/ethjs-schema/-/ethjs-schema-0.2.1.tgz", - "integrity": "sha512-DXd8lwNrhT9sjsh/Vd2Z+4pfyGxhc0POVnLBUfwk5udtdoBzADyq+sK39dcb48+ZU+2VgtwHxtGWnLnCfmfW5g==" - }, - "ethjs-sha3": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/ethjs-sha3/-/ethjs-sha3-0.1.2.tgz", - "integrity": "sha1-4D9sNKPEIGvewo1BdNbX/wZqFdI=", - "requires": { - "hash.js": "1.0.3" - }, - "dependencies": { - "hash.js": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.0.3.tgz", - "integrity": "sha1-EzL/ABVsCg/92CNgE9B7d6BFFXM=", - "requires": { - "inherits": "^2.0.1" - } - } - } - }, - "ethjs-signer": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/ethjs-signer/-/ethjs-signer-0.1.1.tgz", - "integrity": "sha1-Cvd5YeKe5FhgOqvTZguIaNM4ZEE=", - "requires": { - "elliptic": "6.3.2", - "js-sha3": "0.5.5", - "number-to-bn": "1.1.0", - "rlp": "2.0.0", - "strip-hex-prefix": "1.0.0" - }, - "dependencies": { - "number-to-bn": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/number-to-bn/-/number-to-bn-1.1.0.tgz", - "integrity": "sha1-UaM4fFvGgDWrQFjGJhMvdn2dCL8=", - "requires": { - "bn.js": "4.11.6", - "is-hex-prefixed": "1.0.0", - "strip-hex-prefix": "1.0.0" - } - } - } - }, "ethjs-unit": { "version": "0.1.6", "resolved": "https://registry.npmjs.org/ethjs-unit/-/ethjs-unit-0.1.6.tgz", @@ -1198,15 +973,6 @@ "number-to-bn": "1.7.0" } }, - "ethjs-util": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/ethjs-util/-/ethjs-util-0.1.3.tgz", - "integrity": "sha1-39XqSkANxeQhqInK9H4IGtp4u1U=", - "requires": { - "is-hex-prefixed": "1.0.0", - "strip-hex-prefix": "1.0.0" - } - }, "execa": { "version": "0.7.0", "resolved": "https://registry.npmjs.org/execa/-/execa-0.7.0.tgz", @@ -2605,11 +2371,6 @@ "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", "dev": true }, - "is-fn": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-fn/-/is-fn-1.0.0.tgz", - "integrity": "sha1-lUPV3nvPWwiiLsiiC65uKG1RDYw=" - }, "is-fullwidth-code-point": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", @@ -2765,11 +2526,6 @@ "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", "dev": true }, - "js-sha3": { - "version": "0.5.5", - "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.5.5.tgz", - "integrity": "sha1-uvDA6MVK1ZA0R9+Wreekobynmko=" - }, "js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", @@ -3554,15 +3310,6 @@ "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", "dev": true }, - "promise-to-callback": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/promise-to-callback/-/promise-to-callback-1.0.0.tgz", - "integrity": "sha1-XSp0kBC/tn2WNZj805YHRqaP7vc=", - "requires": { - "is-fn": "^1.0.0", - "set-immediate-shim": "^1.0.1" - } - }, "pseudomap": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", @@ -3668,11 +3415,6 @@ "integrity": "sha512-Ts1Y/anZELhSsjMcU605fU9RE4Oi3p5ORujwbIKXfWa+0Zxs510Qrmrce5/Jowq3cHSZSJqBjypxmHarc+vEWg==", "dev": true }, - "regenerator-runtime": { - "version": "0.11.1", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", - "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==" - }, "regex-not": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", @@ -3757,11 +3499,6 @@ "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", "dev": true }, - "rlp": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/rlp/-/rlp-2.0.0.tgz", - "integrity": "sha1-nbOE/0uJqPYVY9kjldhiWxjzr7A=" - }, "rollup": { "version": "1.16.3", "resolved": "https://registry.npmjs.org/rollup/-/rollup-1.16.3.tgz", @@ -3933,11 +3670,6 @@ "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=" }, - "set-immediate-shim": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz", - "integrity": "sha1-SysbJ+uAip+NzEgaWOXlb1mfP2E=" - }, "set-value": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz", @@ -5035,11 +4767,6 @@ "xhr-request": "^1.0.1" } }, - "xhr2": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/xhr2/-/xhr2-0.1.3.tgz", - "integrity": "sha1-y/xHWaabSoiOeM9PILBRA4dXvRE=" - }, "xmlhttprequest": { "version": "1.8.0", "resolved": "https://registry.npmjs.org/xmlhttprequest/-/xmlhttprequest-1.8.0.tgz", diff --git a/package.json b/package.json index 6efff7d..1b5d2b4 100644 --- a/package.json +++ b/package.json @@ -13,10 +13,6 @@ "decimal.js-light": "^2.5.0", "dotenv": "^8.2.0", "ethers": "4.0.45", - "ethjs": "^0.4.0", - "ethjs-account": "^0.1.4", - "ethjs-provider-signer": "^0.1.4", - "ethjs-signer": "^0.1.1", "mocha": "^6.1.4", "randomstring": "^1.1.5", "web3-eth-abi": "^1.2.6", @@ -25,7 +21,6 @@ "devDependencies": { "@types/assert": "^1.4.2", "@types/bn.js": "^4.11.6", - "@types/ethjs-signer": "^0.1.0", "@types/mocha": "^5.2.7", "@types/node": "^13.11.0", "@types/web3-eth-abi": "^1.0.0", diff --git a/src/Tinlake.ts b/src/Tinlake.ts index fc9525c..06f8ce0 100644 --- a/src/Tinlake.ts +++ b/src/Tinlake.ts @@ -1,5 +1,3 @@ -import Eth from 'ethjs' -import { ethI } from './services/ethereum' import abiDefinitions from './abi' import { ethers } from 'ethers' import BN from 'bn.js' @@ -41,12 +39,6 @@ export type PendingTransaction = { timesOutAt?: number } -export type EthConfig = { - from?: string - gasPrice?: string - gas?: string -} - export type Overrides = { gasPrice?: number gasLimit?: number @@ -54,7 +46,7 @@ export type Overrides = { export type EthersConfig = { provider: ethers.providers.Provider - signer: ethers.Signer + signer?: ethers.providers.Web3Provider } export type ContractName = typeof contractNames[number] @@ -72,12 +64,10 @@ export type ContractAddresses = { } export type TinlakeParams = { - provider: any + ethersConfig: EthersConfig transactionTimeout: number contractAddresses?: ContractAddresses | {} contractAbis?: ContractAbis | {} - ethConfig?: EthConfig - ethersConfig?: EthersConfig overrides?: Overrides ethOptions?: any | {} contracts?: Contracts | {} @@ -94,26 +84,20 @@ ethers.errors.setLogLevel('error') export default class Tinlake { public provider: any - public eth: ethI - public ethOptions: any - public ethConfig: EthConfig public ethersConfig: EthersConfig public overrides: Overrides = {} public contractAddresses: ContractAddresses public transactionTimeout: number public contracts: Contracts = {} - public ethersContracts: Contracts = {} public contractAbis: ContractAbis = {} public contractConfig: any = {} constructor(params: TinlakeParams) { const { - provider, contractAddresses, transactionTimeout, contractAbis, ethOptions, - ethConfig, ethersConfig, overrides, contractConfig, @@ -126,18 +110,7 @@ export default class Tinlake { this.contractAddresses = contractAddresses || {} this.transactionTimeout = transactionTimeout this.overrides = overrides || {} - this.setProvider(provider, ethOptions, ethersConfig) - this.setEthConfig(ethConfig || {}) this.setEthersConfig(ethersConfig) - } - - setProvider = (provider: any, ethOptions?: any, ethersConfig?: EthersConfig) => { - this.provider = provider - this.ethOptions = ethOptions || {} - this.eth = new Eth(this.provider, this.ethOptions) as ethI - - if (ethersConfig) this.ethersConfig = ethersConfig - this.setContracts() } @@ -145,64 +118,47 @@ export default class Tinlake { // set root & proxy contracts contractNames.forEach((name) => { if (this.contractAbis[name] && this.contractAddresses[name]) { - this.contracts[name] = this.eth.contract(this.contractAbis[name]).at(this.contractAddresses[name]) - - if (this.ethersConfig) this.ethersContracts[name] = this.createContract(this.contractAddresses[name]!, name) + this.contracts[name] = this.createContract(this.contractAddresses[name]!, name) } }) // modular contracts if (this.contractAddresses['JUNIOR_OPERATOR']) { this.contracts['JUNIOR_OPERATOR'] = this.contractConfig['JUNIOR_OPERATOR'] - ? this.createEthContract(this.contractAddresses['JUNIOR_OPERATOR'], this.contractConfig['JUNIOR_OPERATOR']) - : this.createEthContract(this.contractAddresses['JUNIOR_OPERATOR'], 'ALLOWANCE_OPERATOR') - - this.ethersContracts['JUNIOR_OPERATOR'] = this.contractConfig['JUNIOR_OPERATOR'] ? this.createContract(this.contractAddresses['JUNIOR_OPERATOR'], this.contractConfig['JUNIOR_OPERATOR']) : this.createContract(this.contractAddresses['JUNIOR_OPERATOR'], 'ALLOWANCE_OPERATOR') } if (this.contractAddresses['SENIOR_OPERATOR']) { this.contracts['SENIOR_OPERATOR'] = this.contractConfig['SENIOR_OPERATOR'] - ? this.createEthContract(this.contractAddresses['SENIOR_OPERATOR'], this.contractConfig['SENIOR_OPERATOR']) - : this.createEthContract(this.contractAddresses['SENIOR_OPERATOR'], 'ALLOWANCE_OPERATOR') - - this.ethersContracts['SENIOR_OPERATOR'] = this.contractConfig['SENIOR_OPERATOR'] ? this.createContract(this.contractAddresses['SENIOR_OPERATOR'], this.contractConfig['SENIOR_OPERATOR']) : this.createContract(this.contractAddresses['SENIOR_OPERATOR'], 'ALLOWANCE_OPERATOR') } } - setEthConfig = (ethConfig: EthConfig) => { - this.ethConfig = { - ...this.ethConfig, - ...ethConfig, - } - } - - setEthersConfig = (ethersConfig: EthersConfig | undefined) => { + setEthersConfig = (ethersConfig: EthersConfig) => { this.ethersConfig = { ...this.ethersConfig, ...ethersConfig, } } - createEthContract(address: string, abiName: ContractName) { - const contract = this.eth.contract(this.contractAbis[abiName]).at(address) - return contract - } - createContract(address: string, abiName: ContractName) { return new ethers.Contract(address, this.contractAbis[abiName], this.ethersConfig.provider) } contract(abiName: ContractName, address?: string): ethers.Contract { + const signerOrProvider = this.ethersConfig.signer || this.ethersConfig.provider + if (!(abiName in this.contracts)) { + throw new Error(`Contract ${abiName} not loaded`) + } + if (address) { - return new ethers.Contract(address, this.contractAbis[abiName], this.ethersConfig.signer) + return new ethers.Contract(address, this.contractAbis[abiName], signerOrProvider) } if (this.ethersConfig.signer) { - return this.ethersContracts[abiName].connect(this.ethersConfig.signer) + return this.contracts[abiName].connect(signerOrProvider) } - return this.ethersContracts[abiName] + return this.contracts[abiName] } async pending(txPromise: Promise): Promise { diff --git a/src/actions/analytics.ts b/src/actions/analytics.ts index 795ade0..0f18d86 100644 --- a/src/actions/analytics.ts +++ b/src/actions/analytics.ts @@ -1,5 +1,5 @@ import { Constructor, TinlakeParams } from '../Tinlake' -import { executeAndRetry, ZERO_ADDRESS } from '../services/ethereum' +import { ZERO_ADDRESS } from '../services/ethereum' import { Loan, Investor } from '../types/tinlake' import BN from 'bn.js' @@ -42,10 +42,13 @@ export function AnalyticsActions> const riskGroup = await this.contract('NFT_FEED').risk(nftId) // retrieve rates for this risk group - const resEthers = await this.contract('PILE').rates(riskGroup) - console.log('getInterestRate res', resEthers) - const res = await executeAndRetry(this.contracts['PILE'].rates, [riskGroup]) - return res ? res[2] : new BN(0) + const res = await this.contract('PILE').rates(riskGroup) + console.log('getInterestRate res', res) + console.log('TODO: return getInterestRate here') + + return res.toBN() + // const res = await executeAndRetry(this.contracts['PILE'].rates, [riskGroup]) + // return res ? res[2] : new BN(0) } getOwnerOfLoan = async (loanId: string): Promise => { @@ -208,17 +211,10 @@ export function AnalyticsActions> let tokenPrice: BN switch (operatorType) { case 'PROPORTIONAL_OPERATOR': - const customTokenPriceRes: { 0: BN } = await executeAndRetry( - this.contracts['SENIOR_OPERATOR'].calcTokenPrice, - [user] - ) - tokenPrice = customTokenPriceRes[0] + tokenPrice = (await this.contract('SENIOR_OPERATOR').calcTokenPrice(user)).toBN() break case 'ALLOWANCE_OPERATOR': - const res: { 0: BN } = await executeAndRetry(this.contracts['ASSESSOR'].calcTokenPrice, [ - this.contractAddresses['SENIOR'], - ]) - tokenPrice = res[0] + tokenPrice = (await this.contract('ASSESSOR').calcTokenPrice(this.contractAddresses['SENIOR'])).toBN() break default: tokenPrice = new BN(0) @@ -228,8 +224,7 @@ export function AnalyticsActions> getSeniorReserve = async () => { if (this.contractAddresses['SENIOR'] !== ZERO_ADDRESS) { - const res: { 0: BN } = await executeAndRetry(this.contracts['SENIOR'].balance, []) - return res[0] || new BN(0) + return (await this.contract('SENIOR').balance()).toBN() } return new BN(0) } diff --git a/src/actions/proxy.ts b/src/actions/proxy.ts index 1b4611e..10d6719 100644 --- a/src/actions/proxy.ts +++ b/src/actions/proxy.ts @@ -69,6 +69,7 @@ export function ProxyActions>(Bas proxyIssue = async (proxyAddress: string, nftRegistryAddress: string, tokenId: string) => { const proxy = this.contract('PROXY', proxyAddress) + // TODO: replace with ethers.js method call const encoded = abiCoder.encodeFunctionCall( { name: 'issue', @@ -87,6 +88,7 @@ export function ProxyActions>(Bas proxyTransferIssue = async (proxyAddress: string, nftRegistryAddress: string, tokenId: string) => { const proxy = this.contract('PROXY', proxyAddress) + // TODO: replace with ethers.js method call const encoded = abiCoder.encodeFunctionCall( { name: 'transferIssue', @@ -105,6 +107,7 @@ export function ProxyActions>(Bas proxyLockBorrowWithdraw = async (proxyAddress: string, loanId: string, amount: string, usr: string) => { const proxy = this.contract('PROXY', proxyAddress) + // TODO: replace with ethers.js method call const encoded = abiCoder.encodeFunctionCall( { name: 'lockBorrowWithdraw', @@ -124,6 +127,7 @@ export function ProxyActions>(Bas proxyRepayUnlockClose = async (proxyAddress: string, tokenId: string, loanId: string, registry: string) => { const proxy = this.contract('PROXY', proxyAddress) + // TODO: replace with ethers.js method call const encoded = abiCoder.encodeFunctionCall( { name: 'repayUnlockClose', diff --git a/src/services/ethereum.ts b/src/services/ethereum.ts index 41727f5..57b3230 100644 --- a/src/services/ethereum.ts +++ b/src/services/ethereum.ts @@ -3,90 +3,12 @@ import { sha3 } from 'web3-utils' export const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000' -export interface ethI { - send: Function - web3_sha3: (signature: string) => string - getTransactionReceipt: (arg0: any, arg1: (err: any, receipt: any) => void) => void - getTransactionByHash: (arg0: any, arg1: (err: any, tx: any) => void) => void - contract: (arg0: any) => { at: (arg0: any) => void } - sendRawTransaction: any - getTransactionCount: any - abi: any -} - export interface Events { txHash: string status: any events: { event: { name: any }; data: any[] }[] } -export async function executeAndRetry(f: Function, args: any = []): Promise { - try { - const result = await f(...args) - return result - } catch (e) { - // using error message, since error code -32603 is not unique enough - // todo introduce retry limit - if ( - e && - e.message && - (e.message.indexOf("Cannot read property 'number' of null") !== -1 || - e.message.indexOf('error with payload') !== -1) - ) { - console.log('internal RPC error detected, retry triggered...', e) - throw new Error('Internal RPC Error. Please try again.') - // await sleep(1000); - // return executeAndRetry(f, args); - } else { - throw e - } - } -} - -export const waitAndReturnEvents = async (eth: ethI, txHash: string, abi: any, transactionTimeout: number) => { - const tx: any = await waitForTransaction(eth, txHash, transactionTimeout) - return new Promise((resolve, reject) => { - eth.getTransactionReceipt(tx.hash, (err: null, receipt: any) => { - if (err != null) { - reject('failed to get receipt') - } - const events = getEvents(receipt, abi) - resolve({ events, txHash: tx.hash, status: receipt.status }) - }) - }) -} - -// todo replace with a better polling -// TODO : use polling interval from config -export const waitForTransaction = (eth: ethI, txHash: any, transactionTimeout: number) => { - return new Promise((resolve, reject) => { - const secMax = transactionTimeout - let sec = 0 - const wait = (txHash: string) => { - setTimeout(() => { - eth.getTransactionByHash(txHash, (err: any, tx: any) => { - if (err) { - reject(err) - return - } - if (tx && tx.blockHash != null) { - resolve(tx) - return - } - console.log(`waiting for tx :${txHash}`) - sec = sec + 1 - if (sec < secMax) { - wait(txHash) - } else { - reject(new Error(`waiting for transaction tx ${txHash} timed out after ${secMax} seconds`)) - } - }) - }, 1000) - } - wait(txHash) - }) -} - export const findEvent = (abi: { filter: (arg0: (item: any) => boolean | undefined) => any[] }, funcSignature: any) => { return abi.filter( (item: { diff --git a/src/types/tinlake.ts b/src/types/tinlake.ts index 5fe52ce..99e3cb3 100644 --- a/src/types/tinlake.ts +++ b/src/types/tinlake.ts @@ -1,6 +1,6 @@ import { TinlakeActions } from '../actions' import BN from 'bn.js' -import Tinlake, { EthConfig, ContractAddresses, ContractAbis, Contracts } from '../Tinlake' +import Tinlake, { PendingTransaction, ContractAddresses, ContractAbis, Contracts } from '../Tinlake' export type Loan = { loanId: string @@ -46,3 +46,4 @@ export type Investor = { } export type ITinlake = TinlakeActions & Tinlake +export { PendingTransaction, ContractAddresses, ContractAbis, Contracts } \ No newline at end of file From 53a0fd6df3ec51f6596398e13e785ed3e58779a5 Mon Sep 17 00:00:00 2001 From: Jeroen Offerijns Date: Fri, 4 Sep 2020 13:35:20 +0200 Subject: [PATCH 29/65] fix: load collateral NFT contract --- src/Tinlake.ts | 7 ++++--- src/actions/admin.ts | 2 ++ src/actions/analytics.ts | 5 ++++- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/Tinlake.ts b/src/Tinlake.ts index 06f8ce0..24f9833 100644 --- a/src/Tinlake.ts +++ b/src/Tinlake.ts @@ -46,7 +46,7 @@ export type Overrides = { export type EthersConfig = { provider: ethers.providers.Provider - signer?: ethers.providers.Web3Provider + signer?: ethers.Signer } export type ContractName = typeof contractNames[number] @@ -118,6 +118,7 @@ export default class Tinlake { // set root & proxy contracts contractNames.forEach((name) => { if (this.contractAbis[name] && this.contractAddresses[name]) { + console.log(`Creating ${name}`) this.contracts[name] = this.createContract(this.contractAddresses[name]!, name) } }) @@ -148,8 +149,8 @@ export default class Tinlake { contract(abiName: ContractName, address?: string): ethers.Contract { const signerOrProvider = this.ethersConfig.signer || this.ethersConfig.provider - if (!(abiName in this.contracts)) { - throw new Error(`Contract ${abiName} not loaded`) + if (!(abiName in this.contracts) && !(address && abiName in this.contractAbis)) { + throw new Error(`Contract ${abiName} not loaded: ${JSON.stringify(Object.keys(this.contracts))}`) } if (address) { diff --git a/src/actions/admin.ts b/src/actions/admin.ts index 8d0367b..68aeab5 100644 --- a/src/actions/admin.ts +++ b/src/actions/admin.ts @@ -122,8 +122,10 @@ export type IAdminActions = { canSetInvestorAllowanceJunior(user: string): Promise canSetInvestorAllowanceSenior(user: string): Promise canSetLoanPrice(user: string): Promise + existsRateGroup(ratePerSecond: string): Promise initRate(rate: string): Promise setRate(loan: string, rate: string): Promise + changeRate(loan: string, ratePerSecond: string): Promise setMinimumJuniorRatio(amount: string): Promise approveAllowanceJunior(user: string, maxCurrency: string, maxToken: string): Promise approveAllowanceSenior(user: string, maxCurrency: string, maxToken: string): Promise diff --git a/src/actions/analytics.ts b/src/actions/analytics.ts index 0f18d86..eb76da5 100644 --- a/src/actions/analytics.ts +++ b/src/actions/analytics.ts @@ -242,6 +242,7 @@ export function AnalyticsActions> } getAssetValueJunior = async () => { + console.log(`contract address in getAssetvalueJunior: ${this.contractAddresses['JUNIOR']}`) return (await this.contract('ASSESSOR').calcAssetValue(this.contractAddresses['JUNIOR'])).toBN() } @@ -272,12 +273,14 @@ export type IAnalyticsActions = { getPrincipal(loanId: string): Promise getInterestRate(loanId: string): Promise getOwnerOfLoan(loanId: string): Promise - getOwnerOfCollateral(nftRegistryAddr: string, tokenId: string, loanId: string): Promise + getOwnerOfCollateral(nftRegistryAddr: string, tokenId: string): Promise existsSenior(): boolean getJuniorReserve(): Promise getSeniorReserve(): Promise getJuniorTokenBalance(user: string): Promise getSeniorTokenBalance(user: string): Promise + getJuniorTotalSupply(): Promise + getSeniorTotalSupply(): Promise getMaxSupplyAmountJunior(user: string): Promise getMaxRedeemAmountJunior(user: string): Promise getMaxSupplyAmountSenior(user: string): Promise From 4208ff953bbb58c3c1acbf3c30a38efd679d9f5c Mon Sep 17 00:00:00 2001 From: Jeroen Offerijns Date: Fri, 4 Sep 2020 15:55:31 +0200 Subject: [PATCH 30/65] refactor: remove unused test config --- package-lock.json | 13 ------------- src/actions/admin.ts | 5 +++-- src/test/config.ts | 8 -------- 3 files changed, 3 insertions(+), 23 deletions(-) diff --git a/package-lock.json b/package-lock.json index 3a3730e..c336de4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -347,11 +347,6 @@ "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=", "dev": true }, - "array-uniq": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.2.tgz", - "integrity": "sha1-X8w3OSB3VyPP1k1lxkvvU7+eum0=" - }, "array-unique": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", @@ -3468,14 +3463,6 @@ "resolved": "https://registry.npmjs.org/randomhex/-/randomhex-0.1.5.tgz", "integrity": "sha1-us7vmCMpCRQA8qKRLGzQLxCU9YU=" }, - "randomstring": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/randomstring/-/randomstring-1.1.5.tgz", - "integrity": "sha1-bfBij3XL1ZMpMNn+OrTpVqGFGMM=", - "requires": { - "array-uniq": "1.0.2" - } - }, "rc": { "version": "1.2.8", "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", diff --git a/src/actions/admin.ts b/src/actions/admin.ts index 8bad838..8dcb170 100644 --- a/src/actions/admin.ts +++ b/src/actions/admin.ts @@ -119,11 +119,12 @@ export function AdminActions>(Bas } getNftFeedId = async (registry: string, tokenId: number) => { - return await this.contract('NFT_FEED').nftID(registry, tokenId, this.overrides) + console.log('nft funcs', this.contract('NFT_FEED').functions) + return await this.contract('NFT_FEED').nftID(registry, tokenId) } getNftFeedValue = async (nftFeedId: string) => { - return (await this.contract('NFT_FEED').nftValues(nftFeedId, this.overrides)).toBN() + return (await this.contract('NFT_FEED').nftValues(nftFeedId)).toBN() } } } diff --git a/src/test/config.ts b/src/test/config.ts index 40d77dc..af408bd 100644 --- a/src/test/config.ts +++ b/src/test/config.ts @@ -6,13 +6,9 @@ import { ethers } from 'ethers' dotenv.config() -const KWEI = 1000 -const MWEI = 1000 * KWEI -const GWEI = 1000 * MWEI const MILLI_ETH = 1e15 // 0.001 ETH const FAUCET_AMOUNT = 5000 * MILLI_ETH -const GAS_PRICE = 10 * GWEI const GAS_LIMIT = 1000000 const testConfig: ProviderConfig = { @@ -22,8 +18,6 @@ const testConfig: ProviderConfig = { ), nftRegistry: process.env.NFT_REGISTRY || '0xac0c1ef395290288028a0a9fdfc8fdebebe54a24', transactionTimeout: 50000, - gasPrice: `${GAS_PRICE}`, - gas: `${GAS_LIMIT}`, overrides: { gasLimit: GAS_LIMIT }, rpcUrl: process.env.RPC_URL || 'http://127.0.0.1:8545', isRealTestnet: false, @@ -39,8 +33,6 @@ export type ProviderConfig = { rpcUrl: string isRealTestnet: boolean godAccount: ethers.Wallet - gas: string - gasPrice: string nftRegistry: string transactionTimeout: number contractAddresses: ContractAddresses From 76599aca5e10573bd7dff39c09e42d037cf42086 Mon Sep 17 00:00:00 2001 From: Jeroen Offerijns Date: Sun, 6 Sep 2020 14:21:11 +0200 Subject: [PATCH 31/65] feat: work on fixing nft feed related tests using ethers.js --- src/Tinlake.ts | 5 +-- src/actions/admin.ts | 7 ++-- src/actions/borrower.spec.ts | 5 --- src/actions/borrower.ts | 2 +- src/actions/collateral.ts | 8 +++- src/actions/proxy.spec.ts | 73 ++++++++++++++++++++++++++---------- src/test/utils.ts | 2 +- 7 files changed, 66 insertions(+), 36 deletions(-) diff --git a/src/Tinlake.ts b/src/Tinlake.ts index a060b69..7ffd17b 100644 --- a/src/Tinlake.ts +++ b/src/Tinlake.ts @@ -192,10 +192,7 @@ export default class Tinlake { try { const receipt = await this.ethersConfig.provider!.waitForTransaction(tx.hash) if (timer) clearTimeout(timer) - - // TODO: if receipt.status === 0, use this to get the revert reason: - // https://gist.github.com/gluk64/fdea559472d957f1138ed93bcbc6f78a#file-reason-js - + return resolve(receipt) } catch (e) { console.error(`Error caught in tinlake.getTransactionReceipt(): ${e}`) diff --git a/src/actions/admin.ts b/src/actions/admin.ts index 8dcb170..c1aed66 100644 --- a/src/actions/admin.ts +++ b/src/actions/admin.ts @@ -110,17 +110,16 @@ export function AdminActions>(Bas let tx; if (!riskGroup) { - tx = this.contract('NFT_FEED').update(tokenId, value, this.overrides) + tx = this.contract('NFT_FEED')['update(bytes32,uint256)'](tokenId, value, this.overrides) } else { - tx = this.contract('NFT_FEED').update(tokenId, value, riskGroup, this.overrides) + tx = this.contract('NFT_FEED')['update(bytes32,uint256,uint256)'](tokenId, value, riskGroup, this.overrides) } return this.pending(tx) } getNftFeedId = async (registry: string, tokenId: number) => { - console.log('nft funcs', this.contract('NFT_FEED').functions) - return await this.contract('NFT_FEED').nftID(registry, tokenId) + return await this.contract('NFT_FEED')['nftID(address,uint256)'](registry, tokenId) } getNftFeedValue = async (nftFeedId: string) => { diff --git a/src/actions/borrower.spec.ts b/src/actions/borrower.spec.ts index 8b82109..0d149a1 100644 --- a/src/actions/borrower.spec.ts +++ b/src/actions/borrower.spec.ts @@ -159,18 +159,13 @@ async function mintIssueBorrow(usr: string, tinlake: ITinlake, amount: string) { const initialBorrowerCurrencyBalance = await borrowerTinlake.getCurrencyBalance(borrowerAccount.address) // supply tranche with money - console.log({ initialBorrowerCurrencyBalance }) - const borrowTx = await borrowerTinlake.borrow(loanId, amount) const borrowResult = await borrowerTinlake.getTransactionReceipt(borrowTx) - console.log({ borrowResult }) const withdrawTx = await borrowerTinlake.withdraw(loanId, amount, borrowerAccount.address) const withdrawResult = await borrowerTinlake.getTransactionReceipt(withdrawTx) - console.log({ withdrawResult }) const newBorrowerCurrencyBalance = await borrowerTinlake.getCurrencyBalance(borrowerAccount.address) - console.log({ newBorrowerCurrencyBalance }) assert.equal(initialBorrowerCurrencyBalance.add(new BN(amount)).toString(), newBorrowerCurrencyBalance.toString()) assert.equal(borrowResult.status, SUCCESS_STATUS) diff --git a/src/actions/borrower.ts b/src/actions/borrower.ts index 9c9ceea..d52358c 100644 --- a/src/actions/borrower.ts +++ b/src/actions/borrower.ts @@ -9,7 +9,7 @@ export function BorrowerActions>( nftLookup = async (registry: string, tokenId: string) => { const nft = ethers.utils.solidityKeccak256(['address', 'uint'], [registry, tokenId]) - const loanId = await this.contract('SHELF').nftlookup(nft, this.overrides) + const loanId = await this.contract('SHELF').nftlookup(nft) return loanId } diff --git a/src/actions/collateral.ts b/src/actions/collateral.ts index 229a6bc..8db4015 100644 --- a/src/actions/collateral.ts +++ b/src/actions/collateral.ts @@ -5,6 +5,9 @@ export function CollateralActions return class extends Base implements ICollateralActions { mintTitleNFT = async (nftAddr: string, user: string) => { // TODO: this is untested right now + const collateralNft = this.contract('COLLATERAL_NFT', nftAddr) + console.log(collateralNft) + console.log(this.contract('COLLATERAL_NFT', nftAddr).functions) const tx = await this.contract('COLLATERAL_NFT', nftAddr).issue(user, this.overrides) const receipt = await this.getTransactionReceipt(tx) @@ -13,7 +16,8 @@ export function CollateralActions } const parsedLog = this.contract('PROXY_REGISTRY').interface.parseLog(receipt.logs[0]) - return parsedLog.values['2'].toString() + const nftId = parsedLog.values['2'].toString() + return nftId } mintNFT = async ( @@ -62,7 +66,7 @@ export function CollateralActions } export type ICollateralActions = { - mintTitleNFT(nftAddr: string, usr: string): Promise + mintTitleNFT(nftAddr: string, usr: string): Promise mintNFT( nftAddr: string, owner: string, diff --git a/src/actions/proxy.spec.ts b/src/actions/proxy.spec.ts index 0a6970a..482d017 100644 --- a/src/actions/proxy.spec.ts +++ b/src/actions/proxy.spec.ts @@ -3,6 +3,7 @@ import { createTinlake, TestProvider } from '../test/utils' import testConfig from '../test/config' import { ITinlake } from '../types/tinlake' import { ethers } from 'ethers' +import BN from 'BN.js' const testProvider = new TestProvider(testConfig) const borrowerAccount = ethers.Wallet.createRandom() @@ -57,28 +58,36 @@ describe('proxy tests', async () => { const initialTrancheBalance = await borrowerTinlake.getCurrencyBalance(contractAddresses['JUNIOR']); // borrow - console.log(initialTrancheBalance.toNumber()) - const borrowResult = await borrowerTinlake.proxyLockBorrowWithdraw(proxyAddr, loanId, amount, borrowerAccount.address); + const borrowTx = await borrowerTinlake.proxyLockBorrowWithdraw(proxyAddr, loanId, amount, borrowerAccount.address); + const borrowResult = await borrowerTinlake.getTransactionReceipt(borrowTx) + const balance = await borrowerTinlake.getCurrencyBalance(borrowerAccount.address); const secondTrancheBalance = await borrowerTinlake.getCurrencyBalance(contractAddresses['JUNIOR']); + assert.equal(borrowResult.status, SUCCESS_STATUS); assert.equal(balance.toString(), amount); assert.equal(secondTrancheBalance.toString(), initialTrancheBalance.sub(new BN(amount)).toString()); // fuel borrower with extra to cover loan interest, approve borrower proxy to take currency - await governanceTinlake.mintCurrency(borrowerAccount.address, amount.toString()); - await borrowerTinlake.approveCurrency(proxyAddr, amount.toString()); + const secondMintTx = await governanceTinlake.mintCurrency(borrowerAccount.address, amount.toString()); + await governanceTinlake.getTransactionReceipt(secondMintTx) + + const secondApproveTx = await borrowerTinlake.approveCurrency(proxyAddr, amount.toString()); + await borrowerTinlake.getTransactionReceipt(secondApproveTx) // repay - const repayResult = await borrowerTinlake.proxyRepayUnlockClose(proxyAddr, tokenId, loanId, testConfig.nftRegistry); + const repayTx = await borrowerTinlake.proxyRepayUnlockClose(proxyAddr, tokenId, loanId, testConfig.nftRegistry); + const repayResult = await borrowerTinlake.getTransactionReceipt(repayTx) assert.equal(repayResult.status, SUCCESS_STATUS); // borrower should be owner of collateral NFT again // tranche balance should be back to pre-borrow amount const owner = await governanceTinlake.getNFTOwner(testConfig.nftRegistry, tokenId); assert.equal(ethers.utils.getAddress(owner.toString()), ethers.utils.getAddress(borrowerAccount.address)); + await borrowerTinlake.getCurrencyBalance(proxyAddr); const finalTrancheBalance = await borrowerTinlake.getCurrencyBalance(contractAddresses['JUNIOR']); + assert.equal(initialTrancheBalance.toString(), finalTrancheBalance.toString()); }) @@ -91,7 +100,6 @@ describe('proxy tests', async () => { // TODO: the next line fails with this error: "Error caught in tinlake.pending(): Error: The execution failed due to an exception." const issueTx = await borrowerTinlake.proxyTransferIssue(proxyAddr, testConfig.nftRegistry, tokenId) - console.log('issueTx', issueTx) const issueResult = await borrowerTinlake.getTransactionReceipt(issueTx) assert.equal(issueResult.status, FAIL_STATUS) @@ -100,26 +108,42 @@ describe('proxy tests', async () => { it('fail: does not succeed if the proxy is not approved to transfer currency from the borrower', async () => { // create new proxy and mint collateral NFT to borrower const proxyAddr = await borrowerTinlake.proxyCreateNew(borrowerAccount.address); - const nftId: any = await governanceTinlake.mintTitleNFT(testConfig.nftRegistry, borrowerAccount.address); - await borrowerTinlake.approveNFT(testConfig.nftRegistry, nftId, proxyAddr); + + const nftId = await governanceTinlake.mintTitleNFT(testConfig.nftRegistry, borrowerAccount.address); + const approveTx = await borrowerTinlake.approveNFT(testConfig.nftRegistry, nftId.toString(), proxyAddr); + await borrowerTinlake.getTransactionReceipt(approveTx) + // issue loan from collateral NFT - await borrowerTinlake.proxyTransferIssue(proxyAddr, testConfig.nftRegistry, nftId); + const proxyTransferTx = await borrowerTinlake.proxyTransferIssue(proxyAddr, testConfig.nftRegistry, nftId); + await borrowerTinlake.getTransactionReceipt(proxyTransferTx) + // set loan parameters and fund tranche const loanId = await borrowerTinlake.nftLookup(testConfig.nftRegistry, nftId); const amount = 1000; - await governanceTinlake.relyAddress(adminAccount.address, contractAddresses['NFT_FEED']); + const relyTx = await governanceTinlake.relyAddress(adminAccount.address, contractAddresses['NFT_FEED']); + await governanceTinlake.getTransactionReceipt(relyTx) + const nftfeedId = await adminTinlake.getNftFeedId(testConfig.nftRegistry, Number(nftId)) - await adminTinlake.updateNftFeed(nftfeedId, Number(amount)) + const updateNftTx = await adminTinlake.updateNftFeed(nftfeedId, Number(amount)) + await adminTinlake.getTransactionReceipt(updateNftTx) + await fundTranche('1000000000'); await borrowerTinlake.getCurrencyBalance(contractAddresses['JUNIOR']); + // borrow - await borrowerTinlake.proxyLockBorrowWithdraw(proxyAddr, loanId, amount.toString(), borrowerAccount.address); + const proxyLockBorrowWithdrawTx = await borrowerTinlake.proxyLockBorrowWithdraw(proxyAddr, loanId, amount.toString(), borrowerAccount.address); + await borrowerTinlake.getTransactionReceipt(proxyLockBorrowWithdrawTx) + await borrowerTinlake.getCurrencyBalance(borrowerAccount.address); await borrowerTinlake.getCurrencyBalance(contractAddresses['JUNIOR']); + // does not approve proxy to transfer currency - await governanceTinlake.mintCurrency(borrowerAccount.address, amount.toString()); + const mintTx = await governanceTinlake.mintCurrency(borrowerAccount.address, amount.toString()); + await governanceTinlake.getTransactionReceipt(mintTx) + // repay - const repayResult = await borrowerTinlake.proxyRepayUnlockClose(proxyAddr, nftId, loanId, testConfig.nftRegistry); + const repayTx = await borrowerTinlake.proxyRepayUnlockClose(proxyAddr, nftId, loanId, testConfig.nftRegistry); + const repayResult = await borrowerTinlake.getTransactionReceipt(repayTx) assert.equal(repayResult.status, FAIL_STATUS); }) }) @@ -129,16 +153,27 @@ describe('proxy tests', async () => { async function fundTranche(amount: string) { const lenderAccount = ethers.Wallet.createRandom() const lenderTinlake = createTinlake(lenderAccount, testConfig) + // fund lender account with eth await testProvider.fundAccountWithETH(lenderAccount.address, FAUCET_AMOUNT) + // make admin address ward on tranche operator - await governanceTinlake.relyAddress(adminAccount.address, contractAddresses['JUNIOR_OPERATOR']) + const fundTx = await governanceTinlake.relyAddress(adminAccount.address, contractAddresses['JUNIOR_OPERATOR']) + await governanceTinlake.getTransactionReceipt(fundTx) + // whitelist lender - await adminTinlake.approveAllowanceJunior(lenderAccount.address, amount, amount) + const approveAllowanceTx = await adminTinlake.approveAllowanceJunior(lenderAccount.address, amount, amount) + await adminTinlake.getTransactionReceipt(approveAllowanceTx) + // lender approves tranche to take currency - await lenderTinlake.approveCurrency(contractAddresses['JUNIOR'], amount) + const approveTx = await lenderTinlake.approveCurrency(contractAddresses['JUNIOR'], amount) + await lenderTinlake.getTransactionReceipt(approveTx) + // mint currency for lender - await governanceTinlake.mintCurrency(lenderAccount.address, amount) + const mintTx = await governanceTinlake.mintCurrency(lenderAccount.address, amount) + governanceTinlake.getTransactionReceipt(mintTx) + // lender supplies tranche with funds - await lenderTinlake.supplyJunior(amount) + const supplyTx = await lenderTinlake.supplyJunior(amount) + await lenderTinlake.getTransactionReceipt(supplyTx) } diff --git a/src/test/utils.ts b/src/test/utils.ts index 0f55108..45a0f6d 100644 --- a/src/test/utils.ts +++ b/src/test/utils.ts @@ -41,6 +41,6 @@ export function createTinlake(wallet: Wallet, testConfig: ProviderConfig): ITinl function createEthersConfig(rpcUrl: string, wallet: Wallet) { const provider = new ethers.providers.JsonRpcProvider(rpcUrl) - const signer = new ethers.Wallet(wallet.privateKey).connect(provider) + const signer = wallet.connect(provider) return { provider, signer } } From e1a2f742ee9cddd4b8c238bb62950754a7d0527b Mon Sep 17 00:00:00 2001 From: Jeroen Offerijns Date: Sun, 6 Sep 2020 15:01:04 +0200 Subject: [PATCH 32/65] docs: describe solver constraint limitations --- src/actions/coordinator.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/actions/coordinator.ts b/src/actions/coordinator.ts index 5dc3125..9a8407a 100644 --- a/src/actions/coordinator.ts +++ b/src/actions/coordinator.ts @@ -25,6 +25,13 @@ export function CoordinatorActions { + /** + * The limitations are: + * - only input variables (those in state or orderState) can be on the right side of the constraint (the bnds key) + * - only output variables ([dropRedeem,tinRedeem,tinInvest,dropInvest]) can be on the left side of the constraint (the vars key) + * - variables can have coefficients, but there's no option for brackets or other more advanced equation forms + * (e.g. it's limited to a * x_1 + b * x_2 + ..., where [a,b] are coefficients and [x_1,x_2] are variables) + */ return require('glpk.js').then((glpk: any) => { const lp = { name: 'LP', From 634f2aa1f262f70de38267730706af2aaff05052 Mon Sep 17 00:00:00 2001 From: Jeroen Offerijns Date: Sun, 6 Sep 2020 15:04:39 +0200 Subject: [PATCH 33/65] docs: update constriant limitations --- src/actions/coordinator.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/actions/coordinator.ts b/src/actions/coordinator.ts index 9a8407a..b774a30 100644 --- a/src/actions/coordinator.ts +++ b/src/actions/coordinator.ts @@ -31,6 +31,7 @@ export function CoordinatorActions=,=]) */ return require('glpk.js').then((glpk: any) => { const lp = { @@ -89,10 +90,10 @@ export function CoordinatorActions Date: Sun, 6 Sep 2020 15:22:08 +0200 Subject: [PATCH 34/65] refactor: clean up --- src/Tinlake.ts | 12 ++++-------- src/actions/lender.spec.ts | 6 +++--- src/actions/proxy.spec.ts | 1 - src/test/config.ts | 2 +- 4 files changed, 8 insertions(+), 13 deletions(-) diff --git a/src/Tinlake.ts b/src/Tinlake.ts index 7ffd17b..05d30d0 100644 --- a/src/Tinlake.ts +++ b/src/Tinlake.ts @@ -39,11 +39,6 @@ export type PendingTransaction = { timesOutAt?: number } -export type Overrides = { - gasPrice?: number - gasLimit?: number -} - export type EthersConfig = { provider: ethers.providers.Provider signer?: ethers.Signer @@ -68,7 +63,7 @@ export type TinlakeParams = { transactionTimeout: number contractAddresses?: ContractAddresses | {} contractAbis?: ContractAbis | {} - overrides?: Overrides + overrides?: ethers.providers.TransactionRequest ethOptions?: any | {} contracts?: Contracts | {} contractConfig?: any | {} @@ -78,6 +73,7 @@ export type Constructor = new (...args: any[]) => Tinlake ethers.errors.setLogLevel('error') +// This adds a .toBN() function to all BigNumber instances returned by ethers.js ;(ethers.utils.BigNumber as any).prototype.toBN = function () { return new BN((this as any).toString()) } @@ -85,7 +81,7 @@ ethers.errors.setLogLevel('error') export default class Tinlake { public provider: any public ethersConfig: EthersConfig - public overrides: Overrides = {} + public overrides: ethers.providers.TransactionRequest = {} public contractAddresses: ContractAddresses public transactionTimeout: number public contracts: Contracts = {} @@ -192,7 +188,7 @@ export default class Tinlake { try { const receipt = await this.ethersConfig.provider!.waitForTransaction(tx.hash) if (timer) clearTimeout(timer) - + return resolve(receipt) } catch (e) { console.error(`Error caught in tinlake.getTransactionReceipt(): ${e}`) diff --git a/src/actions/lender.spec.ts b/src/actions/lender.spec.ts index db1f7ef..7b4fa59 100644 --- a/src/actions/lender.spec.ts +++ b/src/actions/lender.spec.ts @@ -120,7 +120,6 @@ describe('lender functions', async () => { const redeemTx = await lenderTinlake.redeemJunior(tokenAmount) const redeemResult = await lenderTinlake.getTransactionReceipt(redeemTx) - // console.log(redeemTx) assert.equal(redeemResult.status, FAIL_STATUS) }) @@ -140,9 +139,7 @@ async function supply(investor: string, currencyAmount: string, tinlake: ITinlak const initialJuniorTokenBalance = await tinlake.getJuniorTokenBalance(investor) const supplyTx = await tinlake.supplyJunior(currencyAmount) - // console.log('supplyTx', supplyTx) const supplyResult = await tinlake.getTransactionReceipt(supplyTx) - // console.log('supplyResult', supplyResult) const newTrancheCurrencyBalance = await tinlake.getCurrencyBalance(contractAddresses['JUNIOR']) const newLenderCurrencyBalance = await tinlake.getCurrencyBalance(investor) @@ -150,10 +147,13 @@ async function supply(investor: string, currencyAmount: string, tinlake: ITinlak // assert result successful assert.equal(supplyResult.status, SUCCESS_STATUS) + // assert tranche balance increased by currency amount assert.equal(newTrancheCurrencyBalance.sub(initialTrancheCurrencyBalance).toString(), currencyAmount) + // assert investor currency balanace decreased assert.equal(initialLenderCurrencyBalance.sub(newLenderCurrencyBalance).toString(), currencyAmount) + // assert investor received tokens if (testConfig.isRealTestnet) { assert.ok(newJuniorTokenBalance.gt(initialJuniorTokenBalance)) diff --git a/src/actions/proxy.spec.ts b/src/actions/proxy.spec.ts index 482d017..32279b6 100644 --- a/src/actions/proxy.spec.ts +++ b/src/actions/proxy.spec.ts @@ -98,7 +98,6 @@ describe('proxy tests', async () => { const mintTx = await governanceTinlake.mintNFT(testConfig.nftRegistry, borrowerAccount.address, tokenId, '234', '345', '456') await governanceTinlake.getTransactionReceipt(mintTx) - // TODO: the next line fails with this error: "Error caught in tinlake.pending(): Error: The execution failed due to an exception." const issueTx = await borrowerTinlake.proxyTransferIssue(proxyAddr, testConfig.nftRegistry, tokenId) const issueResult = await borrowerTinlake.getTransactionReceipt(issueTx) diff --git a/src/test/config.ts b/src/test/config.ts index af408bd..ad61953 100644 --- a/src/test/config.ts +++ b/src/test/config.ts @@ -40,7 +40,7 @@ export type ProviderConfig = { SUCCESS_STATUS: 1 FAIL_STATUS: 0 FAUCET_AMOUNT: string - overrides: any + overrides: ethers.providers.TransactionRequest } export default testConfig From 3310ca61e8dfecf154a0c1b1cfd935a62ad48484 Mon Sep 17 00:00:00 2001 From: Jeroen Offerijns Date: Mon, 7 Sep 2020 11:11:44 +0200 Subject: [PATCH 35/65] 0.0.19-develop.6 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index c336de4..e8f99ed 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@centrifuge/tinlake-js", - "version": "0.0.19-develop.5", + "version": "0.0.19-develop.6", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index bb1c1db..307f229 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@centrifuge/tinlake-js", - "version": "0.0.19-develop.5", + "version": "0.0.19-develop.6", "description": "Centrifuge Tinlake Contracts Client", "main": "dist/index.js", "types": "dist/index.d.ts", From acd9e3314d6cef383b90858480077443e969a7b6 Mon Sep 17 00:00:00 2001 From: Jeroen Offerijns Date: Mon, 7 Sep 2020 11:12:22 +0200 Subject: [PATCH 36/65] 0.0.19-develop.7 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index e8f99ed..e276e56 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@centrifuge/tinlake-js", - "version": "0.0.19-develop.6", + "version": "0.0.19-develop.7", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 307f229..51f22ed 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@centrifuge/tinlake-js", - "version": "0.0.19-develop.6", + "version": "0.0.19-develop.7", "description": "Centrifuge Tinlake Contracts Client", "main": "dist/index.js", "types": "dist/index.d.ts", From fa599c287f102d29f9eadd6e1598ac966eaeda30 Mon Sep 17 00:00:00 2001 From: Jeroen Offerijns Date: Mon, 7 Sep 2020 15:01:53 +0200 Subject: [PATCH 37/65] chore: clean up code --- src/Tinlake.ts | 2 -- src/actions/analytics.ts | 7 ++++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/Tinlake.ts b/src/Tinlake.ts index 05d30d0..afab3fe 100644 --- a/src/Tinlake.ts +++ b/src/Tinlake.ts @@ -64,7 +64,6 @@ export type TinlakeParams = { contractAddresses?: ContractAddresses | {} contractAbis?: ContractAbis | {} overrides?: ethers.providers.TransactionRequest - ethOptions?: any | {} contracts?: Contracts | {} contractConfig?: any | {} } @@ -93,7 +92,6 @@ export default class Tinlake { contractAddresses, transactionTimeout, contractAbis, - ethOptions, ethersConfig, overrides, contractConfig, diff --git a/src/actions/analytics.ts b/src/actions/analytics.ts index eb76da5..41b4966 100644 --- a/src/actions/analytics.ts +++ b/src/actions/analytics.ts @@ -105,7 +105,9 @@ export function AnalyticsActions> } // lender analytics - getInvestor = async (user: string): Promise => { + getInvestor = async (user: string): Promise => { + if (typeof user === 'undefined' || user === '') return undefined + const includeSenior = this.existsSenior() const tokenBalanceJunior = await this.getJuniorTokenBalance(user) const tokenBalanceSenior = (includeSenior && (await this.getSeniorTokenBalance(user))) || new BN(0) @@ -242,7 +244,6 @@ export function AnalyticsActions> } getAssetValueJunior = async () => { - console.log(`contract address in getAssetvalueJunior: ${this.contractAddresses['JUNIOR']}`) return (await this.contract('ASSESSOR').calcAssetValue(this.contractAddresses['JUNIOR'])).toBN() } @@ -292,7 +293,7 @@ export type IAnalyticsActions = { getMinJuniorRatio(): Promise getCurrentJuniorRatio(): Promise getAssetValueJunior(): Promise - getInvestor(user: string): Promise + getInvestor(user: string): Promise } export default AnalyticsActions From aa6a5f05d211b471043d03fc3b8ea4c4123de439 Mon Sep 17 00:00:00 2001 From: Jeroen Offerijns Date: Mon, 7 Sep 2020 15:29:00 +0200 Subject: [PATCH 38/65] docs: describe solver implementation --- src/actions/coordinator.ts | 45 +++++++++++++++++++++++++++----------- 1 file changed, 32 insertions(+), 13 deletions(-) diff --git a/src/actions/coordinator.ts b/src/actions/coordinator.ts index b774a30..ad3bda4 100644 --- a/src/actions/coordinator.ts +++ b/src/actions/coordinator.ts @@ -2,28 +2,47 @@ import { Constructor, TinlakeParams } from '../Tinlake' export function CoordinatorActions>(Base: ActionsBase) { return class extends Base implements ICoordinatorActions { - solveEpoch = async () => { + // const tinlake = (this as any) // const reserve = (await tinlake.getJuniorReserve()).add(await tinlake.getSeniorReserve()) + solveEpoch = async () => { + // if (!coordinator.submissionPeriod) { + // await coordinator.closeEpoch() + + // if (!coordinator.submissionPeriod) return + // } + // const state = { - // reserve, - // netAssetValue: 0, - // seniorDebt: await tinlake.getSeniorDebt(), - // seniorBalance: 0, - // minTinRatio: await tinlake.getMinJuniorRatio(), - // maxTinRatio: 0, - // maxReserve: 0, + // reserve, // coordinator.epochReserve + // netAssetValue: 0, // coordinator.epochNAV + // seniorDebt: await tinlake.getSeniorDebt(), // coordinator.epochSeniorDebt (to be added) + // seniorBalance: 0, // epochSeniorAsset - epochSeniorDebt + // minTinRatio: await tinlake.getMinJuniorRatio(), // 1 - maxSeniorRatio on the assessor + // maxTinRatio: 0, // 1 - mSeniorRatio on the assessor + // maxReserve: 0, // assessor.maxReserve // } - + + // const orderState = coordinator.order + + // const solution = calculateOptimalSolution(state, orderState) + + // Call submitSolution(solution) + return Promise.resolve({ - tinRedeem: 1, - dropRedeem: 2, - tinInvest: 3, - dropInvest: 4 + tinRedeem: 1, + dropRedeem: 2, + tinInvest: 3, + dropInvest: 4 }) + } + // executeEpoch = () => void + + // isInChallengePeriod = () => boolean + // check coordinator.minChallengePeriodEnd + calculateOptimalSolution = async (state: State, orderState: OrderState) => { /** * The limitations are: From 2895da01621098e843e83e11b1db3e21354d924f Mon Sep 17 00:00:00 2001 From: Jeroen Offerijns Date: Mon, 7 Sep 2020 15:32:15 +0200 Subject: [PATCH 39/65] 0.0.19-develop.8 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index e276e56..70ade36 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@centrifuge/tinlake-js", - "version": "0.0.19-develop.7", + "version": "0.0.19-develop.8", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 51f22ed..dfa9a06 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@centrifuge/tinlake-js", - "version": "0.0.19-develop.7", + "version": "0.0.19-develop.8", "description": "Centrifuge Tinlake Contracts Client", "main": "dist/index.js", "types": "dist/index.d.ts", From 625f6db1b31131341d3895df6b1d60580e8fca1a Mon Sep 17 00:00:00 2001 From: Jeroen Offerijns Date: Mon, 7 Sep 2020 16:27:31 +0200 Subject: [PATCH 40/65] fix: improve typings, fix get interest rate --- src/Tinlake.ts | 25 +++++++++---------------- src/abi/index.ts | 5 ++--- src/actions/analytics.ts | 9 ++------- 3 files changed, 13 insertions(+), 26 deletions(-) diff --git a/src/Tinlake.ts b/src/Tinlake.ts index afab3fe..23b5ec2 100644 --- a/src/Tinlake.ts +++ b/src/Tinlake.ts @@ -20,7 +20,7 @@ const contractNames = [ 'THRESHOLD', 'PRICE_POOL', 'COLLATERAL_NFT', - 'COLLATERAL_NFT_DATA', + // 'COLLATERAL_NFT_DATA', 'ROOT_CONTRACT', 'PROXY', 'PROXY_REGISTRY', @@ -47,11 +47,11 @@ export type EthersConfig = { export type ContractName = typeof contractNames[number] export type Contracts = { - [key in ContractName]?: any + [key in ContractName]?: ethers.Contract } export type ContractAbis = { - [key in ContractName]?: any + [key in ContractName]?: (ethers.utils.EventFragment | ethers.utils.FunctionFragment)[] } export type ContractAddresses = { @@ -88,14 +88,7 @@ export default class Tinlake { public contractConfig: any = {} constructor(params: TinlakeParams) { - const { - contractAddresses, - transactionTimeout, - contractAbis, - ethersConfig, - overrides, - contractConfig, - } = params + const { contractAddresses, transactionTimeout, contractAbis, ethersConfig, overrides, contractConfig } = params if (!contractAbis) { this.contractAbis = abiDefinitions } @@ -137,22 +130,22 @@ export default class Tinlake { } createContract(address: string, abiName: ContractName) { - return new ethers.Contract(address, this.contractAbis[abiName], this.ethersConfig.provider) + return new ethers.Contract(address, this.contractAbis[abiName]!, this.ethersConfig.provider) } - contract(abiName: ContractName, address?: string): ethers.Contract { + contract(abiName: keyof Tinlake['contracts'] | ContractName, address?: string) { const signerOrProvider = this.ethersConfig.signer || this.ethersConfig.provider if (!(abiName in this.contracts) && !(address && abiName in this.contractAbis)) { throw new Error(`Contract ${abiName} not loaded: ${JSON.stringify(Object.keys(this.contracts))}`) } if (address) { - return new ethers.Contract(address, this.contractAbis[abiName], signerOrProvider) + return new ethers.Contract(address, this.contractAbis[abiName]!, signerOrProvider) } if (this.ethersConfig.signer) { - return this.contracts[abiName].connect(signerOrProvider) + return this.contracts[abiName]!.connect(signerOrProvider) } - return this.contracts[abiName] + return this.contracts[abiName]! } async pending(txPromise: Promise): Promise { diff --git a/src/abi/index.ts b/src/abi/index.ts index b5f4338..a7fdf6b 100644 --- a/src/abi/index.ts +++ b/src/abi/index.ts @@ -15,16 +15,15 @@ import contractAbiProxy from './Proxy.abi.json' import contractAbiProxyRegistry from './ProxyRegistry.abi.json' import contractAbiTranche from './Tranche.abi.json' import contractAbiSeniorTranche from './SeniorTranche.abi.json' -import contractAbiNFTData from './NftData.abi.json' +// import contractAbiNFTData from './NftData.abi.json' import contractAbiNFT from './test/SimpleNFT.abi.json' import contractAbiBorrowerDeployer from './BorrowerDeployer.abi.json' import contractAbiLenderDeployer from './LenderDeployer.abi.json' import { ContractAbis } from '../Tinlake' export default { - // COLLATERAL_NFT : contractAbiTitle, COLLATERAL_NFT: contractAbiNFT, - COLLATERAL_NFT_DATA: contractAbiNFTData, + // COLLATERAL_NFT_DATA: contractAbiNFTData, TITLE: contractAbiTitle, TINLAKE_CURRENCY: contractAbiCurrency, SHELF: contractAbiShelf, diff --git a/src/actions/analytics.ts b/src/actions/analytics.ts index 41b4966..53d9ac7 100644 --- a/src/actions/analytics.ts +++ b/src/actions/analytics.ts @@ -43,12 +43,7 @@ export function AnalyticsActions> // retrieve rates for this risk group const res = await this.contract('PILE').rates(riskGroup) - console.log('getInterestRate res', res) - console.log('TODO: return getInterestRate here') - - return res.toBN() - // const res = await executeAndRetry(this.contracts['PILE'].rates, [riskGroup]) - // return res ? res[2] : new BN(0) + return res[2].toBN() } getOwnerOfLoan = async (loanId: string): Promise => { @@ -62,7 +57,7 @@ export function AnalyticsActions> } getStatus = async (nftRegistryAddr: string, tokenId: string, loanId: string): Promise => { - if ((await this.getOwnerOfCollateral(nftRegistryAddr, tokenId)) === this.contracts['SHELF'].address) { + if ((await this.getOwnerOfCollateral(nftRegistryAddr, tokenId)).toString() === this.contracts['SHELF']!.address) { return 'ongoing' } if ((await this.getOwnerOfLoan(loanId)) === ZERO_ADDRESS) { From d7e26f3a4d33fa0a2334ed14ae70d77415de07a9 Mon Sep 17 00:00:00 2001 From: Jeroen Offerijns Date: Mon, 7 Sep 2020 16:29:41 +0200 Subject: [PATCH 41/65] refactor: remove unused nft data abi --- src/Tinlake.ts | 1 - src/abi/NftData.abi.json | 18 ------------------ src/abi/index.ts | 2 -- 3 files changed, 21 deletions(-) delete mode 100644 src/abi/NftData.abi.json diff --git a/src/Tinlake.ts b/src/Tinlake.ts index 23b5ec2..6b70e7d 100644 --- a/src/Tinlake.ts +++ b/src/Tinlake.ts @@ -20,7 +20,6 @@ const contractNames = [ 'THRESHOLD', 'PRICE_POOL', 'COLLATERAL_NFT', - // 'COLLATERAL_NFT_DATA', 'ROOT_CONTRACT', 'PROXY', 'PROXY_REGISTRY', diff --git a/src/abi/NftData.abi.json b/src/abi/NftData.abi.json deleted file mode 100644 index 3f45b07..0000000 --- a/src/abi/NftData.abi.json +++ /dev/null @@ -1,18 +0,0 @@ -[ - { - "constant":true, - "inputs":[ - { - "name":"", - "type":"uint256" - } - ], - "name":"data", - "outputs":{ - - }, - "payable":false, - "stateMutability":"view", - "type":"function" - } -] diff --git a/src/abi/index.ts b/src/abi/index.ts index a7fdf6b..3ae45fa 100644 --- a/src/abi/index.ts +++ b/src/abi/index.ts @@ -15,7 +15,6 @@ import contractAbiProxy from './Proxy.abi.json' import contractAbiProxyRegistry from './ProxyRegistry.abi.json' import contractAbiTranche from './Tranche.abi.json' import contractAbiSeniorTranche from './SeniorTranche.abi.json' -// import contractAbiNFTData from './NftData.abi.json' import contractAbiNFT from './test/SimpleNFT.abi.json' import contractAbiBorrowerDeployer from './BorrowerDeployer.abi.json' import contractAbiLenderDeployer from './LenderDeployer.abi.json' @@ -23,7 +22,6 @@ import { ContractAbis } from '../Tinlake' export default { COLLATERAL_NFT: contractAbiNFT, - // COLLATERAL_NFT_DATA: contractAbiNFTData, TITLE: contractAbiTitle, TINLAKE_CURRENCY: contractAbiCurrency, SHELF: contractAbiShelf, From 0e2e83a6e98ce7680d7e9abde01ae879ba49e585 Mon Sep 17 00:00:00 2001 From: Jeroen Offerijns Date: Mon, 7 Sep 2020 16:35:41 +0200 Subject: [PATCH 42/65] refactor: pass provider and signer separately --- src/Tinlake.ts | 32 +++++++++++++------------------- src/test/utils.ts | 10 +++------- 2 files changed, 16 insertions(+), 26 deletions(-) diff --git a/src/Tinlake.ts b/src/Tinlake.ts index 6b70e7d..713bc4e 100644 --- a/src/Tinlake.ts +++ b/src/Tinlake.ts @@ -38,11 +38,6 @@ export type PendingTransaction = { timesOutAt?: number } -export type EthersConfig = { - provider: ethers.providers.Provider - signer?: ethers.Signer -} - export type ContractName = typeof contractNames[number] export type Contracts = { @@ -58,7 +53,8 @@ export type ContractAddresses = { } export type TinlakeParams = { - ethersConfig: EthersConfig + provider: ethers.providers.Provider + signer?: ethers.Signer transactionTimeout: number contractAddresses?: ContractAddresses | {} contractAbis?: ContractAbis | {} @@ -77,8 +73,8 @@ ethers.errors.setLogLevel('error') } export default class Tinlake { - public provider: any - public ethersConfig: EthersConfig + public provider: ethers.providers.Provider + public signer?: ethers.Signer public overrides: ethers.providers.TransactionRequest = {} public contractAddresses: ContractAddresses public transactionTimeout: number @@ -87,7 +83,7 @@ export default class Tinlake { public contractConfig: any = {} constructor(params: TinlakeParams) { - const { contractAddresses, transactionTimeout, contractAbis, ethersConfig, overrides, contractConfig } = params + const { provider, signer, contractAddresses, transactionTimeout, contractAbis, overrides, contractConfig } = params if (!contractAbis) { this.contractAbis = abiDefinitions } @@ -96,7 +92,7 @@ export default class Tinlake { this.contractAddresses = contractAddresses || {} this.transactionTimeout = transactionTimeout this.overrides = overrides || {} - this.setEthersConfig(ethersConfig) + this.setProviderAndSigner(provider, signer) this.setContracts() } @@ -121,19 +117,17 @@ export default class Tinlake { } } - setEthersConfig = (ethersConfig: EthersConfig) => { - this.ethersConfig = { - ...this.ethersConfig, - ...ethersConfig, - } + setProviderAndSigner = (provider: ethers.providers.Provider, signer?: ethers.Signer) => { + this.provider = provider + this.signer = signer } createContract(address: string, abiName: ContractName) { - return new ethers.Contract(address, this.contractAbis[abiName]!, this.ethersConfig.provider) + return new ethers.Contract(address, this.contractAbis[abiName]!, this.provider) } contract(abiName: keyof Tinlake['contracts'] | ContractName, address?: string) { - const signerOrProvider = this.ethersConfig.signer || this.ethersConfig.provider + const signerOrProvider = this.signer || this.provider if (!(abiName in this.contracts) && !(address && abiName in this.contractAbis)) { throw new Error(`Contract ${abiName} not loaded: ${JSON.stringify(Object.keys(this.contracts))}`) } @@ -141,7 +135,7 @@ export default class Tinlake { if (address) { return new ethers.Contract(address, this.contractAbis[abiName]!, signerOrProvider) } - if (this.ethersConfig.signer) { + if (this.signer) { return this.contracts[abiName]!.connect(signerOrProvider) } return this.contracts[abiName]! @@ -176,7 +170,7 @@ export default class Tinlake { } try { - const receipt = await this.ethersConfig.provider!.waitForTransaction(tx.hash) + const receipt = await this.provider!.waitForTransaction(tx.hash) if (timer) clearTimeout(timer) return resolve(receipt) diff --git a/src/test/utils.ts b/src/test/utils.ts index 45a0f6d..f3a7f1c 100644 --- a/src/test/utils.ts +++ b/src/test/utils.ts @@ -28,19 +28,15 @@ export class TestProvider { export function createTinlake(wallet: Wallet, testConfig: ProviderConfig): ITinlake { const { rpcUrl, transactionTimeout, contractAddresses } = testConfig + const provider = new ethers.providers.JsonRpcProvider(rpcUrl) const tinlake = new Tinlake({ contractAddresses, transactionTimeout, + provider, + signer: wallet.connect(provider), overrides: testConfig.overrides, - ethersConfig: createEthersConfig(rpcUrl, wallet), }) return tinlake } - -function createEthersConfig(rpcUrl: string, wallet: Wallet) { - const provider = new ethers.providers.JsonRpcProvider(rpcUrl) - const signer = wallet.connect(provider) - return { provider, signer } -} From b4cd0203f6d5cd4c6ef02877e4a9b54ce06df195 Mon Sep 17 00:00:00 2001 From: Jeroen Offerijns Date: Mon, 7 Sep 2020 16:37:20 +0200 Subject: [PATCH 43/65] 0.0.19-develop.9 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 70ade36..7f31f66 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@centrifuge/tinlake-js", - "version": "0.0.19-develop.8", + "version": "0.0.19-develop.9", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index dfa9a06..f12bb07 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@centrifuge/tinlake-js", - "version": "0.0.19-develop.8", + "version": "0.0.19-develop.9", "description": "Centrifuge Tinlake Contracts Client", "main": "dist/index.js", "types": "dist/index.d.ts", From e3802088a7d47df8e99d0afebf0f76fa8f1ef49f Mon Sep 17 00:00:00 2001 From: Jeroen Offerijns Date: Mon, 7 Sep 2020 17:27:46 +0200 Subject: [PATCH 44/65] fix: move glpk out of dev deps --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f12bb07..7aa1558 100644 --- a/package.json +++ b/package.json @@ -13,6 +13,7 @@ "decimal.js-light": "^2.5.0", "dotenv": "^8.2.0", "ethers": "4.0.45", + "glpk.js": "3.1.2", "mocha": "^6.1.4", "web3-eth-abi": "^1.2.11", "web3-utils": "^1.2.0" @@ -24,7 +25,6 @@ "@types/node": "^13.11.0", "@types/web3-eth-abi": "^1.0.0", "declaration-bundler-webpack-plugin": "^1.0.3", - "glpk.js": "3.1.2", "husky": "^4.2.3", "nodemon": "^1.19.1", "prettier": "2.1.1", From a289fb9034853eaea020f0f2bb0679077fff63c2 Mon Sep 17 00:00:00 2001 From: Jeroen Offerijns Date: Mon, 7 Sep 2020 17:28:51 +0200 Subject: [PATCH 45/65] 0.0.19-develop.10 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 7f31f66..b20e549 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@centrifuge/tinlake-js", - "version": "0.0.19-develop.9", + "version": "0.0.19-develop.10", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 7aa1558..151b970 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@centrifuge/tinlake-js", - "version": "0.0.19-develop.9", + "version": "0.0.19-develop.10", "description": "Centrifuge Tinlake Contracts Client", "main": "dist/index.js", "types": "dist/index.d.ts", From 8668d961252b56f1518b519d02f45cb06e0f8086 Mon Sep 17 00:00:00 2001 From: Jeroen Offerijns Date: Mon, 7 Sep 2020 17:31:21 +0200 Subject: [PATCH 46/65] fix: move glpk --- package-lock.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index b20e549..851f7ee 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1961,8 +1961,7 @@ "glpk.js": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/glpk.js/-/glpk.js-3.1.2.tgz", - "integrity": "sha512-gvPFcrjnBeOTVGNH98KjcEg7pbh/RG6mObWlXvmWuIlPVkow6YPSlif1UqJA6B2p/q69lOSyLtXt7qyQhZEmFw==", - "dev": true + "integrity": "sha512-gvPFcrjnBeOTVGNH98KjcEg7pbh/RG6mObWlXvmWuIlPVkow6YPSlif1UqJA6B2p/q69lOSyLtXt7qyQhZEmFw==" }, "got": { "version": "6.7.1", From d85a5529da8f328f1da17d90538153bb3bb6b397 Mon Sep 17 00:00:00 2001 From: Jeroen Offerijns Date: Mon, 7 Sep 2020 17:31:39 +0200 Subject: [PATCH 47/65] 0.0.19-develop.11 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 851f7ee..1926589 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@centrifuge/tinlake-js", - "version": "0.0.19-develop.10", + "version": "0.0.19-develop.11", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 151b970..ef37b35 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@centrifuge/tinlake-js", - "version": "0.0.19-develop.10", + "version": "0.0.19-develop.11", "description": "Centrifuge Tinlake Contracts Client", "main": "dist/index.js", "types": "dist/index.d.ts", From 18beb0df2064658ab81b86f894bc060ca3538be0 Mon Sep 17 00:00:00 2001 From: Jeroen Offerijns Date: Tue, 8 Sep 2020 12:01:07 +0200 Subject: [PATCH 48/65] fix: change amounts in tests --- src/Tinlake.ts | 4 +- src/actions/admin.spec.ts | 4 +- src/actions/admin.ts | 8 +--- src/actions/borrower.spec.ts | 3 +- src/actions/collateral.ts | 32 +++++++------ src/actions/governance.spec.ts | 2 +- src/actions/lender.spec.ts | 10 ++-- src/actions/proxy.spec.ts | 68 +++++++++++++------------- src/actions/proxy.ts | 87 +++++++++------------------------- 9 files changed, 87 insertions(+), 131 deletions(-) diff --git a/src/Tinlake.ts b/src/Tinlake.ts index 713bc4e..5d7e52b 100644 --- a/src/Tinlake.ts +++ b/src/Tinlake.ts @@ -150,7 +150,7 @@ export default class Tinlake { timesOutAt: Date.now() + this.transactionTimeout * 1000, } } catch (e) { - console.error(`Error caught in tinlake.pending(): ${e}`) + console.error(`Error caught in tinlake.pending(): ${JSON.stringify(e)}`) return { status: 0, error: e.message, @@ -175,7 +175,7 @@ export default class Tinlake { return resolve(receipt) } catch (e) { - console.error(`Error caught in tinlake.getTransactionReceipt(): ${e}`) + console.error(`Error caught in tinlake.getTransactionReceipt(): ${JSON.stringify(e)}`) return reject() } }) diff --git a/src/actions/admin.spec.ts b/src/actions/admin.spec.ts index 1e8bed9..d4b09bd 100644 --- a/src/actions/admin.spec.ts +++ b/src/actions/admin.spec.ts @@ -29,8 +29,8 @@ describe('admin tests', async () => { const relyTx = await governanceTinlake.relyAddress(adminAccount.address, contractAddresses['JUNIOR_OPERATOR']) await governanceTinlake.getTransactionReceipt(relyTx) - const maxCurrency = '1000' - const maxToken = '100' + const maxCurrency = '10' + const maxToken = '1' // set allowance for lender address const allowanceTx = await adminTinlake.approveAllowanceJunior( diff --git a/src/actions/admin.ts b/src/actions/admin.ts index c1aed66..45cd188 100644 --- a/src/actions/admin.ts +++ b/src/actions/admin.ts @@ -107,15 +107,11 @@ export function AdminActions>(Bas } updateNftFeed = async (tokenId: string, value: number, riskGroup?: number) => { - let tx; - if (!riskGroup) { - tx = this.contract('NFT_FEED')['update(bytes32,uint256)'](tokenId, value, this.overrides) + return this.pending(this.contract('NFT_FEED')['update(bytes32,uint256)'](tokenId, value, this.overrides)) } else { - tx = this.contract('NFT_FEED')['update(bytes32,uint256,uint256)'](tokenId, value, riskGroup, this.overrides) + return this.pending(this.contract('NFT_FEED')['update(bytes32,uint256,uint256)'](tokenId, value, riskGroup, this.overrides)) } - - return this.pending(tx) } getNftFeedId = async (registry: string, tokenId: number) => { diff --git a/src/actions/borrower.spec.ts b/src/actions/borrower.spec.ts index 0d149a1..f2fbc0b 100644 --- a/src/actions/borrower.spec.ts +++ b/src/actions/borrower.spec.ts @@ -26,7 +26,7 @@ describe('borrower tests', async () => { await testProvider.fundAccountWithETH(adminAccount.address, FAUCET_AMOUNT) // supply tranche with money - const amount = '5000' + const amount = '50' await fundTranche(amount) }) @@ -98,6 +98,7 @@ describe('borrower tests', async () => { // repay loan const initialDebt = await borrowerTinlake.getDebt(loanId) + console.log('initialDebt', initialDebt) // approve shelf to take currency const approveTx = await borrowerTinlake.approveCurrency(contractAddresses['SHELF'], initialDebt.toString()) diff --git a/src/actions/collateral.ts b/src/actions/collateral.ts index 8db4015..6ad3fac 100644 --- a/src/actions/collateral.ts +++ b/src/actions/collateral.ts @@ -1,24 +1,26 @@ import { Constructor, TinlakeParams, PendingTransaction } from '../Tinlake' import BN from 'bn.js' +const util = require('util') export function CollateralActions>(Base: ActionsBase) { return class extends Base implements ICollateralActions { - mintTitleNFT = async (nftAddr: string, user: string) => { - // TODO: this is untested right now - const collateralNft = this.contract('COLLATERAL_NFT', nftAddr) - console.log(collateralNft) - console.log(this.contract('COLLATERAL_NFT', nftAddr).functions) - const tx = await this.contract('COLLATERAL_NFT', nftAddr).issue(user, this.overrides) - const receipt = await this.getTransactionReceipt(tx) + // mintTitleNFT = async (nftAddr: string, user: string) => { + // // TODO: this is untested right now + // const collateralNft = this.contract('COLLATERAL_NFT', nftAddr) + // console.log(collateralNft) + // console.log(this.contract('COLLATERAL_NFT', nftAddr).functions) + // const tx = await collateralNft.issue(user, this.overrides) + // const receipt = await this.getTransactionReceipt(tx) - if (!(receipt.logs && receipt.logs[0])) { - throw new Error('Event missing in collateralNft.issue(user) receipt') - } + // if (!(receipt.logs && receipt.logs[0])) { + // console.log(util.inspect(receipt, { showHidden: false, depth: null })) + // throw new Error('Event missing in COLLATERAL_NFT.issue(user) receipt') + // } - const parsedLog = this.contract('PROXY_REGISTRY').interface.parseLog(receipt.logs[0]) - const nftId = parsedLog.values['2'].toString() - return nftId - } + // const parsedLog = this.contract('PROXY_REGISTRY').interface.parseLog(receipt.logs[0]) + // const nftId = parsedLog.values['2'].toString() + // return nftId + // } mintNFT = async ( nftAddress: string, @@ -66,7 +68,7 @@ export function CollateralActions } export type ICollateralActions = { - mintTitleNFT(nftAddr: string, usr: string): Promise + // mintTitleNFT(nftAddr: string, usr: string): Promise mintNFT( nftAddr: string, owner: string, diff --git a/src/actions/governance.spec.ts b/src/actions/governance.spec.ts index e974059..bb98856 100644 --- a/src/actions/governance.spec.ts +++ b/src/actions/governance.spec.ts @@ -34,7 +34,7 @@ describe('governance tests', async () => { }) it('fail: account has no governance permissions', async () => { - const randomAccount: Account = ethers.Wallet.createRandom() + const randomAccount = ethers.Wallet.createRandom() const testProvider = new TestProvider(testConfig) await testProvider.fundAccountWithETH(randomAccount.address, FAUCET_AMOUNT) diff --git a/src/actions/lender.spec.ts b/src/actions/lender.spec.ts index 7b4fa59..2b326fc 100644 --- a/src/actions/lender.spec.ts +++ b/src/actions/lender.spec.ts @@ -35,8 +35,8 @@ describe('lender functions', async () => { }) it('success: supply junior', async () => { - const currencyAmount = '100000' - const tokenAmount = '100' + const currencyAmount = '1000' + const tokenAmount = '1' // whitelist investor const approveTx = await adminTinlake.approveAllowanceJunior(lenderAccount.address, currencyAmount, tokenAmount) @@ -46,7 +46,7 @@ describe('lender functions', async () => { }) it('fail: supply junior - no allowance', async () => { - const currencyAmount = '1000' + const currencyAmount = '10' // approve junior tranche to take currency const approveTx = await lenderTinlake.approveCurrency(contractAddresses['JUNIOR'], currencyAmount) const approval = await lenderTinlake.getTransactionReceipt(approveTx) @@ -104,8 +104,8 @@ describe('lender functions', async () => { }) it('fail: redeem junior - no allowance', async () => { - const currencyAmount = '1000' - const tokenAmount = '100' + const currencyAmount = '10' + const tokenAmount = '1' // whitelist investor with no allowance to redeem const approveTx = await adminTinlake.approveAllowanceJunior(lenderAccount.address, currencyAmount, '0') diff --git a/src/actions/proxy.spec.ts b/src/actions/proxy.spec.ts index 32279b6..fdee065 100644 --- a/src/actions/proxy.spec.ts +++ b/src/actions/proxy.spec.ts @@ -46,7 +46,7 @@ describe('proxy tests', async () => { // set loan parameters and fund tranche const loanId = await borrowerTinlake.nftLookup(testConfig.nftRegistry, tokenId); - const amount = '1000'; + const amount = '10'; const relyTx = await governanceTinlake.relyAddress(adminAccount.address, contractAddresses['NFT_FEED']); await governanceTinlake.getTransactionReceipt(relyTx) @@ -54,7 +54,7 @@ describe('proxy tests', async () => { const updateNftTx = await adminTinlake.updateNftFeed(nftfeedId, Number(amount)) await adminTinlake.getTransactionReceipt(updateNftTx) - await fundTranche('10000'); + await fundTranche('100'); const initialTrancheBalance = await borrowerTinlake.getCurrencyBalance(contractAddresses['JUNIOR']); // borrow @@ -104,47 +104,47 @@ describe('proxy tests', async () => { assert.equal(issueResult.status, FAIL_STATUS) }) - it('fail: does not succeed if the proxy is not approved to transfer currency from the borrower', async () => { - // create new proxy and mint collateral NFT to borrower - const proxyAddr = await borrowerTinlake.proxyCreateNew(borrowerAccount.address); + // it('fail: does not succeed if the proxy is not approved to transfer currency from the borrower', async () => { + // // create new proxy and mint collateral NFT to borrower + // const proxyAddr = await borrowerTinlake.proxyCreateNew(borrowerAccount.address); - const nftId = await governanceTinlake.mintTitleNFT(testConfig.nftRegistry, borrowerAccount.address); - const approveTx = await borrowerTinlake.approveNFT(testConfig.nftRegistry, nftId.toString(), proxyAddr); - await borrowerTinlake.getTransactionReceipt(approveTx) + // const nftId = await governanceTinlake.mintTitleNFT(testConfig.nftRegistry, borrowerAccount.address); + // const approveTx = await borrowerTinlake.approveNFT(testConfig.nftRegistry, nftId.toString(), proxyAddr); + // await borrowerTinlake.getTransactionReceipt(approveTx) - // issue loan from collateral NFT - const proxyTransferTx = await borrowerTinlake.proxyTransferIssue(proxyAddr, testConfig.nftRegistry, nftId); - await borrowerTinlake.getTransactionReceipt(proxyTransferTx) + // // issue loan from collateral NFT + // const proxyTransferTx = await borrowerTinlake.proxyTransferIssue(proxyAddr, testConfig.nftRegistry, nftId); + // await borrowerTinlake.getTransactionReceipt(proxyTransferTx) - // set loan parameters and fund tranche - const loanId = await borrowerTinlake.nftLookup(testConfig.nftRegistry, nftId); - const amount = 1000; - const relyTx = await governanceTinlake.relyAddress(adminAccount.address, contractAddresses['NFT_FEED']); - await governanceTinlake.getTransactionReceipt(relyTx) + // // set loan parameters and fund tranche + // const loanId = await borrowerTinlake.nftLookup(testConfig.nftRegistry, nftId); + // const amount = 10; + // const relyTx = await governanceTinlake.relyAddress(adminAccount.address, contractAddresses['NFT_FEED']); + // await governanceTinlake.getTransactionReceipt(relyTx) - const nftfeedId = await adminTinlake.getNftFeedId(testConfig.nftRegistry, Number(nftId)) - const updateNftTx = await adminTinlake.updateNftFeed(nftfeedId, Number(amount)) - await adminTinlake.getTransactionReceipt(updateNftTx) + // const nftfeedId = await adminTinlake.getNftFeedId(testConfig.nftRegistry, Number(nftId)) + // const updateNftTx = await adminTinlake.updateNftFeed(nftfeedId, Number(amount)) + // await adminTinlake.getTransactionReceipt(updateNftTx) - await fundTranche('1000000000'); - await borrowerTinlake.getCurrencyBalance(contractAddresses['JUNIOR']); + // await fundTranche('10000000'); + // await borrowerTinlake.getCurrencyBalance(contractAddresses['JUNIOR']); - // borrow - const proxyLockBorrowWithdrawTx = await borrowerTinlake.proxyLockBorrowWithdraw(proxyAddr, loanId, amount.toString(), borrowerAccount.address); - await borrowerTinlake.getTransactionReceipt(proxyLockBorrowWithdrawTx) + // // borrow + // const proxyLockBorrowWithdrawTx = await borrowerTinlake.proxyLockBorrowWithdraw(proxyAddr, loanId, amount.toString(), borrowerAccount.address); + // await borrowerTinlake.getTransactionReceipt(proxyLockBorrowWithdrawTx) - await borrowerTinlake.getCurrencyBalance(borrowerAccount.address); - await borrowerTinlake.getCurrencyBalance(contractAddresses['JUNIOR']); + // await borrowerTinlake.getCurrencyBalance(borrowerAccount.address); + // await borrowerTinlake.getCurrencyBalance(contractAddresses['JUNIOR']); - // does not approve proxy to transfer currency - const mintTx = await governanceTinlake.mintCurrency(borrowerAccount.address, amount.toString()); - await governanceTinlake.getTransactionReceipt(mintTx) + // // does not approve proxy to transfer currency + // const mintTx = await governanceTinlake.mintCurrency(borrowerAccount.address, amount.toString()); + // await governanceTinlake.getTransactionReceipt(mintTx) - // repay - const repayTx = await borrowerTinlake.proxyRepayUnlockClose(proxyAddr, nftId, loanId, testConfig.nftRegistry); - const repayResult = await borrowerTinlake.getTransactionReceipt(repayTx) - assert.equal(repayResult.status, FAIL_STATUS); - }) + // // repay + // const repayTx = await borrowerTinlake.proxyRepayUnlockClose(proxyAddr, nftId, loanId, testConfig.nftRegistry); + // const repayResult = await borrowerTinlake.getTransactionReceipt(repayTx) + // assert.equal(repayResult.status, FAIL_STATUS); + // }) }) }) diff --git a/src/actions/proxy.ts b/src/actions/proxy.ts index 10d6719..9376e49 100644 --- a/src/actions/proxy.ts +++ b/src/actions/proxy.ts @@ -69,87 +69,44 @@ export function ProxyActions>(Bas proxyIssue = async (proxyAddress: string, nftRegistryAddress: string, tokenId: string) => { const proxy = this.contract('PROXY', proxyAddress) - // TODO: replace with ethers.js method call - const encoded = abiCoder.encodeFunctionCall( - { - name: 'issue', - type: 'function', - inputs: [ - { type: 'address', name: 'shelf' }, - { type: 'address', name: 'registry' }, - { type: 'uint256', name: 'token' }, - ], - }, - [this.contract('SHELF').address, nftRegistryAddress, tokenId] - ) + const encoded = this.contract('ACTIONS').interface.functions.issue.encode([ + this.contract('SHELF').address, nftRegistryAddress, tokenId + ]) return this.pending(proxy.execute(this.contract('ACTIONS').address, encoded, this.overrides)) } proxyTransferIssue = async (proxyAddress: string, nftRegistryAddress: string, tokenId: string) => { const proxy = this.contract('PROXY', proxyAddress) - // TODO: replace with ethers.js method call - const encoded = abiCoder.encodeFunctionCall( - { - name: 'transferIssue', - type: 'function', - inputs: [ - { type: 'address', name: 'shelf' }, - { type: 'address', name: 'registry' }, - { type: 'uint256', name: 'token' }, - ], - }, - [this.contract('SHELF').address, nftRegistryAddress, tokenId] - ) + const encoded = this.contract('ACTIONS').interface.functions.transferIssue.encode([ + this.contract('SHELF').address, nftRegistryAddress, tokenId + ]) return this.pending(proxy.execute(this.contract('ACTIONS').address, encoded, this.overrides)) } proxyLockBorrowWithdraw = async (proxyAddress: string, loanId: string, amount: string, usr: string) => { const proxy = this.contract('PROXY', proxyAddress) - // TODO: replace with ethers.js method call - const encoded = abiCoder.encodeFunctionCall( - { - name: 'lockBorrowWithdraw', - type: 'function', - inputs: [ - { type: 'address', name: 'shelf' }, - { type: 'uint256', name: 'loan' }, - { type: 'uint256', name: 'amount' }, - { type: 'address', name: 'usr' }, - ], - }, - [this.contract('SHELF').address, loanId, amount, usr] - ) - - return this.pending(proxy.execute(this.contract('ACTIONS').address, encoded, this.overrides)) + const encoded = this.contract('ACTIONS').interface.functions.lockBorrowWithdraw.encode([ + this.contract('SHELF').address, + loanId, + amount, + usr, + ]) + + return this.pending(proxy.execute(this.contract('ACTIONS').address, encoded)) } proxyRepayUnlockClose = async (proxyAddress: string, tokenId: string, loanId: string, registry: string) => { const proxy = this.contract('PROXY', proxyAddress) - // TODO: replace with ethers.js method call - const encoded = abiCoder.encodeFunctionCall( - { - name: 'repayUnlockClose', - type: 'function', - inputs: [ - { type: 'address', name: 'shelf' }, - { type: 'address', name: 'pile' }, - { type: 'address', name: 'registry' }, - { type: 'uint256', name: 'token' }, - { type: 'address', name: 'erc20' }, - { type: 'uint256', name: 'loan' }, - ], - }, - [ - this.contract('SHELF').address, - this.contract('PILE').address, - registry, - tokenId, - this.contract('TINLAKE_CURRENCY').address, - loanId, - ] - ) + const encoded = this.contract('ACTIONS').interface.functions.repayUnlockClose.encode([ + this.contract('SHELF').address, + this.contract('PILE').address, + registry, + tokenId, + this.contract('TINLAKE_CURRENCY').address, + loanId, + ]) return this.pending(proxy.execute(this.contract('ACTIONS').address, encoded, this.overrides)) } From 2a497c2f95ef67f050570dc7770493126525b11b Mon Sep 17 00:00:00 2001 From: Jeroen Offerijns Date: Tue, 8 Sep 2020 12:01:26 +0200 Subject: [PATCH 49/65] chore: format --- src/actions/admin.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/actions/admin.ts b/src/actions/admin.ts index 45cd188..2666fd2 100644 --- a/src/actions/admin.ts +++ b/src/actions/admin.ts @@ -109,9 +109,9 @@ export function AdminActions>(Bas updateNftFeed = async (tokenId: string, value: number, riskGroup?: number) => { if (!riskGroup) { return this.pending(this.contract('NFT_FEED')['update(bytes32,uint256)'](tokenId, value, this.overrides)) - } else { + } return this.pending(this.contract('NFT_FEED')['update(bytes32,uint256,uint256)'](tokenId, value, riskGroup, this.overrides)) - } + } getNftFeedId = async (registry: string, tokenId: number) => { From bb116bdb3342eaee1c991d9537821ec3411cad29 Mon Sep 17 00:00:00 2001 From: Jeroen Offerijns Date: Tue, 8 Sep 2020 12:34:53 +0200 Subject: [PATCH 50/65] fix: lender test --- .gitignore | 1 + src/abi/.DS_Store | Bin 6148 -> 0 bytes src/actions/lender.spec.ts | 4 ++-- src/actions/proxy.spec.ts | 26 ++++++++++++++++++++------ 4 files changed, 23 insertions(+), 8 deletions(-) delete mode 100644 src/abi/.DS_Store diff --git a/.gitignore b/.gitignore index e19c18a..924eb59 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ *.swp *.swo +.DS_Store # Logs logs diff --git a/src/abi/.DS_Store b/src/abi/.DS_Store deleted file mode 100644 index 98f5e5a2c9a755f06491304e95916e017ff340f8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHK%TB{E5Zr|vDiBqLgg|h~krNVUE}?`2Co0MZKuXF(Rg2nGh+8iF1HZuc@c}Tq zwyGorB?p8M+KudS9naXFCU#6j+@0SX5_O2Eg(MiPA^RfazNDpC@ioF@)p(+78q&M}KSx`4{G$XVGRc0K1LnZLa)5)l zA9pb&zqc+;PWIXm=?Y0g+T{+Fg3NEnT9B=H2T23>LMZ?vkGVtCAnZdxZLrK7_*Dl! E0g}VEj{pDw diff --git a/src/actions/lender.spec.ts b/src/actions/lender.spec.ts index 2b326fc..36e58df 100644 --- a/src/actions/lender.spec.ts +++ b/src/actions/lender.spec.ts @@ -93,11 +93,11 @@ describe('lender functions', async () => { assert.equal(redeemResult.status, SUCCESS_STATUS) assert.equal( - initialTrancheCurrencyBalance.sub(new BN(tokenAmount)).subn(1).toString(), + initialTrancheCurrencyBalance.sub(new BN(tokenAmount)).toString(), newTrancheCurrencyBalance.toString() ) assert.equal( - initialLenderCurrencyBalance.add(new BN(tokenAmount)).addn(1).toString(), + initialLenderCurrencyBalance.add(new BN(tokenAmount)).toString(), newLenderCurrencyBalance.toString() ) assert.equal(tokenAmount, initialJuniorTokenBalance.sub(newJuniorTokenBalance).toString()) diff --git a/src/actions/proxy.spec.ts b/src/actions/proxy.spec.ts index fdee065..01105f7 100644 --- a/src/actions/proxy.spec.ts +++ b/src/actions/proxy.spec.ts @@ -32,15 +32,21 @@ describe('proxy tests', async () => { const tokenId = `${Math.floor(Math.random() * 10e15) + 1}` const mintTx = await governanceTinlake.mintNFT(testConfig.nftRegistry, borrowerAccount.address, tokenId, '234', '345', '456') - await governanceTinlake.getTransactionReceipt(mintTx) + const mintResult = await governanceTinlake.getTransactionReceipt(mintTx) + + // console.log('mintResult', mintResult) const approveTx = await borrowerTinlake.approveNFT(testConfig.nftRegistry, tokenId, proxyAddr) - await borrowerTinlake.getTransactionReceipt(approveTx) + const approveResult = await borrowerTinlake.getTransactionReceipt(approveTx) + + // console.log('approveResult', approveResult) // issue loan from collateral NFT const issueTx = await borrowerTinlake.proxyTransferIssue(proxyAddr, testConfig.nftRegistry, tokenId) const issueResult = await borrowerTinlake.getTransactionReceipt(issueTx) + // console.log('issueResult', issueResult) + assert.equal(issueResult.status, SUCCESS_STATUS) assert.equal(await borrowerTinlake.getNFTOwner(testConfig.nftRegistry, tokenId), proxyAddr) @@ -48,19 +54,27 @@ describe('proxy tests', async () => { const loanId = await borrowerTinlake.nftLookup(testConfig.nftRegistry, tokenId); const amount = '10'; const relyTx = await governanceTinlake.relyAddress(adminAccount.address, contractAddresses['NFT_FEED']); - await governanceTinlake.getTransactionReceipt(relyTx) - + const relyResult = await governanceTinlake.getTransactionReceipt(relyTx) + + // console.log('relyResult', relyResult) + const nftfeedId = await adminTinlake.getNftFeedId(testConfig.nftRegistry, Number(tokenId)) const updateNftTx = await adminTinlake.updateNftFeed(nftfeedId, Number(amount)) - await adminTinlake.getTransactionReceipt(updateNftTx) - + const updateNftResult = await adminTinlake.getTransactionReceipt(updateNftTx) + + // console.log('updateNftResult', updateNftResult) + await fundTranche('100'); const initialTrancheBalance = await borrowerTinlake.getCurrencyBalance(contractAddresses['JUNIOR']); // borrow const borrowTx = await borrowerTinlake.proxyLockBorrowWithdraw(proxyAddr, loanId, amount, borrowerAccount.address); + // console.log('borrowTx', borrowTx) + const borrowResult = await borrowerTinlake.getTransactionReceipt(borrowTx) + // console.log('borrowResult', borrowResult) + const balance = await borrowerTinlake.getCurrencyBalance(borrowerAccount.address); const secondTrancheBalance = await borrowerTinlake.getCurrencyBalance(contractAddresses['JUNIOR']); From b4f24667896c252cce51a362edd5d215dafd876c Mon Sep 17 00:00:00 2001 From: Jeroen Offerijns Date: Thu, 10 Sep 2020 15:11:39 +0200 Subject: [PATCH 51/65] chore: update version --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1926589..159146b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@centrifuge/tinlake-js", - "version": "0.0.19-develop.11", + "version": "0.0.19-develop.12", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index ef37b35..c3bb269 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@centrifuge/tinlake-js", - "version": "0.0.19-develop.11", + "version": "0.0.19-develop.12", "description": "Centrifuge Tinlake Contracts Client", "main": "dist/index.js", "types": "dist/index.d.ts", From 870187cd364b6c49494fb9d6dd549b46e92e9540 Mon Sep 17 00:00:00 2001 From: Jeroen Offerijns Date: Thu, 10 Sep 2020 15:11:54 +0200 Subject: [PATCH 52/65] 0.0.19-develop.13 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 159146b..c158158 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@centrifuge/tinlake-js", - "version": "0.0.19-develop.12", + "version": "0.0.19-develop.13", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index c3bb269..222ef43 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@centrifuge/tinlake-js", - "version": "0.0.19-develop.12", + "version": "0.0.19-develop.13", "description": "Centrifuge Tinlake Contracts Client", "main": "dist/index.js", "types": "dist/index.d.ts", From 4ba4a2be1228d7cbdc1bae57b8bed480889fdb27 Mon Sep 17 00:00:00 2001 From: Jeroen Offerijns Date: Fri, 11 Sep 2020 09:16:26 +0200 Subject: [PATCH 53/65] fix: add default timeout, add .receipt(), fix a few other bugs --- src/Tinlake.ts | 42 ++++++++++++++++++++++++++++++--------- src/actions/admin.spec.ts | 2 +- src/actions/admin.ts | 2 +- 3 files changed, 35 insertions(+), 11 deletions(-) diff --git a/src/Tinlake.ts b/src/Tinlake.ts index 5d7e52b..a4d6c7c 100644 --- a/src/Tinlake.ts +++ b/src/Tinlake.ts @@ -36,6 +36,7 @@ export type PendingTransaction = { status: number error?: string timesOutAt?: number + receipt: () => Promise } export type ContractName = typeof contractNames[number] @@ -55,7 +56,7 @@ export type ContractAddresses = { export type TinlakeParams = { provider: ethers.providers.Provider signer?: ethers.Signer - transactionTimeout: number + transactionTimeout?: number contractAddresses?: ContractAddresses | {} contractAbis?: ContractAbis | {} overrides?: ethers.providers.TransactionRequest @@ -84,13 +85,10 @@ export default class Tinlake { constructor(params: TinlakeParams) { const { provider, signer, contractAddresses, transactionTimeout, contractAbis, overrides, contractConfig } = params - if (!contractAbis) { - this.contractAbis = abiDefinitions - } - + this.contractAbis = contractAbis || abiDefinitions this.contractConfig = contractConfig || {} this.contractAddresses = contractAddresses || {} - this.transactionTimeout = transactionTimeout + this.transactionTimeout = transactionTimeout || 3600 this.overrides = overrides || {} this.setProviderAndSigner(provider, signer) this.setContracts() @@ -144,28 +142,54 @@ export default class Tinlake { async pending(txPromise: Promise): Promise { try { const tx = await txPromise + const timesOutAt = Date.now() + this.transactionTimeout * 1000 return { + timesOutAt, status: 1, hash: tx.hash, - timesOutAt: Date.now() + this.transactionTimeout * 1000, + receipt: async () => { + return new Promise(async (resolve, reject) => { + if (!tx.hash) return reject(tx) + + let timer: NodeJS.Timer | undefined = undefined + if (timesOutAt) { + timer = setTimeout(() => { + return reject(`Transaction ${tx.hash} timed out at ${timesOutAt}`) + }, timesOutAt - Date.now()) + } + + try { + const receipt = await this.provider!.waitForTransaction(tx.hash) + if (timer) clearTimeout(timer) + + return resolve(receipt) + } catch (e) { + console.error(`Error caught in tinlake.getTransactionReceipt(): ${JSON.stringify(e)}`) + return reject() + } + }) + } } } catch (e) { console.error(`Error caught in tinlake.pending(): ${JSON.stringify(e)}`) return { status: 0, error: e.message, + receipt: async () => { + return Promise.reject('Error caught in tinlake.pending()') + } } } } async getTransactionReceipt(tx: PendingTransaction): Promise { return new Promise(async (resolve, reject) => { - if (!tx.hash) return reject() + if (!tx.hash) return reject(tx) let timer: NodeJS.Timer | undefined = undefined if (tx.timesOutAt) { timer = setTimeout(() => { - return reject() + return reject(`Transaction ${tx.hash} timed out at ${tx.timesOutAt}`) }, tx.timesOutAt - Date.now()) } diff --git a/src/actions/admin.spec.ts b/src/actions/admin.spec.ts index d4b09bd..3792d75 100644 --- a/src/actions/admin.spec.ts +++ b/src/actions/admin.spec.ts @@ -38,7 +38,7 @@ describe('admin tests', async () => { maxCurrency, maxToken ) - const allowanceResult = await adminTinlake.getTransactionReceipt(allowanceTx) + const allowanceResult = await allowanceTx.receipt() const maxSupplyAmount = await adminTinlake.getMaxSupplyAmountJunior(lenderAccount.address) const maxRedeemAmount = await adminTinlake.getMaxRedeemAmountJunior(lenderAccount.address) diff --git a/src/actions/admin.ts b/src/actions/admin.ts index 2666fd2..23e1ccf 100644 --- a/src/actions/admin.ts +++ b/src/actions/admin.ts @@ -82,7 +82,7 @@ export function AdminActions>(Bas setRate = async (loan: string, ratePerSecond: string) => { const rateGroup = getRateGroup(ratePerSecond) - return this.pending(this.contract('PILE').setRatet(loan, rateGroup, this.overrides)) + return this.pending(this.contract('PILE').setRate(loan, rateGroup, this.overrides)) } // ------------ admin functions lender-site ------------- From 7bd590d0651fb8970597c477edccb343dea2adee Mon Sep 17 00:00:00 2001 From: Jeroen Offerijns Date: Sun, 13 Sep 2020 23:44:57 +0200 Subject: [PATCH 54/65] feat: add version --- src/Tinlake.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Tinlake.ts b/src/Tinlake.ts index a4d6c7c..a442a39 100644 --- a/src/Tinlake.ts +++ b/src/Tinlake.ts @@ -82,6 +82,7 @@ export default class Tinlake { public contracts: Contracts = {} public contractAbis: ContractAbis = {} public contractConfig: any = {} + public version: number = 2 constructor(params: TinlakeParams) { const { provider, signer, contractAddresses, transactionTimeout, contractAbis, overrides, contractConfig } = params @@ -168,7 +169,7 @@ export default class Tinlake { return reject() } }) - } + }, } } catch (e) { console.error(`Error caught in tinlake.pending(): ${JSON.stringify(e)}`) @@ -177,7 +178,7 @@ export default class Tinlake { error: e.message, receipt: async () => { return Promise.reject('Error caught in tinlake.pending()') - } + }, } } } From 3f0e1deb94d17eb0714331e8e7f8cb986cefc6f5 Mon Sep 17 00:00:00 2001 From: Jeroen Offerijns Date: Sun, 13 Sep 2020 23:48:59 +0200 Subject: [PATCH 55/65] 0.0.19-develop.14 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index c158158..d7ae2b2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@centrifuge/tinlake-js", - "version": "0.0.19-develop.13", + "version": "0.0.19-develop.14", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 222ef43..daf3403 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@centrifuge/tinlake-js", - "version": "0.0.19-develop.13", + "version": "0.0.19-develop.14", "description": "Centrifuge Tinlake Contracts Client", "main": "dist/index.js", "types": "dist/index.d.ts", From 9c3ab347278bad4628b928cd1358cc32d9ff4bba Mon Sep 17 00:00:00 2001 From: Jeroen Offerijns Date: Mon, 21 Sep 2020 10:27:42 +0200 Subject: [PATCH 56/65] fix: add commentst, clear timeout on reject --- src/Tinlake.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Tinlake.ts b/src/Tinlake.ts index a442a39..e01851f 100644 --- a/src/Tinlake.ts +++ b/src/Tinlake.ts @@ -132,11 +132,16 @@ export default class Tinlake { } if (address) { + // If an address was passed, return a contract at that specific address return new ethers.Contract(address, this.contractAbis[abiName]!, signerOrProvider) } + if (this.signer) { + // Return the prespecified contract for that name, and connect it to the signer so that transactions can be initiated return this.contracts[abiName]!.connect(signerOrProvider) } + + // Return the prespecified contract for that name, without a signer, which means that you can only retrieve information, not initiate transactions return this.contracts[abiName]! } @@ -165,6 +170,7 @@ export default class Tinlake { return resolve(receipt) } catch (e) { + if (timer) clearTimeout(timer) console.error(`Error caught in tinlake.getTransactionReceipt(): ${JSON.stringify(e)}`) return reject() } From 05e99f947f44956012068bf661b54cd55f63e9e2 Mon Sep 17 00:00:00 2001 From: Jeroen Offerijns Date: Mon, 21 Sep 2020 10:34:15 +0200 Subject: [PATCH 57/65] 0.0.19-develop.15 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index d7ae2b2..e9c77d2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@centrifuge/tinlake-js", - "version": "0.0.19-develop.14", + "version": "0.0.19-develop.15", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index daf3403..985569d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@centrifuge/tinlake-js", - "version": "0.0.19-develop.14", + "version": "0.0.19-develop.15", "description": "Centrifuge Tinlake Contracts Client", "main": "dist/index.js", "types": "dist/index.d.ts", From dd9b22d77f03c09bab5506643291f07555faf376 Mon Sep 17 00:00:00 2001 From: Jeroen Offerijns Date: Mon, 21 Sep 2020 11:45:04 +0200 Subject: [PATCH 58/65] docs: add comment to pending method --- src/Tinlake.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Tinlake.ts b/src/Tinlake.ts index e01851f..5ede6f8 100644 --- a/src/Tinlake.ts +++ b/src/Tinlake.ts @@ -145,6 +145,10 @@ export default class Tinlake { return this.contracts[abiName]! } + /** + * Handle timeout and wait for transaction success/failure + * @param txPromise + */ async pending(txPromise: Promise): Promise { try { const tx = await txPromise From 96412a10c38fe5f0724b204a0c68a143acc6352f Mon Sep 17 00:00:00 2001 From: Jeroen Offerijns Date: Mon, 21 Sep 2020 12:19:04 +0200 Subject: [PATCH 59/65] chore: format --- src/Tinlake.ts | 2 +- src/actions/admin.spec.ts | 6 +-- src/actions/admin.ts | 13 +++---- src/actions/borrower.spec.ts | 2 +- src/actions/coordinator.ts | 8 ++-- src/actions/index.ts | 2 +- src/actions/lender.spec.ts | 11 ++---- src/actions/proxy.spec.ts | 74 +++++++++++++++++++++--------------- src/actions/proxy.ts | 15 ++++++-- src/index.ts | 4 +- src/types/declarations.d.ts | 2 +- src/types/tinlake.ts | 2 +- 12 files changed, 78 insertions(+), 63 deletions(-) diff --git a/src/Tinlake.ts b/src/Tinlake.ts index 5ede6f8..649ac13 100644 --- a/src/Tinlake.ts +++ b/src/Tinlake.ts @@ -147,7 +147,7 @@ export default class Tinlake { /** * Handle timeout and wait for transaction success/failure - * @param txPromise + * @param txPromise */ async pending(txPromise: Promise): Promise { try { diff --git a/src/actions/admin.spec.ts b/src/actions/admin.spec.ts index 3792d75..e4920db 100644 --- a/src/actions/admin.spec.ts +++ b/src/actions/admin.spec.ts @@ -33,11 +33,7 @@ describe('admin tests', async () => { const maxToken = '1' // set allowance for lender address - const allowanceTx = await adminTinlake.approveAllowanceJunior( - lenderAccount.address, - maxCurrency, - maxToken - ) + const allowanceTx = await adminTinlake.approveAllowanceJunior(lenderAccount.address, maxCurrency, maxToken) const allowanceResult = await allowanceTx.receipt() const maxSupplyAmount = await adminTinlake.getMaxSupplyAmountJunior(lenderAccount.address) diff --git a/src/actions/admin.ts b/src/actions/admin.ts index 23e1ccf..77e1d06 100644 --- a/src/actions/admin.ts +++ b/src/actions/admin.ts @@ -100,18 +100,17 @@ export function AdminActions>(Bas approveAllowanceSenior = async (user: string, maxCurrency: string, maxToken: string) => { if (this.getOperatorType('senior') === 'PROPORTIONAL_OPERATOR') { return this.pending(this.contract('SENIOR_OPERATOR').approve(user, maxCurrency, this.overrides)) - } - return this.pending(this.contract('SENIOR_OPERATOR').approve(user, maxCurrency, maxToken, this.overrides)) - - + } + return this.pending(this.contract('SENIOR_OPERATOR').approve(user, maxCurrency, maxToken, this.overrides)) } updateNftFeed = async (tokenId: string, value: number, riskGroup?: number) => { if (!riskGroup) { return this.pending(this.contract('NFT_FEED')['update(bytes32,uint256)'](tokenId, value, this.overrides)) - } - return this.pending(this.contract('NFT_FEED')['update(bytes32,uint256,uint256)'](tokenId, value, riskGroup, this.overrides)) - + } + return this.pending( + this.contract('NFT_FEED')['update(bytes32,uint256,uint256)'](tokenId, value, riskGroup, this.overrides) + ) } getNftFeedId = async (registry: string, tokenId: number) => { diff --git a/src/actions/borrower.spec.ts b/src/actions/borrower.spec.ts index f2fbc0b..1a72022 100644 --- a/src/actions/borrower.spec.ts +++ b/src/actions/borrower.spec.ts @@ -142,7 +142,7 @@ async function mintIssue(usr: string, tinlake: ITinlake) { async function mintIssueBorrow(usr: string, tinlake: ITinlake, amount: string) { const { tokenId, loanId } = await mintIssue(usr, tinlake) - const relyTx = await governanceTinlake.relyAddress(adminAccount.address, contractAddresses['NFT_FEED']); + const relyTx = await governanceTinlake.relyAddress(adminAccount.address, contractAddresses['NFT_FEED']) await governanceTinlake.getTransactionReceipt(relyTx) const nftfeedId = await adminTinlake.getNftFeedId(testConfig.nftRegistry, Number(tokenId)) diff --git a/src/actions/coordinator.ts b/src/actions/coordinator.ts index ad3bda4..a16d59e 100644 --- a/src/actions/coordinator.ts +++ b/src/actions/coordinator.ts @@ -2,9 +2,8 @@ import { Constructor, TinlakeParams } from '../Tinlake' export function CoordinatorActions>(Base: ActionsBase) { return class extends Base implements ICoordinatorActions { - - // const tinlake = (this as any) - // const reserve = (await tinlake.getJuniorReserve()).add(await tinlake.getSeniorReserve()) + // const tinlake = (this as any) + // const reserve = (await tinlake.getJuniorReserve()).add(await tinlake.getSeniorReserve()) solveEpoch = async () => { // if (!coordinator.submissionPeriod) { @@ -33,9 +32,8 @@ export function CoordinatorActions void diff --git a/src/actions/index.ts b/src/actions/index.ts index 340ac88..94523db 100644 --- a/src/actions/index.ts +++ b/src/actions/index.ts @@ -17,7 +17,7 @@ export default { Analytics, Governance, Proxy, - Coordinator + Coordinator, } export type TinlakeActions = IAdminActions & diff --git a/src/actions/lender.spec.ts b/src/actions/lender.spec.ts index 36e58df..f2b5822 100644 --- a/src/actions/lender.spec.ts +++ b/src/actions/lender.spec.ts @@ -68,7 +68,7 @@ describe('lender functions', async () => { it('success: redeem junior', async () => { const currencyAmount = '10000' const tokenAmount = '100' - + // whitelist investor const approveTx = await adminTinlake.approveAllowanceJunior(lenderAccount.address, currencyAmount, tokenAmount) await adminTinlake.getTransactionReceipt(approveTx) @@ -96,10 +96,7 @@ describe('lender functions', async () => { initialTrancheCurrencyBalance.sub(new BN(tokenAmount)).toString(), newTrancheCurrencyBalance.toString() ) - assert.equal( - initialLenderCurrencyBalance.add(new BN(tokenAmount)).toString(), - newLenderCurrencyBalance.toString() - ) + assert.equal(initialLenderCurrencyBalance.add(new BN(tokenAmount)).toString(), newLenderCurrencyBalance.toString()) assert.equal(tokenAmount, initialJuniorTokenBalance.sub(newJuniorTokenBalance).toString()) }) @@ -120,7 +117,7 @@ describe('lender functions', async () => { const redeemTx = await lenderTinlake.redeemJunior(tokenAmount) const redeemResult = await lenderTinlake.getTransactionReceipt(redeemTx) - + assert.equal(redeemResult.status, FAIL_STATUS) }) }) @@ -153,7 +150,7 @@ async function supply(investor: string, currencyAmount: string, tinlake: ITinlak // assert investor currency balanace decreased assert.equal(initialLenderCurrencyBalance.sub(newLenderCurrencyBalance).toString(), currencyAmount) - + // assert investor received tokens if (testConfig.isRealTestnet) { assert.ok(newJuniorTokenBalance.gt(initialJuniorTokenBalance)) diff --git a/src/actions/proxy.spec.ts b/src/actions/proxy.spec.ts index 01105f7..f0157a4 100644 --- a/src/actions/proxy.spec.ts +++ b/src/actions/proxy.spec.ts @@ -19,7 +19,7 @@ describe('proxy tests', async () => { borrowerTinlake = createTinlake(borrowerAccount, testConfig) adminTinlake = createTinlake(adminAccount, testConfig) governanceTinlake = createTinlake(testConfig.godAccount, testConfig) - + // fund accounts with ETH await testProvider.fundAccountWithETH(adminAccount.address, FAUCET_AMOUNT) await testProvider.fundAccountWithETH(borrowerAccount.address, FAUCET_AMOUNT) @@ -31,7 +31,14 @@ describe('proxy tests', async () => { const proxyAddr = await borrowerTinlake.proxyCreateNew(borrowerAccount.address) const tokenId = `${Math.floor(Math.random() * 10e15) + 1}` - const mintTx = await governanceTinlake.mintNFT(testConfig.nftRegistry, borrowerAccount.address, tokenId, '234', '345', '456') + const mintTx = await governanceTinlake.mintNFT( + testConfig.nftRegistry, + borrowerAccount.address, + tokenId, + '234', + '345', + '456' + ) const mintResult = await governanceTinlake.getTransactionReceipt(mintTx) // console.log('mintResult', mintResult) @@ -51,9 +58,9 @@ describe('proxy tests', async () => { assert.equal(await borrowerTinlake.getNFTOwner(testConfig.nftRegistry, tokenId), proxyAddr) // set loan parameters and fund tranche - const loanId = await borrowerTinlake.nftLookup(testConfig.nftRegistry, tokenId); - const amount = '10'; - const relyTx = await governanceTinlake.relyAddress(adminAccount.address, contractAddresses['NFT_FEED']); + const loanId = await borrowerTinlake.nftLookup(testConfig.nftRegistry, tokenId) + const amount = '10' + const relyTx = await governanceTinlake.relyAddress(adminAccount.address, contractAddresses['NFT_FEED']) const relyResult = await governanceTinlake.getTransactionReceipt(relyTx) // console.log('relyResult', relyResult) @@ -64,57 +71,64 @@ describe('proxy tests', async () => { // console.log('updateNftResult', updateNftResult) - await fundTranche('100'); - const initialTrancheBalance = await borrowerTinlake.getCurrencyBalance(contractAddresses['JUNIOR']); + await fundTranche('100') + const initialTrancheBalance = await borrowerTinlake.getCurrencyBalance(contractAddresses['JUNIOR']) // borrow - const borrowTx = await borrowerTinlake.proxyLockBorrowWithdraw(proxyAddr, loanId, amount, borrowerAccount.address); + const borrowTx = await borrowerTinlake.proxyLockBorrowWithdraw(proxyAddr, loanId, amount, borrowerAccount.address) // console.log('borrowTx', borrowTx) const borrowResult = await borrowerTinlake.getTransactionReceipt(borrowTx) // console.log('borrowResult', borrowResult) - const balance = await borrowerTinlake.getCurrencyBalance(borrowerAccount.address); - const secondTrancheBalance = await borrowerTinlake.getCurrencyBalance(contractAddresses['JUNIOR']); + const balance = await borrowerTinlake.getCurrencyBalance(borrowerAccount.address) + const secondTrancheBalance = await borrowerTinlake.getCurrencyBalance(contractAddresses['JUNIOR']) - assert.equal(borrowResult.status, SUCCESS_STATUS); - assert.equal(balance.toString(), amount); - assert.equal(secondTrancheBalance.toString(), initialTrancheBalance.sub(new BN(amount)).toString()); + assert.equal(borrowResult.status, SUCCESS_STATUS) + assert.equal(balance.toString(), amount) + assert.equal(secondTrancheBalance.toString(), initialTrancheBalance.sub(new BN(amount)).toString()) // fuel borrower with extra to cover loan interest, approve borrower proxy to take currency - const secondMintTx = await governanceTinlake.mintCurrency(borrowerAccount.address, amount.toString()); + const secondMintTx = await governanceTinlake.mintCurrency(borrowerAccount.address, amount.toString()) await governanceTinlake.getTransactionReceipt(secondMintTx) - const secondApproveTx = await borrowerTinlake.approveCurrency(proxyAddr, amount.toString()); + const secondApproveTx = await borrowerTinlake.approveCurrency(proxyAddr, amount.toString()) await borrowerTinlake.getTransactionReceipt(secondApproveTx) // repay - const repayTx = await borrowerTinlake.proxyRepayUnlockClose(proxyAddr, tokenId, loanId, testConfig.nftRegistry); + const repayTx = await borrowerTinlake.proxyRepayUnlockClose(proxyAddr, tokenId, loanId, testConfig.nftRegistry) const repayResult = await borrowerTinlake.getTransactionReceipt(repayTx) - assert.equal(repayResult.status, SUCCESS_STATUS); + assert.equal(repayResult.status, SUCCESS_STATUS) // borrower should be owner of collateral NFT again // tranche balance should be back to pre-borrow amount - const owner = await governanceTinlake.getNFTOwner(testConfig.nftRegistry, tokenId); - assert.equal(ethers.utils.getAddress(owner.toString()), ethers.utils.getAddress(borrowerAccount.address)); + const owner = await governanceTinlake.getNFTOwner(testConfig.nftRegistry, tokenId) + assert.equal(ethers.utils.getAddress(owner.toString()), ethers.utils.getAddress(borrowerAccount.address)) - await borrowerTinlake.getCurrencyBalance(proxyAddr); - const finalTrancheBalance = await borrowerTinlake.getCurrencyBalance(contractAddresses['JUNIOR']); + await borrowerTinlake.getCurrencyBalance(proxyAddr) + const finalTrancheBalance = await borrowerTinlake.getCurrencyBalance(contractAddresses['JUNIOR']) - assert.equal(initialTrancheBalance.toString(), finalTrancheBalance.toString()); + assert.equal(initialTrancheBalance.toString(), finalTrancheBalance.toString()) }) it('fail: does not succeed if the proxy is not approved to take the NFT', async () => { const proxyAddr = await borrowerTinlake.proxyCreateNew(borrowerAccount.address) const tokenId = `${Math.floor(Math.random() * 10e15) + 1}` - const mintTx = await governanceTinlake.mintNFT(testConfig.nftRegistry, borrowerAccount.address, tokenId, '234', '345', '456') + const mintTx = await governanceTinlake.mintNFT( + testConfig.nftRegistry, + borrowerAccount.address, + tokenId, + '234', + '345', + '456' + ) await governanceTinlake.getTransactionReceipt(mintTx) const issueTx = await borrowerTinlake.proxyTransferIssue(proxyAddr, testConfig.nftRegistry, tokenId) const issueResult = await borrowerTinlake.getTransactionReceipt(issueTx) - + assert.equal(issueResult.status, FAIL_STATUS) }) @@ -125,35 +139,35 @@ describe('proxy tests', async () => { // const nftId = await governanceTinlake.mintTitleNFT(testConfig.nftRegistry, borrowerAccount.address); // const approveTx = await borrowerTinlake.approveNFT(testConfig.nftRegistry, nftId.toString(), proxyAddr); // await borrowerTinlake.getTransactionReceipt(approveTx) - + // // issue loan from collateral NFT // const proxyTransferTx = await borrowerTinlake.proxyTransferIssue(proxyAddr, testConfig.nftRegistry, nftId); // await borrowerTinlake.getTransactionReceipt(proxyTransferTx) - + // // set loan parameters and fund tranche // const loanId = await borrowerTinlake.nftLookup(testConfig.nftRegistry, nftId); // const amount = 10; // const relyTx = await governanceTinlake.relyAddress(adminAccount.address, contractAddresses['NFT_FEED']); // await governanceTinlake.getTransactionReceipt(relyTx) - + // const nftfeedId = await adminTinlake.getNftFeedId(testConfig.nftRegistry, Number(nftId)) // const updateNftTx = await adminTinlake.updateNftFeed(nftfeedId, Number(amount)) // await adminTinlake.getTransactionReceipt(updateNftTx) // await fundTranche('10000000'); // await borrowerTinlake.getCurrencyBalance(contractAddresses['JUNIOR']); - + // // borrow // const proxyLockBorrowWithdrawTx = await borrowerTinlake.proxyLockBorrowWithdraw(proxyAddr, loanId, amount.toString(), borrowerAccount.address); // await borrowerTinlake.getTransactionReceipt(proxyLockBorrowWithdrawTx) // await borrowerTinlake.getCurrencyBalance(borrowerAccount.address); // await borrowerTinlake.getCurrencyBalance(contractAddresses['JUNIOR']); - + // // does not approve proxy to transfer currency // const mintTx = await governanceTinlake.mintCurrency(borrowerAccount.address, amount.toString()); // await governanceTinlake.getTransactionReceipt(mintTx) - + // // repay // const repayTx = await borrowerTinlake.proxyRepayUnlockClose(proxyAddr, nftId, loanId, testConfig.nftRegistry); // const repayResult = await borrowerTinlake.getTransactionReceipt(repayTx) diff --git a/src/actions/proxy.ts b/src/actions/proxy.ts index 9376e49..e595a3d 100644 --- a/src/actions/proxy.ts +++ b/src/actions/proxy.ts @@ -70,7 +70,9 @@ export function ProxyActions>(Bas proxyIssue = async (proxyAddress: string, nftRegistryAddress: string, tokenId: string) => { const proxy = this.contract('PROXY', proxyAddress) const encoded = this.contract('ACTIONS').interface.functions.issue.encode([ - this.contract('SHELF').address, nftRegistryAddress, tokenId + this.contract('SHELF').address, + nftRegistryAddress, + tokenId, ]) return this.pending(proxy.execute(this.contract('ACTIONS').address, encoded, this.overrides)) @@ -79,7 +81,9 @@ export function ProxyActions>(Bas proxyTransferIssue = async (proxyAddress: string, nftRegistryAddress: string, tokenId: string) => { const proxy = this.contract('PROXY', proxyAddress) const encoded = this.contract('ACTIONS').interface.functions.transferIssue.encode([ - this.contract('SHELF').address, nftRegistryAddress, tokenId + this.contract('SHELF').address, + nftRegistryAddress, + tokenId, ]) return this.pending(proxy.execute(this.contract('ACTIONS').address, encoded, this.overrides)) @@ -126,7 +130,12 @@ export type IProxyActions = { proxyIssue(proxyAddr: string, nftRegistryAddr: string, tokenId: string): Promise proxyTransferIssue(proxyAddr: string, nftRegistryAddr: string, tokenId: string): Promise proxyLockBorrowWithdraw(proxyAddr: string, loanId: string, amount: string, usr: string): Promise - proxyRepayUnlockClose(proxyAddr: string, tokenId: string, loanId: string, registry: string): Promise + proxyRepayUnlockClose( + proxyAddr: string, + tokenId: string, + loanId: string, + registry: string + ): Promise } export default ProxyActions diff --git a/src/index.ts b/src/index.ts index 51bf707..558f1de 100644 --- a/src/index.ts +++ b/src/index.ts @@ -2,7 +2,9 @@ import actions from './actions/index' import Tinlake from './Tinlake' const { Admin, Borrower, Lender, Analytics, Currency, Collateral, Governance, Proxy, Coordinator } = actions -export const TinlakeWithActions = Coordinator(Proxy(Borrower(Admin(Lender(Analytics(Currency(Collateral(Governance(Tinlake))))))))) +export const TinlakeWithActions = Coordinator( + Proxy(Borrower(Admin(Lender(Analytics(Currency(Collateral(Governance(Tinlake)))))))) +) export default TinlakeWithActions export * from './types/tinlake' diff --git a/src/types/declarations.d.ts b/src/types/declarations.d.ts index 98da937..b7b3580 100644 --- a/src/types/declarations.d.ts +++ b/src/types/declarations.d.ts @@ -6,4 +6,4 @@ declare module '*.abi' { declare module 'ethjs' declare module 'web3-utils' -declare module 'glpk.js' \ No newline at end of file +declare module 'glpk.js' diff --git a/src/types/tinlake.ts b/src/types/tinlake.ts index 99e3cb3..ae748fe 100644 --- a/src/types/tinlake.ts +++ b/src/types/tinlake.ts @@ -46,4 +46,4 @@ export type Investor = { } export type ITinlake = TinlakeActions & Tinlake -export { PendingTransaction, ContractAddresses, ContractAbis, Contracts } \ No newline at end of file +export { PendingTransaction, ContractAddresses, ContractAbis, Contracts } From 9efd9ee528ac5bf50eba23b5e5ac5c276178729e Mon Sep 17 00:00:00 2001 From: Jeroen Offerijns Date: Mon, 21 Sep 2020 13:03:12 +0200 Subject: [PATCH 60/65] fix: comment unused methods --- src/Tinlake.ts | 56 ++++++++++++++++++------------------ src/actions/borrower.spec.ts | 1 - 2 files changed, 28 insertions(+), 29 deletions(-) diff --git a/src/Tinlake.ts b/src/Tinlake.ts index 649ac13..504c75d 100644 --- a/src/Tinlake.ts +++ b/src/Tinlake.ts @@ -36,7 +36,7 @@ export type PendingTransaction = { status: number error?: string timesOutAt?: number - receipt: () => Promise + // receipt: () => Promise } export type ContractName = typeof contractNames[number] @@ -82,7 +82,7 @@ export default class Tinlake { public contracts: Contracts = {} public contractAbis: ContractAbis = {} public contractConfig: any = {} - public version: number = 2 + public readonly version: number = 2 constructor(params: TinlakeParams) { const { provider, signer, contractAddresses, transactionTimeout, contractAbis, overrides, contractConfig } = params @@ -157,38 +157,38 @@ export default class Tinlake { timesOutAt, status: 1, hash: tx.hash, - receipt: async () => { - return new Promise(async (resolve, reject) => { - if (!tx.hash) return reject(tx) - - let timer: NodeJS.Timer | undefined = undefined - if (timesOutAt) { - timer = setTimeout(() => { - return reject(`Transaction ${tx.hash} timed out at ${timesOutAt}`) - }, timesOutAt - Date.now()) - } - - try { - const receipt = await this.provider!.waitForTransaction(tx.hash) - if (timer) clearTimeout(timer) - - return resolve(receipt) - } catch (e) { - if (timer) clearTimeout(timer) - console.error(`Error caught in tinlake.getTransactionReceipt(): ${JSON.stringify(e)}`) - return reject() - } - }) - }, + // receipt: async () => { + // return new Promise(async (resolve, reject) => { + // if (!tx.hash) return reject(tx) + + // let timer: NodeJS.Timer | undefined = undefined + // if (timesOutAt) { + // timer = setTimeout(() => { + // return reject(`Transaction ${tx.hash} timed out at ${timesOutAt}`) + // }, timesOutAt - Date.now()) + // } + + // try { + // const receipt = await this.provider!.waitForTransaction(tx.hash) + // if (timer) clearTimeout(timer) + + // return resolve(receipt) + // } catch (e) { + // if (timer) clearTimeout(timer) + // console.error(`Error caught in tinlake.getTransactionReceipt(): ${JSON.stringify(e)}`) + // return reject() + // } + // }) + // }, } } catch (e) { console.error(`Error caught in tinlake.pending(): ${JSON.stringify(e)}`) return { status: 0, error: e.message, - receipt: async () => { - return Promise.reject('Error caught in tinlake.pending()') - }, + // receipt: async () => { + // return Promise.reject('Error caught in tinlake.pending()') + // }, } } } diff --git a/src/actions/borrower.spec.ts b/src/actions/borrower.spec.ts index 1a72022..3a93b78 100644 --- a/src/actions/borrower.spec.ts +++ b/src/actions/borrower.spec.ts @@ -98,7 +98,6 @@ describe('borrower tests', async () => { // repay loan const initialDebt = await borrowerTinlake.getDebt(loanId) - console.log('initialDebt', initialDebt) // approve shelf to take currency const approveTx = await borrowerTinlake.approveCurrency(contractAddresses['SHELF'], initialDebt.toString()) From e13460787827a10309519890ba69d030235fc291 Mon Sep 17 00:00:00 2001 From: Jeroen Offerijns Date: Mon, 21 Sep 2020 13:04:27 +0200 Subject: [PATCH 61/65] 0.0.19-develop.16 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index e9c77d2..a554d26 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@centrifuge/tinlake-js", - "version": "0.0.19-develop.15", + "version": "0.0.19-develop.16", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 985569d..c433adc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@centrifuge/tinlake-js", - "version": "0.0.19-develop.15", + "version": "0.0.19-develop.16", "description": "Centrifuge Tinlake Contracts Client", "main": "dist/index.js", "types": "dist/index.d.ts", From 399dbaae855a7bb02a65e8780a5962bd9c7038fe Mon Sep 17 00:00:00 2001 From: Jeroen Offerijns Date: Mon, 21 Sep 2020 13:11:39 +0200 Subject: [PATCH 62/65] chore: format --- src/Tinlake.ts | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/src/Tinlake.ts b/src/Tinlake.ts index 504c75d..0890369 100644 --- a/src/Tinlake.ts +++ b/src/Tinlake.ts @@ -157,29 +157,29 @@ export default class Tinlake { timesOutAt, status: 1, hash: tx.hash, - // receipt: async () => { - // return new Promise(async (resolve, reject) => { - // if (!tx.hash) return reject(tx) - - // let timer: NodeJS.Timer | undefined = undefined - // if (timesOutAt) { - // timer = setTimeout(() => { - // return reject(`Transaction ${tx.hash} timed out at ${timesOutAt}`) - // }, timesOutAt - Date.now()) - // } - - // try { - // const receipt = await this.provider!.waitForTransaction(tx.hash) - // if (timer) clearTimeout(timer) - - // return resolve(receipt) - // } catch (e) { - // if (timer) clearTimeout(timer) - // console.error(`Error caught in tinlake.getTransactionReceipt(): ${JSON.stringify(e)}`) - // return reject() - // } - // }) - // }, + // receipt: async () => { + // return new Promise(async (resolve, reject) => { + // if (!tx.hash) return reject(tx) + + // let timer: NodeJS.Timer | undefined = undefined + // if (timesOutAt) { + // timer = setTimeout(() => { + // return reject(`Transaction ${tx.hash} timed out at ${timesOutAt}`) + // }, timesOutAt - Date.now()) + // } + + // try { + // const receipt = await this.provider!.waitForTransaction(tx.hash) + // if (timer) clearTimeout(timer) + + // return resolve(receipt) + // } catch (e) { + // if (timer) clearTimeout(timer) + // console.error(`Error caught in tinlake.getTransactionReceipt(): ${JSON.stringify(e)}`) + // return reject() + // } + // }) + // }, } } catch (e) { console.error(`Error caught in tinlake.pending(): ${JSON.stringify(e)}`) From 64d9259c86749e67b8c10989746f82302e600a8f Mon Sep 17 00:00:00 2001 From: Jeroen Offerijns Date: Mon, 21 Sep 2020 13:26:25 +0200 Subject: [PATCH 63/65] fix: token tranche names --- src/Tinlake.ts | 4 ++-- src/abi/index.ts | 4 ++-- src/actions/admin.ts | 8 ++++---- src/actions/analytics.ts | 20 ++++++++++---------- src/actions/borrower.spec.ts | 2 +- src/actions/currency.ts | 16 ++++++++-------- src/actions/lender.spec.ts | 12 ++++++------ src/actions/lender.ts | 8 ++++---- src/actions/proxy.spec.ts | 12 ++++++------ src/test/addresses.json | 4 ++-- 10 files changed, 45 insertions(+), 45 deletions(-) diff --git a/src/Tinlake.ts b/src/Tinlake.ts index 0890369..996e88b 100644 --- a/src/Tinlake.ts +++ b/src/Tinlake.ts @@ -5,9 +5,9 @@ import BN from 'bn.js' const contractNames = [ 'TINLAKE_CURRENCY', 'JUNIOR_OPERATOR', - 'JUNIOR', + 'JUNIOR_TRANCHE', 'JUNIOR_TOKEN', - 'SENIOR', + 'SENIOR_TRANCHE', 'SENIOR_TOKEN', 'SENIOR_OPERATOR', 'DISTRIBUTOR', diff --git a/src/abi/index.ts b/src/abi/index.ts index 3ae45fa..980a243 100644 --- a/src/abi/index.ts +++ b/src/abi/index.ts @@ -40,8 +40,8 @@ export default { ACTIONS: contractAbiActions, ALLOWANCE_OPERATOR: contractAbiAllowanceOperator, PROPORTIONAL_OPERATOR: contractAbiProportionalOperator, - JUNIOR: contractAbiTranche, - SENIOR: contractAbiSeniorTranche, + JUNIOR_TRANCHE: contractAbiTranche, + SENIOR_TRANCHE: contractAbiSeniorTranche, BORROWER_DEPLOYER: contractAbiBorrowerDeployer, LENDER_DEPLOYER: contractAbiLenderDeployer, NFT_FEED: contractAbiNftFeed, diff --git a/src/actions/admin.ts b/src/actions/admin.ts index 77e1d06..44e9495 100644 --- a/src/actions/admin.ts +++ b/src/actions/admin.ts @@ -8,7 +8,7 @@ export function AdminActions>(Bas canQueryPermissions = () => { return ( !!this.contract('PILE')?.wards && - !!this.contract('SENIOR')?.wards && + !!this.contract('SENIOR_TRANCHE')?.wards && !!this.contract('PRICE_POOL')?.wards && !!this.contract('ASSESSOR')?.wards && !!this.contract('JUNIOR_OPERATOR')?.wards && @@ -28,9 +28,9 @@ export function AdminActions>(Bas } canSetSeniorTrancheInterest = async (user: string) => { - if (!(this.contractAddresses['SENIOR'] !== ZERO_ADDRESS)) return false - if (!this.contract('SENIOR')?.wards) return false - return (await this.contract('SENIOR').wards(user)).toBN().toNumber() === 1 + if (!(this.contractAddresses['SENIOR_TRANCHE'] !== ZERO_ADDRESS)) return false + if (!this.contract('SENIOR_TRANCHE')?.wards) return false + return (await this.contract('SENIOR_TRANCHE').wards(user)).toBN().toNumber() === 1 } canSetRiskScore = async (user: string) => { diff --git a/src/actions/analytics.ts b/src/actions/analytics.ts index 53d9ac7..4813be8 100644 --- a/src/actions/analytics.ts +++ b/src/actions/analytics.ts @@ -144,7 +144,7 @@ export function AnalyticsActions> } getTokenPriceJunior = async () => { - return (await this.contract('ASSESSOR').calcTokenPrice(this.contractAddresses['JUNIOR'])).toBN() + return (await this.contract('ASSESSOR').calcTokenPrice(this.contractAddresses['JUNIOR_TRANCHE'])).toBN() } existsSenior = () => { @@ -211,7 +211,7 @@ export function AnalyticsActions> tokenPrice = (await this.contract('SENIOR_OPERATOR').calcTokenPrice(user)).toBN() break case 'ALLOWANCE_OPERATOR': - tokenPrice = (await this.contract('ASSESSOR').calcTokenPrice(this.contractAddresses['SENIOR'])).toBN() + tokenPrice = (await this.contract('ASSESSOR').calcTokenPrice(this.contractAddresses['SENIOR_TRANCHE'])).toBN() break default: tokenPrice = new BN(0) @@ -220,14 +220,14 @@ export function AnalyticsActions> } getSeniorReserve = async () => { - if (this.contractAddresses['SENIOR'] !== ZERO_ADDRESS) { - return (await this.contract('SENIOR').balance()).toBN() + if (this.contractAddresses['SENIOR_TRANCHE'] !== ZERO_ADDRESS) { + return (await this.contract('SENIOR_TRANCHE').balance()).toBN() } return new BN(0) } getJuniorReserve = async () => { - return (await this.contract('JUNIOR').balance()).toBN() + return (await this.contract('JUNIOR_TRANCHE').balance()).toBN() } getMinJuniorRatio = async () => { @@ -239,19 +239,19 @@ export function AnalyticsActions> } getAssetValueJunior = async () => { - return (await this.contract('ASSESSOR').calcAssetValue(this.contractAddresses['JUNIOR'])).toBN() + return (await this.contract('ASSESSOR').calcAssetValue(this.contractAddresses['JUNIOR_TRANCHE'])).toBN() } getSeniorDebt = async () => { - if (this.contractAddresses['SENIOR'] !== ZERO_ADDRESS) { - return (await this.contract('SENIOR').debt()).toBN() + if (this.contractAddresses['SENIOR_TRANCHE'] !== ZERO_ADDRESS) { + return (await this.contract('SENIOR_TRANCHE').debt()).toBN() } return new BN(0) } getSeniorInterestRate = async () => { - if (this.contractAddresses['SENIOR'] !== ZERO_ADDRESS) { - return (await this.contract('SENIOR').ratePerSecond()).toBN() + if (this.contractAddresses['SENIOR_TRANCHE'] !== ZERO_ADDRESS) { + return (await this.contract('SENIOR_TRANCHE').ratePerSecond()).toBN() } return new BN(0) } diff --git a/src/actions/borrower.spec.ts b/src/actions/borrower.spec.ts index 3a93b78..65f0366 100644 --- a/src/actions/borrower.spec.ts +++ b/src/actions/borrower.spec.ts @@ -190,7 +190,7 @@ async function fundTranche(amount: string) { await adminTinlake.getTransactionReceipt(approveAllowanceTx) // lender approves tranche to take currency - const approveCurrencyTx = await lenderTinlake.approveCurrency(contractAddresses['JUNIOR'], amount) + const approveCurrencyTx = await lenderTinlake.approveCurrency(contractAddresses['JUNIOR_TRANCHE'], amount) await lenderTinlake.getTransactionReceipt(approveCurrencyTx) // mint currency for lender diff --git a/src/actions/currency.ts b/src/actions/currency.ts index b9fd3d0..b00a138 100644 --- a/src/actions/currency.ts +++ b/src/actions/currency.ts @@ -14,13 +14,13 @@ export function CurrencyActions>( } getJuniorForCurrencyAllowance = async (owner: string) => { - if (!this.contractAddresses['JUNIOR']) return - return this.getCurrencyAllowance(owner, this.contractAddresses['JUNIOR']) + if (!this.contractAddresses['JUNIOR_TRANCHE']) return + return this.getCurrencyAllowance(owner, this.contractAddresses['JUNIOR_TRANCHE']) } getSeniorForCurrencyAllowance = async (owner: string) => { - if (!this.contractAddresses['SENIOR']) return - return this.getCurrencyAllowance(owner, this.contractAddresses['SENIOR']) + if (!this.contractAddresses['SENIOR_TRANCHE']) return + return this.getCurrencyAllowance(owner, this.contractAddresses['SENIOR_TRANCHE']) } getCurrencyBalance = async (user: string) => { @@ -33,13 +33,13 @@ export function CurrencyActions>( } approveSeniorForCurrency = async (currencyAmount: string) => { - if (!this.contractAddresses['SENIOR']) return - return this.approveCurrency(this.contractAddresses['SENIOR'], currencyAmount) + if (!this.contractAddresses['SENIOR_TRANCHE']) return + return this.approveCurrency(this.contractAddresses['SENIOR_TRANCHE'], currencyAmount) } approveJuniorForCurrency = async (currencyAmount: string) => { - if (!this.contractAddresses['JUNIOR']) return - return this.approveCurrency(this.contractAddresses['JUNIOR'], currencyAmount) + if (!this.contractAddresses['JUNIOR_TRANCHE']) return + return this.approveCurrency(this.contractAddresses['JUNIOR_TRANCHE'], currencyAmount) } } } diff --git a/src/actions/lender.spec.ts b/src/actions/lender.spec.ts index f2b5822..7892213 100644 --- a/src/actions/lender.spec.ts +++ b/src/actions/lender.spec.ts @@ -48,7 +48,7 @@ describe('lender functions', async () => { it('fail: supply junior - no allowance', async () => { const currencyAmount = '10' // approve junior tranche to take currency - const approveTx = await lenderTinlake.approveCurrency(contractAddresses['JUNIOR'], currencyAmount) + const approveTx = await lenderTinlake.approveCurrency(contractAddresses['JUNIOR_TRANCHE'], currencyAmount) const approval = await lenderTinlake.getTransactionReceipt(approveTx) // console.log('approval', approval) @@ -81,13 +81,13 @@ describe('lender functions', async () => { await lenderTinlake.getTransactionReceipt(lenderApproveTx) const initialLenderCurrencyBalance: BN = await lenderTinlake.getCurrencyBalance(lenderAccount.address) - const initialTrancheCurrencyBalance: BN = await lenderTinlake.getCurrencyBalance(contractAddresses['JUNIOR']) + const initialTrancheCurrencyBalance: BN = await lenderTinlake.getCurrencyBalance(contractAddresses['JUNIOR_TRANCHE']) const initialJuniorTokenBalance = await lenderTinlake.getJuniorTokenBalance(lenderAccount.address) const redeemTx = await lenderTinlake.redeemJunior(tokenAmount) const redeemResult = await lenderTinlake.getTransactionReceipt(redeemTx) - const newTrancheCurrencyBalance = await lenderTinlake.getCurrencyBalance(contractAddresses['JUNIOR']) + const newTrancheCurrencyBalance = await lenderTinlake.getCurrencyBalance(contractAddresses['JUNIOR_TRANCHE']) const newLenderCurrencyBalance = await lenderTinlake.getCurrencyBalance(lenderAccount.address) const newJuniorTokenBalance = await lenderTinlake.getJuniorTokenBalance(lenderAccount.address) @@ -124,7 +124,7 @@ describe('lender functions', async () => { async function supply(investor: string, currencyAmount: string, tinlake: ITinlake) { // approve junior tranche to take currency - const approveTx = await tinlake.approveCurrency(contractAddresses['JUNIOR'], currencyAmount) + const approveTx = await tinlake.approveCurrency(contractAddresses['JUNIOR_TRANCHE'], currencyAmount) await tinlake.getTransactionReceipt(approveTx) // fund investor with tinlake currency @@ -132,13 +132,13 @@ async function supply(investor: string, currencyAmount: string, tinlake: ITinlak await governanceTinlake.getTransactionReceipt(mintTx) const initialLenderCurrencyBalance = await tinlake.getCurrencyBalance(investor) - const initialTrancheCurrencyBalance = await tinlake.getCurrencyBalance(contractAddresses['JUNIOR']) + const initialTrancheCurrencyBalance = await tinlake.getCurrencyBalance(contractAddresses['JUNIOR_TRANCHE']) const initialJuniorTokenBalance = await tinlake.getJuniorTokenBalance(investor) const supplyTx = await tinlake.supplyJunior(currencyAmount) const supplyResult = await tinlake.getTransactionReceipt(supplyTx) - const newTrancheCurrencyBalance = await tinlake.getCurrencyBalance(contractAddresses['JUNIOR']) + const newTrancheCurrencyBalance = await tinlake.getCurrencyBalance(contractAddresses['JUNIOR_TRANCHE']) const newLenderCurrencyBalance = await tinlake.getCurrencyBalance(investor) const newJuniorTokenBalance = await tinlake.getJuniorTokenBalance(investor) diff --git a/src/actions/lender.ts b/src/actions/lender.ts index d1160bc..d0ca7b6 100644 --- a/src/actions/lender.ts +++ b/src/actions/lender.ts @@ -14,13 +14,13 @@ export function LenderActions>(Bas getSeniorTokenAllowance = async (owner: string) => { return ( - await this.contract('SENIOR_TOKEN').allowance(owner, this.contractAddresses['SENIOR'], this.overrides) + await this.contract('SENIOR_TOKEN').allowance(owner, this.contractAddresses['SENIOR_TRANCHE'], this.overrides) ).toBN() } approveSeniorToken = async (tokenAmount: string) => { return this.pending( - this.contract('SENIOR_TOKEN').approve(this.contractAddresses['SENIOR'], tokenAmount, this.overrides) + this.contract('SENIOR_TOKEN').approve(this.contractAddresses['SENIOR_TRANCHE'], tokenAmount, this.overrides) ) } @@ -35,13 +35,13 @@ export function LenderActions>(Bas getJuniorTokenAllowance = async (owner: string) => { return ( - await this.contract('JUNIOR_TOKEN').allowance(owner, this.contractAddresses['JUNIOR'], this.overrides) + await this.contract('JUNIOR_TOKEN').allowance(owner, this.contractAddresses['JUNIOR_TRANCHE'], this.overrides) ).toBN() } approveJuniorToken = async (tokenAmount: string) => { return this.pending( - this.contract('JUNIOR_TOKEN').approve(this.contractAddresses['JUNIOR'], tokenAmount, this.overrides) + this.contract('JUNIOR_TOKEN').approve(this.contractAddresses['JUNIOR_TRANCHE'], tokenAmount, this.overrides) ) } diff --git a/src/actions/proxy.spec.ts b/src/actions/proxy.spec.ts index f0157a4..bae42bd 100644 --- a/src/actions/proxy.spec.ts +++ b/src/actions/proxy.spec.ts @@ -72,7 +72,7 @@ describe('proxy tests', async () => { // console.log('updateNftResult', updateNftResult) await fundTranche('100') - const initialTrancheBalance = await borrowerTinlake.getCurrencyBalance(contractAddresses['JUNIOR']) + const initialTrancheBalance = await borrowerTinlake.getCurrencyBalance(contractAddresses['JUNIOR_TRANCHE']) // borrow const borrowTx = await borrowerTinlake.proxyLockBorrowWithdraw(proxyAddr, loanId, amount, borrowerAccount.address) @@ -83,7 +83,7 @@ describe('proxy tests', async () => { // console.log('borrowResult', borrowResult) const balance = await borrowerTinlake.getCurrencyBalance(borrowerAccount.address) - const secondTrancheBalance = await borrowerTinlake.getCurrencyBalance(contractAddresses['JUNIOR']) + const secondTrancheBalance = await borrowerTinlake.getCurrencyBalance(contractAddresses['JUNIOR_TRANCHE']) assert.equal(borrowResult.status, SUCCESS_STATUS) assert.equal(balance.toString(), amount) @@ -107,7 +107,7 @@ describe('proxy tests', async () => { assert.equal(ethers.utils.getAddress(owner.toString()), ethers.utils.getAddress(borrowerAccount.address)) await borrowerTinlake.getCurrencyBalance(proxyAddr) - const finalTrancheBalance = await borrowerTinlake.getCurrencyBalance(contractAddresses['JUNIOR']) + const finalTrancheBalance = await borrowerTinlake.getCurrencyBalance(contractAddresses['JUNIOR_TRANCHE']) assert.equal(initialTrancheBalance.toString(), finalTrancheBalance.toString()) }) @@ -155,14 +155,14 @@ describe('proxy tests', async () => { // await adminTinlake.getTransactionReceipt(updateNftTx) // await fundTranche('10000000'); - // await borrowerTinlake.getCurrencyBalance(contractAddresses['JUNIOR']); + // await borrowerTinlake.getCurrencyBalance(contractAddresses['JUNIOR_TRANCHE']); // // borrow // const proxyLockBorrowWithdrawTx = await borrowerTinlake.proxyLockBorrowWithdraw(proxyAddr, loanId, amount.toString(), borrowerAccount.address); // await borrowerTinlake.getTransactionReceipt(proxyLockBorrowWithdrawTx) // await borrowerTinlake.getCurrencyBalance(borrowerAccount.address); - // await borrowerTinlake.getCurrencyBalance(contractAddresses['JUNIOR']); + // await borrowerTinlake.getCurrencyBalance(contractAddresses['JUNIOR_TRANCHE']); // // does not approve proxy to transfer currency // const mintTx = await governanceTinlake.mintCurrency(borrowerAccount.address, amount.toString()); @@ -193,7 +193,7 @@ async function fundTranche(amount: string) { await adminTinlake.getTransactionReceipt(approveAllowanceTx) // lender approves tranche to take currency - const approveTx = await lenderTinlake.approveCurrency(contractAddresses['JUNIOR'], amount) + const approveTx = await lenderTinlake.approveCurrency(contractAddresses['JUNIOR_TRANCHE'], amount) await lenderTinlake.getTransactionReceipt(approveTx) // mint currency for lender diff --git a/src/test/addresses.json b/src/test/addresses.json index ecd8d46..37ce6a8 100644 --- a/src/test/addresses.json +++ b/src/test/addresses.json @@ -1,9 +1,9 @@ { "TINLAKE_CURRENCY":"", "JUNIOR_OPERATOR":"", - "JUNIOR":"", + "JUNIOR_TRANCHE":"", "JUNIOR_TOKEN":"", - "SENIOR":"", + "SENIOR_TRANCHE":"", "SENIOR_TOKEN":"", "SENIOR_OPERATOR":"", "DISTRIBUTOR":"", From e34e9aabd444514fc06be4b4f40c30ee26df2e1a Mon Sep 17 00:00:00 2001 From: Jeroen Offerijns Date: Mon, 21 Sep 2020 13:28:27 +0200 Subject: [PATCH 64/65] 0.0.19-develop.17 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index a554d26..004a284 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@centrifuge/tinlake-js", - "version": "0.0.19-develop.16", + "version": "0.0.19-develop.17", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index c433adc..fafbc0c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@centrifuge/tinlake-js", - "version": "0.0.19-develop.16", + "version": "0.0.19-develop.17", "description": "Centrifuge Tinlake Contracts Client", "main": "dist/index.js", "types": "dist/index.d.ts", From 08939d112a610a74ad65b736bceb0589b4b362fe Mon Sep 17 00:00:00 2001 From: Jeroen Offerijns Date: Mon, 21 Sep 2020 14:26:48 +0200 Subject: [PATCH 65/65] chore: format --- src/actions/lender.spec.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/actions/lender.spec.ts b/src/actions/lender.spec.ts index 7892213..41fe204 100644 --- a/src/actions/lender.spec.ts +++ b/src/actions/lender.spec.ts @@ -81,7 +81,9 @@ describe('lender functions', async () => { await lenderTinlake.getTransactionReceipt(lenderApproveTx) const initialLenderCurrencyBalance: BN = await lenderTinlake.getCurrencyBalance(lenderAccount.address) - const initialTrancheCurrencyBalance: BN = await lenderTinlake.getCurrencyBalance(contractAddresses['JUNIOR_TRANCHE']) + const initialTrancheCurrencyBalance: BN = await lenderTinlake.getCurrencyBalance( + contractAddresses['JUNIOR_TRANCHE'] + ) const initialJuniorTokenBalance = await lenderTinlake.getJuniorTokenBalance(lenderAccount.address) const redeemTx = await lenderTinlake.redeemJunior(tokenAmount)