Arianee Privacy Gateway

Methods related to content delivery in a private way are covered.

What is the Arianee Privacy Gateway?

The Arianee Privacy Gateway is used to retrieve the content of private non-fungible tokens (NFTs).

NFT content could be a plain JSON file self-hosted and requestable as a GET resource. But in that case, the NFT content is completely public.

Usually, builders or brands want to be able to make their NFT content private but still transferable and shareable. To do so, the Arianee Privacy Gateway - an agnostic type of database to check the rights - is required. It has two functions:

  • Store the content
  • Deliver the content

An Arianee Privacy Gateway implementation is based on JSON RPC and should expose a few methods.

πŸ“Œ

NPM package

Authentication

The library supports two types of authentication:

  • Arianee Access Token: If you pass an instance of the Core class as the auth parameter, the library will use an Arianee access token generated using the Core instance to authenticate requests.
  • Message/signature: If you pass an object with a message and a signature property, the library will use message/signature authentication.

Let's start πŸš€

We recommend you employ the certification module as an NPM package in your application.

To use the library, you need to import the ArianeePrivacyGatewayClient class and create a new instance of it with the following parameters:

  • auth: An instance of the Core class from the @arianee/core package, an Arianee access token as a string, or an object containing a message and a signature.
  • fetchLike: A function that behaves like the fetch function, used to make HTTP requests.
$ npm i @arianee/arianee-privacy-gateway-client

To use the library, you need to import the ArianeePrivacyGatewayClient class and create a new instance of it with the following parameters:

  • auth: An instance of the Core class from the @arianee/core package, an Arianee access token as a string, or an object containing a message and a signature.
  • fetchLike: A function that behaves like the fetch function, used to make HTTP requests.

πŸ“Œ

The endpoint needs to be defined into the brand identity JSON as endpoint RPC key.

Methods list

Read NFT

Retrieve the original content of an NFT.

πŸ’‘

When the content of an NFT is updated, use the updateRead method, see below.

async certificateRead(
  rpcUrl: RpcUrl,
  {
    certificateId,
    passphrase,
  }: {
    certificateId: string;
    passphrase?: string;
  }
): Promise<ArianeeProductCertificateI18N>;
ParameterMandatoryDescription
rpcUrlβœ…URL of the Arianee Privacy Gateway RPC.
certificateIdβœ…ID of the NFT to retrieve the content of.
passphrase❌The passphrase of the NFT.

Read NFT Update

Retrieve the updated content of an NFT.

async updateRead(
  rpcUrl: RpcUrl,
  {
    certificateId,
    passphrase,
  }: {
    certificateId: string;
    passphrase?: string;
  }
): Promise<ArianeeProductCertificateI18N>;
ParameterMandatoryDescription
rpcUrlβœ…URL of the Arianee Privacy Gateway RPC.
certificateIdβœ…ID of the NFT to retrieve the updated content of.
passphrase❌The passphrase of the NFT.

Read dMessage

Retrieve the content of a private NFT message.

async messageRead(
  rpcUrl: RpcUrl,
  {
    messageId,
  }: {
    messageId: string;
  }
): Promise<ArianeeMessageI18N>;
ParameterMandatoryDescription
rpcUrlβœ…URL of the Arianee Privacy Gateway RPC.
messageIdβœ…ID of the dMessage to retrieve the updated content of.

Read Arianee Event

Retrieve the content of a private Arianee Event.

async eventRead(
  rpcUrl: RpcUrl,
  {
    certificateId,
    eventId,
    passphrase,
  }: {
    certificateId: string;
    eventId: string;
    passphrase?: string;
  }
): Promise<ArianeeEventI18N>;
ParameterMandatoryDescription
rpcUrlβœ…URL of the Arianee Privacy Gateway RPC.
certificateIdβœ…ID of the NFT to retrieve the updated content of.
eventIdβœ…ID of the event to retrieve the content of.
passphrase❌The passphrase of the NFT.