@notabene/javascript-sdk 2.11.0 → 2.13.0-next.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -94,10 +94,6 @@ Configuration options for Transaction components
94
94
 
95
95
  > **destination**: `string`
96
96
 
97
- ##### microTransfer.timeout?
98
-
99
- > `optional` **timeout**: `number`
100
-
101
97
  #### reuseProof?
102
98
 
103
99
  > `optional` **reuseProof**: `boolean`
package/package.json CHANGED
@@ -10,7 +10,7 @@
10
10
  "author": "Notabene <developers@notabene.id>",
11
11
  "license": "MIT",
12
12
  "packageManager": "yarn@4.5.1",
13
- "version": "2.11.0",
13
+ "version": "2.13.0-next.1",
14
14
  "source": "src/notabene.ts",
15
15
  "main": "dist/cjs/notabene.cjs",
16
16
  "module": "dist/esm/notabene.js",
package/src/notabene.ts CHANGED
@@ -13,6 +13,7 @@ import type {
13
13
  ComponentResponse,
14
14
  ConnectionOptions,
15
15
  ConnectionRequest,
16
+ CosmosMetadata,
16
17
  Counterparty,
17
18
  CounterpartyAssistConfig,
18
19
  CryptoCredential,
@@ -65,14 +66,18 @@ import type {
65
66
  import {
66
67
  AgentType,
67
68
  CMType,
69
+ CodeVerificationStatus,
68
70
  ErrorIdentifierCode,
69
71
  HMType,
72
+ IdentityVerificationMethod,
73
+ OAuthProvider,
70
74
  PersonType,
71
75
  ProofStatus,
72
76
  ProofTypes,
73
77
  Status,
74
78
  ValidationSections,
75
79
  VASPSearchControl,
80
+ WarningIdentifierCode,
76
81
  } from './types';
77
82
  import { type MessageCallback } from './utils/MessageEventManager';
78
83
  import { decodeFragmentToObject, encodeObjectToFragment } from './utils/urls';
@@ -91,15 +96,19 @@ export {
91
96
  export {
92
97
  AgentType,
93
98
  CMType,
99
+ CodeVerificationStatus,
94
100
  decodeFragmentToObject,
95
101
  ErrorIdentifierCode,
96
102
  HMType,
103
+ IdentityVerificationMethod,
104
+ OAuthProvider,
97
105
  PersonType,
98
106
  ProofStatus,
99
107
  ProofTypes,
100
108
  Status,
101
109
  ValidationSections,
102
110
  VASPSearchControl,
111
+ WarningIdentifierCode,
103
112
  };
104
113
  export type {
105
114
  Account,
@@ -115,6 +124,7 @@ export type {
115
124
  ComponentResponse,
116
125
  ConnectionOptions,
117
126
  ConnectionRequest,
127
+ CosmosMetadata,
118
128
  Counterparty,
119
129
  CounterpartyAssistConfig,
120
130
  CryptoCredential,
package/src/types.ts CHANGED
@@ -491,7 +491,7 @@ export type LegalPersonFields = Partial<{
491
491
  * @public
492
492
  */
493
493
  type OriginatorFields = {
494
- source?: Source;
494
+ source?: Source | Source[];
495
495
  };
496
496
 
497
497
  /**
@@ -561,6 +561,7 @@ export interface ComponentRequest {
561
561
  * @public
562
562
  */
563
563
  export interface Transaction extends ComponentRequest {
564
+ transactionId?: string;
564
565
  agent: Agent;
565
566
  counterparty: Counterparty;
566
567
  asset: TransactionAsset;
@@ -582,14 +583,6 @@ export interface Refreshable {
582
583
  refreshSource?: RefreshSource;
583
584
  }
584
585
 
585
- /**
586
- * Extended transaction interface for deposits
587
- * @public
588
- */
589
- export interface DepositTransaction extends Transaction {
590
- transactionId?: string; // Optional transactionId of a Notabene transaction. Will be returned with the payload to assist updating the Transaction
591
- }
592
-
593
586
  /**
594
587
  * An object representing a withdrawal transaction
595
588
  * @public
@@ -603,10 +596,7 @@ export interface Withdrawal
603
596
  * An object representing a deposit transaction
604
597
  * @public
605
598
  */
606
- export interface Deposit
607
- extends OriginatorFields,
608
- DepositTransaction,
609
- Refreshable {}
599
+ export interface Deposit extends OriginatorFields, Transaction, Refreshable {}
610
600
 
611
601
  /**
612
602
  * An object representing a request for a deposit
@@ -793,6 +783,47 @@ export type VASPOptions = {
793
783
  searchable?: VASPSearchControl[]; // If array left empty all VASPs will be searchable
794
784
  };
795
785
 
786
+ /**
787
+ * Available methods for identity verification
788
+ * @public
789
+ */
790
+ export enum IdentityVerificationMethod {
791
+ SMS = 'sms',
792
+ EMAIL = 'email',
793
+ }
794
+
795
+ /**
796
+ * Status of a code verification
797
+ * @public
798
+ */
799
+ export enum CodeVerificationStatus {
800
+ PENDING = 'pending',
801
+ APPROVED = 'approved',
802
+ FAILED = 'failed',
803
+ EXPIRED = 'expired',
804
+ MAX_ATTEMPTS_REACHED = 'max_attempts_reached',
805
+ UNREACHABLE = 'unreachable',
806
+ }
807
+
808
+ /**
809
+ * Supported OAuth providers for authentication
810
+ * @public
811
+ */
812
+ export enum OAuthProvider {
813
+ COINBASE = 'coinbase',
814
+ }
815
+
816
+ /**
817
+ * Configuration options for identity verification
818
+ * @public
819
+ */
820
+ export type IdentityVerificationConfig = {
821
+ /** The required verification method. If not specified, none will be used */
822
+ requiredMethod?: IdentityVerificationMethod;
823
+ /** OAuth provider(s) to use for authentication. Can be a single provider or array of providers */
824
+ oAuth?: OAuthProvider[] | OAuthProvider;
825
+ };
826
+
796
827
  /**
797
828
  * Counterparty Assist Configuration options for recipient selection
798
829
  *
@@ -805,6 +836,7 @@ export type CounterpartyAssistConfig =
805
836
  | boolean
806
837
  | {
807
838
  counterpartyTypes: PersonType[];
839
+ identityVerification?: IdentityVerificationConfig;
808
840
  };
809
841
 
810
842
  /**
@@ -845,7 +877,6 @@ export interface TransactionOptions {
845
877
  microTransfer?: {
846
878
  destination: BlockchainAddress;
847
879
  amountSubunits: string;
848
- timeout?: number; // Time to verify in seconds
849
880
  };
850
881
  fallbacks?: ProofTypes[];
851
882
  deminimis?: ThresholdOptions;
@@ -923,6 +954,18 @@ export enum ErrorIdentifierCode {
923
954
  TOKEN_INVALID = 'TOKEN_INVALID',
924
955
  }
925
956
 
957
+ /**
958
+ * Identifier codes for warning messages
959
+ * @public
960
+ */
961
+ export enum WarningIdentifierCode {
962
+ WALLET_ADDRESS_NOT_CONNECTED = 'WALLET_ADDRESS_NOT_CONNECTED',
963
+ WALLET_LOCKED = 'WALLET_LOCKED',
964
+ WALLET_UNREACHABLE = 'WALLET_UNREACHABLE',
965
+ JURISDICTIONAL_REQUIREMENTS_UNAVAILABLE = 'JURISDICTIONAL_REQUIREMENTS_UNAVAILABLE',
966
+ IDV_UNAVAILABLE = 'IDV_UNAVAILABLE',
967
+ }
968
+
926
969
  /**
927
970
  * Represents an error component message
928
971
  * @param message - Error message
@@ -962,12 +1005,14 @@ export type InvalidValue<T> = {
962
1005
  * Represents a warning component message
963
1006
  * @param message - Warning message
964
1007
  * @param description - Description of the warning message
1008
+ * @param identifier - Identifier code of the warning message
965
1009
  * @public
966
1010
  */
967
1011
  export type Warning = {
968
1012
  type: CMType.WARNING;
969
1013
  message: string;
970
1014
  description?: string;
1015
+ identifier?: WarningIdentifierCode;
971
1016
  };
972
1017
 
973
1018
  /**
@@ -1145,6 +1190,7 @@ export enum ProofTypes {
1145
1190
  XRP_ED25519 = 'xrp-ed25519',
1146
1191
  XLM_ED25519 = 'xlm-ed25519',
1147
1192
  CIP8 = 'cip-8',
1193
+ COSMOS = 'cosmos-ecdsa',
1148
1194
  MicroTransfer = 'microtransfer',
1149
1195
  Screenshot = 'screenshot',
1150
1196
  Connect = 'connect',
@@ -1235,6 +1281,16 @@ export interface SolanaMetadata {
1235
1281
  message: SIWXInput;
1236
1282
  }
1237
1283
 
1284
+ /**
1285
+ * Metadata for Cosmos ownership proofs
1286
+ * @remarks
1287
+ * - Includes the public key
1288
+ * @public
1289
+ */
1290
+ export interface CosmosMetadata {
1291
+ pub_key: { type: string; value: string };
1292
+ }
1293
+
1238
1294
  /**
1239
1295
  * Interface for signature-based ownership proofs that use cryptographic message signing
1240
1296
  *
@@ -1268,7 +1324,8 @@ export interface SignatureProof extends OwnershipProof {
1268
1324
  | ProofTypes.CIP8
1269
1325
  | ProofTypes.XRP_ED25519
1270
1326
  | ProofTypes.CONCORDIUM
1271
- | ProofTypes.XLM_ED25519;
1327
+ | ProofTypes.XLM_ED25519
1328
+ | ProofTypes.COSMOS;
1272
1329
 
1273
1330
  proof: string;
1274
1331
  attestation: string;
@@ -1278,7 +1335,8 @@ export interface SignatureProof extends OwnershipProof {
1278
1335
  | {
1279
1336
  cardanoCoseKey?: string; // Cardano COSE key https://cips.cardano.org/cip/CIP-0030
1280
1337
  }
1281
- | SolanaMetadata;
1338
+ | SolanaMetadata
1339
+ | CosmosMetadata;
1282
1340
  }
1283
1341
 
1284
1342
  /**
@@ -208,7 +208,6 @@ export const arbitraryTransactionOptions =
208
208
  fc.record({
209
209
  destination: arbitraryBlockchainAddress(),
210
210
  amountSubunits: fc.string(),
211
- timeout: fc.option(fc.nat()),
212
211
  }),
213
212
  ),
214
213
  fallbacks: fc.option(
@@ -15,6 +15,8 @@ export interface ConnectionData<T extends ComponentRequest> {
15
15
  readonly authToken?: string;
16
16
  readonly txOptions?: TransactionOptions;
17
17
  readonly result?: TransactionResponse<T>;
18
+ readonly phoneNumber?: string;
19
+ readonly email?: string;
18
20
  }
19
21
 
20
22
  export interface ConnectionMetadata {