#0
nonstandard
0.00004000 BSV
Q!§I{_ÃzvVû%>üWÜūѤP¹AºâZß?Q®M
{"__cls":"class PositionSC {\n constructor(owners = [], percentage = 0, facilityId = '', fundId = '') {\n this._owners = owners;\n this.percentage = percentage;\n this.facilityId = facilityId;\n this.fundId = fundId;\n }\n\n split(newPercentage) {\n if (newPercentage < this.percentage) {\n this.percentage -= newPercentage;\n return new PositionSC(this._owners[0], newPercentage, this.facilityId, this.fundId);\n }\n throw new Error(`Cannot split current transaction`);\n }\n\n merge(...positions) {\n try {\n let sendPercentage = this.percentage;\n this.setPercentage(0);\n for (let i = 0; i < positions.length; i += 1) {\n sendPercentage += positions[i].percentage;\n positions[i].setPercentage(0);\n }\n return new PositionSC(this._owners[0], sendPercentage, this.facilityId, this.fundId);\n } catch (err) {\n throw new Error(`Unable to concat positions`);\n }\n }\n\n send(to, fundId, percentage) {\n if (this.percentage < percentage) throw new Error(`Insufficient funds`);\n this.setPercentage(this.percentage - percentage);\n return new PositionSC(to, percentage, this.facilityId, fundId);\n }\n\n setPercentage(percentage) {\n this.percentage = percentage;\n }\n}","__index":{"obj":0},"__func":"constructor","__args":[["03a799497b5fc39d7a765601fb253efc5796dc14c5abd1a450b94113bae25adf3f"],100,"c6d1f4602c32c0aaac7ac621c88f1e91b898004062f60c055af4b34968aceae5:0","2ddca33af9022727ba797ef485e6e81d8d94e977aa63f2209cbe68554e3bb3d7:0"]}u
https://whatsonchain.com/tx/850d320c6c95f5c76c6f8a3e3aa6c20503d5fab84cfc4dce2ea96fcd5bd74d86