@actioncodes/protocol 2.0.17 → 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.
- package/dist/ActionCodesProtocol.d.ts +8 -11
- package/dist/ActionCodesProtocol.d.ts.map +1 -1
- package/dist/adapters/BaseChainAdapter.d.ts +12 -32
- package/dist/adapters/BaseChainAdapter.d.ts.map +1 -1
- package/dist/adapters/SolanaAdapter.d.ts +8 -20
- package/dist/adapters/SolanaAdapter.d.ts.map +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +10 -10
- package/dist/index.js +2 -2
- package/dist/index.js.map +10 -10
- package/dist/strategy/DelegationStrategy.d.ts +3 -7
- package/dist/strategy/DelegationStrategy.d.ts.map +1 -1
- package/dist/strategy/WalletStrategy.d.ts +2 -3
- package/dist/strategy/WalletStrategy.d.ts.map +1 -1
- package/dist/types.d.ts +10 -8
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/canonical.d.ts +2 -2
- package/dist/utils/canonical.d.ts.map +1 -1
- package/package.json +1 -1
@@ -1,9 +1,8 @@
|
|
1
|
-
import type { ActionCode, CodeGenerationConfig,
|
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):
|
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,
|
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
|
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
|
package/dist/types.d.ts.map
CHANGED
@@ -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,
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C,MAAM,MAAM,KAAK,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEtD,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,KAAK,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,2BAA2B;IAC1C,MAAM,EAAE,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"}
|
@@ -4,6 +4,6 @@ export declare const CANONICAL_MESSAGE_PREFIX = "actioncodes";
|
|
4
4
|
export declare const CANONICAL_REVOKE_MESSAGE_PREFIX = "actioncodes-revoke";
|
5
5
|
export declare function serializeCanonical(parts: CanonicalMessageParts): Uint8Array;
|
6
6
|
export declare function serializeCanonicalRevoke(parts: CanonicalRevokeMessageParts): Uint8Array;
|
7
|
-
export declare function getCanonicalMessageParts(pubkey: string
|
8
|
-
export declare function serializeDelegationProof(proof: Omit<DelegationProof,
|
7
|
+
export declare function getCanonicalMessageParts(pubkey: string): Uint8Array;
|
8
|
+
export declare function serializeDelegationProof(proof: Omit<DelegationProof, "signature">): Uint8Array;
|
9
9
|
//# sourceMappingURL=canonical.d.ts.map
|
@@ -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;
|
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"}
|