@proofchain/sdk 2.19.0 → 2.21.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 -6
- package/dist/index.d.ts +173 -6
- package/dist/index.js +122 -1
- package/dist/index.mjs +120 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1498,6 +1498,8 @@ interface EndUser {
|
|
|
1498
1498
|
bio?: string;
|
|
1499
1499
|
wallet_address?: string;
|
|
1500
1500
|
wallet_source?: string;
|
|
1501
|
+
cdp_wallet_address?: string;
|
|
1502
|
+
wallet_linked_at?: string;
|
|
1501
1503
|
status: string;
|
|
1502
1504
|
total_events: number;
|
|
1503
1505
|
first_event_at?: string;
|
|
@@ -1578,9 +1580,10 @@ interface ListEndUsersOptions {
|
|
|
1578
1580
|
sort_order?: 'asc' | 'desc';
|
|
1579
1581
|
}
|
|
1580
1582
|
interface LinkWalletRequest {
|
|
1581
|
-
wallet_address
|
|
1583
|
+
wallet_address?: string;
|
|
1582
1584
|
wallet_source?: string;
|
|
1583
1585
|
signature?: string;
|
|
1586
|
+
restore_cdp_wallet?: boolean;
|
|
1584
1587
|
}
|
|
1585
1588
|
interface MergeUsersRequest {
|
|
1586
1589
|
source_user_ids: string[];
|
|
@@ -2209,6 +2212,8 @@ interface Quest {
|
|
|
2209
2212
|
starts_at?: string;
|
|
2210
2213
|
ends_at?: string;
|
|
2211
2214
|
time_limit_hours?: number;
|
|
2215
|
+
/** When true, auto-expire all in-progress users when ends_at passes. */
|
|
2216
|
+
expire_on_end?: boolean;
|
|
2212
2217
|
prerequisite_quest_ids: string[];
|
|
2213
2218
|
max_participants?: number;
|
|
2214
2219
|
max_completions?: number;
|
|
@@ -2251,7 +2256,7 @@ interface UserQuestProgress {
|
|
|
2251
2256
|
user_id: string;
|
|
2252
2257
|
quest_id: string;
|
|
2253
2258
|
quest_name: string;
|
|
2254
|
-
status: 'not_started' | 'in_progress' | 'completed' | '
|
|
2259
|
+
status: 'not_started' | 'in_progress' | 'completed' | 'claimed' | 'expired';
|
|
2255
2260
|
started_at?: string;
|
|
2256
2261
|
completed_at?: string;
|
|
2257
2262
|
expires_at?: string;
|
|
@@ -2278,14 +2283,25 @@ interface StepProgress {
|
|
|
2278
2283
|
step_name: string;
|
|
2279
2284
|
order: number;
|
|
2280
2285
|
status: 'pending' | 'in_progress' | 'completed' | 'skipped';
|
|
2286
|
+
started_at?: string;
|
|
2281
2287
|
completed_at?: string;
|
|
2282
2288
|
event_id?: string;
|
|
2283
2289
|
}
|
|
2290
|
+
interface StepStartResult {
|
|
2291
|
+
step_index: number;
|
|
2292
|
+
status: 'in_progress' | 'completed';
|
|
2293
|
+
started_at?: string;
|
|
2294
|
+
quest_id: string;
|
|
2295
|
+
quest_name: string;
|
|
2296
|
+
step_name: string;
|
|
2297
|
+
/** Present when step was already completed */
|
|
2298
|
+
message?: string;
|
|
2299
|
+
}
|
|
2284
2300
|
interface StepCompletionResult {
|
|
2285
2301
|
step_index: number;
|
|
2286
2302
|
step_completed: boolean;
|
|
2287
2303
|
quest_completed: boolean;
|
|
2288
|
-
|
|
2304
|
+
can_claim: boolean;
|
|
2289
2305
|
current_count: number;
|
|
2290
2306
|
target_count: number;
|
|
2291
2307
|
points_earned: number;
|
|
@@ -2319,6 +2335,8 @@ interface CreateQuestRequest {
|
|
|
2319
2335
|
starts_at?: string;
|
|
2320
2336
|
ends_at?: string;
|
|
2321
2337
|
time_limit_hours?: number;
|
|
2338
|
+
/** When true, auto-expire all in-progress users when ends_at passes. */
|
|
2339
|
+
expire_on_end?: boolean;
|
|
2322
2340
|
prerequisite_quest_ids?: string[];
|
|
2323
2341
|
max_participants?: number;
|
|
2324
2342
|
max_completions?: number;
|
|
@@ -2425,6 +2443,16 @@ declare class QuestsClient {
|
|
|
2425
2443
|
* Get user's progress on a quest
|
|
2426
2444
|
*/
|
|
2427
2445
|
getUserProgress(questId: string, userId: string): Promise<UserQuestProgress>;
|
|
2446
|
+
/**
|
|
2447
|
+
* Mark a quest step as in-progress (started).
|
|
2448
|
+
*
|
|
2449
|
+
* Call this when the user clicks a CTA link to begin a challenge.
|
|
2450
|
+
* Sets the step to 'in_progress' status so the frontend can show
|
|
2451
|
+
* a pending state while waiting for the completion event to fire.
|
|
2452
|
+
*
|
|
2453
|
+
* Idempotent — safe to call multiple times for the same step.
|
|
2454
|
+
*/
|
|
2455
|
+
startStep(questId: string, userId: string, stepIndex: number): Promise<StepStartResult>;
|
|
2428
2456
|
/**
|
|
2429
2457
|
* Complete a step manually by step index
|
|
2430
2458
|
*/
|
|
@@ -2436,7 +2464,7 @@ declare class QuestsClient {
|
|
|
2436
2464
|
/**
|
|
2437
2465
|
* Claim a completed quest reward.
|
|
2438
2466
|
* Only applicable for quests with reward_mode='claimable'.
|
|
2439
|
-
* Transitions the quest from
|
|
2467
|
+
* Transitions the quest from COMPLETED to CLAIMED
|
|
2440
2468
|
* and awards points + creates the earned reward.
|
|
2441
2469
|
*/
|
|
2442
2470
|
claimReward(questId: string, userId: string): Promise<ClaimRewardResult>;
|
|
@@ -3092,7 +3120,7 @@ interface PushSubscriptionJSON {
|
|
|
3092
3120
|
};
|
|
3093
3121
|
}
|
|
3094
3122
|
/** Notification event types pushed by the server. */
|
|
3095
|
-
type NotificationEventType = 'connected' | 'quest_step_completed' | 'quest_completed' | 'reward_earned' | 'reward_distributed' | 'reward_claimable' | 'points_awarded' | 'badge_earned' | 'level_up';
|
|
3123
|
+
type NotificationEventType = 'connected' | 'quest_step_started' | 'quest_step_completed' | 'quest_completed' | 'reward_earned' | 'reward_distributed' | 'reward_claimable' | 'points_awarded' | 'badge_earned' | 'level_up';
|
|
3096
3124
|
/** A notification event received from the SSE stream. */
|
|
3097
3125
|
interface NotificationEvent {
|
|
3098
3126
|
/** Unique event ID */
|
|
@@ -3408,6 +3436,141 @@ declare class CredentialsClient {
|
|
|
3408
3436
|
verify(verificationCode: string): Promise<CredentialVerifyResult>;
|
|
3409
3437
|
}
|
|
3410
3438
|
|
|
3439
|
+
/**
|
|
3440
|
+
* NFT Minting Client — Standalone NFT minting service.
|
|
3441
|
+
*/
|
|
3442
|
+
|
|
3443
|
+
interface MintNFTRequest {
|
|
3444
|
+
/** Wallet address to receive the NFT */
|
|
3445
|
+
recipientAddress: string;
|
|
3446
|
+
/** NFT name */
|
|
3447
|
+
name: string;
|
|
3448
|
+
/** Image file (Blob, File, or ArrayBuffer) — provide this OR imageUrl */
|
|
3449
|
+
image?: Blob | File | ArrayBuffer;
|
|
3450
|
+
/** Filename for the image (used when image is a Blob/ArrayBuffer) */
|
|
3451
|
+
imageFilename?: string;
|
|
3452
|
+
/** External image URL — provide this OR image */
|
|
3453
|
+
imageUrl?: string;
|
|
3454
|
+
/** Optional end-user external_id */
|
|
3455
|
+
recipientUserId?: string;
|
|
3456
|
+
/** NFT description */
|
|
3457
|
+
description?: string;
|
|
3458
|
+
/** Whether the NFT is soulbound (non-transferable) */
|
|
3459
|
+
soulbound?: boolean;
|
|
3460
|
+
/** Validity period in days */
|
|
3461
|
+
validityDays?: number;
|
|
3462
|
+
/** Blockchain network (default: "base") */
|
|
3463
|
+
network?: string;
|
|
3464
|
+
/** Contract address override */
|
|
3465
|
+
contractAddress?: string;
|
|
3466
|
+
/** Extra metadata attributes to merge */
|
|
3467
|
+
metadata?: Record<string, unknown>;
|
|
3468
|
+
}
|
|
3469
|
+
interface NFTMint {
|
|
3470
|
+
id: string;
|
|
3471
|
+
tenant_id: string;
|
|
3472
|
+
recipient_address: string;
|
|
3473
|
+
recipient_user_id: string | null;
|
|
3474
|
+
token_id: number | null;
|
|
3475
|
+
tx_hash: string | null;
|
|
3476
|
+
contract_address: string;
|
|
3477
|
+
network: string;
|
|
3478
|
+
content_hash: string | null;
|
|
3479
|
+
cert_type: number;
|
|
3480
|
+
validity_days: number | null;
|
|
3481
|
+
metadata: Record<string, unknown> | null;
|
|
3482
|
+
metadata_uri: string | null;
|
|
3483
|
+
image_url: string;
|
|
3484
|
+
image_storage_path: string | null;
|
|
3485
|
+
name: string;
|
|
3486
|
+
description: string | null;
|
|
3487
|
+
status: string;
|
|
3488
|
+
error_message: string | null;
|
|
3489
|
+
gas_used: string | null;
|
|
3490
|
+
created_at: string | null;
|
|
3491
|
+
updated_at: string | null;
|
|
3492
|
+
}
|
|
3493
|
+
interface ListMintsOptions {
|
|
3494
|
+
recipientAddress?: string;
|
|
3495
|
+
network?: string;
|
|
3496
|
+
status?: string;
|
|
3497
|
+
limit?: number;
|
|
3498
|
+
offset?: number;
|
|
3499
|
+
}
|
|
3500
|
+
interface ListMintsResponse {
|
|
3501
|
+
mints: NFTMint[];
|
|
3502
|
+
total: number;
|
|
3503
|
+
}
|
|
3504
|
+
declare class NftClient {
|
|
3505
|
+
private http;
|
|
3506
|
+
constructor(http: HttpClient);
|
|
3507
|
+
/**
|
|
3508
|
+
* Mint an NFT and send it to a wallet address.
|
|
3509
|
+
*/
|
|
3510
|
+
mint(request: MintNFTRequest): Promise<NFTMint>;
|
|
3511
|
+
/**
|
|
3512
|
+
* List NFT mints for the current tenant.
|
|
3513
|
+
*/
|
|
3514
|
+
list(options?: ListMintsOptions): Promise<ListMintsResponse>;
|
|
3515
|
+
/**
|
|
3516
|
+
* Get a single NFT mint by ID.
|
|
3517
|
+
*/
|
|
3518
|
+
get(mintId: string): Promise<NFTMint>;
|
|
3519
|
+
}
|
|
3520
|
+
|
|
3521
|
+
/**
|
|
3522
|
+
* Partner Keys Resource - OTT (One-Time Token) auth for partner integrations
|
|
3523
|
+
*/
|
|
3524
|
+
|
|
3525
|
+
interface OTTRequestResponse {
|
|
3526
|
+
ott: string;
|
|
3527
|
+
expires_in: number;
|
|
3528
|
+
}
|
|
3529
|
+
interface OTTRedeemResponse {
|
|
3530
|
+
user_id: string;
|
|
3531
|
+
session_timeout: number;
|
|
3532
|
+
session_data: Record<string, unknown>;
|
|
3533
|
+
jwt?: string;
|
|
3534
|
+
}
|
|
3535
|
+
interface OTTConfigUpdate {
|
|
3536
|
+
ott_enabled?: boolean;
|
|
3537
|
+
ott_ttl_seconds?: number;
|
|
3538
|
+
ott_redemption_mode?: 'jwt' | 'cookie';
|
|
3539
|
+
ott_jwt_ttl_seconds?: number;
|
|
3540
|
+
ott_session_data_keys?: string[];
|
|
3541
|
+
}
|
|
3542
|
+
interface OTTConfigResponse {
|
|
3543
|
+
partner_key_id: string;
|
|
3544
|
+
partner_name: string;
|
|
3545
|
+
ott_enabled: boolean;
|
|
3546
|
+
ott_ttl_seconds: number;
|
|
3547
|
+
ott_redemption_mode: 'jwt' | 'cookie';
|
|
3548
|
+
ott_jwt_ttl_seconds: number;
|
|
3549
|
+
ott_session_data_keys?: string[];
|
|
3550
|
+
}
|
|
3551
|
+
declare class PartnerKeysClient {
|
|
3552
|
+
private http;
|
|
3553
|
+
constructor(http: HttpClient);
|
|
3554
|
+
/**
|
|
3555
|
+
* Request a one-time token for a partner key (end-user JWKS auth).
|
|
3556
|
+
*/
|
|
3557
|
+
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
|
+
/**
|
|
3565
|
+
* Update OTT configuration for a partner key.
|
|
3566
|
+
*/
|
|
3567
|
+
updateOTTConfig(keyId: string, config: OTTConfigUpdate): Promise<OTTConfigResponse>;
|
|
3568
|
+
/**
|
|
3569
|
+
* Get OTT configuration for a partner key.
|
|
3570
|
+
*/
|
|
3571
|
+
getOTTConfig(keyId: string): Promise<OTTConfigResponse>;
|
|
3572
|
+
}
|
|
3573
|
+
|
|
3411
3574
|
/**
|
|
3412
3575
|
* ProofChain Client
|
|
3413
3576
|
*/
|
|
@@ -3606,6 +3769,10 @@ declare class ProofChain {
|
|
|
3606
3769
|
notifications: NotificationsClient;
|
|
3607
3770
|
/** Credentials client for portable identity credentials */
|
|
3608
3771
|
credentials: CredentialsClient;
|
|
3772
|
+
/** NFT client for standalone NFT minting */
|
|
3773
|
+
nft: NftClient;
|
|
3774
|
+
/** Partner Keys client for OTT auth operations */
|
|
3775
|
+
partnerKeys: PartnerKeysClient;
|
|
3609
3776
|
constructor(options: ProofChainOptions);
|
|
3610
3777
|
/**
|
|
3611
3778
|
* Create a client for end-user JWT authentication (PWA/frontend use).
|
|
@@ -3821,4 +3988,4 @@ declare class TimeoutError extends ProofChainError {
|
|
|
3821
3988
|
constructor(message?: string);
|
|
3822
3989
|
}
|
|
3823
3990
|
|
|
3824
|
-
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 ListQuestsOptions, type ListRewardsOptions, type ListSchemasOptions, type ManualRewardRequest, type MergeUsersRequest, type Milestone, type NFT, NetworkError, NotFoundError, type NotificationCallback, type NotificationEvent, type NotificationEventType, NotificationsClient, 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 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 };
|
|
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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -1498,6 +1498,8 @@ interface EndUser {
|
|
|
1498
1498
|
bio?: string;
|
|
1499
1499
|
wallet_address?: string;
|
|
1500
1500
|
wallet_source?: string;
|
|
1501
|
+
cdp_wallet_address?: string;
|
|
1502
|
+
wallet_linked_at?: string;
|
|
1501
1503
|
status: string;
|
|
1502
1504
|
total_events: number;
|
|
1503
1505
|
first_event_at?: string;
|
|
@@ -1578,9 +1580,10 @@ interface ListEndUsersOptions {
|
|
|
1578
1580
|
sort_order?: 'asc' | 'desc';
|
|
1579
1581
|
}
|
|
1580
1582
|
interface LinkWalletRequest {
|
|
1581
|
-
wallet_address
|
|
1583
|
+
wallet_address?: string;
|
|
1582
1584
|
wallet_source?: string;
|
|
1583
1585
|
signature?: string;
|
|
1586
|
+
restore_cdp_wallet?: boolean;
|
|
1584
1587
|
}
|
|
1585
1588
|
interface MergeUsersRequest {
|
|
1586
1589
|
source_user_ids: string[];
|
|
@@ -2209,6 +2212,8 @@ interface Quest {
|
|
|
2209
2212
|
starts_at?: string;
|
|
2210
2213
|
ends_at?: string;
|
|
2211
2214
|
time_limit_hours?: number;
|
|
2215
|
+
/** When true, auto-expire all in-progress users when ends_at passes. */
|
|
2216
|
+
expire_on_end?: boolean;
|
|
2212
2217
|
prerequisite_quest_ids: string[];
|
|
2213
2218
|
max_participants?: number;
|
|
2214
2219
|
max_completions?: number;
|
|
@@ -2251,7 +2256,7 @@ interface UserQuestProgress {
|
|
|
2251
2256
|
user_id: string;
|
|
2252
2257
|
quest_id: string;
|
|
2253
2258
|
quest_name: string;
|
|
2254
|
-
status: 'not_started' | 'in_progress' | 'completed' | '
|
|
2259
|
+
status: 'not_started' | 'in_progress' | 'completed' | 'claimed' | 'expired';
|
|
2255
2260
|
started_at?: string;
|
|
2256
2261
|
completed_at?: string;
|
|
2257
2262
|
expires_at?: string;
|
|
@@ -2278,14 +2283,25 @@ interface StepProgress {
|
|
|
2278
2283
|
step_name: string;
|
|
2279
2284
|
order: number;
|
|
2280
2285
|
status: 'pending' | 'in_progress' | 'completed' | 'skipped';
|
|
2286
|
+
started_at?: string;
|
|
2281
2287
|
completed_at?: string;
|
|
2282
2288
|
event_id?: string;
|
|
2283
2289
|
}
|
|
2290
|
+
interface StepStartResult {
|
|
2291
|
+
step_index: number;
|
|
2292
|
+
status: 'in_progress' | 'completed';
|
|
2293
|
+
started_at?: string;
|
|
2294
|
+
quest_id: string;
|
|
2295
|
+
quest_name: string;
|
|
2296
|
+
step_name: string;
|
|
2297
|
+
/** Present when step was already completed */
|
|
2298
|
+
message?: string;
|
|
2299
|
+
}
|
|
2284
2300
|
interface StepCompletionResult {
|
|
2285
2301
|
step_index: number;
|
|
2286
2302
|
step_completed: boolean;
|
|
2287
2303
|
quest_completed: boolean;
|
|
2288
|
-
|
|
2304
|
+
can_claim: boolean;
|
|
2289
2305
|
current_count: number;
|
|
2290
2306
|
target_count: number;
|
|
2291
2307
|
points_earned: number;
|
|
@@ -2319,6 +2335,8 @@ interface CreateQuestRequest {
|
|
|
2319
2335
|
starts_at?: string;
|
|
2320
2336
|
ends_at?: string;
|
|
2321
2337
|
time_limit_hours?: number;
|
|
2338
|
+
/** When true, auto-expire all in-progress users when ends_at passes. */
|
|
2339
|
+
expire_on_end?: boolean;
|
|
2322
2340
|
prerequisite_quest_ids?: string[];
|
|
2323
2341
|
max_participants?: number;
|
|
2324
2342
|
max_completions?: number;
|
|
@@ -2425,6 +2443,16 @@ declare class QuestsClient {
|
|
|
2425
2443
|
* Get user's progress on a quest
|
|
2426
2444
|
*/
|
|
2427
2445
|
getUserProgress(questId: string, userId: string): Promise<UserQuestProgress>;
|
|
2446
|
+
/**
|
|
2447
|
+
* Mark a quest step as in-progress (started).
|
|
2448
|
+
*
|
|
2449
|
+
* Call this when the user clicks a CTA link to begin a challenge.
|
|
2450
|
+
* Sets the step to 'in_progress' status so the frontend can show
|
|
2451
|
+
* a pending state while waiting for the completion event to fire.
|
|
2452
|
+
*
|
|
2453
|
+
* Idempotent — safe to call multiple times for the same step.
|
|
2454
|
+
*/
|
|
2455
|
+
startStep(questId: string, userId: string, stepIndex: number): Promise<StepStartResult>;
|
|
2428
2456
|
/**
|
|
2429
2457
|
* Complete a step manually by step index
|
|
2430
2458
|
*/
|
|
@@ -2436,7 +2464,7 @@ declare class QuestsClient {
|
|
|
2436
2464
|
/**
|
|
2437
2465
|
* Claim a completed quest reward.
|
|
2438
2466
|
* Only applicable for quests with reward_mode='claimable'.
|
|
2439
|
-
* Transitions the quest from
|
|
2467
|
+
* Transitions the quest from COMPLETED to CLAIMED
|
|
2440
2468
|
* and awards points + creates the earned reward.
|
|
2441
2469
|
*/
|
|
2442
2470
|
claimReward(questId: string, userId: string): Promise<ClaimRewardResult>;
|
|
@@ -3092,7 +3120,7 @@ interface PushSubscriptionJSON {
|
|
|
3092
3120
|
};
|
|
3093
3121
|
}
|
|
3094
3122
|
/** Notification event types pushed by the server. */
|
|
3095
|
-
type NotificationEventType = 'connected' | 'quest_step_completed' | 'quest_completed' | 'reward_earned' | 'reward_distributed' | 'reward_claimable' | 'points_awarded' | 'badge_earned' | 'level_up';
|
|
3123
|
+
type NotificationEventType = 'connected' | 'quest_step_started' | 'quest_step_completed' | 'quest_completed' | 'reward_earned' | 'reward_distributed' | 'reward_claimable' | 'points_awarded' | 'badge_earned' | 'level_up';
|
|
3096
3124
|
/** A notification event received from the SSE stream. */
|
|
3097
3125
|
interface NotificationEvent {
|
|
3098
3126
|
/** Unique event ID */
|
|
@@ -3408,6 +3436,141 @@ declare class CredentialsClient {
|
|
|
3408
3436
|
verify(verificationCode: string): Promise<CredentialVerifyResult>;
|
|
3409
3437
|
}
|
|
3410
3438
|
|
|
3439
|
+
/**
|
|
3440
|
+
* NFT Minting Client — Standalone NFT minting service.
|
|
3441
|
+
*/
|
|
3442
|
+
|
|
3443
|
+
interface MintNFTRequest {
|
|
3444
|
+
/** Wallet address to receive the NFT */
|
|
3445
|
+
recipientAddress: string;
|
|
3446
|
+
/** NFT name */
|
|
3447
|
+
name: string;
|
|
3448
|
+
/** Image file (Blob, File, or ArrayBuffer) — provide this OR imageUrl */
|
|
3449
|
+
image?: Blob | File | ArrayBuffer;
|
|
3450
|
+
/** Filename for the image (used when image is a Blob/ArrayBuffer) */
|
|
3451
|
+
imageFilename?: string;
|
|
3452
|
+
/** External image URL — provide this OR image */
|
|
3453
|
+
imageUrl?: string;
|
|
3454
|
+
/** Optional end-user external_id */
|
|
3455
|
+
recipientUserId?: string;
|
|
3456
|
+
/** NFT description */
|
|
3457
|
+
description?: string;
|
|
3458
|
+
/** Whether the NFT is soulbound (non-transferable) */
|
|
3459
|
+
soulbound?: boolean;
|
|
3460
|
+
/** Validity period in days */
|
|
3461
|
+
validityDays?: number;
|
|
3462
|
+
/** Blockchain network (default: "base") */
|
|
3463
|
+
network?: string;
|
|
3464
|
+
/** Contract address override */
|
|
3465
|
+
contractAddress?: string;
|
|
3466
|
+
/** Extra metadata attributes to merge */
|
|
3467
|
+
metadata?: Record<string, unknown>;
|
|
3468
|
+
}
|
|
3469
|
+
interface NFTMint {
|
|
3470
|
+
id: string;
|
|
3471
|
+
tenant_id: string;
|
|
3472
|
+
recipient_address: string;
|
|
3473
|
+
recipient_user_id: string | null;
|
|
3474
|
+
token_id: number | null;
|
|
3475
|
+
tx_hash: string | null;
|
|
3476
|
+
contract_address: string;
|
|
3477
|
+
network: string;
|
|
3478
|
+
content_hash: string | null;
|
|
3479
|
+
cert_type: number;
|
|
3480
|
+
validity_days: number | null;
|
|
3481
|
+
metadata: Record<string, unknown> | null;
|
|
3482
|
+
metadata_uri: string | null;
|
|
3483
|
+
image_url: string;
|
|
3484
|
+
image_storage_path: string | null;
|
|
3485
|
+
name: string;
|
|
3486
|
+
description: string | null;
|
|
3487
|
+
status: string;
|
|
3488
|
+
error_message: string | null;
|
|
3489
|
+
gas_used: string | null;
|
|
3490
|
+
created_at: string | null;
|
|
3491
|
+
updated_at: string | null;
|
|
3492
|
+
}
|
|
3493
|
+
interface ListMintsOptions {
|
|
3494
|
+
recipientAddress?: string;
|
|
3495
|
+
network?: string;
|
|
3496
|
+
status?: string;
|
|
3497
|
+
limit?: number;
|
|
3498
|
+
offset?: number;
|
|
3499
|
+
}
|
|
3500
|
+
interface ListMintsResponse {
|
|
3501
|
+
mints: NFTMint[];
|
|
3502
|
+
total: number;
|
|
3503
|
+
}
|
|
3504
|
+
declare class NftClient {
|
|
3505
|
+
private http;
|
|
3506
|
+
constructor(http: HttpClient);
|
|
3507
|
+
/**
|
|
3508
|
+
* Mint an NFT and send it to a wallet address.
|
|
3509
|
+
*/
|
|
3510
|
+
mint(request: MintNFTRequest): Promise<NFTMint>;
|
|
3511
|
+
/**
|
|
3512
|
+
* List NFT mints for the current tenant.
|
|
3513
|
+
*/
|
|
3514
|
+
list(options?: ListMintsOptions): Promise<ListMintsResponse>;
|
|
3515
|
+
/**
|
|
3516
|
+
* Get a single NFT mint by ID.
|
|
3517
|
+
*/
|
|
3518
|
+
get(mintId: string): Promise<NFTMint>;
|
|
3519
|
+
}
|
|
3520
|
+
|
|
3521
|
+
/**
|
|
3522
|
+
* Partner Keys Resource - OTT (One-Time Token) auth for partner integrations
|
|
3523
|
+
*/
|
|
3524
|
+
|
|
3525
|
+
interface OTTRequestResponse {
|
|
3526
|
+
ott: string;
|
|
3527
|
+
expires_in: number;
|
|
3528
|
+
}
|
|
3529
|
+
interface OTTRedeemResponse {
|
|
3530
|
+
user_id: string;
|
|
3531
|
+
session_timeout: number;
|
|
3532
|
+
session_data: Record<string, unknown>;
|
|
3533
|
+
jwt?: string;
|
|
3534
|
+
}
|
|
3535
|
+
interface OTTConfigUpdate {
|
|
3536
|
+
ott_enabled?: boolean;
|
|
3537
|
+
ott_ttl_seconds?: number;
|
|
3538
|
+
ott_redemption_mode?: 'jwt' | 'cookie';
|
|
3539
|
+
ott_jwt_ttl_seconds?: number;
|
|
3540
|
+
ott_session_data_keys?: string[];
|
|
3541
|
+
}
|
|
3542
|
+
interface OTTConfigResponse {
|
|
3543
|
+
partner_key_id: string;
|
|
3544
|
+
partner_name: string;
|
|
3545
|
+
ott_enabled: boolean;
|
|
3546
|
+
ott_ttl_seconds: number;
|
|
3547
|
+
ott_redemption_mode: 'jwt' | 'cookie';
|
|
3548
|
+
ott_jwt_ttl_seconds: number;
|
|
3549
|
+
ott_session_data_keys?: string[];
|
|
3550
|
+
}
|
|
3551
|
+
declare class PartnerKeysClient {
|
|
3552
|
+
private http;
|
|
3553
|
+
constructor(http: HttpClient);
|
|
3554
|
+
/**
|
|
3555
|
+
* Request a one-time token for a partner key (end-user JWKS auth).
|
|
3556
|
+
*/
|
|
3557
|
+
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
|
+
/**
|
|
3565
|
+
* Update OTT configuration for a partner key.
|
|
3566
|
+
*/
|
|
3567
|
+
updateOTTConfig(keyId: string, config: OTTConfigUpdate): Promise<OTTConfigResponse>;
|
|
3568
|
+
/**
|
|
3569
|
+
* Get OTT configuration for a partner key.
|
|
3570
|
+
*/
|
|
3571
|
+
getOTTConfig(keyId: string): Promise<OTTConfigResponse>;
|
|
3572
|
+
}
|
|
3573
|
+
|
|
3411
3574
|
/**
|
|
3412
3575
|
* ProofChain Client
|
|
3413
3576
|
*/
|
|
@@ -3606,6 +3769,10 @@ declare class ProofChain {
|
|
|
3606
3769
|
notifications: NotificationsClient;
|
|
3607
3770
|
/** Credentials client for portable identity credentials */
|
|
3608
3771
|
credentials: CredentialsClient;
|
|
3772
|
+
/** NFT client for standalone NFT minting */
|
|
3773
|
+
nft: NftClient;
|
|
3774
|
+
/** Partner Keys client for OTT auth operations */
|
|
3775
|
+
partnerKeys: PartnerKeysClient;
|
|
3609
3776
|
constructor(options: ProofChainOptions);
|
|
3610
3777
|
/**
|
|
3611
3778
|
* Create a client for end-user JWT authentication (PWA/frontend use).
|
|
@@ -3821,4 +3988,4 @@ declare class TimeoutError extends ProofChainError {
|
|
|
3821
3988
|
constructor(message?: string);
|
|
3822
3989
|
}
|
|
3823
3990
|
|
|
3824
|
-
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 ListQuestsOptions, type ListRewardsOptions, type ListSchemasOptions, type ManualRewardRequest, type MergeUsersRequest, type Milestone, type NFT, NetworkError, NotFoundError, type NotificationCallback, type NotificationEvent, type NotificationEventType, NotificationsClient, 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 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 };
|
|
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 };
|
package/dist/index.js
CHANGED
|
@@ -34,8 +34,10 @@ __export(index_exports, {
|
|
|
34
34
|
FanpassLeaderboardClient: () => FanpassLeaderboardClient,
|
|
35
35
|
IngestionClient: () => IngestionClient,
|
|
36
36
|
NetworkError: () => NetworkError,
|
|
37
|
+
NftClient: () => NftClient,
|
|
37
38
|
NotFoundError: () => NotFoundError,
|
|
38
39
|
NotificationsClient: () => NotificationsClient,
|
|
40
|
+
PartnerKeysClient: () => PartnerKeysClient,
|
|
39
41
|
PassportClient: () => PassportClient,
|
|
40
42
|
ProofChain: () => ProofChain,
|
|
41
43
|
ProofChainError: () => ProofChainError,
|
|
@@ -1804,6 +1806,21 @@ var QuestsClient = class {
|
|
|
1804
1806
|
async getUserProgress(questId, userId) {
|
|
1805
1807
|
return this.http.get(`/quests/${questId}/progress/${encodeURIComponent(userId)}`);
|
|
1806
1808
|
}
|
|
1809
|
+
/**
|
|
1810
|
+
* Mark a quest step as in-progress (started).
|
|
1811
|
+
*
|
|
1812
|
+
* Call this when the user clicks a CTA link to begin a challenge.
|
|
1813
|
+
* Sets the step to 'in_progress' status so the frontend can show
|
|
1814
|
+
* a pending state while waiting for the completion event to fire.
|
|
1815
|
+
*
|
|
1816
|
+
* Idempotent — safe to call multiple times for the same step.
|
|
1817
|
+
*/
|
|
1818
|
+
async startStep(questId, userId, stepIndex) {
|
|
1819
|
+
return this.http.post(
|
|
1820
|
+
`/quests/${questId}/progress/${encodeURIComponent(userId)}/step/${stepIndex}/start`,
|
|
1821
|
+
{}
|
|
1822
|
+
);
|
|
1823
|
+
}
|
|
1807
1824
|
/**
|
|
1808
1825
|
* Complete a step manually by step index
|
|
1809
1826
|
*/
|
|
@@ -1822,7 +1839,7 @@ var QuestsClient = class {
|
|
|
1822
1839
|
/**
|
|
1823
1840
|
* Claim a completed quest reward.
|
|
1824
1841
|
* Only applicable for quests with reward_mode='claimable'.
|
|
1825
|
-
* Transitions the quest from
|
|
1842
|
+
* Transitions the quest from COMPLETED to CLAIMED
|
|
1826
1843
|
* and awards points + creates the earned reward.
|
|
1827
1844
|
*/
|
|
1828
1845
|
async claimReward(questId, userId) {
|
|
@@ -2618,6 +2635,106 @@ var CredentialsClient = class {
|
|
|
2618
2635
|
}
|
|
2619
2636
|
};
|
|
2620
2637
|
|
|
2638
|
+
// src/nft.ts
|
|
2639
|
+
var NftClient = class {
|
|
2640
|
+
constructor(http) {
|
|
2641
|
+
this.http = http;
|
|
2642
|
+
}
|
|
2643
|
+
/**
|
|
2644
|
+
* Mint an NFT and send it to a wallet address.
|
|
2645
|
+
*/
|
|
2646
|
+
async mint(request) {
|
|
2647
|
+
const formData = new FormData();
|
|
2648
|
+
formData.append("recipient_address", request.recipientAddress);
|
|
2649
|
+
formData.append("name", request.name);
|
|
2650
|
+
if (request.image) {
|
|
2651
|
+
let blob;
|
|
2652
|
+
if (request.image instanceof Blob) {
|
|
2653
|
+
blob = request.image;
|
|
2654
|
+
} else if (request.image instanceof ArrayBuffer) {
|
|
2655
|
+
blob = new Blob([request.image]);
|
|
2656
|
+
} else {
|
|
2657
|
+
blob = new Blob([request.image]);
|
|
2658
|
+
}
|
|
2659
|
+
formData.append("image", blob, request.imageFilename || "image.png");
|
|
2660
|
+
}
|
|
2661
|
+
if (request.imageUrl) {
|
|
2662
|
+
formData.append("image_url", request.imageUrl);
|
|
2663
|
+
}
|
|
2664
|
+
if (request.recipientUserId) {
|
|
2665
|
+
formData.append("recipient_user_id", request.recipientUserId);
|
|
2666
|
+
}
|
|
2667
|
+
if (request.description) {
|
|
2668
|
+
formData.append("description", request.description);
|
|
2669
|
+
}
|
|
2670
|
+
if (request.soulbound !== void 0) {
|
|
2671
|
+
formData.append("soulbound", String(request.soulbound));
|
|
2672
|
+
}
|
|
2673
|
+
if (request.validityDays !== void 0) {
|
|
2674
|
+
formData.append("validity_days", String(request.validityDays));
|
|
2675
|
+
}
|
|
2676
|
+
if (request.network) {
|
|
2677
|
+
formData.append("network", request.network);
|
|
2678
|
+
}
|
|
2679
|
+
if (request.contractAddress) {
|
|
2680
|
+
formData.append("contract_address", request.contractAddress);
|
|
2681
|
+
}
|
|
2682
|
+
if (request.metadata) {
|
|
2683
|
+
formData.append("metadata", JSON.stringify(request.metadata));
|
|
2684
|
+
}
|
|
2685
|
+
return this.http.requestMultipart("/nft/mint", formData);
|
|
2686
|
+
}
|
|
2687
|
+
/**
|
|
2688
|
+
* List NFT mints for the current tenant.
|
|
2689
|
+
*/
|
|
2690
|
+
async list(options = {}) {
|
|
2691
|
+
return this.http.get("/nft/mints", {
|
|
2692
|
+
recipient_address: options.recipientAddress,
|
|
2693
|
+
network: options.network,
|
|
2694
|
+
status: options.status,
|
|
2695
|
+
limit: options.limit,
|
|
2696
|
+
offset: options.offset
|
|
2697
|
+
});
|
|
2698
|
+
}
|
|
2699
|
+
/**
|
|
2700
|
+
* Get a single NFT mint by ID.
|
|
2701
|
+
*/
|
|
2702
|
+
async get(mintId) {
|
|
2703
|
+
return this.http.get(`/nft/mints/${mintId}`);
|
|
2704
|
+
}
|
|
2705
|
+
};
|
|
2706
|
+
|
|
2707
|
+
// src/partner-keys.ts
|
|
2708
|
+
var PartnerKeysClient = class {
|
|
2709
|
+
constructor(http) {
|
|
2710
|
+
this.http = http;
|
|
2711
|
+
}
|
|
2712
|
+
/**
|
|
2713
|
+
* Request a one-time token for a partner key (end-user JWKS auth).
|
|
2714
|
+
*/
|
|
2715
|
+
async requestOTT(keyId) {
|
|
2716
|
+
return this.http.post(`/partner-keys/${keyId}/ott/request`);
|
|
2717
|
+
}
|
|
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
|
+
/**
|
|
2725
|
+
* Update OTT configuration for a partner key.
|
|
2726
|
+
*/
|
|
2727
|
+
async updateOTTConfig(keyId, config) {
|
|
2728
|
+
return this.http.patch(`/partner-keys/${keyId}/ott-config`, config);
|
|
2729
|
+
}
|
|
2730
|
+
/**
|
|
2731
|
+
* Get OTT configuration for a partner key.
|
|
2732
|
+
*/
|
|
2733
|
+
async getOTTConfig(keyId) {
|
|
2734
|
+
return this.http.get(`/partner-keys/${keyId}/ott-config`);
|
|
2735
|
+
}
|
|
2736
|
+
};
|
|
2737
|
+
|
|
2621
2738
|
// src/client.ts
|
|
2622
2739
|
var DocumentsResource = class {
|
|
2623
2740
|
constructor(http) {
|
|
@@ -2917,6 +3034,8 @@ var ProofChain = class _ProofChain {
|
|
|
2917
3034
|
this.fanpassLeaderboard = new FanpassLeaderboardClient(this.http);
|
|
2918
3035
|
this.notifications = new NotificationsClient(this.http);
|
|
2919
3036
|
this.credentials = new CredentialsClient(this.http);
|
|
3037
|
+
this.nft = new NftClient(this.http);
|
|
3038
|
+
this.partnerKeys = new PartnerKeysClient(this.http);
|
|
2920
3039
|
}
|
|
2921
3040
|
/**
|
|
2922
3041
|
* Create a client for end-user JWT authentication (PWA/frontend use).
|
|
@@ -3260,8 +3379,10 @@ var EndUserIngestionClient = class {
|
|
|
3260
3379
|
FanpassLeaderboardClient,
|
|
3261
3380
|
IngestionClient,
|
|
3262
3381
|
NetworkError,
|
|
3382
|
+
NftClient,
|
|
3263
3383
|
NotFoundError,
|
|
3264
3384
|
NotificationsClient,
|
|
3385
|
+
PartnerKeysClient,
|
|
3265
3386
|
PassportClient,
|
|
3266
3387
|
ProofChain,
|
|
3267
3388
|
ProofChainError,
|
package/dist/index.mjs
CHANGED
|
@@ -1747,6 +1747,21 @@ var QuestsClient = class {
|
|
|
1747
1747
|
async getUserProgress(questId, userId) {
|
|
1748
1748
|
return this.http.get(`/quests/${questId}/progress/${encodeURIComponent(userId)}`);
|
|
1749
1749
|
}
|
|
1750
|
+
/**
|
|
1751
|
+
* Mark a quest step as in-progress (started).
|
|
1752
|
+
*
|
|
1753
|
+
* Call this when the user clicks a CTA link to begin a challenge.
|
|
1754
|
+
* Sets the step to 'in_progress' status so the frontend can show
|
|
1755
|
+
* a pending state while waiting for the completion event to fire.
|
|
1756
|
+
*
|
|
1757
|
+
* Idempotent — safe to call multiple times for the same step.
|
|
1758
|
+
*/
|
|
1759
|
+
async startStep(questId, userId, stepIndex) {
|
|
1760
|
+
return this.http.post(
|
|
1761
|
+
`/quests/${questId}/progress/${encodeURIComponent(userId)}/step/${stepIndex}/start`,
|
|
1762
|
+
{}
|
|
1763
|
+
);
|
|
1764
|
+
}
|
|
1750
1765
|
/**
|
|
1751
1766
|
* Complete a step manually by step index
|
|
1752
1767
|
*/
|
|
@@ -1765,7 +1780,7 @@ var QuestsClient = class {
|
|
|
1765
1780
|
/**
|
|
1766
1781
|
* Claim a completed quest reward.
|
|
1767
1782
|
* Only applicable for quests with reward_mode='claimable'.
|
|
1768
|
-
* Transitions the quest from
|
|
1783
|
+
* Transitions the quest from COMPLETED to CLAIMED
|
|
1769
1784
|
* and awards points + creates the earned reward.
|
|
1770
1785
|
*/
|
|
1771
1786
|
async claimReward(questId, userId) {
|
|
@@ -2561,6 +2576,106 @@ var CredentialsClient = class {
|
|
|
2561
2576
|
}
|
|
2562
2577
|
};
|
|
2563
2578
|
|
|
2579
|
+
// src/nft.ts
|
|
2580
|
+
var NftClient = class {
|
|
2581
|
+
constructor(http) {
|
|
2582
|
+
this.http = http;
|
|
2583
|
+
}
|
|
2584
|
+
/**
|
|
2585
|
+
* Mint an NFT and send it to a wallet address.
|
|
2586
|
+
*/
|
|
2587
|
+
async mint(request) {
|
|
2588
|
+
const formData = new FormData();
|
|
2589
|
+
formData.append("recipient_address", request.recipientAddress);
|
|
2590
|
+
formData.append("name", request.name);
|
|
2591
|
+
if (request.image) {
|
|
2592
|
+
let blob;
|
|
2593
|
+
if (request.image instanceof Blob) {
|
|
2594
|
+
blob = request.image;
|
|
2595
|
+
} else if (request.image instanceof ArrayBuffer) {
|
|
2596
|
+
blob = new Blob([request.image]);
|
|
2597
|
+
} else {
|
|
2598
|
+
blob = new Blob([request.image]);
|
|
2599
|
+
}
|
|
2600
|
+
formData.append("image", blob, request.imageFilename || "image.png");
|
|
2601
|
+
}
|
|
2602
|
+
if (request.imageUrl) {
|
|
2603
|
+
formData.append("image_url", request.imageUrl);
|
|
2604
|
+
}
|
|
2605
|
+
if (request.recipientUserId) {
|
|
2606
|
+
formData.append("recipient_user_id", request.recipientUserId);
|
|
2607
|
+
}
|
|
2608
|
+
if (request.description) {
|
|
2609
|
+
formData.append("description", request.description);
|
|
2610
|
+
}
|
|
2611
|
+
if (request.soulbound !== void 0) {
|
|
2612
|
+
formData.append("soulbound", String(request.soulbound));
|
|
2613
|
+
}
|
|
2614
|
+
if (request.validityDays !== void 0) {
|
|
2615
|
+
formData.append("validity_days", String(request.validityDays));
|
|
2616
|
+
}
|
|
2617
|
+
if (request.network) {
|
|
2618
|
+
formData.append("network", request.network);
|
|
2619
|
+
}
|
|
2620
|
+
if (request.contractAddress) {
|
|
2621
|
+
formData.append("contract_address", request.contractAddress);
|
|
2622
|
+
}
|
|
2623
|
+
if (request.metadata) {
|
|
2624
|
+
formData.append("metadata", JSON.stringify(request.metadata));
|
|
2625
|
+
}
|
|
2626
|
+
return this.http.requestMultipart("/nft/mint", formData);
|
|
2627
|
+
}
|
|
2628
|
+
/**
|
|
2629
|
+
* List NFT mints for the current tenant.
|
|
2630
|
+
*/
|
|
2631
|
+
async list(options = {}) {
|
|
2632
|
+
return this.http.get("/nft/mints", {
|
|
2633
|
+
recipient_address: options.recipientAddress,
|
|
2634
|
+
network: options.network,
|
|
2635
|
+
status: options.status,
|
|
2636
|
+
limit: options.limit,
|
|
2637
|
+
offset: options.offset
|
|
2638
|
+
});
|
|
2639
|
+
}
|
|
2640
|
+
/**
|
|
2641
|
+
* Get a single NFT mint by ID.
|
|
2642
|
+
*/
|
|
2643
|
+
async get(mintId) {
|
|
2644
|
+
return this.http.get(`/nft/mints/${mintId}`);
|
|
2645
|
+
}
|
|
2646
|
+
};
|
|
2647
|
+
|
|
2648
|
+
// src/partner-keys.ts
|
|
2649
|
+
var PartnerKeysClient = class {
|
|
2650
|
+
constructor(http) {
|
|
2651
|
+
this.http = http;
|
|
2652
|
+
}
|
|
2653
|
+
/**
|
|
2654
|
+
* Request a one-time token for a partner key (end-user JWKS auth).
|
|
2655
|
+
*/
|
|
2656
|
+
async requestOTT(keyId) {
|
|
2657
|
+
return this.http.post(`/partner-keys/${keyId}/ott/request`);
|
|
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
|
+
/**
|
|
2666
|
+
* Update OTT configuration for a partner key.
|
|
2667
|
+
*/
|
|
2668
|
+
async updateOTTConfig(keyId, config) {
|
|
2669
|
+
return this.http.patch(`/partner-keys/${keyId}/ott-config`, config);
|
|
2670
|
+
}
|
|
2671
|
+
/**
|
|
2672
|
+
* Get OTT configuration for a partner key.
|
|
2673
|
+
*/
|
|
2674
|
+
async getOTTConfig(keyId) {
|
|
2675
|
+
return this.http.get(`/partner-keys/${keyId}/ott-config`);
|
|
2676
|
+
}
|
|
2677
|
+
};
|
|
2678
|
+
|
|
2564
2679
|
// src/client.ts
|
|
2565
2680
|
var DocumentsResource = class {
|
|
2566
2681
|
constructor(http) {
|
|
@@ -2860,6 +2975,8 @@ var ProofChain = class _ProofChain {
|
|
|
2860
2975
|
this.fanpassLeaderboard = new FanpassLeaderboardClient(this.http);
|
|
2861
2976
|
this.notifications = new NotificationsClient(this.http);
|
|
2862
2977
|
this.credentials = new CredentialsClient(this.http);
|
|
2978
|
+
this.nft = new NftClient(this.http);
|
|
2979
|
+
this.partnerKeys = new PartnerKeysClient(this.http);
|
|
2863
2980
|
}
|
|
2864
2981
|
/**
|
|
2865
2982
|
* Create a client for end-user JWT authentication (PWA/frontend use).
|
|
@@ -3202,8 +3319,10 @@ export {
|
|
|
3202
3319
|
FanpassLeaderboardClient,
|
|
3203
3320
|
IngestionClient,
|
|
3204
3321
|
NetworkError,
|
|
3322
|
+
NftClient,
|
|
3205
3323
|
NotFoundError,
|
|
3206
3324
|
NotificationsClient,
|
|
3325
|
+
PartnerKeysClient,
|
|
3207
3326
|
PassportClient,
|
|
3208
3327
|
ProofChain,
|
|
3209
3328
|
ProofChainError,
|
package/package.json
CHANGED