@phantom/sdk-types 0.1.2 → 0.1.4

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 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; type?: "PKI"; idToken?: never; salt?: never }): Promise<string>;
24
- stamp(params: { data: Buffer; type: "OIDC"; idToken: string; salt: string }): Promise<string>;
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
- async stamp(params: { data: Buffer; type?: "PKI" }): Promise<string> {
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; type?: "PKI" }): Promise<string> {
85
+ async stamp(params: { data: Buffer }): Promise<string> {
82
86
  // Implementation
83
87
  return "stamp-value";
84
88
  }
package/dist/index.d.ts CHANGED
@@ -16,6 +16,9 @@ interface Stamper {
16
16
  salt: string;
17
17
  }): Promise<string>;
18
18
  algorithm: Algorithm;
19
+ type: "PKI" | "OIDC";
20
+ idToken?: string;
21
+ salt?: string;
19
22
  }
20
23
  interface StamperKeyInfo {
21
24
  keyId: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@phantom/sdk-types",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "description": "Common types for Phantom SDK packages",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -36,7 +36,7 @@
36
36
  "typescript": "^5.0.4"
37
37
  },
38
38
  "dependencies": {
39
- "@phantom/openapi-wallet-service": "^0.1.7",
39
+ "@phantom/openapi-wallet-service": "^0.1.9",
40
40
  "buffer": "^6.0.3"
41
41
  },
42
42
  "files": [