Memo (message)

create(vaultId, message)

  • vaultId (string, required)

  • message (string, required) - memo content

  • options (NodeCreateOptions, optional) - parent id, etc.

  • returns Promise<{ memoId, transactionId }> - Promise with new memo id & corresponding transaction id

example
const { memoId } = await akord.memo.create(vaultId, "Suspendisse ut lorem vitae lectus faucibus lacinia");

addReaction(memoId, reaction)

  • memoId (string, required)

  • reaction (reactionEmoji, required)

  • returns Promise<{ transactionId }> - Promise with corresponding transaction id

example
import { Akord } from "@akord/akord-js"
// valid values: [JOY, ASTONISHED, CRY, HEART, FIRE, THUMBS_UP, THUMBS_DOWN, PRAY]
const { transactionId } = await akord.memo.addReaction(memoId, Akord.reactionEmoji.FIRE);

removeReaction(memoId, reaction)

  • memoId (string, required)

  • reaction (reactionEmoji, required)

  • returns Promise<{ transactionId }> - Promise with corresponding transaction id

example
import { Akord } from "@akord/akord-js"
// valid values: [JOY, ASTONISHED, CRY, HEART, FIRE, THUMBS_UP, THUMBS_DOWN, PRAY]
const { transactionId } = await akord.memo.removeReaction(memoId, Akord.reactionEmoji.FIRE);

get(memoId, options)

  • memoId (string, required)

  • options (GetOptions, optional)

  • returns Promise<Memo> - Promise with the memo object

example
const memo = await akord.memo.get(memoId);

listAll(vaultId, options)

  • vaultId (string, required)

  • options (ListOptions, optional)

  • returns Promise<Array<Memo>> - Promise with all memos within given vault

example
const memos = await akord.memo.listAll(vaultId);

list(vaultId, options)

  • vaultId (string, required)

  • options (ListOptions, optional)

  • returns Promise<{ items, nextToken }> - Promise with paginated memos within given vault

example
// retrieve first 100 memos for the vault
const { items } = await akord.memo.list(vaultId);

// retrieve first 20 memos for the vault
const { items } = await akord.memo.list(vaultId, { limit: 20 });

// iterate through all memos
let token = null;
let memos = [];
do {
  const { items, nextToken } = await akord.memo.list(vaultId, { nextToken: token });
  memos = memos.concat(items);
  token = nextToken;
} while (token);

Last updated