<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Marc P</title>
    <description>The latest articles on DEV Community by Marc P (@marc1019).</description>
    <link>https://dev.to/marc1019</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1102066%2F05475852-8557-423b-961c-d6188631bead.jpeg</url>
      <title>DEV Community: Marc P</title>
      <link>https://dev.to/marc1019</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/marc1019"/>
    <language>en</language>
    <item>
      <title>How can I deserialize vectors in SUI from move contract?</title>
      <dc:creator>Marc P</dc:creator>
      <pubDate>Thu, 15 Jun 2023 13:57:03 +0000</pubDate>
      <link>https://dev.to/marc1019/how-can-i-deserialize-vectors-in-sui-from-move-contract-58gi</link>
      <guid>https://dev.to/marc1019/how-can-i-deserialize-vectors-in-sui-from-move-contract-58gi</guid>
      <description>&lt;p&gt;I have problems in deserializing vectors from move contract in SUI.&lt;/p&gt;

&lt;p&gt;This is backend codes.&lt;/p&gt;

&lt;p&gt;module forum::forum {&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;use std::option::{ Option, some};
use std::string::{Self, String};
use std::vector::{ empty, push_back, contains};  
use sui::object::{Self, UID};
use sui::transfer;
use sui::tx_context::{Self, TxContext};
use sui::url::{Self, Url};
use sui::clock::{Self, Clock};

struct Forum has key {
    id: UID,        
    posts : vector&amp;lt;Post&amp;gt;,
}

struct Post has key, store {
    id: UID,
    title: String,
    content: String,
    creator: address,
    vote: u64, 
    comments: vector&amp;lt;Comment&amp;gt;      
}

struct Comment has key, store {
    id: UID,
    created_at: u64,
    content: String,
    reply: vector&amp;lt;Reply&amp;gt;
}


struct Reply has key, store {
    id : UID,
    created_at: u64,
    content : String,
}
    push_back(community_ref,  _community);

    if(!contains(&amp;amp;gilder.members, &amp;amp;creator)) {
        push_back(&amp;amp;mut gilder.members, creator)
    }
}

public fun get_posts(forum: &amp;amp;Forum) : &amp;amp;vector&amp;lt;Post&amp;gt; {
    return &amp;amp;forum.posts
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;}&lt;/p&gt;

&lt;p&gt;I have to deserialize this codes in frontend(for SUI).&lt;/p&gt;

&lt;p&gt;I know I have to use bcs to deserialize post vectors from backend but I didn't find the solution.&lt;/p&gt;

&lt;p&gt;Please help me if you know the solution.&lt;/p&gt;

&lt;p&gt;Thanks&lt;/p&gt;

</description>
      <category>sui</category>
      <category>deserialize</category>
      <category>move</category>
    </item>
  </channel>
</rss>
