kontext-sdk 0.11.0 → 0.11.1
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.mts +101 -309
- package/dist/index.d.ts +101 -309
- package/dist/index.js +210 -722
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +209 -720
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -452,12 +452,6 @@ interface KontextConfig {
|
|
|
452
452
|
* - 'both': pre-send screening + post-send full verify
|
|
453
453
|
*/
|
|
454
454
|
interceptorMode?: 'post-send' | 'pre-send' | 'both';
|
|
455
|
-
/**
|
|
456
|
-
* Wallet provider configuration. When provided, SDK initializes the
|
|
457
|
-
* corresponding wallet manager (Circle, Coinbase, or MetaMask) for
|
|
458
|
-
* compliance-wrapped wallet operations.
|
|
459
|
-
*/
|
|
460
|
-
walletProvider?: WalletProviderConfig;
|
|
461
455
|
}
|
|
462
456
|
/** Screening configuration for pluggable multi-provider sanctions screening */
|
|
463
457
|
interface ScreeningConfig {
|
|
@@ -506,141 +500,6 @@ interface WalletMonitoringConfig {
|
|
|
506
500
|
/** Polling interval in ms for HTTP transports (default: 12000) */
|
|
507
501
|
pollingIntervalMs?: number;
|
|
508
502
|
}
|
|
509
|
-
type WalletProviderType = 'none' | 'circle' | 'coinbase' | 'metamask';
|
|
510
|
-
type WalletProviderConfig = WalletProviderNone | WalletProviderCircle | WalletProviderCoinbase | WalletProviderMetaMask;
|
|
511
|
-
interface WalletProviderNone {
|
|
512
|
-
type: 'none';
|
|
513
|
-
}
|
|
514
|
-
interface WalletProviderCircle {
|
|
515
|
-
type: 'circle';
|
|
516
|
-
apiKeyEnvVar: string;
|
|
517
|
-
entitySecretEnvVar: string;
|
|
518
|
-
circleEnvironment: 'sandbox' | 'production';
|
|
519
|
-
walletSetName?: string;
|
|
520
|
-
secretsStorage: SecretsStorageConfig;
|
|
521
|
-
}
|
|
522
|
-
interface WalletProviderCoinbase {
|
|
523
|
-
type: 'coinbase';
|
|
524
|
-
apiKeyIdEnvVar: string;
|
|
525
|
-
apiKeySecretEnvVar: string;
|
|
526
|
-
walletSecretEnvVar: string;
|
|
527
|
-
cdpEnvironment: 'testnet' | 'mainnet';
|
|
528
|
-
secretsStorage: SecretsStorageConfig;
|
|
529
|
-
}
|
|
530
|
-
interface WalletProviderMetaMask {
|
|
531
|
-
type: 'metamask';
|
|
532
|
-
clientIdEnvVar: string;
|
|
533
|
-
authConnectionId: string;
|
|
534
|
-
web3AuthNetwork: 'sapphire_mainnet' | 'sapphire_devnet';
|
|
535
|
-
secretsStorage: SecretsStorageConfig;
|
|
536
|
-
}
|
|
537
|
-
type SecretsStorageConfig = {
|
|
538
|
-
type: 'dotenv';
|
|
539
|
-
path: string;
|
|
540
|
-
} | {
|
|
541
|
-
type: 'file';
|
|
542
|
-
path: string;
|
|
543
|
-
} | {
|
|
544
|
-
type: 'gcp-secret-manager';
|
|
545
|
-
project: string;
|
|
546
|
-
} | {
|
|
547
|
-
type: 'aws-secrets-manager';
|
|
548
|
-
region: string;
|
|
549
|
-
} | {
|
|
550
|
-
type: 'hashicorp-vault';
|
|
551
|
-
address: string;
|
|
552
|
-
};
|
|
553
|
-
interface CircleWalletConfig {
|
|
554
|
-
apiKey: string;
|
|
555
|
-
entitySecret: string;
|
|
556
|
-
baseUrl?: string;
|
|
557
|
-
}
|
|
558
|
-
interface CreateWalletSetInput {
|
|
559
|
-
name: string;
|
|
560
|
-
idempotencyKey?: string;
|
|
561
|
-
}
|
|
562
|
-
interface CircleWalletSet {
|
|
563
|
-
id: string;
|
|
564
|
-
name: string;
|
|
565
|
-
custodyType: string;
|
|
566
|
-
createDate: string;
|
|
567
|
-
updateDate: string;
|
|
568
|
-
}
|
|
569
|
-
interface CreateWalletInput {
|
|
570
|
-
walletSetId: string;
|
|
571
|
-
blockchains: Chain[];
|
|
572
|
-
count?: number;
|
|
573
|
-
accountType?: 'EOA' | 'SCA';
|
|
574
|
-
idempotencyKey?: string;
|
|
575
|
-
}
|
|
576
|
-
interface CircleWallet {
|
|
577
|
-
id: string;
|
|
578
|
-
state: string;
|
|
579
|
-
address: string;
|
|
580
|
-
blockchain: string;
|
|
581
|
-
walletSetId: string;
|
|
582
|
-
createDate: string;
|
|
583
|
-
}
|
|
584
|
-
interface CircleTransferInput {
|
|
585
|
-
walletId: string;
|
|
586
|
-
tokenAddress: string;
|
|
587
|
-
destinationAddress: string;
|
|
588
|
-
amount: string;
|
|
589
|
-
blockchain: Chain;
|
|
590
|
-
agentId?: string;
|
|
591
|
-
idempotencyKey?: string;
|
|
592
|
-
}
|
|
593
|
-
interface CircleTransferResult {
|
|
594
|
-
id: string;
|
|
595
|
-
state: string;
|
|
596
|
-
txHash?: string;
|
|
597
|
-
complianceResult?: VerifyResult;
|
|
598
|
-
}
|
|
599
|
-
interface CoinbaseWalletConfig {
|
|
600
|
-
apiKeyId: string;
|
|
601
|
-
apiKeySecret: string;
|
|
602
|
-
walletSecret: string;
|
|
603
|
-
}
|
|
604
|
-
interface CoinbaseAccount {
|
|
605
|
-
address: string;
|
|
606
|
-
name?: string;
|
|
607
|
-
network: string;
|
|
608
|
-
}
|
|
609
|
-
interface CoinbaseTransferInput {
|
|
610
|
-
fromAddress: string;
|
|
611
|
-
toAddress: string;
|
|
612
|
-
amount: string;
|
|
613
|
-
token: Token;
|
|
614
|
-
network: string;
|
|
615
|
-
agentId?: string;
|
|
616
|
-
}
|
|
617
|
-
interface CoinbaseTransferResult {
|
|
618
|
-
transactionHash: string;
|
|
619
|
-
status: string;
|
|
620
|
-
complianceResult?: VerifyResult;
|
|
621
|
-
}
|
|
622
|
-
interface MetaMaskWalletConfig {
|
|
623
|
-
clientId: string;
|
|
624
|
-
authConnectionId: string;
|
|
625
|
-
web3AuthNetwork: 'sapphire_mainnet' | 'sapphire_devnet';
|
|
626
|
-
}
|
|
627
|
-
interface MetaMaskAccount {
|
|
628
|
-
address: string;
|
|
629
|
-
publicKey: string;
|
|
630
|
-
}
|
|
631
|
-
interface MetaMaskTransferInput {
|
|
632
|
-
toAddress: string;
|
|
633
|
-
amount: string;
|
|
634
|
-
token: Token;
|
|
635
|
-
chain: Chain;
|
|
636
|
-
agentId?: string;
|
|
637
|
-
idToken: string;
|
|
638
|
-
}
|
|
639
|
-
interface MetaMaskTransferResult {
|
|
640
|
-
transactionHash: string;
|
|
641
|
-
status: string;
|
|
642
|
-
complianceResult?: VerifyResult;
|
|
643
|
-
}
|
|
644
503
|
/**
|
|
645
504
|
* Interface for metadata validation. Compatible with Zod schemas and any
|
|
646
505
|
* validator that implements a `parse` method.
|
|
@@ -1122,6 +981,8 @@ interface VerifyResult {
|
|
|
1122
981
|
task?: Task;
|
|
1123
982
|
/** ERC-8021 builder attribution (present when erc8021 config provided and tx has attribution) */
|
|
1124
983
|
attribution?: ERC8021Attribution;
|
|
984
|
+
/** Coverage warning when using built-in screening only (no external providers configured) */
|
|
985
|
+
coverageWarning?: string;
|
|
1125
986
|
}
|
|
1126
987
|
/**
|
|
1127
988
|
* Input for logging an agent's reasoning/decision step.
|
|
@@ -2551,9 +2412,6 @@ declare class Kontext {
|
|
|
2551
2412
|
private behavioralFingerprinter;
|
|
2552
2413
|
private crossSessionLinker;
|
|
2553
2414
|
private confidenceScorer;
|
|
2554
|
-
private circleWalletManager;
|
|
2555
|
-
private coinbaseWalletManager;
|
|
2556
|
-
private metamaskWalletManager;
|
|
2557
2415
|
private constructor();
|
|
2558
2416
|
/**
|
|
2559
2417
|
* Initialize the Kontext SDK.
|
|
@@ -2618,12 +2476,6 @@ declare class Kontext {
|
|
|
2618
2476
|
private getCrossSessionLinker;
|
|
2619
2477
|
/** Lazy-init KYAConfidenceScorer on first use. */
|
|
2620
2478
|
private getConfidenceScorer;
|
|
2621
|
-
/** Lazy-init CircleWalletManager from config.walletProvider */
|
|
2622
|
-
private getCircleManager;
|
|
2623
|
-
/** Lazy-init CoinbaseWalletManager from config.walletProvider */
|
|
2624
|
-
private getCoinbaseManager;
|
|
2625
|
-
/** Lazy-init MetaMaskWalletManager from config.walletProvider */
|
|
2626
|
-
private getMetaMaskManager;
|
|
2627
2479
|
/**
|
|
2628
2480
|
* Log a generic agent action.
|
|
2629
2481
|
*
|
|
@@ -3079,25 +2931,6 @@ declare class Kontext {
|
|
|
3079
2931
|
* Get the underlying FeatureFlagManager (or null if not configured).
|
|
3080
2932
|
*/
|
|
3081
2933
|
getFeatureFlagManager(): FeatureFlagManager | null;
|
|
3082
|
-
/** Create a Circle wallet set. Enterprise plan required. */
|
|
3083
|
-
createCircleWalletSet(input: CreateWalletSetInput): Promise<CircleWalletSet>;
|
|
3084
|
-
/** Create Circle wallet(s) in a wallet set. Enterprise plan required. */
|
|
3085
|
-
createCircleWallet(input: CreateWalletInput): Promise<CircleWallet[]>;
|
|
3086
|
-
/** Transfer via Circle with auto-compliance. Enterprise plan required. */
|
|
3087
|
-
circleTransferWithCompliance(input: CircleTransferInput): Promise<CircleTransferResult>;
|
|
3088
|
-
/** Create a Coinbase CDP account. Enterprise plan required. */
|
|
3089
|
-
createCoinbaseAccount(opts?: {
|
|
3090
|
-
name?: string;
|
|
3091
|
-
network?: string;
|
|
3092
|
-
}): Promise<CoinbaseAccount>;
|
|
3093
|
-
/** List Coinbase CDP accounts. Enterprise plan required. */
|
|
3094
|
-
listCoinbaseAccounts(): Promise<CoinbaseAccount[]>;
|
|
3095
|
-
/** Transfer via Coinbase CDP with auto-compliance. Enterprise plan required. */
|
|
3096
|
-
coinbaseTransferWithCompliance(input: CoinbaseTransferInput): Promise<CoinbaseTransferResult>;
|
|
3097
|
-
/** Connect to MetaMask Embedded Wallet for a user. Enterprise plan required. */
|
|
3098
|
-
metamaskConnect(idToken: string): Promise<MetaMaskAccount>;
|
|
3099
|
-
/** Transfer via MetaMask with auto-compliance. Enterprise plan required. */
|
|
3100
|
-
metamaskTransferWithCompliance(input: MetaMaskTransferInput): Promise<MetaMaskTransferResult>;
|
|
3101
2934
|
/**
|
|
3102
2935
|
* Get the wallet monitor instance (or null if not configured).
|
|
3103
2936
|
* Used by the viem interceptor for dedup registration.
|
|
@@ -3110,7 +2943,7 @@ declare class Kontext {
|
|
|
3110
2943
|
}
|
|
3111
2944
|
|
|
3112
2945
|
/** Features gated by plan tier */
|
|
3113
|
-
type GatedFeature = 'advanced-anomaly-rules' | 'sar-ctr-reports' | 'webhooks' | 'ofac-screening' | 'csv-export' | 'multi-chain' | 'cftc-compliance' | 'circle-wallets' | 'circle-compliance' | 'gas-station' | 'cctp-transfers' | 'approval-policies' | 'unified-screening' | 'blocklist-manager' | 'kya-identity' | 'kya-behavioral'
|
|
2946
|
+
type GatedFeature = 'advanced-anomaly-rules' | 'sar-ctr-reports' | 'webhooks' | 'ofac-screening' | 'csv-export' | 'multi-chain' | 'cftc-compliance' | 'circle-wallets' | 'circle-compliance' | 'gas-station' | 'cctp-transfers' | 'approval-policies' | 'unified-screening' | 'blocklist-manager' | 'kya-identity' | 'kya-behavioral';
|
|
3114
2947
|
/**
|
|
3115
2948
|
* Check if a feature is available on the given plan.
|
|
3116
2949
|
* Returns true if allowed, false if not.
|
|
@@ -4018,6 +3851,103 @@ declare class ChainalysisOracleProvider implements ScreeningProvider {
|
|
|
4018
3851
|
private errorResult;
|
|
4019
3852
|
}
|
|
4020
3853
|
|
|
3854
|
+
interface KontextCloudScreeningConfig {
|
|
3855
|
+
/** Kontext API key (not a third-party key) */
|
|
3856
|
+
apiKey: string;
|
|
3857
|
+
/** Kontext project ID */
|
|
3858
|
+
projectId: string;
|
|
3859
|
+
/** API base URL (default: https://api.getkontext.com) */
|
|
3860
|
+
apiUrl?: string;
|
|
3861
|
+
/** Fuzzy match threshold for entity names (default: 0.85) */
|
|
3862
|
+
threshold?: number;
|
|
3863
|
+
/** Max entity results (default: 5) */
|
|
3864
|
+
maxResults?: number;
|
|
3865
|
+
}
|
|
3866
|
+
/**
|
|
3867
|
+
* Kontext Cloud Screening Provider.
|
|
3868
|
+
*
|
|
3869
|
+
* Screens addresses and entity names against Kontext's pre-cached
|
|
3870
|
+
* government sanctions data. Covers OFAC SDN (~69K entities, ~1,245
|
|
3871
|
+
* crypto addresses), UK Sanctions List (~12K entities), and EU FSF
|
|
3872
|
+
* (~14K entities).
|
|
3873
|
+
*
|
|
3874
|
+
* - **Pay-as-you-go**, requires Kontext API key
|
|
3875
|
+
* - **Browser-compatible** — all HTTP
|
|
3876
|
+
* - Supports address + entity name queries
|
|
3877
|
+
*
|
|
3878
|
+
* @example
|
|
3879
|
+
* ```typescript
|
|
3880
|
+
* const provider = new KontextCloudScreeningProvider({
|
|
3881
|
+
* apiKey: 'sk_live_...',
|
|
3882
|
+
* projectId: 'my-project',
|
|
3883
|
+
* });
|
|
3884
|
+
*
|
|
3885
|
+
* // Address lookup (O(1) sub-ms on server)
|
|
3886
|
+
* const result = await provider.screen('0x1234...');
|
|
3887
|
+
*
|
|
3888
|
+
* // Entity name search (fuzzy, 1-5ms on server)
|
|
3889
|
+
* const result = await provider.screen('Lazarus Group');
|
|
3890
|
+
* ```
|
|
3891
|
+
*/
|
|
3892
|
+
declare class KontextCloudScreeningProvider implements ScreeningProvider {
|
|
3893
|
+
readonly id = "kontext-cloud";
|
|
3894
|
+
readonly name = "Kontext Cloud Screening";
|
|
3895
|
+
readonly lists: readonly SanctionsList[];
|
|
3896
|
+
readonly requiresApiKey = true;
|
|
3897
|
+
readonly browserCompatible = true;
|
|
3898
|
+
readonly queryTypes: readonly QueryType[];
|
|
3899
|
+
private readonly apiKey;
|
|
3900
|
+
private readonly projectId;
|
|
3901
|
+
private readonly apiUrl;
|
|
3902
|
+
private readonly threshold;
|
|
3903
|
+
private readonly maxResults;
|
|
3904
|
+
constructor(config: KontextCloudScreeningConfig);
|
|
3905
|
+
isAvailable(): boolean;
|
|
3906
|
+
screen(query: string, _context?: ScreeningContext): Promise<ScreeningResult>;
|
|
3907
|
+
private screenAddress;
|
|
3908
|
+
private screenEntity;
|
|
3909
|
+
private errorResult;
|
|
3910
|
+
}
|
|
3911
|
+
|
|
3912
|
+
interface TRMLabsConfig {
|
|
3913
|
+
/** TRM Labs API key */
|
|
3914
|
+
apiKey: string;
|
|
3915
|
+
/** API base URL (default: https://api.trmlabs.com/public/v2) */
|
|
3916
|
+
baseUrl?: string;
|
|
3917
|
+
}
|
|
3918
|
+
/**
|
|
3919
|
+
* TRM Labs Sanctions Screening Provider.
|
|
3920
|
+
*
|
|
3921
|
+
* Screens blockchain addresses via the TRM Labs free sanctions API.
|
|
3922
|
+
* Covers 25 blockchains with cross-chain detection. Address-only —
|
|
3923
|
+
* does not support entity name screening.
|
|
3924
|
+
*
|
|
3925
|
+
* - **Free** — 100K req/day with API key
|
|
3926
|
+
* - **Browser-compatible** — simple REST API
|
|
3927
|
+
*
|
|
3928
|
+
* @example
|
|
3929
|
+
* ```typescript
|
|
3930
|
+
* const provider = new TRMLabsProvider({
|
|
3931
|
+
* apiKey: process.env.TRM_API_KEY!,
|
|
3932
|
+
* });
|
|
3933
|
+
* const result = await provider.screen('0x098B716B8Aaf21512996dC57EB0615e2383E2f96');
|
|
3934
|
+
* ```
|
|
3935
|
+
*/
|
|
3936
|
+
declare class TRMLabsProvider implements ScreeningProvider {
|
|
3937
|
+
readonly id = "trm-labs";
|
|
3938
|
+
readonly name = "TRM Labs Sanctions Screening";
|
|
3939
|
+
readonly lists: readonly SanctionsList[];
|
|
3940
|
+
readonly requiresApiKey = true;
|
|
3941
|
+
readonly browserCompatible = true;
|
|
3942
|
+
readonly queryTypes: readonly QueryType[];
|
|
3943
|
+
private readonly apiKey;
|
|
3944
|
+
private readonly baseUrl;
|
|
3945
|
+
constructor(config: TRMLabsConfig);
|
|
3946
|
+
isAvailable(): boolean;
|
|
3947
|
+
screen(query: string, _context?: ScreeningContext): Promise<ScreeningResult>;
|
|
3948
|
+
private errorResult;
|
|
3949
|
+
}
|
|
3950
|
+
|
|
4021
3951
|
type ConsensusStrategy = 'ANY_MATCH' | 'ALL_MATCH' | 'MAJORITY';
|
|
4022
3952
|
interface ScreeningAggregatorConfig {
|
|
4023
3953
|
providers: ScreeningProvider[];
|
|
@@ -4196,7 +4126,6 @@ interface KontextConfigFile {
|
|
|
4196
4126
|
ctrAmount?: string;
|
|
4197
4127
|
};
|
|
4198
4128
|
apiKey?: string;
|
|
4199
|
-
walletProvider?: WalletProviderConfig;
|
|
4200
4129
|
}
|
|
4201
4130
|
/**
|
|
4202
4131
|
* Discover and load kontext.config.json by walking up from startDir.
|
|
@@ -4204,141 +4133,4 @@ interface KontextConfigFile {
|
|
|
4204
4133
|
*/
|
|
4205
4134
|
declare function loadConfigFile(startDir?: string): KontextConfigFile | null;
|
|
4206
4135
|
|
|
4207
|
-
|
|
4208
|
-
* CircleWalletManager wraps Circle Programmable Wallets (developer-controlled)
|
|
4209
|
-
* with automatic compliance logging via Kontext.
|
|
4210
|
-
*
|
|
4211
|
-
* Enterprise plan-gated — plan checks enforced at the Kontext client level.
|
|
4212
|
-
*/
|
|
4213
|
-
declare class CircleWalletManager {
|
|
4214
|
-
private readonly apiKey;
|
|
4215
|
-
private readonly entitySecret;
|
|
4216
|
-
private readonly baseUrl;
|
|
4217
|
-
private kontext;
|
|
4218
|
-
constructor(config: CircleWalletConfig);
|
|
4219
|
-
/** Link to Kontext instance for auto-compliance logging */
|
|
4220
|
-
setKontext(kontext: any): void;
|
|
4221
|
-
/** Validate credentials by calling Circle's configuration endpoint */
|
|
4222
|
-
validateCredentials(): Promise<boolean>;
|
|
4223
|
-
/** Create a wallet set (container for wallets) */
|
|
4224
|
-
createWalletSet(input: CreateWalletSetInput): Promise<CircleWalletSet>;
|
|
4225
|
-
/** Create wallet(s) in a wallet set */
|
|
4226
|
-
createWallet(input: CreateWalletInput): Promise<CircleWallet[]>;
|
|
4227
|
-
/** List wallets, optionally filtered by wallet set */
|
|
4228
|
-
listWallets(walletSetId?: string): Promise<CircleWallet[]>;
|
|
4229
|
-
/** Get wallet token balances */
|
|
4230
|
-
getBalance(walletId: string): Promise<{
|
|
4231
|
-
token: string;
|
|
4232
|
-
amount: string;
|
|
4233
|
-
}[]>;
|
|
4234
|
-
/** Transfer with auto-compliance: runs verify() before/after transfer */
|
|
4235
|
-
transferWithCompliance(input: CircleTransferInput): Promise<CircleTransferResult>;
|
|
4236
|
-
private headers;
|
|
4237
|
-
private request;
|
|
4238
|
-
private mapChain;
|
|
4239
|
-
}
|
|
4240
|
-
|
|
4241
|
-
/**
|
|
4242
|
-
* CoinbaseWalletManager wraps Coinbase Developer Platform (CDP) server wallets
|
|
4243
|
-
* with automatic compliance logging via Kontext.
|
|
4244
|
-
*
|
|
4245
|
-
* Enterprise plan-gated — plan checks enforced at the Kontext client level.
|
|
4246
|
-
*
|
|
4247
|
-
* Auth model:
|
|
4248
|
-
* - API requests: JWT Bearer token signed with apiKeySecret (Ed25519), 120s expiry
|
|
4249
|
-
* - Wallet operations: X-Wallet-Auth header (JWT signed with walletSecret, 60s expiry)
|
|
4250
|
-
*/
|
|
4251
|
-
declare class CoinbaseWalletManager {
|
|
4252
|
-
private readonly apiKeyId;
|
|
4253
|
-
private readonly apiKeySecret;
|
|
4254
|
-
private readonly walletSecret;
|
|
4255
|
-
private readonly baseUrl;
|
|
4256
|
-
private kontext;
|
|
4257
|
-
constructor(config: CoinbaseWalletConfig);
|
|
4258
|
-
/** Link to Kontext instance for auto-compliance logging */
|
|
4259
|
-
setKontext(kontext: any): void;
|
|
4260
|
-
/** Validate credentials by listing accounts */
|
|
4261
|
-
validateCredentials(): Promise<boolean>;
|
|
4262
|
-
/** Create an EVM account */
|
|
4263
|
-
createAccount(opts?: {
|
|
4264
|
-
name?: string;
|
|
4265
|
-
network?: string;
|
|
4266
|
-
}): Promise<CoinbaseAccount>;
|
|
4267
|
-
/** List accounts */
|
|
4268
|
-
listAccounts(): Promise<CoinbaseAccount[]>;
|
|
4269
|
-
/** Get token balances for an address */
|
|
4270
|
-
getBalances(address: string, network: string): Promise<{
|
|
4271
|
-
token: string;
|
|
4272
|
-
amount: string;
|
|
4273
|
-
}[]>;
|
|
4274
|
-
/** Transfer with auto-compliance: runs verify() before/after transfer */
|
|
4275
|
-
transferWithCompliance(input: CoinbaseTransferInput): Promise<CoinbaseTransferResult>;
|
|
4276
|
-
/**
|
|
4277
|
-
* Build auth headers. CDP uses JWT Bearer tokens:
|
|
4278
|
-
* - API auth: signed with apiKeySecret, apiKeyId as kid, 120s expiry
|
|
4279
|
-
* - Wallet auth: X-Wallet-Auth header signed with walletSecret, 60s expiry
|
|
4280
|
-
*
|
|
4281
|
-
* Note: Full Ed25519 JWT signing requires the jose or crypto module.
|
|
4282
|
-
* This implementation provides the header structure; production use
|
|
4283
|
-
* should integrate with @coinbase/cdp-sdk for proper JWT signing.
|
|
4284
|
-
*/
|
|
4285
|
-
private headers;
|
|
4286
|
-
/**
|
|
4287
|
-
* Build a minimal JWT structure. In production, this should use Ed25519
|
|
4288
|
-
* signing via the crypto module or jose library. Here we build the
|
|
4289
|
-
* structure that CDP expects.
|
|
4290
|
-
*/
|
|
4291
|
-
private buildJwt;
|
|
4292
|
-
private request;
|
|
4293
|
-
private mapNetwork;
|
|
4294
|
-
}
|
|
4295
|
-
|
|
4296
|
-
/**
|
|
4297
|
-
* MetaMaskWalletManager wraps MetaMask Embedded Wallets (via Web3Auth Node SDK)
|
|
4298
|
-
* with automatic compliance logging via Kontext.
|
|
4299
|
-
*
|
|
4300
|
-
* Enterprise plan-gated — plan checks enforced at the Kontext client level.
|
|
4301
|
-
*
|
|
4302
|
-
* Requirements:
|
|
4303
|
-
* - `@web3auth/node-sdk` must be installed as a peer dependency
|
|
4304
|
-
* - Stateless: each connect() call is independent (no session state)
|
|
4305
|
-
* - Infura RPC access is pre-integrated (no separate key needed)
|
|
4306
|
-
*/
|
|
4307
|
-
declare class MetaMaskWalletManager {
|
|
4308
|
-
private readonly clientId;
|
|
4309
|
-
private readonly authConnectionId;
|
|
4310
|
-
private readonly web3AuthNetwork;
|
|
4311
|
-
private kontext;
|
|
4312
|
-
constructor(config: MetaMaskWalletConfig);
|
|
4313
|
-
/** Link to Kontext instance for auto-compliance logging */
|
|
4314
|
-
setKontext(kontext: any): void;
|
|
4315
|
-
/**
|
|
4316
|
-
* Validate credentials by attempting to initialize Web3Auth.
|
|
4317
|
-
* Returns false if @web3auth/node-sdk is not installed.
|
|
4318
|
-
*/
|
|
4319
|
-
validateCredentials(): Promise<boolean>;
|
|
4320
|
-
/**
|
|
4321
|
-
* Connect and get account for a user.
|
|
4322
|
-
* Requires a JWT idToken for custom auth via authConnectionId.
|
|
4323
|
-
*/
|
|
4324
|
-
connect(idToken: string): Promise<MetaMaskAccount>;
|
|
4325
|
-
/**
|
|
4326
|
-
* Get the private key for an authenticated user.
|
|
4327
|
-
* Use with caution — only for signing transactions server-side.
|
|
4328
|
-
*/
|
|
4329
|
-
getPrivateKey(idToken: string): Promise<string>;
|
|
4330
|
-
/** Transfer with auto-compliance: runs verify() before/after transfer */
|
|
4331
|
-
transferWithCompliance(input: MetaMaskTransferInput): Promise<MetaMaskTransferResult>;
|
|
4332
|
-
/**
|
|
4333
|
-
* Dynamically import @web3auth/node-sdk. Returns null if not installed.
|
|
4334
|
-
*/
|
|
4335
|
-
private loadWeb3Auth;
|
|
4336
|
-
/**
|
|
4337
|
-
* Require @web3auth/node-sdk — throws if not installed.
|
|
4338
|
-
*/
|
|
4339
|
-
private requireWeb3Auth;
|
|
4340
|
-
private getAccounts;
|
|
4341
|
-
private requestPrivateKey;
|
|
4342
|
-
}
|
|
4343
|
-
|
|
4344
|
-
export { type ActionLog, type AgentCard, type AgentData, type AgentIdentity, AgentIdentityRegistry, type AgentLink, type AgentSession, type AggregatedScreeningResult, type AnchorResult, type AnchorVerification, type AnomalyCallback, type AnomalyDetectionConfig, AnomalyDetector, type AnomalyEvent, type AnomalyRuleType, type AnomalySeverity, type AnomalyThresholds, type AttestationDecision, type AttestationPayload, type AttestationRequest, type AttestationResponse, type AttestationSignature, type BehavioralEmbedding, BehavioralFingerprinter, CHAIN_ID_MAP, CURRENCY_REQUIRED_LISTS, type Chain, ChainalysisFreeAPIProvider, ChainalysisOracleProvider, type CheckpointStatus, type CircleTransferInput, type CircleTransferResult, type CircleWallet, type CircleWalletConfig, CircleWalletManager, type CircleWalletSet, type ClusteringEvidence, type ClusteringHeuristic, type CoinbaseAccount, type CoinbaseTransferInput, type CoinbaseTransferResult, type CoinbaseWalletConfig, CoinbaseWalletManager, type ComplianceCertificate, type ComplianceCheckResult, type ComplianceReport, type ConfirmTaskInput, type ConsensusStrategy, ConsoleExporter, type CounterpartyAttestation, type CounterpartyConfig, type CreateCheckpointInput, type CreateSessionInput, type CreateTaskInput, type CreateWalletInput, type CreateWalletSetInput, CrossSessionLinker, type CrossSessionLinkerConfig, type DateRange, DigestChain, type DigestLink, type DigestVerification, type ERC8021Attribution, type ERC8021Config, type EntityStatus, type EntityType, type Environment, type EventExporter, type ExportFormat, type ExportOptions, type ExportResult, type ExporterResult, type FeatureFlag, type FeatureFlagConfig, FeatureFlagManager, FileStorage, type FinancialFeatures, type FlagPlanTargeting, type FlagScope, type FlagTargeting, type GatedFeature, type GenerateComplianceCertificateInput, type HumanAttestation, JsonFileExporter, type Jurisdiction, KONTEXT_BUILDER_CODE, type KYAConfidenceLevel, type KYAConfidenceScore, KYAConfidenceScorer, type KYAConfidenceScorerConfig, type KYAEnvelope, type KYAScoreComponent, type KYCProviderReference, type KYCStatus, Kontext, type KontextConfig, KontextError, KontextErrorCode, type KontextMode, type LimitEvent, type LinkSignal, type LinkStatus, type LogActionInput, type LogLevel, type LogReasoningInput, type LogTransactionInput, type MatchType, MemoryStorage, type MetaMaskAccount, type MetaMaskTransferInput, type MetaMaskTransferResult, type MetaMaskWalletConfig, MetaMaskWalletManager, type MetadataValidator, type NetworkFeatures, NoopExporter, OFACAddressProvider, OFACEntityProvider, type OnChainAnchorConfig, OnChainExporter, OpenSanctionsLocalProvider, OpenSanctionsProvider, type OperationalFeatures, PLAN_LIMITS, PaymentCompliance, type PlanConfig, PlanManager, type PlanTier, type PlanUsage, type PolicyConfig, type PrecisionTimestamp, type ProvenanceAction, type ProvenanceAttestor, type ProvenanceBundle, type ProvenanceBundleVerification, type ProvenanceCheckpoint, ProvenanceManager, type QueryType, type ReasoningEntry, type RegisterIdentityInput, type ReportOptions, type ReportType, type RiskFactor, STABLECOIN_CONTRACTS, type SanctionsCheckResult, type SanctionsList, ScreeningAggregator, type ScreeningAggregatorConfig, type ScreeningConfig, type ScreeningContext, type ScreeningMatch, type ScreeningProvider, type ScreeningResult, type SecretsStorageConfig, type SessionConstraints, type SessionStatus, type StorageAdapter, TOKEN_REQUIRED_LISTS, type Task, type TaskEvidence, type TaskStatus, type TemporalFeatures, type Token, type TransactionEvaluation, type TransactionRecord, type TrustFactor, type TrustScore, TrustScorer, UKOFSIProvider, type UpdateIdentityInput, UsdcCompliance, type UsdcComplianceCheck, type VerificationKey, type VerifyInput, type VerifyResult, ViemComplianceError, type ViemInstrumentationOptions, type WalletClientLike, type WalletCluster, WalletClusterer, type WalletClusteringConfig, type WalletMapping, WalletMonitor, type WalletMonitoringConfig, type WalletProviderCircle, type WalletProviderCoinbase, type WalletProviderConfig, type WalletProviderMetaMask, type WalletProviderNone, type WalletProviderType, anchorDigest, encodeERC8021Suffix, exchangeAttestation, fetchAgentCard, fetchTransactionAttribution, getAnchor, getRequiredLists, isBlockchainAddress, isCryptoTransaction, isFeatureAvailable, loadConfigFile, parseERC8021Suffix, providerSupportsQuery, requirePlan, verifyAnchor, verifyExportedChain, withKontextCompliance };
|
|
4136
|
+
export { type ActionLog, type AgentCard, type AgentData, type AgentIdentity, AgentIdentityRegistry, type AgentLink, type AgentSession, type AggregatedScreeningResult, type AnchorResult, type AnchorVerification, type AnomalyCallback, type AnomalyDetectionConfig, AnomalyDetector, type AnomalyEvent, type AnomalyRuleType, type AnomalySeverity, type AnomalyThresholds, type AttestationDecision, type AttestationPayload, type AttestationRequest, type AttestationResponse, type AttestationSignature, type BehavioralEmbedding, BehavioralFingerprinter, CHAIN_ID_MAP, CURRENCY_REQUIRED_LISTS, type Chain, ChainalysisFreeAPIProvider, ChainalysisOracleProvider, type CheckpointStatus, type ClusteringEvidence, type ClusteringHeuristic, type ComplianceCertificate, type ComplianceCheckResult, type ComplianceReport, type ConfirmTaskInput, type ConsensusStrategy, ConsoleExporter, type CounterpartyAttestation, type CounterpartyConfig, type CreateCheckpointInput, type CreateSessionInput, type CreateTaskInput, CrossSessionLinker, type CrossSessionLinkerConfig, type DateRange, DigestChain, type DigestLink, type DigestVerification, type ERC8021Attribution, type ERC8021Config, type EntityStatus, type EntityType, type Environment, type EventExporter, type ExportFormat, type ExportOptions, type ExportResult, type ExporterResult, type FeatureFlag, type FeatureFlagConfig, FeatureFlagManager, FileStorage, type FinancialFeatures, type FlagPlanTargeting, type FlagScope, type FlagTargeting, type GatedFeature, type GenerateComplianceCertificateInput, type HumanAttestation, JsonFileExporter, type Jurisdiction, KONTEXT_BUILDER_CODE, type KYAConfidenceLevel, type KYAConfidenceScore, KYAConfidenceScorer, type KYAConfidenceScorerConfig, type KYAEnvelope, type KYAScoreComponent, type KYCProviderReference, type KYCStatus, Kontext, type KontextCloudScreeningConfig, KontextCloudScreeningProvider, type KontextConfig, KontextError, KontextErrorCode, type KontextMode, type LimitEvent, type LinkSignal, type LinkStatus, type LogActionInput, type LogLevel, type LogReasoningInput, type LogTransactionInput, type MatchType, MemoryStorage, type MetadataValidator, type NetworkFeatures, NoopExporter, OFACAddressProvider, OFACEntityProvider, type OnChainAnchorConfig, OnChainExporter, OpenSanctionsLocalProvider, OpenSanctionsProvider, type OperationalFeatures, PLAN_LIMITS, PaymentCompliance, type PlanConfig, PlanManager, type PlanTier, type PlanUsage, type PolicyConfig, type PrecisionTimestamp, type ProvenanceAction, type ProvenanceAttestor, type ProvenanceBundle, type ProvenanceBundleVerification, type ProvenanceCheckpoint, ProvenanceManager, type QueryType, type ReasoningEntry, type RegisterIdentityInput, type ReportOptions, type ReportType, type RiskFactor, STABLECOIN_CONTRACTS, type SanctionsCheckResult, type SanctionsList, ScreeningAggregator, type ScreeningAggregatorConfig, type ScreeningConfig, type ScreeningContext, type ScreeningMatch, type ScreeningProvider, type ScreeningResult, type SessionConstraints, type SessionStatus, type StorageAdapter, TOKEN_REQUIRED_LISTS, type TRMLabsConfig, TRMLabsProvider, type Task, type TaskEvidence, type TaskStatus, type TemporalFeatures, type Token, type TransactionEvaluation, type TransactionRecord, type TrustFactor, type TrustScore, TrustScorer, UKOFSIProvider, type UpdateIdentityInput, UsdcCompliance, type UsdcComplianceCheck, type VerificationKey, type VerifyInput, type VerifyResult, ViemComplianceError, type ViemInstrumentationOptions, type WalletClientLike, type WalletCluster, WalletClusterer, type WalletClusteringConfig, type WalletMapping, WalletMonitor, type WalletMonitoringConfig, anchorDigest, encodeERC8021Suffix, exchangeAttestation, fetchAgentCard, fetchTransactionAttribution, getAnchor, getRequiredLists, isBlockchainAddress, isCryptoTransaction, isFeatureAvailable, loadConfigFile, parseERC8021Suffix, providerSupportsQuery, requirePlan, verifyAnchor, verifyExportedChain, withKontextCompliance };
|