block-quote On this pagechevron-down
copy Copy chevron-down
ARCHIVE chevron-right GeoDIDs chevron-right Build with GeoDIDs chevron-right @astralprotocol/core API API for the @astralprotocol/core package
Creates a new AstralClient Instance to utilize the following functions.
new AstralClient(_ethAddress, _endpoint?);
Name
Type
Attributes
Description
The Ethereum Address of the user.
The Graph Endpoint. Already has a default value that can be overloaded with another endpoint.
CreateGenesisGeoDID
Creates a GenesisGeoDID Document. This creates a new root node for the linked data structure.
async createGenesisGeoDID(_typeOfGeoDID: string): Promise<IDocumentInfo>{}
The type of Genesis GeoDID you want to create. OfType GeoDidType.
Returns info regarding the Document Type, like the geodidid and the Document Itself.
Copy interface IDocumentInfo {
geodidid: string;
documentVal: any;
parentid?: string;
} CreateChildGeoDID
Creates a Child GeoDIDDocument. This creates a child node for an existing linked data structure.
async createChildGeoDID(_typeOfGeoDID: string, _parentID: string, _path: string): Promise<IDocumentInfo>{}
Name
Type
Attributes
Description
The type of Genesis GeoDID you want to create. OfType GeoDidType.
The Parent GeoDID ID of this new Child GeoDID
The path that will be appended to the Parent GeoDID ID
Returns information regarding the Document, like the GeoDID ID and the contents of the Document.
Copy interface IDocumentInfo {
geodidid: string;
documentVal: any;
parentid?: string;
} Pins the Document to IPFS or FFS via Powergate.
async pinDocument(_documentInfo: IDocumentInfo, _token?: string): Promise<IPinInfo>{}
Name
Type
Attributes
Description
The Info related to the Document that is required for pinning.
The Auth Token of the Powergate Instance that you want to pin the document on. If you don't have one yet, the client will automatically create a new one for you and return it for you to save.
Returns information regarding the Pin, like the GeoDID ID, cid, Powergate Auth token, and the pinDate.
Loads the Document by the DocID and the Powergate Auth token associated with it.
async loadDocument(_docId: string, _token: string): Promise<ILoadInfo>{}
Name
Type
Attribute
Description
The GeoDID id of the DID Document.
The Auth Token for the Powergate Instance that the Document in stored on.
Returns information regarding the Load, like the DocumentInfo as well as the Powergate Instance that the Document was pinned on.