@verxioprotocol/core
Version:
Opensource infrastructure powering on-chain loyalty across Solana with Metaplex Core
878 lines (739 loc) • 27.9 kB
TypeScript
import { AssetV1 } from '@metaplex-foundation/mpl-core';
import { CreateCollectionArgsPlugin } from '@metaplex-foundation/mpl-core';
import { KeypairSigner } from '@metaplex-foundation/umi';
import { PublicKey } from '@metaplex-foundation/umi';
import { TransactionBuilder } from '@metaplex-foundation/umi';
import { TransactionSignature } from '@metaplex-foundation/umi';
import { Umi } from '@metaplex-foundation/umi';
export declare function approveTransfer(context: VerxioContext, passAddress: PublicKey, toAddress: PublicKey): Promise<void>;
export declare function approveTransferInstruction(context: VerxioContext, config: ApproveTransferInstructionConfig): ApproveTransferInstructionResult;
export declare interface ApproveTransferInstructionConfig {
passAddress: PublicKey;
toAddress: PublicKey;
}
export declare interface ApproveTransferInstructionResult {
instruction: TransactionBuilder;
}
export declare interface AssetData {
xp: number;
lastAction: string | null;
actionHistory: Array<{
type: string;
points: number;
timestamp: number;
newTotal: number;
}>;
currentTier: string;
tierUpdatedAt: number;
rewards: string[];
name: string;
uri: string;
owner: string;
pass: string;
metadata: {
organizationName: string;
brandColor?: string;
[key: string]: any;
};
rewardTiers: Array<{
name: string;
xpRequired: number;
rewards: string[];
}>;
broadcasts: {
broadcasts: Broadcast[];
totalBroadcasts: number;
unreadBroadcasts: number;
};
}
export declare interface AssetMessage {
id: string;
content: string;
sender: string;
timestamp: number;
read: boolean;
}
export declare const ATTRIBUTE_KEYS: {
readonly PROGRAM_TYPE: "programType";
readonly TIERS: "tiers";
readonly POINTS_PER_ACTION: "pointsPerAction";
readonly CREATOR: "creator";
readonly TYPE: "type";
readonly XP: "xp";
readonly METADATA: "metadata";
readonly VOUCHER_TYPES: "voucherTypes";
readonly MERCHANT_ID: "merchantId";
};
export declare function awardLoyaltyPoints(context: VerxioContext, config: AwardLoyaltyPointsConfig): Promise<{
points: number;
signature: string;
}>;
export declare interface AwardLoyaltyPointsConfig {
passAddress: PublicKey;
action: string;
signer: KeypairSigner;
multiplier?: number;
}
export declare function awardLoyaltyPointsInstruction(context: VerxioContext, config: AwardLoyaltyPointsInstructionConfig): Promise<AwardLoyaltyPointsInstructionResult>;
export declare interface AwardLoyaltyPointsInstructionConfig {
passAddress: PublicKey;
action: string;
signer: KeypairSigner;
multiplier?: number;
}
export declare interface AwardLoyaltyPointsInstructionResult {
instruction: TransactionBuilder;
newXp: number;
pointsAwarded: number;
newTier: any;
}
export declare interface Broadcast {
id: string;
content: string;
sender: string;
timestamp: number;
read: boolean;
}
export declare interface BroadcastMessage {
id: string;
content: string;
sender: string;
timestamp: number;
read: boolean;
}
export declare function calculateNewTier(context: VerxioContext, xp: number): Promise<LoyaltyProgramTier>;
export declare function cancelVoucher(context: VerxioContext, config: CancelVoucherConfig): Promise<CancelVoucherResult>;
export declare interface CancelVoucherConfig {
voucherAddress: PublicKey;
updateAuthority: KeypairSigner;
reason?: string;
}
export declare function cancelVoucherInstruction(context: VerxioContext, config: CancelVoucherInstructionConfig): Promise<CancelVoucherInstructionResult>;
export declare interface CancelVoucherInstructionConfig {
voucherAddress: PublicKey;
updateAuthority: KeypairSigner;
reason?: string;
}
export declare interface CancelVoucherInstructionResult {
instruction: TransactionBuilder;
updatedVoucher: VoucherData;
}
export declare interface CancelVoucherResult {
success: boolean;
signature?: string;
updatedVoucher?: VoucherData;
errors: string[];
}
export declare function createLoyaltyProgram(context: VerxioContext, config: CreateLoyaltyProgramConfig): Promise<{
collection: KeypairSigner;
signature: string;
updateAuthority?: KeypairSigner;
}>;
export declare interface CreateLoyaltyProgramConfig {
collectionSigner?: KeypairSigner;
loyaltyProgramName: string;
pointsPerAction: Record<string, number>;
programAuthority: PublicKey;
updateAuthority?: KeypairSigner;
tiers: LoyaltyProgramTier[];
metadata: {
organizationName: string;
brandColor?: string;
[key: string]: any;
};
imageBuffer?: Buffer;
imageFilename?: string;
imageContentType?: string;
metadataUri?: string;
}
export declare function createLoyaltyProgramInstruction(context: VerxioContext, config: CreateLoyaltyProgramInstructionConfig): Promise<CreateLoyaltyProgramInstructionResult>;
export declare interface CreateLoyaltyProgramInstructionConfig {
collectionSigner?: KeypairSigner;
loyaltyProgramName: string;
pointsPerAction: Record<string, number>;
programAuthority: PublicKey;
updateAuthority?: KeypairSigner;
tiers: LoyaltyProgramTier[];
metadata: {
organizationName: string;
brandColor?: string;
[key: string]: any;
};
imageBuffer?: Buffer;
imageFilename?: string;
imageContentType?: string;
metadataUri?: string;
}
export declare interface CreateLoyaltyProgramInstructionResult {
instruction: TransactionBuilder;
collection: KeypairSigner;
updateAuthority?: KeypairSigner;
}
export declare function createLoyaltyProgramPlugins(config: CreateLoyaltyProgramConfig, updateAuthority: PublicKey): CreateCollectionArgsPlugin[];
export declare function createLoyaltyProgramPluginsInstruction(config: CreateLoyaltyProgramInstructionConfig, updateAuthority: PublicKey): CreateCollectionArgsPlugin[];
export declare function createVoucherCollection(context: VerxioContext, config: CreateVoucherCollectionConfig): Promise<{
collection: KeypairSigner;
signature: string;
updateAuthority?: KeypairSigner;
}>;
export declare interface CreateVoucherCollectionConfig {
collectionSigner?: KeypairSigner;
voucherCollectionName: string;
programAuthority: PublicKey;
updateAuthority?: KeypairSigner;
metadata: {
merchantName: string;
merchantAddress: string;
contactInfo?: string;
voucherTypes: string[];
[key: string]: any;
};
imageBuffer?: Buffer;
imageFilename?: string;
imageContentType?: string;
description?: string;
metadataUri?: string;
}
export declare function createVoucherCollectionInstruction(context: VerxioContext, config: CreateVoucherCollectionInstructionConfig): Promise<CreateVoucherCollectionInstructionResult>;
export declare interface CreateVoucherCollectionInstructionConfig {
collectionSigner?: KeypairSigner;
voucherCollectionName: string;
programAuthority: PublicKey;
updateAuthority?: KeypairSigner;
metadata: {
merchantName: string;
merchantAddress: string;
contactInfo?: string;
voucherTypes: string[];
[key: string]: any;
};
imageBuffer?: Buffer;
imageFilename?: string;
imageContentType?: string;
description?: string;
metadataUri?: string;
}
export declare interface CreateVoucherCollectionInstructionResult {
instruction: TransactionBuilder;
collection: KeypairSigner;
updateAuthority: KeypairSigner;
}
export declare function createVoucherCollectionPlugins(config: CreateVoucherCollectionConfig, updateAuthority: PublicKey): CreateCollectionArgsPlugin[];
export declare function createVoucherCollectionPluginsInstruction(config: CreateVoucherCollectionInstructionConfig, updateAuthority: PublicKey): CreateCollectionArgsPlugin[];
export declare const DEFAULT_BROADCAST_DATA: {
totalBroadcasts: number;
broadcasts: never[];
};
export declare const DEFAULT_PASS_DATA: {
xp: number;
lastAction: null;
actionHistory: never[];
messageHistory: never[];
currentTier: string;
tierUpdatedAt: number;
rewards: string[];
};
export declare const DEFAULT_TIER: LoyaltyProgramTier;
export declare const DEFAULT_VOUCHER_COLLECTION_DATA: {
totalVouchersIssued: number;
totalVouchersRedeemed: number;
totalValueRedeemed: number;
voucherStats: never[];
};
export declare function extendVoucherExpiry(context: VerxioContext, config: ExtendVoucherExpiryConfig): Promise<ExtendVoucherExpiryResult>;
export declare interface ExtendVoucherExpiryConfig {
voucherAddress: PublicKey;
updateAuthority: KeypairSigner;
newExpiryDate: number;
}
export declare function extendVoucherExpiryInstruction(context: VerxioContext, config: ExtendVoucherExpiryInstructionConfig): Promise<ExtendVoucherExpiryInstructionResult>;
export declare interface ExtendVoucherExpiryInstructionConfig {
voucherAddress: PublicKey;
updateAuthority: KeypairSigner;
newExpiryDate: number;
}
export declare interface ExtendVoucherExpiryInstructionResult {
instruction: TransactionBuilder;
updatedVoucher: VoucherData;
previousExpiryDate: number;
}
export declare interface ExtendVoucherExpiryResult {
success: boolean;
signature?: string;
updatedVoucher?: VoucherData;
previousExpiryDate?: number;
errors: string[];
}
export declare function generateLoyaltyPassMetadata(context: VerxioContext, data: {
passName: string;
organizationName: string;
imageUri: string;
creator: PublicKey;
mimeType?: string;
}): Promise<string>;
export declare function generateLoyaltyProgramMetadata(context: VerxioContext, data: MetadataInput): Promise<string>;
export declare function generateVoucherCollectionMetadata(context: VerxioContext, data: {
collectionName: string;
merchantName: string;
description: string;
imageUri: string;
creator: PublicKey;
mimeType?: string;
}): Promise<string>;
export declare function generateVoucherMetadata(context: VerxioContext, data: VoucherMetadataInput): Promise<string>;
export declare function getAssetData(context: VerxioContext, passAddress: PublicKey): Promise<AssetData | null>;
export declare function getCollectionAttribute(context: VerxioContext, attributeKey: string): Promise<any>;
export declare function getExpiringVouchers(context: VerxioContext, config: GetUserVouchersConfig & {
expiryWarningDays?: number;
}): Promise<UserVoucherInfo[]>;
export declare function getPointsPerAction(context: VerxioContext): Promise<Record<string, number>>;
export declare function getProgramDetails(context: VerxioContext): Promise<{
name: string;
uri: string;
collectionAddress: string;
updateAuthority: string;
numMinted: number;
transferAuthority: string;
creator: string;
tiers: ProgramTier[];
pointsPerAction: Record<string, number>;
metadata: ProgramMetadata;
broadcasts: ProgramBroadcasts;
}>;
export declare function getProgramTiers(context: VerxioContext): Promise<LoyaltyProgramTier[]>;
export declare function getRedeemableVouchers(context: VerxioContext, config: GetUserVouchersConfig): Promise<UserVoucherInfo[]>;
export declare function getRemainingUses(voucher: VoucherData): number;
export declare function getTimeRemainingUntilExpiry(voucher: VoucherData): {
isExpired: boolean;
timeRemaining: number;
daysRemaining: number;
hoursRemaining: number;
minutesRemaining: number;
};
export declare function getUserVouchers(context: VerxioContext, config: GetUserVouchersConfig): Promise<GetUserVouchersResult>;
export declare interface GetUserVouchersConfig {
userAddress: PublicKey;
collectionAddress?: PublicKey;
merchantId?: string;
status?: 'active' | 'used' | 'expired' | 'cancelled';
voucherType?: 'percentage_off' | 'fixed_verxio_credits' | 'free_item' | 'buy_one_get_one' | 'custom_reward';
limit?: number;
offset?: number;
}
export declare interface GetUserVouchersResult {
vouchers: UserVoucherInfo[];
totalCount: number;
hasMore: boolean;
summary: {
activeVouchers: number;
expiredVouchers: number;
usedVouchers: number;
cancelledVouchers: number;
totalValue: number;
byType: Record<string, number>;
byMerchant: Record<string, number>;
};
}
export declare function getVoucherDisplayValue(voucher: VoucherData): string;
export declare function getWalletLoyaltyPasses(context: VerxioContext, walletAddress: PublicKey): Promise<AssetV1[]>;
export declare function giftLoyaltyPoints(context: VerxioContext, config: GiftLoyaltyPointsConfig): Promise<{
points: number;
signature: string;
newTier: LoyaltyProgramTier;
}>;
export declare interface GiftLoyaltyPointsConfig {
passAddress: PublicKey;
pointsToGift: number;
signer: KeypairSigner;
action: string;
}
export declare function giftLoyaltyPointsInstruction(context: VerxioContext, config: GiftLoyaltyPointsInstructionConfig): Promise<GiftLoyaltyPointsInstructionResult>;
export declare interface GiftLoyaltyPointsInstructionConfig {
passAddress: PublicKey;
pointsToGift: number;
signer: KeypairSigner;
action: string;
}
export declare interface GiftLoyaltyPointsInstructionResult {
instruction: TransactionBuilder;
newPoints: number;
pointsGifted: number;
newTier: LoyaltyProgramTier;
}
export declare function initializeVerxio(umi: Umi, programAuthority: PublicKey): VerxioContext;
export declare function isMultiUseVoucher(voucher: VoucherData): boolean;
export declare function issueLoyaltyPass(context: VerxioContext, config: IssueLoyaltyPassConfig): Promise<{
asset: KeypairSigner;
signature: string;
}>;
export declare interface IssueLoyaltyPassConfig {
collectionAddress: PublicKey;
recipient: PublicKey;
passName: string;
assetSigner?: KeypairSigner;
updateAuthority: KeypairSigner;
imageBuffer?: Buffer;
imageFilename?: string;
imageContentType?: string;
organizationName: string;
passMetadataUri?: string;
}
export declare function issueLoyaltyPassInstruction(context: VerxioContext, config: IssueLoyaltyPassInstructionConfig): Promise<IssueLoyaltyPassInstructionResult>;
export declare interface IssueLoyaltyPassInstructionConfig {
collectionAddress: PublicKey;
recipient: PublicKey;
passName: string;
assetSigner?: KeypairSigner;
updateAuthority: KeypairSigner;
imageBuffer?: Buffer;
imageFilename?: string;
imageContentType?: string;
organizationName: string;
passMetadataUri?: string;
}
export declare interface IssueLoyaltyPassInstructionResult {
instruction: TransactionBuilder;
asset: KeypairSigner;
}
export declare interface LoyaltyProgramTier {
name: string;
rewards: string[];
xpRequired: number;
}
export declare function markBroadcastReadInstruction(context: VerxioContext, config: MarkBroadcastReadInstructionConfig): Promise<MarkBroadcastReadInstructionResult>;
export declare interface MarkBroadcastReadInstructionConfig {
collectionAddress: PublicKey;
broadcastId: string;
signer: KeypairSigner;
}
export declare interface MarkBroadcastReadInstructionResult {
instruction: TransactionBuilder;
}
export declare function markMessageReadInstruction(context: VerxioContext, config: MarkMessageReadInstructionConfig): Promise<MarkMessageReadInstructionResult>;
export declare interface MarkMessageReadInstructionConfig {
passAddress: PublicKey;
messageId: string;
signer: KeypairSigner;
}
export declare interface MarkMessageReadInstructionResult {
instruction: TransactionBuilder;
}
export declare interface Message {
id: string;
content: string;
sender: string;
timestamp: number;
read: boolean;
}
export declare interface MetadataInput {
loyaltyProgramName: string;
metadata: {
organizationName: string;
brandColor?: string;
};
tiers: Array<{
name: string;
xpRequired: number;
rewards: string[];
}>;
pointsPerAction: Record<string, number>;
imageUri: string;
creator: PublicKey;
mimeType?: string;
}
export declare function mintVoucher(context: VerxioContext, config: MintVoucherConfig): Promise<{
asset: KeypairSigner;
signature: string;
voucherAddress: PublicKey;
}>;
export declare interface MintVoucherConfig {
collectionAddress: PublicKey;
recipient: PublicKey;
voucherName: string;
voucherData: {
type: 'percentage_off' | 'fixed_verxio_credits' | 'free_item' | 'buy_one_get_one' | 'custom_reward';
value: number;
description: string;
expiryDate: number;
maxUses: number;
transferable?: boolean;
merchantId: string;
conditions?: VoucherCondition[];
};
assetSigner?: KeypairSigner;
updateAuthority: KeypairSigner;
imageBuffer?: Buffer;
imageFilename?: string;
imageContentType?: string;
voucherMetadataUri?: string;
}
export declare function mintVoucherInstruction(context: VerxioContext, config: MintVoucherInstructionConfig): Promise<MintVoucherInstructionResult>;
export declare interface MintVoucherInstructionConfig {
collectionAddress: PublicKey;
recipient: PublicKey;
voucherName: string;
voucherData: {
type: 'percentage_off' | 'fixed_verxio_credits' | 'free_item' | 'buy_one_get_one' | 'custom_reward';
value: number;
description: string;
expiryDate: number;
maxUses: number;
transferable?: boolean;
merchantId: string;
conditions?: VoucherCondition[];
};
assetSigner?: KeypairSigner;
updateAuthority: KeypairSigner;
imageBuffer?: Buffer;
imageFilename?: string;
imageContentType?: string;
voucherMetadataUri?: string;
}
export declare interface MintVoucherInstructionResult {
instruction: TransactionBuilder;
asset: KeypairSigner;
voucherAddress: PublicKey;
}
export declare const PLUGIN_TYPES: {
readonly ATTRIBUTES: "Attributes";
readonly APP_DATA: "AppData";
readonly PERMANENT_TRANSFER_DELEGATE: "PermanentTransferDelegate";
readonly UPDATE_DELEGATE: "UpdateDelegate";
readonly FREEZE_DELEGATE: "FreezeDelegate";
};
export declare interface ProgramBroadcasts {
broadcasts: Broadcast[];
totalBroadcasts: number;
}
export declare interface ProgramMetadata {
organizationName: string;
brandColor?: string;
[key: string]: any;
}
export declare interface ProgramTier {
name: string;
xpRequired: number;
rewards: string[];
}
export declare function redeemVoucher(context: VerxioContext, config: RedeemVoucherConfig): Promise<VoucherRedemptionResult>;
export declare interface RedeemVoucherConfig extends ValidateVoucherConfig {
updateAuthority: KeypairSigner;
merchantId: string;
redemptionAmount?: number;
redemptionDetails?: {
transactionId?: string;
items?: string[];
totalAmount?: number;
discountApplied?: number;
creditsUsed?: number;
};
}
export declare function redeemVoucherInstruction(context: VerxioContext, config: RedeemVoucherInstructionConfig): Promise<RedeemVoucherInstructionResult>;
export declare interface RedeemVoucherInstructionConfig extends ValidateVoucherConfig {
merchantId: string;
updateAuthority: KeypairSigner;
redemptionAmount?: number;
redemptionDetails?: {
transactionId?: string;
items?: string[];
totalAmount?: number;
discountApplied?: number;
creditsUsed?: number;
};
}
export declare interface RedeemVoucherInstructionResult {
instruction: TransactionBuilder;
validation: VoucherValidationResult;
redemptionValue: number;
updatedVoucher: VoucherData;
}
export declare function revokeLoyaltyPoints(context: VerxioContext, config: RevokeLoyaltyPointsConfig): Promise<{
points: number;
signature: string;
newTier: LoyaltyProgramTier;
}>;
export declare interface RevokeLoyaltyPointsConfig {
passAddress: PublicKey;
pointsToRevoke: number;
signer: KeypairSigner;
}
export declare function revokeLoyaltyPointsInstruction(context: VerxioContext, config: RevokeLoyaltyPointsInstructionConfig): Promise<RevokeLoyaltyPointsInstructionResult>;
export declare interface RevokeLoyaltyPointsInstructionConfig {
passAddress: PublicKey;
pointsToRevoke: number;
signer: KeypairSigner;
}
export declare interface RevokeLoyaltyPointsInstructionResult {
instruction: TransactionBuilder;
newPoints: number;
pointsRevoked: number;
newTier: LoyaltyProgramTier;
}
export declare function sendAssetMessageInstruction(context: VerxioContext, config: SendAssetMessageInstructionConfig): Promise<SendAssetMessageInstructionResult>;
export declare interface SendAssetMessageInstructionConfig {
passAddress: PublicKey;
message: string;
sender: PublicKey;
signer: KeypairSigner;
}
export declare interface SendAssetMessageInstructionResult {
instruction: TransactionBuilder;
message: AssetMessage;
}
export declare function sendBroadcast(context: VerxioContext, config: SendBroadcastConfig): Promise<{
signature: string;
broadcast: Broadcast;
}>;
export declare interface SendBroadcastConfig {
collectionAddress: PublicKey;
message: string;
sender: PublicKey;
signer: KeypairSigner;
}
export declare function sendBroadcastInstruction(context: VerxioContext, config: SendBroadcastInstructionConfig): Promise<SendBroadcastInstructionResult>;
export declare interface SendBroadcastInstructionConfig {
collectionAddress: PublicKey;
message: string;
sender: PublicKey;
signer: KeypairSigner;
}
export declare interface SendBroadcastInstructionResult {
instruction: TransactionBuilder;
broadcast: BroadcastMessage;
}
export declare function sendMessage(context: VerxioContext, config: SendMessageConfig): Promise<{
signature: string;
message: Message;
}>;
export declare interface SendMessageConfig {
passAddress: PublicKey;
message: string;
sender: PublicKey;
signer: KeypairSigner;
}
export declare function shouldExtendVoucher(voucher: VoucherData, warningDays?: number): boolean;
export declare function toBase58(buffer: Buffer | TransactionSignature): string;
export declare function updateLoyaltyProgram(context: VerxioContext, config: UpdateLoyaltyProgramConfig): Promise<{
signature: string;
}>;
export declare interface UpdateLoyaltyProgramConfig {
collectionAddress: PublicKey;
programAuthority: PublicKey;
updateAuthority: KeypairSigner;
newTiers?: LoyaltyProgramTier[];
newPointsPerAction?: Record<string, number>;
}
export declare function updateLoyaltyProgramInstruction(context: VerxioContext, config: UpdateLoyaltyProgramInstructionConfig): Promise<UpdateLoyaltyProgramInstructionResult>;
export declare interface UpdateLoyaltyProgramInstructionConfig {
collectionAddress: PublicKey;
programAuthority: PublicKey;
updateAuthority: KeypairSigner;
newTiers?: LoyaltyProgramTier[];
newPointsPerAction?: Record<string, number>;
}
export declare interface UpdateLoyaltyProgramInstructionResult {
instruction: TransactionBuilder;
updatedTiers: LoyaltyProgramTier[];
updatedPointsPerAction: Record<string, number>;
}
export declare function updatePassData(context: VerxioContext, passAddress: PublicKey, signer: KeypairSigner, appDataPlugin: any, updates: {
xp: number;
action: string;
points: number;
currentData: any;
newTier: any;
messageHistory?: any[];
}): Promise<{
points: number;
signature: string;
}>;
export declare function updateProgramData(context: VerxioContext, collectionAddress: PublicKey, signer: KeypairSigner, appDataPlugin: any, updates: {
broadcasts: any[];
totalBroadcasts: number;
}): Promise<{
signature: string;
}>;
export declare function uploadImage(context: VerxioContext, imageBuffer: Buffer, filename: string, contentType?: string): Promise<string>;
export declare interface UserVoucherInfo {
voucherAddress: PublicKey;
voucherData: VoucherData;
collectionAddress: PublicKey;
name: string;
uri: string;
isExpired: boolean;
canRedeem: boolean;
remainingUses: number;
timeUntilExpiry: number;
}
export declare function validateCollectionState(context: VerxioContext): void;
export declare function validateVoucher(context: VerxioContext, config: ValidateVoucherConfig): Promise<VoucherValidationResult>;
export declare interface ValidateVoucherConfig {
voucherAddress: PublicKey;
}
export declare function validateVoucherInstruction(context: VerxioContext, config: ValidateVoucherInstructionConfig): Promise<ValidateVoucherInstructionResult>;
export declare interface ValidateVoucherInstructionConfig extends ValidateVoucherConfig {
}
export declare interface ValidateVoucherInstructionResult {
validation: VoucherValidationResult & {
isValid: boolean;
};
}
export declare interface VerxioContext {
umi: Umi;
programAuthority: PublicKey;
collectionAddress?: PublicKey;
}
export declare interface VoucherCondition {
type: 'minimum_purchase' | 'specific_items' | 'time_restriction' | 'user_tier';
value: any;
operator: 'equals' | 'greater_than' | 'less_than' | 'contains';
}
export declare interface VoucherData {
type: 'percentage_off' | 'fixed_verxio_credits' | 'free_item' | 'buy_one_get_one' | 'custom_reward';
value: number;
description: string;
expiryDate: number;
maxUses: number;
currentUses: number;
transferable: boolean;
status: 'active' | 'used' | 'expired' | 'cancelled';
issuedAt: number;
usedAt?: number;
merchantId: string;
conditions?: VoucherCondition[];
redemptionHistory?: VoucherRedemptionRecord[];
}
export declare interface VoucherMetadataInput {
voucherName: string;
voucherData: {
type: string;
value: number;
description: string;
merchantId: string;
};
imageUri: string;
creator: PublicKey;
mimeType?: string;
}
export declare interface VoucherRedemptionRecord {
timestamp: number;
redemptionValue: number;
transactionId?: string;
items?: string[];
totalAmount?: number;
discountApplied?: number;
creditsUsed?: number;
}
export declare interface VoucherRedemptionResult {
success: boolean;
signature?: string;
validation: VoucherValidationResult;
redemptionValue?: number;
updatedVoucher?: VoucherData;
errors: string[];
}
export declare interface VoucherValidationResult {
voucher?: VoucherData;
errors: string[];
}
export { }