blockintel-gate-sdk 0.4.7 → 0.4.8

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.
Files changed (2) hide show
  1. package/README.md +50 -2
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  Production-grade TypeScript/Node.js SDK for [BlockIntel Gate](https://blockintelai.com) Hot Path API.
4
4
 
5
+ Gate intercepts AWS KMS signing operations before cryptographic signatures are produced. Every transaction is evaluated against policy (denylist, velocity caps, value thresholds, signer allowlist) in <50ms. If policy says no, the key never signs.
6
+
7
+ **SHADOW mode** — zero production risk. Gate evaluates every transaction and logs WOULD_BLOCK decisions, but never blocks. Drop it into your existing signing flow in minutes and collect 14 days of data before enforcing anything.
8
+
5
9
  ## Installation
6
10
 
7
11
  ```bash
@@ -21,9 +25,51 @@ npm install @blockintel/gate-sdk
21
25
  - **signingContext**: Hot Path requires `actorPrincipal` and `signerId`. The SDK defaults them when missing (`gate-sdk-client` or from `signingContext.signerId`).
22
26
  - **ESM**: HMAC and SHA-256 use `node:crypto` (no `require('crypto')`), so the SDK works in ESM (`"type": "module"`) and in bundled canary apps.
23
27
 
24
- ## Quick Start
28
+ ## Quick Start — 3 Steps
25
29
 
26
- ### HMAC Authentication
30
+ ```typescript
31
+ // 1. Install
32
+ // npm install @blockintel/gate-sdk
33
+
34
+ // 2. Initialize (API key — simplest auth for getting started)
35
+ import { GateClient } from '@blockintel/gate-sdk';
36
+
37
+ const gate = new GateClient({
38
+ baseUrl: process.env.GATE_BASE_URL!,
39
+ tenantId: process.env.GATE_TENANT_ID!,
40
+ auth: { mode: 'apiKey', apiKey: process.env.GATE_API_KEY! },
41
+ });
42
+
43
+ // 3. Wrap your signing call
44
+ const decision = await gate.evaluate({
45
+ txIntent: {
46
+ from: '0xYourAddress',
47
+ to: '0xDestination',
48
+ value: '1000000000000000000', // 1 ETH in wei
49
+ chainId: 1,
50
+ },
51
+ });
52
+
53
+ // In SHADOW mode: always ALLOW, but reasonCodes shows what WOULD_BLOCK
54
+ console.log(decision.decision); // "ALLOW"
55
+ console.log(decision.reasonCodes); // ["DENYLIST"] if policy would have blocked
56
+ ```
57
+
58
+ Get a free tenant at [blockintelai.com](https://blockintelai.com). For production use, switch to HMAC authentication — see the [Production Setup — HMAC Authentication](#production-setup--hmac-authentication) section below.
59
+
60
+ ## Why Gate
61
+
62
+ **The problem:** Every `kms:Sign` call is unrestricted by default. Any process with valid IAM permissions can sign any transaction to any address for any amount. A compromised credential is a blank check.
63
+
64
+ **What Gate adds:**
65
+ - **Pre-signature policy evaluation** — denylist, value thresholds, velocity caps, signer allowlist
66
+ - **Cryptographic receipts** — every decision signed with HMAC + RSA, verifiable by third parties
67
+ - **SHADOW mode** — collect 14 days of data with zero production risk before enforcing
68
+ - **Enforcement ladder** — SHADOW → SOFT_ENFORCE → HARD_KMS_GATEWAY (IAM-level, app loses kms:Sign)
69
+
70
+ **Who uses it:** Crypto exchanges and custodians who need independently verifiable evidence of signing controls — for insurance carriers, compliance auditors (VARA, NYDFS), and internal governance.
71
+
72
+ ## Production Setup — HMAC Authentication
27
73
 
28
74
  ```typescript
29
75
  import { GateClient } from '@blockintel/gate-sdk';
@@ -180,6 +226,8 @@ console.log('Elapsed time:', result.elapsedMs, 'ms');
180
226
 
181
227
  ## Configuration
182
228
 
229
+ > **SHADOW mode is the default.** `onConnectionFailure: 'FAIL_OPEN'` means Gate never blocks your signing operations — even if Gate itself is unreachable. You get full visibility into what would have been blocked without any production risk. Switch to `FAIL_CLOSED` only when you're ready to enforce.
230
+
183
231
  ### `GateClientConfig`
184
232
 
185
233
  ```typescript
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "blockintel-gate-sdk",
3
- "version": "0.4.7",
3
+ "version": "0.4.8",
4
4
  "description": "Production-grade TypeScript/Node.js SDK for BlockIntel Gate Hot Path",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -107,4 +107,4 @@
107
107
  "optionalDependencies": {
108
108
  "pkcs11js": "^2.1.6"
109
109
  }
110
- }
110
+ }