Settings

Blockchain
Network
Unit
Language
Theme
Sound New Block

Transaction

1e3585e89decfcb020c42b241d32f89e7d38a09b04d945ff5807a8d3fbb7f6f7
Timestamp (utc)
2021-01-13 05:41:42
Fee Paid
0.00003258 BSV
(
0.00992603 BSV
-
0.00989345 BSV
)
Fee Rate
510.8 sat/KB
Version
1
Confirmations
325,555
Size Stats
6,377 B

3 Outputs

Total Output:
0.00989345 BSV
  • jrun cryptofightsMÃ¥{"in":0,"ref":["b3878396e872bf4dcffc6df0f4f1469a63a970182fe40c9020630f83c2c21211_o1","084a81d9fd6c8b96af656f9c4e673f3fcdc0994c0bd1f5bcfb8a7d03c3365ade_o1","456f45e2cc4ecce7373debce7d057173e57f6a54953d3e6144ec419b0f620dde_o1","247085e2de0e644d9ff393ba53169214fdf883895e6a1fb0c4c0b822c65055aa_o1","7c46788235187dfd3eb37da3dade340c174a814dfca7d32a046fd1462f73146e_o1","b2b0e743dafe40297dea5609ffe42516e082a04d6fef28fc03e14f4326162c97_o1","a9644e60148a55d866661bef56710b5cd868c6d697c608d6317057f5ecb25126_o1","91e2e3cb089c8342223d40abadab69c7fdc192e146a7a33c4638515159bc0b7d_o1","f4ff4bd972453ce31c95279e406b6737c19a86285a51235885025a98442884f2_o1","6137cc92426478e6aab4036389d43942774e2b4b707ffb3e5bd6edfeb5f759fb_o1"],"out":["449379e0ed0b43bfd97b37915955190e0ffaa93a7fa09501e084117752c13b59"],"del":[],"cre":["n2Bd4cWhEQK1aVjb1R7EBGV9mrw3etvSdC"],"exec":[{"op":"DEPLOY","data":["class QueueAgent extends Agent {\n async init() {\n console.log('Initializing', this.constructor.name);\n\n Object.values(QueueAgent.validators).forEach(v => this.messageHandlers.set(v.origin, this.onEnterQueue));\n this.messageHandlers.set('ExitQueue', this.onExitQueue);\n }\n\n onMessage(message) {\n if(!this.messageHandlers.has(message.subject)) {\n throw new KronoError(410, 'Invalid Lobby');\n }\n\n return super.onMessage(message);\n }\n\n async onExitQueue(message) {\n const prevMsgId = await this.storage.get(`player${message.from}`); \n if(!prevMsgId || !(await this.storage.exists(prevMsgId))) return;\n const prevMessage = await this.storage.hgetall(prevMsgId);\n const rules = this.constructor.validators[prevMessage.subject];\n await rules.sendExitQueueStatus(prevMessage, this.wallet, this.blockchain);\n const pipeline = this.storage.pipeline()\n .del(`player${message.from}`);\n for (const rules of Object.values(QueueAgent.validators)) {\n pipeline.hdel(rules.origin, message.from);\n }\n await pipeline.exec();\n return;\n }\n\n async onEnterQueue(message) {\n console.log('Enter Queue:', message.subject);\n const rules = this.constructor.validators[message.subject];\n if(!rules) throw new Error('Unsupported Rules');\n\n console.log('RULES:', JSON.stringify({...rules}));\n\n const prevMsgId = await this.storage.get(`player${message.from}`);\n if(prevMsgId) {\n const prev = await this.storage.hget(prevMsgId, 'subject');\n await this.storage.pipeline()\n .hdel(prev, message.from)\n .del(`player${message.from}`)\n .exec();\n }\n \n if(rules.playerCount === 1) {\n await this.createBattle(rules, [{...message}]);\n } \n else {\n const match = await rules.processQueue(message, this);\n if(match) {\n await this.createBattle(rules, [message, match]);\n } else {\n await this.storage.pipeline()\n .hmset(message.id, message)\n .set(`player${message.from}`, message.id)\n .hset(message.subject, message.from, message.id)\n .exec();\n }\n }\n \n await rules.sendEnterQueueStatus(message, this.wallet, this.blockchain);\n }\n\n async createBattle(rules, messages) {\n console.log('Sending to Validator');\n const message = this.wallet.buildMessage({\n to: [ValidatorConfig.pubkey],\n subject: 'LaunchAgent',\n payload: JSON.stringify({\n location: rules.origin,\n initParams: {\n messages,\n nonce: this.wallet.randomBytes(16)\n }\n })\n });\n await this.blockchain.sendMessage(message);\n\n // Remove from queue\n const pipeline = this.storage.pipeline();\n messages.forEach(m => {\n pipeline.hdel(m.subject, m.from);\n pipeline.del(m.id);\n });\n await pipeline.exec();\n }\n\n static async preDeploy() {\n const {Bot1ValidatorAgent,Bot2ValidatorAgent,Bot3ValidatorAgent,Bot4ValidatorAgent,Bot5ValidatorAgent,Bot6ValidatorAgent,Tier7ValidatorAgent} = this.deps;\n QueueAgent.validators = {\n [Bot1ValidatorAgent.origin]: Bot1ValidatorAgent,\n [Bot2ValidatorAgent.origin]: Bot2ValidatorAgent,\n [Bot3ValidatorAgent.origin]: Bot3ValidatorAgent,\n [Bot4ValidatorAgent.origin]: Bot4ValidatorAgent,\n [Bot5ValidatorAgent.origin]: Bot5ValidatorAgent,\n [Bot6ValidatorAgent.origin]: Bot6ValidatorAgent,\n [Tier7ValidatorAgent.origin]: Tier7ValidatorAgent\n };\n }\n}",{"agentId":"queue","deps":{"Agent":{"$jig":0},"Bot1ValidatorAgent":{"$jig":1},"Bot2ValidatorAgent":{"$jig":2},"Bot3ValidatorAgent":{"$jig":3},"Bot4ValidatorAgent":{"$jig":4},"Bot5ValidatorAgent":{"$jig":5},"Bot6ValidatorAgent":{"$jig":6},"KronoError":{"$jig":7},"Tier7ValidatorAgent":{"$jig":8},"ValidatorConfig":{"$jig":9}},"hash":"10b7b6494413133e0e311f89e6cb11df9fceee7043a0aa04fffd09cd79f5076c","sealed":false,"validators":{"084a81d9fd6c8b96af656f9c4e673f3fcdc0994c0bd1f5bcfb8a7d03c3365ade_o1":{"$dup":["1","deps","Bot1ValidatorAgent"]},"247085e2de0e644d9ff393ba53169214fdf883895e6a1fb0c4c0b822c65055aa_o1":{"$dup":["1","deps","Bot3ValidatorAgent"]},"456f45e2cc4ecce7373debce7d057173e57f6a54953d3e6144ec419b0f620dde_o1":{"$dup":["1","deps","Bot2ValidatorAgent"]},"7c46788235187dfd3eb37da3dade340c174a814dfca7d32a046fd1462f73146e_o1":{"$dup":["1","deps","Bot4ValidatorAgent"]},"a9644e60148a55d866661bef56710b5cd868c6d697c608d6317057f5ecb25126_o1":{"$dup":["1","deps","Bot6ValidatorAgent"]},"b2b0e743dafe40297dea5609ffe42516e082a04d6fef28fc03e14f4326162c97_o1":{"$dup":["1","deps","Bot5ValidatorAgent"]},"f4ff4bd972453ce31c95279e406b6737c19a86285a51235885025a98442884f2_o1":{"$dup":["1","deps","Tier7ValidatorAgent"]}}}]}]}
    https://whatsonchain.com/tx/1e3585e89decfcb020c42b241d32f89e7d38a09b04d945ff5807a8d3fbb7f6f7