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).
Digital passport content could be a plain JSON file self-hosted and requestable as a GET resource. But in that case, the digital passport content is completely public.
Usually, builders or brands want to be able to make their digital passport 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.
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 Digital Passport
Retrieve the original content of a digital passport.
When the content of a digital passport is updated, use the
updateRead
method, see below.
async certificateRead(
rpcUrl: RpcUrl,
{
certificateId,
passphrase,
}: {
certificateId: string;
passphrase?: string;
}
): Promise<ArianeeProductCertificateI18N>;
Parameter | Mandatory | Description |
---|---|---|
rpcUrl | ✅ | URL of the Arianee Privacy Gateway RPC. |
certificateId | ✅ | ID of the digital passport to retrieve the content of. |
passphrase | ❌ | The passphrase of the digital passport. |
Read Digital Passport Update
Retrieve the updated content of a digital passport.
async updateRead(
rpcUrl: RpcUrl,
{
certificateId,
passphrase,
}: {
certificateId: string;
passphrase?: string;
}
): Promise<ArianeeProductCertificateI18N>;
Parameter | Mandatory | Description |
---|---|---|
rpcUrl | ✅ | URL of the Arianee Privacy Gateway RPC. |
certificateId | ✅ | ID of the NFT to retrieve the updated content of. |
passphrase | ❌ | The passphrase of the digital passport. |
Read dMessage
Retrieve the content of a private digital passport message.
async messageRead(
rpcUrl: RpcUrl,
{
messageId,
}: {
messageId: string;
}
): Promise<ArianeeMessageI18N>;
Parameter | Mandatory | Description |
---|---|---|
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>;
Parameter | Mandatory | Description |
---|---|---|
rpcUrl | ✅ | URL of the Arianee Privacy Gateway RPC. |
certificateId | ✅ | ID of the digital passport to retrieve the updated content of. |
eventId | ✅ | ID of the event to retrieve the content of. |
passphrase | ❌ | The passphrase of the digital passport. |
Updated about 2 months ago