@turnkey/api-key-stamper
Version:
API key stamper for @turnkey/http
35 lines • 1.11 kB
TypeScript
/// <reference lib="dom" />
export type Runtime = "browser" | "node" | "purejs";
export type TApiKeyStamperConfig = {
apiPublicKey: string;
apiPrivateKey: string;
runtimeOverride?: Runtime | undefined;
};
export declare enum SignatureFormat {
Der = "der",
Raw = "raw"
}
/**
* Signature function abstracting the differences between NodeJS and web environments for signing with API keys.
*/
export declare const signWithApiKey: (input: {
content: string;
publicKey: string;
privateKey: string;
}, runtimeOverride?: Runtime | undefined) => Promise<string>;
/**
* Stamper to use with `@turnkey/http`'s `TurnkeyClient`
*/
export declare class ApiKeyStamper {
apiPublicKey: string;
apiPrivateKey: string;
runtimeOverride?: Runtime | undefined;
constructor(config: TApiKeyStamperConfig);
stamp(payload: string): Promise<{
stampHeaderName: string;
stampHeaderValue: string;
}>;
sign(payload: string, format: SignatureFormat): Promise<string>;
}
export { pointDecode } from "./tink/elliptic_curves";
//# sourceMappingURL=index.d.ts.map