@circle-fin/w3s-pw-react-native-sdk 1.0.6 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/README.md +3 -3
  2. package/android/build.gradle +1 -1
  3. package/android/src/main/java/com/circlefin/programmablewalletrnsdk/BridgeHelper.kt +8 -1
  4. package/android/src/main/java/com/circlefin/programmablewalletrnsdk/ProgrammablewalletRnSdkModule.kt +53 -21
  5. package/android/src/main/java/com/circlefin/programmablewalletrnsdk/PromiseCallback.kt +6 -7
  6. package/android/src/main/java/com/circlefin/programmablewalletrnsdk/PromiseCallback2.kt +65 -0
  7. package/android/src/main/java/com/circlefin/programmablewalletrnsdk/PromiseLogoutCallback.kt +47 -0
  8. package/android/src/main/java/com/circlefin/programmablewalletrnsdk/PromiseSocialCallback.kt +53 -0
  9. package/android/src/main/java/com/circlefin/programmablewalletrnsdk/annotation/ExcludeFromGeneratedCCReport.kt +33 -0
  10. package/android/src/main/java/com/circlefin/programmablewalletrnsdk/pwcustom/RnLayoutProvider.kt +3 -0
  11. package/android/src/oldarch/ProgrammablewalletRnSdkSpec.kt +16 -7
  12. package/circlefin-w3s-pw-react-native-sdk.podspec +1 -1
  13. package/ios/BridgeHelper.swift +1 -6
  14. package/ios/ProgrammablewalletRnSdk.mm +22 -7
  15. package/ios/RnWalletSdk+CustomizeAdapter.swift +176 -5
  16. package/ios/RnWalletSdk.swift +146 -81
  17. package/ios/TextKey.swift +137 -74
  18. package/lib/commonjs/NativeProgrammablewalletRnSdk.js.map +1 -1
  19. package/lib/commonjs/ProgrammablewalletRnSdkModule.js.map +1 -1
  20. package/lib/commonjs/WalletSdk.js +20 -8
  21. package/lib/commonjs/WalletSdk.js.map +1 -1
  22. package/lib/commonjs/types.js +60 -4
  23. package/lib/commonjs/types.js.map +1 -1
  24. package/lib/module/NativeProgrammablewalletRnSdk.js.map +1 -1
  25. package/lib/module/ProgrammablewalletRnSdkModule.js.map +1 -1
  26. package/lib/module/WalletSdk.js +19 -7
  27. package/lib/module/WalletSdk.js.map +1 -1
  28. package/lib/module/types.js +59 -3
  29. package/lib/module/types.js.map +1 -1
  30. package/lib/typescript/src/NativeProgrammablewalletRnSdk.d.ts +3 -1
  31. package/lib/typescript/src/NativeProgrammablewalletRnSdk.d.ts.map +1 -1
  32. package/lib/typescript/src/WalletSdk.d.ts.map +1 -1
  33. package/lib/typescript/src/types.d.ts +83 -8
  34. package/lib/typescript/src/types.d.ts.map +1 -1
  35. package/package.json +1 -1
  36. package/src/NativeProgrammablewalletRnSdk.ts +16 -7
  37. package/src/WalletSdk.ts +36 -14
  38. package/src/types.ts +101 -13
package/src/types.ts CHANGED
@@ -30,18 +30,29 @@ export interface IWalletSdk {
30
30
  successCallback: SuccessCallback,
31
31
  errorCallback: ErrorCallback,
32
32
  ) => void;
33
- executeWithUserSecret: (
33
+ setBiometricsPin: (
34
34
  userToken: string,
35
35
  encryptionKey: string,
36
- userSecret: string,
37
- challengeIds: string[],
38
36
  successCallback: SuccessCallback,
39
37
  errorCallback: ErrorCallback,
40
38
  ) => void;
41
- setBiometricsPin: (
42
- userToken: string,
43
- encryptionKey: string,
44
- successCallback: SuccessCallback,
39
+ performLogin: (
40
+ provider: SocialProvider,
41
+ deviceToken: string,
42
+ deviceEncryptionKey: string,
43
+ successCallback: LoginSuccessCallback,
44
+ errorCallback: ErrorCallback,
45
+ ) => void;
46
+ verifyOTP: (
47
+ otpToken: string,
48
+ deviceToken: string,
49
+ deviceEncryptionKey: string,
50
+ successCallback: LoginSuccessCallback,
51
+ errorCallback: ErrorCallback,
52
+ ) => void;
53
+ performLogout: (
54
+ provider: SocialProvider,
55
+ completeCallback: CompleteCallback,
45
56
  errorCallback: ErrorCallback,
46
57
  ) => void;
47
58
  setDismissOnCallbackMap: (map: Map<ErrorCode, boolean>) => void;
@@ -151,6 +162,49 @@ export enum TextKey {
151
162
  circlepw_swipe_bt_confirming = 'circlepw_swipe_bt_confirming',
152
163
  circlepw_swipe_bt_confirmed = 'circlepw_swipe_bt_confirmed',
153
164
  circlepw_swipe_bt_try_again = 'circlepw_swipe_bt_try_again',
165
+ circlepw_transaction_request_title = 'circlepw_transaction_request_title',
166
+ circlepw_transaction_request_subtitle = 'circlepw_transaction_request_subtitle',
167
+ circlepw_transaction_request_main_currency = 'circlepw_transaction_request_main_currency',
168
+ circlepw_transaction_request_exchange_value = 'circlepw_transaction_request_exchange_value',
169
+ circlepw_transaction_request_from_label = 'circlepw_transaction_request_from_label',
170
+ circlepw_transaction_request_from = 'circlepw_transaction_request_from',
171
+ circlepw_transaction_request_to_label = 'circlepw_transaction_request_to_label',
172
+ circlepw_transaction_request_to_config = 'circlepw_transaction_request_to_config',
173
+ circlepw_transaction_request_to_contract_name = 'circlepw_transaction_request_to_contract_name',
174
+ circlepw_transaction_request_to_contract_url = 'circlepw_transaction_request_to_contract_url',
175
+ circlepw_transaction_request_network_fee_label = 'circlepw_transaction_request_network_fee_label',
176
+ circlepw_transaction_request_network_fee = 'circlepw_transaction_request_network_fee',
177
+ circlepw_transaction_request_exchange_network_fee = 'circlepw_transaction_request_exchange_network_fee',
178
+ circlepw_transaction_request_total_label = 'circlepw_transaction_request_total_label',
179
+ circlepw_transaction_request_total_config = 'circlepw_transaction_request_total_config',
180
+ circlepw_transaction_request_exchange_total_value = 'circlepw_transaction_request_exchange_total_value',
181
+ circlepw_transaction_request_error_config = 'circlepw_transaction_request_error_config',
182
+ circlepw_transaction_request_fee_tip = 'circlepw_transaction_request_fee_tip',
183
+ circlepw_contract_interaction_contract_address_label = 'circlepw_contract_interaction_contract_address_label',
184
+ circlepw_contract_interaction_contract_address_config = 'circlepw_contract_interaction_contract_address_config',
185
+ circlepw_contract_interaction_data_details = 'circlepw_contract_interaction_data_details',
186
+ circlepw_contract_interaction_abi_function_label = 'circlepw_contract_interaction_abi_function_label',
187
+ circlepw_contract_interaction_abi_function_config = 'circlepw_contract_interaction_abi_function_config',
188
+ circlepw_contract_interaction_abi_parameter_label = 'circlepw_contract_interaction_abi_parameter_label',
189
+ circlepw_contract_interaction_call_data_label = 'circlepw_contract_interaction_call_data_label',
190
+ circlepw_contract_interaction_call_data_config = 'circlepw_contract_interaction_call_data_config',
191
+ circlepw_transaction_request_raw_tx_description = 'circlepw_transaction_request_raw_tx_description',
192
+ circlepw_transaction_request_raw_tx_config = 'circlepw_transaction_request_raw_tx_config',
193
+ circlepw_signature_request_title = 'circlepw_signature_request_title',
194
+ circlepw_signature_request_contract_name = 'circlepw_signature_request_contract_name',
195
+ circlepw_signature_request_contract_url = 'circlepw_signature_request_contract_url',
196
+ circlepw_signature_request_subtitle = 'circlepw_signature_request_subtitle',
197
+ circlepw_signature_request_description = 'circlepw_signature_request_description',
198
+ circlepw_signature_request_msg_config = 'circlepw_signature_request_msg_config',
199
+ circlepw_sign = 'circlepw_sign',
200
+ circlepw_try_again = 'circlepw_try_again',
201
+ circlepw_email_otp_title = 'circlepw_email_otp_title',
202
+ circlepw_email_otp_description = 'circlepw_email_otp_description',
203
+ circlepw_email_otp_email = 'circlepw_email_otp_email',
204
+ circlepw_email_otp_head_config = 'circlepw_email_otp_head_config',
205
+ circlepw_email_otp_dash = 'circlepw_email_otp_dash',
206
+ circlepw_email_otp_send_again_hint = 'circlepw_email_otp_send_again_hint',
207
+ circlepw_email_otp_send_again = 'circlepw_email_otp_send_again',
154
208
  }
155
209
 
156
210
  export enum ImageKey {
@@ -165,8 +219,11 @@ export enum ImageKey {
165
219
  showPin = 'showPin',
166
220
  hidePin = 'hidePin',
167
221
  alertWindowIcon = 'alertWindowIcon',
168
- swipeItemIcon = 'swipeItemIcon',
169
- swipeBtConfirmed = 'swipeBtConfirmed',
222
+ transactionTokenIcon = 'transactionTokenIcon',
223
+ networkFeeTipIcon = 'networkFeeTipIcon',
224
+ showLessDetailArrow = 'showLessDetailArrow',
225
+ showMoreDetailArrow = 'showMoreDetailArrow',
226
+ requestIcon = 'requestIcon',
170
227
  }
171
228
 
172
229
  export enum DateFormat {
@@ -259,7 +316,10 @@ export enum ErrorCode {
259
316
  biometricsUserNotAllowPermission = '155715',
260
317
  biometricsInternalError = '155716',
261
318
  userSecretMissing = '155717',
262
- invalidUserSecret = '155718',
319
+ invalidUserTokenFormat = '155718',
320
+ userTokenMismatch = '155719',
321
+ socialLoginFailed = '155720',
322
+ loginInfoMissing = '155721',
263
323
  }
264
324
 
265
325
  export class SecurityQuestion {
@@ -280,6 +340,8 @@ export interface Configuration {
280
340
 
281
341
  export type EventListener = (event: ExecuteEvent) => void
282
342
  export type SuccessCallback = (result: SuccessResult) => void
343
+ export type LoginSuccessCallback = (result: LoginResult) => void
344
+ export type CompleteCallback = () => void
283
345
  export type ErrorCallback = (error: Error) => void
284
346
  export interface SdkVersion {
285
347
  native: string;
@@ -296,6 +358,26 @@ export interface Error {
296
358
  message: string;
297
359
  }
298
360
 
361
+ export interface LoginResult {
362
+ userToken?: string;
363
+ encryptionKey?: string;
364
+ refreshToken?: string;
365
+ oauthInfo?: OauthInfo;
366
+ }
367
+
368
+ export interface OauthInfo {
369
+ provider?: string;
370
+ scope?: string[];
371
+ socialUserUUID?: string;
372
+ socialUserInfo?: SocialUserInfo;
373
+ }
374
+
375
+ export interface SocialUserInfo {
376
+ name?: string;
377
+ email?: string;
378
+ phone?: string;
379
+ }
380
+
299
381
  export interface ExecuteResult {
300
382
  resultType: ExecuteResultType;
301
383
  status: ExecuteResultStatus;
@@ -315,7 +397,6 @@ export interface ExecuteResultData {
315
397
 
316
398
  export interface SettingsManagement {
317
399
  enableBiometricsPin: boolean;
318
- disableConfirmationUI: boolean;
319
400
  }
320
401
 
321
402
  export class IconTextConfig {
@@ -334,8 +415,8 @@ export class TextConfig {
334
415
  textColor?: string
335
416
  font?: string
336
417
  constructor(
337
- text: string,
338
- gradientColorsOrTextColor: string[] | string,
418
+ text?: string,
419
+ gradientColorsOrTextColor?: string[] | string,
339
420
  font?: string,
340
421
  ) {
341
422
  this.text = text
@@ -359,6 +440,7 @@ export enum ExecuteResultStatus {
359
440
 
360
441
  export enum ExecuteEvent {
361
442
  forgotPin = 'forgotPin',
443
+ resendOtp = 'resendOtp',
362
444
  }
363
445
 
364
446
  export enum ExecuteResultType {
@@ -380,3 +462,9 @@ export enum InputType {
380
462
  text = 'text',
381
463
  datePicker = 'datePicker',
382
464
  }
465
+
466
+ export enum SocialProvider {
467
+ Google = 'Google',
468
+ Facebook = 'Facebook',
469
+ Apple = 'Apple',
470
+ }