#0
nonstandard
0.00004000 BSV
Q!×AËw0lpË®áVQ`{ç¥}6ÁG?~t_>³1Q®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":[["0312d741cb77306c70cb94aee15651607be7a510967d36c1473f7e745f903eb331"],"55ca6ab9f4c33eb4432a12ef086de8596490a75ecf6a1f8aceb7b7a62a8c4d84:0"]}u
https://whatsonchain.com/tx/543c273068ebf76da6b5ce39620b911c23262736758e197ab3c6fb7c076f5434