#0
nonstandard
0.00004000 BSV
Q!ùBÒ2к%~È'*¾TW@ÿµ¸p8u¸°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":[["030ef942d23298d09e91ba25887ec8272abe545740ffb58ab8703875b810b01b15"],10,"f74b9005074aef0cc33478515a8268e8d7d4152227bdf99e4fc830c5c1047b43:0","9e8b4f6904bad80a78d091ab938b363834ea6814b82e35485906070aff50c289:0"]}u
https://whatsonchain.com/tx/72e889108215f94b58dc2eaec30878fa88536a9e1ab2acff35d5c56e1697de76