#0
nonstandard
0.00004000 BSV
Q!&ÒøFËɰvX¨i¾XDÁ|I&E)¥äÉÞ¦¤%ØQ®MH{"__cls":"class LendersOfRecordSC {\n constructor(\n owners = [],\n facilityId,\n ) {\n this._owners = owners;\n this.facilityId = facilityId;\n this.updates = [];\n this.lendersOfRecord = []\n }\n\n setLendersOfRecord(fundId, numberOfShares, timestamp) {\n const prev = this.lendersOfRecord.filter(x => x.fundId === fundId);\n const commitmentAmount = numberOfShares;\n if (prev.length !== 0) {\n prev[0].commitmentAmount += commitmentAmount;\n } else {\n this.lendersOfRecord.push({ fundId, commitmentAmount, timestamp });\n }\n }\n \n descreaseLendersOfRecord(fundId, numberOfShares) {\n const prev = this.lendersOfRecord.filter(x => x.fundId === fundId);\n const commitmentAmount = numberOfShares;\n if (!!prev && prev[0].commitmentAmount >= numberOfShares) {\n prev[0].commitmentAmount -= commitmentAmount;\n } else {\n throw new Error('Cannot decrease number of shares')\n }\n }\n\n transferPosition(fundFrom, fundTo, numberOfShares, timestamp) {\n this.setLendersOfRecord(fundTo, numberOfShares, timestamp)\n this.descreaseLendersOfRecord(fundFrom, numberOfShares)\n this.addUpdate(fundFrom, fundTo, numberOfShares, timestamp)\n }\n\n addUpdate(fundFrom, fundTo, numberOfShares, timestamp) {\n this.updates.push([fundFrom, fundTo, numberOfShares, timestamp])\n }\n\n setInitialLender(fundId, numberOfShares, timestamp) {\n this.setLendersOfRecord(fundId, numberOfShares, timestamp)\n this.addUpdate('-', fundId, numberOfShares, timestamp)\n }\n}","__index":{"obj":0},"__func":"constructor","__args":[["032603d2f846cbc9b07658a869be588044c17c49264529a5e4c99cdea6a425d886"],"59a7e332ca66520741a2b1f38ec9967bb95091ce641ee61bd5e9dd62e523b5ac:0"]}u
https://whatsonchain.com/tx/ed39d1e4ede3292e5f8ae22df55d08f2b1296742d7f2fde67819c5f5d503d506