@proofchain/sdk 2.20.0 → 2.21.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +134 -2
- package/dist/index.d.ts +134 -2
- package/dist/index.js +136 -24
- package/dist/index.mjs +134 -24
- 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[];
|
|
@@ -3433,6 +3436,129 @@ declare class CredentialsClient {
|
|
|
3433
3436
|
verify(verificationCode: string): Promise<CredentialVerifyResult>;
|
|
3434
3437
|
}
|
|
3435
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 OTTConfigUpdate {
|
|
3530
|
+
ott_enabled?: boolean;
|
|
3531
|
+
ott_ttl_seconds?: number;
|
|
3532
|
+
ott_redemption_mode?: 'jwt' | 'cookie';
|
|
3533
|
+
ott_jwt_ttl_seconds?: number;
|
|
3534
|
+
ott_session_data_keys?: string[];
|
|
3535
|
+
}
|
|
3536
|
+
interface OTTConfigResponse {
|
|
3537
|
+
partner_key_id: string;
|
|
3538
|
+
partner_name: string;
|
|
3539
|
+
ott_enabled: boolean;
|
|
3540
|
+
ott_ttl_seconds: number;
|
|
3541
|
+
ott_redemption_mode: 'jwt' | 'cookie';
|
|
3542
|
+
ott_jwt_ttl_seconds: number;
|
|
3543
|
+
ott_session_data_keys?: string[];
|
|
3544
|
+
}
|
|
3545
|
+
declare class PartnerKeysClient {
|
|
3546
|
+
private http;
|
|
3547
|
+
constructor(http: HttpClient);
|
|
3548
|
+
/**
|
|
3549
|
+
* Request a one-time token for a partner key (end-user JWKS auth).
|
|
3550
|
+
*/
|
|
3551
|
+
requestOTT(keyId: string): Promise<OTTRequestResponse>;
|
|
3552
|
+
/**
|
|
3553
|
+
* Update OTT configuration for a partner key.
|
|
3554
|
+
*/
|
|
3555
|
+
updateOTTConfig(keyId: string, config: OTTConfigUpdate): Promise<OTTConfigResponse>;
|
|
3556
|
+
/**
|
|
3557
|
+
* Get OTT configuration for a partner key.
|
|
3558
|
+
*/
|
|
3559
|
+
getOTTConfig(keyId: string): Promise<OTTConfigResponse>;
|
|
3560
|
+
}
|
|
3561
|
+
|
|
3436
3562
|
/**
|
|
3437
3563
|
* ProofChain Client
|
|
3438
3564
|
*/
|
|
@@ -3631,6 +3757,10 @@ declare class ProofChain {
|
|
|
3631
3757
|
notifications: NotificationsClient;
|
|
3632
3758
|
/** Credentials client for portable identity credentials */
|
|
3633
3759
|
credentials: CredentialsClient;
|
|
3760
|
+
/** NFT client for standalone NFT minting */
|
|
3761
|
+
nft: NftClient;
|
|
3762
|
+
/** Partner Keys client for OTT auth operations */
|
|
3763
|
+
partnerKeys: PartnerKeysClient;
|
|
3634
3764
|
constructor(options: ProofChainOptions);
|
|
3635
3765
|
/**
|
|
3636
3766
|
* Create a client for end-user JWT authentication (PWA/frontend use).
|
|
@@ -3684,6 +3814,8 @@ interface IngestEventRequest {
|
|
|
3684
3814
|
data?: Record<string, unknown>;
|
|
3685
3815
|
eventSource?: string;
|
|
3686
3816
|
schemaIds?: string[];
|
|
3817
|
+
/** Hot attestation — immediate on-chain TX per event (higher cost, lower latency) */
|
|
3818
|
+
hot?: boolean;
|
|
3687
3819
|
}
|
|
3688
3820
|
interface IngestEventResponse {
|
|
3689
3821
|
eventId: string;
|
|
@@ -3846,4 +3978,4 @@ declare class TimeoutError extends ProofChainError {
|
|
|
3846
3978
|
constructor(message?: string);
|
|
3847
3979
|
}
|
|
3848
3980
|
|
|
3849
|
-
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 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 };
|
|
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 };
|
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[];
|
|
@@ -3433,6 +3436,129 @@ declare class CredentialsClient {
|
|
|
3433
3436
|
verify(verificationCode: string): Promise<CredentialVerifyResult>;
|
|
3434
3437
|
}
|
|
3435
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 OTTConfigUpdate {
|
|
3530
|
+
ott_enabled?: boolean;
|
|
3531
|
+
ott_ttl_seconds?: number;
|
|
3532
|
+
ott_redemption_mode?: 'jwt' | 'cookie';
|
|
3533
|
+
ott_jwt_ttl_seconds?: number;
|
|
3534
|
+
ott_session_data_keys?: string[];
|
|
3535
|
+
}
|
|
3536
|
+
interface OTTConfigResponse {
|
|
3537
|
+
partner_key_id: string;
|
|
3538
|
+
partner_name: string;
|
|
3539
|
+
ott_enabled: boolean;
|
|
3540
|
+
ott_ttl_seconds: number;
|
|
3541
|
+
ott_redemption_mode: 'jwt' | 'cookie';
|
|
3542
|
+
ott_jwt_ttl_seconds: number;
|
|
3543
|
+
ott_session_data_keys?: string[];
|
|
3544
|
+
}
|
|
3545
|
+
declare class PartnerKeysClient {
|
|
3546
|
+
private http;
|
|
3547
|
+
constructor(http: HttpClient);
|
|
3548
|
+
/**
|
|
3549
|
+
* Request a one-time token for a partner key (end-user JWKS auth).
|
|
3550
|
+
*/
|
|
3551
|
+
requestOTT(keyId: string): Promise<OTTRequestResponse>;
|
|
3552
|
+
/**
|
|
3553
|
+
* Update OTT configuration for a partner key.
|
|
3554
|
+
*/
|
|
3555
|
+
updateOTTConfig(keyId: string, config: OTTConfigUpdate): Promise<OTTConfigResponse>;
|
|
3556
|
+
/**
|
|
3557
|
+
* Get OTT configuration for a partner key.
|
|
3558
|
+
*/
|
|
3559
|
+
getOTTConfig(keyId: string): Promise<OTTConfigResponse>;
|
|
3560
|
+
}
|
|
3561
|
+
|
|
3436
3562
|
/**
|
|
3437
3563
|
* ProofChain Client
|
|
3438
3564
|
*/
|
|
@@ -3631,6 +3757,10 @@ declare class ProofChain {
|
|
|
3631
3757
|
notifications: NotificationsClient;
|
|
3632
3758
|
/** Credentials client for portable identity credentials */
|
|
3633
3759
|
credentials: CredentialsClient;
|
|
3760
|
+
/** NFT client for standalone NFT minting */
|
|
3761
|
+
nft: NftClient;
|
|
3762
|
+
/** Partner Keys client for OTT auth operations */
|
|
3763
|
+
partnerKeys: PartnerKeysClient;
|
|
3634
3764
|
constructor(options: ProofChainOptions);
|
|
3635
3765
|
/**
|
|
3636
3766
|
* Create a client for end-user JWT authentication (PWA/frontend use).
|
|
@@ -3684,6 +3814,8 @@ interface IngestEventRequest {
|
|
|
3684
3814
|
data?: Record<string, unknown>;
|
|
3685
3815
|
eventSource?: string;
|
|
3686
3816
|
schemaIds?: string[];
|
|
3817
|
+
/** Hot attestation — immediate on-chain TX per event (higher cost, lower latency) */
|
|
3818
|
+
hot?: boolean;
|
|
3687
3819
|
}
|
|
3688
3820
|
interface IngestEventResponse {
|
|
3689
3821
|
eventId: string;
|
|
@@ -3846,4 +3978,4 @@ declare class TimeoutError extends ProofChainError {
|
|
|
3846
3978
|
constructor(message?: string);
|
|
3847
3979
|
}
|
|
3848
3980
|
|
|
3849
|
-
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 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 };
|
|
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 };
|
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,
|
|
@@ -2633,6 +2635,100 @@ var CredentialsClient = class {
|
|
|
2633
2635
|
}
|
|
2634
2636
|
};
|
|
2635
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
|
+
* Update OTT configuration for a partner key.
|
|
2720
|
+
*/
|
|
2721
|
+
async updateOTTConfig(keyId, config) {
|
|
2722
|
+
return this.http.patch(`/partner-keys/${keyId}/ott-config`, config);
|
|
2723
|
+
}
|
|
2724
|
+
/**
|
|
2725
|
+
* Get OTT configuration for a partner key.
|
|
2726
|
+
*/
|
|
2727
|
+
async getOTTConfig(keyId) {
|
|
2728
|
+
return this.http.get(`/partner-keys/${keyId}/ott-config`);
|
|
2729
|
+
}
|
|
2730
|
+
};
|
|
2731
|
+
|
|
2636
2732
|
// src/client.ts
|
|
2637
2733
|
var DocumentsResource = class {
|
|
2638
2734
|
constructor(http) {
|
|
@@ -2932,6 +3028,8 @@ var ProofChain = class _ProofChain {
|
|
|
2932
3028
|
this.fanpassLeaderboard = new FanpassLeaderboardClient(this.http);
|
|
2933
3029
|
this.notifications = new NotificationsClient(this.http);
|
|
2934
3030
|
this.credentials = new CredentialsClient(this.http);
|
|
3031
|
+
this.nft = new NftClient(this.http);
|
|
3032
|
+
this.partnerKeys = new PartnerKeysClient(this.http);
|
|
2935
3033
|
}
|
|
2936
3034
|
/**
|
|
2937
3035
|
* Create a client for end-user JWT authentication (PWA/frontend use).
|
|
@@ -3040,15 +3138,17 @@ var IngestionClient = class {
|
|
|
3040
3138
|
if (request.schemaIds?.length) {
|
|
3041
3139
|
headers["X-Schemas"] = request.schemaIds.join(",");
|
|
3042
3140
|
}
|
|
3141
|
+
const body = {
|
|
3142
|
+
user_id: request.userId,
|
|
3143
|
+
event_type: request.eventType,
|
|
3144
|
+
data: request.data || {},
|
|
3145
|
+
event_source: request.eventSource || "sdk"
|
|
3146
|
+
};
|
|
3147
|
+
if (request.hot) body.hot = true;
|
|
3043
3148
|
const response = await fetch(`${this.ingestUrl}/events/ingest`, {
|
|
3044
3149
|
method: "POST",
|
|
3045
3150
|
headers,
|
|
3046
|
-
body: JSON.stringify(
|
|
3047
|
-
user_id: request.userId,
|
|
3048
|
-
event_type: request.eventType,
|
|
3049
|
-
data: request.data || {},
|
|
3050
|
-
event_source: request.eventSource || "sdk"
|
|
3051
|
-
}),
|
|
3151
|
+
body: JSON.stringify(body),
|
|
3052
3152
|
signal: controller.signal
|
|
3053
3153
|
});
|
|
3054
3154
|
const result = await this.handleResponse(response);
|
|
@@ -3083,12 +3183,16 @@ var IngestionClient = class {
|
|
|
3083
3183
|
method: "POST",
|
|
3084
3184
|
headers: this.getHeaders(),
|
|
3085
3185
|
body: JSON.stringify(
|
|
3086
|
-
request.events.map((e) =>
|
|
3087
|
-
|
|
3088
|
-
|
|
3089
|
-
|
|
3090
|
-
|
|
3091
|
-
|
|
3186
|
+
request.events.map((e) => {
|
|
3187
|
+
const ev = {
|
|
3188
|
+
user_id: e.userId,
|
|
3189
|
+
event_type: e.eventType,
|
|
3190
|
+
data: e.data || {},
|
|
3191
|
+
event_source: e.eventSource || "sdk"
|
|
3192
|
+
};
|
|
3193
|
+
if (e.hot) ev.hot = true;
|
|
3194
|
+
return ev;
|
|
3195
|
+
})
|
|
3092
3196
|
),
|
|
3093
3197
|
signal: controller.signal
|
|
3094
3198
|
});
|
|
@@ -3186,15 +3290,17 @@ var EndUserIngestionClient = class {
|
|
|
3186
3290
|
const controller = new AbortController();
|
|
3187
3291
|
const timeoutId = setTimeout(() => controller.abort(), this.timeout);
|
|
3188
3292
|
try {
|
|
3293
|
+
const endUserBody = {
|
|
3294
|
+
user_id: request.userId,
|
|
3295
|
+
event_type: request.eventType,
|
|
3296
|
+
data: request.data || {},
|
|
3297
|
+
event_source: request.eventSource || "end_user_sdk"
|
|
3298
|
+
};
|
|
3299
|
+
if (request.hot) endUserBody.hot = true;
|
|
3189
3300
|
const response = await fetch(`${this.apiUrl}/end-user/events/ingest`, {
|
|
3190
3301
|
method: "POST",
|
|
3191
3302
|
headers: this.getHeaders(),
|
|
3192
|
-
body: JSON.stringify(
|
|
3193
|
-
user_id: request.userId,
|
|
3194
|
-
event_type: request.eventType,
|
|
3195
|
-
data: request.data || {},
|
|
3196
|
-
event_source: request.eventSource || "end_user_sdk"
|
|
3197
|
-
}),
|
|
3303
|
+
body: JSON.stringify(endUserBody),
|
|
3198
3304
|
signal: controller.signal
|
|
3199
3305
|
});
|
|
3200
3306
|
const result = await this.handleResponse(response);
|
|
@@ -3229,12 +3335,16 @@ var EndUserIngestionClient = class {
|
|
|
3229
3335
|
method: "POST",
|
|
3230
3336
|
headers: this.getHeaders(),
|
|
3231
3337
|
body: JSON.stringify({
|
|
3232
|
-
events: request.events.map((e) =>
|
|
3233
|
-
|
|
3234
|
-
|
|
3235
|
-
|
|
3236
|
-
|
|
3237
|
-
|
|
3338
|
+
events: request.events.map((e) => {
|
|
3339
|
+
const ev = {
|
|
3340
|
+
user_id: e.userId,
|
|
3341
|
+
event_type: e.eventType,
|
|
3342
|
+
data: e.data || {},
|
|
3343
|
+
event_source: e.eventSource || "end_user_sdk"
|
|
3344
|
+
};
|
|
3345
|
+
if (e.hot) ev.hot = true;
|
|
3346
|
+
return ev;
|
|
3347
|
+
})
|
|
3238
3348
|
}),
|
|
3239
3349
|
signal: controller.signal
|
|
3240
3350
|
});
|
|
@@ -3275,8 +3385,10 @@ var EndUserIngestionClient = class {
|
|
|
3275
3385
|
FanpassLeaderboardClient,
|
|
3276
3386
|
IngestionClient,
|
|
3277
3387
|
NetworkError,
|
|
3388
|
+
NftClient,
|
|
3278
3389
|
NotFoundError,
|
|
3279
3390
|
NotificationsClient,
|
|
3391
|
+
PartnerKeysClient,
|
|
3280
3392
|
PassportClient,
|
|
3281
3393
|
ProofChain,
|
|
3282
3394
|
ProofChainError,
|
package/dist/index.mjs
CHANGED
|
@@ -2576,6 +2576,100 @@ var CredentialsClient = class {
|
|
|
2576
2576
|
}
|
|
2577
2577
|
};
|
|
2578
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
|
+
* Update OTT configuration for a partner key.
|
|
2661
|
+
*/
|
|
2662
|
+
async updateOTTConfig(keyId, config) {
|
|
2663
|
+
return this.http.patch(`/partner-keys/${keyId}/ott-config`, config);
|
|
2664
|
+
}
|
|
2665
|
+
/**
|
|
2666
|
+
* Get OTT configuration for a partner key.
|
|
2667
|
+
*/
|
|
2668
|
+
async getOTTConfig(keyId) {
|
|
2669
|
+
return this.http.get(`/partner-keys/${keyId}/ott-config`);
|
|
2670
|
+
}
|
|
2671
|
+
};
|
|
2672
|
+
|
|
2579
2673
|
// src/client.ts
|
|
2580
2674
|
var DocumentsResource = class {
|
|
2581
2675
|
constructor(http) {
|
|
@@ -2875,6 +2969,8 @@ var ProofChain = class _ProofChain {
|
|
|
2875
2969
|
this.fanpassLeaderboard = new FanpassLeaderboardClient(this.http);
|
|
2876
2970
|
this.notifications = new NotificationsClient(this.http);
|
|
2877
2971
|
this.credentials = new CredentialsClient(this.http);
|
|
2972
|
+
this.nft = new NftClient(this.http);
|
|
2973
|
+
this.partnerKeys = new PartnerKeysClient(this.http);
|
|
2878
2974
|
}
|
|
2879
2975
|
/**
|
|
2880
2976
|
* Create a client for end-user JWT authentication (PWA/frontend use).
|
|
@@ -2983,15 +3079,17 @@ var IngestionClient = class {
|
|
|
2983
3079
|
if (request.schemaIds?.length) {
|
|
2984
3080
|
headers["X-Schemas"] = request.schemaIds.join(",");
|
|
2985
3081
|
}
|
|
3082
|
+
const body = {
|
|
3083
|
+
user_id: request.userId,
|
|
3084
|
+
event_type: request.eventType,
|
|
3085
|
+
data: request.data || {},
|
|
3086
|
+
event_source: request.eventSource || "sdk"
|
|
3087
|
+
};
|
|
3088
|
+
if (request.hot) body.hot = true;
|
|
2986
3089
|
const response = await fetch(`${this.ingestUrl}/events/ingest`, {
|
|
2987
3090
|
method: "POST",
|
|
2988
3091
|
headers,
|
|
2989
|
-
body: JSON.stringify(
|
|
2990
|
-
user_id: request.userId,
|
|
2991
|
-
event_type: request.eventType,
|
|
2992
|
-
data: request.data || {},
|
|
2993
|
-
event_source: request.eventSource || "sdk"
|
|
2994
|
-
}),
|
|
3092
|
+
body: JSON.stringify(body),
|
|
2995
3093
|
signal: controller.signal
|
|
2996
3094
|
});
|
|
2997
3095
|
const result = await this.handleResponse(response);
|
|
@@ -3026,12 +3124,16 @@ var IngestionClient = class {
|
|
|
3026
3124
|
method: "POST",
|
|
3027
3125
|
headers: this.getHeaders(),
|
|
3028
3126
|
body: JSON.stringify(
|
|
3029
|
-
request.events.map((e) =>
|
|
3030
|
-
|
|
3031
|
-
|
|
3032
|
-
|
|
3033
|
-
|
|
3034
|
-
|
|
3127
|
+
request.events.map((e) => {
|
|
3128
|
+
const ev = {
|
|
3129
|
+
user_id: e.userId,
|
|
3130
|
+
event_type: e.eventType,
|
|
3131
|
+
data: e.data || {},
|
|
3132
|
+
event_source: e.eventSource || "sdk"
|
|
3133
|
+
};
|
|
3134
|
+
if (e.hot) ev.hot = true;
|
|
3135
|
+
return ev;
|
|
3136
|
+
})
|
|
3035
3137
|
),
|
|
3036
3138
|
signal: controller.signal
|
|
3037
3139
|
});
|
|
@@ -3129,15 +3231,17 @@ var EndUserIngestionClient = class {
|
|
|
3129
3231
|
const controller = new AbortController();
|
|
3130
3232
|
const timeoutId = setTimeout(() => controller.abort(), this.timeout);
|
|
3131
3233
|
try {
|
|
3234
|
+
const endUserBody = {
|
|
3235
|
+
user_id: request.userId,
|
|
3236
|
+
event_type: request.eventType,
|
|
3237
|
+
data: request.data || {},
|
|
3238
|
+
event_source: request.eventSource || "end_user_sdk"
|
|
3239
|
+
};
|
|
3240
|
+
if (request.hot) endUserBody.hot = true;
|
|
3132
3241
|
const response = await fetch(`${this.apiUrl}/end-user/events/ingest`, {
|
|
3133
3242
|
method: "POST",
|
|
3134
3243
|
headers: this.getHeaders(),
|
|
3135
|
-
body: JSON.stringify(
|
|
3136
|
-
user_id: request.userId,
|
|
3137
|
-
event_type: request.eventType,
|
|
3138
|
-
data: request.data || {},
|
|
3139
|
-
event_source: request.eventSource || "end_user_sdk"
|
|
3140
|
-
}),
|
|
3244
|
+
body: JSON.stringify(endUserBody),
|
|
3141
3245
|
signal: controller.signal
|
|
3142
3246
|
});
|
|
3143
3247
|
const result = await this.handleResponse(response);
|
|
@@ -3172,12 +3276,16 @@ var EndUserIngestionClient = class {
|
|
|
3172
3276
|
method: "POST",
|
|
3173
3277
|
headers: this.getHeaders(),
|
|
3174
3278
|
body: JSON.stringify({
|
|
3175
|
-
events: request.events.map((e) =>
|
|
3176
|
-
|
|
3177
|
-
|
|
3178
|
-
|
|
3179
|
-
|
|
3180
|
-
|
|
3279
|
+
events: request.events.map((e) => {
|
|
3280
|
+
const ev = {
|
|
3281
|
+
user_id: e.userId,
|
|
3282
|
+
event_type: e.eventType,
|
|
3283
|
+
data: e.data || {},
|
|
3284
|
+
event_source: e.eventSource || "end_user_sdk"
|
|
3285
|
+
};
|
|
3286
|
+
if (e.hot) ev.hot = true;
|
|
3287
|
+
return ev;
|
|
3288
|
+
})
|
|
3181
3289
|
}),
|
|
3182
3290
|
signal: controller.signal
|
|
3183
3291
|
});
|
|
@@ -3217,8 +3325,10 @@ export {
|
|
|
3217
3325
|
FanpassLeaderboardClient,
|
|
3218
3326
|
IngestionClient,
|
|
3219
3327
|
NetworkError,
|
|
3328
|
+
NftClient,
|
|
3220
3329
|
NotFoundError,
|
|
3221
3330
|
NotificationsClient,
|
|
3331
|
+
PartnerKeysClient,
|
|
3222
3332
|
PassportClient,
|
|
3223
3333
|
ProofChain,
|
|
3224
3334
|
ProofChainError,
|
package/package.json
CHANGED