@bleepay/core 0.0.1 → 0.0.2
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.ts +20 -5
- package/dist/index.js +9 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -120,7 +120,7 @@ type NativeCallTransaction = EthereumNativeCallTransaction | SolanaNativeCallTra
|
|
|
120
120
|
type PaymentRequestWallet = {
|
|
121
121
|
address: string;
|
|
122
122
|
};
|
|
123
|
-
type PaymentRequest
|
|
123
|
+
type PaymentRequest = {
|
|
124
124
|
network: string;
|
|
125
125
|
currency: string;
|
|
126
126
|
currencyAddress: string;
|
|
@@ -208,12 +208,17 @@ declare enum VoucherInteropStatus {
|
|
|
208
208
|
Failed = "FAILED",
|
|
209
209
|
Unknown = "UNKNOWN"
|
|
210
210
|
}
|
|
211
|
+
type PayeeInfo = {
|
|
212
|
+
appName: string;
|
|
213
|
+
appIconUrl: string;
|
|
214
|
+
};
|
|
211
215
|
type Voucher = {
|
|
212
216
|
id: string;
|
|
213
217
|
contextId: string | null;
|
|
214
218
|
sessionId: string | null;
|
|
215
219
|
payerId: string | null;
|
|
216
220
|
payeeId: string | null;
|
|
221
|
+
payeeInfo: PayeeInfo | null;
|
|
217
222
|
type: VoucherType;
|
|
218
223
|
format: VoucherFormat;
|
|
219
224
|
code: string;
|
|
@@ -222,8 +227,8 @@ type Voucher = {
|
|
|
222
227
|
extras: VoucherInstruction[];
|
|
223
228
|
payments: VoucherPayment[];
|
|
224
229
|
receipts: VoucherReceipt[];
|
|
225
|
-
suppliedPayment: PaymentRequest
|
|
226
|
-
expectedPayment: PaymentRequest
|
|
230
|
+
suppliedPayment: PaymentRequest | null;
|
|
231
|
+
expectedPayment: PaymentRequest | null;
|
|
227
232
|
status: VoucherStatus;
|
|
228
233
|
expiresAt: string;
|
|
229
234
|
timeoutAt: string;
|
|
@@ -272,13 +277,22 @@ declare const sessionApi: {
|
|
|
272
277
|
reserveVoucherInSession: (sessionId: string) => Promise<Voucher>;
|
|
273
278
|
};
|
|
274
279
|
|
|
280
|
+
type RedeemVoucherRequest = {
|
|
281
|
+
networks?: VoucherNetwork[];
|
|
282
|
+
extras?: VoucherInstruction[];
|
|
283
|
+
payments?: VoucherPayment[];
|
|
284
|
+
payeeInfo?: PayeeInfo | null;
|
|
285
|
+
} | {
|
|
286
|
+
expectedPayment?: PaymentRequest | null;
|
|
287
|
+
payeeInfo?: PayeeInfo | null;
|
|
288
|
+
};
|
|
275
289
|
type VoucherInteropStatusResponse = {
|
|
276
290
|
status: VoucherInteropStatus;
|
|
277
291
|
};
|
|
278
292
|
declare const vouchersApi: {
|
|
279
293
|
reserveVoucher: (code: string) => Promise<Voucher>;
|
|
280
294
|
getVoucherById: (voucherId: string) => Promise<Voucher>;
|
|
281
|
-
redeemVoucherById: (voucherId: string,
|
|
295
|
+
redeemVoucherById: (voucherId: string, data: RedeemVoucherRequest) => Promise<Voucher>;
|
|
282
296
|
resolveVoucher: (voucherId: string, receipts: VoucherReceipt[]) => Promise<Voucher>;
|
|
283
297
|
discardVoucher: (voucherId: string) => Promise<void>;
|
|
284
298
|
initVoucherInterop: (voucherId: string, submitHook: string, signature: string) => Promise<{
|
|
@@ -308,6 +322,7 @@ declare const formatAmount: (amount: string | number, decimals?: number) => stri
|
|
|
308
322
|
|
|
309
323
|
declare const createVoucherPayer: (address: string) => VoucherPayer;
|
|
310
324
|
declare const createVoucherReceipt: (paymentId: string) => VoucherReceipt;
|
|
325
|
+
declare const createPayeeInfo: (appName: string, appIconUrl: string) => PayeeInfo;
|
|
311
326
|
|
|
312
327
|
declare const createEvmNetwork: (params: {
|
|
313
328
|
network: string;
|
|
@@ -346,4 +361,4 @@ declare const createEvmPayment: (params: {
|
|
|
346
361
|
}) => VoucherPayment;
|
|
347
362
|
declare const isEvmNetwork: (network: VoucherNetwork) => boolean;
|
|
348
363
|
|
|
349
|
-
export { API_BASE_URL, type ApiError, type ApiResponse, type Context, ContextFormat, type ContextPayer, type ContextResource, ContextStatus, ContextType, DEFAULT_TIMEOUT_MS, type EthereumNativeCallTransaction, type EthereumNativeMethod, type EthereumNativeSendTransaction, type EthereumPlatformData, type NativeCallTransaction, type NativeMethod, type NativeSendTransaction, type
|
|
364
|
+
export { API_BASE_URL, type ApiError, type ApiResponse, type Context, ContextFormat, type ContextPayer, type ContextResource, ContextStatus, ContextType, DEFAULT_TIMEOUT_MS, type EthereumNativeCallTransaction, type EthereumNativeMethod, type EthereumNativeSendTransaction, type EthereumPlatformData, type NativeCallTransaction, type NativeMethod, type NativeSendTransaction, type PayeeInfo, type PaymentRequest, type PaymentRequestWallet, type PlatformData, type Session, SessionFormat, type SessionPayer, SessionStatus, SessionType, type SignInInput, type SignInResponse, type SignInWithResourceInput, type SolanaInstruction, type SolanaNativeCallTransaction, type SolanaNativeSendTransaction, type SolanaPayeeInstruction, type SolanaPayeeInstructionKey, type SolanaPayerInstruction, type SolanaPayerInstructionKey, type SolanaPlatformData, VOUCHER_CODE_LENGTH, VOUCHER_CODE_PATTERN, type Voucher, VoucherFormat, type VoucherInstruction, type VoucherInstructionCallTransaction, type VoucherInstructionData, type VoucherInstructionRpcMethod, type VoucherInstructionSendTransaction, VoucherInstructionType, VoucherInteropStatus, type VoucherNetwork, type VoucherPayer, type VoucherPayment, type VoucherPaymentData, type VoucherPaymentRpcMethod, type VoucherPaymentSendTransaction, type VoucherPaymentSystemApiMethod, type VoucherPaymentSystemRpcMethod, VoucherPaymentType, type VoucherReceipt, VoucherStatus, VoucherType, apiClient, authApi, contextApi, createEvmCallTransactionInstruction, createEvmNetwork, createEvmPayment, createEvmRpcMethodInstruction, createEvmSendTransactionInstruction, createEvmSystemRpcMethodPayment, createPayeeInfo, createVoucherPayer, createVoucherReceipt, formatAddress, formatAmount, isEvmNetwork, isValidAddress, isValidChainId, isValidVoucherCode, normalizeVoucherCode, sessionApi, storage, vouchersApi };
|
package/dist/index.js
CHANGED
|
@@ -215,12 +215,9 @@ var vouchersApi = {
|
|
|
215
215
|
const response = await apiClient.get(`/vouchers/${voucherId}`);
|
|
216
216
|
return response.data;
|
|
217
217
|
},
|
|
218
|
-
redeemVoucherById: async (voucherId,
|
|
218
|
+
redeemVoucherById: async (voucherId, data) => {
|
|
219
219
|
const response = await apiClient.post(`/vouchers/${voucherId}/redeem-voucher`, {
|
|
220
|
-
|
|
221
|
-
extras,
|
|
222
|
-
payments,
|
|
223
|
-
expectedPayment
|
|
220
|
+
...data
|
|
224
221
|
});
|
|
225
222
|
return response.data;
|
|
226
223
|
},
|
|
@@ -326,6 +323,12 @@ var createVoucherReceipt = (paymentId) => {
|
|
|
326
323
|
paymentId
|
|
327
324
|
};
|
|
328
325
|
};
|
|
326
|
+
var createPayeeInfo = (appName, appIconUrl) => {
|
|
327
|
+
return {
|
|
328
|
+
appName,
|
|
329
|
+
appIconUrl
|
|
330
|
+
};
|
|
331
|
+
};
|
|
329
332
|
|
|
330
333
|
// src/utils/voucher-evm.ts
|
|
331
334
|
var createEvmNetwork = (params) => {
|
|
@@ -429,6 +432,7 @@ export {
|
|
|
429
432
|
createEvmRpcMethodInstruction,
|
|
430
433
|
createEvmSendTransactionInstruction,
|
|
431
434
|
createEvmSystemRpcMethodPayment,
|
|
435
|
+
createPayeeInfo,
|
|
432
436
|
createVoucherPayer,
|
|
433
437
|
createVoucherReceipt,
|
|
434
438
|
formatAddress,
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/constants/index.ts","../src/api/client.ts","../src/api/auth.ts","../src/types/context.ts","../src/api/context.ts","../src/types/session.ts","../src/types/voucher.ts","../src/api/session.ts","../src/api/vouchers.ts","../src/utils/storage.ts","../src/utils/validation.ts","../src/utils/voucher-common.ts","../src/utils/voucher-evm.ts"],"sourcesContent":["export const API_BASE_URL = 'https://payments-sandbox.bleepay.com/api/v1';\n\nexport const VOUCHER_CODE_LENGTH = 6;\nexport const VOUCHER_CODE_PATTERN = /^\\d{6}$/;\n\nexport const DEFAULT_TIMEOUT_MS = 30000;\n","import {API_BASE_URL, DEFAULT_TIMEOUT_MS} from '../constants';\n\nexport type ApiResponse<T> = {\n data: T;\n status: number;\n};\n\nexport type ApiError = {\n code: string;\n message: string;\n status: number;\n};\n\nexport const apiClient = {\n baseUrl: API_BASE_URL,\n timeout: DEFAULT_TIMEOUT_MS,\n sessionToken: null as string | null,\n\n async request<T>(method: string, path: string, body?: unknown): Promise<ApiResponse<T>> {\n const controller = new AbortController();\n const timeoutId = setTimeout(() => controller.abort(), this.timeout);\n\n try {\n const headers: Record<string, string> = {\n 'Content-Type': 'application/json',\n };\n\n if (this.sessionToken) {\n headers.Authorization = `Bearer ${this.sessionToken}`;\n }\n\n const response = await fetch(`${this.baseUrl}${path}`, {\n method,\n headers,\n body: body ? JSON.stringify(body) : undefined,\n signal: controller.signal,\n });\n\n clearTimeout(timeoutId);\n\n if (!response.ok) {\n console.log('API error response:', response);\n const error = (await response.json()) as ApiError;\n throw new Error(error.message || `API error: ${response.status}`);\n }\n\n const data = (await response.json()) as T;\n return {data, status: response.status};\n } catch (error) {\n console.error('API request error:', error);\n clearTimeout(timeoutId);\n if (error instanceof Error && error.name === 'AbortError') {\n throw new Error('Request timeout');\n }\n throw error;\n }\n },\n\n setSessionToken(token: string): void {\n this.sessionToken = token;\n },\n\n async get<T>(path: string): Promise<ApiResponse<T>> {\n return this.request<T>('GET', path);\n },\n\n async post<T>(path: string, body: unknown): Promise<ApiResponse<T>> {\n return this.request<T>('POST', path, body);\n },\n\n async put<T>(path: string, body: unknown): Promise<ApiResponse<T>> {\n return this.request<T>('PUT', path, body);\n },\n\n async delete<T>(path: string): Promise<ApiResponse<T>> {\n return this.request<T>('DELETE', path);\n },\n};\n","import {apiClient} from './client';\n\nexport type SignInInput = {\n type: 'resource';\n data: SignInWithResourceInput;\n};\n\nexport type SignInResponse = {\n authorization: {\n token: string;\n expiresIn: string;\n };\n};\n\nexport type SignInWithResourceInput = {\n resource: string;\n};\n\nexport const authApi = {\n async signIn(signInInput: SignInInput): Promise<SignInResponse> {\n const response = await apiClient.post<SignInResponse>('/auth/sign-in', signInInput);\n return response.data;\n },\n};\n","import type {Session} from './session';\nimport type {Voucher} from './voucher';\n\nexport enum ContextType {\n Default = 'CONTEXT_DEFAULT',\n}\n\nexport enum ContextFormat {\n Numeric = 'numeric',\n Alphanum = 'alphanum',\n}\n\nexport enum ContextStatus {\n Open = 'OPEN',\n Closed = 'CLOSED',\n Expired = 'EXPIRED',\n}\n\nexport type ContextPayer = {\n address: string;\n};\n\nexport type ContextResource = Voucher | Session;\n\nexport type Context = {\n id: string;\n payerId: string | null;\n payeeId: string | null;\n type: ContextType;\n format: ContextFormat;\n code: string;\n payers: ContextPayer[];\n resources: ContextResource[];\n status: ContextStatus;\n expiresAt: string;\n};\n","import {Context, ContextFormat, ContextPayer} from '../types/context';\nimport {apiClient} from './client';\n\ntype OpenVoucherContextRequest = {\n format: ContextFormat;\n payers?: ContextPayer[];\n};\n\ntype CloseVoucherContextRequest = {\n payeeId: string | null;\n};\n\nexport const contextApi = {\n openContext: async (\n format: ContextFormat = ContextFormat.Numeric,\n payers: ContextPayer[] = [],\n ): Promise<Context> => {\n const response = await apiClient.post<Context>('/vouchers/contexts/context-open', {\n format,\n payers,\n } as OpenVoucherContextRequest);\n return response.data;\n },\n\n getContextById: async (contextId: string): Promise<Context> => {\n const response = await apiClient.get<Context>(`/vouchers/contexts/${contextId}`);\n return response.data;\n },\n\n closeContext: async (contextId: string, payeeId: string | null = null): Promise<Context> => {\n const response = await apiClient.post<Context>(\n `/vouchers/contexts/${contextId}/context-close`,\n {\n payeeId,\n } as CloseVoucherContextRequest,\n );\n return response.data;\n },\n};\n","export enum SessionType {\n Default = 'SESSION_DEFAULT',\n}\n\nexport enum SessionFormat {\n Numeric = 'numeric',\n Alphanum = 'alphanum',\n}\n\nexport enum SessionStatus {\n Open = 'OPEN',\n Negotiating = 'NEGOTIATING',\n Established = 'ESTABLISHED',\n Closed = 'CLOSED',\n Expired = 'EXPIRED',\n TimedOut = 'TIMED_OUT',\n}\n\nexport type SessionPayer = {\n address: string;\n};\n\nexport type Session = {\n id: string;\n contextId: string | null;\n payerId: string | null;\n payeeId: string | null;\n type: SessionType;\n format: SessionFormat;\n code: string;\n payers: SessionPayer[];\n status: SessionStatus;\n expiresAt: string;\n timeoutAt: string;\n};\n","export type SolanaPayerInstructionKey = {\n pubkey: string;\n isSigner?: boolean;\n isWritable?: boolean;\n};\n\nexport type SolanaPayerInstruction = {\n programId: string;\n keys: SolanaPayerInstructionKey[];\n data?: string;\n};\n\nexport type SolanaPayeeInstructionKey = {\n pubkey: string;\n isWritable?: boolean;\n};\n\nexport type SolanaPayeeInstruction = {\n programId: string;\n accounts: SolanaPayeeInstructionKey[];\n data?: string;\n};\n\nexport type SolanaInstruction = SolanaPayerInstruction & SolanaPayeeInstruction;\n\nexport type EthereumNativeMethod = {\n method: string;\n params: object;\n};\n\nexport type NativeMethod = EthereumNativeMethod;\n\nexport type EthereumNativeSendTransaction = {\n from: string;\n to: string;\n value: string;\n data: string;\n};\n\nexport type SolanaNativeSendTransaction = {\n feePayer: string;\n recentBlockhash?: string;\n instructions: SolanaInstruction[];\n};\n\nexport type NativeSendTransaction = EthereumNativeSendTransaction | SolanaNativeSendTransaction;\n\nexport type EthereumNativeCallTransaction = {\n from: string;\n to: string;\n value: string;\n data: string;\n};\n\nexport type SolanaNativeCallTransaction = {\n feePayer: string;\n recentBlockhash?: string;\n instructions: SolanaInstruction[];\n};\n\nexport type NativeCallTransaction = EthereumNativeCallTransaction | SolanaNativeCallTransaction;\n\nexport type PaymentRequestWallet = {\n address: string;\n};\n\nexport type PaymentRequest = {\n network: string;\n currency: string;\n currencyAddress: string;\n amount: string;\n wallet: PaymentRequestWallet;\n};\n\nexport type EthereumPlatformData = {\n network: string;\n chainId: string;\n};\n\nexport type SolanaPlatformData = {\n network: string;\n};\n\nexport type PlatformData = EthereumPlatformData | SolanaPlatformData;\n\nexport type VoucherNetwork = {\n network: string;\n type: 'evm' | 'solana';\n chainId?: string;\n};\n\nexport enum VoucherFormat {\n Numeric = 'numeric',\n Alphanum = 'alphanum',\n}\n\nexport enum VoucherType {\n Custom = 'VOUCHER_CUSTOM',\n Simple = 'VOUCHER_SIMPLE',\n}\n\nexport enum VoucherStatus {\n Reserved = 'RESERVED',\n Redeemed = 'REDEEMED',\n Discarded = 'DISCARDED',\n Resolved = 'RESOLVED',\n Expired = 'EXPIRED',\n}\n\nexport type VoucherPayer = {\n address: string;\n};\n\nexport enum VoucherInstructionType {\n NativeRpcMethod = 'rpc_method',\n NativeCallTransaction = 'call_transaction',\n NativeSendTransaction = 'send_transaction',\n}\n\nexport type VoucherInstructionRpcMethod = NativeMethod;\n\nexport type VoucherInstructionSendTransaction = {\n method: string;\n params: NativeSendTransaction;\n};\n\nexport type VoucherInstructionCallTransaction = {\n method: string;\n params: NativeCallTransaction;\n};\n\nexport type VoucherInstructionData =\n | VoucherInstructionRpcMethod\n | VoucherInstructionSendTransaction\n | VoucherInstructionCallTransaction;\n\nexport type VoucherInstruction = {\n type: VoucherInstructionType;\n input: VoucherInstructionData;\n networkIndex?: number;\n};\n\nexport enum VoucherPaymentType {\n SystemRpcMethod = 'system_rpc_method',\n SystemApiMethod = 'system_api_method',\n NativeSendTransaction = 'send_transaction',\n}\n\nexport type VoucherPaymentRpcMethod = NativeMethod;\n\nexport type VoucherPaymentSystemApiMethod = {\n submitHook: string;\n statusHook: string;\n};\n\nexport type VoucherPaymentSystemRpcMethod = NativeMethod & VoucherPaymentSystemApiMethod;\n\nexport type VoucherPaymentSendTransaction = {\n method: string;\n params: NativeSendTransaction;\n};\n\nexport type VoucherPaymentData =\n | VoucherPaymentSystemRpcMethod\n | VoucherPaymentSystemApiMethod\n | VoucherPaymentSendTransaction;\n\nexport type VoucherPayment = {\n type: VoucherPaymentType;\n input: VoucherPaymentData;\n networkIndex?: number;\n};\n\nexport type VoucherReceipt = {\n paymentId: string;\n};\n\nexport enum VoucherInteropStatus {\n Pending = 'PENDING',\n Succeeded = 'SUCCEEDED',\n Failed = 'FAILED',\n Unknown = 'UNKNOWN',\n}\n\nexport type Voucher = {\n id: string;\n contextId: string | null;\n sessionId: string | null;\n payerId: string | null;\n payeeId: string | null;\n type: VoucherType;\n format: VoucherFormat;\n code: string;\n networks: VoucherNetwork[];\n payers: VoucherPayer[];\n extras: VoucherInstruction[];\n payments: VoucherPayment[];\n receipts: VoucherReceipt[];\n suppliedPayment: PaymentRequest | null;\n expectedPayment: PaymentRequest | null;\n status: VoucherStatus;\n expiresAt: string;\n timeoutAt: string;\n};\n","import {Session, SessionType, Voucher} from '../types';\nimport {apiClient} from './client';\n\ntype OpenVoucherSessionRequest = {\n code: string;\n type: SessionType;\n};\n\ntype JoinVoucherSessionRequest = Record<string, never>;\n\ntype CloseVoucherSessionRequest = Record<string, never>;\n\ntype ReserveVoucherInSessionRequest = Record<string, never>;\n\nexport const sessionApi = {\n getSessionById: async (sessionId: string): Promise<Session> => {\n const response = await apiClient.get<Session>(`/vouchers/sessions/${sessionId}`);\n return response.data;\n },\n\n openSession: async (code: string, type: SessionType = SessionType.Default): Promise<Session> => {\n const response = await apiClient.post<Session>('/vouchers/sessions/session-open', {\n code,\n type,\n } as OpenVoucherSessionRequest);\n return response.data;\n },\n\n joinSession: async (sessionId: string): Promise<Session> => {\n const response = await apiClient.post<Session>(\n `/vouchers/sessions/${sessionId}/session-join`,\n {} as JoinVoucherSessionRequest,\n );\n return response.data;\n },\n\n closeSession: async (sessionId: string): Promise<Session> => {\n const response = await apiClient.post<Session>(\n `/vouchers/sessions/${sessionId}/session-close`,\n {} as CloseVoucherSessionRequest,\n );\n return response.data;\n },\n\n reserveVoucherInSession: async (sessionId: string): Promise<Voucher> => {\n const response = await apiClient.post<Voucher>(\n `/vouchers/sessions/${sessionId}/reserve-voucher`,\n {} as ReserveVoucherInSessionRequest,\n );\n return response.data;\n },\n};\n","import {\n Voucher,\n VoucherInstruction,\n VoucherInteropStatus,\n VoucherNetwork,\n VoucherPayment,\n VoucherReceipt,\n} from '../types';\nimport {apiClient} from './client';\n\ntype ReserveVoucherRequest = {\n code: string;\n};\n\ntype RedeemVoucherRequest = {\n networks?: VoucherNetwork[];\n extras?: VoucherInstruction[];\n payments?: VoucherPayment[];\n expectedPayment?: PaymentRequest | null;\n};\n\ntype ResolveVoucherRequest = {\n receipts: VoucherReceipt[];\n};\n\ntype VoucherInteropStatusResponse = {\n status: VoucherInteropStatus;\n};\n\nexport const vouchersApi = {\n reserveVoucher: async (code: string): Promise<Voucher> => {\n const response = await apiClient.post<Voucher>('/vouchers/reserve-voucher', {\n code,\n } as ReserveVoucherRequest);\n return response.data;\n },\n\n getVoucherById: async (voucherId: string): Promise<Voucher> => {\n const response = await apiClient.get<Voucher>(`/vouchers/${voucherId}`);\n return response.data;\n },\n\n redeemVoucherById: async (\n voucherId: string,\n networks: VoucherNetwork[] = [],\n payments: VoucherPayment[] = [],\n extras: VoucherInstruction[] = [],\n expectedPayment: PaymentRequest | null = null,\n ): Promise<Voucher> => {\n const response = await apiClient.post<Voucher>(`/vouchers/${voucherId}/redeem-voucher`, {\n networks,\n extras,\n payments,\n expectedPayment,\n } as RedeemVoucherRequest);\n return response.data;\n },\n\n resolveVoucher: async (voucherId: string, receipts: VoucherReceipt[]): Promise<Voucher> => {\n const response = await apiClient.post<Voucher>(`/vouchers/${voucherId}/resolve-voucher`, {\n receipts,\n } as ResolveVoucherRequest);\n return response.data;\n },\n\n discardVoucher: async (voucherId: string): Promise<void> => {\n await apiClient.post<void>(`/vouchers/${voucherId}/discard-voucher`, {});\n },\n\n initVoucherInterop: async (\n voucherId: string,\n submitHook: string,\n signature: string,\n ): Promise<{id: string}> => {\n const response = await apiClient.post<{id: string}>(\n `/vouchers/${voucherId}/submit/${submitHook}`,\n {\n signature,\n },\n );\n return response.data;\n },\n\n getVoucherInteropStatus: async (\n voucherId: string,\n statusHook: string,\n ): Promise<VoucherInteropStatusResponse> => {\n const response = await apiClient.get<VoucherInteropStatusResponse>(\n `/vouchers/${voucherId}/status/${statusHook}`,\n );\n return response.data;\n },\n};\n","const STORAGE_PREFIX = 'bleepay_';\n\nexport const storage = {\n get<T>(key: string): T | null {\n if (typeof window === 'undefined') return null;\n try {\n const item = window.localStorage.getItem(`${STORAGE_PREFIX}${key}`);\n return item ? (JSON.parse(item) as T) : null;\n } catch {\n return null;\n }\n },\n\n set<T>(key: string, value: T): void {\n if (typeof window === 'undefined') return;\n try {\n window.localStorage.setItem(`${STORAGE_PREFIX}${key}`, JSON.stringify(value));\n } catch {\n // Storage full or disabled\n }\n },\n\n remove(key: string): void {\n if (typeof window === 'undefined') return;\n try {\n window.localStorage.removeItem(`${STORAGE_PREFIX}${key}`);\n } catch {\n // Storage disabled\n }\n },\n\n clear(): void {\n if (typeof window === 'undefined') return;\n try {\n const keys = Object.keys(window.localStorage);\n for (const key of keys) {\n if (key.startsWith(STORAGE_PREFIX)) {\n window.localStorage.removeItem(key);\n }\n }\n } catch {\n // Storage disabled\n }\n },\n};\n","import {VOUCHER_CODE_LENGTH, VOUCHER_CODE_PATTERN} from '../constants';\n\nexport const isValidVoucherCode = (code: string): boolean => {\n return VOUCHER_CODE_PATTERN.test(code);\n};\n\nexport const normalizeVoucherCode = (code: string): string => {\n return code.replace(/\\D/g, '').slice(0, VOUCHER_CODE_LENGTH);\n};\n\nexport const isValidAddress = (address: string): boolean => {\n return /^0x[a-fA-F0-9]{40}$/.test(address);\n};\n\nexport const isValidChainId = (chainId: unknown): chainId is number => {\n return typeof chainId === 'number' && Number.isInteger(chainId) && chainId > 0;\n};\n\nexport const formatAddress = (address: string, prefixLength = 6, suffixLength = 4): string => {\n if (!isValidAddress(address)) return address;\n return `${address.slice(0, prefixLength)}...${address.slice(-suffixLength)}`;\n};\n\nexport const formatAmount = (amount: string | number, decimals = 2): string => {\n const num = typeof amount === 'string' ? Number.parseFloat(amount) : amount;\n return num.toLocaleString('en-US', {\n minimumFractionDigits: decimals,\n maximumFractionDigits: decimals,\n });\n};\n","import {type VoucherPayer, type VoucherReceipt} from '../types';\n\nexport const createVoucherPayer = (address: string): VoucherPayer => {\n return {\n address,\n };\n};\n\nexport const createVoucherReceipt = (paymentId: string): VoucherReceipt => {\n return {\n paymentId,\n };\n};\n","import {\n type EthereumNativeCallTransaction,\n type EthereumNativeMethod,\n type EthereumNativeSendTransaction,\n type VoucherInstruction,\n VoucherInstructionType,\n type VoucherNetwork,\n type VoucherPayment,\n VoucherPaymentSystemRpcMethod,\n VoucherPaymentType,\n} from '../types';\n\nexport const createEvmNetwork = (params: {\n network: string;\n chainId: string | number;\n}): VoucherNetwork => {\n return {\n network: params.network,\n type: 'evm',\n chainId: String(params.chainId),\n };\n};\n\nexport const createEvmRpcMethodInstruction = (params: {\n method: string;\n params: object;\n networkIndex?: number;\n}): VoucherInstruction => {\n return {\n type: VoucherInstructionType.NativeRpcMethod,\n input: {\n method: params.method,\n params: params.params,\n } as EthereumNativeMethod,\n networkIndex: params.networkIndex,\n };\n};\n\nexport const createEvmCallTransactionInstruction = (params: {\n from: string;\n to: string;\n value: string;\n data: string;\n networkIndex?: number;\n}): VoucherInstruction => {\n return {\n type: VoucherInstructionType.NativeCallTransaction,\n input: {\n method: 'eth_call',\n params: {\n from: params.from,\n to: params.to,\n value: params.value,\n data: params.data,\n } as EthereumNativeCallTransaction,\n },\n networkIndex: params.networkIndex,\n };\n};\n\nexport const createEvmSendTransactionInstruction = (params: {\n from: string;\n to: string;\n value: string;\n data: string;\n networkIndex?: number;\n}): VoucherInstruction => {\n return {\n type: VoucherInstructionType.NativeSendTransaction,\n input: {\n method: 'eth_sendTransaction',\n params: {\n from: params.from,\n to: params.to,\n value: params.value,\n data: params.data,\n } as EthereumNativeSendTransaction,\n },\n networkIndex: params.networkIndex,\n };\n};\n\nexport const createEvmSystemRpcMethodPayment = (params: {\n method: string;\n params: object;\n networkIndex?: number;\n}): VoucherPayment => {\n return {\n type: VoucherPaymentType.SystemRpcMethod,\n input: {\n method: params.method,\n params: params.params,\n } as VoucherPaymentSystemRpcMethod,\n networkIndex: params.networkIndex,\n };\n};\n\nexport const createEvmPayment = (params: {\n from: string;\n to: string;\n value: string;\n data?: string;\n networkIndex?: number;\n}): VoucherPayment => {\n return {\n type: VoucherPaymentType.NativeSendTransaction,\n input: {\n method: 'eth_sendTransaction',\n params: {\n from: params.from,\n to: params.to,\n value: params.value,\n data: params.data || '0x',\n } as EthereumNativeSendTransaction,\n },\n networkIndex: params.networkIndex,\n };\n};\n\nexport const isEvmNetwork = (network: VoucherNetwork): boolean => {\n return network.type === 'evm';\n};\n"],"mappings":";AAAO,IAAM,eAAe;AAErB,IAAM,sBAAsB;AAC5B,IAAM,uBAAuB;AAE7B,IAAM,qBAAqB;;;ACQ3B,IAAM,YAAY;AAAA,EACvB,SAAS;AAAA,EACT,SAAS;AAAA,EACT,cAAc;AAAA,EAEd,MAAM,QAAW,QAAgB,MAAc,MAAyC;AACtF,UAAM,aAAa,IAAI,gBAAgB;AACvC,UAAM,YAAY,WAAW,MAAM,WAAW,MAAM,GAAG,KAAK,OAAO;AAEnE,QAAI;AACF,YAAM,UAAkC;AAAA,QACtC,gBAAgB;AAAA,MAClB;AAEA,UAAI,KAAK,cAAc;AACrB,gBAAQ,gBAAgB,UAAU,KAAK,YAAY;AAAA,MACrD;AAEA,YAAM,WAAW,MAAM,MAAM,GAAG,KAAK,OAAO,GAAG,IAAI,IAAI;AAAA,QACrD;AAAA,QACA;AAAA,QACA,MAAM,OAAO,KAAK,UAAU,IAAI,IAAI;AAAA,QACpC,QAAQ,WAAW;AAAA,MACrB,CAAC;AAED,mBAAa,SAAS;AAEtB,UAAI,CAAC,SAAS,IAAI;AAChB,gBAAQ,IAAI,uBAAuB,QAAQ;AAC3C,cAAM,QAAS,MAAM,SAAS,KAAK;AACnC,cAAM,IAAI,MAAM,MAAM,WAAW,cAAc,SAAS,MAAM,EAAE;AAAA,MAClE;AAEA,YAAM,OAAQ,MAAM,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A,EACvB;AACF;AAEO,IAAM,kCAAkC,CAAC,WAI1B;AACpB,SAAO;AAAA,IACL;AAAA,IACA,OAAO;AAAA,MACL,QAAQ,OAAO;AAAA,MACf,QAAQ,OAAO;AAAA,IACjB;AAAA,IACA,cAAc,OAAO;AAAA,EACvB;AACF;AAEO,IAAM,mBAAmB,CAAC,WAMX;AACpB,SAAO;AAAA,IACL;AAAA,IACA,OAAO;AAAA,MACL,QAAQ;AAAA,MACR,QAAQ;AAAA,QACN,MAAM,OAAO;AAAA,QACb,IAAI,OAAO;AAAA,QACX,OAAO,OAAO;AAAA,QACd,MAAM,OAAO,QAAQ;AAAA,MACvB;AAAA,IACF;AAAA,IACA,cAAc,OAAO;AAAA,EACvB;AACF;AAEO,IAAM,eAAe,CAAC,YAAqC;AAChE,SAAO,QAAQ,SAAS;AAC1B;","names":["ContextType","ContextFormat","ContextStatus","SessionType","SessionFormat","SessionStatus","VoucherFormat","VoucherType","VoucherStatus","VoucherInstructionType","VoucherPaymentType","VoucherInteropStatus"]}
|
|
1
|
+
{"version":3,"sources":["../src/constants/index.ts","../src/api/client.ts","../src/api/auth.ts","../src/types/context.ts","../src/api/context.ts","../src/types/session.ts","../src/types/voucher.ts","../src/api/session.ts","../src/api/vouchers.ts","../src/utils/storage.ts","../src/utils/validation.ts","../src/utils/voucher-common.ts","../src/utils/voucher-evm.ts"],"sourcesContent":["export const API_BASE_URL = 'https://payments-sandbox.bleepay.com/api/v1';\n\nexport const VOUCHER_CODE_LENGTH = 6;\nexport const VOUCHER_CODE_PATTERN = /^\\d{6}$/;\n\nexport const DEFAULT_TIMEOUT_MS = 30000;\n","import {API_BASE_URL, DEFAULT_TIMEOUT_MS} from '../constants';\n\nexport type ApiResponse<T> = {\n data: T;\n status: number;\n};\n\nexport type ApiError = {\n code: string;\n message: string;\n status: number;\n};\n\nexport const apiClient = {\n baseUrl: API_BASE_URL,\n timeout: DEFAULT_TIMEOUT_MS,\n sessionToken: null as string | null,\n\n async request<T>(method: string, path: string, body?: unknown): Promise<ApiResponse<T>> {\n const controller = new AbortController();\n const timeoutId = setTimeout(() => controller.abort(), this.timeout);\n\n try {\n const headers: Record<string, string> = {\n 'Content-Type': 'application/json',\n };\n\n if (this.sessionToken) {\n headers.Authorization = `Bearer ${this.sessionToken}`;\n }\n\n const response = await fetch(`${this.baseUrl}${path}`, {\n method,\n headers,\n body: body ? JSON.stringify(body) : undefined,\n signal: controller.signal,\n });\n\n clearTimeout(timeoutId);\n\n if (!response.ok) {\n console.log('API error response:', response);\n const error = (await response.json()) as ApiError;\n throw new Error(error.message || `API error: ${response.status}`);\n }\n\n const data = (await response.json()) as T;\n return {data, status: response.status};\n } catch (error) {\n console.error('API request error:', error);\n clearTimeout(timeoutId);\n if (error instanceof Error && error.name === 'AbortError') {\n throw new Error('Request timeout');\n }\n throw error;\n }\n },\n\n setSessionToken(token: string): void {\n this.sessionToken = token;\n },\n\n async get<T>(path: string): Promise<ApiResponse<T>> {\n return this.request<T>('GET', path);\n },\n\n async post<T>(path: string, body: unknown): Promise<ApiResponse<T>> {\n return this.request<T>('POST', path, body);\n },\n\n async put<T>(path: string, body: unknown): Promise<ApiResponse<T>> {\n return this.request<T>('PUT', path, body);\n },\n\n async delete<T>(path: string): Promise<ApiResponse<T>> {\n return this.request<T>('DELETE', path);\n },\n};\n","import {apiClient} from './client';\n\nexport type SignInInput = {\n type: 'resource';\n data: SignInWithResourceInput;\n};\n\nexport type SignInResponse = {\n authorization: {\n token: string;\n expiresIn: string;\n };\n};\n\nexport type SignInWithResourceInput = {\n resource: string;\n};\n\nexport const authApi = {\n async signIn(signInInput: SignInInput): Promise<SignInResponse> {\n const response = await apiClient.post<SignInResponse>('/auth/sign-in', signInInput);\n return response.data;\n },\n};\n","import type {Session} from './session';\nimport type {Voucher} from './voucher';\n\nexport enum ContextType {\n Default = 'CONTEXT_DEFAULT',\n}\n\nexport enum ContextFormat {\n Numeric = 'numeric',\n Alphanum = 'alphanum',\n}\n\nexport enum ContextStatus {\n Open = 'OPEN',\n Closed = 'CLOSED',\n Expired = 'EXPIRED',\n}\n\nexport type ContextPayer = {\n address: string;\n};\n\nexport type ContextResource = Voucher | Session;\n\nexport type Context = {\n id: string;\n payerId: string | null;\n payeeId: string | null;\n type: ContextType;\n format: ContextFormat;\n code: string;\n payers: ContextPayer[];\n resources: ContextResource[];\n status: ContextStatus;\n expiresAt: string;\n};\n","import {Context, ContextFormat, ContextPayer} from '../types/context';\nimport {apiClient} from './client';\n\ntype OpenVoucherContextRequest = {\n format: ContextFormat;\n payers?: ContextPayer[];\n};\n\ntype CloseVoucherContextRequest = {\n payeeId: string | null;\n};\n\nexport const contextApi = {\n openContext: async (\n format: ContextFormat = ContextFormat.Numeric,\n payers: ContextPayer[] = [],\n ): Promise<Context> => {\n const response = await apiClient.post<Context>('/vouchers/contexts/context-open', {\n format,\n payers,\n } as OpenVoucherContextRequest);\n return response.data;\n },\n\n getContextById: async (contextId: string): Promise<Context> => {\n const response = await apiClient.get<Context>(`/vouchers/contexts/${contextId}`);\n return response.data;\n },\n\n closeContext: async (contextId: string, payeeId: string | null = null): Promise<Context> => {\n const response = await apiClient.post<Context>(\n `/vouchers/contexts/${contextId}/context-close`,\n {\n payeeId,\n } as CloseVoucherContextRequest,\n );\n return response.data;\n },\n};\n","export enum SessionType {\n Default = 'SESSION_DEFAULT',\n}\n\nexport enum SessionFormat {\n Numeric = 'numeric',\n Alphanum = 'alphanum',\n}\n\nexport enum SessionStatus {\n Open = 'OPEN',\n Negotiating = 'NEGOTIATING',\n Established = 'ESTABLISHED',\n Closed = 'CLOSED',\n Expired = 'EXPIRED',\n TimedOut = 'TIMED_OUT',\n}\n\nexport type SessionPayer = {\n address: string;\n};\n\nexport type Session = {\n id: string;\n contextId: string | null;\n payerId: string | null;\n payeeId: string | null;\n type: SessionType;\n format: SessionFormat;\n code: string;\n payers: SessionPayer[];\n status: SessionStatus;\n expiresAt: string;\n timeoutAt: string;\n};\n","export type SolanaPayerInstructionKey = {\n pubkey: string;\n isSigner?: boolean;\n isWritable?: boolean;\n};\n\nexport type SolanaPayerInstruction = {\n programId: string;\n keys: SolanaPayerInstructionKey[];\n data?: string;\n};\n\nexport type SolanaPayeeInstructionKey = {\n pubkey: string;\n isWritable?: boolean;\n};\n\nexport type SolanaPayeeInstruction = {\n programId: string;\n accounts: SolanaPayeeInstructionKey[];\n data?: string;\n};\n\nexport type SolanaInstruction = SolanaPayerInstruction & SolanaPayeeInstruction;\n\nexport type EthereumNativeMethod = {\n method: string;\n params: object;\n};\n\nexport type NativeMethod = EthereumNativeMethod;\n\nexport type EthereumNativeSendTransaction = {\n from: string;\n to: string;\n value: string;\n data: string;\n};\n\nexport type SolanaNativeSendTransaction = {\n feePayer: string;\n recentBlockhash?: string;\n instructions: SolanaInstruction[];\n};\n\nexport type NativeSendTransaction = EthereumNativeSendTransaction | SolanaNativeSendTransaction;\n\nexport type EthereumNativeCallTransaction = {\n from: string;\n to: string;\n value: string;\n data: string;\n};\n\nexport type SolanaNativeCallTransaction = {\n feePayer: string;\n recentBlockhash?: string;\n instructions: SolanaInstruction[];\n};\n\nexport type NativeCallTransaction = EthereumNativeCallTransaction | SolanaNativeCallTransaction;\n\nexport type PaymentRequestWallet = {\n address: string;\n};\n\nexport type PaymentRequest = {\n network: string;\n currency: string;\n currencyAddress: string;\n amount: string;\n wallet: PaymentRequestWallet;\n};\n\nexport type EthereumPlatformData = {\n network: string;\n chainId: string;\n};\n\nexport type SolanaPlatformData = {\n network: string;\n};\n\nexport type PlatformData = EthereumPlatformData | SolanaPlatformData;\n\nexport type VoucherNetwork = {\n network: string;\n type: 'evm' | 'solana';\n chainId?: string;\n};\n\nexport enum VoucherFormat {\n Numeric = 'numeric',\n Alphanum = 'alphanum',\n}\n\nexport enum VoucherType {\n Custom = 'VOUCHER_CUSTOM',\n Simple = 'VOUCHER_SIMPLE',\n}\n\nexport enum VoucherStatus {\n Reserved = 'RESERVED',\n Redeemed = 'REDEEMED',\n Discarded = 'DISCARDED',\n Resolved = 'RESOLVED',\n Expired = 'EXPIRED',\n}\n\nexport type VoucherPayer = {\n address: string;\n};\n\nexport enum VoucherInstructionType {\n NativeRpcMethod = 'rpc_method',\n NativeCallTransaction = 'call_transaction',\n NativeSendTransaction = 'send_transaction',\n}\n\nexport type VoucherInstructionRpcMethod = NativeMethod;\n\nexport type VoucherInstructionSendTransaction = {\n method: string;\n params: NativeSendTransaction;\n};\n\nexport type VoucherInstructionCallTransaction = {\n method: string;\n params: NativeCallTransaction;\n};\n\nexport type VoucherInstructionData =\n | VoucherInstructionRpcMethod\n | VoucherInstructionSendTransaction\n | VoucherInstructionCallTransaction;\n\nexport type VoucherInstruction = {\n type: VoucherInstructionType;\n input: VoucherInstructionData;\n networkIndex?: number;\n};\n\nexport enum VoucherPaymentType {\n SystemRpcMethod = 'system_rpc_method',\n SystemApiMethod = 'system_api_method',\n NativeSendTransaction = 'send_transaction',\n}\n\nexport type VoucherPaymentRpcMethod = NativeMethod;\n\nexport type VoucherPaymentSystemApiMethod = {\n submitHook: string;\n statusHook: string;\n};\n\nexport type VoucherPaymentSystemRpcMethod = NativeMethod & VoucherPaymentSystemApiMethod;\n\nexport type VoucherPaymentSendTransaction = {\n method: string;\n params: NativeSendTransaction;\n};\n\nexport type VoucherPaymentData =\n | VoucherPaymentSystemRpcMethod\n | VoucherPaymentSystemApiMethod\n | VoucherPaymentSendTransaction;\n\nexport type VoucherPayment = {\n type: VoucherPaymentType;\n input: VoucherPaymentData;\n networkIndex?: number;\n};\n\nexport type VoucherReceipt = {\n paymentId: string;\n};\n\nexport enum VoucherInteropStatus {\n Pending = 'PENDING',\n Succeeded = 'SUCCEEDED',\n Failed = 'FAILED',\n Unknown = 'UNKNOWN',\n}\n\nexport type PayeeInfo = {\n appName: string;\n appIconUrl: string;\n};\n\nexport type Voucher = {\n id: string;\n contextId: string | null;\n sessionId: string | null;\n payerId: string | null;\n payeeId: string | null;\n payeeInfo: PayeeInfo | null;\n type: VoucherType;\n format: VoucherFormat;\n code: string;\n networks: VoucherNetwork[];\n payers: VoucherPayer[];\n extras: VoucherInstruction[];\n payments: VoucherPayment[];\n receipts: VoucherReceipt[];\n suppliedPayment: PaymentRequest | null;\n expectedPayment: PaymentRequest | null;\n status: VoucherStatus;\n expiresAt: string;\n timeoutAt: string;\n};\n","import {Session, SessionType, Voucher} from '../types';\nimport {apiClient} from './client';\n\ntype OpenVoucherSessionRequest = {\n code: string;\n type: SessionType;\n};\n\ntype JoinVoucherSessionRequest = Record<string, never>;\n\ntype CloseVoucherSessionRequest = Record<string, never>;\n\ntype ReserveVoucherInSessionRequest = Record<string, never>;\n\nexport const sessionApi = {\n getSessionById: async (sessionId: string): Promise<Session> => {\n const response = await apiClient.get<Session>(`/vouchers/sessions/${sessionId}`);\n return response.data;\n },\n\n openSession: async (code: string, type: SessionType = SessionType.Default): Promise<Session> => {\n const response = await apiClient.post<Session>('/vouchers/sessions/session-open', {\n code,\n type,\n } as OpenVoucherSessionRequest);\n return response.data;\n },\n\n joinSession: async (sessionId: string): Promise<Session> => {\n const response = await apiClient.post<Session>(\n `/vouchers/sessions/${sessionId}/session-join`,\n {} as JoinVoucherSessionRequest,\n );\n return response.data;\n },\n\n closeSession: async (sessionId: string): Promise<Session> => {\n const response = await apiClient.post<Session>(\n `/vouchers/sessions/${sessionId}/session-close`,\n {} as CloseVoucherSessionRequest,\n );\n return response.data;\n },\n\n reserveVoucherInSession: async (sessionId: string): Promise<Voucher> => {\n const response = await apiClient.post<Voucher>(\n `/vouchers/sessions/${sessionId}/reserve-voucher`,\n {} as ReserveVoucherInSessionRequest,\n );\n return response.data;\n },\n};\n","import {\n PayeeInfo,\n PaymentRequest,\n Voucher,\n VoucherInstruction,\n VoucherInteropStatus,\n VoucherNetwork,\n VoucherPayment,\n VoucherReceipt,\n} from '../types';\nimport {apiClient} from './client';\n\ntype ReserveVoucherRequest = {\n code: string;\n};\n\ntype RedeemVoucherRequest =\n | {\n networks?: VoucherNetwork[];\n extras?: VoucherInstruction[];\n payments?: VoucherPayment[];\n payeeInfo?: PayeeInfo | null;\n }\n | {\n expectedPayment?: PaymentRequest | null;\n payeeInfo?: PayeeInfo | null;\n };\n\ntype ResolveVoucherRequest = {\n receipts: VoucherReceipt[];\n};\n\ntype VoucherInteropStatusResponse = {\n status: VoucherInteropStatus;\n};\n\nexport const vouchersApi = {\n reserveVoucher: async (code: string): Promise<Voucher> => {\n const response = await apiClient.post<Voucher>('/vouchers/reserve-voucher', {\n code,\n } as ReserveVoucherRequest);\n return response.data;\n },\n\n getVoucherById: async (voucherId: string): Promise<Voucher> => {\n const response = await apiClient.get<Voucher>(`/vouchers/${voucherId}`);\n return response.data;\n },\n\n redeemVoucherById: async (voucherId: string, data: RedeemVoucherRequest): Promise<Voucher> => {\n const response = await apiClient.post<Voucher>(`/vouchers/${voucherId}/redeem-voucher`, {\n ...data,\n } as RedeemVoucherRequest);\n return response.data;\n },\n\n resolveVoucher: async (voucherId: string, receipts: VoucherReceipt[]): Promise<Voucher> => {\n const response = await apiClient.post<Voucher>(`/vouchers/${voucherId}/resolve-voucher`, {\n receipts,\n } as ResolveVoucherRequest);\n return response.data;\n },\n\n discardVoucher: async (voucherId: string): Promise<void> => {\n await apiClient.post<void>(`/vouchers/${voucherId}/discard-voucher`, {});\n },\n\n initVoucherInterop: async (\n voucherId: string,\n submitHook: string,\n signature: string,\n ): Promise<{id: string}> => {\n const response = await apiClient.post<{id: string}>(\n `/vouchers/${voucherId}/submit/${submitHook}`,\n {\n signature,\n },\n );\n return response.data;\n },\n\n getVoucherInteropStatus: async (\n voucherId: string,\n statusHook: string,\n ): Promise<VoucherInteropStatusResponse> => {\n const response = await apiClient.get<VoucherInteropStatusResponse>(\n `/vouchers/${voucherId}/status/${statusHook}`,\n );\n return response.data;\n },\n};\n","const STORAGE_PREFIX = 'bleepay_';\n\nexport const storage = {\n get<T>(key: string): T | null {\n if (typeof window === 'undefined') return null;\n try {\n const item = window.localStorage.getItem(`${STORAGE_PREFIX}${key}`);\n return item ? (JSON.parse(item) as T) : null;\n } catch {\n return null;\n }\n },\n\n set<T>(key: string, value: T): void {\n if (typeof window === 'undefined') return;\n try {\n window.localStorage.setItem(`${STORAGE_PREFIX}${key}`, JSON.stringify(value));\n } catch {\n // Storage full or disabled\n }\n },\n\n remove(key: string): void {\n if (typeof window === 'undefined') return;\n try {\n window.localStorage.removeItem(`${STORAGE_PREFIX}${key}`);\n } catch {\n // Storage disabled\n }\n },\n\n clear(): void {\n if (typeof window === 'undefined') return;\n try {\n const keys = Object.keys(window.localStorage);\n for (const key of keys) {\n if (key.startsWith(STORAGE_PREFIX)) {\n window.localStorage.removeItem(key);\n }\n }\n } catch {\n // Storage disabled\n }\n },\n};\n","import {VOUCHER_CODE_LENGTH, VOUCHER_CODE_PATTERN} from '../constants';\n\nexport const isValidVoucherCode = (code: string): boolean => {\n return VOUCHER_CODE_PATTERN.test(code);\n};\n\nexport const normalizeVoucherCode = (code: string): string => {\n return code.replace(/\\D/g, '').slice(0, VOUCHER_CODE_LENGTH);\n};\n\nexport const isValidAddress = (address: string): boolean => {\n return /^0x[a-fA-F0-9]{40}$/.test(address);\n};\n\nexport const isValidChainId = (chainId: unknown): chainId is number => {\n return typeof chainId === 'number' && Number.isInteger(chainId) && chainId > 0;\n};\n\nexport const formatAddress = (address: string, prefixLength = 6, suffixLength = 4): string => {\n if (!isValidAddress(address)) return address;\n return `${address.slice(0, prefixLength)}...${address.slice(-suffixLength)}`;\n};\n\nexport const formatAmount = (amount: string | number, decimals = 2): string => {\n const num = typeof amount === 'string' ? Number.parseFloat(amount) : amount;\n return num.toLocaleString('en-US', {\n minimumFractionDigits: decimals,\n maximumFractionDigits: decimals,\n });\n};\n","import {PayeeInfo, type VoucherPayer, type VoucherReceipt} from '../types';\n\nexport const createVoucherPayer = (address: string): VoucherPayer => {\n return {\n address,\n };\n};\n\nexport const createVoucherReceipt = (paymentId: string): VoucherReceipt => {\n return {\n paymentId,\n };\n};\n\nexport const createPayeeInfo = (appName: string, appIconUrl: string): PayeeInfo => {\n return {\n appName,\n appIconUrl,\n };\n};\n","import {\n type EthereumNativeCallTransaction,\n type EthereumNativeMethod,\n type EthereumNativeSendTransaction,\n type VoucherInstruction,\n VoucherInstructionType,\n type VoucherNetwork,\n type VoucherPayment,\n VoucherPaymentSystemRpcMethod,\n VoucherPaymentType,\n} from '../types';\n\nexport const createEvmNetwork = (params: {\n network: string;\n chainId: string | number;\n}): VoucherNetwork => {\n return {\n network: params.network,\n type: 'evm',\n chainId: String(params.chainId),\n };\n};\n\nexport const createEvmRpcMethodInstruction = (params: {\n method: string;\n params: object;\n networkIndex?: number;\n}): VoucherInstruction => {\n return {\n type: VoucherInstructionType.NativeRpcMethod,\n input: {\n method: params.method,\n params: params.params,\n } as EthereumNativeMethod,\n networkIndex: params.networkIndex,\n };\n};\n\nexport const createEvmCallTransactionInstruction = (params: {\n from: string;\n to: string;\n value: string;\n data: string;\n networkIndex?: number;\n}): VoucherInstruction => {\n return {\n type: VoucherInstructionType.NativeCallTransaction,\n input: {\n method: 'eth_call',\n params: {\n from: params.from,\n to: params.to,\n value: params.value,\n data: params.data,\n } as EthereumNativeCallTransaction,\n },\n networkIndex: params.networkIndex,\n };\n};\n\nexport const createEvmSendTransactionInstruction = (params: {\n from: string;\n to: string;\n value: string;\n data: string;\n networkIndex?: number;\n}): VoucherInstruction => {\n return {\n type: VoucherInstructionType.NativeSendTransaction,\n input: {\n method: 'eth_sendTransaction',\n params: {\n from: params.from,\n to: params.to,\n value: params.value,\n data: params.data,\n } as EthereumNativeSendTransaction,\n },\n networkIndex: params.networkIndex,\n };\n};\n\nexport const createEvmSystemRpcMethodPayment = (params: {\n method: string;\n params: object;\n networkIndex?: number;\n}): VoucherPayment => {\n return {\n type: VoucherPaymentType.SystemRpcMethod,\n input: {\n method: params.method,\n params: params.params,\n } as VoucherPaymentSystemRpcMethod,\n networkIndex: params.networkIndex,\n };\n};\n\nexport const createEvmPayment = (params: {\n from: string;\n to: string;\n value: string;\n data?: string;\n networkIndex?: number;\n}): VoucherPayment => {\n return {\n type: VoucherPaymentType.NativeSendTransaction,\n input: {\n method: 'eth_sendTransaction',\n params: {\n from: params.from,\n to: params.to,\n value: params.value,\n data: params.data || '0x',\n } as EthereumNativeSendTransaction,\n },\n networkIndex: params.networkIndex,\n };\n};\n\nexport const isEvmNetwork = (network: VoucherNetwork): boolean => {\n return network.type === 'evm';\n};\n"],"mappings":";AAAO,IAAM,eAAe;AAErB,IAAM,sBAAsB;AAC5B,IAAM,uBAAuB;AAE7B,IAAM,qBAAqB;;;ACQ3B,IAAM,YAAY;AAAA,EACvB,SAAS;AAAA,EACT,SAAS;AAAA,EACT,cAAc;AAAA,EAEd,MAAM,QAAW,QAAgB,MAAc,MAAyC;AACtF,UAAM,aAAa,IAAI,gBAAgB;AACvC,UAAM,YAAY,WAAW,MAAM,WAAW,MAAM,GAAG,KAAK,OAAO;AAEnE,QAAI;AACF,YAAM,UAAkC;AAAA,QACtC,gBAAgB;AAAA,MAClB;AAEA,UAAI,KAAK,cAAc;AACrB,gBAAQ,gBAAgB,UAAU,KAAK,YAAY;AAAA,MACrD;AAEA,YAAM,WAAW,MAAM,MAAM,GAAG,KAAK,OAAO,GAAG,IAAI,IAAI;AAAA,QACrD;AAAA,QACA;AAAA,QACA,MAAM,OAAO,KAAK,UAAU,IAAI,IAAI;AAAA,QACpC,QAAQ,WAAW;AAAA,MACrB,CAAC;AAED,mBAAa,SAAS;AAEtB,UAAI,CAAC,SAAS,IAAI;AAChB,gBAAQ,IAAI,uBAAuB,QAAQ;AAC3C,cAAM,QAAS,MAAM,SAAS,KAAK;AACnC,cAAM,IAAI,MAAM,MAAM,WAAW,cAAc,SAAS,MAAM,EAAE;AAAA,MAClE;AAEA,YAAM,OAAQ,MAAM,SAAS,KAAK;AAClC,aAAO,EAAC,MAAM,QAAQ,SAAS,OAAM;AAAA,IACvC,SAAS,OAAO;AACd,cAAQ,MAAM,sBAAsB,KAAK;AACzC,mBAAa,SAAS;AACtB,UAAI,iBAAiB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,IACA,cAAc,OAAO;AAAA,EACvB;AACF;AAEO,IAAM,mBAAmB,CAAC,WAMX;AACpB,SAAO;AAAA,IACL;AAAA,IACA,OAAO;AAAA,MACL,QAAQ;AAAA,MACR,QAAQ;AAAA,QACN,MAAM,OAAO;AAAA,QACb,IAAI,OAAO;AAAA,QACX,OAAO,OAAO;AAAA,QACd,MAAM,OAAO,QAAQ;AAAA,MACvB;AAAA,IACF;AAAA,IACA,cAAc,OAAO;AAAA,EACvB;AACF;AAEO,IAAM,eAAe,CAAC,YAAqC;AAChE,SAAO,QAAQ,SAAS;AAC1B;","names":["ContextType","ContextFormat","ContextStatus","SessionType","SessionFormat","SessionStatus","VoucherFormat","VoucherType","VoucherStatus","VoucherInstructionType","VoucherPaymentType","VoucherInteropStatus"]}
|