#0
nonstandard
0.00004000 BSV
Q!?ÝäÈÁþ'u-VþU-8£@E9¯F-Z²(«ûJ}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":[["023fdde4c81615c11cfe27752dad56fe552d38a3404539af462d5ab228abfb4a7d"],"25216b9ce9e35b7f1f87e878ea4c16814d0df573c1e6b600dfb6d4c696e2771c:0"]}u
https://whatsonchain.com/tx/260828954e2828d465adb3d9b08fb7911886552cd1794e37eccf2b1a245b8438