@proofchain/sdk 2.21.0 → 2.22.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/index.d.mts CHANGED
@@ -3526,12 +3526,6 @@ interface OTTRequestResponse {
3526
3526
  ott: string;
3527
3527
  expires_in: number;
3528
3528
  }
3529
- interface OTTRedeemResponse {
3530
- user_id: string;
3531
- session_timeout: number;
3532
- session_data: Record<string, unknown>;
3533
- jwt?: string;
3534
- }
3535
3529
  interface OTTConfigUpdate {
3536
3530
  ott_enabled?: boolean;
3537
3531
  ott_ttl_seconds?: number;
@@ -3555,12 +3549,6 @@ declare class PartnerKeysClient {
3555
3549
  * Request a one-time token for a partner key (end-user JWKS auth).
3556
3550
  */
3557
3551
  requestOTT(keyId: string): Promise<OTTRequestResponse>;
3558
- /**
3559
- * Redeem a one-time token (partner key auth).
3560
- */
3561
- redeemOTT(body: {
3562
- ott: string;
3563
- }): Promise<OTTRedeemResponse>;
3564
3552
  /**
3565
3553
  * Update OTT configuration for a partner key.
3566
3554
  */
@@ -3571,6 +3559,176 @@ declare class PartnerKeysClient {
3571
3559
  getOTTConfig(keyId: string): Promise<OTTConfigResponse>;
3572
3560
  }
3573
3561
 
3562
+ /**
3563
+ * Attestations API Client
3564
+ *
3565
+ * Manage on-chain and off-chain attestations — EIP-712 signed credentials
3566
+ * issued to users' smart wallet addresses.
3567
+ *
3568
+ * Includes public credential discovery endpoints that require no authentication.
3569
+ */
3570
+
3571
+ interface AttestationSchema {
3572
+ id: string;
3573
+ name: string;
3574
+ slug: string;
3575
+ description?: string;
3576
+ attestation_type: string;
3577
+ schema_definition: Record<string, any>;
3578
+ revocable: boolean;
3579
+ default_expiry_days?: number;
3580
+ icon?: string;
3581
+ color?: string;
3582
+ version: number;
3583
+ is_active: boolean;
3584
+ created_at: string;
3585
+ }
3586
+ interface Attestation {
3587
+ id: string;
3588
+ uid: string;
3589
+ tenant_id: string;
3590
+ schema_id: string;
3591
+ attester_address: string;
3592
+ attester_type: string;
3593
+ subject_address: string;
3594
+ subject_user_id?: string;
3595
+ data: Record<string, any>;
3596
+ ref_type?: string;
3597
+ ref_id?: string;
3598
+ signature?: string;
3599
+ signature_type?: string;
3600
+ status: string;
3601
+ expires_at?: string;
3602
+ revoked_at?: string;
3603
+ revocation_reason?: string;
3604
+ tx_hash?: string;
3605
+ block_number?: number;
3606
+ ipfs_hash?: string;
3607
+ created_at: string;
3608
+ }
3609
+ interface WalletCredential {
3610
+ uid: string;
3611
+ attestation_type?: string;
3612
+ issuer_name?: string;
3613
+ issuer_client_id?: string;
3614
+ subject_address: string;
3615
+ data: Record<string, any>;
3616
+ signature?: string;
3617
+ signature_type?: string;
3618
+ status: string;
3619
+ tx_hash?: string;
3620
+ expires_at?: string;
3621
+ created_at: string;
3622
+ }
3623
+ interface WalletCredentialVerifySummary {
3624
+ wallet_address: string;
3625
+ total_credentials: number;
3626
+ credential_types: Record<string, number>;
3627
+ latest_scores: Record<string, any>;
3628
+ is_verified: boolean;
3629
+ }
3630
+ interface AttestationConfig {
3631
+ id: string;
3632
+ tenant_id: string;
3633
+ auto_attest_passports: boolean;
3634
+ auto_attest_cohort_scores: boolean;
3635
+ attest_on_score_change: boolean;
3636
+ min_score_change_threshold: number;
3637
+ anchor_attestations: boolean;
3638
+ reward_anchoring_mode: string;
3639
+ public_attestations: boolean;
3640
+ }
3641
+ interface CreateAttestationRequest {
3642
+ schema_id: string;
3643
+ subject_address: string;
3644
+ data: Record<string, any>;
3645
+ subject_user_id?: string;
3646
+ ref_type?: string;
3647
+ ref_id?: string;
3648
+ expires_at?: string;
3649
+ }
3650
+ interface ListAttestationsOptions {
3651
+ attestation_type?: string;
3652
+ status?: string;
3653
+ limit?: number;
3654
+ }
3655
+ interface ListWalletCredentialsOptions {
3656
+ attestation_type?: string;
3657
+ limit?: number;
3658
+ offset?: number;
3659
+ }
3660
+ interface UpdateConfigRequest {
3661
+ attest_on_score_change?: boolean;
3662
+ min_score_change_threshold?: number;
3663
+ anchor_attestations?: boolean;
3664
+ reward_anchoring_mode?: string;
3665
+ auto_attest_cohort_scores?: boolean;
3666
+ public_attestations?: boolean;
3667
+ }
3668
+ declare class AttestationsClient {
3669
+ private http;
3670
+ constructor(http: HttpClient);
3671
+ /**
3672
+ * List attestation schemas for the tenant
3673
+ */
3674
+ listSchemas(options?: {
3675
+ attestation_type?: string;
3676
+ }): Promise<AttestationSchema[]>;
3677
+ /**
3678
+ * Get a specific schema
3679
+ */
3680
+ getSchema(schemaId: string): Promise<AttestationSchema>;
3681
+ /**
3682
+ * Create a new attestation. The attestation will be EIP-712 signed
3683
+ * by the tenant's treasury wallet.
3684
+ */
3685
+ create(request: CreateAttestationRequest): Promise<Attestation>;
3686
+ /**
3687
+ * List attestations created by the tenant
3688
+ */
3689
+ list(options?: ListAttestationsOptions): Promise<Attestation[]>;
3690
+ /**
3691
+ * List attestations for a specific subject wallet within the tenant
3692
+ */
3693
+ listBySubject(subjectAddress: string, options?: ListAttestationsOptions): Promise<Attestation[]>;
3694
+ /**
3695
+ * Get a specific attestation by ID
3696
+ */
3697
+ get(attestationId: string): Promise<Attestation>;
3698
+ /**
3699
+ * Revoke an attestation
3700
+ */
3701
+ revoke(attestationId: string, reason?: string): Promise<Attestation>;
3702
+ /**
3703
+ * Anchor an attestation on-chain (requires anchor_attestations enabled)
3704
+ */
3705
+ anchor(attestationId: string): Promise<Attestation>;
3706
+ /**
3707
+ * Get the tenant's attestation configuration
3708
+ */
3709
+ getConfig(): Promise<AttestationConfig>;
3710
+ /**
3711
+ * Update the tenant's attestation configuration
3712
+ */
3713
+ updateConfig(request: UpdateConfigRequest): Promise<AttestationConfig>;
3714
+ /**
3715
+ * List all valid credentials held by a wallet address.
3716
+ * This is a public endpoint — no authentication required.
3717
+ */
3718
+ getWalletCredentials(walletAddress: string, options?: ListWalletCredentialsOptions): Promise<WalletCredential[]>;
3719
+ /**
3720
+ * Get a specific credential by wallet address and attestation UID.
3721
+ * This is a public endpoint — no authentication required.
3722
+ */
3723
+ getWalletCredential(walletAddress: string, attestationUid: string): Promise<WalletCredential>;
3724
+ /**
3725
+ * Get an aggregate verification summary for a wallet's credentials.
3726
+ * Returns credential counts by type and latest score values.
3727
+ * This is a public endpoint — no authentication required.
3728
+ */
3729
+ verifyWalletCredentials(walletAddress: string): Promise<WalletCredentialVerifySummary>;
3730
+ }
3731
+
3574
3732
  /**
3575
3733
  * ProofChain Client
3576
3734
  */
@@ -3773,6 +3931,8 @@ declare class ProofChain {
3773
3931
  nft: NftClient;
3774
3932
  /** Partner Keys client for OTT auth operations */
3775
3933
  partnerKeys: PartnerKeysClient;
3934
+ /** Attestations client for EIP-712 signed credentials and public discovery */
3935
+ attestations: AttestationsClient;
3776
3936
  constructor(options: ProofChainOptions);
3777
3937
  /**
3778
3938
  * Create a client for end-user JWT authentication (PWA/frontend use).
@@ -3826,6 +3986,8 @@ interface IngestEventRequest {
3826
3986
  data?: Record<string, unknown>;
3827
3987
  eventSource?: string;
3828
3988
  schemaIds?: string[];
3989
+ /** Hot attestation — immediate on-chain TX per event (higher cost, lower latency) */
3990
+ hot?: boolean;
3829
3991
  }
3830
3992
  interface IngestEventResponse {
3831
3993
  eventId: string;
@@ -3988,4 +4150,4 @@ declare class TimeoutError extends ProofChainError {
3988
4150
  constructor(message?: string);
3989
4151
  }
3990
4152
 
3991
- export { type Achievement, type ActivitySummaryView, type AddNFTRequest, type AnchorResult, type ApiKey, type AttestRequest, type AttestationMode, type AttestationResult, AuthenticationError, AuthorizationError, type AvailableView, type Badge, type BatchIngestRequest, type BatchIngestResponse, type BatchVerifyResult, type BlockchainProof, type BlockchainStats, type Certificate, type CertificateVerifyResult, CertificatesResource, type Channel, type ChannelState, type ChannelStatus, ChannelsResource, type ClaimNFTResult, type ClaimRewardResult, type CohortDefinition, type CohortGroupStats, CohortLeaderboardClient, type CohortLeaderboardEntry, type CohortLeaderboardOptions, type CohortLeaderboardResponse, type ComprehensiveWalletInfo, type CreateAchievementRequest, type CreateApiKeyRequest, type CreateBadgeRequest, type CreateChannelRequest, type CreateCredentialTypeRequest, type CreateDataViewRequest, type CreateDualWalletsRequest, type CreateEndUserRequest, type CreateEventRequest, type CreatePassportDefinitionRequest, type CreatePassportRequest, type CreateQuestRequest, type CreateQuestStepRequest, type CreateRewardDefinitionRequest, type CreateSchemaRequest, type CreateTemplateFieldRequest, type CreateTemplateRequest, type CreateWalletRequest as CreateUserWalletRequest, type CreateWalletRequest$1 as CreateWalletRequest, type CreateWebhookRequest, type CredentialType, type CredentialVerifyResult, CredentialsClient, type DataViewColumn, type DataViewComputation, type DataViewDetail, type DataViewExecuteResult, type DataViewInfo, type DataViewListResponse, type DataViewPreviewRequest, type DataViewPreviewResult, type DataViewSummary, DataViewsClient, type DistributeResult, DocumentsResource, type DualWallets, type EarnedReward, type EndUser, EndUserIngestionClient, type EndUserIngestionClientOptions, type EndUserListResponse, EndUsersClient, type Event, type EventBatchProof, type EventMetadata, type EventStatus, EventsResource, type ExecuteSwapRequest, type Facet, type FacetsResponse, type FanProfileView, type FanpassGroupStats, FanpassLeaderboardClient, type FanpassLeaderboardEntry, type FanpassLeaderboardOptions, type FanpassLeaderboardResponse, type FanpassUserComparisonResponse, type FieldValue, type GDPRDeletionRequest, type GDPRDeletionResponse, type GDPRPreviewResponse, type IngestEventRequest, type IngestEventResponse, IngestionClient, type IngestionClientOptions, type IssueCertificateRequest, type IssueCredentialRequest, type IssuedCredential, type LeaderboardUserProfile$1 as LeaderboardUserProfile, type LinkWalletRequest, type ListCertificatesRequest, type ListCohortsOptions, type ListEndUsersOptions, type ListEventsRequest, type ListIssuedCredentialsOptions, type ListMintsOptions, type ListMintsResponse, type ListQuestsOptions, type ListRewardsOptions, type ListSchemasOptions, type ManualRewardRequest, type MergeUsersRequest, type Milestone, type MintNFTRequest, type NFT, type NFTMint, NetworkError, NftClient, NotFoundError, type NotificationCallback, type NotificationEvent, type NotificationEventType, NotificationsClient, type OTTConfigResponse, type OTTConfigUpdate, type OTTRedeemResponse, type OTTRequestResponse, PartnerKeysClient, type Passport, PassportClient, type PassportDefinition, type PassportFieldValue, type PassportHistory, type PassportTemplate, type PassportV2Data, type PassportWithFields, ProofChain, ProofChainError, type ProofChainOptions, type ProofVerifyResult, type PushSubscriptionJSON, type Quest, type QuestStep, type QuestWithProgress, QuestsClient, RateLimitError, type RegisterWalletRequest, type RevokeResult, type RewardAsset, type RewardAttestationResult, type RewardDefinition, type RewardEarned, type VerifyResult as RewardVerifyResult, RewardsClient, type Schema, type SchemaDetail, type SchemaField, type SchemaListResponse, type ValidationError$1 as SchemaValidationError, SchemasClient, type SearchFilters, type SearchQueryRequest, type SearchRequest, SearchResource, type SearchResponse, type SearchResult, type SearchStats, ServerError, type SetProfileRequest, type Settlement, type StepCompletionResult, type StepProgress, type StepStartResult, type StreamAck, type StreamEventRequest, type SubscribeOptions, type SwapQuote, type SwapQuoteRequest, type SwapResult, type TemplateField, type TenantInfo, TenantResource, type TierDefinition, TimeoutError, type TokenBalance, type TransferRequest, type TransferResult, type Unsubscribe, type UpdateDataViewRequest, type UpdateEndUserRequest, type UpdatePassportRequest, type UpdateWebhookRequest, type UsageStats, type UserAchievement, type UserActivity, type UserActivityResponse, type UserBadge, type UserBreakdownResponse, type UserCohortBreakdownEntry, type UserCredentialsSummary, type UserQuestProgress, type UserReward$1 as UserReward, type UserRewardsResponse, type UserWalletSummary, type UserWithWallets, type UsersWithWalletsResponse, type ValidateDataRequest, ValidationError, type ValidationErrorDetail, type ValidationResult, type VaultFile, type VaultFolder, type VaultListResponse, VaultResource, type VaultStats, type VaultUploadRequest, type VerificationResult, VerifyResource, type ViewColumn, type ViewTemplate, type Wallet, type WalletBalance, WalletClient, type WalletCreationResult, type WalletStats, type Webhook, WebhooksResource };
4153
+ export { type Achievement, type ActivitySummaryView, type AddNFTRequest, type AnchorResult, type ApiKey, type AttestRequest, type AttestationConfig, type AttestationMode, type Attestation as AttestationRecord, type AttestationResult, type AttestationSchema, AttestationsClient, AuthenticationError, AuthorizationError, type AvailableView, type Badge, type BatchIngestRequest, type BatchIngestResponse, type BatchVerifyResult, type BlockchainProof, type BlockchainStats, type Certificate, type CertificateVerifyResult, CertificatesResource, type Channel, type ChannelState, type ChannelStatus, ChannelsResource, type ClaimNFTResult, type ClaimRewardResult, type CohortDefinition, type CohortGroupStats, CohortLeaderboardClient, type CohortLeaderboardEntry, type CohortLeaderboardOptions, type CohortLeaderboardResponse, type ComprehensiveWalletInfo, type CreateAchievementRequest, type CreateApiKeyRequest, type CreateAttestationRequest, type CreateBadgeRequest, type CreateChannelRequest, type CreateCredentialTypeRequest, type CreateDataViewRequest, type CreateDualWalletsRequest, type CreateEndUserRequest, type CreateEventRequest, type CreatePassportDefinitionRequest, type CreatePassportRequest, type CreateQuestRequest, type CreateQuestStepRequest, type CreateRewardDefinitionRequest, type CreateSchemaRequest, type CreateTemplateFieldRequest, type CreateTemplateRequest, type CreateWalletRequest as CreateUserWalletRequest, type CreateWalletRequest$1 as CreateWalletRequest, type CreateWebhookRequest, type CredentialType, type CredentialVerifyResult, CredentialsClient, type DataViewColumn, type DataViewComputation, type DataViewDetail, type DataViewExecuteResult, type DataViewInfo, type DataViewListResponse, type DataViewPreviewRequest, type DataViewPreviewResult, type DataViewSummary, DataViewsClient, type DistributeResult, DocumentsResource, type DualWallets, type EarnedReward, type EndUser, EndUserIngestionClient, type EndUserIngestionClientOptions, type EndUserListResponse, EndUsersClient, type Event, type EventBatchProof, type EventMetadata, type EventStatus, EventsResource, type ExecuteSwapRequest, type Facet, type FacetsResponse, type FanProfileView, type FanpassGroupStats, FanpassLeaderboardClient, type FanpassLeaderboardEntry, type FanpassLeaderboardOptions, type FanpassLeaderboardResponse, type FanpassUserComparisonResponse, type FieldValue, type GDPRDeletionRequest, type GDPRDeletionResponse, type GDPRPreviewResponse, type IngestEventRequest, type IngestEventResponse, IngestionClient, type IngestionClientOptions, type IssueCertificateRequest, type IssueCredentialRequest, type IssuedCredential, type LeaderboardUserProfile$1 as LeaderboardUserProfile, type LinkWalletRequest, type ListAttestationsOptions, type ListCertificatesRequest, type ListCohortsOptions, type ListEndUsersOptions, type ListEventsRequest, type ListIssuedCredentialsOptions, type ListMintsOptions, type ListMintsResponse, type ListQuestsOptions, type ListRewardsOptions, type ListSchemasOptions, type ListWalletCredentialsOptions, type ManualRewardRequest, type MergeUsersRequest, type Milestone, type MintNFTRequest, type NFT, type NFTMint, NetworkError, NftClient, NotFoundError, type NotificationCallback, type NotificationEvent, type NotificationEventType, NotificationsClient, type OTTConfigResponse, type OTTConfigUpdate, type OTTRequestResponse, PartnerKeysClient, type Passport, PassportClient, type PassportDefinition, type PassportFieldValue, type PassportHistory, type PassportTemplate, type PassportV2Data, type PassportWithFields, ProofChain, ProofChainError, type ProofChainOptions, type ProofVerifyResult, type PushSubscriptionJSON, type Quest, type QuestStep, type QuestWithProgress, QuestsClient, RateLimitError, type RegisterWalletRequest, type RevokeResult, type RewardAsset, type RewardAttestationResult, type RewardDefinition, type RewardEarned, type VerifyResult as RewardVerifyResult, RewardsClient, type Schema, type SchemaDetail, type SchemaField, type SchemaListResponse, type ValidationError$1 as SchemaValidationError, SchemasClient, type SearchFilters, type SearchQueryRequest, type SearchRequest, SearchResource, type SearchResponse, type SearchResult, type SearchStats, ServerError, type SetProfileRequest, type Settlement, type StepCompletionResult, type StepProgress, type StepStartResult, type StreamAck, type StreamEventRequest, type SubscribeOptions, type SwapQuote, type SwapQuoteRequest, type SwapResult, type TemplateField, type TenantInfo, TenantResource, type TierDefinition, TimeoutError, type TokenBalance, type TransferRequest, type TransferResult, type Unsubscribe, type UpdateConfigRequest as UpdateAttestationConfigRequest, type UpdateDataViewRequest, type UpdateEndUserRequest, type UpdatePassportRequest, type UpdateWebhookRequest, type UsageStats, type UserAchievement, type UserActivity, type UserActivityResponse, type UserBadge, type UserBreakdownResponse, type UserCohortBreakdownEntry, type UserCredentialsSummary, type UserQuestProgress, type UserReward$1 as UserReward, type UserRewardsResponse, type UserWalletSummary, type UserWithWallets, type UsersWithWalletsResponse, type ValidateDataRequest, ValidationError, type ValidationErrorDetail, type ValidationResult, type VaultFile, type VaultFolder, type VaultListResponse, VaultResource, type VaultStats, type VaultUploadRequest, type VerificationResult, VerifyResource, type ViewColumn, type ViewTemplate, type Wallet, type WalletBalance, WalletClient, type WalletCreationResult, type WalletCredential, type WalletCredentialVerifySummary, type WalletStats, type Webhook, WebhooksResource };
package/dist/index.d.ts CHANGED
@@ -3526,12 +3526,6 @@ interface OTTRequestResponse {
3526
3526
  ott: string;
3527
3527
  expires_in: number;
3528
3528
  }
3529
- interface OTTRedeemResponse {
3530
- user_id: string;
3531
- session_timeout: number;
3532
- session_data: Record<string, unknown>;
3533
- jwt?: string;
3534
- }
3535
3529
  interface OTTConfigUpdate {
3536
3530
  ott_enabled?: boolean;
3537
3531
  ott_ttl_seconds?: number;
@@ -3555,12 +3549,6 @@ declare class PartnerKeysClient {
3555
3549
  * Request a one-time token for a partner key (end-user JWKS auth).
3556
3550
  */
3557
3551
  requestOTT(keyId: string): Promise<OTTRequestResponse>;
3558
- /**
3559
- * Redeem a one-time token (partner key auth).
3560
- */
3561
- redeemOTT(body: {
3562
- ott: string;
3563
- }): Promise<OTTRedeemResponse>;
3564
3552
  /**
3565
3553
  * Update OTT configuration for a partner key.
3566
3554
  */
@@ -3571,6 +3559,176 @@ declare class PartnerKeysClient {
3571
3559
  getOTTConfig(keyId: string): Promise<OTTConfigResponse>;
3572
3560
  }
3573
3561
 
3562
+ /**
3563
+ * Attestations API Client
3564
+ *
3565
+ * Manage on-chain and off-chain attestations — EIP-712 signed credentials
3566
+ * issued to users' smart wallet addresses.
3567
+ *
3568
+ * Includes public credential discovery endpoints that require no authentication.
3569
+ */
3570
+
3571
+ interface AttestationSchema {
3572
+ id: string;
3573
+ name: string;
3574
+ slug: string;
3575
+ description?: string;
3576
+ attestation_type: string;
3577
+ schema_definition: Record<string, any>;
3578
+ revocable: boolean;
3579
+ default_expiry_days?: number;
3580
+ icon?: string;
3581
+ color?: string;
3582
+ version: number;
3583
+ is_active: boolean;
3584
+ created_at: string;
3585
+ }
3586
+ interface Attestation {
3587
+ id: string;
3588
+ uid: string;
3589
+ tenant_id: string;
3590
+ schema_id: string;
3591
+ attester_address: string;
3592
+ attester_type: string;
3593
+ subject_address: string;
3594
+ subject_user_id?: string;
3595
+ data: Record<string, any>;
3596
+ ref_type?: string;
3597
+ ref_id?: string;
3598
+ signature?: string;
3599
+ signature_type?: string;
3600
+ status: string;
3601
+ expires_at?: string;
3602
+ revoked_at?: string;
3603
+ revocation_reason?: string;
3604
+ tx_hash?: string;
3605
+ block_number?: number;
3606
+ ipfs_hash?: string;
3607
+ created_at: string;
3608
+ }
3609
+ interface WalletCredential {
3610
+ uid: string;
3611
+ attestation_type?: string;
3612
+ issuer_name?: string;
3613
+ issuer_client_id?: string;
3614
+ subject_address: string;
3615
+ data: Record<string, any>;
3616
+ signature?: string;
3617
+ signature_type?: string;
3618
+ status: string;
3619
+ tx_hash?: string;
3620
+ expires_at?: string;
3621
+ created_at: string;
3622
+ }
3623
+ interface WalletCredentialVerifySummary {
3624
+ wallet_address: string;
3625
+ total_credentials: number;
3626
+ credential_types: Record<string, number>;
3627
+ latest_scores: Record<string, any>;
3628
+ is_verified: boolean;
3629
+ }
3630
+ interface AttestationConfig {
3631
+ id: string;
3632
+ tenant_id: string;
3633
+ auto_attest_passports: boolean;
3634
+ auto_attest_cohort_scores: boolean;
3635
+ attest_on_score_change: boolean;
3636
+ min_score_change_threshold: number;
3637
+ anchor_attestations: boolean;
3638
+ reward_anchoring_mode: string;
3639
+ public_attestations: boolean;
3640
+ }
3641
+ interface CreateAttestationRequest {
3642
+ schema_id: string;
3643
+ subject_address: string;
3644
+ data: Record<string, any>;
3645
+ subject_user_id?: string;
3646
+ ref_type?: string;
3647
+ ref_id?: string;
3648
+ expires_at?: string;
3649
+ }
3650
+ interface ListAttestationsOptions {
3651
+ attestation_type?: string;
3652
+ status?: string;
3653
+ limit?: number;
3654
+ }
3655
+ interface ListWalletCredentialsOptions {
3656
+ attestation_type?: string;
3657
+ limit?: number;
3658
+ offset?: number;
3659
+ }
3660
+ interface UpdateConfigRequest {
3661
+ attest_on_score_change?: boolean;
3662
+ min_score_change_threshold?: number;
3663
+ anchor_attestations?: boolean;
3664
+ reward_anchoring_mode?: string;
3665
+ auto_attest_cohort_scores?: boolean;
3666
+ public_attestations?: boolean;
3667
+ }
3668
+ declare class AttestationsClient {
3669
+ private http;
3670
+ constructor(http: HttpClient);
3671
+ /**
3672
+ * List attestation schemas for the tenant
3673
+ */
3674
+ listSchemas(options?: {
3675
+ attestation_type?: string;
3676
+ }): Promise<AttestationSchema[]>;
3677
+ /**
3678
+ * Get a specific schema
3679
+ */
3680
+ getSchema(schemaId: string): Promise<AttestationSchema>;
3681
+ /**
3682
+ * Create a new attestation. The attestation will be EIP-712 signed
3683
+ * by the tenant's treasury wallet.
3684
+ */
3685
+ create(request: CreateAttestationRequest): Promise<Attestation>;
3686
+ /**
3687
+ * List attestations created by the tenant
3688
+ */
3689
+ list(options?: ListAttestationsOptions): Promise<Attestation[]>;
3690
+ /**
3691
+ * List attestations for a specific subject wallet within the tenant
3692
+ */
3693
+ listBySubject(subjectAddress: string, options?: ListAttestationsOptions): Promise<Attestation[]>;
3694
+ /**
3695
+ * Get a specific attestation by ID
3696
+ */
3697
+ get(attestationId: string): Promise<Attestation>;
3698
+ /**
3699
+ * Revoke an attestation
3700
+ */
3701
+ revoke(attestationId: string, reason?: string): Promise<Attestation>;
3702
+ /**
3703
+ * Anchor an attestation on-chain (requires anchor_attestations enabled)
3704
+ */
3705
+ anchor(attestationId: string): Promise<Attestation>;
3706
+ /**
3707
+ * Get the tenant's attestation configuration
3708
+ */
3709
+ getConfig(): Promise<AttestationConfig>;
3710
+ /**
3711
+ * Update the tenant's attestation configuration
3712
+ */
3713
+ updateConfig(request: UpdateConfigRequest): Promise<AttestationConfig>;
3714
+ /**
3715
+ * List all valid credentials held by a wallet address.
3716
+ * This is a public endpoint — no authentication required.
3717
+ */
3718
+ getWalletCredentials(walletAddress: string, options?: ListWalletCredentialsOptions): Promise<WalletCredential[]>;
3719
+ /**
3720
+ * Get a specific credential by wallet address and attestation UID.
3721
+ * This is a public endpoint — no authentication required.
3722
+ */
3723
+ getWalletCredential(walletAddress: string, attestationUid: string): Promise<WalletCredential>;
3724
+ /**
3725
+ * Get an aggregate verification summary for a wallet's credentials.
3726
+ * Returns credential counts by type and latest score values.
3727
+ * This is a public endpoint — no authentication required.
3728
+ */
3729
+ verifyWalletCredentials(walletAddress: string): Promise<WalletCredentialVerifySummary>;
3730
+ }
3731
+
3574
3732
  /**
3575
3733
  * ProofChain Client
3576
3734
  */
@@ -3773,6 +3931,8 @@ declare class ProofChain {
3773
3931
  nft: NftClient;
3774
3932
  /** Partner Keys client for OTT auth operations */
3775
3933
  partnerKeys: PartnerKeysClient;
3934
+ /** Attestations client for EIP-712 signed credentials and public discovery */
3935
+ attestations: AttestationsClient;
3776
3936
  constructor(options: ProofChainOptions);
3777
3937
  /**
3778
3938
  * Create a client for end-user JWT authentication (PWA/frontend use).
@@ -3826,6 +3986,8 @@ interface IngestEventRequest {
3826
3986
  data?: Record<string, unknown>;
3827
3987
  eventSource?: string;
3828
3988
  schemaIds?: string[];
3989
+ /** Hot attestation — immediate on-chain TX per event (higher cost, lower latency) */
3990
+ hot?: boolean;
3829
3991
  }
3830
3992
  interface IngestEventResponse {
3831
3993
  eventId: string;
@@ -3988,4 +4150,4 @@ declare class TimeoutError extends ProofChainError {
3988
4150
  constructor(message?: string);
3989
4151
  }
3990
4152
 
3991
- export { type Achievement, type ActivitySummaryView, type AddNFTRequest, type AnchorResult, type ApiKey, type AttestRequest, type AttestationMode, type AttestationResult, AuthenticationError, AuthorizationError, type AvailableView, type Badge, type BatchIngestRequest, type BatchIngestResponse, type BatchVerifyResult, type BlockchainProof, type BlockchainStats, type Certificate, type CertificateVerifyResult, CertificatesResource, type Channel, type ChannelState, type ChannelStatus, ChannelsResource, type ClaimNFTResult, type ClaimRewardResult, type CohortDefinition, type CohortGroupStats, CohortLeaderboardClient, type CohortLeaderboardEntry, type CohortLeaderboardOptions, type CohortLeaderboardResponse, type ComprehensiveWalletInfo, type CreateAchievementRequest, type CreateApiKeyRequest, type CreateBadgeRequest, type CreateChannelRequest, type CreateCredentialTypeRequest, type CreateDataViewRequest, type CreateDualWalletsRequest, type CreateEndUserRequest, type CreateEventRequest, type CreatePassportDefinitionRequest, type CreatePassportRequest, type CreateQuestRequest, type CreateQuestStepRequest, type CreateRewardDefinitionRequest, type CreateSchemaRequest, type CreateTemplateFieldRequest, type CreateTemplateRequest, type CreateWalletRequest as CreateUserWalletRequest, type CreateWalletRequest$1 as CreateWalletRequest, type CreateWebhookRequest, type CredentialType, type CredentialVerifyResult, CredentialsClient, type DataViewColumn, type DataViewComputation, type DataViewDetail, type DataViewExecuteResult, type DataViewInfo, type DataViewListResponse, type DataViewPreviewRequest, type DataViewPreviewResult, type DataViewSummary, DataViewsClient, type DistributeResult, DocumentsResource, type DualWallets, type EarnedReward, type EndUser, EndUserIngestionClient, type EndUserIngestionClientOptions, type EndUserListResponse, EndUsersClient, type Event, type EventBatchProof, type EventMetadata, type EventStatus, EventsResource, type ExecuteSwapRequest, type Facet, type FacetsResponse, type FanProfileView, type FanpassGroupStats, FanpassLeaderboardClient, type FanpassLeaderboardEntry, type FanpassLeaderboardOptions, type FanpassLeaderboardResponse, type FanpassUserComparisonResponse, type FieldValue, type GDPRDeletionRequest, type GDPRDeletionResponse, type GDPRPreviewResponse, type IngestEventRequest, type IngestEventResponse, IngestionClient, type IngestionClientOptions, type IssueCertificateRequest, type IssueCredentialRequest, type IssuedCredential, type LeaderboardUserProfile$1 as LeaderboardUserProfile, type LinkWalletRequest, type ListCertificatesRequest, type ListCohortsOptions, type ListEndUsersOptions, type ListEventsRequest, type ListIssuedCredentialsOptions, type ListMintsOptions, type ListMintsResponse, type ListQuestsOptions, type ListRewardsOptions, type ListSchemasOptions, type ManualRewardRequest, type MergeUsersRequest, type Milestone, type MintNFTRequest, type NFT, type NFTMint, NetworkError, NftClient, NotFoundError, type NotificationCallback, type NotificationEvent, type NotificationEventType, NotificationsClient, type OTTConfigResponse, type OTTConfigUpdate, type OTTRedeemResponse, type OTTRequestResponse, PartnerKeysClient, type Passport, PassportClient, type PassportDefinition, type PassportFieldValue, type PassportHistory, type PassportTemplate, type PassportV2Data, type PassportWithFields, ProofChain, ProofChainError, type ProofChainOptions, type ProofVerifyResult, type PushSubscriptionJSON, type Quest, type QuestStep, type QuestWithProgress, QuestsClient, RateLimitError, type RegisterWalletRequest, type RevokeResult, type RewardAsset, type RewardAttestationResult, type RewardDefinition, type RewardEarned, type VerifyResult as RewardVerifyResult, RewardsClient, type Schema, type SchemaDetail, type SchemaField, type SchemaListResponse, type ValidationError$1 as SchemaValidationError, SchemasClient, type SearchFilters, type SearchQueryRequest, type SearchRequest, SearchResource, type SearchResponse, type SearchResult, type SearchStats, ServerError, type SetProfileRequest, type Settlement, type StepCompletionResult, type StepProgress, type StepStartResult, type StreamAck, type StreamEventRequest, type SubscribeOptions, type SwapQuote, type SwapQuoteRequest, type SwapResult, type TemplateField, type TenantInfo, TenantResource, type TierDefinition, TimeoutError, type TokenBalance, type TransferRequest, type TransferResult, type Unsubscribe, type UpdateDataViewRequest, type UpdateEndUserRequest, type UpdatePassportRequest, type UpdateWebhookRequest, type UsageStats, type UserAchievement, type UserActivity, type UserActivityResponse, type UserBadge, type UserBreakdownResponse, type UserCohortBreakdownEntry, type UserCredentialsSummary, type UserQuestProgress, type UserReward$1 as UserReward, type UserRewardsResponse, type UserWalletSummary, type UserWithWallets, type UsersWithWalletsResponse, type ValidateDataRequest, ValidationError, type ValidationErrorDetail, type ValidationResult, type VaultFile, type VaultFolder, type VaultListResponse, VaultResource, type VaultStats, type VaultUploadRequest, type VerificationResult, VerifyResource, type ViewColumn, type ViewTemplate, type Wallet, type WalletBalance, WalletClient, type WalletCreationResult, type WalletStats, type Webhook, WebhooksResource };
4153
+ export { type Achievement, type ActivitySummaryView, type AddNFTRequest, type AnchorResult, type ApiKey, type AttestRequest, type AttestationConfig, type AttestationMode, type Attestation as AttestationRecord, type AttestationResult, type AttestationSchema, AttestationsClient, AuthenticationError, AuthorizationError, type AvailableView, type Badge, type BatchIngestRequest, type BatchIngestResponse, type BatchVerifyResult, type BlockchainProof, type BlockchainStats, type Certificate, type CertificateVerifyResult, CertificatesResource, type Channel, type ChannelState, type ChannelStatus, ChannelsResource, type ClaimNFTResult, type ClaimRewardResult, type CohortDefinition, type CohortGroupStats, CohortLeaderboardClient, type CohortLeaderboardEntry, type CohortLeaderboardOptions, type CohortLeaderboardResponse, type ComprehensiveWalletInfo, type CreateAchievementRequest, type CreateApiKeyRequest, type CreateAttestationRequest, type CreateBadgeRequest, type CreateChannelRequest, type CreateCredentialTypeRequest, type CreateDataViewRequest, type CreateDualWalletsRequest, type CreateEndUserRequest, type CreateEventRequest, type CreatePassportDefinitionRequest, type CreatePassportRequest, type CreateQuestRequest, type CreateQuestStepRequest, type CreateRewardDefinitionRequest, type CreateSchemaRequest, type CreateTemplateFieldRequest, type CreateTemplateRequest, type CreateWalletRequest as CreateUserWalletRequest, type CreateWalletRequest$1 as CreateWalletRequest, type CreateWebhookRequest, type CredentialType, type CredentialVerifyResult, CredentialsClient, type DataViewColumn, type DataViewComputation, type DataViewDetail, type DataViewExecuteResult, type DataViewInfo, type DataViewListResponse, type DataViewPreviewRequest, type DataViewPreviewResult, type DataViewSummary, DataViewsClient, type DistributeResult, DocumentsResource, type DualWallets, type EarnedReward, type EndUser, EndUserIngestionClient, type EndUserIngestionClientOptions, type EndUserListResponse, EndUsersClient, type Event, type EventBatchProof, type EventMetadata, type EventStatus, EventsResource, type ExecuteSwapRequest, type Facet, type FacetsResponse, type FanProfileView, type FanpassGroupStats, FanpassLeaderboardClient, type FanpassLeaderboardEntry, type FanpassLeaderboardOptions, type FanpassLeaderboardResponse, type FanpassUserComparisonResponse, type FieldValue, type GDPRDeletionRequest, type GDPRDeletionResponse, type GDPRPreviewResponse, type IngestEventRequest, type IngestEventResponse, IngestionClient, type IngestionClientOptions, type IssueCertificateRequest, type IssueCredentialRequest, type IssuedCredential, type LeaderboardUserProfile$1 as LeaderboardUserProfile, type LinkWalletRequest, type ListAttestationsOptions, type ListCertificatesRequest, type ListCohortsOptions, type ListEndUsersOptions, type ListEventsRequest, type ListIssuedCredentialsOptions, type ListMintsOptions, type ListMintsResponse, type ListQuestsOptions, type ListRewardsOptions, type ListSchemasOptions, type ListWalletCredentialsOptions, type ManualRewardRequest, type MergeUsersRequest, type Milestone, type MintNFTRequest, type NFT, type NFTMint, NetworkError, NftClient, NotFoundError, type NotificationCallback, type NotificationEvent, type NotificationEventType, NotificationsClient, type OTTConfigResponse, type OTTConfigUpdate, type OTTRequestResponse, PartnerKeysClient, type Passport, PassportClient, type PassportDefinition, type PassportFieldValue, type PassportHistory, type PassportTemplate, type PassportV2Data, type PassportWithFields, ProofChain, ProofChainError, type ProofChainOptions, type ProofVerifyResult, type PushSubscriptionJSON, type Quest, type QuestStep, type QuestWithProgress, QuestsClient, RateLimitError, type RegisterWalletRequest, type RevokeResult, type RewardAsset, type RewardAttestationResult, type RewardDefinition, type RewardEarned, type VerifyResult as RewardVerifyResult, RewardsClient, type Schema, type SchemaDetail, type SchemaField, type SchemaListResponse, type ValidationError$1 as SchemaValidationError, SchemasClient, type SearchFilters, type SearchQueryRequest, type SearchRequest, SearchResource, type SearchResponse, type SearchResult, type SearchStats, ServerError, type SetProfileRequest, type Settlement, type StepCompletionResult, type StepProgress, type StepStartResult, type StreamAck, type StreamEventRequest, type SubscribeOptions, type SwapQuote, type SwapQuoteRequest, type SwapResult, type TemplateField, type TenantInfo, TenantResource, type TierDefinition, TimeoutError, type TokenBalance, type TransferRequest, type TransferResult, type Unsubscribe, type UpdateConfigRequest as UpdateAttestationConfigRequest, type UpdateDataViewRequest, type UpdateEndUserRequest, type UpdatePassportRequest, type UpdateWebhookRequest, type UsageStats, type UserAchievement, type UserActivity, type UserActivityResponse, type UserBadge, type UserBreakdownResponse, type UserCohortBreakdownEntry, type UserCredentialsSummary, type UserQuestProgress, type UserReward$1 as UserReward, type UserRewardsResponse, type UserWalletSummary, type UserWithWallets, type UsersWithWalletsResponse, type ValidateDataRequest, ValidationError, type ValidationErrorDetail, type ValidationResult, type VaultFile, type VaultFolder, type VaultListResponse, VaultResource, type VaultStats, type VaultUploadRequest, type VerificationResult, VerifyResource, type ViewColumn, type ViewTemplate, type Wallet, type WalletBalance, WalletClient, type WalletCreationResult, type WalletCredential, type WalletCredentialVerifySummary, type WalletStats, type Webhook, WebhooksResource };
package/dist/index.js CHANGED
@@ -20,6 +20,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
20
20
  // src/index.ts
21
21
  var index_exports = {};
22
22
  __export(index_exports, {
23
+ AttestationsClient: () => AttestationsClient,
23
24
  AuthenticationError: () => AuthenticationError,
24
25
  AuthorizationError: () => AuthorizationError,
25
26
  CertificatesResource: () => CertificatesResource,
@@ -2715,12 +2716,6 @@ var PartnerKeysClient = class {
2715
2716
  async requestOTT(keyId) {
2716
2717
  return this.http.post(`/partner-keys/${keyId}/ott/request`);
2717
2718
  }
2718
- /**
2719
- * Redeem a one-time token (partner key auth).
2720
- */
2721
- async redeemOTT(body) {
2722
- return this.http.post("/partner-keys/ott/redeem", body);
2723
- }
2724
2719
  /**
2725
2720
  * Update OTT configuration for a partner key.
2726
2721
  */
@@ -2735,6 +2730,139 @@ var PartnerKeysClient = class {
2735
2730
  }
2736
2731
  };
2737
2732
 
2733
+ // src/attestations.ts
2734
+ var AttestationsClient = class {
2735
+ constructor(http) {
2736
+ this.http = http;
2737
+ }
2738
+ // ---------------------------------------------------------------------------
2739
+ // Schemas
2740
+ // ---------------------------------------------------------------------------
2741
+ /**
2742
+ * List attestation schemas for the tenant
2743
+ */
2744
+ async listSchemas(options) {
2745
+ return this.http.get("/attestations/schemas", {
2746
+ attestation_type: options?.attestation_type
2747
+ });
2748
+ }
2749
+ /**
2750
+ * Get a specific schema
2751
+ */
2752
+ async getSchema(schemaId) {
2753
+ return this.http.get(`/attestations/schemas/${schemaId}`);
2754
+ }
2755
+ // ---------------------------------------------------------------------------
2756
+ // Attestation Management (authenticated)
2757
+ // ---------------------------------------------------------------------------
2758
+ /**
2759
+ * Create a new attestation. The attestation will be EIP-712 signed
2760
+ * by the tenant's treasury wallet.
2761
+ */
2762
+ async create(request) {
2763
+ return this.http.post("/attestations", request);
2764
+ }
2765
+ /**
2766
+ * List attestations created by the tenant
2767
+ */
2768
+ async list(options) {
2769
+ return this.http.get("/attestations", {
2770
+ attestation_type: options?.attestation_type,
2771
+ status: options?.status,
2772
+ limit: options?.limit
2773
+ });
2774
+ }
2775
+ /**
2776
+ * List attestations for a specific subject wallet within the tenant
2777
+ */
2778
+ async listBySubject(subjectAddress, options) {
2779
+ return this.http.get(
2780
+ `/attestations/by-subject/${subjectAddress}`,
2781
+ {
2782
+ attestation_type: options?.attestation_type,
2783
+ status: options?.status,
2784
+ limit: options?.limit
2785
+ }
2786
+ );
2787
+ }
2788
+ /**
2789
+ * Get a specific attestation by ID
2790
+ */
2791
+ async get(attestationId) {
2792
+ return this.http.get(`/attestations/${attestationId}`);
2793
+ }
2794
+ /**
2795
+ * Revoke an attestation
2796
+ */
2797
+ async revoke(attestationId, reason) {
2798
+ const params = reason ? `?reason=${encodeURIComponent(reason)}` : "";
2799
+ return this.http.post(
2800
+ `/attestations/${attestationId}/revoke${params}`,
2801
+ {}
2802
+ );
2803
+ }
2804
+ /**
2805
+ * Anchor an attestation on-chain (requires anchor_attestations enabled)
2806
+ */
2807
+ async anchor(attestationId) {
2808
+ return this.http.post(
2809
+ `/attestations/${attestationId}/anchor`,
2810
+ {}
2811
+ );
2812
+ }
2813
+ // ---------------------------------------------------------------------------
2814
+ // Configuration
2815
+ // ---------------------------------------------------------------------------
2816
+ /**
2817
+ * Get the tenant's attestation configuration
2818
+ */
2819
+ async getConfig() {
2820
+ return this.http.get("/attestations/config");
2821
+ }
2822
+ /**
2823
+ * Update the tenant's attestation configuration
2824
+ */
2825
+ async updateConfig(request) {
2826
+ return this.http.put("/attestations/config", request);
2827
+ }
2828
+ // ---------------------------------------------------------------------------
2829
+ // Public Credential Discovery (no auth required)
2830
+ // ---------------------------------------------------------------------------
2831
+ /**
2832
+ * List all valid credentials held by a wallet address.
2833
+ * This is a public endpoint — no authentication required.
2834
+ */
2835
+ async getWalletCredentials(walletAddress, options) {
2836
+ return this.http.get(
2837
+ `/public/credentials/${walletAddress}`,
2838
+ {
2839
+ attestation_type: options?.attestation_type,
2840
+ limit: options?.limit,
2841
+ offset: options?.offset
2842
+ }
2843
+ );
2844
+ }
2845
+ /**
2846
+ * Get a specific credential by wallet address and attestation UID.
2847
+ * This is a public endpoint — no authentication required.
2848
+ */
2849
+ async getWalletCredential(walletAddress, attestationUid) {
2850
+ return this.http.get(
2851
+ `/public/credentials/${walletAddress}/${attestationUid}`
2852
+ );
2853
+ }
2854
+ /**
2855
+ * Get an aggregate verification summary for a wallet's credentials.
2856
+ * Returns credential counts by type and latest score values.
2857
+ * This is a public endpoint — no authentication required.
2858
+ */
2859
+ async verifyWalletCredentials(walletAddress) {
2860
+ return this.http.get(
2861
+ `/public/credentials/${walletAddress}/verify`
2862
+ );
2863
+ }
2864
+ };
2865
+
2738
2866
  // src/client.ts
2739
2867
  var DocumentsResource = class {
2740
2868
  constructor(http) {
@@ -3036,6 +3164,7 @@ var ProofChain = class _ProofChain {
3036
3164
  this.credentials = new CredentialsClient(this.http);
3037
3165
  this.nft = new NftClient(this.http);
3038
3166
  this.partnerKeys = new PartnerKeysClient(this.http);
3167
+ this.attestations = new AttestationsClient(this.http);
3039
3168
  }
3040
3169
  /**
3041
3170
  * Create a client for end-user JWT authentication (PWA/frontend use).
@@ -3144,15 +3273,17 @@ var IngestionClient = class {
3144
3273
  if (request.schemaIds?.length) {
3145
3274
  headers["X-Schemas"] = request.schemaIds.join(",");
3146
3275
  }
3276
+ const body = {
3277
+ user_id: request.userId,
3278
+ event_type: request.eventType,
3279
+ data: request.data || {},
3280
+ event_source: request.eventSource || "sdk"
3281
+ };
3282
+ if (request.hot) body.hot = true;
3147
3283
  const response = await fetch(`${this.ingestUrl}/events/ingest`, {
3148
3284
  method: "POST",
3149
3285
  headers,
3150
- body: JSON.stringify({
3151
- user_id: request.userId,
3152
- event_type: request.eventType,
3153
- data: request.data || {},
3154
- event_source: request.eventSource || "sdk"
3155
- }),
3286
+ body: JSON.stringify(body),
3156
3287
  signal: controller.signal
3157
3288
  });
3158
3289
  const result = await this.handleResponse(response);
@@ -3187,12 +3318,16 @@ var IngestionClient = class {
3187
3318
  method: "POST",
3188
3319
  headers: this.getHeaders(),
3189
3320
  body: JSON.stringify(
3190
- request.events.map((e) => ({
3191
- user_id: e.userId,
3192
- event_type: e.eventType,
3193
- data: e.data || {},
3194
- event_source: e.eventSource || "sdk"
3195
- }))
3321
+ request.events.map((e) => {
3322
+ const ev = {
3323
+ user_id: e.userId,
3324
+ event_type: e.eventType,
3325
+ data: e.data || {},
3326
+ event_source: e.eventSource || "sdk"
3327
+ };
3328
+ if (e.hot) ev.hot = true;
3329
+ return ev;
3330
+ })
3196
3331
  ),
3197
3332
  signal: controller.signal
3198
3333
  });
@@ -3290,15 +3425,17 @@ var EndUserIngestionClient = class {
3290
3425
  const controller = new AbortController();
3291
3426
  const timeoutId = setTimeout(() => controller.abort(), this.timeout);
3292
3427
  try {
3428
+ const endUserBody = {
3429
+ user_id: request.userId,
3430
+ event_type: request.eventType,
3431
+ data: request.data || {},
3432
+ event_source: request.eventSource || "end_user_sdk"
3433
+ };
3434
+ if (request.hot) endUserBody.hot = true;
3293
3435
  const response = await fetch(`${this.apiUrl}/end-user/events/ingest`, {
3294
3436
  method: "POST",
3295
3437
  headers: this.getHeaders(),
3296
- body: JSON.stringify({
3297
- user_id: request.userId,
3298
- event_type: request.eventType,
3299
- data: request.data || {},
3300
- event_source: request.eventSource || "end_user_sdk"
3301
- }),
3438
+ body: JSON.stringify(endUserBody),
3302
3439
  signal: controller.signal
3303
3440
  });
3304
3441
  const result = await this.handleResponse(response);
@@ -3333,12 +3470,16 @@ var EndUserIngestionClient = class {
3333
3470
  method: "POST",
3334
3471
  headers: this.getHeaders(),
3335
3472
  body: JSON.stringify({
3336
- events: request.events.map((e) => ({
3337
- user_id: e.userId,
3338
- event_type: e.eventType,
3339
- data: e.data || {},
3340
- event_source: e.eventSource || "end_user_sdk"
3341
- }))
3473
+ events: request.events.map((e) => {
3474
+ const ev = {
3475
+ user_id: e.userId,
3476
+ event_type: e.eventType,
3477
+ data: e.data || {},
3478
+ event_source: e.eventSource || "end_user_sdk"
3479
+ };
3480
+ if (e.hot) ev.hot = true;
3481
+ return ev;
3482
+ })
3342
3483
  }),
3343
3484
  signal: controller.signal
3344
3485
  });
@@ -3365,6 +3506,7 @@ var EndUserIngestionClient = class {
3365
3506
  };
3366
3507
  // Annotate the CommonJS export names for ESM import in node:
3367
3508
  0 && (module.exports = {
3509
+ AttestationsClient,
3368
3510
  AuthenticationError,
3369
3511
  AuthorizationError,
3370
3512
  CertificatesResource,
package/dist/index.mjs CHANGED
@@ -2656,12 +2656,6 @@ var PartnerKeysClient = class {
2656
2656
  async requestOTT(keyId) {
2657
2657
  return this.http.post(`/partner-keys/${keyId}/ott/request`);
2658
2658
  }
2659
- /**
2660
- * Redeem a one-time token (partner key auth).
2661
- */
2662
- async redeemOTT(body) {
2663
- return this.http.post("/partner-keys/ott/redeem", body);
2664
- }
2665
2659
  /**
2666
2660
  * Update OTT configuration for a partner key.
2667
2661
  */
@@ -2676,6 +2670,139 @@ var PartnerKeysClient = class {
2676
2670
  }
2677
2671
  };
2678
2672
 
2673
+ // src/attestations.ts
2674
+ var AttestationsClient = class {
2675
+ constructor(http) {
2676
+ this.http = http;
2677
+ }
2678
+ // ---------------------------------------------------------------------------
2679
+ // Schemas
2680
+ // ---------------------------------------------------------------------------
2681
+ /**
2682
+ * List attestation schemas for the tenant
2683
+ */
2684
+ async listSchemas(options) {
2685
+ return this.http.get("/attestations/schemas", {
2686
+ attestation_type: options?.attestation_type
2687
+ });
2688
+ }
2689
+ /**
2690
+ * Get a specific schema
2691
+ */
2692
+ async getSchema(schemaId) {
2693
+ return this.http.get(`/attestations/schemas/${schemaId}`);
2694
+ }
2695
+ // ---------------------------------------------------------------------------
2696
+ // Attestation Management (authenticated)
2697
+ // ---------------------------------------------------------------------------
2698
+ /**
2699
+ * Create a new attestation. The attestation will be EIP-712 signed
2700
+ * by the tenant's treasury wallet.
2701
+ */
2702
+ async create(request) {
2703
+ return this.http.post("/attestations", request);
2704
+ }
2705
+ /**
2706
+ * List attestations created by the tenant
2707
+ */
2708
+ async list(options) {
2709
+ return this.http.get("/attestations", {
2710
+ attestation_type: options?.attestation_type,
2711
+ status: options?.status,
2712
+ limit: options?.limit
2713
+ });
2714
+ }
2715
+ /**
2716
+ * List attestations for a specific subject wallet within the tenant
2717
+ */
2718
+ async listBySubject(subjectAddress, options) {
2719
+ return this.http.get(
2720
+ `/attestations/by-subject/${subjectAddress}`,
2721
+ {
2722
+ attestation_type: options?.attestation_type,
2723
+ status: options?.status,
2724
+ limit: options?.limit
2725
+ }
2726
+ );
2727
+ }
2728
+ /**
2729
+ * Get a specific attestation by ID
2730
+ */
2731
+ async get(attestationId) {
2732
+ return this.http.get(`/attestations/${attestationId}`);
2733
+ }
2734
+ /**
2735
+ * Revoke an attestation
2736
+ */
2737
+ async revoke(attestationId, reason) {
2738
+ const params = reason ? `?reason=${encodeURIComponent(reason)}` : "";
2739
+ return this.http.post(
2740
+ `/attestations/${attestationId}/revoke${params}`,
2741
+ {}
2742
+ );
2743
+ }
2744
+ /**
2745
+ * Anchor an attestation on-chain (requires anchor_attestations enabled)
2746
+ */
2747
+ async anchor(attestationId) {
2748
+ return this.http.post(
2749
+ `/attestations/${attestationId}/anchor`,
2750
+ {}
2751
+ );
2752
+ }
2753
+ // ---------------------------------------------------------------------------
2754
+ // Configuration
2755
+ // ---------------------------------------------------------------------------
2756
+ /**
2757
+ * Get the tenant's attestation configuration
2758
+ */
2759
+ async getConfig() {
2760
+ return this.http.get("/attestations/config");
2761
+ }
2762
+ /**
2763
+ * Update the tenant's attestation configuration
2764
+ */
2765
+ async updateConfig(request) {
2766
+ return this.http.put("/attestations/config", request);
2767
+ }
2768
+ // ---------------------------------------------------------------------------
2769
+ // Public Credential Discovery (no auth required)
2770
+ // ---------------------------------------------------------------------------
2771
+ /**
2772
+ * List all valid credentials held by a wallet address.
2773
+ * This is a public endpoint — no authentication required.
2774
+ */
2775
+ async getWalletCredentials(walletAddress, options) {
2776
+ return this.http.get(
2777
+ `/public/credentials/${walletAddress}`,
2778
+ {
2779
+ attestation_type: options?.attestation_type,
2780
+ limit: options?.limit,
2781
+ offset: options?.offset
2782
+ }
2783
+ );
2784
+ }
2785
+ /**
2786
+ * Get a specific credential by wallet address and attestation UID.
2787
+ * This is a public endpoint — no authentication required.
2788
+ */
2789
+ async getWalletCredential(walletAddress, attestationUid) {
2790
+ return this.http.get(
2791
+ `/public/credentials/${walletAddress}/${attestationUid}`
2792
+ );
2793
+ }
2794
+ /**
2795
+ * Get an aggregate verification summary for a wallet's credentials.
2796
+ * Returns credential counts by type and latest score values.
2797
+ * This is a public endpoint — no authentication required.
2798
+ */
2799
+ async verifyWalletCredentials(walletAddress) {
2800
+ return this.http.get(
2801
+ `/public/credentials/${walletAddress}/verify`
2802
+ );
2803
+ }
2804
+ };
2805
+
2679
2806
  // src/client.ts
2680
2807
  var DocumentsResource = class {
2681
2808
  constructor(http) {
@@ -2977,6 +3104,7 @@ var ProofChain = class _ProofChain {
2977
3104
  this.credentials = new CredentialsClient(this.http);
2978
3105
  this.nft = new NftClient(this.http);
2979
3106
  this.partnerKeys = new PartnerKeysClient(this.http);
3107
+ this.attestations = new AttestationsClient(this.http);
2980
3108
  }
2981
3109
  /**
2982
3110
  * Create a client for end-user JWT authentication (PWA/frontend use).
@@ -3085,15 +3213,17 @@ var IngestionClient = class {
3085
3213
  if (request.schemaIds?.length) {
3086
3214
  headers["X-Schemas"] = request.schemaIds.join(",");
3087
3215
  }
3216
+ const body = {
3217
+ user_id: request.userId,
3218
+ event_type: request.eventType,
3219
+ data: request.data || {},
3220
+ event_source: request.eventSource || "sdk"
3221
+ };
3222
+ if (request.hot) body.hot = true;
3088
3223
  const response = await fetch(`${this.ingestUrl}/events/ingest`, {
3089
3224
  method: "POST",
3090
3225
  headers,
3091
- body: JSON.stringify({
3092
- user_id: request.userId,
3093
- event_type: request.eventType,
3094
- data: request.data || {},
3095
- event_source: request.eventSource || "sdk"
3096
- }),
3226
+ body: JSON.stringify(body),
3097
3227
  signal: controller.signal
3098
3228
  });
3099
3229
  const result = await this.handleResponse(response);
@@ -3128,12 +3258,16 @@ var IngestionClient = class {
3128
3258
  method: "POST",
3129
3259
  headers: this.getHeaders(),
3130
3260
  body: JSON.stringify(
3131
- request.events.map((e) => ({
3132
- user_id: e.userId,
3133
- event_type: e.eventType,
3134
- data: e.data || {},
3135
- event_source: e.eventSource || "sdk"
3136
- }))
3261
+ request.events.map((e) => {
3262
+ const ev = {
3263
+ user_id: e.userId,
3264
+ event_type: e.eventType,
3265
+ data: e.data || {},
3266
+ event_source: e.eventSource || "sdk"
3267
+ };
3268
+ if (e.hot) ev.hot = true;
3269
+ return ev;
3270
+ })
3137
3271
  ),
3138
3272
  signal: controller.signal
3139
3273
  });
@@ -3231,15 +3365,17 @@ var EndUserIngestionClient = class {
3231
3365
  const controller = new AbortController();
3232
3366
  const timeoutId = setTimeout(() => controller.abort(), this.timeout);
3233
3367
  try {
3368
+ const endUserBody = {
3369
+ user_id: request.userId,
3370
+ event_type: request.eventType,
3371
+ data: request.data || {},
3372
+ event_source: request.eventSource || "end_user_sdk"
3373
+ };
3374
+ if (request.hot) endUserBody.hot = true;
3234
3375
  const response = await fetch(`${this.apiUrl}/end-user/events/ingest`, {
3235
3376
  method: "POST",
3236
3377
  headers: this.getHeaders(),
3237
- body: JSON.stringify({
3238
- user_id: request.userId,
3239
- event_type: request.eventType,
3240
- data: request.data || {},
3241
- event_source: request.eventSource || "end_user_sdk"
3242
- }),
3378
+ body: JSON.stringify(endUserBody),
3243
3379
  signal: controller.signal
3244
3380
  });
3245
3381
  const result = await this.handleResponse(response);
@@ -3274,12 +3410,16 @@ var EndUserIngestionClient = class {
3274
3410
  method: "POST",
3275
3411
  headers: this.getHeaders(),
3276
3412
  body: JSON.stringify({
3277
- events: request.events.map((e) => ({
3278
- user_id: e.userId,
3279
- event_type: e.eventType,
3280
- data: e.data || {},
3281
- event_source: e.eventSource || "end_user_sdk"
3282
- }))
3413
+ events: request.events.map((e) => {
3414
+ const ev = {
3415
+ user_id: e.userId,
3416
+ event_type: e.eventType,
3417
+ data: e.data || {},
3418
+ event_source: e.eventSource || "end_user_sdk"
3419
+ };
3420
+ if (e.hot) ev.hot = true;
3421
+ return ev;
3422
+ })
3283
3423
  }),
3284
3424
  signal: controller.signal
3285
3425
  });
@@ -3305,6 +3445,7 @@ var EndUserIngestionClient = class {
3305
3445
  }
3306
3446
  };
3307
3447
  export {
3448
+ AttestationsClient,
3308
3449
  AuthenticationError,
3309
3450
  AuthorizationError,
3310
3451
  CertificatesResource,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@proofchain/sdk",
3
- "version": "2.21.0",
3
+ "version": "2.22.0",
4
4
  "description": "Official JavaScript/TypeScript SDK for ProofChain - blockchain-anchored document attestation",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",