Transaction

2c2396e89f3032d7e5abf32389e9a10cb35841413bf3305c9acd76de279a33db
( - )
151,792
2021-11-14 03:11:07
1
1,962 B

2 Inputs

Total Input:
  • Q!6¢Zp2A<I¥›?õæflWxÅE g}Î ½àQ®M¦{"__cls":"class Token {\n constructor(to, supply, name) {\n this.coins = supply\n this._owners = [to]\n this.name = name\n }\n\n send(amount, to) {\n if (this.coins < amount) throw new Error()\n this.coins -= amount\n return new Token(to, amount, this.name)\n }\n}","__index":{"obj":0},"__func":"constructor","__args":["0236a219185a01060f7032413c49a59b3ff5e6666c570f78c5450b677dce20bde0",32,"vivek"]}u
    https://whatsonchain.com/tx/undefined

3 Outputs

Total Output:
  • Q!6¢Zp2A<I¥›?õæflWxÅE g}Î ½àQ®{"__index":{"0":0,"obj":1}}u
    https://whatsonchain.com/tx/2c2396e89f3032d7e5abf32389e9a10cb35841413bf3305c9acd76de279a33db
  • Q!6¢Zp2A<I¥›?õæflWxÅE g}Î ½àQ®Mù{"haveToken":0,"__cls":"class BuyLimitOrder {\n _id\n _rev\n _rootId\n haveToken\n wantTokenRootId\n _owner\n limitPrice\n priceForOrderBook\n\n constructor(haveToken, wantTokenRootId, priceRatio, publicKey) {\n this.limitPrice = 1.0 / priceRatio\n this.priceForOrderBook = priceRatio\n this.haveToken = haveToken\n this.wantTokenRootId = wantTokenRootId\n this._owner = publicKey\n }\n\n /**\n * Executes the Limit Order\n * @param wantToken token should match what is needed by Limit Order\n */\n execute(wantToken) {\n if (wantToken._rootId !== this.wantTokenRootId) {\n throw new Error(\n 'Incorrect Operation. Reason: Root of the token which is required by this Limit Order doesnot match'\n )\n }\n const numberOfWantCoins = parseFloat(wantToken.coins)\n const numberOfHaveCoins = parseFloat(this.haveToken.coins)\n\n if (numberOfWantCoins > numberOfHaveCoins * this.limitPrice) {\n this.haveToken.send(numberOfHaveCoins, wantToken._owners[0])\n wantToken.send(numberOfHaveCoins * this.limitPrice, this._owner)\n } else {\n const amountToBeSendFromHaveToken =\n numberOfWantCoins * (1.0 / this.limitPrice)\n this.haveToken.send(amountToBeSendFromHaveToken, wantToken._owners[0])\n wantToken.send(numberOfWantCoins, this._owner)\n }\n }\n}","__func":"constructor","__args":["__","181b1d6d400a0372af49cf85f20e6a72327c79be2399b175d2fca421237fd430:0",10,"0236a219185a01060f7032413c49a59b3ff5e6666c570f78c5450b677dce20bde0"]}u
    https://whatsonchain.com/tx/2c2396e89f3032d7e5abf32389e9a10cb35841413bf3305c9acd76de279a33db