@phantom/sdk-types 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -4
- package/dist/index.d.ts +3 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -20,8 +20,11 @@ Interface for creating X-Phantom-Stamp header values for API authentication.
|
|
|
20
20
|
|
|
21
21
|
```typescript
|
|
22
22
|
interface Stamper {
|
|
23
|
-
stamp(params: { data: Buffer
|
|
24
|
-
|
|
23
|
+
stamp(params: { data: Buffer }): Promise<string>;
|
|
24
|
+
type?: "PKI" | "OIDC"; // Optional, defaults to "PKI"
|
|
25
|
+
idToken?: string; // Required for OIDC type, optional for PKI
|
|
26
|
+
salt?: string; // Required for OIDC type, optional for PKI
|
|
27
|
+
algorithm?: Algorithm; // Optional, defaults to Algorithm.ed25519
|
|
25
28
|
}
|
|
26
29
|
```
|
|
27
30
|
|
|
@@ -31,7 +34,8 @@ interface Stamper {
|
|
|
31
34
|
import type { Stamper } from "@phantom/sdk-types";
|
|
32
35
|
|
|
33
36
|
class MyStamper implements Stamper {
|
|
34
|
-
|
|
37
|
+
type = "PKI"; // or "OIDC"
|
|
38
|
+
async stamp(params: { data: Buffer }): Promise<string> {
|
|
35
39
|
// Implementation for PKI stamping
|
|
36
40
|
return "stamp-value";
|
|
37
41
|
}
|
|
@@ -78,7 +82,7 @@ class MyKeyManagedStamper implements StamperWithKeyManagement {
|
|
|
78
82
|
return { keyId: "key-id", publicKey: "public-key" };
|
|
79
83
|
}
|
|
80
84
|
|
|
81
|
-
async stamp(params: { data: Buffer
|
|
85
|
+
async stamp(params: { data: Buffer }): Promise<string> {
|
|
82
86
|
// Implementation
|
|
83
87
|
return "stamp-value";
|
|
84
88
|
}
|
package/dist/index.d.ts
CHANGED