Transaction

f07a30c075cef4955832490ae2046b7e9dfb749e524e3eab5eb417f29977c3da
( - )
203,701
2021-02-10 13:24:43
1
2,438 B

2 Outputs

Total Output:
  • Q!qol·Œ‰°>‡´R݉üévOþÍ(X›AÿW.V‹Q®M’{"__cls":"class PositionSC {\r\n constructor(owner, numberOfShares = 0, dealId = '', facilityId = '', fundId = '') {\r\n this._owners = [owner];\r\n this.numberOfShares = numberOfShares;\r\n this.dealId = dealId\r\n this.facilityId = facilityId;\r\n this.fundId = fundId;\r\n }\r\n\r\n split(newNumberOfShares) {\r\n if (newNumberOfShares === this.numberOfShares) {\r\n return this;\r\n }\r\n if (newNumberOfShares < this.numberOfShares) {\r\n this.numberOfShares -= newNumberOfShares;\r\n return new PositionSC(this._owners[0], newNumberOfShares, this.dealId, 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 if (positions.length === 0) return this;\r\n let sendNumberOfShares = this.numberOfShares;\r\n this.numberOfShares = 0;\r\n for (let i = 0; i < positions.length; i += 1) {\r\n if (positions[i].dealId !== this.dealId || positions[i].facilityId !== this.facilityId || positions[i].fundId !== this.fundId) {\r\n throw new Error(`Unable to merge, positions don't originate from the same facility or don't belong to the same fund`);\r\n }\r\n sendNumberOfShares += positions[i].numberOfShares;\r\n positions[i].numberOfShares = 0;\r\n }\r\n return new PositionSC(this._owners[0], sendNumberOfShares, this.dealId, this.facilityId, this.fundId);\r\n } catch (err) {\r\n throw new Error(`Unable to merge positions`);\r\n }\r\n }\r\n\r\n send(to, fundId, numberOfShares) {\r\n if (this.numberOfShares < numberOfShares) throw new Error(`Insufficient funds`);\r\n this.numberOfShares = this.numberOfShares - numberOfShares;\r\n return new PositionSC(to, numberOfShares, this.dealId, this.facilityId, fundId);\r\n }\r\n}","__index":{"obj":0},"__func":"constructor","__args":["02716f6cb78c89b03e879db452dd89fce9764f00fecd28589b41ff1f07572e568b",1000,"ecad8379a7e0d8e62da3ef0de8ef6b56483814a4e1f2548550cc80466f41e1d5:0","72639edace8eab5df5b319b69b06dc118db03755508750d45456cf1b1d2e4098:0","c6fe5c2f6e3676bfc06a0b9cb8ebc16fc62efd866b1b15b190ddcbc135824de9:0"]}u
    https://whatsonchain.com/tx/f07a30c075cef4955832490ae2046b7e9dfb749e524e3eab5eb417f29977c3da