Top
@Kitty4D on the B-Chain
just my adventures with the blockchain, web3, cryptocurrencies, and NFTs
Developer, Content Creator, NFT Hodler, Degen, Former Camgirl
aka @Kitty4DHD, @kitty4Do, $kitty4d
kitty4d Profile Photo

Post by kitty4d

2022-02-08
• 7 months ago
@100 @Dylanjaggerlee @TyFischer @AlexValaitis @TeamDeSo help me to know how to do this via github and i can probably just knock out a bunch since i'm doing this in parallel with updating my javascript to call the method in question. no idea how this will end up looking once posted, if the indentation is gone i can send it another way. https://github.com/deso-protocol/docs/blob/e6cb98ac40f35401b8fc54fb6b809fc8752f007f/devs/backend-api.md#get-posts-for-public-key ### Get Posts For Public Key ```text POST /api/v0/get-posts-for-public-key ``` Get posts for a public key or username. Can be used to retrieve all posts by a user when viewing their profile page. Example use in [frontend](https://github.com/deso-protocol/frontend/blob/afcc2c14edcee62bcdded4738b225c9349cf44e3/src/app/creator-profile-page/creator-profile-posts/creator-profile-posts.component.ts#L51) and endpoint implementation in [backend](https://github.com/deso-protocol/backend/blob/ecb04939469a61ae1dd3510dbd140d31fc9f5d5d/routes/post.go#L1463). **Parameters** Retrieves posts by a user. Either PublicKeyBase58Check or Username can be set to locate the user. | Name | Type | Description | | :--- | :--- | :--- | | PublicKeyBase58Check | string | Poster's public key | | Username | string | Poster's username | | ReaderPublicKeyBase58Check | string | Reader's public key (optional) | | LastPostHashHex | string | Hash of last post for paging (optional) | | NumToFetch | uint64 | Number of posts to fetch | | MediaRequired | bool | If true, only include posts with photos and/or videos (optional) | **Response** Example response only represents one type of post configuration. You will want to test each post configuration out in order to understand how best to parse the response. The following response is a post having no comments and it is not a quote repost. If a Reader's public key was passed, the response contains information regarding the reader. For example, PostEntryReaderState ([backend class definition](https://github.com/deso-protocol/frontend/blob/afcc2c14edcee62bcdded4738b225c9349cf44e3/src/app/backend-api.service.ts#L316)), which contains information about if the reader liked, bestowed diamonds upon, and/or reposted the post. ```text { Posts: [ { "PostHashHex": "...", "PosterPublicKeyBase58Check": "...", "ParentStakeID": "", "Body": "...", "ImageURLs": [ "..." ], "VideoURLs": null, "RepostedPostEntryResponse": null, "CreatorBasisPoints": 1000, "StakeMultipleBasisPoints": 12500, "TimestampNanos": 0, "IsHidden": false, "ConfirmationBlockHeight": 0, "InMempool": false, "ProfileEntryResponse": null, "Comments": null, "LikeCount": 0, "DiamondCount": 0, "PostEntryReaderState": null, "InGlobalFeed": false, "InHotFeed": false, "IsPinned": false, "PostExtraData": { "Language": "en", "Node": "0" }, "CommentCount": 0, "RepostCount": 0, "QuoteRepostCount": 0, "ParentPosts": null, "IsNFT": false, "NumNFTCopies": 0, "NumNFTCopiesForSale": 0, "NumNFTCopiesBurned": 0, "HasUnlockable": false, "NFTRoyaltyToCreatorBasisPoints": 0, "NFTRoyaltyToCoinBasisPoints": 0, "AdditionalDESORoyaltiesMap": {}, "AdditionalCoinRoyaltiesMap": {}, "DiamondsFromSender": 0, "HotnessScore": 0, "PostMultiplier": 0, "RecloutCount": 0, "QuoteRecloutCount": 0, "RecloutedPostEntryResponse": null } ], "LastPostHashHex": "..." } ```
mcmarsh Profile Photo kitty4D Profile Photo
Likes:
4
Diamonds:
3
Reposts:
0
Quote Reposts:
0

comments

mcmarsh Profile Photo
mcmarsh
2022-02-08
• 7 months ago
is this a example of not just posts but also reply fetching ?
Likes:
0
Diamonds:
1
Reposts:
0
Quote Reposts:
0
kitty4D Profile Photo
kitty4D
2022-02-08
• 7 months ago
it's literally just what should go here: https://docs.deso.org/devs/backend-api#get-posts-for-public-key it's basic documentation for the backend API method get-posts-for-public-key, used for instance on a user's profile page to get only posts by that one particular user. i assumed it would return comments in the "Comments" field, i was getting a null value for that for a post with 0 comments, but it looks like for this post it's also returning null there though it shows 1 for the number of comments (yours). i don't know for sure, haven't tried yet!
Likes:
1
Diamonds:
1
Reposts:
0
Quote Reposts:
0
{
   PostHashHex: "88fcb4ca73bb980cd64f70b53cc9e5642bce36e9d933aaf93ca8ae682e126320",
   PosterPublicKeyBase58Check: "BC1YLgbCAxYSSn97DArZtbwwhVUtHtjUfGZzKojLBKfxP8wbRHvb2Gz",
   ParentStakeID: "",
   Body: "@100 @Dylanjaggerlee @TyFischer @AlexValaitis @TeamDeSo \n\nhelp me to know how to do this via github and i can probably just knock out a bunch since i'm doing this in parallel with updating my javascript to call the method in question.\n\nno idea how this will end up looking once posted, if the indentation is gone i can send it another way.\n\nhttps://github.com/deso-protocol/docs/blob/e6cb98ac40f35401b8fc54fb6b809fc8752f007f/devs/backend-api.md#get-posts-for-public-key\n\n### Get Posts For Public Key\n\n```text\nPOST /api/v0/get-posts-for-public-key\n```\n\nGet posts for a public key or username. Can be used to retrieve all posts by a user when viewing their profile page. Example use in [frontend](https://github.com/deso-protocol/frontend/blob/afcc2c14edcee62bcdded4738b225c9349cf44e3/src/app/creator-profile-page/creator-profile-posts/creator-profile-posts.component.ts#L51) and endpoint implementation in [backend](https://github.com/deso-protocol/backend/blob/ecb04939469a61ae1dd3510dbd140d31fc9f5d5d/routes/post.go#L1463).\n\n**Parameters**\n\nRetrieves posts by a user. Either PublicKeyBase58Check or Username can be set to locate the user. \n\n| Name | Type | Description |\n| :--- | :--- | :--- |\n| PublicKeyBase58Check | string | Poster's public key |\n| Username | string | Poster's username |\n| ReaderPublicKeyBase58Check | string | Reader's public key (optional) |\n| LastPostHashHex | string | Hash of last post for paging (optional) |\n| NumToFetch | uint64 | Number of posts to fetch |\n| MediaRequired | bool | If true, only include posts with photos and/or videos (optional) |\n\n**Response**\n\nExample response only represents one type of post configuration. \nYou will want to test each post configuration out in order to understand how best to parse the response. The following response is a post having no comments and it is not a quote repost.\n\nIf a Reader's public key was passed, the response contains information regarding the reader. For example, PostEntryReaderState ([backend class definition](https://github.com/deso-protocol/frontend/blob/afcc2c14edcee62bcdded4738b225c9349cf44e3/src/app/backend-api.service.ts#L316)), which contains information about if the reader liked, bestowed diamonds upon, and/or reposted the post.\n\n```text\n{\n    Posts: [\n        {\n            \"PostHashHex\": \"...\",\n            \"PosterPublicKeyBase58Check\": \"...\",\n            \"ParentStakeID\": \"\",\n            \"Body\": \"...\",\n            \"ImageURLs\": [\n                \"...\"\n            ],\n            \"VideoURLs\": null,\n            \"RepostedPostEntryResponse\": null,\n            \"CreatorBasisPoints\": 1000,\n            \"StakeMultipleBasisPoints\": 12500,\n            \"TimestampNanos\": 0,\n            \"IsHidden\": false,\n            \"ConfirmationBlockHeight\": 0,\n            \"InMempool\": false,\n            \"ProfileEntryResponse\": null,\n            \"Comments\": null,\n            \"LikeCount\": 0,\n            \"DiamondCount\": 0,\n            \"PostEntryReaderState\": null,\n            \"InGlobalFeed\": false,\n            \"InHotFeed\": false,\n            \"IsPinned\": false,\n            \"PostExtraData\": {\n                \"Language\": \"en\",\n                \"Node\": \"0\"\n            },\n            \"CommentCount\": 0,\n            \"RepostCount\": 0,\n            \"QuoteRepostCount\": 0,\n            \"ParentPosts\": null,\n            \"IsNFT\": false,\n            \"NumNFTCopies\": 0,\n            \"NumNFTCopiesForSale\": 0,\n            \"NumNFTCopiesBurned\": 0,\n            \"HasUnlockable\": false,\n            \"NFTRoyaltyToCreatorBasisPoints\": 0,\n            \"NFTRoyaltyToCoinBasisPoints\": 0,\n            \"AdditionalDESORoyaltiesMap\": {},\n            \"AdditionalCoinRoyaltiesMap\": {},\n            \"DiamondsFromSender\": 0,\n            \"HotnessScore\": 0,\n            \"PostMultiplier\": 0,\n            \"RecloutCount\": 0,\n            \"QuoteRecloutCount\": 0,\n            \"RecloutedPostEntryResponse\": null\n        }\n    ],\n    \"LastPostHashHex\": \"...\"\n}\n```",
   ImageURLs: null,
   VideoURLs: null,
   RepostedPostEntryResponse: null,
   CreatorBasisPoints: 1000,
   StakeMultipleBasisPoints: 12500,
   TimestampNanos: 1644284411969028900,
   IsHidden: false,
   ConfirmationBlockHeight: 102236,
   InMempool: false,
   ProfileEntryResponse: {
      Username: "kitty4d"
   },
   Comments: null,
   LikeCount: 4,
   DiamondCount: 3,
   PostEntryReaderState: null,
   InGlobalFeed: false,
   InHotFeed: false,
   IsPinned: false,
   PostExtraData: {
      Language: "en-US",
      Node: "11"
   },
   CommentCount: 2,
   RepostCount: 0,
   QuoteRepostCount: 0,
   ParentPosts: null,
   IsNFT: false,
   NumNFTCopies: 0,
   NumNFTCopiesForSale: 0,
   NumNFTCopiesBurned: 0,
   HasUnlockable: false,
   NFTRoyaltyToCreatorBasisPoints: 0,
   NFTRoyaltyToCoinBasisPoints: 0,
   AdditionalDESORoyaltiesMap: {},
   AdditionalCoinRoyaltiesMap: {},
   DiamondsFromSender: 0,
   HotnessScore: 0,
   PostMultiplier: 0,
   RecloutCount: 0,
   QuoteRecloutCount: 0,
   RecloutedPostEntryResponse: null
}
[
   {
      PostHashHex: "8e45f42900963f3aacc998c63b93d26209a82b7c8b2386d6c5d380796434f427",
      PosterPublicKeyBase58Check: "BC1YLiaMnyaKdaE48TemmcYnizr5FA99iR8ThXLuYJb9ExZnpxizs5g",
      ParentStakeID: "88fcb4ca73bb980cd64f70b53cc9e5642bce36e9d933aaf93ca8ae682e126320",
      Body: "is this a example of not just posts but also reply fetching ?",
      ImageURLs: null,
      VideoURLs: null,
      RepostedPostEntryResponse: null,
      CreatorBasisPoints: 1000,
      StakeMultipleBasisPoints: 12500,
      TimestampNanos: 1644284919522918700,
      IsHidden: false,
      ConfirmationBlockHeight: 102236,
      InMempool: false,
      ProfileEntryResponse: {
         PublicKeyBase58Check: "BC1YLiaMnyaKdaE48TemmcYnizr5FA99iR8ThXLuYJb9ExZnpxizs5g",
         Username: "mcmarsh",
         Description: "Matt\nsee who's online > @activ\nFrom UK desogeo.com/map?account=mcmarsh\n\nsince Mar 2021\n @_science @_music @_tech #Film #Formula1\n\nhttps://twitter.com/mcmarsh\n\npeople who will tell you I'm real:\[email protected] and @jemarsh (my brothers)\[email protected] and @NirvanaHTX from @NachoAverageCall video call\n\ncheck the @_help feed for tips/FAQs 👍🤗",
         IsHidden: false,
         IsReserved: false,
         IsVerified: false,
         Comments: null,
         Posts: null,
         CoinEntry: {
            CreatorBasisPoints: 3000,
            DeSoLockedNanos: 15653958982,
            NumberOfHolders: 441,
            CoinsInCirculationNanos: 25015427346,
            CoinWatermarkNanos: 25779063229,
            BitCloutLockedNanos: 15653958982
         },
         DAOCoinEntry: {
            NumberOfHolders: 0,
            CoinsInCirculationNanos: "0x0",
            MintingDisabled: false,
            TransferRestrictionStatus: "unrestricted"
         },
         CoinPriceDeSoNanos: 1877316785,
         CoinPriceBitCloutNanos: 1877316785,
         UsersThatHODL: null,
         IsFeaturedTutorialWellKnownCreator: false,
         IsFeaturedTutorialUpAndComingCreator: false,
         ExtraData: {
            FeaturedImageURL: "https://images.deso.org/cb0c0193a9b43b3936ec4a99d53459c20b8e3fa0d1f392bc63d98d9166dfb754.webp",
            LargeProfilePicURL: "",
            LargeProfilePicUrl: ""
         },
         DESOBalanceNanos: 751204561,
         BestExchangeRateDESOPerDAOCoin: 0
      },
      Comments: null,
      LikeCount: 0,
      DiamondCount: 1,
      PostEntryReaderState: {
         LikedByReader: false,
         DiamondLevelBestowed: 1,
         RepostedByReader: false,
         RepostPostHashHex: ""
      },
      IsPinned: false,
      PostExtraData: {
         Language: "en-US",
         Node: "11"
      },
      CommentCount: 1,
      RepostCount: 0,
      QuoteRepostCount: 0,
      ParentPosts: null,
      IsNFT: false,
      NumNFTCopies: 0,
      NumNFTCopiesForSale: 0,
      NumNFTCopiesBurned: 0,
      HasUnlockable: false,
      NFTRoyaltyToCreatorBasisPoints: 0,
      NFTRoyaltyToCoinBasisPoints: 0,
      AdditionalDESORoyaltiesMap: {},
      AdditionalCoinRoyaltiesMap: {},
      DiamondsFromSender: 0,
      HotnessScore: 0,
      PostMultiplier: 0,
      RecloutCount: 0,
      QuoteRecloutCount: 0,
      RecloutedPostEntryResponse: null,
      Depth: 0
   },
   {
      PostHashHex: "af957744ea443570bda64842ff57a2ee5fc6c13005db41bd0fb42e79274f4bd7",
      PosterPublicKeyBase58Check: "BC1YLgbCAxYSSn97DArZtbwwhVUtHtjUfGZzKojLBKfxP8wbRHvb2Gz",
      ParentStakeID: "8e45f42900963f3aacc998c63b93d26209a82b7c8b2386d6c5d380796434f427",
      Body: "it's literally just what should go here:\n\nhttps://docs.deso.org/devs/backend-api#get-posts-for-public-key\n\nit's basic documentation for the backend API method get-posts-for-public-key, used for instance on a user's profile page to get only posts by that one particular user.\n\ni assumed it would return comments in the \"Comments\" field, i was getting a null value for that for a post with 0 comments, but it looks like for this post it's also returning null there though it shows 1 for the number of comments (yours). i don't know for sure, haven't tried yet!",
      ImageURLs: null,
      VideoURLs: null,
      RepostedPostEntryResponse: null,
      CreatorBasisPoints: 1000,
      StakeMultipleBasisPoints: 12500,
      TimestampNanos: 1644285864645733000,
      IsHidden: false,
      ConfirmationBlockHeight: 102240,
      InMempool: false,
      ProfileEntryResponse: {
         PublicKeyBase58Check: "BC1YLgbCAxYSSn97DArZtbwwhVUtHtjUfGZzKojLBKfxP8wbRHvb2Gz",
         Username: "kitty4D",
         Description: "kitty.fourdown.org\nkitty.fourdown.org/media/images\nkitty.fourdown.org/media/videos\n\nwww.youtube.com/channel/UCyWRuGbRn_br0Mu4tDavnWA\n\nTwitter/IG @kitty4Do\n\n\n",
         IsHidden: false,
         IsReserved: false,
         IsVerified: true,
         Comments: null,
         Posts: null,
         CoinEntry: {
            CreatorBasisPoints: 669,
            DeSoLockedNanos: 24921878349,
            NumberOfHolders: 41,
            CoinsInCirculationNanos: 28387117318,
            CoinWatermarkNanos: 31128707817,
            BitCloutLockedNanos: 24921878349
         },
         DAOCoinEntry: {
            NumberOfHolders: 0,
            CoinsInCirculationNanos: "0x0",
            MintingDisabled: false,
            TransferRestrictionStatus: "unrestricted"
         },
         CoinPriceDeSoNanos: 2633787773,
         CoinPriceBitCloutNanos: 2633787773,
         UsersThatHODL: null,
         IsFeaturedTutorialWellKnownCreator: false,
         IsFeaturedTutorialUpAndComingCreator: false,
         ExtraData: {
            DAOPublicKeysPurchased: "BC1YLiY1xTwxSJ9ZVf9ghgC3FGfXzSWvCYHH1TKqBgTuaD4nq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Z,BC1YLig8w3ReQU6c6FmD63sEaJJ3h4LkQwM832esom98aHGUCkVhKyv,BC1YLgxr4MHqWPegTm2vKw4Qp3FEvr7p2rjxWZUYWaDHLsXUHdw8DCf",
            DerivedPublicKey: "BC1YLgdhYLwmNmDmEDL4wn9abou2jwpdVfcCKVcLBNUmNbUsWXnysQ6",
            DiscordURL: "kitty4D#6969",
            DisplayName: "Kitty4D on the B-Chain",
            FeaturedImageURL: "https://images.deso.org/19298b88cdea9eeed8aa6ee4de494bac62ba8f12558d9a9db2c57cdbfee81af0.gif",
            LargeProfilePicURL: "",
            MarkdownDescription: "# [Kitty4DAO @ DAODAO](https://beta.daodao.io/d/Kitty4DAO)\n\n## Kitty4D on the B-Chain \n[YouTube Channel](https://www.youtube.com/channel/UCyWRuGbRn_br0Mu4tDavnWA)\n\ni'm just a girl with a dream, a dream to make content all day and all night forever in between writing code. i never created content before November 13, 2021, the day i joined the DESO blockchain on DiamondApp.\n\n### What Kitty Do\n\n1. Programmer/developer.  JavaScript (Vue, ReactJS/Next, Svelte, Node.js) ($$$$$); Python ($$$); C# ($$); HTML/CSS ($$$$$); SEO Stuff ($$$); DBA / Database Design (MSSQL, MySQL, Postgres) ($$$$); Solidity ($); Debugging, no matter the language ($$$$$)\n\n2. Content creator.  Image Editing; Video Editing; Memes; Sometimes I write stuff; Pointed and constructive criticism + good ideas; You name it, I'll create it\n\n3. Cat in the Hat Hacker.  I push it to the limit; Past the point of no return\n\ni work in DeFi on the Ethereum blockchain. hoping to bring solana in sometime. if there is ever such a thing as vote gauges on DESO using governance tokens and vote escrow tokens, i'd suggest that we integrate DESO as well. (but i don't know if a social blockchain would really ever have that- i'm just saying, i totally would make sure we did it if it were possible)",
            TelegramURL: "",
            TwitterURL: "kitty4Do",
            WebsiteURL: "https://kitty.fourdown.org"
         },
         DESOBalanceNanos: 62111213,
         BestExchangeRateDESOPerDAOCoin: 0
      },
      Comments: null,
      LikeCount: 1,
      DiamondCount: 1,
      PostEntryReaderState: {
         LikedByReader: false,
         DiamondLevelBestowed: 0,
         RepostedByReader: false,
         RepostPostHashHex: ""
      },
      IsPinned: false,
      PostExtraData: {
         Language: "en",
         Node: "3"
      },
      CommentCount: 0,
      RepostCount: 0,
      QuoteRepostCount: 0,
      ParentPosts: null,
      IsNFT: false,
      NumNFTCopies: 0,
      NumNFTCopiesForSale: 0,
      NumNFTCopiesBurned: 0,
      HasUnlockable: false,
      NFTRoyaltyToCreatorBasisPoints: 0,
      NFTRoyaltyToCoinBasisPoints: 0,
      AdditionalDESORoyaltiesMap: {},
      AdditionalCoinRoyaltiesMap: {},
      DiamondsFromSender: 0,
      HotnessScore: 0,
      PostMultiplier: 0,
      RecloutCount: 0,
      QuoteRecloutCount: 0,
      RecloutedPostEntryResponse: null,
      Depth: 1
   }
]