This repository was archived by the owner on May 3, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +11
-7
lines changed Expand file tree Collapse file tree 3 files changed +11
-7
lines changed Original file line number Diff line number Diff line change 18
18
nft_module = sdk .get_nft_module ("0xbDfF8fb43688fB4D2184DF8029A7238ac1413A24" )
19
19
print (nft_module .total_supply ())
20
20
21
- minted_nft = nft_module .mint (arg = MintArg (name = "Test 123" , description = "Some description" ))
22
- print (minted_nft )
23
- # print(nft_module.get(27))
24
- #
21
+ # minted_nft = nft_module.mint(arg=MintArg(name="Test 123", description="Some description"))
22
+ # print(minted_nft)
23
+
24
+ for nft in nft_module .get_all ():
25
+ print (nft )
Original file line number Diff line number Diff line change 7
7
from web3 .types import TxReceipt
8
8
9
9
from . import BaseModule
10
- from typing import Callable , Dict , NamedTuple
10
+ from typing import Callable , Dict , NamedTuple , List
11
11
from ..abi .nft import NFT
12
12
from ..storage .ipfs_storage import IpfsStorage
13
13
@@ -100,3 +100,6 @@ def set_royalty_bps(self, amount: int):
100
100
tx = self .__abi_module .set_royalty_bps .build_transaction (amount , self .get_transact_opts ())
101
101
self .execute_tx (tx )
102
102
103
+ def get_all (self ) -> List [NftType ]:
104
+ max_id = self .__abi_module .next_token_id .call ()
105
+ return [self .get (i ) for i in range (max_id )]
Original file line number Diff line number Diff line change 1
1
from dataclasses import dataclass
2
- from typing import Optional
2
+ from typing import Optional , Union
3
3
4
4
from dataclasses_json import dataclass_json
5
5
@@ -10,6 +10,6 @@ class NFT:
10
10
name : str
11
11
description : str
12
12
image : str
13
- properties : Optional [dict ] = None
13
+ properties : Optional [Union [ str , dict ] ] = None
14
14
id : Optional [int ] = None
15
15
uri : Optional [str ] = None
You can’t perform that action at this time.
0 commit comments