#0
nonstandard
0.00004000 BSV
Q!¿2<T^³\!ð¯aIì?nÖÃícwÃÓ_Q®MX{"__cls":"class PositionSC {\r\n constructor(owners = [], percentage = 0, facilityId = '', fundId = '') {\r\n this._owners = owners;\r\n this.percentage = percentage;\r\n this.facilityId = facilityId;\r\n this.fundId = fundId;\r\n }\r\n\r\n split(newPercentage) {\r\n if (newPercentage < this.percentage) {\r\n this.percentage -= newPercentage;\r\n return new PositionSC(this._owners[0], newPercentage, this.facilityId, this.fundId);\r\n }\r\n throw new Error(`Cannot split current transaction`);\r\n }\r\n\r\n merge(...positions) {\r\n try {\r\n let sendPercentage = this.percentage;\r\n this.setPercentage(0);\r\n for (let i = 0; i < positions.length; i += 1) {\r\n sendPercentage += positions[i].percentage;\r\n positions[i].setPercentage(0);\r\n }\r\n return new PositionSC(this._owners[0], sendPercentage, this.facilityId, this.fundId);\r\n } catch (err) {\r\n throw new Error(`Unable to concat positions`);\r\n }\r\n }\r\n\r\n send(to, fundId, percentage) {\r\n if (this.percentage < percentage) throw new Error(`Insufficient funds`);\r\n this.setPercentage(this.percentage - percentage);\r\n return new PositionSC(to, percentage, this.facilityId, fundId);\r\n }\r\n\r\n setPercentage(percentage) {\r\n this.percentage = percentage;\r\n }\r\n}","__index":{"obj":0},"__func":"constructor","__args":[["03bf323c545eb35c918f21168d98f01daf6149ec3f6ed687c3ed1c637711c3d35f"],123,"14b3829bc9b06606137ab6f05c68dde7f43a22e3d90d4c076f83861e74bfa36c:0","c8bbf3fab54c38a2a542d150d365f1a4a697aa35da5362ab6b4b114a22755597:0"]}u
https://whatsonchain.com/tx/623d75365d1185152ab4ac5cdd2f9f4defe32fdfd381420e92bcc18175416b82