@actioncodes/protocol 2.0.18 → 2.0.19

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.
@@ -1,9 +1,8 @@
1
- import type { ActionCode, CodeGenerationConfig, WalletStrategyCodeGenerationResult } from "../types";
1
+ import type { ActionCode, CodeGenerationConfig, Chain } from "../types";
2
2
  export declare class WalletStrategy {
3
3
  private config;
4
4
  constructor(config: CodeGenerationConfig);
5
- generateCode(canonicalMessage: Uint8Array, signature: string): WalletStrategyCodeGenerationResult;
5
+ generateCode(canonicalMessage: Uint8Array, chain: Chain, signature: string): ActionCode;
6
6
  validateCode(actionCode: ActionCode): void;
7
- getCanonicalMessageParts(pubkey: string): Uint8Array;
8
7
  }
9
8
  //# sourceMappingURL=WalletStrategy.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"WalletStrategy.d.ts","sourceRoot":"","sources":["../../src/strategy/WalletStrategy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,oBAAoB,EACpB,kCAAkC,EACnC,MAAM,UAAU,CAAC;AAclB,qBAAa,cAAc;IACb,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,oBAAoB;IAEhD,YAAY,CACV,gBAAgB,EAAE,UAAU,EAC5B,SAAS,EAAE,MAAM,GAChB,kCAAkC;IAqCrC,YAAY,CAAC,UAAU,EAAE,UAAU,GAAG,IAAI;IA2C1C,wBAAwB,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU;CAGrD"}
1
+ {"version":3,"file":"WalletStrategy.d.ts","sourceRoot":"","sources":["../../src/strategy/WalletStrategy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,oBAAoB,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAOxE,qBAAa,cAAc;IACb,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,oBAAoB;IAEhD,YAAY,CACV,gBAAgB,EAAE,UAAU,EAC5B,KAAK,EAAE,KAAK,EACZ,SAAS,EAAE,MAAM,GAChB,UAAU;IAsCb,YAAY,CAAC,UAAU,EAAE,UAAU,GAAG,IAAI;CAyC3C"}
package/dist/types.d.ts CHANGED
@@ -1,9 +1,12 @@
1
+ import { SUPPORTED_CHAINS } from "./constants";
2
+ export type Chain = (typeof SUPPORTED_CHAINS)[number];
1
3
  export interface ActionCode {
4
+ chain: Chain;
2
5
  code: string;
3
6
  pubkey: string;
4
7
  timestamp: number;
5
8
  expiresAt: number;
6
- signature?: string;
9
+ signature: string;
7
10
  }
8
11
  export interface CanonicalMessageParts {
9
12
  pubkey: string;
@@ -19,13 +22,6 @@ export interface CodeGenerationConfig {
19
22
  ttlMs: number;
20
23
  clockSkewMs?: number;
21
24
  }
22
- export interface WalletStrategyCodeGenerationResult {
23
- actionCode: ActionCode;
24
- canonicalMessage: Uint8Array;
25
- }
26
- export interface DelegationStrategyCodeGenerationResult {
27
- actionCode: DelegatedActionCode;
28
- }
29
25
  export interface DelegationProof {
30
26
  walletPubkey: string;
31
27
  delegatedPubkey: string;
@@ -36,4 +32,10 @@ export interface DelegationProof {
36
32
  export interface DelegatedActionCode extends ActionCode {
37
33
  delegationProof: DelegationProof;
38
34
  }
35
+ export interface ActionCodeRevoke extends ActionCode {
36
+ revokeSignature: string;
37
+ }
38
+ export interface DelegatedActionCodeRevoke extends DelegatedActionCode {
39
+ revokeSignature: string;
40
+ }
39
41
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,MAAM,CAAC;IACf,W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,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,oBAAoB;IACnC,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,eAAe;IAC9B,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,mBAAoB,SAAQ,UAAU;IACrD,eAAe,EAAE,eAAe,CAAC;CAClC;AAED,MAAM,WAAW,gBAAiB,SAAQ,UAAU;IAClD,eAAe,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,yBAA0B,SAAQ,mBAAmB;IACpE,eAAe,EAAE,MAAM,CAAC;CACzB"}
@@ -1 +1 @@
1
- {"version":3,"file":"canonical.d.ts","sourceRoot":"","sources":["../../src/utils/canonical.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,EACrB,2BAA2B,EAC3B,eAAe,EAChB,MAAM,UAAU,CAAC;AAElB,eAAO,MAAM,yBAAyB,IAAI,CAAC;AAC3C,eAAO,MAAM,wBAAwB,gBAAgB,CAAC;AACtD,eAAO,MAAM,+BAA+B,uBAAuB,CAAC;AAEpE,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,qBAAqB,GAAG,UAAU,CAQ3E;AAED,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,2BAA2B,GACjC,UAAU,CASZ;AAED,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU,CAEnE;AAED,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,IAAI,CAAC,eAAe,EAAE,WAAW,CAAC,GACxC,UAAU,CAQZ"}
1
+ {"version":3,"file":"canonical.d.ts","sourceRoot":"","sources":["../../src/utils/canonical.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,EACrB,2BAA2B,EAC3B,eAAe,EAChB,MAAM,UAAU,CAAC;AAGlB,eAAO,MAAM,yBAAyB,IAAI,CAAC;AAC3C,eAAO,MAAM,wBAAwB,gBAAgB,CAAC;AACtD,eAAO,MAAM,+BAA+B,uBAAuB,CAAC;AAEpE,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,qBAAqB,GAAG,UAAU,CAoC3E;AAED,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,2BAA2B,GACjC,UAAU,CA8CZ;AAED,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU,CAEnE;AAED,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,IAAI,CAAC,eAAe,EAAE,WAAW,CAAC,GACxC,UAAU,CA8BZ"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@actioncodes/protocol",
3
- "version": "2.0.18",
3
+ "version": "2.0.19",
4
4
  "module": "index.ts",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",