freelii-passkey-kit
Version:
A helper library for creating and using smart wallet accounts on the Stellar blockchain.
32 lines (26 loc) • 791 B
text/typescript
export type Signer = {
kind: string
key: string
val: string
expiration: number | null
storage: "Persistent" | "Temporary"
limits: string
evicted?: boolean
}
export class SignerKey {
private constructor(public key: "Policy" | "Ed25519" | "Secp256r1", public value: string) { }
static Policy(policy: string): SignerKey {
return new SignerKey("Policy", policy);
}
static Ed25519(publicKey: string): SignerKey {
return new SignerKey("Ed25519", publicKey);
}
static Secp256r1(id: string): SignerKey {
return new SignerKey("Secp256r1", id);
}
}
export type SignerLimits = Map<string, SignerKey[] | undefined> | undefined
export enum SignerStore {
Persistent = 'Persistent',
Temporary = 'Temporary',
}