From adf67034fbf96128bf8c046b511bdf583a947f05 Mon Sep 17 00:00:00 2001 From: "Chris Kim (Hyunggun)" Date: Thu, 30 May 2024 20:48:08 +0900 Subject: [PATCH 1/3] .env.template update. delete artifacts --- .../NftMarketplace.approval.teal | 356 --------- .../nft_marketplace/NftMarketplace.arc32.json | 109 --- .../nft_marketplace/NftMarketplace.clear.teal | 7 - .../artifacts/nft_marketplace/client.ts | 711 ------------------ .../.env.template | 42 +- .../src/contracts/NftMarketplace.ts | 711 ------------------ .../src/contracts/NftMarketplaceList.ts | 639 ---------------- 7 files changed, 21 insertions(+), 2554 deletions(-) delete mode 100644 projects/orakle-nft-marketplace-app-contracts/smart_contracts/artifacts/nft_marketplace/NftMarketplace.approval.teal delete mode 100644 projects/orakle-nft-marketplace-app-contracts/smart_contracts/artifacts/nft_marketplace/NftMarketplace.arc32.json delete mode 100644 projects/orakle-nft-marketplace-app-contracts/smart_contracts/artifacts/nft_marketplace/NftMarketplace.clear.teal delete mode 100644 projects/orakle-nft-marketplace-app-contracts/smart_contracts/artifacts/nft_marketplace/client.ts delete mode 100644 projects/orakle-nft-marketplace-app-frontend/src/contracts/NftMarketplace.ts delete mode 100644 projects/orakle-nft-marketplace-app-frontend/src/contracts/NftMarketplaceList.ts diff --git a/projects/orakle-nft-marketplace-app-contracts/smart_contracts/artifacts/nft_marketplace/NftMarketplace.approval.teal b/projects/orakle-nft-marketplace-app-contracts/smart_contracts/artifacts/nft_marketplace/NftMarketplace.approval.teal deleted file mode 100644 index 276b0be..0000000 --- a/projects/orakle-nft-marketplace-app-contracts/smart_contracts/artifacts/nft_marketplace/NftMarketplace.approval.teal +++ /dev/null @@ -1,356 +0,0 @@ -#pragma version 10 - -smart_contracts.nft_marketplace.contract.NftMarketplace.approval_program: - txn ApplicationID - bnz main_entrypoint@2 - callsub __init__ - -main_entrypoint@2: - // smart_contracts/nft_marketplace/contract.py:28 - // class NftMarketplace(arc4.ARC4Contract): - txn NumAppArgs - bz main_bare_routing@9 - method "bootstrap(asset,uint64,pay)void" - method "buy(pay,uint64)void" - method "withdraw_and_delete()void" - txna ApplicationArgs 0 - match main_bootstrap_route@4 main_buy_route@5 main_withdraw_and_delete_route@6 - err // reject transaction - -main_bootstrap_route@4: - // smart_contracts/nft_marketplace/contract.py:96 - // @arc4.abimethod - txn OnCompletion - ! - assert // OnCompletion is NoOp - txn ApplicationID - assert // is not creating - // smart_contracts/nft_marketplace/contract.py:28 - // class NftMarketplace(arc4.ARC4Contract): - txna ApplicationArgs 1 - btoi - txnas Assets - txna ApplicationArgs 2 - btoi - txn GroupIndex - int 1 - - - dup - gtxns TypeEnum - int pay - == - assert // transaction type is pay - // smart_contracts/nft_marketplace/contract.py:96 - // @arc4.abimethod - callsub bootstrap - int 1 - return - -main_buy_route@5: - // smart_contracts/nft_marketplace/contract.py:144 - // @arc4.abimethod - txn OnCompletion - ! - assert // OnCompletion is NoOp - txn ApplicationID - assert // is not creating - // smart_contracts/nft_marketplace/contract.py:28 - // class NftMarketplace(arc4.ARC4Contract): - txn GroupIndex - int 1 - - - dup - gtxns TypeEnum - int pay - == - assert // transaction type is pay - txna ApplicationArgs 1 - btoi - // smart_contracts/nft_marketplace/contract.py:144 - // @arc4.abimethod - callsub buy - int 1 - return - -main_withdraw_and_delete_route@6: - // smart_contracts/nft_marketplace/contract.py:199 - // @arc4.abimethod(allow_actions=["DeleteApplication"]) - txn OnCompletion - int DeleteApplication - == - assert // OnCompletion is DeleteApplication - txn ApplicationID - assert // is not creating - callsub withdraw_and_delete - int 1 - return - -main_bare_routing@9: - // smart_contracts/nft_marketplace/contract.py:28 - // class NftMarketplace(arc4.ARC4Contract): - txn OnCompletion - ! - assert // reject transaction - txn ApplicationID - ! - assert // is creating - int 1 - return - - -// smart_contracts.nft_marketplace.contract.NftMarketplace.bootstrap(asset: uint64, unitary_price: uint64, mbr_pay: uint64) -> void: -bootstrap: - // smart_contracts/nft_marketplace/contract.py:96-99 - // @arc4.abimethod - // def bootstrap( - // self, asset: Asset, unitary_price: UInt64, mbr_pay: gtxn.PaymentTransaction - // ) -> None: - proto 3 0 - // smart_contracts/nft_marketplace/contract.py:100 - // assert Txn.sender == Global.creator_address - txn Sender - global CreatorAddress - == - assert - // smart_contracts/nft_marketplace/contract.py:101 - // assert not self.bootstrapped - int 0 - byte "bootstrapped" - app_global_get_ex - assert // check bootstrapped exists - ! - assert - // smart_contracts/nft_marketplace/contract.py:102 - // assert mbr_pay.receiver == Global.current_application_address - frame_dig -1 - gtxns Receiver - global CurrentApplicationAddress - == - assert - // smart_contracts/nft_marketplace/contract.py:103 - // assert mbr_pay.amount == Global.min_balance + Global.asset_opt_in_min_balance - frame_dig -1 - gtxns Amount - global MinBalance - global AssetOptInMinBalance - + - == - assert - // smart_contracts/nft_marketplace/contract.py:105 - // self.asset_id = asset.id - byte "asset_id" - frame_dig -3 - app_global_put - // smart_contracts/nft_marketplace/contract.py:106 - // self.unitary_price = unitary_price - byte "unitary_price" - frame_dig -2 - app_global_put - // smart_contracts/nft_marketplace/contract.py:107 - // self.bootstrapped = True - byte "bootstrapped" - int 1 - app_global_put - // smart_contracts/nft_marketplace/contract.py:109-113 - // itxn.AssetTransfer( - // xfer_asset=asset, - // asset_receiver=Global.current_application_address, - // asset_amount=0, - // ).submit() - itxn_begin - // smart_contracts/nft_marketplace/contract.py:111 - // asset_receiver=Global.current_application_address, - global CurrentApplicationAddress - // smart_contracts/nft_marketplace/contract.py:112 - // asset_amount=0, - int 0 - itxn_field AssetAmount - itxn_field AssetReceiver - frame_dig -3 - itxn_field XferAsset - // smart_contracts/nft_marketplace/contract.py:109 - // itxn.AssetTransfer( - int axfer - itxn_field TypeEnum - // smart_contracts/nft_marketplace/contract.py:109-113 - // itxn.AssetTransfer( - // xfer_asset=asset, - // asset_receiver=Global.current_application_address, - // asset_amount=0, - // ).submit() - itxn_submit - retsub - - -// smart_contracts.nft_marketplace.contract.NftMarketplace.buy(buyer_txn: uint64, quantity: uint64) -> void: -buy: - // smart_contracts/nft_marketplace/contract.py:144-149 - // @arc4.abimethod - // def buy( - // self, - // buyer_txn: gtxn.PaymentTransaction, - // quantity: UInt64, - // ) -> None: - proto 2 0 - // smart_contracts/nft_marketplace/contract.py:150 - // assert self.bootstrapped == True - int 0 - byte "bootstrapped" - app_global_get_ex - assert // check bootstrapped exists - int 1 - == - assert - // smart_contracts/nft_marketplace/contract.py:151 - // assert buyer_txn.sender == Txn.sender - frame_dig -2 - gtxns Sender - txn Sender - == - assert - // smart_contracts/nft_marketplace/contract.py:152 - // assert buyer_txn.receiver == Global.current_application_address - frame_dig -2 - gtxns Receiver - global CurrentApplicationAddress - == - assert - // smart_contracts/nft_marketplace/contract.py:153 - // assert buyer_txn.amount == self.unitary_price * quantity - frame_dig -2 - gtxns Amount - int 0 - byte "unitary_price" - app_global_get_ex - assert // check unitary_price exists - frame_dig -1 - * - == - assert - // smart_contracts/nft_marketplace/contract.py:155-159 - // itxn.AssetTransfer( - // xfer_asset=self.asset_id, - // asset_receiver=Txn.sender, - // asset_amount=quantity, - // ).submit() - itxn_begin - // smart_contracts/nft_marketplace/contract.py:156 - // xfer_asset=self.asset_id, - int 0 - byte "asset_id" - app_global_get_ex - assert // check asset_id exists - // smart_contracts/nft_marketplace/contract.py:157 - // asset_receiver=Txn.sender, - txn Sender - frame_dig -1 - itxn_field AssetAmount - itxn_field AssetReceiver - itxn_field XferAsset - // smart_contracts/nft_marketplace/contract.py:155 - // itxn.AssetTransfer( - int axfer - itxn_field TypeEnum - // smart_contracts/nft_marketplace/contract.py:155-159 - // itxn.AssetTransfer( - // xfer_asset=self.asset_id, - // asset_receiver=Txn.sender, - // asset_amount=quantity, - // ).submit() - itxn_submit - retsub - - -// smart_contracts.nft_marketplace.contract.NftMarketplace.withdraw_and_delete() -> void: -withdraw_and_delete: - // smart_contracts/nft_marketplace/contract.py:199-200 - // @arc4.abimethod(allow_actions=["DeleteApplication"]) - // def withdraw_and_delete(self) -> None: - proto 0 0 - // smart_contracts/nft_marketplace/contract.py:201 - // assert Txn.sender == Global.creator_address - txn Sender - global CreatorAddress - == - assert - // smart_contracts/nft_marketplace/contract.py:203-207 - // itxn.AssetTransfer( - // xfer_asset=self.asset_id, - // asset_receiver=Global.creator_address, - // asset_close_to=Global.creator_address, - // ).submit() - itxn_begin - // smart_contracts/nft_marketplace/contract.py:204 - // xfer_asset=self.asset_id, - int 0 - byte "asset_id" - app_global_get_ex - assert // check asset_id exists - // smart_contracts/nft_marketplace/contract.py:205 - // asset_receiver=Global.creator_address, - global CreatorAddress - // smart_contracts/nft_marketplace/contract.py:206 - // asset_close_to=Global.creator_address, - dup - itxn_field AssetCloseTo - itxn_field AssetReceiver - itxn_field XferAsset - // smart_contracts/nft_marketplace/contract.py:203 - // itxn.AssetTransfer( - int axfer - itxn_field TypeEnum - // smart_contracts/nft_marketplace/contract.py:203-207 - // itxn.AssetTransfer( - // xfer_asset=self.asset_id, - // asset_receiver=Global.creator_address, - // asset_close_to=Global.creator_address, - // ).submit() - itxn_submit - // smart_contracts/nft_marketplace/contract.py:209-212 - // itxn.Payment( - // receiver=Global.creator_address, - // close_remainder_to=Global.creator_address, - // ).submit() - itxn_begin - // smart_contracts/nft_marketplace/contract.py:210 - // receiver=Global.creator_address, - global CreatorAddress - // smart_contracts/nft_marketplace/contract.py:211 - // close_remainder_to=Global.creator_address, - dup - itxn_field CloseRemainderTo - itxn_field Receiver - // smart_contracts/nft_marketplace/contract.py:209 - // itxn.Payment( - int pay - itxn_field TypeEnum - // smart_contracts/nft_marketplace/contract.py:209-212 - // itxn.Payment( - // receiver=Global.creator_address, - // close_remainder_to=Global.creator_address, - // ).submit() - itxn_submit - retsub - - -// smart_contracts.nft_marketplace.contract.NftMarketplace.__init__() -> void: -__init__: - // smart_contracts/nft_marketplace/contract.py:53 - // def __init__(self) -> None: - proto 0 0 - // smart_contracts/nft_marketplace/contract.py:55 - // self.asset_id = UInt64(0) - byte "asset_id" - int 0 - app_global_put - // smart_contracts/nft_marketplace/contract.py:56 - // self.unitary_price = UInt64(0) - byte "unitary_price" - int 0 - app_global_put - // smart_contracts/nft_marketplace/contract.py:57 - // self.bootstrapped = False - byte "bootstrapped" - int 0 - app_global_put - retsub diff --git a/projects/orakle-nft-marketplace-app-contracts/smart_contracts/artifacts/nft_marketplace/NftMarketplace.arc32.json b/projects/orakle-nft-marketplace-app-contracts/smart_contracts/artifacts/nft_marketplace/NftMarketplace.arc32.json deleted file mode 100644 index 4d17a0e..0000000 --- a/projects/orakle-nft-marketplace-app-contracts/smart_contracts/artifacts/nft_marketplace/NftMarketplace.arc32.json +++ /dev/null @@ -1,109 +0,0 @@ -{ - "hints": { - "bootstrap(asset,uint64,pay)void": { - "call_config": { - "no_op": "CALL" - } - }, - "buy(pay,uint64)void": { - "call_config": { - "no_op": "CALL" - } - }, - "withdraw_and_delete()void": { - "call_config": { - "delete_application": "CALL" - } - } - }, - "source": { - "approval": "I3ByYWdtYSB2ZXJzaW9uIDEwCgpzbWFydF9jb250cmFjdHMubmZ0X21hcmtldHBsYWNlLmNvbnRyYWN0Lk5mdE1hcmtldHBsYWNlLmFwcHJvdmFsX3Byb2dyYW06CiAgICB0eG4gQXBwbGljYXRpb25JRAogICAgYm56IG1haW5fZW50cnlwb2ludEAyCiAgICBjYWxsc3ViIF9faW5pdF9fCgptYWluX2VudHJ5cG9pbnRAMjoKICAgIC8vIHNtYXJ0X2NvbnRyYWN0cy9uZnRfbWFya2V0cGxhY2UvY29udHJhY3QucHk6MjgKICAgIC8vIGNsYXNzIE5mdE1hcmtldHBsYWNlKGFyYzQuQVJDNENvbnRyYWN0KToKICAgIHR4biBOdW1BcHBBcmdzCiAgICBieiBtYWluX2JhcmVfcm91dGluZ0A5CiAgICBtZXRob2QgImJvb3RzdHJhcChhc3NldCx1aW50NjQscGF5KXZvaWQiCiAgICBtZXRob2QgImJ1eShwYXksdWludDY0KXZvaWQiCiAgICBtZXRob2QgIndpdGhkcmF3X2FuZF9kZWxldGUoKXZvaWQiCiAgICB0eG5hIEFwcGxpY2F0aW9u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mFjdHMvbmZ0X21hcmtldHBsYWNlL2NvbnRyYWN0LnB5OjI4CiAgICAvLyBjbGFzcyBOZnRNYXJrZXRwbGFjZShhcmM0LkFSQzRDb250cmFjdCk6CiAgICBpbnQgMQogICAgcmV0dXJuCg==" - }, - "state": { - "global": { - "num_byte_slices": 0, - "num_uints": 3 - }, - "local": { - "num_byte_slices": 0, - "num_uints": 0 - } - }, - "schema": { - "global": { - "declared": { - "asset_id": { - "type": "uint64", - "key": "asset_id" - }, - "bootstrapped": { - "type": "uint64", - "key": "bootstrapped" - }, - "unitary_price": { - "type": "uint64", - "key": "unitary_price" - } - }, - "reserved": {} - }, - "local": { - "declared": {}, - "reserved": {} - } - }, - "contract": { - "name": "NftMarketplace", - "desc": "\n \ubb38\uc81c 1\n NftMarketplace \uc571\uc758 \uc0c1\ud0dc(state)\ub97c \uc815\uc758\ud558\uace0 \ucd08\uae30\uac12\uc744 \uc124\uc815\ud558\uc138\uc694.\n\n NftMarketplace \uc571\uc740 \uc138\uac1c\uc758 \uc0c1\ud0dc\ub97c \uac00\uc9c0\uace0 \uc788\uc2b5\ub2c8\ub2e4.\n 1. asset_id: \ud310\ub9e4\ud560 \uc5d0\uc14b(ASA)\uc758 \uc544\uc774\ub514; UInt64\ud0c0\uc785\uc744 \uac00\uc9c4 \uae00\ub85c\ubc8c \uc0c1\ud0dc(Global State) \ucd08\uae30\uac12\uc740 0\uc73c\ub85c \uc124\uc815\ud574\uc8fc\uc138\uc694.\n 2. unitary_price: \ud310\ub9e4\ud560 \uc5d0\uc14b(ASA)\uc758 \uac00\uaca9. UInt64\ud0c0\uc785\uc744 \uac00\uc9c4 \uae00\ub85c\ubc8c \uc0c1\ud0dc(Global State) \ucd08\uae30\uac12\uc740 0\uc73c\ub85c \uc124\uc815\ud574\uc8fc\uc138\uc694.\n 3. bootstrapped: \uc571\uc5d0\uc11c \uc5d0\uc14b\uc744 \ud310\ub9e4\ud560 \uc900\ube44\uac00 \ub418\uc5c8\ub294\uc9c0 \uccb4\ud06c\ud558\ub294 bool \ud0c0\uc785\uc758 \uae00\ub85c\ubc8c \uc0c1\ud0dc(Global State). \ucd08\uae30\uac12\uc740 False\ub85c \uc124\uc815\ud574\uc8fc\uc138\uc694.\n bootstrap \uba54\uc11c\ub4dc\uac00 \uc2e4\ud589\ub418\uba74 True\ub85c \ubcc0\uacbd\ub429\ub2c8\ub2e4.\n\n \uc7ac\ubc0c\ub294 \ud329\ud2b8!\n AVM\uc740 Bytes \ud0c0\uc785\uacfc UInt64 \ud0c0\uc785\ub9cc \uc9c0\uc6d0\ud569\ub2c8\ub2e4. \uadf8\ub798\uc11c \ub2e4\ub978 \ud0c0\uc785\uc744 \uc0ac\uc6a9\ud558\uace0 \uc2f6\uc73c\uba74 \ubcf4\ud1b5 arc4\ud0c0\uc785\uc744 \uc0ac\uc6a9\ud569\ub2c8\ub2e4. \ud558\uc9c0\ub9cc\n Algorand Python\uc5d0\uc11c\ub294 bool, string \ud0c0\uc785\uc740 \ud30c\uc774\uc36c \ucf54\ub4dc\uc640 \ub3d9\uc77c\ud558\uac8c \uc0ac\uc6a9\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \uc608\ub97c \ub4e4\uc5b4 bool \ud0c0\uc785\uc740 True,\n False\ub85c \ud45c\ud5cc\ud558\uba74 \ub418\uace0, string \ud0c0\uc785\uc740 \"Hello, World!\"\uc640 \uac19\uc774 \ud45c\ud604\ud558\uba74 \ub429\ub2c8\ub2e4. Algorand Python\uc5d0\uc11c \ub370\uc774\ud130 \ud0c0\uc785\uc744\n \uc0ac\uc6a9\ud558\ub294 \ubc29\ubc95\uc740 \uc544\ub798 \ub9c1\ud06c\ub97c \ucc38\uace0\ud574\uc8fc\uc138\uc694.\n - arc4 \ud0c0\uc785: https://algorandfoundation.github.io/puya/lg-types.html#types\n\n \ud301!\n - Global State\ub97c \uc815\uc758\ud560\ub54c simplifed \ubc84\uc804\uc73c\ub85c \uc815\uc758\ud558\uba74 \uac04\uacb0\ud55c \ucf54\ub4dc\ub85c \uc0c1\ud0dc\ub97c \uc815\uc758\ud558\uace0 \ucd08\uae30\uac12\uc744 \uc124\uc815\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \uc790\uc138\ud55c \uc0ac\ud56d\uc740 \uc544\ub798 \ud78c\ud2b8 1\uc744 \ucc38\uace0\ud574\uc8fc\uc138\uc694.\n\n \ud78c\ud2b8 1 - \uae00\ub7ec\ubc8c \uc0c1\ud0dc: https://algorandfoundation.github.io/puya/lg-storage.html#global-storage\n \ud78c\ud2b8 2 - \ucf54\ub4dc \uc608\uc2dc: https://github.com/algorandfoundation/puya/blob/11843f6bc4bb6e4c56ac53e3980f74df69d07397/examples/global_state/contract.py#L5\n ", - "methods": [ - { - "name": "bootstrap", - "args": [ - { - "type": "asset", - "name": "asset" - }, - { - "type": "uint64", - "name": "unitary_price" - }, - { - "type": "pay", - "name": "mbr_pay" - } - ], - "returns": { - "type": "void" - } - }, - { - "name": "buy", - "args": [ - { - "type": "pay", - "name": "buyer_txn" - }, - { - "type": "uint64", - "name": "quantity" - } - ], - "returns": { - "type": "void" - } - }, - { - "name": "withdraw_and_delete", - "args": [], - "returns": { - "type": "void" - } - } - ], - "networks": {} - }, - "bare_call_config": { - "no_op": "CREATE" - } -} \ No newline at end of file diff --git a/projects/orakle-nft-marketplace-app-contracts/smart_contracts/artifacts/nft_marketplace/NftMarketplace.clear.teal b/projects/orakle-nft-marketplace-app-contracts/smart_contracts/artifacts/nft_marketplace/NftMarketplace.clear.teal deleted file mode 100644 index 3a8cd77..0000000 --- a/projects/orakle-nft-marketplace-app-contracts/smart_contracts/artifacts/nft_marketplace/NftMarketplace.clear.teal +++ /dev/null @@ -1,7 +0,0 @@ -#pragma version 10 - -smart_contracts.nft_marketplace.contract.NftMarketplace.clear_state_program: - // smart_contracts/nft_marketplace/contract.py:28 - // class NftMarketplace(arc4.ARC4Contract): - int 1 - return diff --git a/projects/orakle-nft-marketplace-app-contracts/smart_contracts/artifacts/nft_marketplace/client.ts b/projects/orakle-nft-marketplace-app-contracts/smart_contracts/artifacts/nft_marketplace/client.ts deleted file mode 100644 index 6e987b4..0000000 --- a/projects/orakle-nft-marketplace-app-contracts/smart_contracts/artifacts/nft_marketplace/client.ts +++ /dev/null @@ -1,711 +0,0 @@ -/* eslint-disable */ -/** - * This file was automatically generated by @algorandfoundation/algokit-client-generator. - * DO NOT MODIFY IT BY HAND. - * requires: @algorandfoundation/algokit-utils: ^2 - */ -import * as algokit from '@algorandfoundation/algokit-utils' -import type { - ABIAppCallArg, - AppCallTransactionResult, - AppCallTransactionResultOfType, - AppCompilationResult, - AppReference, - AppState, - AppStorageSchema, - CoreAppCallArgs, - RawAppCallArgs, - TealTemplateParams, -} from '@algorandfoundation/algokit-utils/types/app' -import type { - AppClientCallCoreParams, - AppClientCompilationParams, - AppClientDeployCoreParams, - AppDetails, - ApplicationClient, -} from '@algorandfoundation/algokit-utils/types/app-client' -import type { AppSpec } from '@algorandfoundation/algokit-utils/types/app-spec' -import type { SendTransactionResult, TransactionToSign, SendTransactionFrom, SendTransactionParams } from '@algorandfoundation/algokit-utils/types/transaction' -import type { ABIResult, TransactionWithSigner } from 'algosdk' -import { Algodv2, OnApplicationComplete, Transaction, AtomicTransactionComposer, modelsv2 } from 'algosdk' -export const APP_SPEC: AppSpec = { - "hints": { - "bootstrap(asset,uint64,pay)void": { - "call_config": { - "no_op": "CALL" - } - }, - "buy(pay,uint64)void": { - "call_config": { - "no_op": "CALL" - } - }, - "withdraw_and_delete()void": { - "call_config": { - "delete_application": "CALL" - } - } - }, - "source": { - "approval": "I3ByYWdtYSB2ZXJzaW9uIDEwCgpzbWFydF9jb250cmFjdHMubmZ0X21hcmtldHBsYWNlLmNvbnRyYWN0Lk5mdE1hcmtldHBsYWNlLmFwcHJvdmFsX3Byb2dyYW06CiAgICB0eG4gQXBwbGljYXRpb25JRAogICAgYm56IG1haW5fZW50cnlwb2ludEAyCiAgICBjYWxsc3ViIF9faW5pdF9fCgptYW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KICAgIGludCAwCiAgICBhcHBfZ2xvYmFsX3B1dAogICAgLy8gc21hcnRfY29udHJhY3RzL25mdF9tYXJrZXRwbGFjZS9jb250cmFjdC5weTo1NwogICAgLy8gc2VsZi5ib290c3RyYXBwZWQgPSBGYWxzZQogICAgYnl0ZSAiYm9vdHN0cmFwcGVkIgogICAgaW50IDAKICAgIGFwcF9nbG9iYWxfcHV0CiAgICByZXRzdWIK", - "clear": "I3ByYWdtYSB2ZXJzaW9uIDEwCgpzbWFydF9jb250cmFjdHMubmZ0X21hcmtldHBsYWNlLmNvbnRyYWN0Lk5mdE1hcmtldHBsYWNlLmNsZWFyX3N0YXRlX3Byb2dyYW06CiAgICAvLyBzbWFydF9jb250cmFjdHMvbmZ0X21hcmtldHBsYWNlL2NvbnRyYWN0LnB5OjI4CiAgICAvLyBjbGFzcyBOZnRNYXJrZXRwbGFjZShhcmM0LkFSQzRDb250cmFjdCk6CiAgICBpbnQgMQogICAgcmV0dXJuCg==" - }, - "state": { - "global": { - "num_byte_slices": 0, - "num_uints": 3 - }, - "local": { - "num_byte_slices": 0, - "num_uints": 0 - } - }, - "schema": { - "global": { - "declared": { - "asset_id": { - "type": "uint64", - "key": "asset_id" - }, - "bootstrapped": { - "type": "uint64", - "key": "bootstrapped" - }, - "unitary_price": { - "type": "uint64", - "key": "unitary_price" - } - }, - "reserved": {} - }, - "local": { - "declared": {}, - "reserved": {} - } - }, - "contract": { - "name": "NftMarketplace", - "desc": "\n 문제 1\n NftMarketplace 앱의 상태(state)를 정의하고 초기값을 설정하세요.\n\n NftMarketplace 앱은 세개의 상태를 가지고 있습니다.\n 1. asset_id: 판매할 에셋(ASA)의 아이디; UInt64타입을 가진 글로벌 상태(Global State) 초기값은 0으로 설정해주세요.\n 2. unitary_price: 판매할 에셋(ASA)의 가격. UInt64타입을 가진 글로벌 상태(Global State) 초기값은 0으로 설정해주세요.\n 3. bootstrapped: 앱에서 에셋을 판매할 준비가 되었는지 체크하는 bool 타입의 글로벌 상태(Global State). 초기값은 False로 설정해주세요.\n bootstrap 메서드가 실행되면 True로 변경됩니다.\n\n 재밌는 팩트!\n AVM은 Bytes 타입과 UInt64 타입만 지원합니다. 그래서 다른 타입을 사용하고 싶으면 보통 arc4타입을 사용합니다. 하지만\n Algorand Python에서는 bool, string 타입은 파이썬 코드와 동일하게 사용할 수 있습니다. 예를 들어 bool 타입은 True,\n False로 표헌하면 되고, string 타입은 \"Hello, World!\"와 같이 표현하면 됩니다. Algorand Python에서 데이터 타입을\n 사용하는 방법은 아래 링크를 참고해주세요.\n - arc4 타입: https://algorandfoundation.github.io/puya/lg-types.html#types\n\n 팁!\n - Global State를 정의할때 simplifed 버전으로 정의하면 간결한 코드로 상태를 정의하고 초기값을 설정할 수 있습니다. 자세한 사항은 아래 힌트 1을 참고해주세요.\n\n 힌트 1 - 글러벌 상태: https://algorandfoundation.github.io/puya/lg-storage.html#global-storage\n 힌트 2 - 코드 예시: https://github.com/algorandfoundation/puya/blob/11843f6bc4bb6e4c56ac53e3980f74df69d07397/examples/global_state/contract.py#L5\n ", - "methods": [ - { - "name": "bootstrap", - "args": [ - { - "type": "asset", - "name": "asset" - }, - { - "type": "uint64", - "name": "unitary_price" - }, - { - "type": "pay", - "name": "mbr_pay" - } - ], - "returns": { - "type": "void" - } - }, - { - "name": "buy", - "args": [ - { - "type": "pay", - "name": "buyer_txn" - }, - { - "type": "uint64", - "name": "quantity" - } - ], - "returns": { - "type": "void" - } - }, - { - "name": "withdraw_and_delete", - "args": [], - "returns": { - "type": "void" - } - } - ], - "networks": {} - }, - "bare_call_config": { - "no_op": "CREATE" - } -} - -/** - * Defines an onCompletionAction of 'no_op' - */ -export type OnCompleteNoOp = { onCompleteAction?: 'no_op' | OnApplicationComplete.NoOpOC } -/** - * Defines an onCompletionAction of 'opt_in' - */ -export type OnCompleteOptIn = { onCompleteAction: 'opt_in' | OnApplicationComplete.OptInOC } -/** - * Defines an onCompletionAction of 'close_out' - */ -export type OnCompleteCloseOut = { onCompleteAction: 'close_out' | OnApplicationComplete.CloseOutOC } -/** - * Defines an onCompletionAction of 'delete_application' - */ -export type OnCompleteDelApp = { onCompleteAction: 'delete_application' | OnApplicationComplete.DeleteApplicationOC } -/** - * Defines an onCompletionAction of 'update_application' - */ -export type OnCompleteUpdApp = { onCompleteAction: 'update_application' | OnApplicationComplete.UpdateApplicationOC } -/** - * A state record containing a single unsigned integer - */ -export type IntegerState = { - /** - * Gets the state value as a BigInt. - */ - asBigInt(): bigint - /** - * Gets the state value as a number. - */ - asNumber(): number -} -/** - * A state record containing binary data - */ -export type BinaryState = { - /** - * Gets the state value as a Uint8Array - */ - asByteArray(): Uint8Array - /** - * Gets the state value as a string - */ - asString(): string -} - -export type AppCreateCallTransactionResult = AppCallTransactionResult & Partial & AppReference -export type AppUpdateCallTransactionResult = AppCallTransactionResult & Partial - -export type AppClientComposeCallCoreParams = Omit & { - sendParams?: Omit -} -export type AppClientComposeExecuteParams = Pick - -export type IncludeSchema = { - /** - * Any overrides for the storage schema to request for the created app; by default the schema indicated by the app spec is used. - */ - schema?: Partial -} - -/** - * Defines the types of available calls and state of the NftMarketplace smart contract. - */ -export type NftMarketplace = { - /** - * Maps method signatures / names to their argument and return types. - */ - methods: - & Record<'bootstrap(asset,uint64,pay)void' | 'bootstrap', { - argsObj: { - asset: number | bigint - unitaryPrice: bigint | number - mbrPay: TransactionToSign | Transaction | Promise - } - argsTuple: [asset: number | bigint, unitaryPrice: bigint | number, mbrPay: TransactionToSign | Transaction | Promise] - returns: void - }> - & Record<'buy(pay,uint64)void' | 'buy', { - argsObj: { - buyerTxn: TransactionToSign | Transaction | Promise - quantity: bigint | number - } - argsTuple: [buyerTxn: TransactionToSign | Transaction | Promise, quantity: bigint | number] - returns: void - }> - & Record<'withdraw_and_delete()void' | 'withdraw_and_delete', { - argsObj: { - } - argsTuple: [] - returns: void - }> - /** - * Defines the shape of the global and local state of the application. - */ - state: { - global: { - assetId?: IntegerState - bootstrapped?: IntegerState - unitaryPrice?: IntegerState - } - } -} -/** - * Defines the possible abi call signatures - */ -export type NftMarketplaceSig = keyof NftMarketplace['methods'] -/** - * Defines an object containing all relevant parameters for a single call to the contract. Where TSignature is undefined, a bare call is made - */ -export type TypedCallParams = { - method: TSignature - methodArgs: TSignature extends undefined ? undefined : Array -} & AppClientCallCoreParams & CoreAppCallArgs -/** - * Defines the arguments required for a bare call - */ -export type BareCallArgs = Omit -/** - * Maps a method signature from the NftMarketplace smart contract to the method's arguments in either tuple of struct form - */ -export type MethodArgs = NftMarketplace['methods'][TSignature]['argsObj' | 'argsTuple'] -/** - * Maps a method signature from the NftMarketplace smart contract to the method's return type - */ -export type MethodReturn = NftMarketplace['methods'][TSignature]['returns'] - -/** - * A factory for available 'create' calls - */ -export type NftMarketplaceCreateCalls = (typeof NftMarketplaceCallFactory)['create'] -/** - * Defines supported create methods for this smart contract - */ -export type NftMarketplaceCreateCallParams = - | (TypedCallParams & (OnCompleteNoOp)) -/** - * A factory for available 'delete' calls - */ -export type NftMarketplaceDeleteCalls = (typeof NftMarketplaceCallFactory)['delete'] -/** - * Defines supported delete methods for this smart contract - */ -export type NftMarketplaceDeleteCallParams = - | TypedCallParams<'withdraw_and_delete()void'> -/** - * Defines arguments required for the deploy method. - */ -export type NftMarketplaceDeployArgs = { - deployTimeParams?: TealTemplateParams - /** - * A delegate which takes a create call factory and returns the create call params for this smart contract - */ - createCall?: (callFactory: NftMarketplaceCreateCalls) => NftMarketplaceCreateCallParams - /** - * A delegate which takes a delete call factory and returns the delete call params for this smart contract - */ - deleteCall?: (callFactory: NftMarketplaceDeleteCalls) => NftMarketplaceDeleteCallParams -} - - -/** - * Exposes methods for constructing all available smart contract calls - */ -export abstract class NftMarketplaceCallFactory { - /** - * Gets available create call factories - */ - static get create() { - return { - /** - * Constructs a create call for the NftMarketplace smart contract using a bare call - * - * @param params Any parameters for the call - * @returns A TypedCallParams object for the call - */ - bare(params: BareCallArgs & AppClientCallCoreParams & CoreAppCallArgs & AppClientCompilationParams & (OnCompleteNoOp) = {}) { - return { - method: undefined, - methodArgs: undefined, - ...params, - } - }, - } - } - - /** - * Gets available delete call factories - */ - static get delete() { - return { - /** - * Constructs a delete call for the NftMarketplace smart contract using the withdraw_and_delete()void ABI method - * - * @param args Any args for the contract call - * @param params Any additional parameters for the call - * @returns A TypedCallParams object for the call - */ - withdrawAndDelete(args: MethodArgs<'withdraw_and_delete()void'>, params: AppClientCallCoreParams & CoreAppCallArgs = {}) { - return { - method: 'withdraw_and_delete()void' as const, - methodArgs: Array.isArray(args) ? args : [], - ...params, - } - }, - } - } - - /** - * Constructs a no op call for the bootstrap(asset,uint64,pay)void ABI method - * - * @param args Any args for the contract call - * @param params Any additional parameters for the call - * @returns A TypedCallParams object for the call - */ - static bootstrap(args: MethodArgs<'bootstrap(asset,uint64,pay)void'>, params: AppClientCallCoreParams & CoreAppCallArgs) { - return { - method: 'bootstrap(asset,uint64,pay)void' as const, - methodArgs: Array.isArray(args) ? args : [args.asset, args.unitaryPrice, args.mbrPay], - ...params, - } - } - /** - * Constructs a no op call for the buy(pay,uint64)void ABI method - * - * @param args Any args for the contract call - * @param params Any additional parameters for the call - * @returns A TypedCallParams object for the call - */ - static buy(args: MethodArgs<'buy(pay,uint64)void'>, params: AppClientCallCoreParams & CoreAppCallArgs) { - return { - method: 'buy(pay,uint64)void' as const, - methodArgs: Array.isArray(args) ? args : [args.buyerTxn, args.quantity], - ...params, - } - } -} - -/** - * A client to make calls to the NftMarketplace smart contract - */ -export class NftMarketplaceClient { - /** - * The underlying `ApplicationClient` for when you want to have more flexibility - */ - public readonly appClient: ApplicationClient - - private readonly sender: SendTransactionFrom | undefined - - /** - * Creates a new instance of `NftMarketplaceClient` - * - * @param appDetails appDetails The details to identify the app to deploy - * @param algod An algod client instance - */ - constructor(appDetails: AppDetails, private algod: Algodv2) { - this.sender = appDetails.sender - this.appClient = algokit.getAppClient({ - ...appDetails, - app: APP_SPEC - }, algod) - } - - /** - * Checks for decode errors on the AppCallTransactionResult and maps the return value to the specified generic type - * - * @param result The AppCallTransactionResult to be mapped - * @param returnValueFormatter An optional delegate to format the return value if required - * @returns The smart contract response with an updated return value - */ - protected mapReturnValue(result: AppCallTransactionResult, returnValueFormatter?: (value: any) => TReturn): AppCallTransactionResultOfType & TResult { - if(result.return?.decodeError) { - throw result.return.decodeError - } - const returnValue = result.return?.returnValue !== undefined && returnValueFormatter !== undefined - ? returnValueFormatter(result.return.returnValue) - : result.return?.returnValue as TReturn | undefined - return { ...result, return: returnValue } as AppCallTransactionResultOfType & TResult - } - - /** - * Calls the ABI method with the matching signature using an onCompletion code of NO_OP - * - * @param typedCallParams An object containing the method signature, args, and any other relevant parameters - * @param returnValueFormatter An optional delegate which when provided will be used to map non-undefined return values to the target type - * @returns The result of the smart contract call - */ - public async call(typedCallParams: TypedCallParams, returnValueFormatter?: (value: any) => MethodReturn) { - return this.mapReturnValue>(await this.appClient.call(typedCallParams), returnValueFormatter) - } - - /** - * Idempotently deploys the NftMarketplace smart contract. - * - * @param params The arguments for the contract calls and any additional parameters for the call - * @returns The deployment result - */ - public deploy(params: NftMarketplaceDeployArgs & AppClientDeployCoreParams & IncludeSchema = {}): ReturnType { - const createArgs = params.createCall?.(NftMarketplaceCallFactory.create) - const deleteArgs = params.deleteCall?.(NftMarketplaceCallFactory.delete) - return this.appClient.deploy({ - ...params, - deleteArgs, - createArgs, - createOnCompleteAction: createArgs?.onCompleteAction, - }) - } - - /** - * Gets available create methods - */ - public get create() { - const $this = this - return { - /** - * Creates a new instance of the NftMarketplace smart contract using a bare call. - * - * @param args The arguments for the bare call - * @returns The create result - */ - async bare(args: BareCallArgs & AppClientCallCoreParams & AppClientCompilationParams & IncludeSchema & CoreAppCallArgs & (OnCompleteNoOp) = {}) { - return $this.mapReturnValue(await $this.appClient.create(args)) - }, - } - } - - /** - * Gets available delete methods - */ - public get delete() { - const $this = this - return { - /** - * Deletes an existing instance of the NftMarketplace smart contract using the withdraw_and_delete()void ABI method. - * - * @param args The arguments for the smart contract call - * @param params Any additional parameters for the call - * @returns The delete result - */ - async withdrawAndDelete(args: MethodArgs<'withdraw_and_delete()void'>, params: AppClientCallCoreParams & CoreAppCallArgs = {}) { - return $this.mapReturnValue>(await $this.appClient.delete(NftMarketplaceCallFactory.delete.withdrawAndDelete(args, params))) - }, - } - } - - /** - * Makes a clear_state call to an existing instance of the NftMarketplace smart contract. - * - * @param args The arguments for the bare call - * @returns The clear_state result - */ - public clearState(args: BareCallArgs & AppClientCallCoreParams & CoreAppCallArgs = {}) { - return this.appClient.clearState(args) - } - - /** - * Calls the bootstrap(asset,uint64,pay)void ABI method. - * - * @param args The arguments for the contract call - * @param params Any additional parameters for the call - * @returns The result of the call - */ - public bootstrap(args: MethodArgs<'bootstrap(asset,uint64,pay)void'>, params: AppClientCallCoreParams & CoreAppCallArgs = {}) { - return this.call(NftMarketplaceCallFactory.bootstrap(args, params)) - } - - /** - * Calls the buy(pay,uint64)void ABI method. - * - * @param args The arguments for the contract call - * @param params Any additional parameters for the call - * @returns The result of the call - */ - public buy(args: MethodArgs<'buy(pay,uint64)void'>, params: AppClientCallCoreParams & CoreAppCallArgs = {}) { - return this.call(NftMarketplaceCallFactory.buy(args, params)) - } - - /** - * Extracts a binary state value out of an AppState dictionary - * - * @param state The state dictionary containing the state value - * @param key The key of the state value - * @returns A BinaryState instance containing the state value, or undefined if the key was not found - */ - private static getBinaryState(state: AppState, key: string): BinaryState | undefined { - const value = state[key] - if (!value) return undefined - if (!('valueRaw' in value)) - throw new Error(`Failed to parse state value for ${key}; received an int when expected a byte array`) - return { - asString(): string { - return value.value - }, - asByteArray(): Uint8Array { - return value.valueRaw - } - } - } - - /** - * Extracts a integer state value out of an AppState dictionary - * - * @param state The state dictionary containing the state value - * @param key The key of the state value - * @returns An IntegerState instance containing the state value, or undefined if the key was not found - */ - private static getIntegerState(state: AppState, key: string): IntegerState | undefined { - const value = state[key] - if (!value) return undefined - if ('valueRaw' in value) - throw new Error(`Failed to parse state value for ${key}; received a byte array when expected a number`) - return { - asBigInt() { - return typeof value.value === 'bigint' ? value.value : BigInt(value.value) - }, - asNumber(): number { - return typeof value.value === 'bigint' ? Number(value.value) : value.value - }, - } - } - - /** - * Returns the smart contract's global state wrapped in a strongly typed accessor with options to format the stored value - */ - public async getGlobalState(): Promise { - const state = await this.appClient.getGlobalState() - return { - get assetId() { - return NftMarketplaceClient.getIntegerState(state, 'asset_id') - }, - get bootstrapped() { - return NftMarketplaceClient.getIntegerState(state, 'bootstrapped') - }, - get unitaryPrice() { - return NftMarketplaceClient.getIntegerState(state, 'unitary_price') - }, - } - } - - public compose(): NftMarketplaceComposer { - const client = this - const atc = new AtomicTransactionComposer() - let promiseChain:Promise = Promise.resolve() - const resultMappers: Array any)> = [] - return { - bootstrap(args: MethodArgs<'bootstrap(asset,uint64,pay)void'>, params?: AppClientComposeCallCoreParams & CoreAppCallArgs) { - promiseChain = promiseChain.then(() => client.bootstrap(args, {...params, sendParams: {...params?.sendParams, skipSending: true, atc}})) - resultMappers.push(undefined) - return this - }, - buy(args: MethodArgs<'buy(pay,uint64)void'>, params?: AppClientComposeCallCoreParams & CoreAppCallArgs) { - promiseChain = promiseChain.then(() => client.buy(args, {...params, sendParams: {...params?.sendParams, skipSending: true, atc}})) - resultMappers.push(undefined) - return this - }, - get delete() { - const $this = this - return { - withdrawAndDelete(args: MethodArgs<'withdraw_and_delete()void'>, params?: AppClientComposeCallCoreParams) { - promiseChain = promiseChain.then(() => client.delete.withdrawAndDelete(args, {...params, sendParams: {...params?.sendParams, skipSending: true, atc}})) - resultMappers.push(undefined) - return $this - }, - } - }, - clearState(args?: BareCallArgs & AppClientComposeCallCoreParams & CoreAppCallArgs) { - promiseChain = promiseChain.then(() => client.clearState({...args, sendParams: {...args?.sendParams, skipSending: true, atc}})) - resultMappers.push(undefined) - return this - }, - addTransaction(txn: TransactionWithSigner | TransactionToSign | Transaction | Promise, defaultSender?: SendTransactionFrom) { - promiseChain = promiseChain.then(async () => atc.addTransaction(await algokit.getTransactionWithSigner(txn, defaultSender ?? client.sender))) - return this - }, - async atc() { - await promiseChain - return atc - }, - async simulate(options?: SimulateOptions) { - await promiseChain - const result = await atc.simulate(client.algod, new modelsv2.SimulateRequest({ txnGroups: [], ...options })) - return { - ...result, - returns: result.methodResults?.map((val, i) => resultMappers[i] !== undefined ? resultMappers[i]!(val.returnValue) : val.returnValue) - } - }, - async execute(sendParams?: AppClientComposeExecuteParams) { - await promiseChain - const result = await algokit.sendAtomicTransactionComposer({ atc, sendParams }, client.algod) - return { - ...result, - returns: result.returns?.map((val, i) => resultMappers[i] !== undefined ? resultMappers[i]!(val.returnValue) : val.returnValue) - } - } - } as unknown as NftMarketplaceComposer - } -} -export type NftMarketplaceComposer = { - /** - * Calls the bootstrap(asset,uint64,pay)void ABI method. - * - * @param args The arguments for the contract call - * @param params Any additional parameters for the call - * @returns The typed transaction composer so you can fluently chain multiple calls or call execute to execute all queued up transactions - */ - bootstrap(args: MethodArgs<'bootstrap(asset,uint64,pay)void'>, params?: AppClientComposeCallCoreParams & CoreAppCallArgs): NftMarketplaceComposer<[...TReturns, MethodReturn<'bootstrap(asset,uint64,pay)void'>]> - - /** - * Calls the buy(pay,uint64)void ABI method. - * - * @param args The arguments for the contract call - * @param params Any additional parameters for the call - * @returns The typed transaction composer so you can fluently chain multiple calls or call execute to execute all queued up transactions - */ - buy(args: MethodArgs<'buy(pay,uint64)void'>, params?: AppClientComposeCallCoreParams & CoreAppCallArgs): NftMarketplaceComposer<[...TReturns, MethodReturn<'buy(pay,uint64)void'>]> - - /** - * Gets available delete methods - */ - readonly delete: { - /** - * Deletes an existing instance of the NftMarketplace smart contract using the withdraw_and_delete()void ABI method. - * - * @param args The arguments for the smart contract call - * @param params Any additional parameters for the call - * @returns The typed transaction composer so you can fluently chain multiple calls or call execute to execute all queued up transactions - */ - withdrawAndDelete(args: MethodArgs<'withdraw_and_delete()void'>, params?: AppClientComposeCallCoreParams): NftMarketplaceComposer<[...TReturns, MethodReturn<'withdraw_and_delete()void'>]> - } - - /** - * Makes a clear_state call to an existing instance of the NftMarketplace smart contract. - * - * @param args The arguments for the bare call - * @returns The typed transaction composer so you can fluently chain multiple calls or call execute to execute all queued up transactions - */ - clearState(args?: BareCallArgs & AppClientComposeCallCoreParams & CoreAppCallArgs): NftMarketplaceComposer<[...TReturns, undefined]> - - /** - * Adds a transaction to the composer - * - * @param txn One of: A TransactionWithSigner object (returned as is), a TransactionToSign object (signer is obtained from the signer property), a Transaction object (signer is extracted from the defaultSender parameter), an async SendTransactionResult returned by one of algokit utils helpers (signer is obtained from the defaultSender parameter) - * @param defaultSender The default sender to be used to obtain a signer where the object provided to the transaction parameter does not include a signer. - */ - addTransaction(txn: TransactionWithSigner | TransactionToSign | Transaction | Promise, defaultSender?: SendTransactionFrom): NftMarketplaceComposer - /** - * Returns the underlying AtomicTransactionComposer instance - */ - atc(): Promise - /** - * Simulates the transaction group and returns the result - */ - simulate(options?: SimulateOptions): Promise> - /** - * Executes the transaction group and returns the results - */ - execute(sendParams?: AppClientComposeExecuteParams): Promise> -} -export type SimulateOptions = Omit[0], 'txnGroups'> -export type NftMarketplaceComposerSimulateResult = { - returns: TReturns - methodResults: ABIResult[] - simulateResponse: modelsv2.SimulateResponse -} -export type NftMarketplaceComposerResults = { - returns: TReturns - groupId: string - txIds: string[] - transactions: Transaction[] -} diff --git a/projects/orakle-nft-marketplace-app-frontend/.env.template b/projects/orakle-nft-marketplace-app-frontend/.env.template index 7719613..97206d1 100644 --- a/projects/orakle-nft-marketplace-app-frontend/.env.template +++ b/projects/orakle-nft-marketplace-app-frontend/.env.template @@ -3,30 +3,30 @@ # uncomment below to use # ====================== -# VITE_ENVIRONMENT=local +VITE_ENVIRONMENT=local -# # Algod -# VITE_ALGOD_TOKEN=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -# VITE_ALGOD_SERVER=http://localhost -# VITE_ALGOD_PORT=4001 -# VITE_ALGOD_NETWORK="" +# Algod +VITE_ALGOD_TOKEN=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +VITE_ALGOD_SERVER=http://localhost +VITE_ALGOD_PORT=4001 +VITE_ALGOD_NETWORK="" -# # Indexer -# VITE_INDEXER_TOKEN=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -# VITE_INDEXER_SERVER=http://localhost -# VITE_INDEXER_PORT=8980 +# Indexer +VITE_INDEXER_TOKEN=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +VITE_INDEXER_SERVER=http://localhost +VITE_INDEXER_PORT=8980 -# # KMD -# # Please note: -# # 1. This is only needed for LocalNet since -# # by default KMD provider is ignored on other networks. -# # 2. AlgoKit LocalNet starts with a single wallet called 'unencrypted-default-wallet', -# # with heaps of tokens available for testing. -# VITE_KMD_TOKEN=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -# VITE_KMD_SERVER=http://localhost -# VITE_KMD_PORT=4002 -# VITE_KMD_WALLET="unencrypted-default-wallet" -# VITE_KMD_PASSWORD="" +# KMD +# Please note: +# 1. This is only needed for LocalNet since +# by default KMD provider is ignored on other networks. +# 2. AlgoKit LocalNet starts with a single wallet called 'unencrypted-default-wallet', +# with heaps of tokens available for testing. +VITE_KMD_TOKEN=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +VITE_KMD_SERVER=http://localhost +VITE_KMD_PORT=4002 +VITE_KMD_WALLET="unencrypted-default-wallet" +VITE_KMD_PASSWORD="" # # ====================== # # TestNet configuration: diff --git a/projects/orakle-nft-marketplace-app-frontend/src/contracts/NftMarketplace.ts b/projects/orakle-nft-marketplace-app-frontend/src/contracts/NftMarketplace.ts deleted file mode 100644 index b9a6970..0000000 --- a/projects/orakle-nft-marketplace-app-frontend/src/contracts/NftMarketplace.ts +++ /dev/null @@ -1,711 +0,0 @@ -/* eslint-disable */ -/** - * This file was automatically generated by @algorandfoundation/algokit-client-generator. - * DO NOT MODIFY IT BY HAND. - * requires: @algorandfoundation/algokit-utils: ^2 - */ -import * as algokit from '@algorandfoundation/algokit-utils' -import type { - ABIAppCallArg, - AppCallTransactionResult, - AppCallTransactionResultOfType, - AppCompilationResult, - AppReference, - AppState, - AppStorageSchema, - CoreAppCallArgs, - RawAppCallArgs, - TealTemplateParams, -} from '@algorandfoundation/algokit-utils/types/app' -import type { - AppClientCallCoreParams, - AppClientCompilationParams, - AppClientDeployCoreParams, - AppDetails, - ApplicationClient, -} from '@algorandfoundation/algokit-utils/types/app-client' -import type { AppSpec } from '@algorandfoundation/algokit-utils/types/app-spec' -import type { SendTransactionResult, TransactionToSign, SendTransactionFrom, SendTransactionParams } from '@algorandfoundation/algokit-utils/types/transaction' -import type { ABIResult, TransactionWithSigner } from 'algosdk' -import { Algodv2, OnApplicationComplete, Transaction, AtomicTransactionComposer, modelsv2 } from 'algosdk' -export const APP_SPEC: AppSpec = { - "hints": { - "bootstrap(asset,uint64,pay)void": { - "call_config": { - "no_op": "CALL" - } - }, - "buy(pay,uint64)void": { - "call_config": { - "no_op": "CALL" - } - }, - "withdraw_and_delete()uint64": { - "call_config": { - "delete_application": "CALL" - } - } - }, - "source": { - "approval": "I3ByYWdtYSB2ZXJzaW9uIDEwCgpzbWFydF9jb250cmFjdHMubmZ0X21hcmtldHBsYWNlLmNvbnRyYWN0Lk5mdE1hcmtldHBsYWNlLmFwcHJvdmFsX3Byb2dyYW06CiAgICB0eG4gQXBwbGljYXRpb25JRAogICAgYm56IG1haW5fZW50cnlwb2ludEAyCiAgICBjYWxsc3ViIF9faW5pdF9fCgptYWluX2VudHJ5cG9pbnRAMjoKICAgIC8vIHNtYXJ0X2NvbnRyYWN0cy9uZnRfbWFya2V0cGxhY2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aW9uIDEwCgpzbWFydF9jb250cmFjdHMubmZ0X21hcmtldHBsYWNlLmNvbnRyYWN0Lk5mdE1hcmtldHBsYWNlLmNsZWFyX3N0YXRlX3Byb2dyYW06CiAgICAvLyBzbWFydF9jb250cmFjdHMvbmZ0X21hcmtldHBsYWNlL2NvbnRyYWN0LnB5OjMwCiAgICAvLyBjbGFzcyBOZnRNYXJrZXRwbGFjZShhcmM0LkFSQzRDb250cmFjdCk6CiAgICBpbnQgMQogICAgcmV0dXJuCg==" - }, - "state": { - "global": { - "num_byte_slices": 0, - "num_uints": 3 - }, - "local": { - "num_byte_slices": 0, - "num_uints": 0 - } - }, - "schema": { - "global": { - "declared": { - "asset_id": { - "type": "uint64", - "key": "asset_id" - }, - "bootstrapped": { - "type": "uint64", - "key": "bootstrapped" - }, - "unitary_price": { - "type": "uint64", - "key": "unitary_price" - } - }, - "reserved": {} - }, - "local": { - "declared": {}, - "reserved": {} - } - }, - "contract": { - "name": "NftMarketplace", - "desc": "\n 문제 1\n NftMarketplace 앱의 상태를 구현하세요.\n\n NftMarketplace 앱은 세개의 상태를 가지고 있습니다.\n 1. asset_id: 판매할 에셋(ASA)의 아이디; UInt64타입을 가진 글로벌 상태(Global State)\n 2. unitary_price: 판매할 에셋(ASA)의 가격. UInt64타입을 가진 글로벌 상태(Global State)\n 3. bootstrapped: 앱에서 에셋을 판매할 준비가 되었는지 체크하는 bool 타입의 글로벌 상태(Global State).\n bootstrap 메서드가 실행되면 True로 변경됩니다.\n\n 재밌는 팩트!\n AVM은 Bytes 타입과 UInt64 타입만 지원합니다. 그래서 다른 타입을 사용하고 싶으면 보통 arc4타입을 사용합니다. 하지만\n Algorand Python에서는 bool, string 타입은 파이썬 코드와 동일하게 사용할 수 있습니다. 예를 들어 bool 타입은 True,\n False로 표헌하면 되고, string 타입은 \"Hello, World!\"와 같이 표현하면 됩니다. Algorand Python에서 데이터 타입을\n 사용하는 방법은 아래 링크를 참고해주세요.\n - arc4 타입: https://algorandfoundation.github.io/puya/lg-types.html#types\n\n 힌트 1 - 글러벌 상태: https://algorandfoundation.github.io/puya/lg-storage.html#global-storage\n 힌트 2 - 코드 예시: https://github.com/algorandfoundation/puya/blob/11843f6bc4bb6e4c56ac53e3980f74df69d07397/examples/global_state/contract.py#L5\n ", - "methods": [ - { - "name": "bootstrap", - "args": [ - { - "type": "asset", - "name": "asset" - }, - { - "type": "uint64", - "name": "unitary_price" - }, - { - "type": "pay", - "name": "mbr_pay" - } - ], - "returns": { - "type": "void" - } - }, - { - "name": "buy", - "args": [ - { - "type": "pay", - "name": "buyer_txn" - }, - { - "type": "uint64", - "name": "quantity" - } - ], - "returns": { - "type": "void" - } - }, - { - "name": "withdraw_and_delete", - "args": [], - "returns": { - "type": "uint64" - } - } - ], - "networks": {} - }, - "bare_call_config": { - "no_op": "CREATE" - } -} - -/** - * Defines an onCompletionAction of 'no_op' - */ -export type OnCompleteNoOp = { onCompleteAction?: 'no_op' | OnApplicationComplete.NoOpOC } -/** - * Defines an onCompletionAction of 'opt_in' - */ -export type OnCompleteOptIn = { onCompleteAction: 'opt_in' | OnApplicationComplete.OptInOC } -/** - * Defines an onCompletionAction of 'close_out' - */ -export type OnCompleteCloseOut = { onCompleteAction: 'close_out' | OnApplicationComplete.CloseOutOC } -/** - * Defines an onCompletionAction of 'delete_application' - */ -export type OnCompleteDelApp = { onCompleteAction: 'delete_application' | OnApplicationComplete.DeleteApplicationOC } -/** - * Defines an onCompletionAction of 'update_application' - */ -export type OnCompleteUpdApp = { onCompleteAction: 'update_application' | OnApplicationComplete.UpdateApplicationOC } -/** - * A state record containing a single unsigned integer - */ -export type IntegerState = { - /** - * Gets the state value as a BigInt. - */ - asBigInt(): bigint - /** - * Gets the state value as a number. - */ - asNumber(): number -} -/** - * A state record containing binary data - */ -export type BinaryState = { - /** - * Gets the state value as a Uint8Array - */ - asByteArray(): Uint8Array - /** - * Gets the state value as a string - */ - asString(): string -} - -export type AppCreateCallTransactionResult = AppCallTransactionResult & Partial & AppReference -export type AppUpdateCallTransactionResult = AppCallTransactionResult & Partial - -export type AppClientComposeCallCoreParams = Omit & { - sendParams?: Omit -} -export type AppClientComposeExecuteParams = Pick - -export type IncludeSchema = { - /** - * Any overrides for the storage schema to request for the created app; by default the schema indicated by the app spec is used. - */ - schema?: Partial -} - -/** - * Defines the types of available calls and state of the NftMarketplace smart contract. - */ -export type NftMarketplace = { - /** - * Maps method signatures / names to their argument and return types. - */ - methods: - & Record<'bootstrap(asset,uint64,pay)void' | 'bootstrap', { - argsObj: { - asset: number | bigint - unitaryPrice: bigint | number - mbrPay: TransactionToSign | Transaction | Promise - } - argsTuple: [asset: number | bigint, unitaryPrice: bigint | number, mbrPay: TransactionToSign | Transaction | Promise] - returns: void - }> - & Record<'buy(pay,uint64)void' | 'buy', { - argsObj: { - buyerTxn: TransactionToSign | Transaction | Promise - quantity: bigint | number - } - argsTuple: [buyerTxn: TransactionToSign | Transaction | Promise, quantity: bigint | number] - returns: void - }> - & Record<'withdraw_and_delete()uint64' | 'withdraw_and_delete', { - argsObj: { - } - argsTuple: [] - returns: bigint - }> - /** - * Defines the shape of the global and local state of the application. - */ - state: { - global: { - assetId?: IntegerState - bootstrapped?: IntegerState - unitaryPrice?: IntegerState - } - } -} -/** - * Defines the possible abi call signatures - */ -export type NftMarketplaceSig = keyof NftMarketplace['methods'] -/** - * Defines an object containing all relevant parameters for a single call to the contract. Where TSignature is undefined, a bare call is made - */ -export type TypedCallParams = { - method: TSignature - methodArgs: TSignature extends undefined ? undefined : Array -} & AppClientCallCoreParams & CoreAppCallArgs -/** - * Defines the arguments required for a bare call - */ -export type BareCallArgs = Omit -/** - * Maps a method signature from the NftMarketplace smart contract to the method's arguments in either tuple of struct form - */ -export type MethodArgs = NftMarketplace['methods'][TSignature]['argsObj' | 'argsTuple'] -/** - * Maps a method signature from the NftMarketplace smart contract to the method's return type - */ -export type MethodReturn = NftMarketplace['methods'][TSignature]['returns'] - -/** - * A factory for available 'create' calls - */ -export type NftMarketplaceCreateCalls = (typeof NftMarketplaceCallFactory)['create'] -/** - * Defines supported create methods for this smart contract - */ -export type NftMarketplaceCreateCallParams = - | (TypedCallParams & (OnCompleteNoOp)) -/** - * A factory for available 'delete' calls - */ -export type NftMarketplaceDeleteCalls = (typeof NftMarketplaceCallFactory)['delete'] -/** - * Defines supported delete methods for this smart contract - */ -export type NftMarketplaceDeleteCallParams = - | TypedCallParams<'withdraw_and_delete()uint64'> -/** - * Defines arguments required for the deploy method. - */ -export type NftMarketplaceDeployArgs = { - deployTimeParams?: TealTemplateParams - /** - * A delegate which takes a create call factory and returns the create call params for this smart contract - */ - createCall?: (callFactory: NftMarketplaceCreateCalls) => NftMarketplaceCreateCallParams - /** - * A delegate which takes a delete call factory and returns the delete call params for this smart contract - */ - deleteCall?: (callFactory: NftMarketplaceDeleteCalls) => NftMarketplaceDeleteCallParams -} - - -/** - * Exposes methods for constructing all available smart contract calls - */ -export abstract class NftMarketplaceCallFactory { - /** - * Gets available create call factories - */ - static get create() { - return { - /** - * Constructs a create call for the NftMarketplace smart contract using a bare call - * - * @param params Any parameters for the call - * @returns A TypedCallParams object for the call - */ - bare(params: BareCallArgs & AppClientCallCoreParams & CoreAppCallArgs & AppClientCompilationParams & (OnCompleteNoOp) = {}) { - return { - method: undefined, - methodArgs: undefined, - ...params, - } - }, - } - } - - /** - * Gets available delete call factories - */ - static get delete() { - return { - /** - * Constructs a delete call for the NftMarketplace smart contract using the withdraw_and_delete()uint64 ABI method - * - * @param args Any args for the contract call - * @param params Any additional parameters for the call - * @returns A TypedCallParams object for the call - */ - withdrawAndDelete(args: MethodArgs<'withdraw_and_delete()uint64'>, params: AppClientCallCoreParams & CoreAppCallArgs = {}) { - return { - method: 'withdraw_and_delete()uint64' as const, - methodArgs: Array.isArray(args) ? args : [], - ...params, - } - }, - } - } - - /** - * Constructs a no op call for the bootstrap(asset,uint64,pay)void ABI method - * - * @param args Any args for the contract call - * @param params Any additional parameters for the call - * @returns A TypedCallParams object for the call - */ - static bootstrap(args: MethodArgs<'bootstrap(asset,uint64,pay)void'>, params: AppClientCallCoreParams & CoreAppCallArgs) { - return { - method: 'bootstrap(asset,uint64,pay)void' as const, - methodArgs: Array.isArray(args) ? args : [args.asset, args.unitaryPrice, args.mbrPay], - ...params, - } - } - /** - * Constructs a no op call for the buy(pay,uint64)void ABI method - * - * @param args Any args for the contract call - * @param params Any additional parameters for the call - * @returns A TypedCallParams object for the call - */ - static buy(args: MethodArgs<'buy(pay,uint64)void'>, params: AppClientCallCoreParams & CoreAppCallArgs) { - return { - method: 'buy(pay,uint64)void' as const, - methodArgs: Array.isArray(args) ? args : [args.buyerTxn, args.quantity], - ...params, - } - } -} - -/** - * A client to make calls to the NftMarketplace smart contract - */ -export class NftMarketplaceClient { - /** - * The underlying `ApplicationClient` for when you want to have more flexibility - */ - public readonly appClient: ApplicationClient - - private readonly sender: SendTransactionFrom | undefined - - /** - * Creates a new instance of `NftMarketplaceClient` - * - * @param appDetails appDetails The details to identify the app to deploy - * @param algod An algod client instance - */ - constructor(appDetails: AppDetails, private algod: Algodv2) { - this.sender = appDetails.sender - this.appClient = algokit.getAppClient({ - ...appDetails, - app: APP_SPEC - }, algod) - } - - /** - * Checks for decode errors on the AppCallTransactionResult and maps the return value to the specified generic type - * - * @param result The AppCallTransactionResult to be mapped - * @param returnValueFormatter An optional delegate to format the return value if required - * @returns The smart contract response with an updated return value - */ - protected mapReturnValue(result: AppCallTransactionResult, returnValueFormatter?: (value: any) => TReturn): AppCallTransactionResultOfType & TResult { - if(result.return?.decodeError) { - throw result.return.decodeError - } - const returnValue = result.return?.returnValue !== undefined && returnValueFormatter !== undefined - ? returnValueFormatter(result.return.returnValue) - : result.return?.returnValue as TReturn | undefined - return { ...result, return: returnValue } as AppCallTransactionResultOfType & TResult - } - - /** - * Calls the ABI method with the matching signature using an onCompletion code of NO_OP - * - * @param typedCallParams An object containing the method signature, args, and any other relevant parameters - * @param returnValueFormatter An optional delegate which when provided will be used to map non-undefined return values to the target type - * @returns The result of the smart contract call - */ - public async call(typedCallParams: TypedCallParams, returnValueFormatter?: (value: any) => MethodReturn) { - return this.mapReturnValue>(await this.appClient.call(typedCallParams), returnValueFormatter) - } - - /** - * Idempotently deploys the NftMarketplace smart contract. - * - * @param params The arguments for the contract calls and any additional parameters for the call - * @returns The deployment result - */ - public deploy(params: NftMarketplaceDeployArgs & AppClientDeployCoreParams & IncludeSchema = {}): ReturnType { - const createArgs = params.createCall?.(NftMarketplaceCallFactory.create) - const deleteArgs = params.deleteCall?.(NftMarketplaceCallFactory.delete) - return this.appClient.deploy({ - ...params, - deleteArgs, - createArgs, - createOnCompleteAction: createArgs?.onCompleteAction, - }) - } - - /** - * Gets available create methods - */ - public get create() { - const $this = this - return { - /** - * Creates a new instance of the NftMarketplace smart contract using a bare call. - * - * @param args The arguments for the bare call - * @returns The create result - */ - async bare(args: BareCallArgs & AppClientCallCoreParams & AppClientCompilationParams & IncludeSchema & CoreAppCallArgs & (OnCompleteNoOp) = {}) { - return $this.mapReturnValue(await $this.appClient.create(args)) - }, - } - } - - /** - * Gets available delete methods - */ - public get delete() { - const $this = this - return { - /** - * Deletes an existing instance of the NftMarketplace smart contract using the withdraw_and_delete()uint64 ABI method. - * - * @param args The arguments for the smart contract call - * @param params Any additional parameters for the call - * @returns The delete result - */ - async withdrawAndDelete(args: MethodArgs<'withdraw_and_delete()uint64'>, params: AppClientCallCoreParams & CoreAppCallArgs = {}) { - return $this.mapReturnValue>(await $this.appClient.delete(NftMarketplaceCallFactory.delete.withdrawAndDelete(args, params))) - }, - } - } - - /** - * Makes a clear_state call to an existing instance of the NftMarketplace smart contract. - * - * @param args The arguments for the bare call - * @returns The clear_state result - */ - public clearState(args: BareCallArgs & AppClientCallCoreParams & CoreAppCallArgs = {}) { - return this.appClient.clearState(args) - } - - /** - * Calls the bootstrap(asset,uint64,pay)void ABI method. - * - * @param args The arguments for the contract call - * @param params Any additional parameters for the call - * @returns The result of the call - */ - public bootstrap(args: MethodArgs<'bootstrap(asset,uint64,pay)void'>, params: AppClientCallCoreParams & CoreAppCallArgs = {}) { - return this.call(NftMarketplaceCallFactory.bootstrap(args, params)) - } - - /** - * Calls the buy(pay,uint64)void ABI method. - * - * @param args The arguments for the contract call - * @param params Any additional parameters for the call - * @returns The result of the call - */ - public buy(args: MethodArgs<'buy(pay,uint64)void'>, params: AppClientCallCoreParams & CoreAppCallArgs = {}) { - return this.call(NftMarketplaceCallFactory.buy(args, params)) - } - - /** - * Extracts a binary state value out of an AppState dictionary - * - * @param state The state dictionary containing the state value - * @param key The key of the state value - * @returns A BinaryState instance containing the state value, or undefined if the key was not found - */ - private static getBinaryState(state: AppState, key: string): BinaryState | undefined { - const value = state[key] - if (!value) return undefined - if (!('valueRaw' in value)) - throw new Error(`Failed to parse state value for ${key}; received an int when expected a byte array`) - return { - asString(): string { - return value.value - }, - asByteArray(): Uint8Array { - return value.valueRaw - } - } - } - - /** - * Extracts a integer state value out of an AppState dictionary - * - * @param state The state dictionary containing the state value - * @param key The key of the state value - * @returns An IntegerState instance containing the state value, or undefined if the key was not found - */ - private static getIntegerState(state: AppState, key: string): IntegerState | undefined { - const value = state[key] - if (!value) return undefined - if ('valueRaw' in value) - throw new Error(`Failed to parse state value for ${key}; received a byte array when expected a number`) - return { - asBigInt() { - return typeof value.value === 'bigint' ? value.value : BigInt(value.value) - }, - asNumber(): number { - return typeof value.value === 'bigint' ? Number(value.value) : value.value - }, - } - } - - /** - * Returns the smart contract's global state wrapped in a strongly typed accessor with options to format the stored value - */ - public async getGlobalState(): Promise { - const state = await this.appClient.getGlobalState() - return { - get assetId() { - return NftMarketplaceClient.getIntegerState(state, 'asset_id') - }, - get bootstrapped() { - return NftMarketplaceClient.getIntegerState(state, 'bootstrapped') - }, - get unitaryPrice() { - return NftMarketplaceClient.getIntegerState(state, 'unitary_price') - }, - } - } - - public compose(): NftMarketplaceComposer { - const client = this - const atc = new AtomicTransactionComposer() - let promiseChain:Promise = Promise.resolve() - const resultMappers: Array any)> = [] - return { - bootstrap(args: MethodArgs<'bootstrap(asset,uint64,pay)void'>, params?: AppClientComposeCallCoreParams & CoreAppCallArgs) { - promiseChain = promiseChain.then(() => client.bootstrap(args, {...params, sendParams: {...params?.sendParams, skipSending: true, atc}})) - resultMappers.push(undefined) - return this - }, - buy(args: MethodArgs<'buy(pay,uint64)void'>, params?: AppClientComposeCallCoreParams & CoreAppCallArgs) { - promiseChain = promiseChain.then(() => client.buy(args, {...params, sendParams: {...params?.sendParams, skipSending: true, atc}})) - resultMappers.push(undefined) - return this - }, - get delete() { - const $this = this - return { - withdrawAndDelete(args: MethodArgs<'withdraw_and_delete()uint64'>, params?: AppClientComposeCallCoreParams) { - promiseChain = promiseChain.then(() => client.delete.withdrawAndDelete(args, {...params, sendParams: {...params?.sendParams, skipSending: true, atc}})) - resultMappers.push(undefined) - return $this - }, - } - }, - clearState(args?: BareCallArgs & AppClientComposeCallCoreParams & CoreAppCallArgs) { - promiseChain = promiseChain.then(() => client.clearState({...args, sendParams: {...args?.sendParams, skipSending: true, atc}})) - resultMappers.push(undefined) - return this - }, - addTransaction(txn: TransactionWithSigner | TransactionToSign | Transaction | Promise, defaultSender?: SendTransactionFrom) { - promiseChain = promiseChain.then(async () => atc.addTransaction(await algokit.getTransactionWithSigner(txn, defaultSender ?? client.sender))) - return this - }, - async atc() { - await promiseChain - return atc - }, - async simulate(options?: SimulateOptions) { - await promiseChain - const result = await atc.simulate(client.algod, new modelsv2.SimulateRequest({ txnGroups: [], ...options })) - return { - ...result, - returns: result.methodResults?.map((val, i) => resultMappers[i] !== undefined ? resultMappers[i]!(val.returnValue) : val.returnValue) - } - }, - async execute(sendParams?: AppClientComposeExecuteParams) { - await promiseChain - const result = await algokit.sendAtomicTransactionComposer({ atc, sendParams }, client.algod) - return { - ...result, - returns: result.returns?.map((val, i) => resultMappers[i] !== undefined ? resultMappers[i]!(val.returnValue) : val.returnValue) - } - } - } as unknown as NftMarketplaceComposer - } -} -export type NftMarketplaceComposer = { - /** - * Calls the bootstrap(asset,uint64,pay)void ABI method. - * - * @param args The arguments for the contract call - * @param params Any additional parameters for the call - * @returns The typed transaction composer so you can fluently chain multiple calls or call execute to execute all queued up transactions - */ - bootstrap(args: MethodArgs<'bootstrap(asset,uint64,pay)void'>, params?: AppClientComposeCallCoreParams & CoreAppCallArgs): NftMarketplaceComposer<[...TReturns, MethodReturn<'bootstrap(asset,uint64,pay)void'>]> - - /** - * Calls the buy(pay,uint64)void ABI method. - * - * @param args The arguments for the contract call - * @param params Any additional parameters for the call - * @returns The typed transaction composer so you can fluently chain multiple calls or call execute to execute all queued up transactions - */ - buy(args: MethodArgs<'buy(pay,uint64)void'>, params?: AppClientComposeCallCoreParams & CoreAppCallArgs): NftMarketplaceComposer<[...TReturns, MethodReturn<'buy(pay,uint64)void'>]> - - /** - * Gets available delete methods - */ - readonly delete: { - /** - * Deletes an existing instance of the NftMarketplace smart contract using the withdraw_and_delete()uint64 ABI method. - * - * @param args The arguments for the smart contract call - * @param params Any additional parameters for the call - * @returns The typed transaction composer so you can fluently chain multiple calls or call execute to execute all queued up transactions - */ - withdrawAndDelete(args: MethodArgs<'withdraw_and_delete()uint64'>, params?: AppClientComposeCallCoreParams): NftMarketplaceComposer<[...TReturns, MethodReturn<'withdraw_and_delete()uint64'>]> - } - - /** - * Makes a clear_state call to an existing instance of the NftMarketplace smart contract. - * - * @param args The arguments for the bare call - * @returns The typed transaction composer so you can fluently chain multiple calls or call execute to execute all queued up transactions - */ - clearState(args?: BareCallArgs & AppClientComposeCallCoreParams & CoreAppCallArgs): NftMarketplaceComposer<[...TReturns, undefined]> - - /** - * Adds a transaction to the composer - * - * @param txn One of: A TransactionWithSigner object (returned as is), a TransactionToSign object (signer is obtained from the signer property), a Transaction object (signer is extracted from the defaultSender parameter), an async SendTransactionResult returned by one of algokit utils helpers (signer is obtained from the defaultSender parameter) - * @param defaultSender The default sender to be used to obtain a signer where the object provided to the transaction parameter does not include a signer. - */ - addTransaction(txn: TransactionWithSigner | TransactionToSign | Transaction | Promise, defaultSender?: SendTransactionFrom): NftMarketplaceComposer - /** - * Returns the underlying AtomicTransactionComposer instance - */ - atc(): Promise - /** - * Simulates the transaction group and returns the result - */ - simulate(options?: SimulateOptions): Promise> - /** - * Executes the transaction group and returns the results - */ - execute(sendParams?: AppClientComposeExecuteParams): Promise> -} -export type SimulateOptions = Omit[0], 'txnGroups'> -export type NftMarketplaceComposerSimulateResult = { - returns: TReturns - methodResults: ABIResult[] - simulateResponse: modelsv2.SimulateResponse -} -export type NftMarketplaceComposerResults = { - returns: TReturns - groupId: string - txIds: string[] - transactions: Transaction[] -} diff --git a/projects/orakle-nft-marketplace-app-frontend/src/contracts/NftMarketplaceList.ts b/projects/orakle-nft-marketplace-app-frontend/src/contracts/NftMarketplaceList.ts deleted file mode 100644 index f169473..0000000 --- a/projects/orakle-nft-marketplace-app-frontend/src/contracts/NftMarketplaceList.ts +++ /dev/null @@ -1,639 +0,0 @@ -/* eslint-disable */ -/** - * This file was automatically generated by @algorandfoundation/algokit-client-generator. - * DO NOT MODIFY IT BY HAND. - * requires: @algorandfoundation/algokit-utils: ^2 - */ -import * as algokit from '@algorandfoundation/algokit-utils' -import type { - ABIAppCallArg, - AppCallTransactionResult, - AppCallTransactionResultOfType, - AppCompilationResult, - AppReference, - AppState, - AppStorageSchema, - CoreAppCallArgs, - RawAppCallArgs, - TealTemplateParams, -} from '@algorandfoundation/algokit-utils/types/app' -import type { - AppClientCallCoreParams, - AppClientCompilationParams, - AppClientDeployCoreParams, - AppDetails, - ApplicationClient, -} from '@algorandfoundation/algokit-utils/types/app-client' -import type { AppSpec } from '@algorandfoundation/algokit-utils/types/app-spec' -import type { SendTransactionResult, TransactionToSign, SendTransactionFrom, SendTransactionParams } from '@algorandfoundation/algokit-utils/types/transaction' -import type { ABIResult, TransactionWithSigner } from 'algosdk' -import { Algodv2, OnApplicationComplete, Transaction, AtomicTransactionComposer, modelsv2 } from 'algosdk' -export const APP_SPEC: AppSpec = { - "hints": { - "add_marketplace_to_list(uint64)uint64[]": { - "call_config": { - "no_op": "CALL" - } - }, - "remove_marketplace_from_list(uint64)uint64[]": { - "call_config": { - "no_op": "CALL" - } - }, - "read_marketplace_list()uint64[]": { - "read_only": true, - "call_config": { - "no_op": "CALL" - } - } - }, - "source": { - "approval": "I3ByYWdtYSB2ZXJzaW9uIDEwCgpzbWFydF9jb250cmFjdHMubmZ0X21hcmtldHBsYWNlX2xpc3QuY29udHJhY3QuTmZ0TWFya2V0cGxhY2VMaXN0LmFwcHJvdmFsX3Byb2dyYW06CiAgICB0eG4gQXBwbGljYXRpb25JRAogICAgYm56IG1haW5fZW50cnlwb2ludEAyCiAgICBjYWxsc3ViIF9faW5pdF9fCgptYWluX2VudHJ5cG9pbnRAMjoKICAgIC8vIHNtYXJ0X2NvbnRyYWN0cy9uZnRfbWFya2V0cGxhY2VfbGlzdC9jb250cmFjdC5weTo5CiAgICAvLyBjbGFzcyBOZnRNYXJrZXRwbGFjZUxpc3QoQVJDNENvbnRyYWN0KToKICAgIHR4biBOdW1BcHBBcmdzCiAgICBieiBtYWluX2JhcmVfcm91dGluZ0A5CiAgICBtZXRob2QgImFkZF9tYXJrZXRwbGFjZV90b19saXN0KHVpbnQ2NCl1aW50NjRbXSIKICAgIG1ldGhvZCAicmVtb3ZlX21hcmtldHBsYWNlX2Zyb21fbGlzdCh1aW50NjQpdWludDY0W10iCiAgICBtZXRob2QgInJlYWRfbWFya2V0cGxhY2VfbGlzdCgpdWludDY0W10iCiAgICB0eG5hIEFwcGxpY2F0aW9uQXJncyAwCiAgICBtYXRjaCBtYWluX2FkZF9tYXJrZXRwbGFjZV90b19saXN0X3JvdXRlQDQgbWFpbl9yZW1vdmVfbWFya2V0cGxhY2VfZnJvbV9saXN0X3JvdXRlQDUgbWFpbl9yZWFkX21hcmtldHBsYWNlX2xpc3Rfcm91dGVANgogICAgZXJyIC8vIHJlamVjdCB0cmFuc2FjdGlvbgoKbWFpbl9hZGRfbWFya2V0cGxhY2VfdG9fbGlzdF9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0TWFya2V0cGxhY2VMaXN0Ll9faW5pdF9fKCkgLT4gdm9pZDoKX19pbml0X186CiAgICAvLyBzbWFydF9jb250cmFjdHMvbmZ0X21hcmtldHBsYWNlX2xpc3QvY29udHJhY3QucHk6MTEKICAgIC8vIGRlZiBfX2luaXRfXyhzZWxmKSAtPiBOb25lOgogICAgcHJvdG8gMCAwCiAgICAvLyBzbWFydF9jb250cmFjdHMvbmZ0X21hcmtldHBsYWNlX2xpc3QvY29udHJhY3QucHk6MTIKICAgIC8vIHNlbGYubWFya2V0cGxhY2VfbGlzdCA9IGFwcF9pZF9saXN0KCkKICAgIGJ5dGUgIm1hcmtldHBsYWNlX2xpc3QiCiAgICBieXRlIDB4MDAwMAogICAgYXBwX2dsb2JhbF9wdXQKICAgIHJldHN1Ygo=", - "clear": "I3ByYWdtYSB2ZXJzaW9uIDEwCgpzbWFydF9jb250cmFjdHMubmZ0X21hcmtldHBsYWNlX2xpc3QuY29udHJhY3QuTmZ0TWFya2V0cGxhY2VMaXN0LmNsZWFyX3N0YXRlX3Byb2dyYW06CiAgICAvLyBzbWFydF9jb250cmFjdHMvbmZ0X21hcmtldHBsYWNlX2xpc3QvY29udHJhY3QucHk6OQogICAgLy8gY2xhc3MgTmZ0TWFya2V0cGxhY2VMaXN0KEFSQzRDb250cmFjdCk6CiAgICBpbnQgMQogICAgcmV0dXJuCg==" - }, - "state": { - "global": { - "num_byte_slices": 1, - "num_uints": 0 - }, - "local": { - "num_byte_slices": 0, - "num_uints": 0 - } - }, - "schema": { - "global": { - "declared": { - "marketplace_list": { - "type": "bytes", - "key": "marketplace_list" - } - }, - "reserved": {} - }, - "local": { - "declared": {}, - "reserved": {} - } - }, - "contract": { - "name": "NftMarketplaceList", - "methods": [ - { - "name": "add_marketplace_to_list", - "args": [ - { - "type": "uint64", - "name": "app_id" - } - ], - "returns": { - "type": "uint64[]" - } - }, - { - "name": "remove_marketplace_from_list", - "args": [ - { - "type": "uint64", - "name": "app_id" - } - ], - "returns": { - "type": "uint64[]" - } - }, - { - "name": "read_marketplace_list", - "args": [], - "returns": { - "type": "uint64[]" - } - } - ], - "networks": {} - }, - "bare_call_config": { - "no_op": "CREATE" - } -} - -/** - * Defines an onCompletionAction of 'no_op' - */ -export type OnCompleteNoOp = { onCompleteAction?: 'no_op' | OnApplicationComplete.NoOpOC } -/** - * Defines an onCompletionAction of 'opt_in' - */ -export type OnCompleteOptIn = { onCompleteAction: 'opt_in' | OnApplicationComplete.OptInOC } -/** - * Defines an onCompletionAction of 'close_out' - */ -export type OnCompleteCloseOut = { onCompleteAction: 'close_out' | OnApplicationComplete.CloseOutOC } -/** - * Defines an onCompletionAction of 'delete_application' - */ -export type OnCompleteDelApp = { onCompleteAction: 'delete_application' | OnApplicationComplete.DeleteApplicationOC } -/** - * Defines an onCompletionAction of 'update_application' - */ -export type OnCompleteUpdApp = { onCompleteAction: 'update_application' | OnApplicationComplete.UpdateApplicationOC } -/** - * A state record containing a single unsigned integer - */ -export type IntegerState = { - /** - * Gets the state value as a BigInt. - */ - asBigInt(): bigint - /** - * Gets the state value as a number. - */ - asNumber(): number -} -/** - * A state record containing binary data - */ -export type BinaryState = { - /** - * Gets the state value as a Uint8Array - */ - asByteArray(): Uint8Array - /** - * Gets the state value as a string - */ - asString(): string -} - -export type AppCreateCallTransactionResult = AppCallTransactionResult & Partial & AppReference -export type AppUpdateCallTransactionResult = AppCallTransactionResult & Partial - -export type AppClientComposeCallCoreParams = Omit & { - sendParams?: Omit -} -export type AppClientComposeExecuteParams = Pick - -export type IncludeSchema = { - /** - * Any overrides for the storage schema to request for the created app; by default the schema indicated by the app spec is used. - */ - schema?: Partial -} - -/** - * Defines the types of available calls and state of the NftMarketplaceList smart contract. - */ -export type NftMarketplaceList = { - /** - * Maps method signatures / names to their argument and return types. - */ - methods: - & Record<'add_marketplace_to_list(uint64)uint64[]' | 'add_marketplace_to_list', { - argsObj: { - appId: bigint | number - } - argsTuple: [appId: bigint | number] - returns: bigint[] - }> - & Record<'remove_marketplace_from_list(uint64)uint64[]' | 'remove_marketplace_from_list', { - argsObj: { - appId: bigint | number - } - argsTuple: [appId: bigint | number] - returns: bigint[] - }> - & Record<'read_marketplace_list()uint64[]' | 'read_marketplace_list', { - argsObj: { - } - argsTuple: [] - returns: bigint[] - }> - /** - * Defines the shape of the global and local state of the application. - */ - state: { - global: { - marketplaceList?: BinaryState - } - } -} -/** - * Defines the possible abi call signatures - */ -export type NftMarketplaceListSig = keyof NftMarketplaceList['methods'] -/** - * Defines an object containing all relevant parameters for a single call to the contract. Where TSignature is undefined, a bare call is made - */ -export type TypedCallParams = { - method: TSignature - methodArgs: TSignature extends undefined ? undefined : Array -} & AppClientCallCoreParams & CoreAppCallArgs -/** - * Defines the arguments required for a bare call - */ -export type BareCallArgs = Omit -/** - * Maps a method signature from the NftMarketplaceList smart contract to the method's arguments in either tuple of struct form - */ -export type MethodArgs = NftMarketplaceList['methods'][TSignature]['argsObj' | 'argsTuple'] -/** - * Maps a method signature from the NftMarketplaceList smart contract to the method's return type - */ -export type MethodReturn = NftMarketplaceList['methods'][TSignature]['returns'] - -/** - * A factory for available 'create' calls - */ -export type NftMarketplaceListCreateCalls = (typeof NftMarketplaceListCallFactory)['create'] -/** - * Defines supported create methods for this smart contract - */ -export type NftMarketplaceListCreateCallParams = - | (TypedCallParams & (OnCompleteNoOp)) -/** - * Defines arguments required for the deploy method. - */ -export type NftMarketplaceListDeployArgs = { - deployTimeParams?: TealTemplateParams - /** - * A delegate which takes a create call factory and returns the create call params for this smart contract - */ - createCall?: (callFactory: NftMarketplaceListCreateCalls) => NftMarketplaceListCreateCallParams -} - - -/** - * Exposes methods for constructing all available smart contract calls - */ -export abstract class NftMarketplaceListCallFactory { - /** - * Gets available create call factories - */ - static get create() { - return { - /** - * Constructs a create call for the NftMarketplaceList smart contract using a bare call - * - * @param params Any parameters for the call - * @returns A TypedCallParams object for the call - */ - bare(params: BareCallArgs & AppClientCallCoreParams & CoreAppCallArgs & AppClientCompilationParams & (OnCompleteNoOp) = {}) { - return { - method: undefined, - methodArgs: undefined, - ...params, - } - }, - } - } - - /** - * Constructs a no op call for the add_marketplace_to_list(uint64)uint64[] ABI method - * - * @param args Any args for the contract call - * @param params Any additional parameters for the call - * @returns A TypedCallParams object for the call - */ - static addMarketplaceToList(args: MethodArgs<'add_marketplace_to_list(uint64)uint64[]'>, params: AppClientCallCoreParams & CoreAppCallArgs) { - return { - method: 'add_marketplace_to_list(uint64)uint64[]' as const, - methodArgs: Array.isArray(args) ? args : [args.appId], - ...params, - } - } - /** - * Constructs a no op call for the remove_marketplace_from_list(uint64)uint64[] ABI method - * - * @param args Any args for the contract call - * @param params Any additional parameters for the call - * @returns A TypedCallParams object for the call - */ - static removeMarketplaceFromList(args: MethodArgs<'remove_marketplace_from_list(uint64)uint64[]'>, params: AppClientCallCoreParams & CoreAppCallArgs) { - return { - method: 'remove_marketplace_from_list(uint64)uint64[]' as const, - methodArgs: Array.isArray(args) ? args : [args.appId], - ...params, - } - } - /** - * Constructs a no op call for the read_marketplace_list()uint64[] ABI method - * - * @param args Any args for the contract call - * @param params Any additional parameters for the call - * @returns A TypedCallParams object for the call - */ - static readMarketplaceList(args: MethodArgs<'read_marketplace_list()uint64[]'>, params: AppClientCallCoreParams & CoreAppCallArgs) { - return { - method: 'read_marketplace_list()uint64[]' as const, - methodArgs: Array.isArray(args) ? args : [], - ...params, - } - } -} - -/** - * A client to make calls to the NftMarketplaceList smart contract - */ -export class NftMarketplaceListClient { - /** - * The underlying `ApplicationClient` for when you want to have more flexibility - */ - public readonly appClient: ApplicationClient - - private readonly sender: SendTransactionFrom | undefined - - /** - * Creates a new instance of `NftMarketplaceListClient` - * - * @param appDetails appDetails The details to identify the app to deploy - * @param algod An algod client instance - */ - constructor(appDetails: AppDetails, private algod: Algodv2) { - this.sender = appDetails.sender - this.appClient = algokit.getAppClient({ - ...appDetails, - app: APP_SPEC - }, algod) - } - - /** - * Checks for decode errors on the AppCallTransactionResult and maps the return value to the specified generic type - * - * @param result The AppCallTransactionResult to be mapped - * @param returnValueFormatter An optional delegate to format the return value if required - * @returns The smart contract response with an updated return value - */ - protected mapReturnValue(result: AppCallTransactionResult, returnValueFormatter?: (value: any) => TReturn): AppCallTransactionResultOfType & TResult { - if(result.return?.decodeError) { - throw result.return.decodeError - } - const returnValue = result.return?.returnValue !== undefined && returnValueFormatter !== undefined - ? returnValueFormatter(result.return.returnValue) - : result.return?.returnValue as TReturn | undefined - return { ...result, return: returnValue } as AppCallTransactionResultOfType & TResult - } - - /** - * Calls the ABI method with the matching signature using an onCompletion code of NO_OP - * - * @param typedCallParams An object containing the method signature, args, and any other relevant parameters - * @param returnValueFormatter An optional delegate which when provided will be used to map non-undefined return values to the target type - * @returns The result of the smart contract call - */ - public async call(typedCallParams: TypedCallParams, returnValueFormatter?: (value: any) => MethodReturn) { - return this.mapReturnValue>(await this.appClient.call(typedCallParams), returnValueFormatter) - } - - /** - * Idempotently deploys the NftMarketplaceList smart contract. - * - * @param params The arguments for the contract calls and any additional parameters for the call - * @returns The deployment result - */ - public deploy(params: NftMarketplaceListDeployArgs & AppClientDeployCoreParams & IncludeSchema = {}): ReturnType { - const createArgs = params.createCall?.(NftMarketplaceListCallFactory.create) - return this.appClient.deploy({ - ...params, - createArgs, - createOnCompleteAction: createArgs?.onCompleteAction, - }) - } - - /** - * Gets available create methods - */ - public get create() { - const $this = this - return { - /** - * Creates a new instance of the NftMarketplaceList smart contract using a bare call. - * - * @param args The arguments for the bare call - * @returns The create result - */ - async bare(args: BareCallArgs & AppClientCallCoreParams & AppClientCompilationParams & IncludeSchema & CoreAppCallArgs & (OnCompleteNoOp) = {}) { - return $this.mapReturnValue(await $this.appClient.create(args)) - }, - } - } - - /** - * Makes a clear_state call to an existing instance of the NftMarketplaceList smart contract. - * - * @param args The arguments for the bare call - * @returns The clear_state result - */ - public clearState(args: BareCallArgs & AppClientCallCoreParams & CoreAppCallArgs = {}) { - return this.appClient.clearState(args) - } - - /** - * Calls the add_marketplace_to_list(uint64)uint64[] ABI method. - * - * @param args The arguments for the contract call - * @param params Any additional parameters for the call - * @returns The result of the call - */ - public addMarketplaceToList(args: MethodArgs<'add_marketplace_to_list(uint64)uint64[]'>, params: AppClientCallCoreParams & CoreAppCallArgs = {}) { - return this.call(NftMarketplaceListCallFactory.addMarketplaceToList(args, params)) - } - - /** - * Calls the remove_marketplace_from_list(uint64)uint64[] ABI method. - * - * @param args The arguments for the contract call - * @param params Any additional parameters for the call - * @returns The result of the call - */ - public removeMarketplaceFromList(args: MethodArgs<'remove_marketplace_from_list(uint64)uint64[]'>, params: AppClientCallCoreParams & CoreAppCallArgs = {}) { - return this.call(NftMarketplaceListCallFactory.removeMarketplaceFromList(args, params)) - } - - /** - * Calls the read_marketplace_list()uint64[] ABI method. - * - * @param args The arguments for the contract call - * @param params Any additional parameters for the call - * @returns The result of the call - */ - public readMarketplaceList(args: MethodArgs<'read_marketplace_list()uint64[]'>, params: AppClientCallCoreParams & CoreAppCallArgs = {}) { - return this.call(NftMarketplaceListCallFactory.readMarketplaceList(args, params)) - } - - /** - * Extracts a binary state value out of an AppState dictionary - * - * @param state The state dictionary containing the state value - * @param key The key of the state value - * @returns A BinaryState instance containing the state value, or undefined if the key was not found - */ - private static getBinaryState(state: AppState, key: string): BinaryState | undefined { - const value = state[key] - if (!value) return undefined - if (!('valueRaw' in value)) - throw new Error(`Failed to parse state value for ${key}; received an int when expected a byte array`) - return { - asString(): string { - return value.value - }, - asByteArray(): Uint8Array { - return value.valueRaw - } - } - } - - /** - * Extracts a integer state value out of an AppState dictionary - * - * @param state The state dictionary containing the state value - * @param key The key of the state value - * @returns An IntegerState instance containing the state value, or undefined if the key was not found - */ - private static getIntegerState(state: AppState, key: string): IntegerState | undefined { - const value = state[key] - if (!value) return undefined - if ('valueRaw' in value) - throw new Error(`Failed to parse state value for ${key}; received a byte array when expected a number`) - return { - asBigInt() { - return typeof value.value === 'bigint' ? value.value : BigInt(value.value) - }, - asNumber(): number { - return typeof value.value === 'bigint' ? Number(value.value) : value.value - }, - } - } - - /** - * Returns the smart contract's global state wrapped in a strongly typed accessor with options to format the stored value - */ - public async getGlobalState(): Promise { - const state = await this.appClient.getGlobalState() - return { - get marketplaceList() { - return NftMarketplaceListClient.getBinaryState(state, 'marketplace_list') - }, - } - } - - public compose(): NftMarketplaceListComposer { - const client = this - const atc = new AtomicTransactionComposer() - let promiseChain:Promise = Promise.resolve() - const resultMappers: Array any)> = [] - return { - addMarketplaceToList(args: MethodArgs<'add_marketplace_to_list(uint64)uint64[]'>, params?: AppClientComposeCallCoreParams & CoreAppCallArgs) { - promiseChain = promiseChain.then(() => client.addMarketplaceToList(args, {...params, sendParams: {...params?.sendParams, skipSending: true, atc}})) - resultMappers.push(undefined) - return this - }, - removeMarketplaceFromList(args: MethodArgs<'remove_marketplace_from_list(uint64)uint64[]'>, params?: AppClientComposeCallCoreParams & CoreAppCallArgs) { - promiseChain = promiseChain.then(() => client.removeMarketplaceFromList(args, {...params, sendParams: {...params?.sendParams, skipSending: true, atc}})) - resultMappers.push(undefined) - return this - }, - readMarketplaceList(args: MethodArgs<'read_marketplace_list()uint64[]'>, params?: AppClientComposeCallCoreParams & CoreAppCallArgs) { - promiseChain = promiseChain.then(() => client.readMarketplaceList(args, {...params, sendParams: {...params?.sendParams, skipSending: true, atc}})) - resultMappers.push(undefined) - return this - }, - clearState(args?: BareCallArgs & AppClientComposeCallCoreParams & CoreAppCallArgs) { - promiseChain = promiseChain.then(() => client.clearState({...args, sendParams: {...args?.sendParams, skipSending: true, atc}})) - resultMappers.push(undefined) - return this - }, - addTransaction(txn: TransactionWithSigner | TransactionToSign | Transaction | Promise, defaultSender?: SendTransactionFrom) { - promiseChain = promiseChain.then(async () => atc.addTransaction(await algokit.getTransactionWithSigner(txn, defaultSender ?? client.sender))) - return this - }, - async atc() { - await promiseChain - return atc - }, - async simulate(options?: SimulateOptions) { - await promiseChain - const result = await atc.simulate(client.algod, new modelsv2.SimulateRequest({ txnGroups: [], ...options })) - return { - ...result, - returns: result.methodResults?.map((val, i) => resultMappers[i] !== undefined ? resultMappers[i]!(val.returnValue) : val.returnValue) - } - }, - async execute(sendParams?: AppClientComposeExecuteParams) { - await promiseChain - const result = await algokit.sendAtomicTransactionComposer({ atc, sendParams }, client.algod) - return { - ...result, - returns: result.returns?.map((val, i) => resultMappers[i] !== undefined ? resultMappers[i]!(val.returnValue) : val.returnValue) - } - } - } as unknown as NftMarketplaceListComposer - } -} -export type NftMarketplaceListComposer = { - /** - * Calls the add_marketplace_to_list(uint64)uint64[] ABI method. - * - * @param args The arguments for the contract call - * @param params Any additional parameters for the call - * @returns The typed transaction composer so you can fluently chain multiple calls or call execute to execute all queued up transactions - */ - addMarketplaceToList(args: MethodArgs<'add_marketplace_to_list(uint64)uint64[]'>, params?: AppClientComposeCallCoreParams & CoreAppCallArgs): NftMarketplaceListComposer<[...TReturns, MethodReturn<'add_marketplace_to_list(uint64)uint64[]'>]> - - /** - * Calls the remove_marketplace_from_list(uint64)uint64[] ABI method. - * - * @param args The arguments for the contract call - * @param params Any additional parameters for the call - * @returns The typed transaction composer so you can fluently chain multiple calls or call execute to execute all queued up transactions - */ - removeMarketplaceFromList(args: MethodArgs<'remove_marketplace_from_list(uint64)uint64[]'>, params?: AppClientComposeCallCoreParams & CoreAppCallArgs): NftMarketplaceListComposer<[...TReturns, MethodReturn<'remove_marketplace_from_list(uint64)uint64[]'>]> - - /** - * Calls the read_marketplace_list()uint64[] ABI method. - * - * @param args The arguments for the contract call - * @param params Any additional parameters for the call - * @returns The typed transaction composer so you can fluently chain multiple calls or call execute to execute all queued up transactions - */ - readMarketplaceList(args: MethodArgs<'read_marketplace_list()uint64[]'>, params?: AppClientComposeCallCoreParams & CoreAppCallArgs): NftMarketplaceListComposer<[...TReturns, MethodReturn<'read_marketplace_list()uint64[]'>]> - - /** - * Makes a clear_state call to an existing instance of the NftMarketplaceList smart contract. - * - * @param args The arguments for the bare call - * @returns The typed transaction composer so you can fluently chain multiple calls or call execute to execute all queued up transactions - */ - clearState(args?: BareCallArgs & AppClientComposeCallCoreParams & CoreAppCallArgs): NftMarketplaceListComposer<[...TReturns, undefined]> - - /** - * Adds a transaction to the composer - * - * @param txn One of: A TransactionWithSigner object (returned as is), a TransactionToSign object (signer is obtained from the signer property), a Transaction object (signer is extracted from the defaultSender parameter), an async SendTransactionResult returned by one of algokit utils helpers (signer is obtained from the defaultSender parameter) - * @param defaultSender The default sender to be used to obtain a signer where the object provided to the transaction parameter does not include a signer. - */ - addTransaction(txn: TransactionWithSigner | TransactionToSign | Transaction | Promise, defaultSender?: SendTransactionFrom): NftMarketplaceListComposer - /** - * Returns the underlying AtomicTransactionComposer instance - */ - atc(): Promise - /** - * Simulates the transaction group and returns the result - */ - simulate(options?: SimulateOptions): Promise> - /** - * Executes the transaction group and returns the results - */ - execute(sendParams?: AppClientComposeExecuteParams): Promise> -} -export type SimulateOptions = Omit[0], 'txnGroups'> -export type NftMarketplaceListComposerSimulateResult = { - returns: TReturns - methodResults: ABIResult[] - simulateResponse: modelsv2.SimulateResponse -} -export type NftMarketplaceListComposerResults = { - returns: TReturns - groupId: string - txIds: string[] - transactions: Transaction[] -} From 9ca68bb434f8c18627ac692aee105b363d45ada2 Mon Sep 17 00:00:00 2001 From: "Chris Kim (Hyunggun)" Date: Thu, 30 May 2024 21:14:07 +0900 Subject: [PATCH 2/3] contract question update --- .../smart_contracts/nft_marketplace/contract.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/orakle-nft-marketplace-app-contracts/smart_contracts/nft_marketplace/contract.py b/projects/orakle-nft-marketplace-app-contracts/smart_contracts/nft_marketplace/contract.py index bc4ddb2..c7bba61 100644 --- a/projects/orakle-nft-marketplace-app-contracts/smart_contracts/nft_marketplace/contract.py +++ b/projects/orakle-nft-marketplace-app-contracts/smart_contracts/nft_marketplace/contract.py @@ -153,7 +153,7 @@ def buy( - 메서드 호출자(Txn.sender)가 앱의 생성자(Global.creator_address)인지 체크해야합니다. # 2단계: withdraw_and_delete 메서드는 아래 기능들을 수행합니다. - 1. 앱 계정에 있는 에셋(ASA)을 앱 계정으로 전송합니다. (AssetTransfer Transaction) + 1. 앱 계정에 있는 에셋(ASA)을 앱 호출자 계정으로 전송합니다. (AssetTransfer Transaction) 이때 asset_close_to 패러미터를 앱 생성자(판매자)로 설정하여 앱 계정에 남아있는 에섯 전부를 앱 생성자(판매자)에게 보냅니다. 에셋의 수량과 무관하게 전 수량 송금되기 때문에 에셋 수량(asset_amount)은 설정하지 않으셔도 됩니다. From 0fd5e84a17afd2f8ac945be3362093dbe1608729 Mon Sep 17 00:00:00 2001 From: "Chris Kim (Hyunggun)" Date: Fri, 31 May 2024 01:34:53 +0900 Subject: [PATCH 3/3] instruction update --- .../src/utils/getCurrentNftmClient.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/projects/orakle-nft-marketplace-app-frontend/src/utils/getCurrentNftmClient.ts b/projects/orakle-nft-marketplace-app-frontend/src/utils/getCurrentNftmClient.ts index 12aeec0..15c4741 100644 --- a/projects/orakle-nft-marketplace-app-frontend/src/utils/getCurrentNftmClient.ts +++ b/projects/orakle-nft-marketplace-app-frontend/src/utils/getCurrentNftmClient.ts @@ -34,9 +34,10 @@ export function getCurrentNftmClient( 주목!!! - 3번째 줄에서 import { NftMarketplaceClient } from '../contracts/NftMarketplace'로 import한 클래스는 Nft 마켓플레이스 앱을 빌드할때 자동 생성된 클라이언트 클래스입니다. - - id값에는 currentAppId를 넣어주세요. + - 이 문제는 getCurrentNftmClient 함수의 인수로 들어오는 4개의 인수를 모두 사용하셔서 푸셔야 합니다. + - id값에는 getCurrentNftmClient의 인수값으로 들어오는 currentAppId를 넣어주세요. - sender값에는 { addr: activeAddress!, signer }를 복붙해주세요. useWallet를 통해 현재 연결된 지갑 주소와 서명자를 포함한 객체를 설정해주는 코드입니다. - - NftMarketplaceClient 생성자의 두번째 인자인 algod는 algorandClient.client 안에 있습니다. + - NftMarketplaceClient 생성자의 두번째 인자인 algod는 getCurrentNftmClient의 인수값으로 들어오는 algorandClient의 algorandClient.client 안에 있습니다. 힌트: https://github.com/algorandfoundation/algokit-client-generator-ts/blob/main/docs/usage.md#creating-an-application-client-instance */