@daml/hub-react
Version:
Daml React functions for Daml Hub
48 lines (47 loc) • 1.15 kB
TypeScript
interface PartyTokenPayload {
exp: number;
'https://daml.com/ledger-api': {
applicationId: string;
ledgerId: string;
actAs: string[];
readAs: string[];
};
ledgerId: string;
owner: string;
party: string;
partyName: string;
}
/**
* A class for parsing and interacting with Daml Hub ledger access tokens.
*/
export declare class PartyToken {
token: string;
payload?: PartyTokenPayload;
constructor(token: string);
/**
* Extract the name of the party, as supplied when that Party authenticates
* themselves with Daml Hub, from an access token.
*/
get partyName(): string;
/**
* Extract the party identifier from an access token.
*/
get party(): string;
/**
* Extract the ledger identifier from an access token.
*/
get ledgerId(): string;
/**
* Daml Hub access tokens expire every 24 hours.
*/
get isExpired(): boolean;
toJSON(): {
token: string;
party: string;
partyName: string;
ledgerId: string;
isExpired: boolean;
};
toString(): string;
}
export {};