Skip to content

Commit

Permalink
Update klaytn.py
Browse files Browse the repository at this point in the history
  • Loading branch information
blockchen-admin authored Nov 16, 2021
1 parent 6bd01e2 commit b266bc4
Showing 1 changed file with 98 additions and 0 deletions.
98 changes: 98 additions & 0 deletions BlockSDK/klaytn.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,104 @@ def getNftTransfers(self, request = {}):
"offset" : request['offset'],
"limit" : request['limit']
})

def getMultiNft(self, request = {}):
if not('offset' in request) or not request['offset']:
request['offset'] = 0
if not('limit' in request) or not request['limit']:
request['limit'] = 10

return self.request("GET","/klay/kip37-tokens/" + request['contract_address'] + "/tokens",{
"offset" : request['offset'],
"limit" : request['limit']
})

def getMultiNftOwnerList(self, request = {}):
if not('offset' in request) or not request['offset']:
request['offset'] = 0
if not('limit' in request) or not request['limit']:
request['limit'] = 10

return self.request("GET","/klay/kip37-tokens/" + request['contract_address'] + "/" + request['token_id'] + "/list",{
"offset" : request['offset'],
"limit" : request['limit']
})

def getMultiNftContractOwner(self, request = {}):
if not('offset' in request) or not request['offset']:
request['offset'] = 0
if not('limit' in request) or not request['limit']:
request['limit'] = 10

return self.request("GET","/klay/kip37-tokens/" + request['contract_address'] + "/" + request['owner_address'] + "/owners",{
"offset" : request['offset'],
"limit" : request['limit']
})

def getMultiNftOwner(self, request = {}):
if not('offset' in request) or not request['offset']:
request['offset'] = 0
if not('limit' in request) or not request['limit']:
request['limit'] = 10

return self.request("GET","/klay/kip37-tokens/" + request['owner_address'] + "/owner",{
"offset" : request['offset'],
"limit" : request['limit']
})

def getMultiNftContractCreator(self, request = {}):
if not('offset' in request) or not request['offset']:
request['offset'] = 0
if not('limit' in request) or not request['limit']:
request['limit'] = 10

return self.request("GET","/klay/kip37-tokens/" + request['contract_address'] + "/" + request['creator_address'] + "/creators",{
"offset" : request['offset'],
"limit" : request['limit']
})

def getMultiNftCreator(self, request = {}):
if not('offset' in request) or not request['offset']:
request['offset'] = 0
if not('limit' in request) or not request['limit']:
request['limit'] = 10

return self.request("GET","/klay/kip37-tokens/" + request['creator_address'] + "/creator",{
"offset" : request['offset'],
"limit" : request['limit']
})

def getMultiNftInfo(self, request = {}):
return self.request("GET","/klay/kip37-tokens/" + request['contract_address'] + "/" + request['token_id'] + "/info",{
})

def getMultiNftTransfers(self, request = {}):
if not('rawtx' in request) or not request['rawtx']:
request['rawtx'] = 0
if not('offset' in request) or not request['offset']:
request['offset'] = 0
if not('limit' in request) or not request['limit']:
request['limit'] = 10

return self.request("GET","/klay/kip37-tokens/" + request['contract_address'] + "/" + request['token_id'] + "/transfers",{
"rawtx" : $request['rawtx'],
"offset" : request['offset'],
"limit" : request['limit']
})

def getMultiSaleNfts(self, request = {}):
if not('order_direction' in request) or not request['order_direction']:
request['order_direction'] = 'desc'
if not('offset' in request) or not request['offset']:
request['offset'] = 0
if not('limit' in request) or not request['limit']:
request['limit'] = 10

return self.request("GET","/klay/kip37-tokens/" + request['contract_address'] + "/" + request['token_id'] + "/sale",{
"order_direction" : $request['order_direction'],
"offset" : request['offset'],
"limit" : request['limit']
})

def getContractRead(self, request = {}):
if not('parameter_type' in request) or not request['parameter_type']:
Expand Down

0 comments on commit b266bc4

Please sign in to comment.