Protocol Registry

Address: s55qq-oqaaa-aaaaa-aaakq-cai

░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
░░░░░░░░░░░░░░░░░░░░░░░█████╗░██╗░░░░░░█████╗░░██████╗██╗░░██╗░█████╗░░░░░░░░░░░░░░░░░
░░░░░░░░░░░░░░░░░░░░░░██╔══██╗██║░░░░░██╔══██╗██╔════╝██║░██╔╝██╔══██╗░░░░░░░░░░░░░░░░
░░░░░░░░░░░░░░░░░░░░░░███████║██║░░░░░███████║╚█████╗░█████═╝░███████║░░░░░░░░░░░░░░░░
░░░░░░░░░░░░░░░░░░░░░░██╔══██║██║░░░░░██╔══██║░╚═══██╗██╔═██╗░██╔══██║░░░░░░░░░░░░░░░░
░░░░░░░░░░░░░░░░░░░░░░██║░░██║███████╗██║░░██║██████╔╝██║░╚██╗██║░░██║░░░░░░░░░░░░░░░░
░░░░░░░░░░░░░░░░░░░░░░╚═╝░░╚═╝╚══════╝╚═╝░░╚═╝╚═════╝░╚═╝░░╚═╝╚═╝░░╚═╝░░░░░░░░░░░░░░░░
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░


░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
░░░░                                                                               ░░░░
░░░░ █▀█ █▀█ █▀█ ▀█▀ █▀█ █▀▀ █▀█ █    █▀█ █▀▀ █▀▀ █ █▀ ▀█▀ █▀▀ █▀█ █▄█             ░░░░
░░░░ █▀▀ █▀▄ █▄█  █  █▄█ █▄▄ █▄█ █▄▄  █▀▄ ██▄ █▄█ █ ▄█  █  ██▄ █▀▄  █              ░░░░
░░░░                                                                               ░░░░ 
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░

IDL

type VerifiedProtocol = 
 record {
   verified_at: Time;
   verified_by: vec principal;
 };
type TokenId = nat;
type Time = int;
type PublishProtocol = record {address: principal;};
type ProtocolVerificationStatus = 
 variant {
   Draft;
   Final;
   Finished: VerifiedProtocol;
   Review;
   Stagnant;
 };
type ProtocolLinks = 
 record {
   discord: text;
   github: text;
   twitter: text;
   website: text;
 };
type Protocol = 
 record {
   address: principal;
   avatar: text;
   category: text;
   created_at: Time;
   created_by: vec principal;
   description: text;
   id: TokenId;
   meta_sentences: vec text;
   name: text;
   recommanded_vessels: vec principal;
   social: ProtocolLinks;
   tags: vec text;
   title: text;
   updated_at: Time;
   verified: ProtocolVerificationStatus;
   version: float64;
 };
service : {
  getProtocolByName: (text) -> (opt Protocol) query;
  getProtocolByPrincipal: (principal) -> (opt Protocol) query;
  getProtocolByTokenID: (TokenId) -> (opt Protocol) query;
  getProtocols: () -> (vec Protocol) query;
  pickProtocol: (TokenId) -> (Protocol);
  protocolExists: (principal) -> (bool) query;
  publishProtocol: (PublishProtocol) -> (opt Protocol);
}

Getters

getProtocols

Returns array of indexed protocols.
@returns [T.Protocol]
@parameters ()

getProtocolByTokenID

Returns Protocol that matches the ID or null if not found.
@returns ?T.Protocol
@parameters (id: T.TokenId)

getProtocolByName

Returns Protocol that matches the name or null if not found.
@returns ?T.Protocol
@parameters (name: Text)

getProtocolByPrincipal

Returns Protocol that matches the Principal or null if not found.
@returns ?T.Protocol
@parameters (p: Principal)

protocolExists

Returns true if the protocol exists with the given Principal.
@returns Bool
@parameters (p: Principal)

pickProtocol

COMING SOON.
@returns T.Protocol
@parameters (id: T.TokenId)

Setters

publishProtocol

Let you index your own Protocol.
@returns ?T.Protocol
@parameters (p: T.PublishProtocol) @note Should match the type properly. @update WILL NOT WORK, OUTDATED TYPE, check the repository if you have