#0
nonstandard
0.00004000 BSV
Q!ùBÒ2к%~È'*¾TW@ÿµ¸p8u¸°Q®M{"__cls":"class PositionSC {\n constructor(owners = [], percentage = '', 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},"__args":[["030ef942d23298d09e91ba25887ec8272abe545740ffb58ab8703875b810b01b15"],"20","16323df364becc518bb429c14fd0a66a111008adb8c29ad234040b1705c6dc54:0","20a8298ce5daaf0e96ae61972063f409398ba25b78151fb15e3a306e88a690f5:0"],"__func":"constructor"}u
https://whatsonchain.com/tx/02af2ba23b8474be452f9d29b375daba09326d3dc4a25110377f3c7ec144f264