@usesigil/plugins 9.0.0 → 11.0.0

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/sak/index.js CHANGED
@@ -1,4 +1,5 @@
1
- import { createSigilClient, custodyAdapterToTransactionSigner, } from "@usesigil/kit";
1
+ import { createSigilClient } from "@usesigil/kit";
2
+ import { custodyAdapterToTransactionSigner, } from "./signer.js";
2
3
  import { swapAction } from "./actions/swap.js";
3
4
  import { transferAction } from "./actions/transfer.js";
4
5
  import { statusAction } from "./actions/status.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/sak/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,iCAAiC,GAElC,MAAM,eAAe,CAAC;AAGvB,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEnD,SAAS,gBAAgB,CACvB,KAAyC;IAEzC,OAAO,CACL,OAAQ,KAAwB,CAAC,YAAY,KAAK,UAAU;QAC5D,OAAQ,KAAwB,CAAC,IAAI,KAAK,UAAU;QACpD,CAAC,CAAC,SAAS,IAAI,KAAK,CAAC,CACtB,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,MAAsB;IACtD,MAAM,MAAM,GAAG,gBAAgB,CAAC,MAAM,CAAC,KAAK,CAAC;QAC3C,CAAC,CAAC,iCAAiC,CAAC,MAAM,CAAC,KAAK,CAAC;QACjD,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;IAEjB,6EAA6E;IAC7E,wEAAwE;IACxE,0EAA0E;IAC1E,yEAAyE;IACzE,wEAAwE;IACxE,sDAAsD;IACtD,MAAM,MAAM,GAAG,iBAAiB,CAAC;QAC/B,GAAG,EAAE,MAAM,CAAC,GAAG;QACf,KAA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iB,CAAC;QAC/B,GAAG,EAAE,MAAM,CAAC,GAAG;QACf,KAAK,EAAE,MAAM,CAAC,KAAK;QACnB,KAAK,EAAE,MAAM;QACb,OAAO,EAAE,MAAM,CAAC,OAAO;KACxB,CAAC,CAAC;IAEH,MAAM,UAAU,GAAG,MAAM,CAAC,aAAa,IAAI,6BAA6B,CAAC;IAEzE,OAAO;QACL,IAAI,EAAE,OAAO;QACb,OAAO,EAAE;YACP,UAAU,EAAE,UAAU,CAAC,MAAM,EAAE,UAAU,CAAC;YAC1C,cAAc,EAAE,cAAc,CAAC,MAAM,CAAC;YACtC,YAAY,EAAE,YAAY,CAAC,MAAM,CAAC;SACnC;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,45 @@
1
+ /**
2
+ * custodyAdapterToTransactionSigner — bridge helper for the SAK plugin.
3
+ *
4
+ * Previously lived in `@usesigil/kit`'s root barrel. Moved here so the
5
+ * kit does not carry plugin-specific custody glue. Consumers of the SAK
6
+ * plugin who need a Sigil vault client constructed from a
7
+ * `CustodyAdapter` call this helper to produce the `TransactionSigner`
8
+ * that `createSigilClient` / `Sigil.fromVault` expect.
9
+ *
10
+ * Contract: thin wrapper. Unchanged from the kit-originated version.
11
+ */
12
+ import type { Address, TransactionSigner } from "@solana/kit";
13
+ import type { AttestationResult } from "@usesigil/kit";
14
+ /**
15
+ * Standardized interface for custody providers. Implementors:
16
+ * - `@usesigil/custody/turnkey` — TEE + Ed25519
17
+ * - `@usesigil/custody/crossmint` — API-verified TEE
18
+ * - `@usesigil/custody/privy` — Embedded wallets
19
+ *
20
+ * Three-method contract:
21
+ * - `getPublicKey()` — Address of the custody-managed signing key
22
+ * - `sign()` — Raw Ed25519 signature over arbitrary bytes
23
+ * - `attestation()` (optional) — TEE attestation proof
24
+ */
25
+ export interface CustodyAdapter {
26
+ /** Get the public key (address) of the custody-managed signing key. */
27
+ getPublicKey(): Address;
28
+ /**
29
+ * Sign arbitrary bytes. Returns a 64-byte Ed25519 signature. The
30
+ * adapter handles key access (TEE, MPC, HSM, etc.) internally.
31
+ */
32
+ sign(bytes: Uint8Array): Promise<Uint8Array>;
33
+ /**
34
+ * Optional: retrieve TEE attestation proof for the custody key.
35
+ * Returns null if the provider doesn't support attestation.
36
+ */
37
+ attestation?(): Promise<AttestationResult | null>;
38
+ }
39
+ /**
40
+ * Bridge a `CustodyAdapter` to Kit's `TransactionSigner` interface.
41
+ * Returns a `TransactionPartialSigner` — custody adapters do pure
42
+ * signing (no transaction modification).
43
+ */
44
+ export declare function custodyAdapterToTransactionSigner(adapter: CustodyAdapter): TransactionSigner;
45
+ //# sourceMappingURL=signer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"signer.d.ts","sourceRoot":"","sources":["../../src/sak/signer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAC9D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAIvD;;;;;;;;;;GAUG;AACH,MAAM,WAAW,cAAc;IAC7B,uEAAuE;IACvE,YAAY,IAAI,OAAO,CAAC;IAExB;;;OAGG;IACH,IAAI,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IAE7C;;;OAGG;IACH,WAAW,CAAC,IAAI,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAAC;CACnD;AAED;;;;GAIG;AACH,wBAAgB,iCAAiC,CAC/C,OAAO,EAAE,cAAc,GACtB,iBAAiB,CAgCnB"}
@@ -0,0 +1,39 @@
1
+ /**
2
+ * custodyAdapterToTransactionSigner — bridge helper for the SAK plugin.
3
+ *
4
+ * Previously lived in `@usesigil/kit`'s root barrel. Moved here so the
5
+ * kit does not carry plugin-specific custody glue. Consumers of the SAK
6
+ * plugin who need a Sigil vault client constructed from a
7
+ * `CustodyAdapter` call this helper to produce the `TransactionSigner`
8
+ * that `createSigilClient` / `Sigil.fromVault` expect.
9
+ *
10
+ * Contract: thin wrapper. Unchanged from the kit-originated version.
11
+ */
12
+ import { SigilSdkDomainError } from "@usesigil/kit";
13
+ import { SIGIL_ERROR__SDK__SIGNATURE_INVALID } from "@usesigil/kit/errors";
14
+ /**
15
+ * Bridge a `CustodyAdapter` to Kit's `TransactionSigner` interface.
16
+ * Returns a `TransactionPartialSigner` — custody adapters do pure
17
+ * signing (no transaction modification).
18
+ */
19
+ export function custodyAdapterToTransactionSigner(adapter) {
20
+ const address = adapter.getPublicKey();
21
+ return {
22
+ address,
23
+ async signTransactions(transactions) {
24
+ const results = [];
25
+ for (const tx of transactions) {
26
+ const sig = await adapter.sign(tx.messageBytes);
27
+ if (!(sig instanceof Uint8Array)) {
28
+ throw new SigilSdkDomainError(SIGIL_ERROR__SDK__SIGNATURE_INVALID, `Custody adapter signature must be Uint8Array, got ${typeof sig}`, { context: { reason: `wrong-type:${typeof sig}` } });
29
+ }
30
+ if (sig.length !== 64) {
31
+ throw new SigilSdkDomainError(SIGIL_ERROR__SDK__SIGNATURE_INVALID, `Custody adapter returned invalid signature: expected 64 bytes, got ${sig.length}`, { context: { reason: `wrong-length:${sig.length}` } });
32
+ }
33
+ results.push({ [address]: sig });
34
+ }
35
+ return results;
36
+ },
37
+ };
38
+ }
39
+ //# sourceMappingURL=signer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"signer.js","sourceRoot":"","sources":["../../src/sak/signer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAIH,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EAAE,mCAAmC,EAAE,MAAM,sBAAsB,CAAC;AA8B3E;;;;GAIG;AACH,MAAM,UAAU,iCAAiC,CAC/C,OAAuB;IAEvB,MAAM,OAAO,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC;IAEvC,OAAO;QACL,OAAO;QACP,KAAK,CAAC,gBAAgB,CACpB,YAA0B;YAE1B,MAAM,OAAO,GAAiC,EAAE,CAAC;YAEjD,KAAK,MAAM,EAAE,IAAI,YAAY,EAAE,CAAC;gBAC9B,MAAM,GAAG,GAAG,MAAM,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC;gBAChD,IAAI,CAAC,CAAC,GAAG,YAAY,UAAU,CAAC,EAAE,CAAC;oBACjC,MAAM,IAAI,mBAAmB,CAC3B,mCAAmC,EACnC,qDAAqD,OAAO,GAAG,EAAE,EACjE,EAAE,OAAO,EAAE,EAAE,MAAM,EAAE,cAAc,OAAO,GAAG,EAAE,EAAE,EAAE,CACpD,CAAC;gBACJ,CAAC;gBACD,IAAI,GAAG,CAAC,MAAM,KAAK,EAAE,EAAE,CAAC;oBACtB,MAAM,IAAI,mBAAmB,CAC3B,mCAAmC,EACnC,sEAAsE,GAAG,CAAC,MAAM,EAAE,EAClF,EAAE,OAAO,EAAE,EAAE,MAAM,EAAE,gBAAgB,GAAG,CAAC,MAAM,EAAE,EAAE,EAAE,CACtD,CAAC;gBACJ,CAAC;gBACD,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC;YACnC,CAAC;YAED,OAAO,OAAO,CAAC;QACjB,CAAC;KACmB,CAAC;AACzB,CAAC"}
@@ -1,5 +1,6 @@
1
1
  import type { Address, Rpc, SolanaRpcApi, TransactionSigner } from "@solana/kit";
2
- import type { CustodyAdapter, Network } from "@usesigil/kit";
2
+ import type { Network } from "@usesigil/kit";
3
+ import type { CustodyAdapter } from "./signer.js";
3
4
  /** Convert plugin's "mainnet" to kit's "mainnet-beta" network string. */
4
5
  export declare function toResolvedNetwork(network: "devnet" | "mainnet"): Network;
5
6
  export interface SigilSakConfig {
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/sak/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,OAAO,EACP,GAAG,EACH,YAAY,EACZ,iBAAiB,EAClB,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAE7D,yEAAyE;AACzE,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,QAAQ,GAAG,SAAS,GAAG,OAAO,CAExE;AAED,MAAM,WAAW,cAAc;IAC7B,yBAAyB;IACzB,KAAK,EAAE,OAAO,CAAC;IACf,wBAAwB;IACxB,OAAO,EAAE,QAAQ,GAAG,SAAS,CAAC;IAC9B,8BAA8B;IAC9B,GAAG,EAAE,GAAG,CAAC,YAAY,CAAC,CAAC;IACvB,yFAAyF;IACzF,KAAK,EAAE,iBAAiB,GAAG,cAAc,CAAC;IAC1C,oEAAoE;IACpE,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/sak/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,OAAO,EACP,GAAG,EACH,YAAY,EACZ,iBAAiB,EAClB,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,yEAAyE;AACzE,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,QAAQ,GAAG,SAAS,GAAG,OAAO,CAExE;AAED,MAAM,WAAW,cAAc;IAC7B,yBAAyB;IACzB,KAAK,EAAE,OAAO,CAAC;IACf,wBAAwB;IACxB,OAAO,EAAE,QAAQ,GAAG,SAAS,CAAC;IAC9B,8BAA8B;IAC9B,GAAG,EAAE,GAAG,CAAC,YAAY,CAAC,CAAC;IACvB,yFAAyF;IACzF,KAAK,EAAE,iBAAiB,GAAG,cAAc,CAAC;IAC1C,oEAAoE;IACpE,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB"}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/sak/types.ts"],"names":[],"mappings":"AAQA,yEAAyE;AACzE,MAAM,UAAU,iBAAiB,CAAC,OAA6B;IAC7D,OAAO,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,QAAQ,CAAC;AAC3D,CAAC"}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/sak/types.ts"],"names":[],"mappings":"AASA,yEAAyE;AACzE,MAAM,UAAU,iBAAiB,CAAC,OAA6B;IAC7D,OAAO,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,QAAQ,CAAC;AAC3D,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@usesigil/plugins",
3
- "version": "9.0.0",
3
+ "version": "11.0.0",
4
4
  "type": "module",
5
5
  "description": "Agent framework adapters for Sigil",
6
6
  "exports": {
@@ -19,7 +19,7 @@
19
19
  "node": ">=18.0.0"
20
20
  },
21
21
  "peerDependencies": {
22
- "@usesigil/kit": ">=0.11.0",
22
+ "@usesigil/kit": ">=0.13.0",
23
23
  "solana-agent-kit": ">=2.0.0"
24
24
  },
25
25
  "peerDependenciesMeta": {
@@ -37,7 +37,7 @@
37
37
  "mocha": "^11.7.5",
38
38
  "tsx": "^4.21.0",
39
39
  "typescript": "^5.6.0",
40
- "@usesigil/kit": "0.11.0"
40
+ "@usesigil/kit": "0.13.0"
41
41
  },
42
42
  "publishConfig": {
43
43
  "access": "public",