-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
liw
committed
Sep 13, 2023
1 parent
b266bc4
commit 82cb32c
Showing
26 changed files
with
3,540 additions
and
2,305 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
from BlockSDK.base import Base | ||
|
||
|
||
class Avalanche(Base): | ||
def GetBlockChainInfo(self): | ||
return self.request("GET", f"/avax/info") | ||
|
||
def GetBlock(self, request): | ||
return self.request("GET", f"/avax/block/{request.get('block', '')}", request) | ||
|
||
def GetAddresses(self, request): | ||
return self.request("GET", f"/avax/address", request) | ||
|
||
def CreateAddress(self, request): | ||
return self.request("POST", f"/avax/address", request) | ||
|
||
def GetAddressInfo(self, request): | ||
return self.request("GET", f"/avax/address/{request.get('address', '')}/info", request) | ||
|
||
def GetAddressBalance(self, request): | ||
return self.request("GET", f"/avax/address/{request.get('address', '')}/balance") | ||
|
||
def Send(self, request): | ||
return self.request("POST", f"/avax/address/{request.get('from', '')}/send", request) | ||
|
||
def SendTransaction(self, request): | ||
return self.request("POST", f"/avax/transaction/send", request) | ||
|
||
def GetTransaction(self, request): | ||
return self.request("GET", f"/avax/transaction/{request.get('hash', '')}") | ||
|
||
def GetTokenInfo(self, request): | ||
return self.request("GET", f"/avax/token/{request.get('contract_address', '')}/info") | ||
|
||
def SendToken(self, request): | ||
return self.request("POST", f"/avax/token/{request.get('contract_address', '')}/{request.get('from', '')}/transfer", request) | ||
|
||
def GetTokenBalance(self, request): | ||
return self.request("GET", f"/avax/token/{request.get('contract_address', '')}/{request.get('from', '')}/balance") | ||
|
||
def GetTokenTxs(self, request): | ||
return self.request("GET", f"/avax/token/{request.get('from_address', '')}/transactions", request) | ||
|
||
def GetTokenContractTxs(self, request): | ||
return self.request("GET", f"/avax/token/{request.get('contract_address', '')}/{request.get('from_address', '')}/transactions", request) | ||
|
||
def GetTokenAllBalance(self, request): | ||
return self.request("GET", f"/avax/token/{request.get('from_address', '')}/all-balance", request) | ||
|
||
def GetSingleNfts(self, request): | ||
return self.request("GET", f"/avax/single-nft/{request.get('contract_address', '')}/nfts", request) | ||
|
||
def GetSingleOwnerNfts(self, request): | ||
return self.request("GET", f"/avax/single-nft/{request.get('owner_address', '')}/owner-nfts", request) | ||
|
||
def GetSingleCreatorNfts(self, request): | ||
return self.request("GET", f"/avax/single-nft/{request.get('creator_address', '')}/creator-nfts", request) | ||
|
||
def GetSingleTxs(self, request): | ||
return self.request("GET", f"/avax/single-nft/{request.get('from_address', '')}/transactions", request) | ||
|
||
def GetSingleNftOwnerNfts(self, request): | ||
return self.request("GET", f"/avax/single-nft/{request.get('contract_address', '')}/{request.get('owner_address', '')}/owner-nfts", request) | ||
|
||
def GetSingleNftCreatorNfts(self, request): | ||
return self.request("GET", f"/avax/single-nft/{request.get('contract_address', '')}/{request.get('creator_address', '')}/creator-nfts", request) | ||
|
||
def GetSingleNftTxs(self, request): | ||
return self.request("GET", f"/avax/single-nft/{request.get('contract_address', '')}/{request.get('from_address', '')}/from-transactions", request) | ||
|
||
def GetSingleNftInfo(self, request): | ||
return self.request("GET", f"/avax/single-nft/{request.get('contract_address', '')}/{request.get('token_id', '')}/info", request) | ||
|
||
def GetSingleNftTokenTxs(self, request): | ||
return self.request("GET", f"/avax/single-nft/{request.get('contract_address', '')}/{request.get('token_id', '')}/nft-transactions", request) | ||
|
||
def GetSingleNftAuctionNfts(self, request): | ||
return self.request("GET", f"/avax/single-nft/{request.get('contract_address', '')}/auction-nfts", request) | ||
|
||
def GetSingleNftSellerNfts(self, request): | ||
return self.request("GET", f"/avax/single-nft/{request.get('contract_address', '')}/{request.get('seller_address', '')}/seller-nfts", request) | ||
|
||
def GetSingleNftTokenBids(self, request): | ||
return self.request("GET", f"/avax/single-nft/{request.get('contract_address', '')}/{request.get('token_id', '')}/nft-bids", request) | ||
|
||
def GetMultiNfts(self, request): | ||
return self.request("GET", f"/avax/multi-nft/{request.get('contract_address', '')}/nfts", request) | ||
|
||
def GetMultiOwnerNfts(self, request): | ||
return self.request("GET", f"/avax/multi-nft/{request.get('owner_address', '')}/owner-nfts", request) | ||
|
||
def GetMultiCreatorNfts(self, request): | ||
return self.request("GET", f"/avax/multi-nft/{request.get('creator_address', '')}/creator-nfts", request) | ||
|
||
def GetMultiTxs(self, request): | ||
return self.request("GET", f"/avax/multi-nft/{request.get('from_address', '')}/transactions", request) | ||
|
||
def GetMultiNftOwnerNfts(self, request): | ||
return self.request("GET", f"/avax/multi-nft/{request.get('contract_address', '')}/{request.get('owner_address', '')}/owner-nfts", request) | ||
|
||
def GetMultiNftCreatorNfts(self, request): | ||
return self.request("GET", f"/avax/multi-nft/{request.get('contract_address', '')}/{request.get('creator_address', '')}/creator-nfts", request) | ||
|
||
def GetMultiNftTxs(self, request): | ||
return self.request("GET", f"/avax/multi-nft/{request.get('contract_address', '')}/{request.get('from_address', '')}/from-transactions", request) | ||
|
||
def GetMultiNftInfo(self, request): | ||
return self.request("GET", f"/avax/multi-nft/{request.get('contract_address', '')}/{request.get('token_id', '')}/info", request) | ||
|
||
def GetMultiNftTokenTxs(self, request): | ||
return self.request("GET", f"/avax/multi-nft/{request.get('contract_address', '')}/{request.get('token_id', '')}/nft-transactions", request) | ||
|
||
def GetMultiNftSellerNfts(self, request): | ||
return self.request("GET", f"/avax/multi-nft/{request.get('contract_address', '')}/{request.get('seller_address', '')}/seller-nfts", request) | ||
|
||
def ReadContract(self, request): | ||
return self.request("POST", f"/avax/contract/{request.get('contract_address', '')}/read", request) | ||
|
||
def WriteContract(self, request): | ||
return self.request("POST", f"/avax/contract/{request.get('contract_address', '')}/write", request) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.