#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"],200,"9b2c9b1a8077d9dfcab911bb18b5a0d01312dcdfd2100a01b3e5e03cfa77f04d:0","2ddca33af9022727ba797ef485e6e81d8d94e977aa63f2209cbe68554e3bb3d7:0"]}u
https://whatsonchain.com/tx/2617069d86afbeddb4c9a9bba60c10c0be07097176403fc2ad1d745157da18c1