blockintel-gate-sdk 0.3.4 → 0.3.6

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/index.d.cts CHANGED
@@ -507,6 +507,32 @@ declare class GateClient {
507
507
  */
508
508
  declare function createGateClient(config: GateClientConfig): GateClient;
509
509
 
510
+ /**
511
+ * Gate - Simplified API for Nexus-style injection
512
+ *
513
+ * Provides a drop-in compatible API for code injected by Nexus:
514
+ * import { Gate } from "blockintel-gate-sdk";
515
+ * const gate = new Gate({ apiKey: process.env.BLOCKINTEL_API_KEY });
516
+ * const tx = await gate.guard(ctx, async () => wallet.sendTransaction({ ... }));
517
+ *
518
+ * In passthrough mode (no baseUrl/tenantId, or Nexus sandbox): executes the callback.
519
+ * For full policy evaluation, use GateClient.evaluate() with tx params before sending.
520
+ */
521
+ declare class Gate {
522
+ private readonly apiKey?;
523
+ constructor(opts?: {
524
+ apiKey?: string;
525
+ });
526
+ /**
527
+ * Guard a signing operation. In passthrough mode, executes the callback.
528
+ * For full Gate integration, use GateClient with evaluate() before sending.
529
+ */
530
+ guard<T>(_ctx: {
531
+ requestId: string;
532
+ reason: string;
533
+ }, cb: () => Promise<T>): Promise<T>;
534
+ }
535
+
510
536
  /**
511
537
  * BlockIntel Gate SDK - Error Types
512
538
  */
@@ -758,4 +784,4 @@ declare class HeartbeatManager {
758
784
  getClientInstanceId(): string;
759
785
  }
760
786
 
761
- export { BlockIntelAuthError, BlockIntelBlockedError, BlockIntelStepUpRequiredError, BlockIntelUnavailableError, type DefenseEvaluateRequestV2, type DefenseEvaluateResponseV2, GateClient, type GateClientConfig, type GateDecision, GateError, GateErrorCode, type GateStepUpStatus, HeartbeatManager, type HeartbeatToken, type Provenance, ProvenanceProvider, type SigningContext, type StepUpFinalResult, type StepUpMetadata, StepUpNotConfiguredError, type StepUpStatusResponse, type TransactionIntentV2, type WrapKmsClientOptions, type WrappedKmsClient, createGateClient, GateClient as default, wrapKmsClient };
787
+ export { BlockIntelAuthError, BlockIntelBlockedError, BlockIntelStepUpRequiredError, BlockIntelUnavailableError, type DefenseEvaluateRequestV2, type DefenseEvaluateResponseV2, Gate, GateClient, type GateClientConfig, type GateDecision, GateError, GateErrorCode, type GateStepUpStatus, HeartbeatManager, type HeartbeatToken, type Provenance, ProvenanceProvider, type SigningContext, type StepUpFinalResult, type StepUpMetadata, StepUpNotConfiguredError, type StepUpStatusResponse, type TransactionIntentV2, type WrapKmsClientOptions, type WrappedKmsClient, createGateClient, GateClient as default, wrapKmsClient };
package/dist/index.d.ts CHANGED
@@ -507,6 +507,32 @@ declare class GateClient {
507
507
  */
508
508
  declare function createGateClient(config: GateClientConfig): GateClient;
509
509
 
510
+ /**
511
+ * Gate - Simplified API for Nexus-style injection
512
+ *
513
+ * Provides a drop-in compatible API for code injected by Nexus:
514
+ * import { Gate } from "blockintel-gate-sdk";
515
+ * const gate = new Gate({ apiKey: process.env.BLOCKINTEL_API_KEY });
516
+ * const tx = await gate.guard(ctx, async () => wallet.sendTransaction({ ... }));
517
+ *
518
+ * In passthrough mode (no baseUrl/tenantId, or Nexus sandbox): executes the callback.
519
+ * For full policy evaluation, use GateClient.evaluate() with tx params before sending.
520
+ */
521
+ declare class Gate {
522
+ private readonly apiKey?;
523
+ constructor(opts?: {
524
+ apiKey?: string;
525
+ });
526
+ /**
527
+ * Guard a signing operation. In passthrough mode, executes the callback.
528
+ * For full Gate integration, use GateClient with evaluate() before sending.
529
+ */
530
+ guard<T>(_ctx: {
531
+ requestId: string;
532
+ reason: string;
533
+ }, cb: () => Promise<T>): Promise<T>;
534
+ }
535
+
510
536
  /**
511
537
  * BlockIntel Gate SDK - Error Types
512
538
  */
@@ -758,4 +784,4 @@ declare class HeartbeatManager {
758
784
  getClientInstanceId(): string;
759
785
  }
760
786
 
761
- export { BlockIntelAuthError, BlockIntelBlockedError, BlockIntelStepUpRequiredError, BlockIntelUnavailableError, type DefenseEvaluateRequestV2, type DefenseEvaluateResponseV2, GateClient, type GateClientConfig, type GateDecision, GateError, GateErrorCode, type GateStepUpStatus, HeartbeatManager, type HeartbeatToken, type Provenance, ProvenanceProvider, type SigningContext, type StepUpFinalResult, type StepUpMetadata, StepUpNotConfiguredError, type StepUpStatusResponse, type TransactionIntentV2, type WrapKmsClientOptions, type WrappedKmsClient, createGateClient, GateClient as default, wrapKmsClient };
787
+ export { BlockIntelAuthError, BlockIntelBlockedError, BlockIntelStepUpRequiredError, BlockIntelUnavailableError, type DefenseEvaluateRequestV2, type DefenseEvaluateResponseV2, Gate, GateClient, type GateClientConfig, type GateDecision, GateError, GateErrorCode, type GateStepUpStatus, HeartbeatManager, type HeartbeatToken, type Provenance, ProvenanceProvider, type SigningContext, type StepUpFinalResult, type StepUpMetadata, StepUpNotConfiguredError, type StepUpStatusResponse, type TransactionIntentV2, type WrapKmsClientOptions, type WrappedKmsClient, createGateClient, GateClient as default, wrapKmsClient };
package/dist/index.js CHANGED
@@ -1986,6 +1986,21 @@ function createGateClient(config) {
1986
1986
  return new GateClient(config);
1987
1987
  }
1988
1988
 
1989
- export { BlockIntelAuthError, BlockIntelBlockedError, BlockIntelStepUpRequiredError, BlockIntelUnavailableError, GateClient, GateError, GateErrorCode, HeartbeatManager, ProvenanceProvider, StepUpNotConfiguredError, createGateClient, GateClient as default, wrapKmsClient };
1989
+ // src/client/Gate.ts
1990
+ var Gate = class {
1991
+ apiKey;
1992
+ constructor(opts) {
1993
+ this.apiKey = opts?.apiKey ?? process.env.BLOCKINTEL_API_KEY;
1994
+ }
1995
+ /**
1996
+ * Guard a signing operation. In passthrough mode, executes the callback.
1997
+ * For full Gate integration, use GateClient with evaluate() before sending.
1998
+ */
1999
+ async guard(_ctx, cb) {
2000
+ return cb();
2001
+ }
2002
+ };
2003
+
2004
+ export { BlockIntelAuthError, BlockIntelBlockedError, BlockIntelStepUpRequiredError, BlockIntelUnavailableError, Gate, GateClient, GateError, GateErrorCode, HeartbeatManager, ProvenanceProvider, StepUpNotConfiguredError, createGateClient, GateClient as default, wrapKmsClient };
1990
2005
  //# sourceMappingURL=index.js.map
1991
2006
  //# sourceMappingURL=index.js.map