@swype-org/react-sdk 0.1.98 → 0.1.102

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.cts CHANGED
@@ -121,7 +121,6 @@ interface Transfer {
121
121
  amount: Amount;
122
122
  createDate: string;
123
123
  updateDate: string;
124
- authorizationSessions: AuthorizationSession[];
125
124
  signPayload?: TransferSignPayload | null;
126
125
  }
127
126
  /** Standard API error shape */
@@ -143,7 +142,7 @@ interface ActionExecutionResult {
143
142
  data?: unknown;
144
143
  }
145
144
  /** Source type discriminator for transfer creation */
146
- type SourceType = 'providerId' | 'accountId' | 'walletId' | 'tokenId';
145
+ type SourceType = 'accountId' | 'walletId' | 'tokenId';
147
146
  /** A chain+token option from the SELECT_SOURCE action metadata. */
148
147
  interface SourceOption {
149
148
  chainName: string;
@@ -298,6 +297,15 @@ declare function useSwypeDepositAmount(): {
298
297
  declare function fetchProviders(apiBaseUrl: string, token: string): Promise<Provider[]>;
299
298
  declare function fetchChains(apiBaseUrl: string, token: string): Promise<Chain[]>;
300
299
  declare function fetchAccounts(apiBaseUrl: string, token: string, credentialId: string): Promise<Account[]>;
300
+ declare function fetchAccount(apiBaseUrl: string, token: string, accountId: string, credentialId: string): Promise<Account>;
301
+ interface CreateAccountParams {
302
+ /** Caller-supplied UUID v4 for idempotency. If omitted, a random UUID is generated. */
303
+ id?: string;
304
+ name: string;
305
+ credentialId: string;
306
+ providerId: string;
307
+ }
308
+ declare function createAccount(apiBaseUrl: string, token: string, params: CreateAccountParams): Promise<Account>;
301
309
  interface CreateTransferParams {
302
310
  /** Caller-supplied UUID v4 for idempotency. If omitted, a random UUID is generated. */
303
311
  id?: string;
@@ -353,8 +361,11 @@ declare function updateUserConfigBySession(apiBaseUrl: string, sessionId: string
353
361
  }): Promise<void>;
354
362
  declare function reportActionCompletion(apiBaseUrl: string, actionId: string, result: Record<string, unknown>): Promise<AuthorizationSessionDetail>;
355
363
 
364
+ type api_CreateAccountParams = CreateAccountParams;
356
365
  type api_CreateTransferParams = CreateTransferParams;
366
+ declare const api_createAccount: typeof createAccount;
357
367
  declare const api_createTransfer: typeof createTransfer;
368
+ declare const api_fetchAccount: typeof fetchAccount;
358
369
  declare const api_fetchAccounts: typeof fetchAccounts;
359
370
  declare const api_fetchAuthorizationSession: typeof fetchAuthorizationSession;
360
371
  declare const api_fetchChains: typeof fetchChains;
@@ -369,7 +380,7 @@ declare const api_signTransfer: typeof signTransfer;
369
380
  declare const api_updateUserConfig: typeof updateUserConfig;
370
381
  declare const api_updateUserConfigBySession: typeof updateUserConfigBySession;
371
382
  declare namespace api {
372
- export { type api_CreateTransferParams as CreateTransferParams, api_createTransfer as createTransfer, api_fetchAccounts as fetchAccounts, api_fetchAuthorizationSession as fetchAuthorizationSession, api_fetchChains as fetchChains, api_fetchMerchantPublicKey as fetchMerchantPublicKey, api_fetchProviders as fetchProviders, api_fetchTransfer as fetchTransfer, api_fetchUserConfig as fetchUserConfig, api_registerPasskey as registerPasskey, api_reportActionCompletion as reportActionCompletion, api_reportPasskeyActivity as reportPasskeyActivity, api_signTransfer as signTransfer, api_updateUserConfig as updateUserConfig, api_updateUserConfigBySession as updateUserConfigBySession };
383
+ export { type api_CreateAccountParams as CreateAccountParams, type api_CreateTransferParams as CreateTransferParams, api_createAccount as createAccount, api_createTransfer as createTransfer, api_fetchAccount as fetchAccount, api_fetchAccounts as fetchAccounts, api_fetchAuthorizationSession as fetchAuthorizationSession, api_fetchChains as fetchChains, api_fetchMerchantPublicKey as fetchMerchantPublicKey, api_fetchProviders as fetchProviders, api_fetchTransfer as fetchTransfer, api_fetchUserConfig as fetchUserConfig, api_registerPasskey as registerPasskey, api_reportActionCompletion as reportActionCompletion, api_reportPasskeyActivity as reportPasskeyActivity, api_signTransfer as signTransfer, api_updateUserConfig as updateUserConfig, api_updateUserConfigBySession as updateUserConfigBySession };
373
384
  }
374
385
 
375
386
  interface SwypePaymentProps {
@@ -554,7 +565,6 @@ interface UseAuthorizationExecutorResult {
554
565
  resolveSelectSource: (selection: SourceSelection) => void;
555
566
  /** Execute authorization by session id. */
556
567
  executeSessionById: (sessionId: string) => Promise<void>;
557
- executeSession: (transfer: Transfer) => Promise<void>;
558
568
  }
559
569
  interface UseAuthorizationExecutorOptions {
560
570
  /** Optional API base URL override when used outside SwypeProvider. */
package/dist/index.d.ts CHANGED
@@ -121,7 +121,6 @@ interface Transfer {
121
121
  amount: Amount;
122
122
  createDate: string;
123
123
  updateDate: string;
124
- authorizationSessions: AuthorizationSession[];
125
124
  signPayload?: TransferSignPayload | null;
126
125
  }
127
126
  /** Standard API error shape */
@@ -143,7 +142,7 @@ interface ActionExecutionResult {
143
142
  data?: unknown;
144
143
  }
145
144
  /** Source type discriminator for transfer creation */
146
- type SourceType = 'providerId' | 'accountId' | 'walletId' | 'tokenId';
145
+ type SourceType = 'accountId' | 'walletId' | 'tokenId';
147
146
  /** A chain+token option from the SELECT_SOURCE action metadata. */
148
147
  interface SourceOption {
149
148
  chainName: string;
@@ -298,6 +297,15 @@ declare function useSwypeDepositAmount(): {
298
297
  declare function fetchProviders(apiBaseUrl: string, token: string): Promise<Provider[]>;
299
298
  declare function fetchChains(apiBaseUrl: string, token: string): Promise<Chain[]>;
300
299
  declare function fetchAccounts(apiBaseUrl: string, token: string, credentialId: string): Promise<Account[]>;
300
+ declare function fetchAccount(apiBaseUrl: string, token: string, accountId: string, credentialId: string): Promise<Account>;
301
+ interface CreateAccountParams {
302
+ /** Caller-supplied UUID v4 for idempotency. If omitted, a random UUID is generated. */
303
+ id?: string;
304
+ name: string;
305
+ credentialId: string;
306
+ providerId: string;
307
+ }
308
+ declare function createAccount(apiBaseUrl: string, token: string, params: CreateAccountParams): Promise<Account>;
301
309
  interface CreateTransferParams {
302
310
  /** Caller-supplied UUID v4 for idempotency. If omitted, a random UUID is generated. */
303
311
  id?: string;
@@ -353,8 +361,11 @@ declare function updateUserConfigBySession(apiBaseUrl: string, sessionId: string
353
361
  }): Promise<void>;
354
362
  declare function reportActionCompletion(apiBaseUrl: string, actionId: string, result: Record<string, unknown>): Promise<AuthorizationSessionDetail>;
355
363
 
364
+ type api_CreateAccountParams = CreateAccountParams;
356
365
  type api_CreateTransferParams = CreateTransferParams;
366
+ declare const api_createAccount: typeof createAccount;
357
367
  declare const api_createTransfer: typeof createTransfer;
368
+ declare const api_fetchAccount: typeof fetchAccount;
358
369
  declare const api_fetchAccounts: typeof fetchAccounts;
359
370
  declare const api_fetchAuthorizationSession: typeof fetchAuthorizationSession;
360
371
  declare const api_fetchChains: typeof fetchChains;
@@ -369,7 +380,7 @@ declare const api_signTransfer: typeof signTransfer;
369
380
  declare const api_updateUserConfig: typeof updateUserConfig;
370
381
  declare const api_updateUserConfigBySession: typeof updateUserConfigBySession;
371
382
  declare namespace api {
372
- export { type api_CreateTransferParams as CreateTransferParams, api_createTransfer as createTransfer, api_fetchAccounts as fetchAccounts, api_fetchAuthorizationSession as fetchAuthorizationSession, api_fetchChains as fetchChains, api_fetchMerchantPublicKey as fetchMerchantPublicKey, api_fetchProviders as fetchProviders, api_fetchTransfer as fetchTransfer, api_fetchUserConfig as fetchUserConfig, api_registerPasskey as registerPasskey, api_reportActionCompletion as reportActionCompletion, api_reportPasskeyActivity as reportPasskeyActivity, api_signTransfer as signTransfer, api_updateUserConfig as updateUserConfig, api_updateUserConfigBySession as updateUserConfigBySession };
383
+ export { type api_CreateAccountParams as CreateAccountParams, type api_CreateTransferParams as CreateTransferParams, api_createAccount as createAccount, api_createTransfer as createTransfer, api_fetchAccount as fetchAccount, api_fetchAccounts as fetchAccounts, api_fetchAuthorizationSession as fetchAuthorizationSession, api_fetchChains as fetchChains, api_fetchMerchantPublicKey as fetchMerchantPublicKey, api_fetchProviders as fetchProviders, api_fetchTransfer as fetchTransfer, api_fetchUserConfig as fetchUserConfig, api_registerPasskey as registerPasskey, api_reportActionCompletion as reportActionCompletion, api_reportPasskeyActivity as reportPasskeyActivity, api_signTransfer as signTransfer, api_updateUserConfig as updateUserConfig, api_updateUserConfigBySession as updateUserConfigBySession };
373
384
  }
374
385
 
375
386
  interface SwypePaymentProps {
@@ -554,7 +565,6 @@ interface UseAuthorizationExecutorResult {
554
565
  resolveSelectSource: (selection: SourceSelection) => void;
555
566
  /** Execute authorization by session id. */
556
567
  executeSessionById: (sessionId: string) => Promise<void>;
557
- executeSession: (transfer: Transfer) => Promise<void>;
558
568
  }
559
569
  interface UseAuthorizationExecutorOptions {
560
570
  /** Optional API base URL override when used outside SwypeProvider. */