@proofchain/sdk 2.21.1 → 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 +173 -1
- package/dist/index.d.ts +173 -1
- package/dist/index.js +136 -0
- package/dist/index.mjs +135 -0
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -3559,6 +3559,176 @@ declare class PartnerKeysClient {
|
|
|
3559
3559
|
getOTTConfig(keyId: string): Promise<OTTConfigResponse>;
|
|
3560
3560
|
}
|
|
3561
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
|
+
|
|
3562
3732
|
/**
|
|
3563
3733
|
* ProofChain Client
|
|
3564
3734
|
*/
|
|
@@ -3761,6 +3931,8 @@ declare class ProofChain {
|
|
|
3761
3931
|
nft: NftClient;
|
|
3762
3932
|
/** Partner Keys client for OTT auth operations */
|
|
3763
3933
|
partnerKeys: PartnerKeysClient;
|
|
3934
|
+
/** Attestations client for EIP-712 signed credentials and public discovery */
|
|
3935
|
+
attestations: AttestationsClient;
|
|
3764
3936
|
constructor(options: ProofChainOptions);
|
|
3765
3937
|
/**
|
|
3766
3938
|
* Create a client for end-user JWT authentication (PWA/frontend use).
|
|
@@ -3978,4 +4150,4 @@ declare class TimeoutError extends ProofChainError {
|
|
|
3978
4150
|
constructor(message?: string);
|
|
3979
4151
|
}
|
|
3980
4152
|
|
|
3981
|
-
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 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
|
@@ -3559,6 +3559,176 @@ declare class PartnerKeysClient {
|
|
|
3559
3559
|
getOTTConfig(keyId: string): Promise<OTTConfigResponse>;
|
|
3560
3560
|
}
|
|
3561
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
|
+
|
|
3562
3732
|
/**
|
|
3563
3733
|
* ProofChain Client
|
|
3564
3734
|
*/
|
|
@@ -3761,6 +3931,8 @@ declare class ProofChain {
|
|
|
3761
3931
|
nft: NftClient;
|
|
3762
3932
|
/** Partner Keys client for OTT auth operations */
|
|
3763
3933
|
partnerKeys: PartnerKeysClient;
|
|
3934
|
+
/** Attestations client for EIP-712 signed credentials and public discovery */
|
|
3935
|
+
attestations: AttestationsClient;
|
|
3764
3936
|
constructor(options: ProofChainOptions);
|
|
3765
3937
|
/**
|
|
3766
3938
|
* Create a client for end-user JWT authentication (PWA/frontend use).
|
|
@@ -3978,4 +4150,4 @@ declare class TimeoutError extends ProofChainError {
|
|
|
3978
4150
|
constructor(message?: string);
|
|
3979
4151
|
}
|
|
3980
4152
|
|
|
3981
|
-
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 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,
|
|
@@ -2729,6 +2730,139 @@ var PartnerKeysClient = class {
|
|
|
2729
2730
|
}
|
|
2730
2731
|
};
|
|
2731
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
|
+
|
|
2732
2866
|
// src/client.ts
|
|
2733
2867
|
var DocumentsResource = class {
|
|
2734
2868
|
constructor(http) {
|
|
@@ -3030,6 +3164,7 @@ var ProofChain = class _ProofChain {
|
|
|
3030
3164
|
this.credentials = new CredentialsClient(this.http);
|
|
3031
3165
|
this.nft = new NftClient(this.http);
|
|
3032
3166
|
this.partnerKeys = new PartnerKeysClient(this.http);
|
|
3167
|
+
this.attestations = new AttestationsClient(this.http);
|
|
3033
3168
|
}
|
|
3034
3169
|
/**
|
|
3035
3170
|
* Create a client for end-user JWT authentication (PWA/frontend use).
|
|
@@ -3371,6 +3506,7 @@ var EndUserIngestionClient = class {
|
|
|
3371
3506
|
};
|
|
3372
3507
|
// Annotate the CommonJS export names for ESM import in node:
|
|
3373
3508
|
0 && (module.exports = {
|
|
3509
|
+
AttestationsClient,
|
|
3374
3510
|
AuthenticationError,
|
|
3375
3511
|
AuthorizationError,
|
|
3376
3512
|
CertificatesResource,
|
package/dist/index.mjs
CHANGED
|
@@ -2670,6 +2670,139 @@ var PartnerKeysClient = class {
|
|
|
2670
2670
|
}
|
|
2671
2671
|
};
|
|
2672
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
|
+
|
|
2673
2806
|
// src/client.ts
|
|
2674
2807
|
var DocumentsResource = class {
|
|
2675
2808
|
constructor(http) {
|
|
@@ -2971,6 +3104,7 @@ var ProofChain = class _ProofChain {
|
|
|
2971
3104
|
this.credentials = new CredentialsClient(this.http);
|
|
2972
3105
|
this.nft = new NftClient(this.http);
|
|
2973
3106
|
this.partnerKeys = new PartnerKeysClient(this.http);
|
|
3107
|
+
this.attestations = new AttestationsClient(this.http);
|
|
2974
3108
|
}
|
|
2975
3109
|
/**
|
|
2976
3110
|
* Create a client for end-user JWT authentication (PWA/frontend use).
|
|
@@ -3311,6 +3445,7 @@ var EndUserIngestionClient = class {
|
|
|
3311
3445
|
}
|
|
3312
3446
|
};
|
|
3313
3447
|
export {
|
|
3448
|
+
AttestationsClient,
|
|
3314
3449
|
AuthenticationError,
|
|
3315
3450
|
AuthorizationError,
|
|
3316
3451
|
CertificatesResource,
|
package/package.json
CHANGED