blockintel-gate-sdk 0.3.3 → 0.3.4
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/README.md +56 -6
- package/dist/index.cjs +4 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# BlockIntel Gate SDK
|
|
2
2
|
|
|
3
|
-
Production-grade TypeScript/Node.js SDK for [BlockIntel Gate](https://
|
|
3
|
+
Production-grade TypeScript/Node.js SDK for [BlockIntel Gate](https://blockintelai.com) Hot Path API.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
@@ -102,6 +102,47 @@ const response = await gate.evaluate({
|
|
|
102
102
|
});
|
|
103
103
|
```
|
|
104
104
|
|
|
105
|
+
### Local Development with Gate Local
|
|
106
|
+
|
|
107
|
+
For local development and testing, use **Gate Local** - a Docker container that emulates the Gate Hot Path:
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
# Start Gate Local
|
|
111
|
+
docker pull blockintelai/gate-local:latest
|
|
112
|
+
docker run -d --name gate-local -p 3000:3000 blockintelai/gate-local:latest
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
Then configure your client for local mode:
|
|
116
|
+
|
|
117
|
+
```typescript
|
|
118
|
+
import { GateClient } from '@blockintel/gate-sdk';
|
|
119
|
+
|
|
120
|
+
// Local development configuration
|
|
121
|
+
const gate = new GateClient({
|
|
122
|
+
baseUrl: 'http://localhost:3000', // Gate Local endpoint
|
|
123
|
+
tenantId: 'local-dev', // Any tenant ID (ignored in local mode)
|
|
124
|
+
local: true, // Enable local mode (disables auth/heartbeat)
|
|
125
|
+
auth: {
|
|
126
|
+
mode: 'apiKey',
|
|
127
|
+
apiKey: 'local-dev-key' // Any API key (ignored in local mode)
|
|
128
|
+
},
|
|
129
|
+
});
|
|
130
|
+
|
|
131
|
+
// Evaluate transactions locally
|
|
132
|
+
const response = await gate.evaluate({
|
|
133
|
+
txIntent: {
|
|
134
|
+
toAddress: '0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb',
|
|
135
|
+
value: '1000000000000000000', // 1 ETH in wei
|
|
136
|
+
valueUsd: 2500.0,
|
|
137
|
+
chainId: 1,
|
|
138
|
+
},
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
console.log(`Decision: ${response.decision}`);
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
**📚 Full Local Development Guide**: See [Gate Local Quick Start Guide](https://docs.blockintelai.com/gate/local-development) for complete setup instructions, trading bot integration examples, and troubleshooting.
|
|
145
|
+
|
|
105
146
|
### Step-Up Polling
|
|
106
147
|
|
|
107
148
|
```typescript
|
|
@@ -159,7 +200,7 @@ When step-up is disabled, the SDK treats `REQUIRE_STEP_UP` as `BLOCK` by default
|
|
|
159
200
|
|
|
160
201
|
```bash
|
|
161
202
|
# Required
|
|
162
|
-
GATE_BASE_URL=https://gate.blockintelai.
|
|
203
|
+
GATE_BASE_URL=https://gate.blockintelai.com
|
|
163
204
|
GATE_TENANT_ID=your-tenant-id
|
|
164
205
|
|
|
165
206
|
# HMAC Authentication
|
|
@@ -353,12 +394,12 @@ The heartbeat manager is automatically configured based on your `GateClientConfi
|
|
|
353
394
|
|
|
354
395
|
```typescript
|
|
355
396
|
const gate = new GateClient({
|
|
356
|
-
baseUrl: 'https://gate.blockintelai.
|
|
397
|
+
baseUrl: 'https://gate.blockintelai.com', // Hot Path URL
|
|
357
398
|
tenantId: 'your-tenant-id',
|
|
358
399
|
auth: { mode: 'hmac', ... },
|
|
359
400
|
// Heartbeat manager uses baseUrl to infer Control Plane URL
|
|
360
401
|
// Or explicitly set controlPlaneUrl if different
|
|
361
|
-
controlPlaneUrl: 'https://control-plane.blockintelai.
|
|
402
|
+
controlPlaneUrl: 'https://control-plane.blockintelai.com', // Optional
|
|
362
403
|
signerId: 'my-signer-id', // Optional: signerId for heartbeat (if known upfront)
|
|
363
404
|
heartbeatRefreshIntervalSeconds: 10, // Optional: heartbeat refresh interval (default: 10s)
|
|
364
405
|
});
|
|
@@ -455,13 +496,22 @@ See [examples](./examples) directory for complete examples:
|
|
|
455
496
|
|
|
456
497
|
See [PUBLISHING.md](./PUBLISHING.md) for detailed publishing instructions.
|
|
457
498
|
|
|
499
|
+
**Quick steps:**
|
|
500
|
+
1. Update version in `package.json`
|
|
501
|
+
2. Create GitHub release tag
|
|
502
|
+
3. GitHub Actions publishes to NPM automatically
|
|
503
|
+
|
|
458
504
|
## License
|
|
459
505
|
|
|
460
506
|
MIT License - see [LICENSE](./LICENSE) file.
|
|
461
507
|
|
|
462
508
|
## Support
|
|
463
509
|
|
|
464
|
-
- **Documentation:** https://docs.
|
|
510
|
+
- **Documentation:** https://docs.blockintelai.com
|
|
465
511
|
- **Issues:** https://github.com/4KInc/blockintel-ai/issues
|
|
466
|
-
- **Email:** support@
|
|
512
|
+
- **Email:** support@blockintelai.com
|
|
513
|
+
|
|
514
|
+
## Keywords
|
|
515
|
+
|
|
516
|
+
blockintel, gate, sdk, defense, crypto, security, transaction, evaluation
|
|
467
517
|
|
package/dist/index.cjs
CHANGED
|
@@ -1321,7 +1321,7 @@ var IamPermissionRiskChecker = class {
|
|
|
1321
1321
|
riskType: "AWS_CREDENTIALS_DETECTED",
|
|
1322
1322
|
confidence: "MEDIUM",
|
|
1323
1323
|
details: "AWS credentials detected in environment. Application may have direct KMS signing permissions.",
|
|
1324
|
-
remediation: "Remove kms:Sign permission from application role. See https://docs.
|
|
1324
|
+
remediation: "Remove kms:Sign permission from application role. See https://docs.blockintelai.com/gate/IAM_HARDENING"
|
|
1325
1325
|
};
|
|
1326
1326
|
}
|
|
1327
1327
|
return {
|
|
@@ -1375,7 +1375,7 @@ var IamPermissionRiskChecker = class {
|
|
|
1375
1375
|
riskType: "DIRECT_KMS_SIGN_PERMISSION",
|
|
1376
1376
|
confidence: "HIGH",
|
|
1377
1377
|
details: `IAM simulation confirms principal ${principalArn} has kms:Sign permission. Direct KMS signing can bypass Gate.`,
|
|
1378
|
-
remediation: "Remove kms:Sign permission from application role. See https://docs.
|
|
1378
|
+
remediation: "Remove kms:Sign permission from application role. See https://docs.blockintelai.com/gate/IAM_HARDENING"
|
|
1379
1379
|
};
|
|
1380
1380
|
}
|
|
1381
1381
|
return {
|
|
@@ -1469,7 +1469,7 @@ var IamPermissionRiskChecker = class {
|
|
|
1469
1469
|
if (result.remediation) {
|
|
1470
1470
|
parts.push(` - Remediation: ${result.remediation}`);
|
|
1471
1471
|
}
|
|
1472
|
-
parts.push(" - See: https://docs.
|
|
1472
|
+
parts.push(" - See: https://docs.blockintelai.com/gate/IAM_HARDENING");
|
|
1473
1473
|
parts.push(` - Override: Set allowInsecureKmsSignPermission=true (not recommended for production)`);
|
|
1474
1474
|
return parts.join("\n");
|
|
1475
1475
|
}
|
|
@@ -1488,7 +1488,7 @@ var IamPermissionRiskChecker = class {
|
|
|
1488
1488
|
confidence: result.confidence,
|
|
1489
1489
|
details: result.details,
|
|
1490
1490
|
remediation: result.remediation,
|
|
1491
|
-
documentation: "https://docs.
|
|
1491
|
+
documentation: "https://docs.blockintelai.com/gate/IAM_HARDENING"
|
|
1492
1492
|
};
|
|
1493
1493
|
console.warn("[GATE WARNING]", JSON.stringify(logData, null, 2));
|
|
1494
1494
|
}
|