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CACb,GAGA,IAAI,CAACW,WAAW,CAAG,IAAI,CAACjB,kBAAkB,EAC5C,CAsJF,CASO,IAAMgD,EAA8B,CAACrI,EAAmB5C,EAAe8I,EAAuBrH,IAC5F,IAAIuG,EAAsBpF,EAAW5C,EAAO8I,EAAerH","sources":["webpack://_N_E/ignored|/codebuild/output/src1784519652/src/soti/node_modules/tweetnacl|crypto","webpack://_N_E/./app/contracts/MarketPlace.ts","webpack://_N_E/./app/contracts/methods/utils.ts","webpack://_N_E/./app/contracts/methods/buyTicket.ts","webpack://_N_E/./app/contracts/methods/redeemTicket.ts","webpack://_N_E/./app/services/ticketContract.ts"],"sourcesContent":["/* (ignored) */","/* eslint-disable */\n/**\n * This file was automatically generated by @algorandfoundation/algokit-client-generator.\n * DO NOT MODIFY IT BY HAND.\n * requires: @algorandfoundation/algokit-utils: ^7\n */\nimport { AlgorandClientInterface } from '@algorandfoundation/algokit-utils/types/algorand-client-interface'\nimport { ABIReturn, AppReturn, SendAppTransactionResult } from '@algorandfoundation/algokit-utils/types/app'\nimport { Arc56Contract, getArc56ReturnValue, getABIStructFromABITuple } from '@algorandfoundation/algokit-utils/types/app-arc56'\nimport {\n AppClient as _AppClient,\n AppClientMethodCallParams,\n AppClientParams,\n AppClientBareCallParams,\n CallOnComplete,\n AppClientCompilationParams,\n ResolveAppClientByCreatorAndName,\n ResolveAppClientByNetwork,\n CloneAppClientParams,\n} from '@algorandfoundation/algokit-utils/types/app-client'\nimport { AppFactory as _AppFactory, AppFactoryAppClientParams, AppFactoryResolveAppClientByCreatorAndNameParams, AppFactoryDeployParams, AppFactoryParams, CreateSchema } from '@algorandfoundation/algokit-utils/types/app-factory'\nimport { TransactionComposer, AppCallMethodCall, AppMethodCallTransactionArgument, SimulateOptions, RawSimulateOptions, SkipSignaturesSimulateOptions } from '@algorandfoundation/algokit-utils/types/composer'\nimport { SendParams, SendSingleTransactionResult, SendAtomicTransactionComposerResults } from '@algorandfoundation/algokit-utils/types/transaction'\nimport { Address, encodeAddress, modelsv2, OnApplicationComplete, Transaction, TransactionSigner } from 'algosdk'\nimport SimulateResponse = modelsv2.SimulateResponse\n\nexport const APP_SPEC: Arc56Contract = {\"arcs\":[],\"name\":\"MarketPlace\",\"structs\":{\"EventTuple\":[{\"name\":\"name\",\"type\":\"string\"},{\"name\":\"description\",\"type\":\"string\"},{\"name\":\"startDate\",\"type\":\"uint64\"},{\"name\":\"endDate\",\"type\":\"uint64\"},{\"name\":\"maxAttendees\",\"type\":\"uint64\"},{\"name\":\"organizer\",\"type\":\"address\"}],\"TicketCost\":[{\"name\":\"totalTickets\",\"type\":\"uint64\"},{\"name\":\"totalPrice\",\"type\":\"uint64\"},{\"name\":\"totalFees\",\"type\":\"uint64\"},{\"name\":\"assetId\",\"type\":\"uint64\"},{\"name\":\"reservedTickets\",\"type\":\"uint64\"}],\"TicketTier\":[{\"name\":\"id\",\"type\":\"uint64\"},{\"name\":\"assetId\",\"type\":\"uint64\"},{\"name\":\"price\",\"type\":\"uint64\"},{\"name\":\"maxPrice\",\"type\":\"uint64\"},{\"name\":\"maxSupply\",\"type\":\"uint64\"},{\"name\":\"currentSupply\",\"type\":\"uint64\"},{\"name\":\"groupSize\",\"type\":\"uint64\"},{\"name\":\"groupDiscount\",\"type\":\"uint64\"},{\"name\":\"reservedTickets\",\"type\":\"uint64\"},{\"name\":\"redeemedTickets\",\"type\":\"uint64\"}]},\"methods\":[{\"name\":\"create_event_with_tiers\",\"desc\":\"Initialize the event contract\",\"args\":[{\"name\":\"event_details\",\"type\":\"(string,string,uint64,uint64,uint64,address)\",\"struct\":\"EventTuple\"},{\"name\":\"tiers_details\",\"type\":\"(uint64,string,uint64,string,uint64,uint64,uint64,uint64,string,uint64,uint64,uint64,string)[]\"},{\"name\":\"min_bal\",\"type\":\"pay\"}],\"returns\":{\"type\":\"uint64\"},\"events\":[],\"actions\":{\"create\":[],\"call\":[\"NoOp\"]}},{\"name\":\"mint_ticket\",\"desc\":\"Mint a new ticket NFT for the specified tier\",\"args\":[{\"name\":\"tier_id\",\"type\":\"uint64\"},{\"name\":\"opt_in\",\"type\":\"axfer\"},{\"name\":\"buy_ticket\",\"type\":\"pay\"}],\"returns\":{\"type\":\"(uint64,uint64,uint64,uint64,uint64)\",\"struct\":\"TicketCost\"},\"events\":[],\"actions\":{\"create\":[],\"call\":[\"NoOp\"]}},{\"name\":\"reserve_tickets\",\"desc\":\"Reserve tickets\",\"args\":[{\"name\":\"tier_id\",\"type\":\"uint64\"},{\"name\":\"reserved_tickets\",\"type\":\"uint64\"},{\"name\":\"buy_ticket\",\"type\":\"pay\"}],\"returns\":{\"type\":\"(uint64,uint64,uint64,uint64,uint64)\",\"struct\":\"TicketCost\"},\"events\":[],\"actions\":{\"create\":[],\"call\":[\"NoOp\"]}},{\"name\":\"claim_ticket\",\"desc\":\"Claim a single ticket NFT\",\"args\":[{\"name\":\"tier_id\",\"type\":\"uint64\"},{\"name\":\"opt_in\",\"type\":\"axfer\"}],\"returns\":{\"type\":\"(uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64)\",\"struct\":\"TicketTier\"},\"events\":[],\"actions\":{\"create\":[],\"call\":[\"NoOp\"]}},{\"name\":\"redeem_ticket\",\"desc\":\"Redeem a single ticket NFT\",\"args\":[{\"name\":\"tier_id\",\"type\":\"uint64\"},{\"name\":\"asset\",\"type\":\"asset\"}],\"returns\":{\"type\":\"(uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64)\",\"struct\":\"TicketTier\"},\"events\":[],\"actions\":{\"create\":[],\"call\":[\"NoOp\"]}}],\"state\":{\"schema\":{\"global\":{\"ints\":3,\"bytes\":3},\"local\":{\"ints\":0,\"bytes\":0}},\"keys\":{\"global\":{\"description\":{\"key\":\"ZGVzY3JpcHRpb24=\",\"keyType\":\"AVMString\",\"valueType\":\"AVMBytes\"},\"end_date\":{\"key\":\"ZW5kX2RhdGU=\",\"keyType\":\"AVMString\",\"valueType\":\"AVMUint64\"},\"event_name\":{\"key\":\"ZXZlbnRfbmFtZQ==\",\"keyType\":\"AVMString\",\"valueType\":\"AVMBytes\"},\"max_attendees\":{\"key\":\"bWF4X2F0dGVuZGVlcw==\",\"keyType\":\"AVMString\",\"valueType\":\"AVMUint64\"},\"organizer\":{\"key\":\"b3JnYW5pemVy\",\"keyType\":\"AVMString\",\"valueType\":\"AVMBytes\"},\"start_date\":{\"key\":\"c3RhcnRfZGF0ZQ==\",\"keyType\":\"AVMString\",\"valueType\":\"AVMUint64\"}},\"local\":{},\"box\":{}},\"maps\":{\"global\":{},\"local\":{},\"box\":{}}},\"source\":{\"approval\":\"I3ByYWdtYSB2ZXJzaW9uIDEwCgpzbWFydF9jb250cmFjdHMubWFya2V0cGxhY2UuY29udHJhY3QuTWFya2V0UGxhY2UuYXBwcm92YWxfcHJvZ3JhbToKICAgIGludGNibG9jayAxIDAgMiA0IDEwMDAwMCBUTVBMX1VQREFUQUJMRSBUTVBMX0RFTEVUQUJMRQogICAgYnl0ZWNibG9jayAib3JnYW5pemVyIiAweDE1MWY3Yzc1ICJzdGFydF9kYXRlIiAiZW5kX2RhdGUiICJldmVudF9uYW1lIiAiZGVzY3JpcHRpb24iICJtYXhfYXR0ZW5kZWVzIiAweDAwMDAwMDAwMDAwMDAwMDAKICAgIHR4biBBcHBsaWNhdGlvbklECiAgICBibnogbWFpbl9hZnRlcl9pZl9lbHNlQDIKICAgIGNhbGxzdWIgX19pbml0X18KCm1haW5fYWZ0ZXJfaWZfZWxzZUAyOgogICAgY2FsbHN1YiBfX3B1eWFfYXJjNF9yb3V0ZXJfXwogICAgcmV0dXJuCgoKLy8gc21hcnRfY29udHJhY3RzLm1hcmtldHBsYWNlLmNvbnRyYWN0Lk1hcmtldFBsYWNlLl9faW5pdF9fKCkgLT4gdm9pZDoKX19pbml0X186CiAgICAvLyBzbWFydF9jb250cmFjdHMvbWFya2V0cGxhY2UvY29udHJhY3QucHk6NzYKICAgIC8vIGRlZiBfX2luaXRfXyhzZWxmKSAtPiBO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FjdC5weTo3NQogICAgLy8gY2xhc3MgTWFya2V0UGxhY2UoQVJDNENvbnRyYWN0KToKICAgIHR4bmEgQXBwbGljYXRpb25BcmdzIDEKICAgIHR4bmEgQXBwbGljYXRpb25BcmdzIDIKICAgIHR4biBHcm91cEluZGV4CiAgICBpbnRjXzAgLy8gMQogICAgLQogICAgZHVwCiAgICBndHhucyBUeXBlRW51bQogICAgaW50Y18wIC8vIHBheQogICAgPT0KICAgIGFzc2VydCAvLyB0cmFuc2FjdGlvbiB0eXBlIGlzIHBheQogICAgLy8gc21hcnRfY29udHJhY3RzL21hcmtldHBsYWNlL2NvbnRyYWN0LnB5OjkwCiAgICAvLyBAYXJjNC5hYmltZXRob2QKICAgIGNhbGxzdWIgY3JlYXRlX2V2ZW50X3dpdGhfdGllcnMKICAgIGl0b2IKICAgIGJ5dGVjXzEgLy8gMHgxNTFmN2M3NQogICAgc3dhcAogICAgY29uY2F0CiAgICBsb2cKICAgIGludGNfMCAvLyAxCiAgICByZXRzdWIKCl9fcHV5YV9hcmM0X3JvdXRlcl9fX21pbnRfdGlja2V0X3JvdXRlQDM6CiAgICAvLyBzbWFydF9jb250cmFjdHMvbWFya2V0cGxhY2UvY29udHJhY3QucHk6MTczCiAgICAvLyBAYXJjNC5hYmltZXRob2QKICAgIHR4biBPbkNvbXBsZXRpb24KICAgICEKICAgIGFzc2VydCAvLyBPbkNvbXBsZXRpb24gaXMgbm90IE5vT3AKICAgIHR4biBBcHBsaWNhdGlvbklECiAgICBhc3NlcnQgLy8gY2FuIG9ubHkgY2FsbCB3aGVuIG5vdCBjcmVhdGluZwogICAgLy8gc21hcnRfY29udHJhY3RzL21hcmtldHBsYWNlL2NvbnRyYWN0LnB5Ojc1CiAgICAvLyBjbGFzcyBNYXJrZXRQbGFjZShBUkM0Q29udHJhY3QpOgogICAgdHhuYSBBcHBsaWNhdGlvbkFyZ3MgMQogICAgdHhuIEdyb3VwSW5kZXgKICAgIGludGNfMiAvLyAyCiAgICAtCiAgIC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U9cHJpY2UsCiAgICAvLyAgICAgbWF4X3ByaWNlPW1heF9wcmljZSwKICAgIC8vICAgICBtYXhfc3VwcGx5PW1heF9zdXBwbHksCiAgICAvLyAgICAgY3VycmVudF9zdXBwbHk9YXJjNC5VSW50NjQoMCksCiAgICAvLyAgICAgZ3JvdXBfc2l6ZT1ncm91cF9zaXplLAogICAgLy8gICAgIGdyb3VwX2Rpc2NvdW50PWdyb3VwX2Rpc2NvdW50LAogICAgLy8gICAgIHJlc2VydmVkX3RpY2tldHM9cmVzZXJ2ZWRfdGlja2V0cywKICAgIC8vICAgICByZWRlZW1lZF90aWNrZXRzPWFyYzQuVUludDY0KDApCiAgICAvLyApCiAgICBjb25jYXQKICAgIHVuY292ZXIgMwogICAgY29uY2F0CiAgICB1bmNvdmVyIDIKICAgIGNvbmNhdAogICAgc3dhcAogICAgY29uY2F0CiAgICAvLyBzbWFydF9jb250cmFjdHMvbWFya2V0cGxhY2UvY29udHJhY3QucHk6MTY0CiAgICAvLyByZWRlZW1lZF90aWNrZXRzPWFyYzQuVUludDY0KDApCiAgICBieXRlYyA3IC8vIDB4MDAwMDAwMDAwMDAwMDAwMAogICAgLy8gc21hcnRfY29udHJhY3RzL21hcmtldHBsYWNlL2NvbnRyYWN0LnB5OjE1My0xNjUKICAgIC8vICMgQ3JlYXRlIG5ldyB0aWVyIHdpdGggMCBjdXJyZW50IHN1cHBseQogICAgLy8gbmV3X3RpZXIgPSBUaWNrZXRUaWVyKAogICAgLy8gICAgIGlkPXRpZXJfaWQsCiAgICAvLyAgICAgYXNzZXRfaWQ9YXJjNC5VSW50NjQodGlja2V0X2Fzc2V0LmlkKSwKICAgIC8vICAgICBwcmljZT1wcmljZSwKICAgIC8vICAgICBtYXhfcHJpY2U9bWF4X3ByaWNlLAogICAgLy8gICAgIG1heF9zdXBwbHk9bWF4X3N1cHBseSwKICAgIC8vICAgICBjdXJyZW50X3N1cHBseT1hcmM0LlVJbnQ2NCgwKSwKICAgIC8vICAgICBncm91c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tldHBsYWNlL2NvbnRyYWN0LnB5OjIxNy0yMjkKICAgIC8vICMgIyBVcGRhdGUgc3VwcGx5CiAgICAvLyB1cGRhdGVkX3RpZXIgPSBUaWNrZXRUaWVyKAogICAgLy8gICAgIGlkPXRpZXJfaWQsCiAgICAvLyAgICAgYXNzZXRfaWQ9dGllci5hc3NldF9pZCwKICAgIC8vICAgICBwcmljZT10aWVyLnByaWNlLAogICAgLy8gICAgIG1heF9wcmljZT10aWVyLm1heF9wcmljZSwKICAgIC8vICAgICBtYXhfc3VwcGx5PXRpZXIubWF4X3N1cHBseSwKICAgIC8vICAgICBjdXJyZW50X3N1cHBseT1hcmM0LlVJbnQ2NCh2YWxpZGF0ZWRfdGlja2V0cy5jdXJyZW50X3N1cHBseS5uYXRpdmUgKyB0b3RhbF90aWNrZXRzKSwKICAgIC8vICAgICBncm91cF9zaXplPXRpZXIuZ3JvdXBfc2l6ZSwKICAgIC8vICAgICBncm91cF9kaXNjb3VudD10aWVyLmdyb3VwX2Rpc2NvdW50LAogICAgLy8gICAgIHJlc2VydmVkX3RpY2tldHM9dGllci5yZXNlcnZlZF90aWNrZXRzLAogICAgLy8gICAgIHJlZGVlbWVkX3RpY2tldHM9dGllci5yZWRlZW1lZF90aWNrZXRzCiAgICAvLyApCiAgICBmcmFtZV9kaWcgLTMKICAgIHVuY292ZXIgMTIKICAgIGNvbmNhdAogICAgdW5jb3ZlciA4CiAgICBjb25jYXQKICAgIHVuY292ZXIgNwogICAgY29uY2F0CiAgICB1bmNvdmVyIDYKICAgIGNvbmNhdAogICAgdW5jb3ZlciA1CiAgICBjb25jYXQKICAgIHVuY292ZXIgNAogICAgY29uY2F0CiAgICB1bmNvdmVyIDMKICAgIGNvbmNhdAogICAgZGlnIDIKICAgIGNvbmNhdAogICAgc3dhcAogICAgY29uY2F0CiAgICAvLyBzbWFydF9jb250cmFjdHMvbWFya2V0cGxhY2UvY29udHJhY3QucHk6MjMwCiAgICAvLyBzZWxmLl9jcmVhdGVfdG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IC8vICAgICBpZD10aWVyX2lkLAogICAgLy8gICAgIGFzc2V0X2lkPXRpZXIuYXNzZXRfaWQsCiAgICAvLyAgICAgcHJpY2U9dGllci5wcmljZSwKICAgIC8vICAgICBtYXhfcHJpY2U9dGllci5tYXhfcHJpY2UsCiAgICAvLyAgICAgbWF4X3N1cHBseT10aWVyLm1heF9zdXBwbHksCiAgICAvLyAgICAgY3VycmVudF9zdXBwbHk9YXJjNC5VSW50NjQodmFsaWRhdGVkX3RpY2tldHMuY3VycmVudF9zdXBwbHkubmF0aXZlICsgVUludDY0KDEpKSwKICAgIC8vICAgICBncm91cF9zaXplPXRpZXIuZ3JvdXBfc2l6ZSwKICAgIC8vICAgICBncm91cF9kaXNjb3VudD10aWVyLmdyb3VwX2Rpc2NvdW50LAogICAgLy8gICAgIHJlc2VydmVkX3RpY2tldHM9YXJjNC5VSW50NjQobmV3X3N0b3JlZF9yZXNlcnZlZF90aWNrZXRzKSwKICAgIC8vICAgICByZWRlZW1lZF90aWNrZXRzPXRpZXIucmVkZWVtZWRfdGlja2V0cwogICAgLy8gKQogICAgZnJhbWVfZGlnIC0zCiAgICB1bmNvdmVyIDExCiAgICBjb25jYXQKICAgIHVuY292ZXIgOQogICAgY29uY2F0CiAgICB1bmNvdmVyIDUKICAgIGNvbmNhdAogICAgdW5jb3ZlciA0CiAgICBjb25jYXQKICAgIHVuY292ZXIgMwogICAgY29uY2F0CiAgICB1bmNvdmVyIDUKICAgIGNvbmNhdAogICAgdW5jb3ZlciA0CiAgICBjb25jYXQKICAgIGRpZyAyCiAgICBjb25jYXQKICAgIHN3YXAKICAgIGNvbmNhdAogICAgLy8gc21hcnRfY29udHJhY3RzL21hcmtldHBsYWNlL2NvbnRyYWN0LnB5OjI4OAogICAgLy8gc2VsZi5fY3JlYXRlX3RpZXIodXBkYXRlZF90aWVyKQogICAgY2FsbHN1YiBfY3JlYXRlX3RpZXIKICAgIHBvcAogICAgLy8gc21hcnRfY29udHJhY3RzL21hcmtldHBsY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ICAgLy8gdXBkYXRlZF90aWVyID0gVGlja2V0VGllcigKICAgIC8vICAgICBpZD10aWVyLmlkLAogICAgLy8gICAgIGFzc2V0X2lkPXRpZXIuYXNzZXRfaWQsCiAgICAvLyAgICAgcHJpY2U9dGllci5wcmljZSwKICAgIC8vICAgICBtYXhfcHJpY2U9dGllci5tYXhfcHJpY2UsCiAgICAvLyAgICAgbWF4X3N1cHBseT10aWVyLm1heF9zdXBwbHksCiAgICAvLyAgICAgY3VycmVudF9zdXBwbHk9YXJjNC5VSW50NjQodGllci5jdXJyZW50X3N1cHBseS5uYXRpdmUgKyBVSW50NjQoMSkpLAogICAgLy8gICAgIGdyb3VwX3NpemU9dGllci5ncm91cF9zaXplLAogICAgLy8gICAgIGdyb3VwX2Rpc2NvdW50PXRpZXIuZ3JvdXBfZGlzY291bnQsCiAgICAvLyAgICAgcmVzZXJ2ZWRfdGlja2V0cz1hcmM0LlVJbnQ2NCh0aWVyLnJlc2VydmVkX3RpY2tldHMubmF0aXZlIC0gVUludDY0KDEpKSwKICAgIC8vICAgICByZWRlZW1lZF90aWNrZXRzPXRpZXIucmVkZWVtZWRfdGlja2V0cwogICAgLy8gKQogICAgdW5jb3ZlciA4CiAgICB1bmNvdmVyIDkKICAgIGNvbmNhdAogICAgdW5jb3ZlciA4CiAgICBjb25jYXQKICAgIHVuY292ZXIgNwogICAgY29uY2F0CiAgICB1bmNvdmVyIDYKICAgIGNvbmNhdAogICAgdW5jb3ZlciA1CiAgICBjb25jYXQKICAgIHVuY292ZXIgNAogICAgY29uY2F0CiAgICB1bmNvdmVyIDMKICAgIGNvbmNhdAogICAgdW5jb3ZlciAyCiAgICBjb25jYXQKICAgIHN3YXAKICAgIGNvbmNhdAogICAgLy8gc21hcnRfY29udHJhY3RzL21hcmtldHBsYWNlL2NvbnRyYWN0LnB5OjM0NAogICAgLy8gc2VsZi5fY3JlYXRlX3RpZXIodXBkYXRlZF90aWVyKQogICAgY2FsbHN1YiBfY3JlYXRlX3RpZXI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N0IDQ4IDggLy8gb24gZXJyb3I6IEluZGV4IGFjY2VzcyBpcyBvdXQgb2YgYm91bmRzCiAgICAvLyBzbWFydF9jb250cmFjdHMvbWFya2V0cGxhY2UvY29udHJhY3QucHk6MzgyCiAgICAvLyBncm91cF9kaXNjb3VudD10aWVyLmdyb3VwX2Rpc2NvdW50LAogICAgZGlnIDgKICAgIGV4dHJhY3QgNTYgOCAvLyBvbiBlcnJvcjogSW5kZXggYWNjZXNzIGlzIG91dCBvZiBib3VuZHMKICAgIC8vIHNtYXJ0X2NvbnRyYWN0cy9tYXJrZXRwbGFjZS9jb250cmFjdC5weTozODMKICAgIC8vIHJlc2VydmVkX3RpY2tldHM9dGllci5yZXNlcnZlZF90aWNrZXRzLAogICAgdW5jb3ZlciA5CiAgICBleHRyYWN0IDY0IDggLy8gb24gZXJyb3I6IEluZGV4IGFjY2VzcyBpcyBvdXQgb2YgYm91bmRzCiAgICAvLyBzbWFydF9jb250cmFjdHMvbWFya2V0cGxhY2UvY29udHJhY3QucHk6Mzg0CiAgICAvLyByZWRlZW1lZF90aWNrZXRzPWFyYzQuVUludDY0KHRpZXIucmVkZWVtZWRfdGlja2V0cy5uYXRpdmUgKyBVSW50NjQoMSkpCiAgICB1bmNvdmVyIDkKICAgIGludGNfMCAvLyAxCiAgICArCiAgICBpdG9iCiAgICAvLyBzbWFydF9jb250cmFjdHMvbWFya2V0cGxhY2UvY29udHJhY3QucHk6Mzc0LTM4NQogICAgLy8gdXBkYXRlZF90aWVyID0gVGlja2V0VGllcigKICAgIC8vICAgICBpZD10aWVyLmlkLAogICAgLy8gICAgIGFzc2V0X2lkPXRpZXIuYXNzZXRfaWQsCiAgICAvLyAgICAgcHJpY2U9dGllci5wcmljZSwKICAgIC8vICAgICBtYXhfcHJpY2U9dGllci5tYXhfcHJpY2UsCiAgICAvLyAgICAgbWF4X3N1cHBseT10aWVyLm1heF9zdXBwbHksCiAgICAvLyAgICAgY3VycmVudF9zdXBwbHk9YXJjNC5VSW50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xhY2UuY2xlYXJfc3RhdGVfcHJvZ3JhbToKICAgIHB1c2hpbnQgMSAvLyAxCiAgICByZXR1cm4K\"},\"bareActions\":{\"create\":[\"NoOp\"],\"call\":[\"DeleteApplication\",\"UpdateApplication\"]}} as unknown as Arc56Contract\n\n/**\n * A state record containing binary data\n */\nexport interface BinaryState {\n /**\n * Gets the state value as a Uint8Array\n */\n asByteArray(): Uint8Array | undefined\n /**\n * Gets the state value as a string\n */\n asString(): string | undefined\n}\n\nclass BinaryStateValue implements BinaryState {\n constructor(private value: Uint8Array | undefined) {}\n\n asByteArray(): Uint8Array | undefined {\n return this.value\n }\n\n asString(): string | undefined {\n return this.value !== undefined ? Buffer.from(this.value).toString('utf-8') : undefined\n }\n}\n\n/**\n * Expands types for IntelliSense so they are more human readable\n * See https://stackoverflow.com/a/69288824\n */\nexport type Expand = T extends (...args: infer A) => infer R\n ? (...args: Expand) => Expand\n : T extends infer O\n ? { [K in keyof O]: O[K] }\n : never\n\n\n// Type definitions for ARC-56 structs\n\nexport type EventTuple = {\n name: string,\n description: string,\n startDate: bigint,\n endDate: bigint,\n maxAttendees: bigint,\n organizer: string\n}\n\n\n/**\n * Converts the ABI tuple representation of a EventTuple to the struct representation\n */\nexport function EventTupleFromTuple(abiTuple: [string, string, bigint, bigint, bigint, string]) {\n return getABIStructFromABITuple(abiTuple, APP_SPEC.structs.EventTuple, APP_SPEC.structs) as EventTuple\n}\n\nexport type TicketCost = {\n totalTickets: bigint,\n totalPrice: bigint,\n totalFees: bigint,\n assetId: bigint,\n reservedTickets: bigint\n}\n\n\n/**\n * Converts the ABI tuple representation of a TicketCost to the struct representation\n */\nexport function TicketCostFromTuple(abiTuple: [bigint, bigint, bigint, bigint, bigint]) {\n return getABIStructFromABITuple(abiTuple, APP_SPEC.structs.TicketCost, APP_SPEC.structs) as TicketCost\n}\n\nexport type TicketTier = {\n id: bigint,\n assetId: bigint,\n price: bigint,\n maxPrice: bigint,\n maxSupply: bigint,\n currentSupply: bigint,\n groupSize: bigint,\n groupDiscount: bigint,\n reservedTickets: bigint,\n redeemedTickets: bigint\n}\n\n\n/**\n * Converts the ABI tuple representation of a TicketTier to the struct representation\n */\nexport function TicketTierFromTuple(abiTuple: [bigint, bigint, bigint, bigint, bigint, bigint, bigint, bigint, bigint, bigint]) {\n return getABIStructFromABITuple(abiTuple, APP_SPEC.structs.TicketTier, APP_SPEC.structs) as TicketTier\n}\n\n/**\n * The argument types for the MarketPlace contract\n */\nexport type MarketPlaceArgs = {\n /**\n * The object representation of the arguments for each method\n */\n obj: {\n 'create_event_with_tiers((string,string,uint64,uint64,uint64,address),(uint64,string,uint64,string,uint64,uint64,uint64,uint64,string,uint64,uint64,uint64,string)[],pay)uint64': {\n eventDetails: EventTuple\n tiersDetails: [bigint | number, string, bigint | number, string, bigint | number, bigint | number, bigint | number, bigint | number, string, bigint | number, bigint | number, bigint | number, string][]\n minBal: AppMethodCallTransactionArgument\n }\n 'mint_ticket(uint64,axfer,pay)(uint64,uint64,uint64,uint64,uint64)': {\n tierId: bigint | number\n optIn: AppMethodCallTransactionArgument\n buyTicket: AppMethodCallTransactionArgument\n }\n 'reserve_tickets(uint64,uint64,pay)(uint64,uint64,uint64,uint64,uint64)': {\n tierId: bigint | number\n reservedTickets: bigint | number\n buyTicket: AppMethodCallTransactionArgument\n }\n 'claim_ticket(uint64,axfer)(uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64)': {\n tierId: bigint | number\n optIn: AppMethodCallTransactionArgument\n }\n 'redeem_ticket(uint64,asset)(uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64)': {\n tierId: bigint | number\n asset: bigint\n }\n }\n /**\n * The tuple representation of the arguments for each method\n */\n tuple: {\n 'create_event_with_tiers((string,string,uint64,uint64,uint64,address),(uint64,string,uint64,string,uint64,uint64,uint64,uint64,string,uint64,uint64,uint64,string)[],pay)uint64': [eventDetails: EventTuple, tiersDetails: [bigint | number, string, bigint | number, string, bigint | number, bigint | number, bigint | number, bigint | number, string, bigint | number, bigint | number, bigint | number, string][], minBal: AppMethodCallTransactionArgument]\n 'mint_ticket(uint64,axfer,pay)(uint64,uint64,uint64,uint64,uint64)': [tierId: bigint | number, optIn: AppMethodCallTransactionArgument, buyTicket: AppMethodCallTransactionArgument]\n 'reserve_tickets(uint64,uint64,pay)(uint64,uint64,uint64,uint64,uint64)': [tierId: bigint | number, reservedTickets: bigint | number, buyTicket: AppMethodCallTransactionArgument]\n 'claim_ticket(uint64,axfer)(uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64)': [tierId: bigint | number, optIn: AppMethodCallTransactionArgument]\n 'redeem_ticket(uint64,asset)(uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64)': [tierId: bigint | number, asset: bigint]\n }\n}\n\n/**\n * The return type for each method\n */\nexport type MarketPlaceReturns = {\n 'create_event_with_tiers((string,string,uint64,uint64,uint64,address),(uint64,string,uint64,string,uint64,uint64,uint64,uint64,string,uint64,uint64,uint64,string)[],pay)uint64': bigint\n 'mint_ticket(uint64,axfer,pay)(uint64,uint64,uint64,uint64,uint64)': TicketCost\n 'reserve_tickets(uint64,uint64,pay)(uint64,uint64,uint64,uint64,uint64)': TicketCost\n 'claim_ticket(uint64,axfer)(uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64)': TicketTier\n 'redeem_ticket(uint64,asset)(uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64)': TicketTier\n}\n\n/**\n * Defines the types of available calls and state of the MarketPlace smart contract.\n */\nexport type MarketPlaceTypes = {\n /**\n * Maps method signatures / names to their argument and return types.\n */\n methods:\n & Record<'create_event_with_tiers((string,string,uint64,uint64,uint64,address),(uint64,string,uint64,string,uint64,uint64,uint64,uint64,string,uint64,uint64,uint64,string)[],pay)uint64' | 'create_event_with_tiers', {\n argsObj: MarketPlaceArgs['obj']['create_event_with_tiers((string,string,uint64,uint64,uint64,address),(uint64,string,uint64,string,uint64,uint64,uint64,uint64,string,uint64,uint64,uint64,string)[],pay)uint64']\n argsTuple: MarketPlaceArgs['tuple']['create_event_with_tiers((string,string,uint64,uint64,uint64,address),(uint64,string,uint64,string,uint64,uint64,uint64,uint64,string,uint64,uint64,uint64,string)[],pay)uint64']\n returns: MarketPlaceReturns['create_event_with_tiers((string,string,uint64,uint64,uint64,address),(uint64,string,uint64,string,uint64,uint64,uint64,uint64,string,uint64,uint64,uint64,string)[],pay)uint64']\n }>\n & Record<'mint_ticket(uint64,axfer,pay)(uint64,uint64,uint64,uint64,uint64)' | 'mint_ticket', {\n argsObj: MarketPlaceArgs['obj']['mint_ticket(uint64,axfer,pay)(uint64,uint64,uint64,uint64,uint64)']\n argsTuple: MarketPlaceArgs['tuple']['mint_ticket(uint64,axfer,pay)(uint64,uint64,uint64,uint64,uint64)']\n returns: MarketPlaceReturns['mint_ticket(uint64,axfer,pay)(uint64,uint64,uint64,uint64,uint64)']\n }>\n & Record<'reserve_tickets(uint64,uint64,pay)(uint64,uint64,uint64,uint64,uint64)' | 'reserve_tickets', {\n argsObj: MarketPlaceArgs['obj']['reserve_tickets(uint64,uint64,pay)(uint64,uint64,uint64,uint64,uint64)']\n argsTuple: MarketPlaceArgs['tuple']['reserve_tickets(uint64,uint64,pay)(uint64,uint64,uint64,uint64,uint64)']\n returns: MarketPlaceReturns['reserve_tickets(uint64,uint64,pay)(uint64,uint64,uint64,uint64,uint64)']\n }>\n & Record<'claim_ticket(uint64,axfer)(uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64)' | 'claim_ticket', {\n argsObj: MarketPlaceArgs['obj']['claim_ticket(uint64,axfer)(uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64)']\n argsTuple: MarketPlaceArgs['tuple']['claim_ticket(uint64,axfer)(uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64)']\n returns: MarketPlaceReturns['claim_ticket(uint64,axfer)(uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64)']\n }>\n & Record<'redeem_ticket(uint64,asset)(uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64)' | 'redeem_ticket', {\n argsObj: MarketPlaceArgs['obj']['redeem_ticket(uint64,asset)(uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64)']\n argsTuple: MarketPlaceArgs['tuple']['redeem_ticket(uint64,asset)(uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64)']\n returns: MarketPlaceReturns['redeem_ticket(uint64,asset)(uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64)']\n }>\n /**\n * Defines the shape of the state of the application.\n */\n state: {\n global: {\n keys: {\n description: BinaryState\n endDate: bigint\n eventName: BinaryState\n maxAttendees: bigint\n organizer: BinaryState\n startDate: bigint\n }\n maps: {}\n }\n }\n}\n\n/**\n * Defines the possible abi call signatures.\n */\nexport type MarketPlaceSignatures = keyof MarketPlaceTypes['methods']\n/**\n * Defines the possible abi call signatures for methods that return a non-void value.\n */\nexport type MarketPlaceNonVoidMethodSignatures = keyof MarketPlaceTypes['methods'] extends infer T ? T extends keyof MarketPlaceTypes['methods'] ? MethodReturn extends void ? never : T : never : never\n/**\n * Defines an object containing all relevant parameters for a single call to the contract.\n */\nexport type CallParams = Expand<\n Omit &\n {\n /** The args for the ABI method call, either as an ordered array or an object */\n args: Expand\n }\n>\n/**\n * Maps a method signature from the MarketPlace smart contract to the method's arguments in either tuple or struct form\n */\nexport type MethodArgs = MarketPlaceTypes['methods'][TSignature]['argsObj' | 'argsTuple']\n/**\n * Maps a method signature from the MarketPlace smart contract to the method's return type\n */\nexport type MethodReturn = MarketPlaceTypes['methods'][TSignature]['returns']\n\n/**\n * Defines the shape of the keyed global state of the application.\n */\nexport type GlobalKeysState = MarketPlaceTypes['state']['global']['keys']\n\n\n/**\n * Defines supported create method params for this smart contract\n */\nexport type MarketPlaceCreateCallParams =\n | Expand\n/**\n * Defines supported update method params for this smart contract\n */\nexport type MarketPlaceUpdateCallParams =\n | Expand & {method?: never}\n/**\n * Defines supported delete method params for this smart contract\n */\nexport type MarketPlaceDeleteCallParams =\n | Expand & {method?: never}\n/**\n * Defines arguments required for the deploy method.\n */\nexport type MarketPlaceDeployParams = Expand & {\n /**\n * Create transaction parameters to use if a create needs to be issued as part of deployment; use `method` to define ABI call (if available) or leave out for a bare call (if available)\n */\n createParams?: MarketPlaceCreateCallParams\n /**\n * Update transaction parameters to use if a create needs to be issued as part of deployment; use `method` to define ABI call (if available) or leave out for a bare call (if available)\n */\n updateParams?: MarketPlaceUpdateCallParams\n /**\n * Delete transaction parameters to use if a create needs to be issued as part of deployment; use `method` to define ABI call (if available) or leave out for a bare call (if available)\n */\n deleteParams?: MarketPlaceDeleteCallParams\n}>\n\n\n/**\n * Exposes methods for constructing `AppClient` params objects for ABI calls to the MarketPlace smart contract\n */\nexport abstract class MarketPlaceParamsFactory {\n /**\n * Constructs a no op call for the create_event_with_tiers((string,string,uint64,uint64,uint64,address),(uint64,string,uint64,string,uint64,uint64,uint64,uint64,string,uint64,uint64,uint64,string)[],pay)uint64 ABI method\n *\n * Initialize the event contract\n *\n * @param params Parameters for the call\n * @returns An `AppClientMethodCallParams` object for the call\n */\n static createEventWithTiers(params: CallParams & CallOnComplete): AppClientMethodCallParams & CallOnComplete {\n return {\n ...params,\n method: 'create_event_with_tiers((string,string,uint64,uint64,uint64,address),(uint64,string,uint64,string,uint64,uint64,uint64,uint64,string,uint64,uint64,uint64,string)[],pay)uint64' as const,\n args: Array.isArray(params.args) ? params.args : [params.args.eventDetails, params.args.tiersDetails, params.args.minBal],\n }\n }\n /**\n * Constructs a no op call for the mint_ticket(uint64,axfer,pay)(uint64,uint64,uint64,uint64,uint64) ABI method\n *\n * Mint a new ticket NFT for the specified tier\n *\n * @param params Parameters for the call\n * @returns An `AppClientMethodCallParams` object for the call\n */\n static mintTicket(params: CallParams & CallOnComplete): AppClientMethodCallParams & CallOnComplete {\n return {\n ...params,\n method: 'mint_ticket(uint64,axfer,pay)(uint64,uint64,uint64,uint64,uint64)' as const,\n args: Array.isArray(params.args) ? params.args : [params.args.tierId, params.args.optIn, params.args.buyTicket],\n }\n }\n /**\n * Constructs a no op call for the reserve_tickets(uint64,uint64,pay)(uint64,uint64,uint64,uint64,uint64) ABI method\n *\n * Reserve tickets\n *\n * @param params Parameters for the call\n * @returns An `AppClientMethodCallParams` object for the call\n */\n static reserveTickets(params: CallParams & CallOnComplete): AppClientMethodCallParams & CallOnComplete {\n return {\n ...params,\n method: 'reserve_tickets(uint64,uint64,pay)(uint64,uint64,uint64,uint64,uint64)' as const,\n args: Array.isArray(params.args) ? params.args : [params.args.tierId, params.args.reservedTickets, params.args.buyTicket],\n }\n }\n /**\n * Constructs a no op call for the claim_ticket(uint64,axfer)(uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64) ABI method\n *\n * Claim a single ticket NFT\n *\n * @param params Parameters for the call\n * @returns An `AppClientMethodCallParams` object for the call\n */\n static claimTicket(params: CallParams & CallOnComplete): AppClientMethodCallParams & CallOnComplete {\n return {\n ...params,\n method: 'claim_ticket(uint64,axfer)(uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64)' as const,\n args: Array.isArray(params.args) ? params.args : [params.args.tierId, params.args.optIn],\n }\n }\n /**\n * Constructs a no op call for the redeem_ticket(uint64,asset)(uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64) ABI method\n *\n * Redeem a single ticket NFT\n *\n * @param params Parameters for the call\n * @returns An `AppClientMethodCallParams` object for the call\n */\n static redeemTicket(params: CallParams & CallOnComplete): AppClientMethodCallParams & CallOnComplete {\n return {\n ...params,\n method: 'redeem_ticket(uint64,asset)(uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64)' as const,\n args: Array.isArray(params.args) ? params.args : [params.args.tierId, params.args.asset],\n }\n }\n}\n\n/**\n * A factory to create and deploy one or more instance of the MarketPlace smart contract and to create one or more app clients to interact with those (or other) app instances\n */\nexport class MarketPlaceFactory {\n /**\n * The underlying `AppFactory` for when you want to have more flexibility\n */\n public readonly appFactory: _AppFactory\n\n /**\n * Creates a new instance of `MarketPlaceFactory`\n *\n * @param params The parameters to initialise the app factory with\n */\n constructor(params: Omit) {\n this.appFactory = new _AppFactory({\n ...params,\n appSpec: APP_SPEC,\n })\n }\n \n /** The name of the app (from the ARC-32 / ARC-56 app spec or override). */\n public get appName() {\n return this.appFactory.appName\n }\n \n /** The ARC-56 app spec being used */\n get appSpec() {\n return APP_SPEC\n }\n \n /** A reference to the underlying `AlgorandClient` this app factory is using. */\n public get algorand(): AlgorandClientInterface {\n return this.appFactory.algorand\n }\n \n /**\n * Returns a new `AppClient` client for an app instance of the given ID.\n *\n * Automatically populates appName, defaultSender and source maps from the factory\n * if not specified in the params.\n * @param params The parameters to create the app client\n * @returns The `AppClient`\n */\n public getAppClientById(params: AppFactoryAppClientParams) {\n return new MarketPlaceClient(this.appFactory.getAppClientById(params))\n }\n \n /**\n * Returns a new `AppClient` client, resolving the app by creator address and name\n * using AlgoKit app deployment semantics (i.e. looking for the app creation transaction note).\n *\n * Automatically populates appName, defaultSender and source maps from the factory\n * if not specified in the params.\n * @param params The parameters to create the app client\n * @returns The `AppClient`\n */\n public async getAppClientByCreatorAndName(\n params: AppFactoryResolveAppClientByCreatorAndNameParams,\n ) {\n return new MarketPlaceClient(await this.appFactory.getAppClientByCreatorAndName(params))\n }\n\n /**\n * Idempotently deploys the MarketPlace smart contract.\n *\n * @param params The arguments for the contract calls and any additional parameters for the call\n * @returns The deployment result\n */\n public async deploy(params: MarketPlaceDeployParams = {}) {\n const result = await this.appFactory.deploy({\n ...params,\n })\n return { result: result.result, appClient: new MarketPlaceClient(result.appClient) }\n }\n\n /**\n * Get parameters to create transactions (create and deploy related calls) for the current app. A good mental model for this is that these parameters represent a deferred transaction creation.\n */\n readonly params = {\n /**\n * Gets available create methods\n */\n create: {\n /**\n * Creates a new instance of the MarketPlace smart contract using a bare call.\n *\n * @param params The params for the bare (raw) call\n * @returns The params for a create call\n */\n bare: (params?: Expand) => {\n return this.appFactory.params.bare.create(params)\n },\n },\n\n /**\n * Gets available deployUpdate methods\n */\n deployUpdate: {\n /**\n * Updates an existing instance of the MarketPlace smart contract using a bare call.\n *\n * @param params The params for the bare (raw) call\n * @returns The params for a deployUpdate call\n */\n bare: (params?: Expand) => {\n return this.appFactory.params.bare.deployUpdate(params)\n },\n },\n\n /**\n * Gets available deployDelete methods\n */\n deployDelete: {\n /**\n * Deletes an existing instance of the MarketPlace smart contract using a bare call.\n *\n * @param params The params for the bare (raw) call\n * @returns The params for a deployDelete call\n */\n bare: (params?: Expand) => {\n return this.appFactory.params.bare.deployDelete(params)\n },\n },\n\n }\n\n /**\n * Create transactions for the current app\n */\n readonly createTransaction = {\n /**\n * Gets available create methods\n */\n create: {\n /**\n * Creates a new instance of the MarketPlace smart contract using a bare call.\n *\n * @param params The params for the bare (raw) call\n * @returns The transaction for a create call\n */\n bare: (params?: Expand) => {\n return this.appFactory.createTransaction.bare.create(params)\n },\n },\n\n }\n\n /**\n * Send calls to the current app\n */\n readonly send = {\n /**\n * Gets available create methods\n */\n create: {\n /**\n * Creates a new instance of the MarketPlace smart contract using a bare call.\n *\n * @param params The params for the bare (raw) call\n * @returns The create result\n */\n bare: async (params?: Expand) => {\n const result = await this.appFactory.send.bare.create(params)\n return { result: result.result, appClient: new MarketPlaceClient(result.appClient) }\n },\n },\n\n }\n\n}\n/**\n * A client to make calls to the MarketPlace smart contract\n */\nexport class MarketPlaceClient {\n /**\n * The underlying `AppClient` for when you want to have more flexibility\n */\n public readonly appClient: _AppClient\n\n /**\n * Creates a new instance of `MarketPlaceClient`\n *\n * @param appClient An `AppClient` instance which has been created with the MarketPlace app spec\n */\n constructor(appClient: _AppClient)\n /**\n * Creates a new instance of `MarketPlaceClient`\n *\n * @param params The parameters to initialise the app client with\n */\n constructor(params: Omit)\n constructor(appClientOrParams: _AppClient | Omit) {\n this.appClient = appClientOrParams instanceof _AppClient ? appClientOrParams : new _AppClient({\n ...appClientOrParams,\n appSpec: APP_SPEC,\n })\n }\n \n /**\n * Checks for decode errors on the given return value and maps the return value to the return type for the given method\n * @returns The typed return value or undefined if there was no value\n */\n decodeReturnValue(method: TSignature, returnValue: ABIReturn | undefined) {\n return returnValue !== undefined ? getArc56ReturnValue>(returnValue, this.appClient.getABIMethod(method), APP_SPEC.structs) : undefined\n }\n \n /**\n * Returns a new `MarketPlaceClient` client, resolving the app by creator address and name\n * using AlgoKit app deployment semantics (i.e. looking for the app creation transaction note).\n * @param params The parameters to create the app client\n */\n public static async fromCreatorAndName(params: Omit): Promise {\n return new MarketPlaceClient(await _AppClient.fromCreatorAndName({...params, appSpec: APP_SPEC}))\n }\n \n /**\n * Returns an `MarketPlaceClient` instance for the current network based on\n * pre-determined network-specific app IDs specified in the ARC-56 app spec.\n *\n * If no IDs are in the app spec or the network isn't recognised, an error is thrown.\n * @param params The parameters to create the app client\n */\n static async fromNetwork(\n params: Omit\n ): Promise {\n return new MarketPlaceClient(await _AppClient.fromNetwork({...params, appSpec: APP_SPEC}))\n }\n \n /** The ID of the app instance this client is linked to. */\n public get appId() {\n return this.appClient.appId\n }\n \n /** The app address of the app instance this client is linked to. */\n public get appAddress() {\n return this.appClient.appAddress\n }\n \n /** The name of the app. */\n public get appName() {\n return this.appClient.appName\n }\n \n /** The ARC-56 app spec being used */\n public get appSpec() {\n return this.appClient.appSpec\n }\n \n /** A reference to the underlying `AlgorandClient` this app client is using. */\n public get algorand(): AlgorandClientInterface {\n return this.appClient.algorand\n }\n\n /**\n * Get parameters to create transactions for the current app. A good mental model for this is that these parameters represent a deferred transaction creation.\n */\n readonly params = {\n /**\n * Gets available update methods\n */\n update: {\n /**\n * Updates an existing instance of the MarketPlace smart contract using a bare call.\n *\n * @param params The params for the bare (raw) call\n * @returns The update result\n */\n bare: (params?: Expand) => {\n return this.appClient.params.bare.update(params)\n },\n },\n\n /**\n * Gets available delete methods\n */\n delete: {\n /**\n * Deletes an existing instance of the MarketPlace smart contract using a bare call.\n *\n * @param params The params for the bare (raw) call\n * @returns The delete result\n */\n bare: (params?: Expand) => {\n return this.appClient.params.bare.delete(params)\n },\n },\n\n /**\n * Makes a clear_state call to an existing instance of the MarketPlace smart contract.\n *\n * @param params The params for the bare (raw) call\n * @returns The clearState result\n */\n clearState: (params?: Expand) => {\n return this.appClient.params.bare.clearState(params)\n },\n\n /**\n * Makes a call to the MarketPlace smart contract using the `create_event_with_tiers((string,string,uint64,uint64,uint64,address),(uint64,string,uint64,string,uint64,uint64,uint64,uint64,string,uint64,uint64,uint64,string)[],pay)uint64` ABI method.\n *\n * Initialize the event contract\n *\n * @param params The params for the smart contract call\n * @returns The call params\n */\n createEventWithTiers: (params: CallParams & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n return this.appClient.params.call(MarketPlaceParamsFactory.createEventWithTiers(params))\n },\n\n /**\n * Makes a call to the MarketPlace smart contract using the `mint_ticket(uint64,axfer,pay)(uint64,uint64,uint64,uint64,uint64)` ABI method.\n *\n * Mint a new ticket NFT for the specified tier\n *\n * @param params The params for the smart contract call\n * @returns The call params\n */\n mintTicket: (params: CallParams & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n return this.appClient.params.call(MarketPlaceParamsFactory.mintTicket(params))\n },\n\n /**\n * Makes a call to the MarketPlace smart contract using the `reserve_tickets(uint64,uint64,pay)(uint64,uint64,uint64,uint64,uint64)` ABI method.\n *\n * Reserve tickets\n *\n * @param params The params for the smart contract call\n * @returns The call params\n */\n reserveTickets: (params: CallParams & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n return this.appClient.params.call(MarketPlaceParamsFactory.reserveTickets(params))\n },\n\n /**\n * Makes a call to the MarketPlace smart contract using the `claim_ticket(uint64,axfer)(uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64)` ABI method.\n *\n * Claim a single ticket NFT\n *\n * @param params The params for the smart contract call\n * @returns The call params\n */\n claimTicket: (params: CallParams & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n return this.appClient.params.call(MarketPlaceParamsFactory.claimTicket(params))\n },\n\n /**\n * Makes a call to the MarketPlace smart contract using the `redeem_ticket(uint64,asset)(uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64)` ABI method.\n *\n * Redeem a single ticket NFT\n *\n * @param params The params for the smart contract call\n * @returns The call params\n */\n redeemTicket: (params: CallParams & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n return this.appClient.params.call(MarketPlaceParamsFactory.redeemTicket(params))\n },\n\n }\n\n /**\n * Create transactions for the current app\n */\n readonly createTransaction = {\n /**\n * Gets available update methods\n */\n update: {\n /**\n * Updates an existing instance of the MarketPlace smart contract using a bare call.\n *\n * @param params The params for the bare (raw) call\n * @returns The update result\n */\n bare: (params?: Expand) => {\n return this.appClient.createTransaction.bare.update(params)\n },\n },\n\n /**\n * Gets available delete methods\n */\n delete: {\n /**\n * Deletes an existing instance of the MarketPlace smart contract using a bare call.\n *\n * @param params The params for the bare (raw) call\n * @returns The delete result\n */\n bare: (params?: Expand) => {\n return this.appClient.createTransaction.bare.delete(params)\n },\n },\n\n /**\n * Makes a clear_state call to an existing instance of the MarketPlace smart contract.\n *\n * @param params The params for the bare (raw) call\n * @returns The clearState result\n */\n clearState: (params?: Expand) => {\n return this.appClient.createTransaction.bare.clearState(params)\n },\n\n /**\n * Makes a call to the MarketPlace smart contract using the `create_event_with_tiers((string,string,uint64,uint64,uint64,address),(uint64,string,uint64,string,uint64,uint64,uint64,uint64,string,uint64,uint64,uint64,string)[],pay)uint64` ABI method.\n *\n * Initialize the event contract\n *\n * @param params The params for the smart contract call\n * @returns The call transaction\n */\n createEventWithTiers: (params: CallParams & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n return this.appClient.createTransaction.call(MarketPlaceParamsFactory.createEventWithTiers(params))\n },\n\n /**\n * Makes a call to the MarketPlace smart contract using the `mint_ticket(uint64,axfer,pay)(uint64,uint64,uint64,uint64,uint64)` ABI method.\n *\n * Mint a new ticket NFT for the specified tier\n *\n * @param params The params for the smart contract call\n * @returns The call transaction\n */\n mintTicket: (params: CallParams & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n return this.appClient.createTransaction.call(MarketPlaceParamsFactory.mintTicket(params))\n },\n\n /**\n * Makes a call to the MarketPlace smart contract using the `reserve_tickets(uint64,uint64,pay)(uint64,uint64,uint64,uint64,uint64)` ABI method.\n *\n * Reserve tickets\n *\n * @param params The params for the smart contract call\n * @returns The call transaction\n */\n reserveTickets: (params: CallParams & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n return this.appClient.createTransaction.call(MarketPlaceParamsFactory.reserveTickets(params))\n },\n\n /**\n * Makes a call to the MarketPlace smart contract using the `claim_ticket(uint64,axfer)(uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64)` ABI method.\n *\n * Claim a single ticket NFT\n *\n * @param params The params for the smart contract call\n * @returns The call transaction\n */\n claimTicket: (params: CallParams & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n return this.appClient.createTransaction.call(MarketPlaceParamsFactory.claimTicket(params))\n },\n\n /**\n * Makes a call to the MarketPlace smart contract using the `redeem_ticket(uint64,asset)(uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64)` ABI method.\n *\n * Redeem a single ticket NFT\n *\n * @param params The params for the smart contract call\n * @returns The call transaction\n */\n redeemTicket: (params: CallParams & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n return this.appClient.createTransaction.call(MarketPlaceParamsFactory.redeemTicket(params))\n },\n\n }\n\n /**\n * Send calls to the current app\n */\n readonly send = {\n /**\n * Gets available update methods\n */\n update: {\n /**\n * Updates an existing instance of the MarketPlace smart contract using a bare call.\n *\n * @param params The params for the bare (raw) call\n * @returns The update result\n */\n bare: (params?: Expand) => {\n return this.appClient.send.bare.update(params)\n },\n },\n\n /**\n * Gets available delete methods\n */\n delete: {\n /**\n * Deletes an existing instance of the MarketPlace smart contract using a bare call.\n *\n * @param params The params for the bare (raw) call\n * @returns The delete result\n */\n bare: (params?: Expand) => {\n return this.appClient.send.bare.delete(params)\n },\n },\n\n /**\n * Makes a clear_state call to an existing instance of the MarketPlace smart contract.\n *\n * @param params The params for the bare (raw) call\n * @returns The clearState result\n */\n clearState: (params?: Expand) => {\n return this.appClient.send.bare.clearState(params)\n },\n\n /**\n * Makes a call to the MarketPlace smart contract using the `create_event_with_tiers((string,string,uint64,uint64,uint64,address),(uint64,string,uint64,string,uint64,uint64,uint64,uint64,string,uint64,uint64,uint64,string)[],pay)uint64` ABI method.\n *\n * Initialize the event contract\n *\n * @param params The params for the smart contract call\n * @returns The call result\n */\n createEventWithTiers: async (params: CallParams & SendParams & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n const result = await this.appClient.send.call(MarketPlaceParamsFactory.createEventWithTiers(params))\n return {...result, return: result.return as unknown as (undefined | MarketPlaceReturns['create_event_with_tiers((string,string,uint64,uint64,uint64,address),(uint64,string,uint64,string,uint64,uint64,uint64,uint64,string,uint64,uint64,uint64,string)[],pay)uint64'])}\n },\n\n /**\n * Makes a call to the MarketPlace smart contract using the `mint_ticket(uint64,axfer,pay)(uint64,uint64,uint64,uint64,uint64)` ABI method.\n *\n * Mint a new ticket NFT for the specified tier\n *\n * @param params The params for the smart contract call\n * @returns The call result\n */\n mintTicket: async (params: CallParams & SendParams & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n const result = await this.appClient.send.call(MarketPlaceParamsFactory.mintTicket(params))\n return {...result, return: result.return as unknown as (undefined | MarketPlaceReturns['mint_ticket(uint64,axfer,pay)(uint64,uint64,uint64,uint64,uint64)'])}\n },\n\n /**\n * Makes a call to the MarketPlace smart contract using the `reserve_tickets(uint64,uint64,pay)(uint64,uint64,uint64,uint64,uint64)` ABI method.\n *\n * Reserve tickets\n *\n * @param params The params for the smart contract call\n * @returns The call result\n */\n reserveTickets: async (params: CallParams & SendParams & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n const result = await this.appClient.send.call(MarketPlaceParamsFactory.reserveTickets(params))\n return {...result, return: result.return as unknown as (undefined | MarketPlaceReturns['reserve_tickets(uint64,uint64,pay)(uint64,uint64,uint64,uint64,uint64)'])}\n },\n\n /**\n * Makes a call to the MarketPlace smart contract using the `claim_ticket(uint64,axfer)(uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64)` ABI method.\n *\n * Claim a single ticket NFT\n *\n * @param params The params for the smart contract call\n * @returns The call result\n */\n claimTicket: async (params: CallParams & SendParams & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n const result = await this.appClient.send.call(MarketPlaceParamsFactory.claimTicket(params))\n return {...result, return: result.return as unknown as (undefined | MarketPlaceReturns['claim_ticket(uint64,axfer)(uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64)'])}\n },\n\n /**\n * Makes a call to the MarketPlace smart contract using the `redeem_ticket(uint64,asset)(uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64)` ABI method.\n *\n * Redeem a single ticket NFT\n *\n * @param params The params for the smart contract call\n * @returns The call result\n */\n redeemTicket: async (params: CallParams & SendParams & {onComplete?: OnApplicationComplete.NoOpOC}) => {\n const result = await this.appClient.send.call(MarketPlaceParamsFactory.redeemTicket(params))\n return {...result, return: result.return as unknown as (undefined | MarketPlaceReturns['redeem_ticket(uint64,asset)(uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64)'])}\n },\n\n }\n\n /**\n * Clone this app client with different params\n *\n * @param params The params to use for the the cloned app client. Omit a param to keep the original value. Set a param to override the original value. Setting to undefined will clear the original value.\n * @returns A new app client with the altered params\n */\n public clone(params: CloneAppClientParams) {\n return new MarketPlaceClient(this.appClient.clone(params))\n }\n\n /**\n * Methods to access state for the current MarketPlace app\n */\n state = {\n /**\n * Methods to access global state for the current MarketPlace app\n */\n global: {\n /**\n * Get all current keyed values from global state\n */\n getAll: async (): Promise>> => {\n const result = await this.appClient.state.global.getAll()\n return {\n description: new BinaryStateValue(result.description),\n endDate: result.end_date,\n eventName: new BinaryStateValue(result.event_name),\n maxAttendees: result.max_attendees,\n organizer: new BinaryStateValue(result.organizer),\n startDate: result.start_date,\n }\n },\n /**\n * Get the current value of the description key in global state\n */\n description: async (): Promise => { return new BinaryStateValue((await this.appClient.state.global.getValue(\"description\")) as Uint8Array | undefined) },\n /**\n * Get the current value of the end_date key in global state\n */\n endDate: async (): Promise => { return (await this.appClient.state.global.getValue(\"end_date\")) as bigint | undefined },\n /**\n * Get the current value of the event_name key in global state\n */\n eventName: async (): Promise => { return new BinaryStateValue((await this.appClient.state.global.getValue(\"event_name\")) as Uint8Array | undefined) },\n /**\n * Get the current value of the max_attendees key in global state\n */\n maxAttendees: async (): Promise => { return (await this.appClient.state.global.getValue(\"max_attendees\")) as bigint | undefined },\n /**\n * Get the current value of the organizer key in global state\n */\n organizer: async (): Promise => { return new BinaryStateValue((await this.appClient.state.global.getValue(\"organizer\")) as Uint8Array | undefined) },\n /**\n * Get the current value of the start_date key in global state\n */\n startDate: async (): Promise => { return (await this.appClient.state.global.getValue(\"start_date\")) as bigint | undefined },\n },\n }\n\n public newGroup(): MarketPlaceComposer {\n const client = this\n const composer = this.algorand.newGroup()\n let promiseChain:Promise = Promise.resolve()\n const resultMappers: Array any)> = []\n return {\n /**\n * Add a create_event_with_tiers((string,string,uint64,uint64,uint64,address),(uint64,string,uint64,string,uint64,uint64,uint64,uint64,string,uint64,uint64,uint64,string)[],pay)uint64 method call against the MarketPlace contract\n */\n createEventWithTiers(params: CallParams & {onComplete?: OnApplicationComplete.NoOpOC}) {\n promiseChain = promiseChain.then(async () => composer.addAppCallMethodCall(await client.params.createEventWithTiers(params)))\n resultMappers.push((v) => client.decodeReturnValue('create_event_with_tiers((string,string,uint64,uint64,uint64,address),(uint64,string,uint64,string,uint64,uint64,uint64,uint64,string,uint64,uint64,uint64,string)[],pay)uint64', v))\n return this\n },\n /**\n * Add a mint_ticket(uint64,axfer,pay)(uint64,uint64,uint64,uint64,uint64) method call against the MarketPlace contract\n */\n mintTicket(params: CallParams & {onComplete?: OnApplicationComplete.NoOpOC}) {\n promiseChain = promiseChain.then(async () => composer.addAppCallMethodCall(await client.params.mintTicket(params)))\n resultMappers.push((v) => client.decodeReturnValue('mint_ticket(uint64,axfer,pay)(uint64,uint64,uint64,uint64,uint64)', v))\n return this\n },\n /**\n * Add a reserve_tickets(uint64,uint64,pay)(uint64,uint64,uint64,uint64,uint64) method call against the MarketPlace contract\n */\n reserveTickets(params: CallParams & {onComplete?: OnApplicationComplete.NoOpOC}) {\n promiseChain = promiseChain.then(async () => composer.addAppCallMethodCall(await client.params.reserveTickets(params)))\n resultMappers.push((v) => client.decodeReturnValue('reserve_tickets(uint64,uint64,pay)(uint64,uint64,uint64,uint64,uint64)', v))\n return this\n },\n /**\n * Add a claim_ticket(uint64,axfer)(uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64) method call against the MarketPlace contract\n */\n claimTicket(params: CallParams & {onComplete?: OnApplicationComplete.NoOpOC}) {\n promiseChain = promiseChain.then(async () => composer.addAppCallMethodCall(await client.params.claimTicket(params)))\n resultMappers.push((v) => client.decodeReturnValue('claim_ticket(uint64,axfer)(uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64)', v))\n return this\n },\n /**\n * Add a redeem_ticket(uint64,asset)(uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64) method call against the MarketPlace contract\n */\n redeemTicket(params: CallParams & {onComplete?: OnApplicationComplete.NoOpOC}) {\n promiseChain = promiseChain.then(async () => composer.addAppCallMethodCall(await client.params.redeemTicket(params)))\n resultMappers.push((v) => client.decodeReturnValue('redeem_ticket(uint64,asset)(uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64)', v))\n return this\n },\n get update() {\n return {\n bare: (params?: AppClientBareCallParams & AppClientCompilationParams ) => {\n promiseChain = promiseChain.then(async () => composer.addAppUpdate(await client.params.update.bare(params)))\n return this\n },\n }\n },\n get delete() {\n return {\n bare: (params?: AppClientBareCallParams ) => {\n promiseChain = promiseChain.then(() => composer.addAppDelete(client.params.delete.bare(params)))\n return this\n },\n }\n },\n /**\n * Add a clear state call to the MarketPlace contract\n */\n clearState(params: AppClientBareCallParams) {\n promiseChain = promiseChain.then(() => composer.addAppCall(client.params.clearState(params)))\n return this\n },\n addTransaction(txn: Transaction, signer?: TransactionSigner) {\n promiseChain = promiseChain.then(() => composer.addTransaction(txn, signer))\n return this\n },\n async composer() {\n await promiseChain\n return composer\n },\n async simulate(options?: SimulateOptions) {\n await promiseChain\n const result = await (!options ? composer.simulate() : composer.simulate(options))\n return {\n ...result,\n returns: result.returns?.map((val, i) => resultMappers[i] !== undefined ? resultMappers[i]!(val) : val.returnValue)\n }\n },\n async send(params?: SendParams) {\n await promiseChain\n const result = await composer.send(params)\n return {\n ...result,\n returns: result.returns?.map((val, i) => resultMappers[i] !== undefined ? resultMappers[i]!(val) : val.returnValue)\n }\n }\n } as unknown as MarketPlaceComposer\n }\n}\nexport type MarketPlaceComposer = {\n /**\n * Calls the create_event_with_tiers((string,string,uint64,uint64,uint64,address),(uint64,string,uint64,string,uint64,uint64,uint64,uint64,string,uint64,uint64,uint64,string)[],pay)uint64 ABI method.\n *\n * Initialize the event contract\n *\n * @param args The arguments for the contract call\n * @param params Any additional parameters for the call\n * @returns The typed transaction composer so you can fluently chain multiple calls or call execute to execute all queued up transactions\n */\n createEventWithTiers(params?: CallParams): MarketPlaceComposer<[...TReturns, MarketPlaceReturns['create_event_with_tiers((string,string,uint64,uint64,uint64,address),(uint64,string,uint64,string,uint64,uint64,uint64,uint64,string,uint64,uint64,uint64,string)[],pay)uint64'] | undefined]>\n\n /**\n * Calls the mint_ticket(uint64,axfer,pay)(uint64,uint64,uint64,uint64,uint64) ABI method.\n *\n * Mint a new ticket NFT for the specified tier\n *\n * @param args The arguments for the contract call\n * @param params Any additional parameters for the call\n * @returns The typed transaction composer so you can fluently chain multiple calls or call execute to execute all queued up transactions\n */\n mintTicket(params?: CallParams): MarketPlaceComposer<[...TReturns, MarketPlaceReturns['mint_ticket(uint64,axfer,pay)(uint64,uint64,uint64,uint64,uint64)'] | undefined]>\n\n /**\n * Calls the reserve_tickets(uint64,uint64,pay)(uint64,uint64,uint64,uint64,uint64) ABI method.\n *\n * Reserve tickets\n *\n * @param args The arguments for the contract call\n * @param params Any additional parameters for the call\n * @returns The typed transaction composer so you can fluently chain multiple calls or call execute to execute all queued up transactions\n */\n reserveTickets(params?: CallParams): MarketPlaceComposer<[...TReturns, MarketPlaceReturns['reserve_tickets(uint64,uint64,pay)(uint64,uint64,uint64,uint64,uint64)'] | undefined]>\n\n /**\n * Calls the claim_ticket(uint64,axfer)(uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64) ABI method.\n *\n * Claim a single ticket NFT\n *\n * @param args The arguments for the contract call\n * @param params Any additional parameters for the call\n * @returns The typed transaction composer so you can fluently chain multiple calls or call execute to execute all queued up transactions\n */\n claimTicket(params?: CallParams): MarketPlaceComposer<[...TReturns, MarketPlaceReturns['claim_ticket(uint64,axfer)(uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64)'] | undefined]>\n\n /**\n * Calls the redeem_ticket(uint64,asset)(uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64) ABI method.\n *\n * Redeem a single ticket NFT\n *\n * @param args The arguments for the contract call\n * @param params Any additional parameters for the call\n * @returns The typed transaction composer so you can fluently chain multiple calls or call execute to execute all queued up transactions\n */\n redeemTicket(params?: CallParams): MarketPlaceComposer<[...TReturns, MarketPlaceReturns['redeem_ticket(uint64,asset)(uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64,uint64)'] | undefined]>\n\n /**\n * Gets available delete methods\n */\n readonly delete: {\n /**\n * Deletes an existing instance of the MarketPlace smart contract using a bare call.\n *\n * @param args The arguments for the bare call\n * @returns The typed transaction composer so you can fluently chain multiple calls or call execute to execute all queued up transactions\n */\n bare(params?: AppClientBareCallParams ): MarketPlaceComposer<[...TReturns, undefined]>\n }\n\n /**\n * Makes a clear_state call to an existing instance of the MarketPlace smart contract.\n *\n * @param args The arguments for the bare call\n * @returns The typed transaction composer so you can fluently chain multiple calls or call execute to execute all queued up transactions\n */\n clearState(params?: AppClientBareCallParams): MarketPlaceComposer<[...TReturns, undefined]>\n\n /**\n * Adds a transaction to the composer\n *\n * @param txn A transaction to add to the transaction group\n * @param signer The optional signer to use when signing this transaction.\n */\n addTransaction(txn: Transaction, signer?: TransactionSigner): MarketPlaceComposer\n /**\n * Returns the underlying AtomicTransactionComposer instance\n */\n composer(): Promise\n /**\n * Simulates the transaction group and returns the result\n */\n simulate(): Promise & { simulateResponse: SimulateResponse }>\n simulate(options: SkipSignaturesSimulateOptions): Promise & { simulateResponse: SimulateResponse }>\n simulate(options: RawSimulateOptions): Promise & { simulateResponse: SimulateResponse }>\n /**\n * Sends the transaction group to the network and returns the results\n */\n send(params?: SendParams): Promise>\n}\nexport type MarketPlaceComposerResults = Expand\n\n","import { BoxName } from '@algorandfoundation/algokit-utils/types/app'\nimport algosdk, { encodeAddress } from 'algosdk'\nimport { GlobalKeysState, MarketPlaceClient } from '../../contracts/MarketPlace'\n\nexport const minBal = 100000\nexport const minAssetBal = 100000\nexport const uint64Byte = 8\nexport const minBoxFee = 2500\nexport const boxConstant = 400\nexport const totalUInt64 = 11\nexport const addressBytes = 32\nexport const stdTicketCost = 1000000\nexport const vipTicketCost = 2000000\nexport const testTierCount = 2\nexport const txnFee = 1000\nexport const tierAId = 12345\nexport const tierBId = 67890\nexport const tierAGrpDiscount = 10\nexport const tierAGrpSize = 2\nexport const tierBGrpDiscount = 5\nexport const tierBGrpSize = 2\n\nfunction decodeGlobalState(global: any) {\n return {\n description: new TextDecoder().decode(global.description),\n endDate: new Date(Number(global.end_date) * 1000),\n eventName: new TextDecoder().decode(global.event_name),\n maxAttendees: Number(global.max_attendees),\n organizer: encodeAddress(global.organizer),\n startDate: new Date(Number(global.start_date) * 1000),\n }\n}\nexport async function getGlobalState(client: MarketPlaceClient): Promise {\n const globalSts = await client.appClient.state.global.getAll()\n return decodeGlobalState(globalSts as GlobalKeysState)\n}\nexport async function getBoxes(\n client: MarketPlaceClient,\n): Promise<{ reservations: Reservation[] | undefined; tiers: BoxTicketTier[] | undefined }> {\n const boxes = await client.appClient.getBoxValues()\n console.log({ boxes })\n const decodeTierBoxes = boxes.map((box) => decodeTierBoxByAbi(box)).filter((box) => box !== undefined)\n const decodeReserveBoxes = boxes.map((box) => decodeReserveBoxByAbi(box)).filter((box) => box !== undefined)\n return {\n reservations: decodeReserveBoxes,\n tiers: decodeTierBoxes,\n }\n}\nfunction decodeTierBoxByAbi(b: { name: BoxName; value: Uint8Array }): BoxTicketTier | undefined {\n if (!b.name.nameBase64.startsWith('AAAAAAA')) return undefined\n return decodeTier(b.value)\n}\nfunction decodeReserveBoxByAbi(b: { name: BoxName; value: Uint8Array }): Reservation | undefined {\n if (b.name.nameBase64.startsWith('AAAAAAA')) return undefined\n const reservationSchema = new algosdk.ABITupleType([\n new algosdk.ABIAddressType(), // reservor\n new algosdk.ABIUintType(64), // ticket_tier\n ])\n const decodedValue = reservationSchema.decode(b.value)\n\n const reservation = {\n reservor: decodedValue[0].toString(),\n ticket_tier: Number(decodedValue[1]),\n reservee: encodeAddress(b.name.nameRaw),\n }\n return reservation\n}\nfunction decodeTier(value: Uint8Array): BoxTicketTier {\n const ticketTierSchema = new algosdk.ABITupleType([\n new algosdk.ABIUintType(64), // id\n new algosdk.ABIUintType(64), // asset_id\n new algosdk.ABIUintType(64), // price\n new algosdk.ABIUintType(64), // max_price\n new algosdk.ABIUintType(64), // max_supply\n new algosdk.ABIUintType(64), // current_supply\n new algosdk.ABIUintType(64), // group_size\n new algosdk.ABIUintType(64), // group_discount\n new algosdk.ABIUintType(64), // reserved_tickets\n new algosdk.ABIUintType(64), // redeemed_tickets\n ])\n const decodedValue = ticketTierSchema.decode(value)\n\n const ticketTier = {\n id: decodedValue[0].toString(),\n asset_id: Number(decodedValue[1]),\n price: Number(decodedValue[2]),\n max_price: Number(decodedValue[3]),\n max_supply: Number(decodedValue[4]),\n current_supply: Number(decodedValue[5]),\n group_size: Number(decodedValue[6]),\n group_discount: Number(decodedValue[7]),\n reserved_tickets: Number(decodedValue[8]),\n redeemed_tickets: Number(decodedValue[9]),\n }\n return ticketTier\n}\nexport const getBox = async (client: MarketPlaceClient, key: number) => {\n const boxes = await getBoxes(client)\n if (!boxes.tiers) return undefined\n return findBoxById(boxes.tiers, key)\n}\nexport const getReservation = async (client: MarketPlaceClient, address: string) => {\n const boxes = await getBoxes(client)\n if (!boxes.reservations) return undefined\n const reservations = boxes.reservations\n return reservations.find((reservation) => reservation.reservee === address)\n}\nexport const getReservationFromBox = (boxes: EventBoxes, address: string) => {\n if (!boxes.reservations) return undefined\n const reservations = boxes.reservations\n return reservations.find((reservation) => reservation.reservee === address)\n}\nconst findBoxById = (array: BoxTicketTier[], id: number) => {\n return array.find((obj) => Number(obj.id) === id)\n}\n\nexport function calculateTierBoxCost(num: number) {\n const totalBoxBytes = minBoxFee + boxConstant * (totalUInt64 * uint64Byte)\n return totalBoxBytes * num\n}\nexport function calculateReserveBoxCost(num: number) {\n const totalBoxBytes = addressBytes * 2 + uint64Byte\n return (minBoxFee + boxConstant * totalBoxBytes) * num\n}\nexport function calculateGroupDiscount(price: number, grp: number, discount: number) {\n const d = 100 - discount\n const p = price * grp\n const maxPrice = p * d\n return Math.floor(maxPrice / 100)\n}\n\n// CALCULATE AVAILABLE TXNS\n\ninterface ProcessedCartResult {\n success: boolean\n modifiedCart: CartItem[]\n unavailableItems: Array<{\n originalQuantity: number\n availableQuantity: number\n boxId: number\n section: string\n }>\n hasChanges: boolean\n}\n\n/**\n * Calculate available tickets for a ticket tier\n */\nfunction calculateAvailableTickets(tier: BoxTicketTier): number {\n return tier.max_supply - tier.current_supply - tier.reserved_tickets - tier.redeemed_tickets\n}\n\n/**\n * Splits a cart item into individual items with quantity of 1\n */\nfunction splitCartItem(item: CartItem): CartItem[] {\n return Array.from({ length: item.quantity }, () => ({\n ...item,\n quantity: 1,\n }))\n}\n\n/**\n * Process cart items based on ticket tier availability\n */\nfunction processCartItems(cartItems: CartItem[], ticketTiers: BoxTicketTier[]): ProcessedCartResult {\n const result: ProcessedCartResult = {\n success: true,\n modifiedCart: [],\n unavailableItems: [],\n hasChanges: false,\n }\n\n // Process each cart item\n cartItems.forEach((cartItem) => {\n // Find corresponding ticket tier\n const tier = ticketTiers.find((t) => t.id === cartItem.boxId.toString())\n\n if (!tier) {\n result.success = false\n result.unavailableItems.push({\n originalQuantity: cartItem.quantity,\n availableQuantity: 0,\n boxId: cartItem.boxId,\n section: cartItem.section,\n })\n return\n }\n\n // Calculate available tickets\n const availableTickets = calculateAvailableTickets(tier)\n\n if (availableTickets === 0) {\n result.success = false\n result.unavailableItems.push({\n originalQuantity: cartItem.quantity,\n availableQuantity: 0,\n boxId: cartItem.boxId,\n section: cartItem.section,\n })\n return\n }\n\n // If requested quantity exceeds available tickets\n if (cartItem.quantity > availableTickets) {\n result.hasChanges = true\n result.unavailableItems.push({\n originalQuantity: cartItem.quantity,\n availableQuantity: availableTickets,\n boxId: cartItem.boxId,\n section: cartItem.section,\n })\n\n // Create individual cart items for available tickets\n if (availableTickets > 0) {\n const adjustedItem: CartItem = {\n ...cartItem,\n quantity: availableTickets,\n }\n result.modifiedCart.push(...splitCartItem(adjustedItem))\n }\n } else {\n // If quantity is available, split into individual items\n result.modifiedCart.push(...splitCartItem(cartItem))\n }\n })\n\n return result\n}\n\n/**\n * Process and validate cart for transaction\n */\nexport function prepareCartForTransaction(\n cartItems: CartItem[],\n ticketTiers: BoxTicketTier[],\n): {\n canProceed: boolean\n message: string\n processedCart: CartItem[]\n unavailableItems: Array<{\n originalQuantity: number\n availableQuantity: number\n boxId: number\n section: string\n }>\n} {\n const processResult = processCartItems(cartItems, ticketTiers)\n\n if (!processResult.success && processResult.modifiedCart.length === 0) {\n return {\n canProceed: false,\n message: 'None of the requested tickets are available',\n processedCart: [],\n unavailableItems: processResult.unavailableItems,\n }\n }\n\n if (processResult.hasChanges) {\n return {\n canProceed: true,\n message: 'Some tickets are not available. Would you like to proceed with available tickets?',\n processedCart: processResult.modifiedCart,\n unavailableItems: processResult.unavailableItems,\n }\n }\n\n return {\n canProceed: true,\n message: 'All requested tickets are available',\n processedCart: processResult.modifiedCart,\n unavailableItems: [],\n }\n}\n","import { AlgoAmount } from '@algorandfoundation/algokit-utils/types/amount'\nimport { encodeUint64 } from 'algosdk'\nimport { MarketPlaceClient, MarketPlaceComposer } from '../../contracts/MarketPlace'\nimport { getBoxes, txnFee } from '../../contracts/methods/utils'\n\nexport default async function buyATicket(client: MarketPlaceClient, cartItems: CartItem[], sender: string) {\n const boxes = await getBoxes(client)\n if (!boxes) throw new Error('Box Missing')\n const tiers = boxes.tiers || undefined\n if (!tiers) throw new Error('Tiers are Missing')\n const atc = client.newGroup()\n cartItems = cartItems.map((cartItem) => ({ ...cartItem, box: tiers.find((box) => Number(box.id) === cartItem.boxId) }))\n cartItems.forEach((cartItem) => {\n createReserveTicketTransaction(client, cartItem, sender, atc)\n })\n const result = await atc.send()\n\n return result.returns\n}\n\nasync function createReserveTicketTransaction(client: MarketPlaceClient, cartItem: CartItem, sender: string, atc: MarketPlaceComposer<[]>) {\n const box = cartItem.box || undefined\n if (!box) throw new Error('Missing Box')\n const assetId = Number(box?.asset_id)\n const totalTicketCost = box.price * Number(cartItem.quantity)\n const boxId = Number(box.id)\n const totalFee = txnFee * 4\n const buyTicketPayment = await client.algorand.createTransaction.payment({\n sender,\n receiver: client.appClient.appAddress,\n amount: AlgoAmount.MicroAlgos(totalTicketCost),\n staticFee: AlgoAmount.MicroAlgos(0),\n })\n\n const optinTicket = await client.algorand.createTransaction.assetTransfer({\n assetId: BigInt(assetId),\n amount: BigInt(0),\n sender,\n receiver: sender,\n staticFee: AlgoAmount.MicroAlgos(0),\n })\n\n return atc.mintTicket({\n args: {\n tierId: boxId,\n optIn: optinTicket,\n buyTicket: buyTicketPayment,\n },\n boxReferences: [\n {\n appId: BigInt(client.appId),\n name: encodeUint64(boxId),\n },\n ],\n assetReferences: [BigInt(assetId)],\n staticFee: AlgoAmount.MicroAlgos(totalFee),\n })\n}\n","import { AlgoAmount } from '@algorandfoundation/algokit-utils/types/amount'\nimport { decodeAddress, encodeUint64 } from 'algosdk'\nimport { MarketPlaceClient } from '../../contracts/MarketPlace'\nimport { getBox } from '../../contracts/methods/utils'\n\nexport default async function redeemTicket(client: MarketPlaceClient, cartItem: CartItem, sender: string, box: BoxTicketTier | undefined) {\n const redeemTicketParams = await getRedeemTicketParams(client, cartItem, sender, box)\n const result = await client.send.redeemTicket(redeemTicketParams)\n return result.return\n}\n\nexport async function getRedeemTicketParams(\n client: MarketPlaceClient,\n cartItem: CartItem,\n sender: string,\n box?: BoxTicketTier | undefined,\n) {\n const boxId = cartItem.boxId\n if (!box) {\n box = await getBox(client, boxId)\n }\n if (!box) throw new Error('Missing Box')\n const assetId = Number(box?.asset_id)\n return {\n args: {\n tierId: boxId,\n asset: BigInt(assetId),\n },\n boxReferences: [\n {\n appId: BigInt(client.appId),\n name: encodeUint64(boxId),\n },\n {\n appId: BigInt(client.appId),\n name: decodeAddress(sender).publicKey,\n },\n ],\n assetReferences: [BigInt(assetId)],\n accountReferences: [sender],\n staticFee: AlgoAmount.MicroAlgos(2000),\n }\n}\n","import { AlgorandClient } from '@algorandfoundation/algokit-utils'\nimport { AppClient } from '@algorandfoundation/algokit-utils/types/app-client'\nimport { AppFactory } from '@algorandfoundation/algokit-utils/types/app-factory'\nimport { AppSpec } from '@algorandfoundation/algokit-utils/types/app-spec'\nimport { Asset } from '@txnlab/use-wallet'\nimport { getApplicationAddress, TransactionSigner } from 'algosdk'\nimport { MarketPlaceClient } from '../contracts/MarketPlace'\nimport appSpec from '../contracts/MarketPlace.arc32.json'\nimport buyATicket from '../contracts/methods/buyTicket'\nimport redeemTicket from '../contracts/methods/redeemTicket'\nimport { getBoxes, getReservationFromBox } from '../contracts/methods/utils'\nimport { CONTRACTMODEL } from '../types/graphql/API'\n\nexport class TicketContractService {\n algorand: AlgorandClient\n appSpec: AppSpec\n appClient: AppClient | null = null\n contract: MarketPlaceClient | null = null\n factory: AppFactory\n eventName: string\n initialized: Promise\n\n constructor(eventName: string, private appId: number, private activeAddress: string, private signer: TransactionSigner) {\n this.eventName = `${eventName}`\n this.algorand = AlgorandClient.testNet()\n this.appSpec = appSpec as unknown as AppSpec\n this.appSpec.contract.name = this.eventName\n this.factory = this.algorand.client.getAppFactory({\n appSpec: this.appSpec,\n defaultSender: activeAddress,\n defaultSigner: signer,\n updatable: true,\n deletable: true,\n })\n\n // Initialize the contract and store the promise\n this.initialized = this.initializeContract()\n }\n\n private async initializeContract() {\n const apps = {}\n console.log('Initializing contract with appId:', this.appId)\n // @ts-ignore\n apps[this.eventName] = {\n appId: BigInt(this.appId),\n appAddress: getApplicationAddress(this.appId),\n createdMetadata: {\n name: this.eventName,\n version: '1.2.0',\n updatable: false,\n deletable: false,\n },\n }\n\n try {\n const result = await this.factory.deploy({\n onSchemaBreak: 'fail',\n onUpdate: 'fail',\n existingDeployments: {\n creator: this.activeAddress,\n apps,\n },\n })\n\n this.appClient = result.appClient\n this.contract = new MarketPlaceClient(result.appClient)\n console.log('Contract initialized successfully')\n } catch (error) {\n console.error('Error during contract initialization:', error)\n throw new Error('Failed to initialize the contract')\n }\n }\n\n private async ensureInitialized() {\n if (this.initialized) {\n await this.initialized\n } else {\n throw new Error('Initialization promise not found')\n }\n }\n\n async purchaseTickets(tickets: CartItem[]) {\n await this.ensureInitialized() // Ensure contract is ready before proceeding\n\n if (!this.contract) {\n throw new Error('Contract not initialized')\n }\n\n try {\n const result = await buyATicket(this.contract, tickets, this.activeAddress)\n if (!result) {\n return {\n success: false,\n }\n }\n console.log({ result })\n return {\n success: true,\n }\n } catch (error) {\n console.error('Failed to purchase tickets:', error)\n return {\n success: false,\n }\n }\n }\n\n async redeemATicket(ticket: BoughtTickets) {\n await this.ensureInitialized() // Ensure contract is ready before proceeding\n\n if (!this.contract) {\n throw new Error('Contract not initialized')\n }\n try {\n const cartItem: CartItem = {\n section: ticket.tier?.asset_id.toString() || '0',\n quantity: 1,\n price: ticket.tier?.price.toString() || '0',\n details: 'Redeem Ticket',\n eventId: this.eventName,\n originalPrice: ticket.tier?.price.toString() || '0',\n boxId: Number(ticket.tier.id),\n }\n\n const result = await redeemTicket(this.contract, cartItem, this.activeAddress, ticket.tier)\n return {\n success: true,\n result,\n }\n } catch (error) {\n console.error('Failed to redeem ticket:', error)\n return {\n success: false,\n }\n }\n }\n async getReservedTickets(contractModel: CONTRACTMODEL): Promise {\n await this.ensureInitialized() // Ensure contract is ready before proceeding\n\n if (!this.contract) {\n throw new Error('Contract not initialized')\n }\n\n try {\n const boxes = await getBoxes(this.contract)\n const reservation = getReservationFromBox(boxes, this.activeAddress)\n if (!reservation) return undefined\n if (!boxes?.tiers) return undefined\n const tiers = boxes.tiers\n return {\n assetId: tiers[reservation.ticket_tier].asset_id,\n tier: tiers[reservation.ticket_tier],\n asaToken: contractModel.asaTokens.find((asaToken) => asaToken?.asaId === tiers[reservation.ticket_tier].asset_id),\n }\n } catch (error) {\n console.error('Failed to get reserved tickets:', error)\n throw error\n }\n }\n\n async getBoughtTickets(getAssets: () => Promise, contractModel: CONTRACTMODEL): Promise {\n await this.ensureInitialized() // Ensure contract is ready before proceeding\n\n if (!this.contract) {\n throw new Error('Contract not initialized')\n }\n try {\n const [assets, boxes] = await Promise.all([getAssets(), getBoxes(this.contract)])\n const assetsWithBalance = assets.filter((asset) => asset.amount > 0)\n const tiers = boxes.tiers\n if (!tiers) return undefined\n\n //search assets with balance 'asset-id' for asset whose id is in the tiers\n let ticketsBought = assetsWithBalance.filter((asset) => tiers.find((tier) => Number(tier.asset_id) === asset['asset-id']))\n ticketsBought = expandTickets(ticketsBought)\n console.log('ticketsBought', ticketsBought)\n // for tickets bought map it with its corresponding tier\n return ticketsBought.map((asset) => ({\n assetId: asset['asset-id'],\n tier: tiers.find((tier) => Number(tier.asset_id) === asset['asset-id']),\n asaToken: contractModel.asaTokens.find((asaToken) => asaToken?.asaId === asset['asset-id']),\n }))\n } catch (error) {\n console.error('Failed to get bought tickets:', error)\n return undefined\n }\n }\n}\nfunction expandTickets(ticketsBought: Asset[]) {\n return ticketsBought.flatMap((ticket) =>\n Array.from({ length: ticket.amount }, () => ({\n ...ticket,\n amount: 1,\n })),\n )\n}\nexport const createTicketContractService = (eventName: string, appId: number, activeAddress: string, signer: TransactionSigner) => {\n return new TicketContractService(eventName, appId, activeAddress, signer)\n}\n"],"names":["APP_SPEC","BinaryStateValue","asByteArray","value","asString","undefined","Buffer","from","toString","constructor","MarketPlaceParamsFactory","createEventWithTiers","params","method","args","Array","isArray","eventDetails","tiersDetails","minBal","mintTicket","tierId","optIn","buyTicket","reserveTickets","reservedTickets","claimTicket","redeemTicket","asset","MarketPlaceClient","decodeReturnValue","returnValue","getArc56ReturnValue","appClient","getABIMethod","structs","fromCreatorAndName","_AppClient","appSpec","fromNetwork","appId","appAddress","appName","algorand","clone","newGroup","client","composer","promiseChain","Promise","resolve","resultMappers","then","addAppCallMethodCall","push","v","update","bare","addAppUpdate","delete","addAppDelete","clearState","addAppCall","addTransaction","txn","signer","simulate","options","result","returns","map","val","i","send","appClientOrParams","call","createTransaction","return","state","global","getAll","description","endDate","end_date","eventName","event_name","maxAttendees","max_attendees","organizer","startDate","start_date","getValue","getBoxes","boxes","getBoxValues","console","log","decodeTierBoxes","decodeTierBoxByAbi","b","name","nameBase64","startsWith","decodeTier","decodedValue","algosdk","decode","id","asset_id","Number","price","max_price","max_supply","current_supply","group_size","group_discount","reserved_tickets","redeemed_tickets","box","filter","reservations","decodeReserveBoxes","decodeReserveBoxByAbi","reservationSchema","reservation","ticket_tier","reservee","encodeAddress","nameRaw","tiers","getBox","key","findBoxById","address","find","array","obj","buyATicket","cartItems","sender","atc","cartItem","boxId","forEach","createReserveTicketTransaction","assetId","totalTicketCost","quantity","buyTicketPayment","payment","receiver","amount","AlgoAmount","MicroAlgos","staticFee","optinTicket","assetTransfer","BigInt","boxReferences","encodeUint64","assetReferences","totalFee","redeemTicketParams","getRedeemTicketParams","Error","decodeAddress","publicKey","accountReferences","TicketContractService","initializeContract","apps","getApplicationAddress","createdMetadata","version","updatable","deletable","factory","deploy","onSchemaBreak","onUpdate","existingDeployments","creator","activeAddress","contract","error","ensureInitialized","initialized","purchaseTickets","tickets","success","redeemATicket","ticket","section","tier","details","eventId","originalPrice","getReservedTickets","contractModel","getReservationFromBox","asaToken","asaTokens","asaId","getBoughtTickets","getAssets","assets","all","assetsWithBalance","ticketsBought","flatMap","expandTickets","length","AlgorandClient","testNet","getAppFactory","defaultSender","defaultSigner","createTicketContractService"],"sourceRoot":"","ignoreList":[0]}