diff --git a/contracts/deployments/chatroom/alephzero-testnet.ts b/contracts/deployments/chatroom/alephzero-testnet.ts new file mode 100644 index 0000000..fcfe394 --- /dev/null +++ b/contracts/deployments/chatroom/alephzero-testnet.ts @@ -0,0 +1,2 @@ +export const address = '5Ebup7yb8hMRb3pfzRxyTjNvRatnZieTsh5GeLtc38Cr2uvc' +export const blockNumber = 56383197 diff --git a/contracts/deployments/chatroom/chatroom.contract b/contracts/deployments/chatroom/chatroom.contract new file mode 100644 index 0000000..956cd41 --- /dev/null +++ b/contracts/deployments/chatroom/chatroom.contract @@ -0,0 +1 @@ +{"source":{"hash":"0xe3c0527753972c39e42572e19da5b98d6b3c65686b6d500dbeb82ca09e441579","language":"ink! 4.3.0","compiler":"rustc 1.71.0","wasm":"0x0061736d0100000001450c60037f7f7f017f60027f7f017f60027f7f0060037f7f7f0060047f7f7f7f0060017f0060047f7f7f7f017f60000060057f7f7f7f7f0060017f017e6000017f60017f017f02990108057365616c310b6765745f73746f726167650006057365616c301176616c75655f7472616e736665727265640002057365616c3005696e7075740002057365616c300663616c6c65720002057365616c300d64656275675f6d6573736167650001057365616c320b7365745f73746f726167650006057365616c300b7365616c5f72657475726e000303656e76066d656d6f727902010210034c4b000200000202030202020a0305020402030b030501020302020205070401010203070503020707080100000301010403040102010509010108060406080204010103000004010101010104040501700112120608017f01418080040b0711020463616c6c002c066465706c6f79002d0917010041010b111b4647384f3a4d4e135013313334134c3c0aa96b4b2b01017f037f2002200346047f200005200020036a200120036a2d00003a0000200341016a21030c010b0b0b910201037f230041106b22022400200241003a000041012103024020012002410110090d00024002400240024020022d0000220441037141016b0e03000102030b200220043a0005200241013a000420022001360200200241003b010c20022002410c6a4102100a0d0320022f010c220441ff014d0d0320044102762101410021030c030b200220043a0005200241013a0004200220013602002002410036020c20022002410c6a4104100a0d02200228020c220341027621012003418080044921030c020b200441034b0d012002410036020020012002410410090d01200228020022014180808080044921030c010b20044102762101410021030b2000200136020420002003360200200241106a24000b3d01027f2000280204220320024922044504402001200220002802002201200241d8a20410432000200320026b3602042000200120026a3602000b20040b3d01017f20002d0004200041003a000404402001200041056a2d00003a00002000280200200141016a200241016b10090f0b20002802002001200210090b8a0101047f230041206b22022400200241186a22034200370300200241106a22044200370300200241086a22054200370300200242003703002000027f200120024120100945044020002002290300370001200041196a2003290300370000200041116a2004290300370000200041096a200529030037000041000c010b41010b3a0000200241206a24000b0a00200120004120100d0b5c01037f02402000280208220420026a220320044f04402003200028020422054b0d01200028020020046a200320046b20012002418ca0041043200020033602080f0b41b09e04411c41ec9f041017000b2003200541fc9f041019000b7401017f230041106b2202240002402001413f4d044020002001410274100f0c010b200141ffff004d0440200220014102744101723b010e20002002410e6a4102100d0c010b200141ffffffff034d04402001410274410272200010100c010b20004103100f2001200010100b200241106a24000b970101027f20002802082202200028020422034904402000200241016a360208200028020020026a20013a00000f0b230041306b220024002000200336020420002002360200200041146a42023702002000412c6a41043602002000410236020c200041c08c04360208200041043602242000200041206a360210200020003602282000200041046a360220200041086a419ca004101c000b2601017f230041106b220224002002200036020c20012002410c6a4104100d200241106a24000b5502027f027e230041206b22002400200041106a22014200370300200042003703082000411036021c200041086a2000411c6a10012001290300210220002903082103200041206a2400410541042002200384501b0b4601027f230041106b22032400200341086a20021039200328020c210420032802082001200210072101200020023602082000200436020420002001360200200341106a24000b0300010b0c00200020014104410c10510b5101017e0240200341808080807820026b20016e4b0440410021020c010b2001ad2003ad7e22044220885004402004a721010c010b41a08004412141c480041017000b20002001360204200020023602000b0c00200020014101412010510b4601017f230041206b220324002003410c6a420037020020034101360204200341ac9e043602082003200136021c200320003602182003200341186a36020020032002101c000b1b002000418180014f0440200041808001419883041019000b20000b6b01017f230041306b220324002003200136020420032000360200200341146a42023702002003412c6a41043602002003410236020c200341f89104360208200341043602242003200341206a3602102003200341046a36022820032003360220200341086a2002101c000b4801017f230041206b220124002001410c6a4201370200200141013602042001418c9c043602002001410136021c200120003602182001200141186a360208200141f88304101c000b860101017f230041306b22022400200241146a42013702002002410136020c2002418c9c0436020820024102360224200220002d0000410274220041f0a2046a28020036022c200220004184a3046a280200360228200141146a280200200141186a2802002002200241206a3602102002200241286a360220200241086a1049200241306a24000b3c01017f230041206b2202240020022000360214200241dc8b0436020c200241ac9e04360208200241013a001820022001360210200241086a103b000b100020022001100e200220002001100d0bc50201057f200028020822022000280204460440230041306b2203240002400240027f4100200241016a2202450d001a200028020422044100480d01200341086a410420044101742205200220022005491b2202200241044d1b22051014200328020c2102200328020821060240200404402003410436022420032004410c6c360228200320002802003602200c010b200341003602240b200341106a20062002200341206a102320032802104504402003280214210220002005360204200020023602004181808080780c010b200341186a280200210220032802140b20021020200341306a24000c010b41a08004412141d486041017000b200028020821020b20002802002002410c6c6a22032001290200370200200341086a200141086a280200360200200241016a220145044041808004411c41e08a041017000b200020013602080be50201057f200028020822032000280204460440230041306b2202240002400240027f4100200341016a2203450d001a200028020422044100480d01200241086a410420044101742205200320032005491b2203200341044d1b22051016200228020c2103200228020821060240200404402002410136022420022004410574360228200220002802003602200c010b200241003602240b200241106a20062003200241206a102320022802104504402002280214210320002005360204200020033602004181808080780c010b200241186a280200210320022802140b20031020200241306a24000c010b41a08004412141d486041017000b200028020821030b200028020020034105746a22022001290000370000200241086a200141086a290000370000200241106a200141106a290000370000200241186a200141186a290000370000200341016a220145044041808004411c41e08a041017000b200020013602080b1f00024020004181808080784704402000450d0120011021000b0f0b1022000b860101017f230041306b220124002001200036020c2001411c6a420137020020014102360214200141a088043602102001410436022c2001200141286a36021820012001410c6a360228230041206b220024002000200141106a360214200041dc8b0436020c200041ac9e04360208200041003a0018200041b08804360210200041086a103b000b3c01017f230041206b22002400200041146a42003702002000410136020c200041f88604360208200041ac9e04360210200041086a41808704101c000bea0101037f230041106b220424002000027f024020010440027f0240200241004e044020032802040d0120042001200210362004280200210320042802040c020b200041003602040c030b200341086a2802002205450440200441086a200120024100103720042802082103200428020c0c010b2003280200210602402001200210252203450440410021030c010b20032006200510071a0b20020b21052003044020002003360204200041086a200536020041000c030b20002001360204200041086a20023602000c010b20004100360204200041086a20023602000b41010b360200200441106a24000b18002001047f41a2a3052d00001a2000200110250520000b0bac0101027f02402001200020016a41016b410020006b7122004d044002404198a304280200220120006a22032001490d00419ca3042802002003490440200041ffff036a22022000490d0320024110764000220141ffff034b0d032001411074220120024180807c716a22032001490d0341002102419ca3042003360200200020016a22032001490d010b4198a3042003360200200121020b20020f0b41909e04411c41809e041017000b41000ba60502087f017e230041106b22062400200641086a200110080240024020062802080d00200628020c220220012802044b0d0020062002410110272006350204210a200120062802002203200210090d00024002402002450d00200241076b22014100200120024d1b2108200341036a417c7120036b2109410021010340024002400240024002400240200120036a2d00002205c02207410048044002400240200541c097046a2d000041026b0e030301000b0b200141016a220420024f0d0a200320046a2c000021040240024002400240200541f0016b0e050100000002000b2007410f6a41ff017141024b0d0d20044140480d020c0d0b200441f0006a41ff01714130490d010c0c0b2004418f7f4a0d0b0b200141026a220520024f0d0a200320056a2c000041bf7f4a0d0a200141036a220120024f0d0a200120036a2c000041bf7f4c0d060c0a0b200141016a220420024f0d09200320046a2c00002104024002400240200541e001470440200541ed01460d012007411f6a41ff0171410c490d022007417e71416e470d0d20044140480d030c0d0b200441607141a07f460d020c0c0b200441a07f480d010c0b0b200441bf7f4a0d0a0b200141026a220120024f0d09200120036a2c000041bf7f4c0d050c090b200920016b4103710d01200120084f0d020340200120036a220541046a280200200528020072418081828478710d03200141086a22012008490d000b0c020b200141016a22012002490d020c070b200141016a21010c030b200120024f0d020340200120036a2c00004100480d032002200141016a2201470d000b0c040b200120036a2c000041bf7f4a0d040b200141016a21010b20012002490d000b0b20002002ad422086200a84370204200020033602000c020b200041003602000c010b200041003602000b200641106a24000b7101027f230041106b2203240002402001450440410121020c010b200141004e22040440027f2002450440200341086a20042001103620032802080c010b2003200420014101103720032802000b22020d0120011021000b1022000b2000200136020420002002360200200341106a24000b3701017f230041106b22002400200042808001370204200041a0a30436020020004101100f20004101100f410120002802081018102b000bbe0202057f017e230041306b2201240020014100360218200142808001370224200141a0a3043602204100200141206a2203101020012001290320370310200141086a200141106a2001280228102a200128020c210420012802082001290310210620014100360228200120063703202000280200200041086a2802002003101d200041246a2003100c200028020c21022003200041146a2802002203100e2003044020022003410c6c6a210303402002280200200241086a280200200141206a101d2002410c6a22022003470d000b0b20002802182102200141206a200041206a2802002200100e200004402000410574210003402002200141206a100c200241206a2102200041206b22000d000b0b200120012903203703102001200141106a2001280228102a20042001280200200128020410051a200141306a24000b4501017f2002200128020422034b044041cc9e04412341aca0041017000b2001200320026b36020420012001280200220120026a36020020002002360204200020013602000b0d00200041a0a30420011006000ba10d02087f077e230041f0016b220024000240024002400240024002400240101141ff0171410546044020004180800136024841a0a304200041c8006a100220002802482201418180014f0d012000200136024c200041a0a3043602482000410036029001200041c8006a20004190016a410410090d062000280290012201411876210320014110762102200141087621050240200141ff0171220141a601470440200141d10147200541ff017141df004772200241ff017141e50047720d08410121072003419a01460d010c080b200541ff0171410747200241ff017141f10047722003411347720d070b200041003602c00120004280800137024c200041a0a3043602484100200041c8006a22021010200020002903483703b801200041206a200041b8016a2000280250102a20002802242105200028022020002802b8012101200020002802bc01220336024820052001200210002105200320002802482202490d020240024002400240024020050e0400020201020b200020023602cc01200020013602c801200041c8006a200041c8016a102620002802482205450d02200029024c2108200041c8006a200041c8016a100b20002d00480d02200041e8016a200041e1006a290000370300200041e0016a200041d9006a290000370300200041d8016a200041d1006a290000370300200020002900493703d001200041186a200041c8016a100820002802180d024104210320002802cc01410c6e2202200028021c2201200120024b1b22020440200041106a2002101420002802102203450d09200028021422044100480d092003200410242203450d080b200041003602302000200236022c2000200336022820010440034020004190016a200041c8016a10262000280290012203450d04200020002902940137024c20002003360248200041286a200041c8006a101e200141016b22010d000b200028022821030b2003450d02200029022c2109200041086a200041c8016a100820002802080d024101210120002802cc014105762204200028020c2202200220044b1b2204044020002004101620002802002201450d09200028020422064100480d092001200610242201450d0a0b200041003602302000200436022c2000200136022820020440200041c8006a41017221010340200041c8006a200041c8016a100b20002d00480d04200041a8016a200141186a290000370300200041a0016a200141106a29000037030020004198016a200141086a2900003703002000200129000037039001200041286a20004190016a101f200241016b22020d000b200028022821010b2001450d02200029022c210a200041406b2202200041e8016a290300370300200041386a2204200041e0016a290300370300200041306a2206200041d8016a290300370300200020002903d00137032820070d03200041a9016a2002290300220b370000200041a1016a2004290300220c37000020004199016a2006290300220d37000020002000290328220e37009101200041f4006a200d370200200041fc006a200c37020020004184016a200b3702002000200a3702642000200136026020002009370358200020033602542000200837024c200020053602482000200e37026c200041c8006a1029200041003a009001230041106b22012400200142808001370204200141a0a304360200024020004190016a22002d000045044020014100100f200041016a2001100c0c010b20014101100f20014101100f0b410020012802081018102b000b200041d4006a42003702002000410136024c200041d084043602480c0a0b200041d4006a42003702002000410136024c200041c48304360248200041ac9e04360250200041c8006a41cc8304101c000b200041d4006a42003702002000410136024c200041b084043602480c080b20004190016a20052008422088a71012200041f4006a2006290300370200200041fc006a200429030037020020004184016a20022903003702002000200a3702642000200136026020002009370358200020033602542000200837024c200020053602482000200029032837026c200041c8006a102920002802900121012000280298012103230041106b22002400200042808001370204200041a0a30436020002402001044020004100100f200120032000101d0c010b20004101100f20004101100f0b410020002802081018102b000b200041043a0048200041c8006a101a000b20014180800141cc81041019000b2002200341cc81041019000b20041021000b1022000b20061021000b1028000b200041ac9e04360250200041c8006a41f88304101c000bfe0402087f027e230041d0016b2200240002400240101141ff01712201410546044020004180800136024841a0a304200041c8006a100220002802482201418180014f0d012000200136024c200041a0a304360248200041003602000240200041c8006a2000410410090d002000280200419bddf6f405470d0020004180800136024841a0a304200041c8006a22011003200041808001360204200041a0a30436020020012000100b20002d00480d03200041a7016a2202200041e1006a290000370000200041a0016a2203200041da006a29010037030020004198016a2205200041d2006a29010022083703002000200029014a22093703900120002d00492104200041b8016a22064100360200200042013703b001200041d1006a2008370000200041d9006a2003290300370000200041e0006a2002290000370000200020043a004820002009370049200041b0016a200041c8006a2201101f200041c8016a22074100360200200042043703c001200141d8840441171012200041c0016a2001101e200041ef840441011012200041146a2007280200360200200041256a2000290390013700002000412d6a2005290300370000200041356a20032903003700002000413c6a2002290000370000200041206a2006280200360200200020043a0024200020002903c00137020c200020002903b0013703182001200041c40010071a20011029230041106b22002400200042808001370204200041a0a30436020020004100100f20004100100f410020002802081018102b000b1028000b200020013a0048200041c8006a101a000b20014180800141cc81041019000b200041003a004841dc810441c100200041c8006a41d4800441888304102e000b7c01017f230041406a220524002005200136020c200520003602082005200336021420052002360210200541246a42023702002005413c6a41033602002005410236021c200541d48c04360218200541023602342005200541306a3602202005200541106a3602382005200541086a360230200541186a2004101c000b5501017f230041206b2202240020022000360204200241186a200141106a290200370300200241106a200141086a29020037030020022001290200370308200241046a418c8504200241086a1030200241206a24000bf40301057f230041406a22032400200341306a2001360200200341033a003820034120360228200341003602342003200036022c2003410036022020034100360218027f02400240200228021022014504402002410c6a28020022004103742105200041ffffffff017121072002280208210441002101034020012005460d02200228020020016a220041046a28020022060440200328022c20002802002006200328023028020c1100000d040b200141086a2101200428020020042802042106200441086a2104200341186a2006110100450d000b0c020b200241146a28020022074105742100200741ffffff3f71210703402000450d01200228020020046a220541046a28020022060440200328022c20052802002006200328023028020c1100000d030b20032001280210360228200320012d001c3a003820032001280218360234200341106a20022802082205200141086a104820032003290310370318200341086a20052001104820032003290308370320200441086a2104200041206b210020012802142106200141206a2101200520064103746a2205280200200341186a2005280204110100450d000b0c010b200228020420074b0440200328022c200228020020074103746a22002802002000280204200328023028020c1100000d010b41000c010b41010b200341406b24000b0f00200028020020012002103241000b7701027f230041106b2204240020022000280204200028020822036b4b0440200441086a20002003200210352004280208200428020c1020200028020821030b200028020020036a2001200210071a2003200220036a22014b044041f08404411c41f08a041017000b20002001360208200441106a24000bdd0201037f230041106b220224000240024002400240200028020022002002410c6a027f0240024020014180014f04402002410036020c2001418010490d012001418080044f0d0220022001413f71418001723a000e20022001410c7641e001723a000c20022001410676413f71418001723a000d41030c030b200028020822032000280204460d030c040b20022001413f71418001723a000d2002200141067641c001723a000c41020c010b20022001413f71418001723a000f20022001410676413f71418001723a000e20022001410c76413f71418001723a000d2002200141127641077141f001723a000c41040b10320c020b230041106b22042400200441086a20002003410110352004280208200428020c1020200441106a2400200028020821030b200028020020036a20013a0000200341016a2201450d01200020013602080b200241106a240041000f0b41f08404411c41e08a041017000b4a01017f230041206b220224002000280200200241186a200141106a290200370300200241106a200141086a29020037030020022001290200370308200241086a102f200241206a24000be10101027f230041206b220424000240027f4100200220036a22032002490d001a200128020422024100480d01410820024101742205200320032005491b2203200341084d1b2203417f73411f7621050240200204402004200236021820044101360214200420012802003602100c010b200441003602140b200420052003200441106a102320042802004504402004280204210220012003360204200120023602004181808080780c010b200441086a280200210320042802040b21052000200336020420002005360200200441206a24000f0b41b08504412141d486041017000b3901017f230041106b22032400200341086a2001200241001037200328020c21012000200328020836020020002001360204200341106a24000b2b0020020440200345044041a2a3052d00001a0b20012002102521010b20002002360204200020013602000be906020b7f027e230041406a2203240020002802002202ad210d0240024002400240024002400240024020024190ce004f044041272100200d210e0240034020004104490d01200341196a20006a220241046b200e200e4290ce0080220d4290ce007e7da7220441ffff037141e4006e220641017441da8d046a2f00003b0000200241026b2004200641e4006c6b41ffff037141017441da8d046a2f00003b0000200041046b2100200e42ffc1d72f56200d210e0d000b200da7220241e3004d0d0320004102490d090c020b0c080b41272100200241e3004b0d002002410a490d040c020b200041026b2200200341196a6a200da72202200241ffff037141e4006e220241e4006c6b41ffff037141017441da8d046a2f00003b00000b2002410a490d01200041024f0d000c050b200041026b2200200341196a6a200241017441da8d046a2f00003b00000c020b2000450d030b200041016b2200200341196a6a200241306a3a00000b200041274b0d01412820006b412720006b2206200128021c220541017122071b2102410021042005410471044041ac9e042104200241ac9e0441ac9e04103d20026a22024b0d010b412b418080c40020071b2107200341196a20006a21080240200128020045044041012100200141146a2802002202200141186a28020022012007200410400d01200220082006200128020c11000021000c010b02402002200128020422094904402005410871450d012001280210210b2001413036021020012d0020210c41012100200141013a0020200141146a2802002205200141186a280200220a2007200410400d02200341106a2001200920026b4101104120032802102202418080c400460d0220032802142104200520082006200a28020c1100000d02200220042005200a10420d022001200c3a00202001200b360210410021000c020b41012100200141146a2802002202200141186a28020022012007200410400d01200220082006200128020c11000021000c010b41012100200341086a2001200920026b4101104120032802082205418080c400460d00200328020c2109200141146a2802002202200141186a28020022012007200410400d00200220082006200128020c1100000d002005200920022001104221000b200341406b240020000f0b41808b04411c419090041017000b41a08b04412141fc9b041017000b3701017f230041106b22022400200241086a200141001027200228020c21012000200228020836020020002001360204200241106a24000b0e0020002802001a03400c000b000b900201027f230041406a220124002001200036020c2001410536021420012001410c6a360210410021004104210202400240024002400240034020002000200241f09e046a2802006a22004b0d01200241086a22024114470d000b200120004101744100200041104e1b10392001410036022020012001290300370318200142013702342001410236022c200141f09e043602282001200141106a360230200141186a200141286a102f0d012001280218200128022041a0a3052d000045044041a1a3052d00004101710d050b10044109470d020c030b41f08404411c41ec9b041017000b41c088044133200141286a41d4850441e08904102e000b41a0a30541013a00000b41a1a30541013a00000b000b0d0042e7e1dbbcef938cbdd6000b8e04010a7f230041106b220224000240200120006b220141104f04402000200041036a417c71220620006b2200103e22042006200120006b2200417c716a2000410371103e6a220320044f0440200041027621050240024003402005450d0520022006200541c0012005200541c0014f1b41f89204103f200228020c21052002280208210620022002280200200228020422002000417c7141e09404103f200228020c210820022802082107024020022802042200450440410021000c010b2002280200220420004102746a21094100210003402004220a41106a21044100210102400340200020002001200a6a280200220b417f73410776200b410676724181828408716a22004d0440200141046a22014110470d010c020b0b41808b04411c41f094041017000b20042009470d000b0b20032003200041087641ff81fc0771200041ff81fc07716a418180046c4110766a22034b0d012008450d000b200841027421014100210003402000200020072802002204417f734107762004410676724181828408716a22004b0d02200741046a2107200141046b22010d000b20032003200041087641ff81fc0771200041ff81fc07716a418180046c4110766a22034d0d0441808b04411c41a095041017000b41808b04411c418095041017000b41808b04411c419095041017000b41808b04411c41d094041017000b20002001103e21030b200241106a240020030b4601017f200145044041000f0b024003402002200220002c000041bf7f4a6a22024b0d01200041016a2100200141016b22010d000b20020f0b41808b04411c41ec9b041017000b3e00200220034f044020002003360204200020013602002000410c6a200220036b3602002000200120034102746a3602080f0b41cc9e04412320041017000b39000240027f2002418080c40047044041012000200220012802101101000d011a0b20030d0141000b0f0b200020034100200128020c1100000bb40101027f20022105024002400240024020012d0020220441016b0e03020100030b200341ff01710d01410021040c020b200241016a2203044020034101762105200241017621040c020b41808b04411c41a090041017000b41002105200221040b200441016a2102200141186a2802002103200128021021042001280214210102400340200241016b2202450d01200120042003280210110100450d000b418080c40021040b20002005360204200020043602000b3201017f027f0340200120012004460d011a200441016a2104200220002003280210110100450d000b200441016b0b2001490b7b002001200346044020002002200110071a0f0b230041306b220024002000200336020420002001360200200041146a42023702002000412c6a41043602002000410336020c200041c89304360208200041043602242000200041206a360210200020003602282000200041046a360220200041086a2004101c000b8b0201067f02402000027f418080c400200128020022022001280204460d001a2001200241016a2205360200024020022d00002203c041004e0d002001200241026a220536020020022d0001413f7121042003411f712106200341df014d0440200641067420047221030c010b2001200241036a220536020020022d0002413f712004410674722107200341f00149044020072006410c747221030c010b2001200241046a2205360200418080c4002006411274418080f0007120022d0003413f71200741067472722203418080c400460d011a0b20012802082204200520026b6a22022004490d012001200236020820030b360204200020043602000f0b41808b04411c41a096041017000b2c00200120024d04402000200220016b3602042000200120036a3602000f0b41a08b04412141b097041017000bc90301067f230041306b22022400200028020421042000280200210302400240027f024020012802002205200128020822007204402000450d032001410c6a28020020024100360228200220033602202002200320046a36022441016a21000340200041016b22000440200241186a200241206a1044200228021c418080c400470d010c050b0b200241106a200241206a10442002280214418080c400460d03024020022802102200450d00200020044f044020002004460d010c030b200020036a2c00004140480d020b200241086a4100200020031045200228020c210620022802080c020b200128021420032004200141186a28020028020c11000021000c030b41000b21002006200420001b21042000200320001b21030b2005450440200128021420032004200141186a28020028020c11000021000c010b200128020422002003200320046a103d22054b044020022001200020056b410010414101210020022802002205418080c400460d0120022802042106200141146a280200220720032004200141186a280200220128020c1100000d012005200620072001104221000c010b200128021420032004200141186a28020028020c11000021000b200241306a240020000b140020002802002001200028020428020c1101000b5501027f0240027f02400240200228020041016b0e020103000b200241046a0c010b200120022802044103746a22012802044106470d0120012802000b2802002104410121030b20002004360204200020033602000b4901017f230041206b22032400200341186a200241106a290200370300200341106a200241086a2902003703002003200229020037030820002001200341086a1030200341206a24000bcc0701107f230041d0006b22032400200341003b014c200320023602482003410036024420034281808080a00137023c2003200236023820034100360234200320023602302003200136022c2003410a3602282000280204210c2000280200210d2000280208210e200341406b210f027f03400240024002400240024020032d004d450440200328022c210a027f02402003280238220b200328023022104b0d00200b20032802342202490d00200328023c2206450d052006200f6a41016b21110340200a200222076a210020112d000021050240024002400240027f0240024002400240200b20026b220441084f04402000200041036a417c712202460440200441086b2108410021020c030b200341206a20052000200220006b2202104b20032802204101470d01200328022421010c040b200341106a200520002004104b2003280214210120032802100c040b2002200441086b22084b0d010b200541818284086c21090340200020026a22012802002009732212417f73201241818284086b71200141046a2802002009732201417f73200141818284086b7172418081828478710d01200241086a220220084d0d000b0b200220044b0d02200341186a2005200020026a200420026b104b410020032802184101470d011a2002200328021c6a220120024f0d0041808b04411c41b491041017000b41010b22004101460440200141016a2202450d0202402007200220076a22024d04402003200236023420022006490d06200220104d0d010c060b41808b04411c41d49a041017000b200641054f0d03027f200a200220066b6a2105200f210720062104034041002004450d011a200441016b210420072d0000210820052d00002109200541016a2105200741016a210720082009460d000b200920086b0b0d04200341086a20032802442002200a104520032002360244200328020c210020032802080c070b2003200b3602340c050b41a08b04412141a491041017000b41808b04411c41c49a041017000b2006410441e49a041019000b2002200b4d0d000b0b200341013a004d024020032d004c044020032802482101200328024421020c010b2003280248220120032802442202490d04410020012002460d011a0b200320022001200a10452003280204210020032802000b22020d010b41000c060b200e2d0000450d02200d41e48c044104200c28020c110000450d020c030b41a08b04412141b096041017000b41a08b04412141b49a041017000b200e2000047f200020026a41016b2d0000410a460541000b22013a0000200d20022000200c28020c110000450d010b0b41010b200341d0006a24000b5701027f024002402003450440410021030c010b200141ff017121054101210103402005200220046a2d0000460440200421030c030b2003200441016a2204470d000b0b410021010b20002003360204200020013602000b1b00200128021441e8a2044105200141186a28020028020c1100000b16002001280214200141186a280200200028020010300b0b002000280200200110460bf50201047f230041406a2202240020002802002103410121000240200141146a280200220441ec8b04410c200141186a280200220128020c1100000d000240200328020c220504402002200536020c200241346a42013702002002410236022c200241fc8b04360228200241073602142002200241106a36023020022002410c6a36021020042001200241286a1049450d010c020b20032802002205200328020428020c11090042c1f7f9e8cc93b2d141520d002002200536020c200241346a42013702002002410236022c200241fc8b04360228200241083602142002200241106a36023020022002410c6a36021020042001200241286a10490d010b200328020821002002411c6a42033702002002413c6a4104360200200241346a410436020020024103360214200241c48b0436021020022000410c6a3602382002200041086a3602302002410236022c200220003602282002200241286a36021820042001200241106a104921000b200241406b240020000bdd0401047f230041106b220224000240024002400240024002400240024002400240024002400240024020002d000041016b0e0c0102030405060708090a0b0c000b410121002001280214220341eba1044106200141186a280200220528020c22041100000d0c024020012d001c410471450440200341ec8c04410120041100000d0e200341e8a20441052004110000450d010c0e0b200341ea8c04410220041100000d0d2002200536020420022003360200200241013a000f20022002410f6a360208200241e8a2044105104a0d0d200241e88c044102104a0d0d0b200341c18b044101200411000021000c0c0b200128021441dea104410d200141186a28020028020c11000021000c0b0b200128021441d0a104410e200141186a28020028020c11000021000c0a0b200128021441c5a104410b200141186a28020028020c11000021000c090b200128021441aba104411a200141186a28020028020c11000021000c080b2001280214419da104410e200141186a28020028020c11000021000c070b2001280214418da1044110200141186a28020028020c11000021000c060b20012802144181a104410c200141186a28020028020c11000021000c050b200128021441f6a004410b200141186a28020028020c11000021000c040b200128021441efa0044107200141186a28020028020c11000021000c030b200128021441e0a004410f200141186a28020028020c11000021000c020b200128021441cfa0044111200141186a28020028020c11000021000c010b200128021441bca0044113200141186a28020028020c11000021000b200241106a240020000b3901017f230041106b22042400200441086a2003200220011015200428020c21012000200428020836020020002001360204200441106a24000b0bdb220400418080040ba105617474656d707420746f206164642077697468206f766572666c6f7700000000617474656d707420746f206d756c7469706c792077697468206f766572666c6f770000008c0e010072000000c30100001e0000000900000001000000010000000a0000002f7573722f6c6f63616c2f636172676f2f72656769737472792f7372632f696e6465782e6372617465732e696f2d366631376432326262613135303031662f696e6b5f656e762d342e332e302f7372632f656e67696e652f6f6e5f636861696e2f6578742e7273006400010067000000e40000001400000054686520657865637574656420636f6e7472616374206d757374206861766520612063616c6c6572207769746820612076616c6964206163636f756e742069642e2f7573722f6c6f63616c2f636172676f2f72656769737472792f7372632f696e6465782e6372617465732e696f2d366631376432326262613135303031662f696e6b5f656e762d342e332e302f7372632f656e67696e652f6f6e5f636861696e2f696d706c732e727300001d010100690000006b0100000e0000001d010100690000002401000023000000656e636f756e746572656420756e6578706563746564206572726f72a80101001c0000001d01010069000000ed000000170000002f736f75726365732f7372632f63686174726f6f6d2f6c69622e7273dc0101001c0000001000000005000000636f756c64206e6f742070726f7065726c79206465636f64652073746f7261676520656e74727900080201002700000073746f7261676520656e7472792077617320656d70747900380201001700000057656c636f6d6520746f207468652063686174726f6f6d31617474656d707420746f206164642077697468206f766572666c6f770b00000004000000040000000c0000000d0000000e0041b085040b9013617474656d707420746f206d756c7469706c792077697468206f766572666c6f770000000f0000000000000001000000100000002f7573722f6c6f63616c2f7275737475702f746f6f6c636861696e732f737461626c652d7838365f36342d756e6b6e6f776e2d6c696e75782d676e752f6c69622f727573746c69622f7372632f727573742f6c6962726172792f616c6c6f632f7372632f7261775f7665632e72730000e40201006e0000008e0100001c0000006361706163697479206f766572666c6f770000006403010011000000e40201006e0000000c020000050000002f7573722f6c6f63616c2f7275737475702f746f6f6c636861696e732f737461626c652d7838365f36342d756e6b6e6f776e2d6c696e75782d676e752f6c69622f727573746c69622f7372632f727573742f6c6962726172792f616c6c6f632f7372632f616c6c6f632e72736d656d6f727920616c6c6f636174696f6e206f6620206279746573206661696c65640000fc03010015000000110401000d000000900301006c000000a30100000d0000006120666f726d617474696e6720747261697420696d706c656d656e746174696f6e2072657475726e656420616e206572726f722f7573722f6c6f63616c2f7275737475702f746f6f6c636861696e732f737461626c652d7838365f36342d756e6b6e6f776e2d6c696e75782d676e752f6c69622f727573746c69622f7372632f727573742f6c6962726172792f616c6c6f632f7372632f666d742e7273000000730401006a00000062020000200000002f7573722f6c6f63616c2f7275737475702f746f6f6c636861696e732f737461626c652d7838365f36342d756e6b6e6f776e2d6c696e75782d676e752f6c69622f727573746c69622f7372632f727573742f6c6962726172792f616c6c6f632f7372632f7665632f6d6f642e72730000f00401006e000000290700000d000000f00401006e0000009707000009000000617474656d707420746f206164642077697468206f766572666c6f7700000000617474656d707420746f2073756274726163742077697468206f766572666c6f77293a002c0f010000000000c205010001000000c2050100010000000f00000000000000010000001100000070616e69636b65642061742027272c20f805010001000000f905010003000000696e646578206f7574206f6620626f756e64733a20746865206c656e20697320206275742074686520696e6465782069732000000c060100200000002c060100120000003a2000002c0f0100000000005006010002000000202020202c0a280a282f7573722f6c6f63616c2f7275737475702f746f6f6c636861696e732f737461626c652d7838365f36342d756e6b6e6f776e2d6c696e75782d676e752f6c69622f727573746c69622f7372632f727573742f6c6962726172792f636f72652f7372632f666d742f6e756d2e727330303031303230333034303530363037303830393130313131323133313431353136313731383139323032313232323332343235323632373238323933303331333233333334333533363337333833393430343134323433343434353436343734383439353035313532353335343535353635373538353936303631363236333634363536363637363836393730373137323733373437353736373737383739383038313832383338343835383638373838383939303931393239333934393539363937393839392f7573722f6c6f63616c2f7275737475702f746f6f6c636861696e732f737461626c652d7838365f36342d756e6b6e6f776e2d6c696e75782d676e752f6c69622f727573746c69622f7372632f727573742f6c6962726172792f636f72652f7372632f666d742f6d6f642e727300a20701006d000000eb0400000d000000a20701006d0000007d050000300000002f7573722f6c6f63616c2f7275737475702f746f6f6c636861696e732f737461626c652d7838365f36342d756e6b6e6f776e2d6c696e75782d676e752f6c69622f727573746c69622f7372632f727573742f6c6962726172792f636f72652f7372632f736c6963652f6d656d6368722e727300003008010072000000760000004b00000030080100720000007700000034000000206f7574206f662072616e676520666f7220736c696365206f66206c656e6774682072616e676520656e6420696e646578200000e608010010000000c4080100220000002f7573722f6c6f63616c2f7275737475702f746f6f6c636861696e732f737461626c652d7838365f36342d756e6b6e6f776e2d6c696e75782d676e752f6c69622f727573746c69622f7372632f727573742f6c6962726172792f636f72652f7372632f736c6963652f697465722e72730809010070000000c205000025000000736f7572636520736c696365206c656e67746820282920646f6573206e6f74206d617463682064657374696e6174696f6e20736c696365206c656e677468202888090100150000009d0901002b000000c1050100010000002f7573722f6c6f63616c2f7275737475702f746f6f6c636861696e732f737461626c652d7838365f36342d756e6b6e6f776e2d6c696e75782d676e752f6c69622f727573746c69622f7372632f727573742f6c6962726172792f636f72652f7372632f7374722f636f756e742e727300e00901006f0000004700000015000000e00901006f0000004f00000032000000e00901006f0000005400000011000000e00901006f0000005a00000009000000e00901006f0000006400000011000000e00901006f000000660000000d0000002f7573722f6c6f63616c2f7275737475702f746f6f6c636861696e732f737461626c652d7838365f36342d756e6b6e6f776e2d6c696e75782d676e752f6c69622f727573746c69622f7372632f727573742f6c6962726172792f636f72652f7372632f7374722f697465722e72730000b00a01006e0000009100000011000000b00a01006e0000004f0200002d0000002f7573722f6c6f63616c2f7275737475702f746f6f6c636861696e732f737461626c652d7838365f36342d756e6b6e6f776e2d6c696e75782d676e752f6c69622f727573746c69622f7372632f727573742f6c6962726172792f636f72652f7372632f7374722f7472616974732e7273400b010070000000d300000013000000010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010100418299040b330202020202020202020202020202020202020202020202020202020202020303030303030303030303030303030304040404040041c099040bd7092f7573722f6c6f63616c2f7275737475702f746f6f6c636861696e732f737461626c652d7838365f36342d756e6b6e6f776e2d6c696e75782d676e752f6c69622f727573746c69622f7372632f727573742f6c6962726172792f636f72652f7372632f7374722f7061747465726e2e7273000000c00c010071000000a101000047000000c00c010071000000b401000020000000c00c010071000000b401000011000000c00c010071000000b8010000260000002f7573722f6c6f63616c2f7275737475702f746f6f6c636861696e732f737461626c652d7838365f36342d756e6b6e6f776e2d6c696e75782d676e752f6c69622f727573746c69622f7372632f727573742f6c6962726172792f636f72652f7372632f697465722f7472616974732f616363756d2e727300740d01007700000095000000010000006d0601006d000000d2010000050000002c0f0100000000007061696420616e20756e70617961626c65206d657373616765636f756c64206e6f74207265616420696e707574756e61626c6520746f206465636f646520696e707574656e636f756e746572656420756e6b6e6f776e2073656c6563746f72756e61626c6520746f206465636f64652073656c6563746f722f7573722f6c6f63616c2f7275737475702f746f6f6c636861696e732f737461626c652d7838365f36342d756e6b6e6f776e2d6c696e75782d676e752f6c69622f727573746c69622f7372632f727573742f6c6962726172792f636f72652f7372632f616c6c6f632f6c61796f75742e727300008c0e0100720000002e01000018000000617474656d707420746f206164642077697468206f766572666c6f7700000000617474656d707420746f206164642077697468206f766572666c6f77617373657274696f6e206661696c65643a206d6964203c3d2073656c662e6c656e28290a2c0f0100000000006f0f0100010000002f7573722f6c6f63616c2f636172676f2f72656769737472792f7372632f696e6465782e6372617465732e696f2d366631376432326262613135303031662f696e6b5f656e762d342e332e302f7372632f656e67696e652f6f6e5f636861696e2f6275666665722e72730000800f01006a0000005a0000001c000000800f01006a0000005a00000009000000800f01006a0000005a00000031000000800f01006a0000006500000009000000800f01006a0000008d0000002100000045636473615265636f766572794661696c656443616c6c52756e74696d654661696c65644c6f6767696e6744697361626c6564556e6b6e6f776e4e6f7443616c6c61626c65436f64654e6f74466f756e645f456e646f776d656e74546f6f4c6f775472616e736665724661696c65645f42656c6f7753756273697374656e63655468726573686f6c644b65794e6f74466f756e6443616c6c6565526576657274656443616c6c6565547261707065644465636f64652f7573722f6c6f63616c2f636172676f2f72656769737472792f7372632f696e6465782e6372617465732e696f2d366631376432326262613135303031662f7061726974792d7363616c652d636f6465632d332e362e392f7372632f636f6465632e7273000000f110010064000000770000000e0000004572726f72000000190000001c000000160000001400000019000000730e0100570e0100410e01002d0e0100140e01","build_info":{"build_mode":"Debug","cargo_contract_version":"3.0.1","rust_toolchain":"stable-x86_64-unknown-linux-gnu","wasm_opt_settings":{"keep_debug_symbols":false,"optimization_passes":"Z"}}},"contract":{"name":"chatroom","version":"0.1.0","authors":["od41 <[your_email]>"]},"image":null,"spec":{"constructors":[{"args":[],"default":false,"docs":["Constructor that initializes the `bool` value to the given `init_value`."],"label":"new","payable":false,"returnType":{"displayName":["ink_primitives","ConstructorResult"],"type":6},"selector":"0x9bae9d5e"}],"docs":[],"environment":{"accountId":{"displayName":["AccountId"],"type":1},"balance":{"displayName":["Balance"],"type":13},"blockNumber":{"displayName":["BlockNumber"],"type":16},"chainExtension":{"displayName":["ChainExtension"],"type":17},"hash":{"displayName":["Hash"],"type":14},"maxEventTopics":4,"timestamp":{"displayName":["Timestamp"],"type":15}},"events":[{"args":[{"docs":[],"indexed":false,"label":"id","type":{"displayName":["String"],"type":0}},{"docs":[],"indexed":false,"label":"owner","type":{"displayName":["Option"],"type":11}},{"docs":[],"indexed":false,"label":"members","type":{"displayName":["Vec"],"type":12}}],"docs":[],"label":"ChatroomCreated"}],"lang_error":{"displayName":["ink","LangError"],"type":8},"messages":[{"args":[],"default":false,"docs":[" A message that can be called on instantiated contracts."," This one flips the value of the stored `bool` from `true`"," to `false` and vice versa."],"label":"getId","mutates":true,"payable":false,"returnType":{"displayName":["ink","MessageResult"],"type":9},"selector":"0xd15f659a"},{"args":[],"default":false,"docs":[],"label":"getOwner","mutates":true,"payable":false,"returnType":{"displayName":["ink","MessageResult"],"type":10},"selector":"0xa6077113"}]},"storage":{"root":{"layout":{"struct":{"fields":[{"layout":{"leaf":{"key":"0x00000000","ty":0}},"name":"id"},{"layout":{"leaf":{"key":"0x00000000","ty":1}},"name":"owner"},{"layout":{"leaf":{"key":"0x00000000","ty":4}},"name":"messages"},{"layout":{"leaf":{"key":"0x00000000","ty":5}},"name":"members"}],"name":"Chatroom"}},"root_key":"0x00000000"}},"types":[{"id":0,"type":{"def":{"primitive":"str"}}},{"id":1,"type":{"def":{"composite":{"fields":[{"type":2,"typeName":"[u8; 32]"}]}},"path":["ink_primitives","types","AccountId"]}},{"id":2,"type":{"def":{"array":{"len":32,"type":3}}}},{"id":3,"type":{"def":{"primitive":"u8"}}},{"id":4,"type":{"def":{"sequence":{"type":0}}}},{"id":5,"type":{"def":{"sequence":{"type":1}}}},{"id":6,"type":{"def":{"variant":{"variants":[{"fields":[{"type":7}],"index":0,"name":"Ok"},{"fields":[{"type":8}],"index":1,"name":"Err"}]}},"params":[{"name":"T","type":7},{"name":"E","type":8}],"path":["Result"]}},{"id":7,"type":{"def":{"tuple":[]}}},{"id":8,"type":{"def":{"variant":{"variants":[{"index":1,"name":"CouldNotReadInput"}]}},"path":["ink_primitives","LangError"]}},{"id":9,"type":{"def":{"variant":{"variants":[{"fields":[{"type":0}],"index":0,"name":"Ok"},{"fields":[{"type":8}],"index":1,"name":"Err"}]}},"params":[{"name":"T","type":0},{"name":"E","type":8}],"path":["Result"]}},{"id":10,"type":{"def":{"variant":{"variants":[{"fields":[{"type":1}],"index":0,"name":"Ok"},{"fields":[{"type":8}],"index":1,"name":"Err"}]}},"params":[{"name":"T","type":1},{"name":"E","type":8}],"path":["Result"]}},{"id":11,"type":{"def":{"variant":{"variants":[{"index":0,"name":"None"},{"fields":[{"type":1}],"index":1,"name":"Some"}]}},"params":[{"name":"T","type":1}],"path":["Option"]}},{"id":12,"type":{"def":{"sequence":{"type":11}}}},{"id":13,"type":{"def":{"primitive":"u128"}}},{"id":14,"type":{"def":{"composite":{"fields":[{"type":2,"typeName":"[u8; 32]"}]}},"path":["ink_primitives","types","Hash"]}},{"id":15,"type":{"def":{"primitive":"u64"}}},{"id":16,"type":{"def":{"primitive":"u32"}}},{"id":17,"type":{"def":{"variant":{}},"path":["ink_env","types","NoChainExtension"]}}],"version":"4"} \ No newline at end of file diff --git a/contracts/deployments/chatroom/chatroom.json b/contracts/deployments/chatroom/chatroom.json new file mode 100644 index 0000000..a4fc2a3 --- /dev/null +++ b/contracts/deployments/chatroom/chatroom.json @@ -0,0 +1,542 @@ +{ + "source": { + "hash": "0xe3c0527753972c39e42572e19da5b98d6b3c65686b6d500dbeb82ca09e441579", + "language": "ink! 4.3.0", + "compiler": "rustc 1.71.0", + "build_info": { + "build_mode": "Debug", + "cargo_contract_version": "3.0.1", + "rust_toolchain": "stable-x86_64-unknown-linux-gnu", + "wasm_opt_settings": { + "keep_debug_symbols": false, + "optimization_passes": "Z" + } + } + }, + "contract": { + "name": "chatroom", + "version": "0.1.0", + "authors": [ + "od41 <[your_email]>" + ] + }, + "image": null, + "spec": { + "constructors": [ + { + "args": [], + "default": false, + "docs": [ + "Constructor that initializes the `bool` value to the given `init_value`." + ], + "label": "new", + "payable": false, + "returnType": { + "displayName": [ + "ink_primitives", + "ConstructorResult" + ], + "type": 6 + }, + "selector": "0x9bae9d5e" + } + ], + "docs": [], + "environment": { + "accountId": { + "displayName": [ + "AccountId" + ], + "type": 1 + }, + "balance": { + "displayName": [ + "Balance" + ], + "type": 13 + }, + "blockNumber": { + "displayName": [ + "BlockNumber" + ], + "type": 16 + }, + "chainExtension": { + "displayName": [ + "ChainExtension" + ], + "type": 17 + }, + "hash": { + "displayName": [ + "Hash" + ], + "type": 14 + }, + "maxEventTopics": 4, + "timestamp": { + "displayName": [ + "Timestamp" + ], + "type": 15 + } + }, + "events": [ + { + "args": [ + { + "docs": [], + "indexed": false, + "label": "id", + "type": { + "displayName": [ + "String" + ], + "type": 0 + } + }, + { + "docs": [], + "indexed": false, + "label": "owner", + "type": { + "displayName": [ + "Option" + ], + "type": 11 + } + }, + { + "docs": [], + "indexed": false, + "label": "members", + "type": { + "displayName": [ + "Vec" + ], + "type": 12 + } + } + ], + "docs": [], + "label": "ChatroomCreated" + } + ], + "lang_error": { + "displayName": [ + "ink", + "LangError" + ], + "type": 8 + }, + "messages": [ + { + "args": [], + "default": false, + "docs": [ + " A message that can be called on instantiated contracts.", + " This one flips the value of the stored `bool` from `true`", + " to `false` and vice versa." + ], + "label": "getId", + "mutates": true, + "payable": false, + "returnType": { + "displayName": [ + "ink", + "MessageResult" + ], + "type": 9 + }, + "selector": "0xd15f659a" + }, + { + "args": [], + "default": false, + "docs": [], + "label": "getOwner", + "mutates": true, + "payable": false, + "returnType": { + "displayName": [ + "ink", + "MessageResult" + ], + "type": 10 + }, + "selector": "0xa6077113" + } + ] + }, + "storage": { + "root": { + "layout": { + "struct": { + "fields": [ + { + "layout": { + "leaf": { + "key": "0x00000000", + "ty": 0 + } + }, + "name": "id" + }, + { + "layout": { + "leaf": { + "key": "0x00000000", + "ty": 1 + } + }, + "name": "owner" + }, + { + "layout": { + "leaf": { + "key": "0x00000000", + "ty": 4 + } + }, + "name": "messages" + }, + { + "layout": { + "leaf": { + "key": "0x00000000", + "ty": 5 + } + }, + "name": "members" + } + ], + "name": "Chatroom" + } + }, + "root_key": "0x00000000" + } + }, + "types": [ + { + "id": 0, + "type": { + "def": { + "primitive": "str" + } + } + }, + { + "id": 1, + "type": { + "def": { + "composite": { + "fields": [ + { + "type": 2, + "typeName": "[u8; 32]" + } + ] + } + }, + "path": [ + "ink_primitives", + "types", + "AccountId" + ] + } + }, + { + "id": 2, + "type": { + "def": { + "array": { + "len": 32, + "type": 3 + } + } + } + }, + { + "id": 3, + "type": { + "def": { + "primitive": "u8" + } + } + }, + { + "id": 4, + "type": { + "def": { + "sequence": { + "type": 0 + } + } + } + }, + { + "id": 5, + "type": { + "def": { + "sequence": { + "type": 1 + } + } + } + }, + { + "id": 6, + "type": { + "def": { + "variant": { + "variants": [ + { + "fields": [ + { + "type": 7 + } + ], + "index": 0, + "name": "Ok" + }, + { + "fields": [ + { + "type": 8 + } + ], + "index": 1, + "name": "Err" + } + ] + } + }, + "params": [ + { + "name": "T", + "type": 7 + }, + { + "name": "E", + "type": 8 + } + ], + "path": [ + "Result" + ] + } + }, + { + "id": 7, + "type": { + "def": { + "tuple": [] + } + } + }, + { + "id": 8, + "type": { + "def": { + "variant": { + "variants": [ + { + "index": 1, + "name": "CouldNotReadInput" + } + ] + } + }, + "path": [ + "ink_primitives", + "LangError" + ] + } + }, + { + "id": 9, + "type": { + "def": { + "variant": { + "variants": [ + { + "fields": [ + { + "type": 0 + } + ], + "index": 0, + "name": "Ok" + }, + { + "fields": [ + { + "type": 8 + } + ], + "index": 1, + "name": "Err" + } + ] + } + }, + "params": [ + { + "name": "T", + "type": 0 + }, + { + "name": "E", + "type": 8 + } + ], + "path": [ + "Result" + ] + } + }, + { + "id": 10, + "type": { + "def": { + "variant": { + "variants": [ + { + "fields": [ + { + "type": 1 + } + ], + "index": 0, + "name": "Ok" + }, + { + "fields": [ + { + "type": 8 + } + ], + "index": 1, + "name": "Err" + } + ] + } + }, + "params": [ + { + "name": "T", + "type": 1 + }, + { + "name": "E", + "type": 8 + } + ], + "path": [ + "Result" + ] + } + }, + { + "id": 11, + "type": { + "def": { + "variant": { + "variants": [ + { + "index": 0, + "name": "None" + }, + { + "fields": [ + { + "type": 1 + } + ], + "index": 1, + "name": "Some" + } + ] + } + }, + "params": [ + { + "name": "T", + "type": 1 + } + ], + "path": [ + "Option" + ] + } + }, + { + "id": 12, + "type": { + "def": { + "sequence": { + "type": 11 + } + } + } + }, + { + "id": 13, + "type": { + "def": { + "primitive": "u128" + } + } + }, + { + "id": 14, + "type": { + "def": { + "composite": { + "fields": [ + { + "type": 2, + "typeName": "[u8; 32]" + } + ] + } + }, + "path": [ + "ink_primitives", + "types", + "Hash" + ] + } + }, + { + "id": 15, + "type": { + "def": { + "primitive": "u64" + } + } + }, + { + "id": 16, + "type": { + "def": { + "primitive": "u32" + } + } + }, + { + "id": 17, + "type": { + "def": { + "variant": {} + }, + "path": [ + "ink_env", + "types", + "NoChainExtension" + ] + } + } + ], + "version": "4" +} \ No newline at end of file diff --git a/contracts/deployments/chatroom/chatroom.wasm b/contracts/deployments/chatroom/chatroom.wasm new file mode 100644 index 0000000..dbf60e0 Binary files /dev/null and b/contracts/deployments/chatroom/chatroom.wasm differ diff --git a/contracts/typed-contracts/build-extrinsic/chatroom.ts b/contracts/typed-contracts/build-extrinsic/chatroom.ts new file mode 100644 index 0000000..98ee3be --- /dev/null +++ b/contracts/typed-contracts/build-extrinsic/chatroom.ts @@ -0,0 +1,43 @@ +/* This file is auto-generated */ + +import type { ContractPromise } from '@polkadot/api-contract'; +import type { GasLimit, GasLimitAndRequiredValue } from '@727-ventures/typechain-types'; +import { buildSubmittableExtrinsic } from '@727-ventures/typechain-types'; +import type * as ArgumentTypes from '../types-arguments/chatroom'; +import type BN from 'bn.js'; +import type { ApiPromise } from '@polkadot/api'; + + + +export default class Methods { + readonly __nativeContract : ContractPromise; + readonly __apiPromise: ApiPromise; + + constructor( + nativeContract : ContractPromise, + apiPromise: ApiPromise, + ) { + this.__nativeContract = nativeContract; + this.__apiPromise = apiPromise; + } + /** + * getId + * + */ + "getId" ( + __options: GasLimit, + ){ + return buildSubmittableExtrinsic( this.__apiPromise, this.__nativeContract, "getId", [], __options); + } + + /** + * getOwner + * + */ + "getOwner" ( + __options: GasLimit, + ){ + return buildSubmittableExtrinsic( this.__apiPromise, this.__nativeContract, "getOwner", [], __options); + } + +} \ No newline at end of file diff --git a/contracts/typed-contracts/constructors/chatroom.ts b/contracts/typed-contracts/constructors/chatroom.ts new file mode 100644 index 0000000..905756a --- /dev/null +++ b/contracts/typed-contracts/constructors/chatroom.ts @@ -0,0 +1,51 @@ +import {CodePromise} from "@polkadot/api-contract"; +import type {KeyringPair} from "@polkadot/keyring/types"; +import type {ApiPromise} from "@polkadot/api"; +import {_genValidGasLimitAndValue, _signAndSend, SignAndSendSuccessResponse} from "@727-ventures/typechain-types"; +import type {ConstructorOptions} from "@727-ventures/typechain-types"; +import type {WeightV2} from "@polkadot/types/interfaces"; +import type * as ArgumentTypes from '../types-arguments/chatroom'; +import { ContractFile } from '../contract-info/chatroom'; +import type BN from 'bn.js'; + +export default class Constructors { + readonly nativeAPI: ApiPromise; + readonly signer: KeyringPair; + + constructor( + nativeAPI: ApiPromise, + signer: KeyringPair, + ) { + this.nativeAPI = nativeAPI; + this.signer = signer; + } + + /** + * new + * + */ + async "new" ( + __options ? : ConstructorOptions, + ) { + const __contract = JSON.parse(ContractFile); + const code = new CodePromise(this.nativeAPI, __contract, __contract.source.wasm); + const gasLimit = (await _genValidGasLimitAndValue(this.nativeAPI, __options)).gasLimit as WeightV2; + + const storageDepositLimit = __options?.storageDepositLimit; + const tx = code.tx["new"]!({ gasLimit, storageDepositLimit, value: __options?.value }, ); + let response; + + try { + response = await _signAndSend(this.nativeAPI.registry, tx, this.signer, (event: any) => event); + } + catch (error) { + console.log(error); + } + + return { + result: response as SignAndSendSuccessResponse, + // @ts-ignore + address: (response as SignAndSendSuccessResponse)!.result!.contract.address.toString(), + }; + } +} \ No newline at end of file diff --git a/contracts/typed-contracts/contract-info/chatroom.ts b/contracts/typed-contracts/contract-info/chatroom.ts new file mode 100644 index 0000000..7404a63 --- /dev/null +++ b/contracts/typed-contracts/contract-info/chatroom.ts @@ -0,0 +1,2 @@ +export const ContractAbi = `{"source":{"hash":"0xe3c0527753972c39e42572e19da5b98d6b3c65686b6d500dbeb82ca09e441579","language":"ink! 4.3.0","compiler":"rustc 1.71.0","build_info":{"build_mode":"Debug","cargo_contract_version":"3.0.1","rust_toolchain":"stable-x86_64-unknown-linux-gnu","wasm_opt_settings":{"keep_debug_symbols":false,"optimization_passes":"Z"}}},"contract":{"name":"chatroom","version":"0.1.0","authors":["od41 <[your_email]>"]},"image":null,"spec":{"constructors":[{"args":[],"default":false,"docs":["Constructor that initializes the \`bool\` value to the given \`init_value\`."],"label":"new","payable":false,"returnType":{"displayName":["ink_primitives","ConstructorResult"],"type":6},"selector":"0x9bae9d5e"}],"docs":[],"environment":{"accountId":{"displayName":["AccountId"],"type":1},"balance":{"displayName":["Balance"],"type":13},"blockNumber":{"displayName":["BlockNumber"],"type":16},"chainExtension":{"displayName":["ChainExtension"],"type":17},"hash":{"displayName":["Hash"],"type":14},"maxEventTopics":4,"timestamp":{"displayName":["Timestamp"],"type":15}},"events":[{"args":[{"docs":[],"indexed":false,"label":"id","type":{"displayName":["String"],"type":0}},{"docs":[],"indexed":false,"label":"owner","type":{"displayName":["Option"],"type":11}},{"docs":[],"indexed":false,"label":"members","type":{"displayName":["Vec"],"type":12}}],"docs":[],"label":"ChatroomCreated"}],"lang_error":{"displayName":["ink","LangError"],"type":8},"messages":[{"args":[],"default":false,"docs":[" A message that can be called on instantiated contracts."," This one flips the value of the stored \`bool\` from \`true\`"," to \`false\` and vice versa."],"label":"getId","mutates":true,"payable":false,"returnType":{"displayName":["ink","MessageResult"],"type":9},"selector":"0xd15f659a"},{"args":[],"default":false,"docs":[],"label":"getOwner","mutates":true,"payable":false,"returnType":{"displayName":["ink","MessageResult"],"type":10},"selector":"0xa6077113"}]},"storage":{"root":{"layout":{"struct":{"fields":[{"layout":{"leaf":{"key":"0x00000000","ty":0}},"name":"id"},{"layout":{"leaf":{"key":"0x00000000","ty":1}},"name":"owner"},{"layout":{"leaf":{"key":"0x00000000","ty":4}},"name":"messages"},{"layout":{"leaf":{"key":"0x00000000","ty":5}},"name":"members"}],"name":"Chatroom"}},"root_key":"0x00000000"}},"types":[{"id":0,"type":{"def":{"primitive":"str"}}},{"id":1,"type":{"def":{"composite":{"fields":[{"type":2,"typeName":"[u8; 32]"}]}},"path":["ink_primitives","types","AccountId"]}},{"id":2,"type":{"def":{"array":{"len":32,"type":3}}}},{"id":3,"type":{"def":{"primitive":"u8"}}},{"id":4,"type":{"def":{"sequence":{"type":0}}}},{"id":5,"type":{"def":{"sequence":{"type":1}}}},{"id":6,"type":{"def":{"variant":{"variants":[{"fields":[{"type":7}],"index":0,"name":"Ok"},{"fields":[{"type":8}],"index":1,"name":"Err"}]}},"params":[{"name":"T","type":7},{"name":"E","type":8}],"path":["Result"]}},{"id":7,"type":{"def":{"tuple":[]}}},{"id":8,"type":{"def":{"variant":{"variants":[{"index":1,"name":"CouldNotReadInput"}]}},"path":["ink_primitives","LangError"]}},{"id":9,"type":{"def":{"variant":{"variants":[{"fields":[{"type":0}],"index":0,"name":"Ok"},{"fields":[{"type":8}],"index":1,"name":"Err"}]}},"params":[{"name":"T","type":0},{"name":"E","type":8}],"path":["Result"]}},{"id":10,"type":{"def":{"variant":{"variants":[{"fields":[{"type":1}],"index":0,"name":"Ok"},{"fields":[{"type":8}],"index":1,"name":"Err"}]}},"params":[{"name":"T","type":1},{"name":"E","type":8}],"path":["Result"]}},{"id":11,"type":{"def":{"variant":{"variants":[{"index":0,"name":"None"},{"fields":[{"type":1}],"index":1,"name":"Some"}]}},"params":[{"name":"T","type":1}],"path":["Option"]}},{"id":12,"type":{"def":{"sequence":{"type":11}}}},{"id":13,"type":{"def":{"primitive":"u128"}}},{"id":14,"type":{"def":{"composite":{"fields":[{"type":2,"typeName":"[u8; 32]"}]}},"path":["ink_primitives","types","Hash"]}},{"id":15,"type":{"def":{"primitive":"u64"}}},{"id":16,"type":{"def":{"primitive":"u32"}}},{"id":17,"type":{"def":{"variant":{}},"path":["ink_env","types","NoChainExtension"]}}],"version":"4"}`; +export const ContractFile = `{"source":{"hash":"0xe3c0527753972c39e42572e19da5b98d6b3c65686b6d500dbeb82ca09e441579","language":"ink! 4.3.0","compiler":"rustc 1.71.0","wasm":"0x0061736d0100000001450c60037f7f7f017f60027f7f017f60027f7f0060037f7f7f0060047f7f7f7f0060017f0060047f7f7f7f017f60000060057f7f7f7f7f0060017f017e6000017f60017f017f02990108057365616c310b6765745f73746f726167650006057365616c301176616c75655f7472616e736665727265640002057365616c3005696e7075740002057365616c300663616c6c65720002057365616c300d64656275675f6d6573736167650001057365616c320b7365745f73746f726167650006057365616c300b7365616c5f72657475726e000303656e76066d656d6f727902010210034c4b000200000202030202020a0305020402030b030501020302020205070401010203070503020707080100000301010403040102010509010108060406080204010103000004010101010104040501700112120608017f01418080040b0711020463616c6c002c066465706c6f79002d0917010041010b111b4647384f3a4d4e135013313334134c3c0aa96b4b2b01017f037f2002200346047f200005200020036a200120036a2d00003a0000200341016a21030c010b0b0b910201037f230041106b22022400200241003a000041012103024020012002410110090d00024002400240024020022d0000220441037141016b0e03000102030b200220043a0005200241013a000420022001360200200241003b010c20022002410c6a4102100a0d0320022f010c220441ff014d0d0320044102762101410021030c030b200220043a0005200241013a0004200220013602002002410036020c20022002410c6a4104100a0d02200228020c220341027621012003418080044921030c020b200441034b0d012002410036020020012002410410090d01200228020022014180808080044921030c010b20044102762101410021030b2000200136020420002003360200200241106a24000b3d01027f2000280204220320024922044504402001200220002802002201200241d8a20410432000200320026b3602042000200120026a3602000b20040b3d01017f20002d0004200041003a000404402001200041056a2d00003a00002000280200200141016a200241016b10090f0b20002802002001200210090b8a0101047f230041206b22022400200241186a22034200370300200241106a22044200370300200241086a22054200370300200242003703002000027f200120024120100945044020002002290300370001200041196a2003290300370000200041116a2004290300370000200041096a200529030037000041000c010b41010b3a0000200241206a24000b0a00200120004120100d0b5c01037f02402000280208220420026a220320044f04402003200028020422054b0d01200028020020046a200320046b20012002418ca0041043200020033602080f0b41b09e04411c41ec9f041017000b2003200541fc9f041019000b7401017f230041106b2202240002402001413f4d044020002001410274100f0c010b200141ffff004d0440200220014102744101723b010e20002002410e6a4102100d0c010b200141ffffffff034d04402001410274410272200010100c010b20004103100f2001200010100b200241106a24000b970101027f20002802082202200028020422034904402000200241016a360208200028020020026a20013a00000f0b230041306b220024002000200336020420002002360200200041146a42023702002000412c6a41043602002000410236020c200041c08c04360208200041043602242000200041206a360210200020003602282000200041046a360220200041086a419ca004101c000b2601017f230041106b220224002002200036020c20012002410c6a4104100d200241106a24000b5502027f027e230041206b22002400200041106a22014200370300200042003703082000411036021c200041086a2000411c6a10012001290300210220002903082103200041206a2400410541042002200384501b0b4601027f230041106b22032400200341086a20021039200328020c210420032802082001200210072101200020023602082000200436020420002001360200200341106a24000b0300010b0c00200020014104410c10510b5101017e0240200341808080807820026b20016e4b0440410021020c010b2001ad2003ad7e22044220885004402004a721010c010b41a08004412141c480041017000b20002001360204200020023602000b0c00200020014101412010510b4601017f230041206b220324002003410c6a420037020020034101360204200341ac9e043602082003200136021c200320003602182003200341186a36020020032002101c000b1b002000418180014f0440200041808001419883041019000b20000b6b01017f230041306b220324002003200136020420032000360200200341146a42023702002003412c6a41043602002003410236020c200341f89104360208200341043602242003200341206a3602102003200341046a36022820032003360220200341086a2002101c000b4801017f230041206b220124002001410c6a4201370200200141013602042001418c9c043602002001410136021c200120003602182001200141186a360208200141f88304101c000b860101017f230041306b22022400200241146a42013702002002410136020c2002418c9c0436020820024102360224200220002d0000410274220041f0a2046a28020036022c200220004184a3046a280200360228200141146a280200200141186a2802002002200241206a3602102002200241286a360220200241086a1049200241306a24000b3c01017f230041206b2202240020022000360214200241dc8b0436020c200241ac9e04360208200241013a001820022001360210200241086a103b000b100020022001100e200220002001100d0bc50201057f200028020822022000280204460440230041306b2203240002400240027f4100200241016a2202450d001a200028020422044100480d01200341086a410420044101742205200220022005491b2202200241044d1b22051014200328020c2102200328020821060240200404402003410436022420032004410c6c360228200320002802003602200c010b200341003602240b200341106a20062002200341206a102320032802104504402003280214210220002005360204200020023602004181808080780c010b200341186a280200210220032802140b20021020200341306a24000c010b41a08004412141d486041017000b200028020821020b20002802002002410c6c6a22032001290200370200200341086a200141086a280200360200200241016a220145044041808004411c41e08a041017000b200020013602080be50201057f200028020822032000280204460440230041306b2202240002400240027f4100200341016a2203450d001a200028020422044100480d01200241086a410420044101742205200320032005491b2203200341044d1b22051016200228020c2103200228020821060240200404402002410136022420022004410574360228200220002802003602200c010b200241003602240b200241106a20062003200241206a102320022802104504402002280214210320002005360204200020033602004181808080780c010b200241186a280200210320022802140b20031020200241306a24000c010b41a08004412141d486041017000b200028020821030b200028020020034105746a22022001290000370000200241086a200141086a290000370000200241106a200141106a290000370000200241186a200141186a290000370000200341016a220145044041808004411c41e08a041017000b200020013602080b1f00024020004181808080784704402000450d0120011021000b0f0b1022000b860101017f230041306b220124002001200036020c2001411c6a420137020020014102360214200141a088043602102001410436022c2001200141286a36021820012001410c6a360228230041206b220024002000200141106a360214200041dc8b0436020c200041ac9e04360208200041003a0018200041b08804360210200041086a103b000b3c01017f230041206b22002400200041146a42003702002000410136020c200041f88604360208200041ac9e04360210200041086a41808704101c000bea0101037f230041106b220424002000027f024020010440027f0240200241004e044020032802040d0120042001200210362004280200210320042802040c020b200041003602040c030b200341086a2802002205450440200441086a200120024100103720042802082103200428020c0c010b2003280200210602402001200210252203450440410021030c010b20032006200510071a0b20020b21052003044020002003360204200041086a200536020041000c030b20002001360204200041086a20023602000c010b20004100360204200041086a20023602000b41010b360200200441106a24000b18002001047f41a2a3052d00001a2000200110250520000b0bac0101027f02402001200020016a41016b410020006b7122004d044002404198a304280200220120006a22032001490d00419ca3042802002003490440200041ffff036a22022000490d0320024110764000220141ffff034b0d032001411074220120024180807c716a22032001490d0341002102419ca3042003360200200020016a22032001490d010b4198a3042003360200200121020b20020f0b41909e04411c41809e041017000b41000ba60502087f017e230041106b22062400200641086a200110080240024020062802080d00200628020c220220012802044b0d0020062002410110272006350204210a200120062802002203200210090d00024002402002450d00200241076b22014100200120024d1b2108200341036a417c7120036b2109410021010340024002400240024002400240200120036a2d00002205c02207410048044002400240200541c097046a2d000041026b0e030301000b0b200141016a220420024f0d0a200320046a2c000021040240024002400240200541f0016b0e050100000002000b2007410f6a41ff017141024b0d0d20044140480d020c0d0b200441f0006a41ff01714130490d010c0c0b2004418f7f4a0d0b0b200141026a220520024f0d0a200320056a2c000041bf7f4a0d0a200141036a220120024f0d0a200120036a2c000041bf7f4c0d060c0a0b200141016a220420024f0d09200320046a2c00002104024002400240200541e001470440200541ed01460d012007411f6a41ff0171410c490d022007417e71416e470d0d20044140480d030c0d0b200441607141a07f460d020c0c0b200441a07f480d010c0b0b200441bf7f4a0d0a0b200141026a220120024f0d09200120036a2c000041bf7f4c0d050c090b200920016b4103710d01200120084f0d020340200120036a220541046a280200200528020072418081828478710d03200141086a22012008490d000b0c020b200141016a22012002490d020c070b200141016a21010c030b200120024f0d020340200120036a2c00004100480d032002200141016a2201470d000b0c040b200120036a2c000041bf7f4a0d040b200141016a21010b20012002490d000b0b20002002ad422086200a84370204200020033602000c020b200041003602000c010b200041003602000b200641106a24000b7101027f230041106b2203240002402001450440410121020c010b200141004e22040440027f2002450440200341086a20042001103620032802080c010b2003200420014101103720032802000b22020d0120011021000b1022000b2000200136020420002002360200200341106a24000b3701017f230041106b22002400200042808001370204200041a0a30436020020004101100f20004101100f410120002802081018102b000bbe0202057f017e230041306b2201240020014100360218200142808001370224200141a0a3043602204100200141206a2203101020012001290320370310200141086a200141106a2001280228102a200128020c210420012802082001290310210620014100360228200120063703202000280200200041086a2802002003101d200041246a2003100c200028020c21022003200041146a2802002203100e2003044020022003410c6c6a210303402002280200200241086a280200200141206a101d2002410c6a22022003470d000b0b20002802182102200141206a200041206a2802002200100e200004402000410574210003402002200141206a100c200241206a2102200041206b22000d000b0b200120012903203703102001200141106a2001280228102a20042001280200200128020410051a200141306a24000b4501017f2002200128020422034b044041cc9e04412341aca0041017000b2001200320026b36020420012001280200220120026a36020020002002360204200020013602000b0d00200041a0a30420011006000ba10d02087f077e230041f0016b220024000240024002400240024002400240101141ff0171410546044020004180800136024841a0a304200041c8006a100220002802482201418180014f0d012000200136024c200041a0a3043602482000410036029001200041c8006a20004190016a410410090d062000280290012201411876210320014110762102200141087621050240200141ff0171220141a601470440200141d10147200541ff017141df004772200241ff017141e50047720d08410121072003419a01460d010c080b200541ff0171410747200241ff017141f10047722003411347720d070b200041003602c00120004280800137024c200041a0a3043602484100200041c8006a22021010200020002903483703b801200041206a200041b8016a2000280250102a20002802242105200028022020002802b8012101200020002802bc01220336024820052001200210002105200320002802482202490d020240024002400240024020050e0400020201020b200020023602cc01200020013602c801200041c8006a200041c8016a102620002802482205450d02200029024c2108200041c8006a200041c8016a100b20002d00480d02200041e8016a200041e1006a290000370300200041e0016a200041d9006a290000370300200041d8016a200041d1006a290000370300200020002900493703d001200041186a200041c8016a100820002802180d024104210320002802cc01410c6e2202200028021c2201200120024b1b22020440200041106a2002101420002802102203450d09200028021422044100480d092003200410242203450d080b200041003602302000200236022c2000200336022820010440034020004190016a200041c8016a10262000280290012203450d04200020002902940137024c20002003360248200041286a200041c8006a101e200141016b22010d000b200028022821030b2003450d02200029022c2109200041086a200041c8016a100820002802080d024101210120002802cc014105762204200028020c2202200220044b1b2204044020002004101620002802002201450d09200028020422064100480d092001200610242201450d0a0b200041003602302000200436022c2000200136022820020440200041c8006a41017221010340200041c8006a200041c8016a100b20002d00480d04200041a8016a200141186a290000370300200041a0016a200141106a29000037030020004198016a200141086a2900003703002000200129000037039001200041286a20004190016a101f200241016b22020d000b200028022821010b2001450d02200029022c210a200041406b2202200041e8016a290300370300200041386a2204200041e0016a290300370300200041306a2206200041d8016a290300370300200020002903d00137032820070d03200041a9016a2002290300220b370000200041a1016a2004290300220c37000020004199016a2006290300220d37000020002000290328220e37009101200041f4006a200d370200200041fc006a200c37020020004184016a200b3702002000200a3702642000200136026020002009370358200020033602542000200837024c200020053602482000200e37026c200041c8006a1029200041003a009001230041106b22012400200142808001370204200141a0a304360200024020004190016a22002d000045044020014100100f200041016a2001100c0c010b20014101100f20014101100f0b410020012802081018102b000b200041d4006a42003702002000410136024c200041d084043602480c0a0b200041d4006a42003702002000410136024c200041c48304360248200041ac9e04360250200041c8006a41cc8304101c000b200041d4006a42003702002000410136024c200041b084043602480c080b20004190016a20052008422088a71012200041f4006a2006290300370200200041fc006a200429030037020020004184016a20022903003702002000200a3702642000200136026020002009370358200020033602542000200837024c200020053602482000200029032837026c200041c8006a102920002802900121012000280298012103230041106b22002400200042808001370204200041a0a30436020002402001044020004100100f200120032000101d0c010b20004101100f20004101100f0b410020002802081018102b000b200041043a0048200041c8006a101a000b20014180800141cc81041019000b2002200341cc81041019000b20041021000b1022000b20061021000b1028000b200041ac9e04360250200041c8006a41f88304101c000bfe0402087f027e230041d0016b2200240002400240101141ff01712201410546044020004180800136024841a0a304200041c8006a100220002802482201418180014f0d012000200136024c200041a0a304360248200041003602000240200041c8006a2000410410090d002000280200419bddf6f405470d0020004180800136024841a0a304200041c8006a22011003200041808001360204200041a0a30436020020012000100b20002d00480d03200041a7016a2202200041e1006a290000370000200041a0016a2203200041da006a29010037030020004198016a2205200041d2006a29010022083703002000200029014a22093703900120002d00492104200041b8016a22064100360200200042013703b001200041d1006a2008370000200041d9006a2003290300370000200041e0006a2002290000370000200020043a004820002009370049200041b0016a200041c8006a2201101f200041c8016a22074100360200200042043703c001200141d8840441171012200041c0016a2001101e200041ef840441011012200041146a2007280200360200200041256a2000290390013700002000412d6a2005290300370000200041356a20032903003700002000413c6a2002290000370000200041206a2006280200360200200020043a0024200020002903c00137020c200020002903b0013703182001200041c40010071a20011029230041106b22002400200042808001370204200041a0a30436020020004100100f20004100100f410020002802081018102b000b1028000b200020013a0048200041c8006a101a000b20014180800141cc81041019000b200041003a004841dc810441c100200041c8006a41d4800441888304102e000b7c01017f230041406a220524002005200136020c200520003602082005200336021420052002360210200541246a42023702002005413c6a41033602002005410236021c200541d48c04360218200541023602342005200541306a3602202005200541106a3602382005200541086a360230200541186a2004101c000b5501017f230041206b2202240020022000360204200241186a200141106a290200370300200241106a200141086a29020037030020022001290200370308200241046a418c8504200241086a1030200241206a24000bf40301057f230041406a22032400200341306a2001360200200341033a003820034120360228200341003602342003200036022c2003410036022020034100360218027f02400240200228021022014504402002410c6a28020022004103742105200041ffffffff017121072002280208210441002101034020012005460d02200228020020016a220041046a28020022060440200328022c20002802002006200328023028020c1100000d040b200141086a2101200428020020042802042106200441086a2104200341186a2006110100450d000b0c020b200241146a28020022074105742100200741ffffff3f71210703402000450d01200228020020046a220541046a28020022060440200328022c20052802002006200328023028020c1100000d030b20032001280210360228200320012d001c3a003820032001280218360234200341106a20022802082205200141086a104820032003290310370318200341086a20052001104820032003290308370320200441086a2104200041206b210020012802142106200141206a2101200520064103746a2205280200200341186a2005280204110100450d000b0c010b200228020420074b0440200328022c200228020020074103746a22002802002000280204200328023028020c1100000d010b41000c010b41010b200341406b24000b0f00200028020020012002103241000b7701027f230041106b2204240020022000280204200028020822036b4b0440200441086a20002003200210352004280208200428020c1020200028020821030b200028020020036a2001200210071a2003200220036a22014b044041f08404411c41f08a041017000b20002001360208200441106a24000bdd0201037f230041106b220224000240024002400240200028020022002002410c6a027f0240024020014180014f04402002410036020c2001418010490d012001418080044f0d0220022001413f71418001723a000e20022001410c7641e001723a000c20022001410676413f71418001723a000d41030c030b200028020822032000280204460d030c040b20022001413f71418001723a000d2002200141067641c001723a000c41020c010b20022001413f71418001723a000f20022001410676413f71418001723a000e20022001410c76413f71418001723a000d2002200141127641077141f001723a000c41040b10320c020b230041106b22042400200441086a20002003410110352004280208200428020c1020200441106a2400200028020821030b200028020020036a20013a0000200341016a2201450d01200020013602080b200241106a240041000f0b41f08404411c41e08a041017000b4a01017f230041206b220224002000280200200241186a200141106a290200370300200241106a200141086a29020037030020022001290200370308200241086a102f200241206a24000be10101027f230041206b220424000240027f4100200220036a22032002490d001a200128020422024100480d01410820024101742205200320032005491b2203200341084d1b2203417f73411f7621050240200204402004200236021820044101360214200420012802003602100c010b200441003602140b200420052003200441106a102320042802004504402004280204210220012003360204200120023602004181808080780c010b200441086a280200210320042802040b21052000200336020420002005360200200441206a24000f0b41b08504412141d486041017000b3901017f230041106b22032400200341086a2001200241001037200328020c21012000200328020836020020002001360204200341106a24000b2b0020020440200345044041a2a3052d00001a0b20012002102521010b20002002360204200020013602000be906020b7f027e230041406a2203240020002802002202ad210d0240024002400240024002400240024020024190ce004f044041272100200d210e0240034020004104490d01200341196a20006a220241046b200e200e4290ce0080220d4290ce007e7da7220441ffff037141e4006e220641017441da8d046a2f00003b0000200241026b2004200641e4006c6b41ffff037141017441da8d046a2f00003b0000200041046b2100200e42ffc1d72f56200d210e0d000b200da7220241e3004d0d0320004102490d090c020b0c080b41272100200241e3004b0d002002410a490d040c020b200041026b2200200341196a6a200da72202200241ffff037141e4006e220241e4006c6b41ffff037141017441da8d046a2f00003b00000b2002410a490d01200041024f0d000c050b200041026b2200200341196a6a200241017441da8d046a2f00003b00000c020b2000450d030b200041016b2200200341196a6a200241306a3a00000b200041274b0d01412820006b412720006b2206200128021c220541017122071b2102410021042005410471044041ac9e042104200241ac9e0441ac9e04103d20026a22024b0d010b412b418080c40020071b2107200341196a20006a21080240200128020045044041012100200141146a2802002202200141186a28020022012007200410400d01200220082006200128020c11000021000c010b02402002200128020422094904402005410871450d012001280210210b2001413036021020012d0020210c41012100200141013a0020200141146a2802002205200141186a280200220a2007200410400d02200341106a2001200920026b4101104120032802102202418080c400460d0220032802142104200520082006200a28020c1100000d02200220042005200a10420d022001200c3a00202001200b360210410021000c020b41012100200141146a2802002202200141186a28020022012007200410400d01200220082006200128020c11000021000c010b41012100200341086a2001200920026b4101104120032802082205418080c400460d00200328020c2109200141146a2802002202200141186a28020022012007200410400d00200220082006200128020c1100000d002005200920022001104221000b200341406b240020000f0b41808b04411c419090041017000b41a08b04412141fc9b041017000b3701017f230041106b22022400200241086a200141001027200228020c21012000200228020836020020002001360204200241106a24000b0e0020002802001a03400c000b000b900201027f230041406a220124002001200036020c2001410536021420012001410c6a360210410021004104210202400240024002400240034020002000200241f09e046a2802006a22004b0d01200241086a22024114470d000b200120004101744100200041104e1b10392001410036022020012001290300370318200142013702342001410236022c200141f09e043602282001200141106a360230200141186a200141286a102f0d012001280218200128022041a0a3052d000045044041a1a3052d00004101710d050b10044109470d020c030b41f08404411c41ec9b041017000b41c088044133200141286a41d4850441e08904102e000b41a0a30541013a00000b41a1a30541013a00000b000b0d0042e7e1dbbcef938cbdd6000b8e04010a7f230041106b220224000240200120006b220141104f04402000200041036a417c71220620006b2200103e22042006200120006b2200417c716a2000410371103e6a220320044f0440200041027621050240024003402005450d0520022006200541c0012005200541c0014f1b41f89204103f200228020c21052002280208210620022002280200200228020422002000417c7141e09404103f200228020c210820022802082107024020022802042200450440410021000c010b2002280200220420004102746a21094100210003402004220a41106a21044100210102400340200020002001200a6a280200220b417f73410776200b410676724181828408716a22004d0440200141046a22014110470d010c020b0b41808b04411c41f094041017000b20042009470d000b0b20032003200041087641ff81fc0771200041ff81fc07716a418180046c4110766a22034b0d012008450d000b200841027421014100210003402000200020072802002204417f734107762004410676724181828408716a22004b0d02200741046a2107200141046b22010d000b20032003200041087641ff81fc0771200041ff81fc07716a418180046c4110766a22034d0d0441808b04411c41a095041017000b41808b04411c418095041017000b41808b04411c419095041017000b41808b04411c41d094041017000b20002001103e21030b200241106a240020030b4601017f200145044041000f0b024003402002200220002c000041bf7f4a6a22024b0d01200041016a2100200141016b22010d000b20020f0b41808b04411c41ec9b041017000b3e00200220034f044020002003360204200020013602002000410c6a200220036b3602002000200120034102746a3602080f0b41cc9e04412320041017000b39000240027f2002418080c40047044041012000200220012802101101000d011a0b20030d0141000b0f0b200020034100200128020c1100000bb40101027f20022105024002400240024020012d0020220441016b0e03020100030b200341ff01710d01410021040c020b200241016a2203044020034101762105200241017621040c020b41808b04411c41a090041017000b41002105200221040b200441016a2102200141186a2802002103200128021021042001280214210102400340200241016b2202450d01200120042003280210110100450d000b418080c40021040b20002005360204200020043602000b3201017f027f0340200120012004460d011a200441016a2104200220002003280210110100450d000b200441016b0b2001490b7b002001200346044020002002200110071a0f0b230041306b220024002000200336020420002001360200200041146a42023702002000412c6a41043602002000410336020c200041c89304360208200041043602242000200041206a360210200020003602282000200041046a360220200041086a2004101c000b8b0201067f02402000027f418080c400200128020022022001280204460d001a2001200241016a2205360200024020022d00002203c041004e0d002001200241026a220536020020022d0001413f7121042003411f712106200341df014d0440200641067420047221030c010b2001200241036a220536020020022d0002413f712004410674722107200341f00149044020072006410c747221030c010b2001200241046a2205360200418080c4002006411274418080f0007120022d0003413f71200741067472722203418080c400460d011a0b20012802082204200520026b6a22022004490d012001200236020820030b360204200020043602000f0b41808b04411c41a096041017000b2c00200120024d04402000200220016b3602042000200120036a3602000f0b41a08b04412141b097041017000bc90301067f230041306b22022400200028020421042000280200210302400240027f024020012802002205200128020822007204402000450d032001410c6a28020020024100360228200220033602202002200320046a36022441016a21000340200041016b22000440200241186a200241206a1044200228021c418080c400470d010c050b0b200241106a200241206a10442002280214418080c400460d03024020022802102200450d00200020044f044020002004460d010c030b200020036a2c00004140480d020b200241086a4100200020031045200228020c210620022802080c020b200128021420032004200141186a28020028020c11000021000c030b41000b21002006200420001b21042000200320001b21030b2005450440200128021420032004200141186a28020028020c11000021000c010b200128020422002003200320046a103d22054b044020022001200020056b410010414101210020022802002205418080c400460d0120022802042106200141146a280200220720032004200141186a280200220128020c1100000d012005200620072001104221000c010b200128021420032004200141186a28020028020c11000021000b200241306a240020000b140020002802002001200028020428020c1101000b5501027f0240027f02400240200228020041016b0e020103000b200241046a0c010b200120022802044103746a22012802044106470d0120012802000b2802002104410121030b20002004360204200020033602000b4901017f230041206b22032400200341186a200241106a290200370300200341106a200241086a2902003703002003200229020037030820002001200341086a1030200341206a24000bcc0701107f230041d0006b22032400200341003b014c200320023602482003410036024420034281808080a00137023c2003200236023820034100360234200320023602302003200136022c2003410a3602282000280204210c2000280200210d2000280208210e200341406b210f027f03400240024002400240024020032d004d450440200328022c210a027f02402003280238220b200328023022104b0d00200b20032802342202490d00200328023c2206450d052006200f6a41016b21110340200a200222076a210020112d000021050240024002400240027f0240024002400240200b20026b220441084f04402000200041036a417c712202460440200441086b2108410021020c030b200341206a20052000200220006b2202104b20032802204101470d01200328022421010c040b200341106a200520002004104b2003280214210120032802100c040b2002200441086b22084b0d010b200541818284086c21090340200020026a22012802002009732212417f73201241818284086b71200141046a2802002009732201417f73200141818284086b7172418081828478710d01200241086a220220084d0d000b0b200220044b0d02200341186a2005200020026a200420026b104b410020032802184101470d011a2002200328021c6a220120024f0d0041808b04411c41b491041017000b41010b22004101460440200141016a2202450d0202402007200220076a22024d04402003200236023420022006490d06200220104d0d010c060b41808b04411c41d49a041017000b200641054f0d03027f200a200220066b6a2105200f210720062104034041002004450d011a200441016b210420072d0000210820052d00002109200541016a2105200741016a210720082009460d000b200920086b0b0d04200341086a20032802442002200a104520032002360244200328020c210020032802080c070b2003200b3602340c050b41a08b04412141a491041017000b41808b04411c41c49a041017000b2006410441e49a041019000b2002200b4d0d000b0b200341013a004d024020032d004c044020032802482101200328024421020c010b2003280248220120032802442202490d04410020012002460d011a0b200320022001200a10452003280204210020032802000b22020d010b41000c060b200e2d0000450d02200d41e48c044104200c28020c110000450d020c030b41a08b04412141b096041017000b41a08b04412141b49a041017000b200e2000047f200020026a41016b2d0000410a460541000b22013a0000200d20022000200c28020c110000450d010b0b41010b200341d0006a24000b5701027f024002402003450440410021030c010b200141ff017121054101210103402005200220046a2d0000460440200421030c030b2003200441016a2204470d000b0b410021010b20002003360204200020013602000b1b00200128021441e8a2044105200141186a28020028020c1100000b16002001280214200141186a280200200028020010300b0b002000280200200110460bf50201047f230041406a2202240020002802002103410121000240200141146a280200220441ec8b04410c200141186a280200220128020c1100000d000240200328020c220504402002200536020c200241346a42013702002002410236022c200241fc8b04360228200241073602142002200241106a36023020022002410c6a36021020042001200241286a1049450d010c020b20032802002205200328020428020c11090042c1f7f9e8cc93b2d141520d002002200536020c200241346a42013702002002410236022c200241fc8b04360228200241083602142002200241106a36023020022002410c6a36021020042001200241286a10490d010b200328020821002002411c6a42033702002002413c6a4104360200200241346a410436020020024103360214200241c48b0436021020022000410c6a3602382002200041086a3602302002410236022c200220003602282002200241286a36021820042001200241106a104921000b200241406b240020000bdd0401047f230041106b220224000240024002400240024002400240024002400240024002400240024020002d000041016b0e0c0102030405060708090a0b0c000b410121002001280214220341eba1044106200141186a280200220528020c22041100000d0c024020012d001c410471450440200341ec8c04410120041100000d0e200341e8a20441052004110000450d010c0e0b200341ea8c04410220041100000d0d2002200536020420022003360200200241013a000f20022002410f6a360208200241e8a2044105104a0d0d200241e88c044102104a0d0d0b200341c18b044101200411000021000c0c0b200128021441dea104410d200141186a28020028020c11000021000c0b0b200128021441d0a104410e200141186a28020028020c11000021000c0a0b200128021441c5a104410b200141186a28020028020c11000021000c090b200128021441aba104411a200141186a28020028020c11000021000c080b2001280214419da104410e200141186a28020028020c11000021000c070b2001280214418da1044110200141186a28020028020c11000021000c060b20012802144181a104410c200141186a28020028020c11000021000c050b200128021441f6a004410b200141186a28020028020c11000021000c040b200128021441efa0044107200141186a28020028020c11000021000c030b200128021441e0a004410f200141186a28020028020c11000021000c020b200128021441cfa0044111200141186a28020028020c11000021000c010b200128021441bca0044113200141186a28020028020c11000021000b200241106a240020000b3901017f230041106b22042400200441086a2003200220011015200428020c21012000200428020836020020002001360204200441106a24000b0bdb220400418080040ba105617474656d707420746f206164642077697468206f766572666c6f7700000000617474656d707420746f206d756c7469706c792077697468206f766572666c6f770000008c0e010072000000c30100001e0000000900000001000000010000000a0000002f7573722f6c6f63616c2f636172676f2f72656769737472792f7372632f696e6465782e6372617465732e696f2d366631376432326262613135303031662f696e6b5f656e762d342e332e302f7372632f656e67696e652f6f6e5f636861696e2f6578742e7273006400010067000000e40000001400000054686520657865637574656420636f6e7472616374206d757374206861766520612063616c6c6572207769746820612076616c6964206163636f756e742069642e2f7573722f6c6f63616c2f636172676f2f72656769737472792f7372632f696e6465782e6372617465732e696f2d366631376432326262613135303031662f696e6b5f656e762d342e332e302f7372632f656e67696e652f6f6e5f636861696e2f696d706c732e727300001d010100690000006b0100000e0000001d010100690000002401000023000000656e636f756e746572656420756e6578706563746564206572726f72a80101001c0000001d01010069000000ed000000170000002f736f75726365732f7372632f63686174726f6f6d2f6c69622e7273dc0101001c0000001000000005000000636f756c64206e6f742070726f7065726c79206465636f64652073746f7261676520656e74727900080201002700000073746f7261676520656e7472792077617320656d70747900380201001700000057656c636f6d6520746f207468652063686174726f6f6d31617474656d707420746f206164642077697468206f766572666c6f770b00000004000000040000000c0000000d0000000e0041b085040b9013617474656d707420746f206d756c7469706c792077697468206f766572666c6f770000000f0000000000000001000000100000002f7573722f6c6f63616c2f7275737475702f746f6f6c636861696e732f737461626c652d7838365f36342d756e6b6e6f776e2d6c696e75782d676e752f6c69622f727573746c69622f7372632f727573742f6c6962726172792f616c6c6f632f7372632f7261775f7665632e72730000e40201006e0000008e0100001c0000006361706163697479206f766572666c6f770000006403010011000000e40201006e0000000c020000050000002f7573722f6c6f63616c2f7275737475702f746f6f6c636861696e732f737461626c652d7838365f36342d756e6b6e6f776e2d6c696e75782d676e752f6c69622f727573746c69622f7372632f727573742f6c6962726172792f616c6c6f632f7372632f616c6c6f632e72736d656d6f727920616c6c6f636174696f6e206f6620206279746573206661696c65640000fc03010015000000110401000d000000900301006c000000a30100000d0000006120666f726d617474696e6720747261697420696d706c656d656e746174696f6e2072657475726e656420616e206572726f722f7573722f6c6f63616c2f7275737475702f746f6f6c636861696e732f737461626c652d7838365f36342d756e6b6e6f776e2d6c696e75782d676e752f6c69622f727573746c69622f7372632f727573742f6c6962726172792f616c6c6f632f7372632f666d742e7273000000730401006a00000062020000200000002f7573722f6c6f63616c2f7275737475702f746f6f6c636861696e732f737461626c652d7838365f36342d756e6b6e6f776e2d6c696e75782d676e752f6c69622f727573746c69622f7372632f727573742f6c6962726172792f616c6c6f632f7372632f7665632f6d6f642e72730000f00401006e000000290700000d000000f00401006e0000009707000009000000617474656d707420746f206164642077697468206f766572666c6f7700000000617474656d707420746f2073756274726163742077697468206f766572666c6f77293a002c0f010000000000c205010001000000c2050100010000000f00000000000000010000001100000070616e69636b65642061742027272c20f805010001000000f905010003000000696e646578206f7574206f6620626f756e64733a20746865206c656e20697320206275742074686520696e6465782069732000000c060100200000002c060100120000003a2000002c0f0100000000005006010002000000202020202c0a280a282f7573722f6c6f63616c2f7275737475702f746f6f6c636861696e732f737461626c652d7838365f36342d756e6b6e6f776e2d6c696e75782d676e752f6c69622f727573746c69622f7372632f727573742f6c6962726172792f636f72652f7372632f666d742f6e756d2e727330303031303230333034303530363037303830393130313131323133313431353136313731383139323032313232323332343235323632373238323933303331333233333334333533363337333833393430343134323433343434353436343734383439353035313532353335343535353635373538353936303631363236333634363536363637363836393730373137323733373437353736373737383739383038313832383338343835383638373838383939303931393239333934393539363937393839392f7573722f6c6f63616c2f7275737475702f746f6f6c636861696e732f737461626c652d7838365f36342d756e6b6e6f776e2d6c696e75782d676e752f6c69622f727573746c69622f7372632f727573742f6c6962726172792f636f72652f7372632f666d742f6d6f642e727300a20701006d000000eb0400000d000000a20701006d0000007d050000300000002f7573722f6c6f63616c2f7275737475702f746f6f6c636861696e732f737461626c652d7838365f36342d756e6b6e6f776e2d6c696e75782d676e752f6c69622f727573746c69622f7372632f727573742f6c6962726172792f636f72652f7372632f736c6963652f6d656d6368722e727300003008010072000000760000004b00000030080100720000007700000034000000206f7574206f662072616e676520666f7220736c696365206f66206c656e6774682072616e676520656e6420696e646578200000e608010010000000c4080100220000002f7573722f6c6f63616c2f7275737475702f746f6f6c636861696e732f737461626c652d7838365f36342d756e6b6e6f776e2d6c696e75782d676e752f6c69622f727573746c69622f7372632f727573742f6c6962726172792f636f72652f7372632f736c6963652f697465722e72730809010070000000c205000025000000736f7572636520736c696365206c656e67746820282920646f6573206e6f74206d617463682064657374696e6174696f6e20736c696365206c656e677468202888090100150000009d0901002b000000c1050100010000002f7573722f6c6f63616c2f7275737475702f746f6f6c636861696e732f737461626c652d7838365f36342d756e6b6e6f776e2d6c696e75782d676e752f6c69622f727573746c69622f7372632f727573742f6c6962726172792f636f72652f7372632f7374722f636f756e742e727300e00901006f0000004700000015000000e00901006f0000004f00000032000000e00901006f0000005400000011000000e00901006f0000005a00000009000000e00901006f0000006400000011000000e00901006f000000660000000d0000002f7573722f6c6f63616c2f7275737475702f746f6f6c636861696e732f737461626c652d7838365f36342d756e6b6e6f776e2d6c696e75782d676e752f6c69622f727573746c69622f7372632f727573742f6c6962726172792f636f72652f7372632f7374722f697465722e72730000b00a01006e0000009100000011000000b00a01006e0000004f0200002d0000002f7573722f6c6f63616c2f7275737475702f746f6f6c636861696e732f737461626c652d7838365f36342d756e6b6e6f776e2d6c696e75782d676e752f6c69622f727573746c69622f7372632f727573742f6c6962726172792f636f72652f7372632f7374722f7472616974732e7273400b010070000000d300000013000000010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010100418299040b330202020202020202020202020202020202020202020202020202020202020303030303030303030303030303030304040404040041c099040bd7092f7573722f6c6f63616c2f7275737475702f746f6f6c636861696e732f737461626c652d7838365f36342d756e6b6e6f776e2d6c696e75782d676e752f6c69622f727573746c69622f7372632f727573742f6c6962726172792f636f72652f7372632f7374722f7061747465726e2e7273000000c00c010071000000a101000047000000c00c010071000000b401000020000000c00c010071000000b401000011000000c00c010071000000b8010000260000002f7573722f6c6f63616c2f7275737475702f746f6f6c636861696e732f737461626c652d7838365f36342d756e6b6e6f776e2d6c696e75782d676e752f6c69622f727573746c69622f7372632f727573742f6c6962726172792f636f72652f7372632f697465722f7472616974732f616363756d2e727300740d01007700000095000000010000006d0601006d000000d2010000050000002c0f0100000000007061696420616e20756e70617961626c65206d657373616765636f756c64206e6f74207265616420696e707574756e61626c6520746f206465636f646520696e707574656e636f756e746572656420756e6b6e6f776e2073656c6563746f72756e61626c6520746f206465636f64652073656c6563746f722f7573722f6c6f63616c2f7275737475702f746f6f6c636861696e732f737461626c652d7838365f36342d756e6b6e6f776e2d6c696e75782d676e752f6c69622f727573746c69622f7372632f727573742f6c6962726172792f636f72652f7372632f616c6c6f632f6c61796f75742e727300008c0e0100720000002e01000018000000617474656d707420746f206164642077697468206f766572666c6f7700000000617474656d707420746f206164642077697468206f766572666c6f77617373657274696f6e206661696c65643a206d6964203c3d2073656c662e6c656e28290a2c0f0100000000006f0f0100010000002f7573722f6c6f63616c2f636172676f2f72656769737472792f7372632f696e6465782e6372617465732e696f2d366631376432326262613135303031662f696e6b5f656e762d342e332e302f7372632f656e67696e652f6f6e5f636861696e2f6275666665722e72730000800f01006a0000005a0000001c000000800f01006a0000005a00000009000000800f01006a0000005a00000031000000800f01006a0000006500000009000000800f01006a0000008d0000002100000045636473615265636f766572794661696c656443616c6c52756e74696d654661696c65644c6f6767696e6744697361626c6564556e6b6e6f776e4e6f7443616c6c61626c65436f64654e6f74466f756e645f456e646f776d656e74546f6f4c6f775472616e736665724661696c65645f42656c6f7753756273697374656e63655468726573686f6c644b65794e6f74466f756e6443616c6c6565526576657274656443616c6c6565547261707065644465636f64652f7573722f6c6f63616c2f636172676f2f72656769737472792f7372632f696e6465782e6372617465732e696f2d366631376432326262613135303031662f7061726974792d7363616c652d636f6465632d332e362e392f7372632f636f6465632e7273000000f110010064000000770000000e0000004572726f72000000190000001c000000160000001400000019000000730e0100570e0100410e01002d0e0100140e01","build_info":{"build_mode":"Debug","cargo_contract_version":"3.0.1","rust_toolchain":"stable-x86_64-unknown-linux-gnu","wasm_opt_settings":{"keep_debug_symbols":false,"optimization_passes":"Z"}}},"contract":{"name":"chatroom","version":"0.1.0","authors":["od41 <[your_email]>"]},"image":null,"spec":{"constructors":[{"args":[],"default":false,"docs":["Constructor that initializes the \`bool\` value to the given \`init_value\`."],"label":"new","payable":false,"returnType":{"displayName":["ink_primitives","ConstructorResult"],"type":6},"selector":"0x9bae9d5e"}],"docs":[],"environment":{"accountId":{"displayName":["AccountId"],"type":1},"balance":{"displayName":["Balance"],"type":13},"blockNumber":{"displayName":["BlockNumber"],"type":16},"chainExtension":{"displayName":["ChainExtension"],"type":17},"hash":{"displayName":["Hash"],"type":14},"maxEventTopics":4,"timestamp":{"displayName":["Timestamp"],"type":15}},"events":[{"args":[{"docs":[],"indexed":false,"label":"id","type":{"displayName":["String"],"type":0}},{"docs":[],"indexed":false,"label":"owner","type":{"displayName":["Option"],"type":11}},{"docs":[],"indexed":false,"label":"members","type":{"displayName":["Vec"],"type":12}}],"docs":[],"label":"ChatroomCreated"}],"lang_error":{"displayName":["ink","LangError"],"type":8},"messages":[{"args":[],"default":false,"docs":[" A message that can be called on instantiated contracts."," This one flips the value of the stored \`bool\` from \`true\`"," to \`false\` and vice versa."],"label":"getId","mutates":true,"payable":false,"returnType":{"displayName":["ink","MessageResult"],"type":9},"selector":"0xd15f659a"},{"args":[],"default":false,"docs":[],"label":"getOwner","mutates":true,"payable":false,"returnType":{"displayName":["ink","MessageResult"],"type":10},"selector":"0xa6077113"}]},"storage":{"root":{"layout":{"struct":{"fields":[{"layout":{"leaf":{"key":"0x00000000","ty":0}},"name":"id"},{"layout":{"leaf":{"key":"0x00000000","ty":1}},"name":"owner"},{"layout":{"leaf":{"key":"0x00000000","ty":4}},"name":"messages"},{"layout":{"leaf":{"key":"0x00000000","ty":5}},"name":"members"}],"name":"Chatroom"}},"root_key":"0x00000000"}},"types":[{"id":0,"type":{"def":{"primitive":"str"}}},{"id":1,"type":{"def":{"composite":{"fields":[{"type":2,"typeName":"[u8; 32]"}]}},"path":["ink_primitives","types","AccountId"]}},{"id":2,"type":{"def":{"array":{"len":32,"type":3}}}},{"id":3,"type":{"def":{"primitive":"u8"}}},{"id":4,"type":{"def":{"sequence":{"type":0}}}},{"id":5,"type":{"def":{"sequence":{"type":1}}}},{"id":6,"type":{"def":{"variant":{"variants":[{"fields":[{"type":7}],"index":0,"name":"Ok"},{"fields":[{"type":8}],"index":1,"name":"Err"}]}},"params":[{"name":"T","type":7},{"name":"E","type":8}],"path":["Result"]}},{"id":7,"type":{"def":{"tuple":[]}}},{"id":8,"type":{"def":{"variant":{"variants":[{"index":1,"name":"CouldNotReadInput"}]}},"path":["ink_primitives","LangError"]}},{"id":9,"type":{"def":{"variant":{"variants":[{"fields":[{"type":0}],"index":0,"name":"Ok"},{"fields":[{"type":8}],"index":1,"name":"Err"}]}},"params":[{"name":"T","type":0},{"name":"E","type":8}],"path":["Result"]}},{"id":10,"type":{"def":{"variant":{"variants":[{"fields":[{"type":1}],"index":0,"name":"Ok"},{"fields":[{"type":8}],"index":1,"name":"Err"}]}},"params":[{"name":"T","type":1},{"name":"E","type":8}],"path":["Result"]}},{"id":11,"type":{"def":{"variant":{"variants":[{"index":0,"name":"None"},{"fields":[{"type":1}],"index":1,"name":"Some"}]}},"params":[{"name":"T","type":1}],"path":["Option"]}},{"id":12,"type":{"def":{"sequence":{"type":11}}}},{"id":13,"type":{"def":{"primitive":"u128"}}},{"id":14,"type":{"def":{"composite":{"fields":[{"type":2,"typeName":"[u8; 32]"}]}},"path":["ink_primitives","types","Hash"]}},{"id":15,"type":{"def":{"primitive":"u64"}}},{"id":16,"type":{"def":{"primitive":"u32"}}},{"id":17,"type":{"def":{"variant":{}},"path":["ink_env","types","NoChainExtension"]}}],"version":"4"}`; \ No newline at end of file diff --git a/contracts/typed-contracts/contracts/chatroom.ts b/contracts/typed-contracts/contracts/chatroom.ts new file mode 100644 index 0000000..f06bebe --- /dev/null +++ b/contracts/typed-contracts/contracts/chatroom.ts @@ -0,0 +1,107 @@ +/* This file is auto-generated */ + +import type { ApiPromise } from '@polkadot/api'; +import { Abi } from '@polkadot/api-contract'; +import type { KeyringPair } from '@polkadot/keyring/types'; +import { ContractPromise } from '@polkadot/api-contract'; +import { ContractAbi } from '../contract-info/chatroom'; +import QueryMethods from '../query/chatroom'; +import BuildExtrinsicMethods from '../build-extrinsic/chatroom'; +import TxSignAndSendMethods from '../tx-sign-and-send/chatroom'; +import MixedMethods from '../mixed-methods/chatroom'; +import EventsClass from '../events/chatroom'; + + +export default class Contract { + readonly query : QueryMethods; + readonly buildExtrinsic : BuildExtrinsicMethods; + readonly tx : TxSignAndSendMethods; + readonly methods : MixedMethods; + readonly events: EventsClass; + + readonly address : string; + readonly signer : KeyringPair; + + readonly nativeContract : ContractPromise; + readonly nativeAPI : ApiPromise; + readonly contractAbi: Abi; + + /** + * @constructor + + * @param address - The address of the contract. + * @param signer - The signer to use for signing transactions. + * @param nativeAPI - The API instance to use for queries. + */ + constructor( + address : string, + signer : KeyringPair, + nativeAPI : ApiPromise, + ) { + this.address = address; + this.nativeContract = new ContractPromise(nativeAPI, ContractAbi, address); + this.nativeAPI = nativeAPI; + this.signer = signer; + this.contractAbi = new Abi(ContractAbi); + + this.query = new QueryMethods(this.nativeContract, this.nativeAPI, signer.address); + this.buildExtrinsic = new BuildExtrinsicMethods(this.nativeContract, this.nativeAPI); + this.tx = new TxSignAndSendMethods(nativeAPI, this.nativeContract, signer); + this.methods = new MixedMethods(nativeAPI, this.nativeContract, signer); + this.events = new EventsClass(this.nativeContract, nativeAPI); + } + + /** + * name + * + * @returns The name of the contract. + */ + get name() : string { + return this.nativeContract.abi.info.contract.name.toString(); + } + + /** + * abi + * + * @returns The abi of the contract. + */ + get abi() : Abi { + return this.contractAbi; + } + + /** + * withSigner + * + * @param signer - The signer to use for signing transactions. + * @returns New instance of the contract class with new signer. + * @example + * ```typescript + * const contract = new Contract(address, signerAlice, api); + * await contract.mint(signerBob.address, 100); + * await contract.withSigner(signerBob).transfer(signerAlice.address, 100); + * ``` + */ + withSigner(signer : KeyringPair) : Contract { + return new Contract(this.address, signer, this.nativeAPI); + } + + /** + * withAddress + * + * @param address - The address of the contract. + * @returns New instance of the contract class to interact with new contract. + */ + withAddress(address : string) : Contract { + return new Contract(address, this.signer, this.nativeAPI); + } + + /** + * withAPI + * + * @param api - The API instance to use for queries. + * @returns New instance of the contract class to interact with new API. + */ + withAPI(api : ApiPromise) : Contract { + return new Contract(this.address, this.signer, api); + } +} \ No newline at end of file diff --git a/contracts/typed-contracts/data/chatroom.json b/contracts/typed-contracts/data/chatroom.json new file mode 100644 index 0000000..4e2d026 --- /dev/null +++ b/contracts/typed-contracts/data/chatroom.json @@ -0,0 +1,3 @@ +{ +"0": {"name":"string","isResult":false,"isPrimitive":true,"isConvertable":false},"1": {"name":"AccountId","body":"string | number[]","isResult":false,"isPrimitive":true,"isConvertable":false},"2": {"name":"Array","body":{"0":{"name":"number","isResult":false,"isPrimitive":true,"isConvertable":false}},"isResult":false,"isPrimitive":false,"isConvertable":false},"3": {"name":"number","isResult":false,"isPrimitive":true,"isConvertable":false},"6": {"name":"Result; +} + diff --git a/contracts/typed-contracts/events/chatroom.ts b/contracts/typed-contracts/events/chatroom.ts new file mode 100644 index 0000000..9247bfa --- /dev/null +++ b/contracts/typed-contracts/events/chatroom.ts @@ -0,0 +1,58 @@ +import type * as EventTypes from '../event-types/chatroom'; +import type {ContractPromise} from "@polkadot/api-contract"; +import type {ApiPromise} from "@polkadot/api"; +import EVENT_DATA_TYPE_DESCRIPTIONS from '../event-data/chatroom.json'; +import {getEventTypeDescription} from "../shared/utils"; +import {handleEventReturn} from "@727-ventures/typechain-types"; + +export default class EventsClass { + readonly __nativeContract : ContractPromise; + readonly __api : ApiPromise; + + constructor( + nativeContract : ContractPromise, + api : ApiPromise, + ) { + this.__nativeContract = nativeContract; + this.__api = api; + } + + public subscribeOnChatroomCreatedEvent(callback : (event : EventTypes.ChatroomCreated) => void) { + const callbackWrapper = (args: any[], event: any) => { + const _event: Record < string, any > = {}; + + for (let i = 0; i < args.length; i++) { + _event[event.args[i]!.name] = args[i]!.toJSON(); + } + + callback(handleEventReturn(_event, getEventTypeDescription('ChatroomCreated', EVENT_DATA_TYPE_DESCRIPTIONS)) as EventTypes.ChatroomCreated); + }; + + return this.__subscribeOnEvent(callbackWrapper, (eventName : string) => eventName == 'ChatroomCreated'); + } + + + private __subscribeOnEvent( + callback : (args: any[], event: any) => void, + filter : (eventName: string) => boolean = () => true + ) { + // @ts-ignore + return this.__api.query.system.events((events) => { + events.forEach((record: any) => { + const { event } = record; + + if (event.method == 'ContractEmitted') { + const [address, data] = record.event.data; + + if (address.toString() === this.__nativeContract.address.toString()) { + const {args, event} = this.__nativeContract.abi.decodeEvent(data); + + if (filter(event.identifier.toString())) + callback(args, event); + } + } + }); + }); + } + +} \ No newline at end of file diff --git a/contracts/typed-contracts/mixed-methods/chatroom.ts b/contracts/typed-contracts/mixed-methods/chatroom.ts new file mode 100644 index 0000000..52d4db1 --- /dev/null +++ b/contracts/typed-contracts/mixed-methods/chatroom.ts @@ -0,0 +1,66 @@ +/* This file is auto-generated */ + +import type { ContractPromise } from '@polkadot/api-contract'; +import type { ApiPromise } from '@polkadot/api'; +import type { KeyringPair } from '@polkadot/keyring/types'; +import type { GasLimit, GasLimitAndRequiredValue, Result } from '@727-ventures/typechain-types'; +import type { QueryReturnType } from '@727-ventures/typechain-types'; +import { queryOkJSON, queryJSON, handleReturnType } from '@727-ventures/typechain-types'; +import { txSignAndSend } from '@727-ventures/typechain-types'; +import type * as ArgumentTypes from '../types-arguments/chatroom'; +import type * as ReturnTypes from '../types-returns/chatroom'; +import type BN from 'bn.js'; +//@ts-ignore +import {ReturnNumber} from '@727-ventures/typechain-types'; +import {getTypeDescription} from './../shared/utils'; +// @ts-ignore +import type {EventRecord} from "@polkadot/api/submittable"; +import {decodeEvents} from "../shared/utils"; +import DATA_TYPE_DESCRIPTIONS from '../data/chatroom.json'; +import EVENT_DATA_TYPE_DESCRIPTIONS from '../event-data/chatroom.json'; + + +export default class Methods { + readonly __nativeContract : ContractPromise; + readonly __keyringPair : KeyringPair; + readonly __callerAddress : string; + readonly __apiPromise: ApiPromise; + + constructor( + apiPromise : ApiPromise, + nativeContract : ContractPromise, + keyringPair : KeyringPair, + ) { + this.__apiPromise = apiPromise; + this.__nativeContract = nativeContract; + this.__keyringPair = keyringPair; + this.__callerAddress = keyringPair.address; + } + + /** + * getId + * + * @returns { void } + */ + "getId" ( + __options: GasLimit, + ){ + return txSignAndSend( this.__apiPromise, this.__nativeContract, this.__keyringPair, "getId", (events: EventRecord) => { + return decodeEvents(events, this.__nativeContract, EVENT_DATA_TYPE_DESCRIPTIONS); + }, [], __options); + } + + /** + * getOwner + * + * @returns { void } + */ + "getOwner" ( + __options: GasLimit, + ){ + return txSignAndSend( this.__apiPromise, this.__nativeContract, this.__keyringPair, "getOwner", (events: EventRecord) => { + return decodeEvents(events, this.__nativeContract, EVENT_DATA_TYPE_DESCRIPTIONS); + }, [], __options); + } + +} \ No newline at end of file diff --git a/contracts/typed-contracts/query/chatroom.ts b/contracts/typed-contracts/query/chatroom.ts new file mode 100644 index 0000000..9d75b0c --- /dev/null +++ b/contracts/typed-contracts/query/chatroom.ts @@ -0,0 +1,54 @@ +/* This file is auto-generated */ + +import type { ContractPromise } from '@polkadot/api-contract'; +import type { ApiPromise } from '@polkadot/api'; +import type { GasLimit, GasLimitAndRequiredValue, Result } from '@727-ventures/typechain-types'; +import type { QueryReturnType } from '@727-ventures/typechain-types'; +import { queryJSON, queryOkJSON, handleReturnType } from '@727-ventures/typechain-types'; +import type * as ArgumentTypes from '../types-arguments/chatroom'; +import type * as ReturnTypes from '../types-returns/chatroom'; +import type BN from 'bn.js'; +//@ts-ignore +import {ReturnNumber} from '@727-ventures/typechain-types'; +import {getTypeDescription} from './../shared/utils'; +import DATA_TYPE_DESCRIPTIONS from '../data/chatroom.json'; + + +export default class Methods { + readonly __nativeContract : ContractPromise; + readonly __apiPromise: ApiPromise; + readonly __callerAddress : string; + + constructor( + nativeContract : ContractPromise, + nativeApi : ApiPromise, + callerAddress : string, + ) { + this.__nativeContract = nativeContract; + this.__callerAddress = callerAddress; + this.__apiPromise = nativeApi; + } + + /** + * getId + * + * @returns { Result } + */ + "getId" ( + __options ? : GasLimit, + ): Promise< QueryReturnType< Result > >{ + return queryOkJSON( this.__apiPromise, this.__nativeContract, this.__callerAddress, "getId", [], __options , (result) => { return handleReturnType(result, getTypeDescription(9, DATA_TYPE_DESCRIPTIONS)); }); + } + + /** + * getOwner + * + * @returns { Result } + */ + "getOwner" ( + __options ? : GasLimit, + ): Promise< QueryReturnType< Result > >{ + return queryOkJSON( this.__apiPromise, this.__nativeContract, this.__callerAddress, "getOwner", [], __options , (result) => { return handleReturnType(result, getTypeDescription(10, DATA_TYPE_DESCRIPTIONS)); }); + } + +} \ No newline at end of file diff --git a/contracts/typed-contracts/tx-sign-and-send/chatroom.ts b/contracts/typed-contracts/tx-sign-and-send/chatroom.ts new file mode 100644 index 0000000..7dab1f6 --- /dev/null +++ b/contracts/typed-contracts/tx-sign-and-send/chatroom.ts @@ -0,0 +1,55 @@ +/* This file is auto-generated */ + +import type { ContractPromise } from '@polkadot/api-contract'; +import type { KeyringPair } from '@polkadot/keyring/types'; +import type { ApiPromise } from '@polkadot/api'; +import type { GasLimit, GasLimitAndRequiredValue, Result } from '@727-ventures/typechain-types'; +import { txSignAndSend } from '@727-ventures/typechain-types'; +import type * as ArgumentTypes from '../types-arguments/chatroom'; +import type BN from 'bn.js'; +// @ts-ignore +import type {EventRecord} from "@polkadot/api/submittable"; +import {decodeEvents} from "../shared/utils"; +import EVENT_DATA_TYPE_DESCRIPTIONS from '../event-data/chatroom.json'; + + +export default class Methods { + readonly __nativeContract : ContractPromise; + readonly __keyringPair : KeyringPair; + readonly __apiPromise: ApiPromise; + + constructor( + apiPromise: ApiPromise, + nativeContract : ContractPromise, + keyringPair : KeyringPair, + ) { + this.__apiPromise = apiPromise; + this.__nativeContract = nativeContract; + this.__keyringPair = keyringPair; + } + + /** + * getId + * + */ + "getId" ( + __options ? : GasLimit, + ){ + return txSignAndSend( this.__apiPromise, this.__nativeContract, this.__keyringPair, "getId", (events: EventRecord) => { + return decodeEvents(events, this.__nativeContract, EVENT_DATA_TYPE_DESCRIPTIONS); + }, [], __options); + } + + /** + * getOwner + * + */ + "getOwner" ( + __options ? : GasLimit, + ){ + return txSignAndSend( this.__apiPromise, this.__nativeContract, this.__keyringPair, "getOwner", (events: EventRecord) => { + return decodeEvents(events, this.__nativeContract, EVENT_DATA_TYPE_DESCRIPTIONS); + }, [], __options); + } + +} \ No newline at end of file diff --git a/contracts/typed-contracts/types-arguments/chatroom.ts b/contracts/typed-contracts/types-arguments/chatroom.ts new file mode 100644 index 0000000..0c5fd33 --- /dev/null +++ b/contracts/typed-contracts/types-arguments/chatroom.ts @@ -0,0 +1,8 @@ +import type BN from 'bn.js'; + +export type AccountId = string | number[] + +export enum LangError { + couldNotReadInput = 'CouldNotReadInput' +} + diff --git a/contracts/typed-contracts/types-returns/chatroom.ts b/contracts/typed-contracts/types-returns/chatroom.ts new file mode 100644 index 0000000..8866b3b --- /dev/null +++ b/contracts/typed-contracts/types-returns/chatroom.ts @@ -0,0 +1,9 @@ +import type BN from 'bn.js'; +import type {ReturnNumber} from '@727-ventures/typechain-types'; + +export type AccountId = string | number[] + +export enum LangError { + couldNotReadInput = 'CouldNotReadInput' +} + diff --git a/frontend/package.json b/frontend/package.json index c942234..9fce7f3 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -31,6 +31,7 @@ "@polkadot/util-crypto": "^12.6.2", "@radix-ui/react-dropdown-menu": "^2.0.6", "@radix-ui/react-label": "^2.0.2", + "@radix-ui/react-scroll-area": "^1.0.5", "@radix-ui/react-slot": "^1.0.2", "@radix-ui/react-tooltip": "^1.0.7", "@scio-labs/use-inkathon": "^0.8.1", diff --git a/frontend/src/app/chat/[slug].tsx b/frontend/src/app/chat/[slug].tsx new file mode 100644 index 0000000..e69de29 diff --git a/frontend/src/app/layout.tsx b/frontend/src/app/layout.tsx index c76b07f..08a9600 100644 --- a/frontend/src/app/layout.tsx +++ b/frontend/src/app/layout.tsx @@ -19,15 +19,15 @@ export const viewport: Viewport = { } export const metadata: Metadata = { - title: 'ink!athon Boilerplate', - description: 'Full-Stack DApp Boilerplate for ink! Smart Contracts', + title: 'Whisper | Disappearing group chats', + description: 'Private and ephemeral conversations for the privacy focused individual', metadataBase: new URL(env.url), robots: env.isProduction ? 'all' : 'noindex,nofollow', openGraph: { type: 'website', locale: 'en', url: env.url, - siteName: 'ink!athon Boilerplate', + siteName: 'Whisper | Disappearing group chats', images: [ { url: '/images/inkathon-og-banner.jpg', @@ -37,8 +37,8 @@ export const metadata: Metadata = { ], }, twitter: { - site: '@scio_xyz', - creator: '@scio_xyz', + site: '@elder41_', + creator: '@elder41_', card: 'summary_large_image', }, } diff --git a/frontend/src/app/page.tsx b/frontend/src/app/page.tsx index c5a9300..de3fc27 100644 --- a/frontend/src/app/page.tsx +++ b/frontend/src/app/page.tsx @@ -5,10 +5,9 @@ import { useEffect } from 'react' import { useInkathon } from '@scio-labs/use-inkathon' import { toast } from 'react-hot-toast' -import { HomePageTitle } from '@/app/components/home-page-title' -import { ChainInfo } from '@/components/web3/chain-info' +import { ChatMessages } from '@/components/web3/chat-messages' +import { Chatroom } from '@/components/web3/chatroom' import { ConnectButton } from '@/components/web3/connect-button' -import { GreeterContractInteractions } from '@/components/web3/greeter-contract-interactions' export default function HomePage() { // Display `useInkathon` error messages (optional) @@ -22,17 +21,16 @@ export default function HomePage() { <>
{/* Title */} - + {/* */} {/* Connect Wallet Button */} -
+
{/* Chain Metadata Information */} - + - {/* Greeter Read/Write Contract Interactions */} - +
diff --git a/frontend/src/app/providers.tsx b/frontend/src/app/providers.tsx index fb1a52a..cd0f0f5 100644 --- a/frontend/src/app/providers.tsx +++ b/frontend/src/app/providers.tsx @@ -10,7 +10,7 @@ import { env } from '@/config/environment' export default function ClientProviders({ children }: PropsWithChildren) { return ( , + React.ComponentPropsWithoutRef +>(({ className, children, ...props }, ref) => ( + + + {children} + + + + +)) +ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName + +const ScrollBar = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, orientation = "vertical", ...props }, ref) => ( + + + +)) +ScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName + +export { ScrollArea, ScrollBar } diff --git a/frontend/src/components/web3/chat-messages.tsx b/frontend/src/components/web3/chat-messages.tsx new file mode 100644 index 0000000..310ca5a --- /dev/null +++ b/frontend/src/components/web3/chat-messages.tsx @@ -0,0 +1,126 @@ +'use client' + +import { FC, useEffect, useState } from 'react' + +import { useInkathon } from '@scio-labs/use-inkathon' + +import { Card, CardContent } from '@/components/ui/card' +import { ScrollArea } from '@/components/ui/scroll-area' +import { Spinner } from '@/components/ui/spinner' + +import { Message, MessageProps } from './message' + +export const ChatMessages: FC = () => { + const { api, activeChain } = useInkathon() + const [chainInfo, setChainInfo] = useState<{ [_: string]: any }>() + + const messages: MessageProps[] = [ + { + content: + 'This is the message body. This is the message body. This is the message body. This is the message body', + sender: 'addressofsenderdidga;oglkaj', + }, + { + content: 'This is the message body', + sender: 'addressofsenderdidga;oglkaj', + }, + { + content: 'This is the message body', + sender: 'addressofsenderdidga;oglkaj', + }, + { + content: 'This is the message body', + sender: 'addressofsenderdidga;oglkaj', + }, + { + content: + 'This is the message body. This is the message body. This is the message body. This is the message body', + sender: 'addressofsenderdidga;oglkaj', + }, + { + content: 'This is the message body', + sender: 'addressofsenderdidga;oglkaj', + }, + { + content: 'This is the message body', + sender: 'addressofsenderdidga;oglkaj', + }, + { + content: 'This is the message body', + sender: 'addressofsenderdidga;oglkaj', + }, + { + content: + 'This is the message body. This is the message body. This is the message body. This is the message body', + sender: 'addressofsenderdidga;oglkaj', + }, + { + content: 'This is the message body', + sender: 'addressofsenderdidga;oglkaj', + }, + { + content: 'This is the message body', + sender: 'addressofsenderdidga;oglkaj', + }, + { + content: 'This is the message body', + sender: 'addressofsenderdidga;oglkaj', + }, + { + content: + 'This is the message body. This is the message body. This is the message body. This is the message body', + sender: 'addressofsenderdidga;oglkaj', + }, + { + content: 'This is the message body', + sender: 'addressofsenderdidga;oglkaj', + }, + { + content: 'This is the message body', + sender: 'addressofsenderdidga;oglkaj', + }, + { + content: 'This is the message body', + sender: 'addressofsenderdidga;oglkaj', + }, + ] + + // Fetch messages + const fetchMessages = async () => { + console.log('fetching messages...') + } + + useEffect(() => { + fetchMessages() + }, [api]) + + // Connection Loading Indicator + if (!api) + return ( +
+ +
+ Connecting to {activeChain?.name} ({activeChain?.rpcUrls?.[0]}) +
+
+ ) + + return ( + <> +
+

Chatroom

+ + + + + {/* Messages */} + {messages.map((message, key) => ( + + ))} + + + +
+ + ) +} diff --git a/frontend/src/components/web3/chatroom.tsx b/frontend/src/components/web3/chatroom.tsx new file mode 100644 index 0000000..09ab83f --- /dev/null +++ b/frontend/src/components/web3/chatroom.tsx @@ -0,0 +1,113 @@ +'use client' + +import { FC, useEffect } from 'react' + +import { ContractIds } from '@/deployments/deployments' +import { zodResolver } from '@hookform/resolvers/zod' +import GreeterContract from '@inkathon/contracts/typed-contracts/contracts/greeter' +import { + useInkathon, + useRegisteredContract, + useRegisteredTypedContract, +} from '@scio-labs/use-inkathon' +import { SubmitHandler, useForm } from 'react-hook-form' +import toast from 'react-hot-toast' +import * as z from 'zod' + +import { Button } from '@/components/ui/button' +import { Card, CardContent } from '@/components/ui/card' +import { Form, FormControl, FormItem } from '@/components/ui/form' +import { Input } from '@/components/ui/input' +import { contractTxWithToast } from '@/utils/contract-tx-with-toast' + +const formSchema = z.object({ + newMessage: z.string().min(1).max(400), +}) + +export const Chatroom: FC = () => { + const { api, activeAccount, activeSigner } = useInkathon() + const { contract, address: contractAddress } = useRegisteredContract(ContractIds.Chatroom) + const { typedContract } = useRegisteredTypedContract(ContractIds.Chatroom, GreeterContract) + + const form = useForm>({ + resolver: zodResolver(formSchema), + }) + + const { register, reset, handleSubmit } = form + + useEffect(() => { + //listing to contract + }, [typedContract]) + + // fetch messages + const fetchMessages = async () => { + console.log('fetching messages...') + } + + // send a message + const sendMessage: SubmitHandler> = async ({ newMessage }) => { + if (!activeAccount || !contract || !activeSigner || !api) { + toast.error('Wallet not connected. Try again…') + return + } + + try { + await contractTxWithToast(api, activeAccount.address, contract, 'sendMessage', {}, [ + newMessage, + ]) + reset() + } catch (e) { + console.error(e) + } finally { + fetchMessages() + } + } + + // if (!api) return null + + return ( + <> +
+ {/*

Greeter Smart Contract

*/} + +
+ {/* Update Greeting */} + + + + + {/* */} + +
+ + +
+
+
+ +
+
+ + + {/* Contract Address */} +

+ {contract ? contractAddress : 'Loading…'} +

+
+ + ) +} diff --git a/frontend/src/components/web3/connect-button.tsx b/frontend/src/components/web3/connect-button.tsx index 3e498b8..2174df1 100644 --- a/frontend/src/components/web3/connect-button.tsx +++ b/frontend/src/components/web3/connect-button.tsx @@ -79,7 +79,7 @@ export const ConnectButton: FC = () => { disabled={isConnecting} translate="no" > - Connect Wallet + Sign in