Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
asim committed Sep 5, 2022
1 parent 33258ac commit 7f63d79
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 44 deletions.
8 changes: 4 additions & 4 deletions nft/domain/opensea.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ type Contract struct {
// payout address
PayoutAddress string `json:"payout_address,omitempty"`
// seller fees
SellerFees float64 `json:"seller_fees_basis_points,omitempty"`
SellerFees interface{} `json:"seller_fees_basis_points,omitempty"`
}

type Collection struct {
Expand All @@ -68,7 +68,7 @@ type Collection struct {

ExternalLink string `json:"external_link,omitempty"`
BannerImageUrl string `json:"banner_image_url,omitempty"`
DevSellerFeeBasisPoints float64 `json:"dev_seller_fee_basis_points,omitempty"`
DevSellerFeeBasisPoints interface{} `json:"dev_seller_fee_basis_points,omitempty"`
SafelistRequestStatus string `json:"safelist_request_status,omitempty"`
PrimaryAssetContracts []Contract `json:"primary_asset_contracts,omitempty"`
Traits map[string]interface{} `json:"traits,omitempty"`
Expand Down Expand Up @@ -107,11 +107,11 @@ type Transaction struct {
Id int32 `json:"id,omitempty"`
Timestamp string `json:"timestamp,omitempty"`
BlockHash string `json:"block_hash,omitempty"`
BlockNumber float64 `json:"block_number,omitempty"`
BlockNumber interface{} `json:"block_number,omitempty"`
FromAccount *User `json:"from_account,omitempty"`
ToAccount *User `json:"to_account,omitempty"`
TransactionHash string `json:"transaction_hash,omitempty"`
TransactionIndex float64 `json:"transaction_index,omitempty"`
TransactionIndex interface{} `json:"transaction_index,omitempty"`
}

type Token struct {
Expand Down
20 changes: 10 additions & 10 deletions nft/examples.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"symbol": "CC",
"description": "The Cryptocards collection was created at the dawn of what is considered cryptoart or NFTs today being minted on January 2018. \n\nIt is the only NFT collection chronicling the history of Bitcoin including over 50 cards with a total supply of 7.851.\n\nThe initial CryptoCards were issued as a ERC-20, but we developed an ERC1155 wrapper to make them available on OpenSea.\n\nBeware of other fake collections on OS. Stay safe and join the community: https://discord.gg/m9nUKEzcWJ",
"payout_address": "0xb7e0c211fb088e42aa9fd936b0a9c52985fbd273",
"seller_fees": 0
"seller_fees": "0"
},
"collection": {
"name": "The CryptoCards Collection (2018)",
Expand Down Expand Up @@ -60,7 +60,7 @@
"id": 218344593,
"timestamp": "2021-12-08T13:52:33",
"block_hash": "0xe168736f9f7f9bf610c04c0705165ef2ca470ddfc5fedb6d0337701f1d083d32",
"block_number": 13765159,
"block_number": "13765159",
"from_account": {
"username": "austincountach",
"profile_url": "https://storage.googleapis.com/opensea-static/opensea-profile/31.png",
Expand All @@ -72,7 +72,7 @@
"address": "0x7be8076f4ea4a4ad08075c2508e481d6c946d12b"
},
"transaction_hash": "0xd3bfa0ffe5d37af6854f485606ceb349634e957ff5778570ea396288fe8914db",
"transaction_index": 176
"transaction_index": "176"
},
"payment_token": {
"id": 1,
Expand Down Expand Up @@ -153,7 +153,7 @@
"symbol": "PUNK",
"description": "CryptoPunks launched as a fixed set of 10,000 items in mid-2017 and became one of the inspirations for the ERC-721 standard. They have been featured in places like The New York Times, Christie’s of London, Art|Basel Miami, and The PBS NewsHour.",
"payout_address": "",
"seller_fees": 0
"seller_fees": "0"
},
"collection": {
"name": "CryptoPunks",
Expand All @@ -164,7 +164,7 @@
"payout_address": "",
"external_link": "",
"banner_image_url": "https://lh3.googleusercontent.com/48oVuDyfe_xhs24BC2TTVcaYCX7rrU5mpuQLyTgRDbKHj2PtzKZsQ5qC3xTH4ar34wwAXxEKH8uUDPAGffbg7boeGYqX6op5vBDcbA=s2500",
"seller_fees": 0,
"seller_fees": "0",
"safelist_request_status": "verified",
"primary_asset_contracts": [
{
Expand All @@ -177,7 +177,7 @@
"symbol": "PUNK",
"description": "CryptoPunks launched as a fixed set of 10,000 items in mid-2017 and became one of the inspirations for the ERC-721 standard. They have been featured in places like The New York Times, Christie’s of London, Art|Basel Miami, and The PBS NewsHour.",
"payout_address": "",
"seller_fees": 0
"seller_fees": "0"
}
],
"traits": {},
Expand Down Expand Up @@ -271,7 +271,7 @@
"id": 63641091,
"timestamp": "2020-11-30T18:44:26",
"block_hash": "0xe3eacbc6f4d6bb43525b69baffe09477f452f0f5e1a5b1d5232dc23b6cb176cb",
"block_number": 11361817,
"block_number": "11361817",
"from_account": {
"username": "GoWestBTC",
"profile_url": "https://storage.googleapis.com/opensea-static/opensea-profile/4.png",
Expand All @@ -283,7 +283,7 @@
"address": "0xb47e3cd837ddf8e4c57f05d70ab865de6e193bbb"
},
"transaction_hash": "0xf4af5563f3c4c3b26dee3ab027902f113bee5985b28d9ede5b81ab42b46abb30",
"transaction_index": 58
"transaction_index": "58"
},
"payment_token": {
"id": 1,
Expand Down Expand Up @@ -353,7 +353,7 @@
"payout_address": "0xdcd382be6cc4f1971c667ffda85c7a287605afe4",
"external_link": "",
"banner_image_url": "https://lh3.googleusercontent.com/svc_rQkHVGf3aMI14v3pN-ZTI7uDRwN-QayvixX-nHSMZBgb1L1LReSg1-rXj4gNLJgAB0-yD8ERoT-Q2Gu4cy5AuSg-RdHF9bOxFDw=s2500",
"seller_fees": 500,
"seller_fees": "500",
"safelist_request_status": "verified",
"primary_asset_contracts": [
{
Expand All @@ -366,7 +366,7 @@
"symbol": "DOODLE",
"description": "A community-driven collectibles project featuring art by Burnt Toast. Doodles come in a joyful range of colors, traits and sizes with a collection size of 10,000. Each Doodle allows its owner to vote for experiences and activations paid for by the Doodles Community Treasury.",
"payout_address": "0xdcd382be6cc4f1971c667ffda85c7a287605afe4",
"seller_fees": 0
"seller_fees": "0"
}
],
"traits": {
Expand Down
8 changes: 4 additions & 4 deletions nft/handler/opensea.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ func contractToPb(contract *domain.Contract) *pb.Contract {
Schema: contract.Schema,
Symbol: contract.Symbol,
PayoutAddress: contract.PayoutAddress,
SellerFees: contract.SellerFees,
SellerFees: fmt.Sprintf("%v", contract.SellerFees),
}
}

Expand All @@ -167,7 +167,7 @@ func collectionToPb(collection *domain.Collection) *pb.Collection {
PayoutAddress: collection.PayoutAddress,
ExternalLink: collection.ExternalLink,
BannerImageUrl: collection.BannerImageUrl,
SellerFees: collection.DevSellerFeeBasisPoints,
SellerFees: fmt.Sprintf("%v", collection.DevSellerFeeBasisPoints),
SafelistRequestStatus: collection.SafelistRequestStatus,
PrimaryAssetContracts: func() []*pb.Contract {
cons := make([]*pb.Contract, len(collection.PrimaryAssetContracts))
Expand Down Expand Up @@ -251,7 +251,7 @@ func assetToPb(asset *domain.Asset) *pb.Asset {
Id: asset.LastSale.Transaction.Id,
Timestamp: asset.LastSale.Transaction.Timestamp,
BlockHash: asset.LastSale.Transaction.BlockHash,
BlockNumber: asset.LastSale.Transaction.BlockNumber,
BlockNumber: fmt.Sprintf("%v", asset.LastSale.Transaction.BlockNumber),
FromAccount: &pb.User{
Username: asset.LastSale.Transaction.FromAccount.User.Username,
ProfileUrl: asset.LastSale.Transaction.FromAccount.ProfileUrl,
Expand All @@ -263,7 +263,7 @@ func assetToPb(asset *domain.Asset) *pb.Asset {
Address: asset.LastSale.Transaction.ToAccount.Address,
},
TransactionHash: asset.LastSale.Transaction.TransactionHash,
TransactionIndex: asset.LastSale.Transaction.TransactionIndex,
TransactionIndex: fmt.Sprintf("%v", asset.LastSale.Transaction.TransactionIndex),
},
PaymentToken: paymentTokenToPb(asset.LastSale.PaymentToken),
}
Expand Down
44 changes: 22 additions & 22 deletions nft/proto/nft.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions nft/proto/nft.proto
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ message Contract {
// payout address
string payout_address = 9;
// seller fees
double seller_fees = 10;
string seller_fees = 10;
}

message Collection {
Expand All @@ -116,7 +116,7 @@ message Collection {
// image used in the banner for the collection
string banner_image_url = 8;
// the fees that get paid out when a sale is made
double seller_fees = 9;
string seller_fees = 9;
// the collection's approval status on OpenSea
string safelist_request_status = 10;
// a list of the contracts associated with this collection
Expand Down Expand Up @@ -153,11 +153,11 @@ message Transaction {
int32 id = 1;
string timestamp = 2;
string block_hash = 3;
double block_number = 4;
string block_number = 4;
User from_account = 5;
User to_account = 6;
string transaction_hash = 7;
double transaction_index = 8;
string transaction_index = 8;
}

message Token {
Expand Down

0 comments on commit 7f63d79

Please sign in to comment.