@reown/appkit-common-react-native 2.0.0-alpha.5 → 2.0.0-alpha.6

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 (106) hide show
  1. package/lib/commonjs/adapters/BitcoinBaseAdapter.js +10 -0
  2. package/lib/commonjs/adapters/BitcoinBaseAdapter.js.map +1 -0
  3. package/lib/commonjs/adapters/EvmAdapter.js +2 -2
  4. package/lib/commonjs/adapters/EvmAdapter.js.map +1 -1
  5. package/lib/commonjs/adapters/SolanaBaseAdapter.js.map +1 -1
  6. package/lib/commonjs/index.js +9 -1
  7. package/lib/commonjs/index.js.map +1 -1
  8. package/lib/commonjs/types/index.js +4 -4
  9. package/lib/commonjs/types/index.js.map +1 -1
  10. package/lib/commonjs/types/{siwe → siwx}/config.js.map +1 -1
  11. package/lib/commonjs/types/{siwe → siwx}/index.js +22 -0
  12. package/lib/commonjs/types/siwx/index.js.map +1 -0
  13. package/lib/commonjs/types/{siwe → siwx}/message.js.map +1 -1
  14. package/lib/commonjs/types/siwx/storage.js +6 -0
  15. package/lib/commonjs/types/siwx/storage.js.map +1 -0
  16. package/lib/commonjs/types/siwx/verifier.js +35 -0
  17. package/lib/commonjs/types/siwx/verifier.js.map +1 -0
  18. package/lib/commonjs/types/storage.js +22 -0
  19. package/lib/commonjs/types/storage.js.map +1 -1
  20. package/lib/commonjs/types/wallet/connector.js.map +1 -1
  21. package/lib/commonjs/utils/ConstantsUtil.js +10 -17
  22. package/lib/commonjs/utils/ConstantsUtil.js.map +1 -1
  23. package/lib/module/adapters/BitcoinBaseAdapter.js +5 -0
  24. package/lib/module/adapters/BitcoinBaseAdapter.js.map +1 -0
  25. package/lib/module/adapters/EvmAdapter.js +2 -2
  26. package/lib/module/adapters/EvmAdapter.js.map +1 -1
  27. package/lib/module/index.js +1 -0
  28. package/lib/module/index.js.map +1 -1
  29. package/lib/module/types/index.js +2 -2
  30. package/lib/module/types/{siwe → siwx}/config.js.map +1 -1
  31. package/lib/module/types/siwx/index.js +7 -0
  32. package/lib/module/types/siwx/index.js.map +1 -0
  33. package/lib/module/types/{siwe → siwx}/message.js.map +1 -1
  34. package/lib/module/types/siwx/storage.js +4 -0
  35. package/lib/module/types/siwx/storage.js.map +1 -0
  36. package/lib/module/types/siwx/verifier.js +30 -0
  37. package/lib/module/types/siwx/verifier.js.map +1 -0
  38. package/lib/module/types/storage.js +18 -0
  39. package/lib/module/types/storage.js.map +1 -1
  40. package/lib/module/types/wallet/connector.js.map +1 -1
  41. package/lib/module/utils/ConstantsUtil.js +10 -17
  42. package/lib/module/utils/ConstantsUtil.js.map +1 -1
  43. package/lib/typescript/adapters/BitcoinBaseAdapter.d.ts +5 -0
  44. package/lib/typescript/adapters/BitcoinBaseAdapter.d.ts.map +1 -0
  45. package/lib/typescript/adapters/EvmAdapter.d.ts +1 -1
  46. package/lib/typescript/adapters/EvmAdapter.d.ts.map +1 -1
  47. package/lib/typescript/adapters/SolanaBaseAdapter.d.ts +1 -0
  48. package/lib/typescript/adapters/SolanaBaseAdapter.d.ts.map +1 -1
  49. package/lib/typescript/index.d.ts +1 -0
  50. package/lib/typescript/index.d.ts.map +1 -1
  51. package/lib/typescript/types/api/events.d.ts +7 -5
  52. package/lib/typescript/types/api/events.d.ts.map +1 -1
  53. package/lib/typescript/types/blockchain/balance.d.ts +1 -1
  54. package/lib/typescript/types/blockchain/balance.d.ts.map +1 -1
  55. package/lib/typescript/types/index.d.ts +1 -1
  56. package/lib/typescript/types/siwx/config.d.ts +73 -0
  57. package/lib/typescript/types/siwx/config.d.ts.map +1 -0
  58. package/lib/typescript/types/siwx/index.d.ts +5 -0
  59. package/lib/typescript/types/siwx/index.d.ts.map +1 -0
  60. package/lib/typescript/types/siwx/message.d.ts +92 -0
  61. package/lib/typescript/types/siwx/message.d.ts.map +1 -0
  62. package/lib/typescript/types/siwx/storage.d.ts +41 -0
  63. package/lib/typescript/types/siwx/storage.d.ts.map +1 -0
  64. package/lib/typescript/types/siwx/verifier.d.ts +28 -0
  65. package/lib/typescript/types/siwx/verifier.d.ts.map +1 -0
  66. package/lib/typescript/types/storage.d.ts +32 -0
  67. package/lib/typescript/types/storage.d.ts.map +1 -1
  68. package/lib/typescript/types/wallet/connector.d.ts +0 -2
  69. package/lib/typescript/types/wallet/connector.d.ts.map +1 -1
  70. package/lib/typescript/types/wallet/wallet-info.d.ts +1 -0
  71. package/lib/typescript/types/wallet/wallet-info.d.ts.map +1 -1
  72. package/lib/typescript/utils/ConstantsUtil.d.ts +9 -14
  73. package/lib/typescript/utils/ConstantsUtil.d.ts.map +1 -1
  74. package/package.json +1 -1
  75. package/src/adapters/BitcoinBaseAdapter.ts +5 -0
  76. package/src/adapters/EvmAdapter.ts +2 -2
  77. package/src/adapters/SolanaBaseAdapter.ts +1 -0
  78. package/src/index.ts +1 -0
  79. package/src/types/api/events.ts +9 -8
  80. package/src/types/blockchain/balance.ts +1 -1
  81. package/src/types/index.ts +2 -2
  82. package/src/types/siwx/config.ts +73 -0
  83. package/src/types/siwx/index.ts +4 -0
  84. package/src/types/siwx/message.ts +92 -0
  85. package/src/types/siwx/storage.ts +44 -0
  86. package/src/types/siwx/verifier.ts +32 -0
  87. package/src/types/storage.ts +34 -0
  88. package/src/types/wallet/connector.ts +0 -2
  89. package/src/types/wallet/wallet-info.ts +1 -0
  90. package/src/utils/ConstantsUtil.ts +11 -17
  91. package/lib/commonjs/types/siwe/index.js.map +0 -1
  92. package/lib/module/types/siwe/index.js +0 -6
  93. package/lib/module/types/siwe/index.js.map +0 -1
  94. package/lib/typescript/types/siwe/config.d.ts +0 -31
  95. package/lib/typescript/types/siwe/config.d.ts.map +0 -1
  96. package/lib/typescript/types/siwe/index.d.ts +0 -3
  97. package/lib/typescript/types/siwe/index.d.ts.map +0 -1
  98. package/lib/typescript/types/siwe/message.d.ts +0 -57
  99. package/lib/typescript/types/siwe/message.d.ts.map +0 -1
  100. package/src/types/siwe/config.ts +0 -44
  101. package/src/types/siwe/index.ts +0 -3
  102. package/src/types/siwe/message.ts +0 -62
  103. /package/lib/commonjs/types/{siwe → siwx}/config.js +0 -0
  104. /package/lib/commonjs/types/{siwe → siwx}/message.js +0 -0
  105. /package/lib/module/types/{siwe → siwx}/config.js +0 -0
  106. /package/lib/module/types/{siwe → siwx}/message.js +0 -0
@@ -21,10 +21,9 @@ export type EventName =
21
21
  | 'EMAIL_EDIT'
22
22
  | 'EMAIL_EDIT_COMPLETE'
23
23
  | 'EMAIL_UPGRADE_FROM_MODAL'
24
- | 'CLICK_SIGN_SIWE_MESSAGE'
25
- | 'CLICK_CANCEL_SIWE'
26
- | 'SIWE_AUTH_SUCCESS'
27
- | 'SIWE_AUTH_ERROR'
24
+ | 'SIWX_AUTH_SUCCESS'
25
+ | 'SIWX_AUTH_ERROR'
26
+ | 'CLICK_CANCEL_SIWX'
28
27
  | 'CLICK_TRANSACTIONS'
29
28
  | 'ERROR_FETCH_TRANSACTIONS'
30
29
  | 'LOAD_MORE_TRANSACTIONS'
@@ -152,7 +151,8 @@ export type Event =
152
151
  }
153
152
  | {
154
153
  type: 'track';
155
- event: 'CLICK_SIGN_SIWE_MESSAGE';
154
+ address?: string;
155
+ event: 'CLICK_SIGN_SIWX_MESSAGE';
156
156
  properties: {
157
157
  network: string;
158
158
  isSmartAccount: boolean;
@@ -160,7 +160,7 @@ export type Event =
160
160
  }
161
161
  | {
162
162
  type: 'track';
163
- event: 'CLICK_CANCEL_SIWE';
163
+ event: 'CLICK_CANCEL_SIWX';
164
164
  properties: {
165
165
  network: string;
166
166
  isSmartAccount: boolean;
@@ -168,7 +168,7 @@ export type Event =
168
168
  }
169
169
  | {
170
170
  type: 'track';
171
- event: 'SIWE_AUTH_SUCCESS';
171
+ event: 'SIWX_AUTH_SUCCESS';
172
172
  properties: {
173
173
  network: string;
174
174
  isSmartAccount: boolean;
@@ -176,10 +176,11 @@ export type Event =
176
176
  }
177
177
  | {
178
178
  type: 'track';
179
- event: 'SIWE_AUTH_ERROR';
179
+ event: 'SIWX_AUTH_ERROR';
180
180
  properties: {
181
181
  network: string;
182
182
  isSmartAccount: boolean;
183
+ message?: string;
183
184
  };
184
185
  }
185
186
  | {
@@ -11,7 +11,7 @@ export interface Balance {
11
11
  numeric: string;
12
12
  };
13
13
  chainId?: string;
14
- address?: CaipAddress; // contract address
14
+ address?: CaipAddress | string; // contract address
15
15
  value?: number; //total value of the amount in currency
16
16
  price?: number; //price of the token in currency
17
17
  iconUrl?: string;
@@ -18,8 +18,8 @@ export * from './swap';
18
18
  // OnRamp types
19
19
  export * from './onramp';
20
20
 
21
- // SIWE types
22
- export * from './siwe';
21
+ // SIWX types
22
+ export * from './siwx';
23
23
 
24
24
  // Storage types
25
25
  export * from './storage';
@@ -0,0 +1,73 @@
1
+ import type { CaipNetworkId } from '../common';
2
+ import type { SIWXSession, SIWXMessage } from './message';
3
+
4
+ /**
5
+ * This interface represents the SIWX configuration plugin, which is used to create and manage SIWX messages and sessions.
6
+ * You may use it to create a custom implementation following your needs, but watch close for the methods requirements.
7
+ */
8
+ export interface SIWXConfig {
9
+ /**
10
+ * This method will be called to create a new message to be signed by the user.
11
+ *
12
+ * Constraints:
13
+ * - The message MUST be unique and contain all the necessary information to verify the user's identity.
14
+ * - SIWXMessage.toString() method MUST be implemented to return the message string.
15
+ *
16
+ * @param input SIWXMessage.Input
17
+ * @returns SIWXMessage
18
+ */
19
+ createMessage: (input: SIWXMessage.Input) => Promise<SIWXMessage>;
20
+ /**
21
+ * This method will be called to store a new single session.
22
+ *
23
+ * Constraints:
24
+ * - This method MUST verify if the session is valid and store it in the storage successfully.
25
+ *
26
+ * @param session SIWXSession
27
+ */
28
+ addSession: (session: SIWXSession) => Promise<void>;
29
+ /**
30
+ * This method will be called to revoke all the sessions stored for a specific chain and address.
31
+ *
32
+ * Constraints:
33
+ * - This method MUST delete all the sessions stored for the specific chain and address successfully.
34
+ *
35
+ * @param chainId CaipNetworkId
36
+ * @param address string
37
+ */
38
+ revokeSession: (chainId: CaipNetworkId, address: string) => Promise<void>;
39
+ /**
40
+ * This method will be called to replace all the sessions in the storage with the new ones.
41
+ *
42
+ * Constraints:
43
+ * - This method MUST verify all the sessions before storing them in the storage;
44
+ * - This method MUST replace all the sessions in the storage with the new ones succesfully otherwise it MUST throw an error.
45
+ *
46
+ * @param sessions SIWXSession[]
47
+ */
48
+ setSessions: (sessions: SIWXSession[]) => Promise<void>;
49
+ /**
50
+ * This method will be called to get all the sessions stored for a specific chain and address.
51
+ *
52
+ * Constraints:
53
+ * - This method MUST return only sessions that are verified and valid;
54
+ * - This method MUST NOT return expired sessions.
55
+ *
56
+ * @param chainId CaipNetworkId
57
+ * @param address string
58
+ * @returns
59
+ */
60
+ getSessions: (chainId: CaipNetworkId, address: string) => Promise<SIWXSession[]>;
61
+ /**
62
+ * This method determines whether the wallet stays connected when the user denies the signature request.
63
+ *
64
+ * @returns {boolean}
65
+ */
66
+ getRequired?: () => boolean;
67
+ /**
68
+ * This flag determines whether the session should be cleared when the user disconnects.
69
+ *
70
+ * @default true
71
+ */
72
+ signOutOnDisconnect?: boolean;
73
+ }
@@ -0,0 +1,4 @@
1
+ export * from './config';
2
+ export * from './message';
3
+ export * from './verifier';
4
+ export * from './storage';
@@ -0,0 +1,92 @@
1
+ import type { CaipNetworkId } from '../common';
2
+
3
+ /**
4
+ * This interface represents a SIWX session, which is used to store the user's identity information.
5
+ */
6
+ export interface SIWXSession {
7
+ data: SIWXMessage.Data;
8
+ message: string;
9
+ signature: string;
10
+ cacao?: Cacao;
11
+ }
12
+ /**
13
+ * This interface represents a SIWX message, which is used to create a message to be signed by the user.
14
+ * This must contain the necessary information to verify the user's identity and how to generate the string message.
15
+ */
16
+ export interface SIWXMessage extends SIWXMessage.Data, SIWXMessage.Methods {}
17
+ export declare namespace SIWXMessage {
18
+ /**
19
+ * This interface represents the SIWX message data, which is used to create a message to be signed by the user.
20
+ */
21
+ interface Data extends Input, Metadata, Identifier {}
22
+ /**
23
+ * This interface represents the SIWX message input.
24
+ * Here must contain what is different for each user of the application.
25
+ */
26
+ interface Input {
27
+ accountAddress: string;
28
+ chainId: CaipNetworkId;
29
+ notBefore?: Timestamp;
30
+ }
31
+ /**
32
+ * This interface represents the SIWX message metadata.
33
+ * Here must contain the main data related to the app.
34
+ */
35
+ interface Metadata {
36
+ domain: string;
37
+ uri: string;
38
+ version: string;
39
+ nonce: string;
40
+ statement?: string;
41
+ resources?: string[];
42
+ }
43
+ /**
44
+ * This interface represents the SIWX message identifier.
45
+ * Here must contain the request id and the timestamps.
46
+ */
47
+ interface Identifier {
48
+ requestId?: string;
49
+ issuedAt?: Timestamp;
50
+ expirationTime?: Timestamp;
51
+ }
52
+ /**
53
+ * This interface represents the SIWX message methods.
54
+ * Here must contain the method to generate the message string and any other method performed by the SIWX message.
55
+ */
56
+ interface Methods {
57
+ toString: () => string;
58
+ }
59
+ /**
60
+ * The timestamp is a UTC string representing the time in ISO 8601 format.
61
+ */
62
+ type Timestamp = string;
63
+ }
64
+
65
+ interface CacaoHeader {
66
+ t: 'caip122';
67
+ }
68
+
69
+ interface CacaoPayload {
70
+ domain: string;
71
+ aud: string;
72
+ nonce: string;
73
+ iss: string;
74
+ version?: string;
75
+ iat?: string;
76
+ nbf?: string;
77
+ exp?: string;
78
+ statement?: string;
79
+ requestId?: string;
80
+ resources?: string[];
81
+ type?: string;
82
+ }
83
+
84
+ interface Cacao {
85
+ h: CacaoHeader;
86
+ p: CacaoPayload;
87
+ s: {
88
+ t: 'eip191' | 'eip1271';
89
+ s: string;
90
+ m?: string;
91
+ };
92
+ }
@@ -0,0 +1,44 @@
1
+ import type { CaipNetworkId } from '../common';
2
+ import type { SIWXSession } from './message';
3
+
4
+ /**
5
+ * This is the interface for a SIWX storage.
6
+ */
7
+ export interface SIWXStorage {
8
+ /**
9
+ * Adds a new session for the storage.
10
+ * This method should not verify the session, only store it.
11
+ *
12
+ * @param session SIWXSession
13
+ * @returns Promise<void>
14
+ */
15
+ add(session: SIWXSession): Promise<void>;
16
+
17
+ /**
18
+ * Deletes a session from the storage.
19
+ *
20
+ * @param chainId CaipNetworkId
21
+ * @param address string
22
+ * @returns Promise<void>
23
+ */
24
+ delete(chainId: CaipNetworkId, address: string): Promise<void>;
25
+
26
+ /**
27
+ * Gets a list of sessions for a given chainId and address.
28
+ * This method should not verify sessions, only return the sessions that are stored.
29
+ *
30
+ * @param chainId CaipNetworkId
31
+ * @param address string
32
+ * @returns Promise<SIWXSession[]>
33
+ */
34
+ get(chainId: CaipNetworkId, address: string): Promise<SIWXSession[]>;
35
+
36
+ /**
37
+ * Replaces the current sessions with the new list of sessions.
38
+ * This method should not verify sessions, only store them.
39
+ *
40
+ * @param sessions SIWXSession[]
41
+ * @returns Promise<void>
42
+ */
43
+ set(sessions: SIWXSession[]): Promise<void>;
44
+ }
@@ -0,0 +1,32 @@
1
+ import type { ChainNamespace } from '../common';
2
+ import type { SIWXSession } from './message';
3
+
4
+ /**
5
+ * This is the base class for a SIWX verifier.
6
+ */
7
+ export abstract class SIWXVerifier {
8
+ /**
9
+ * The chain namespace that this verifier should verify.
10
+ */
11
+ public abstract readonly chainNamespace: ChainNamespace;
12
+
13
+ /**
14
+ * This method should return true if the verifier should verify the session.
15
+ * By default it will check by the chain namespace, but you may override it for a specific requirement.
16
+ *
17
+ * @param session SIWXSession
18
+ * @returns boolean
19
+ */
20
+ public shouldVerify(session: SIWXSession): boolean {
21
+ return session.data.chainId.startsWith(this.chainNamespace);
22
+ }
23
+
24
+ /**
25
+ * This method should verify the session.
26
+ * You must implement this method with the verification logic.
27
+ *
28
+ * @param session SIWXSession
29
+ * @returns Promise<boolean> - If `true` means the session is valid.
30
+ */
31
+ abstract verify(session: SIWXSession): Promise<boolean>;
32
+ }
@@ -28,3 +28,37 @@ export interface Storage {
28
28
  */
29
29
  removeItem(key: string): Promise<void>;
30
30
  }
31
+
32
+ export interface SafeStorageItems {
33
+ 'WALLETCONNECT_DEEPLINK_CHOICE': string; //dont change this one
34
+ '@appkit/recent_wallet': string;
35
+ '@appkit/connected_connectors': string;
36
+ '@appkit/onramp_preferred_country': string;
37
+ '@appkit/onramp_countries': string;
38
+ '@appkit/onramp_service_providers': string;
39
+ '@appkit/onramp_fiat_limits': string;
40
+ '@appkit/onramp_fiat_currencies': string;
41
+ '@appkit/onramp_preferred_fiat_currency': string;
42
+ '@appkit/onramp_countries_defaults': string;
43
+ '@appkit/active_namespace': string;
44
+ '@appkit/coinbase_connector/session': string;
45
+ '@appkit/siwx-auth-token': string;
46
+ '@appkit/siwx-nonce-token': string;
47
+ }
48
+
49
+ export const SafeStorageKeys = {
50
+ WC_DEEPLINK: 'WALLETCONNECT_DEEPLINK_CHOICE', //dont change this one
51
+ RECENT_WALLET: '@appkit/recent_wallet',
52
+ CONNECTED_CONNECTORS: '@appkit/connected_connectors',
53
+ ONRAMP_PREFERRED_COUNTRY: '@appkit/onramp_preferred_country',
54
+ ONRAMP_COUNTRIES: '@appkit/onramp_countries',
55
+ ONRAMP_SERVICE_PROVIDERS: '@appkit/onramp_service_providers',
56
+ ONRAMP_FIAT_LIMITS: '@appkit/onramp_fiat_limits',
57
+ ONRAMP_FIAT_CURRENCIES: '@appkit/onramp_fiat_currencies',
58
+ ONRAMP_PREFERRED_FIAT_CURRENCY: '@appkit/onramp_preferred_fiat_currency',
59
+ ONRAMP_COUNTRIES_DEFAULTS: '@appkit/onramp_countries_defaults',
60
+ ACTIVE_NAMESPACE: '@appkit/active_namespace',
61
+ COINBASE_CONNECTOR_SESSION: '@appkit/coinbase_connector/session',
62
+ SIWX_AUTH_TOKEN: '@appkit/siwx-auth-token',
63
+ SIWX_NONCE_TOKEN: '@appkit/siwx-nonce-token'
64
+ } as const;
@@ -4,7 +4,6 @@ import type { AppKitNetwork } from '../blockchain/network';
4
4
  import type { Provider } from '../blockchain/adapter';
5
5
  import type { WalletInfo, Metadata } from './wallet-info';
6
6
  import type { ConnectionProperties } from './connection';
7
- import type { AppKitSIWEClient } from '../siwe';
8
7
  import type { Storage } from '../storage';
9
8
  import type { WcWallet } from '../api/wallet-api';
10
9
 
@@ -31,7 +30,6 @@ export type ConnectOptions = {
31
30
  namespaces?: ProposalNamespaces;
32
31
  defaultNetwork?: AppKitNetwork;
33
32
  universalLink?: string;
34
- siweConfig?: AppKitSIWEClient;
35
33
  };
36
34
 
37
35
  export type ConnectorInitOptions = {
@@ -11,6 +11,7 @@ export interface WalletInfo {
11
11
  universal?: string;
12
12
  linkMode?: boolean;
13
13
  };
14
+ type?: 'walletconnect' | 'external' | 'unknown';
14
15
  [key: string]: unknown;
15
16
  }
16
17
 
@@ -1,5 +1,5 @@
1
1
  export const ConstantsUtil = {
2
- VERSION: '2.0.0-alpha.5',
2
+ VERSION: '2.0.0-alpha.6',
3
3
 
4
4
  EIP155: 'eip155',
5
5
  ADD_CHAIN_METHOD: 'wallet_addEthereumChain',
@@ -16,6 +16,16 @@ export const ConstantsUtil = {
16
16
  SECURE_SITE_ICON: `https://secure.reown.com/images/favicon.png`,
17
17
  REOWN_URL: `https://reown.com`,
18
18
 
19
+ CHAIN_NAME_MAP: {
20
+ eip155: 'EVM Networks',
21
+ solana: 'Solana',
22
+ polkadot: 'Polkadot',
23
+ bip122: 'Bitcoin',
24
+ cosmos: 'Cosmos',
25
+ sui: 'Sui',
26
+ stacks: 'Stacks'
27
+ },
28
+
19
29
  USDT_CONTRACT_ADDRESSES: [
20
30
  // Mainnet
21
31
  '0xdac17f958d2ee523a2206206994597c13d831ec7',
@@ -64,21 +74,5 @@ export const ConstantsUtil = {
64
74
  app_store: 'https://apps.apple.com/app/id1580902717',
65
75
  android_app_id: 'com.solflare.mobile',
66
76
  ios_schema: 'solflare://'
67
- },
68
-
69
- // Storage Keys
70
- STORAGE_KEYS: {
71
- WC_DEEPLINK: 'WALLETCONNECT_DEEPLINK_CHOICE', //dont change this one
72
- RECENT_WALLET: '@appkit/recent_wallet',
73
- CONNECTED_CONNECTORS: '@appkit/connected_connectors',
74
- ONRAMP_PREFERRED_COUNTRY: '@appkit/onramp_preferred_country',
75
- ONRAMP_COUNTRIES: '@appkit/onramp_countries',
76
- ONRAMP_SERVICE_PROVIDERS: '@appkit/onramp_service_providers',
77
- ONRAMP_FIAT_LIMITS: '@appkit/onramp_fiat_limits',
78
- ONRAMP_FIAT_CURRENCIES: '@appkit/onramp_fiat_currencies',
79
- ONRAMP_PREFERRED_FIAT_CURRENCY: '@appkit/onramp_preferred_fiat_currency',
80
- ONRAMP_COUNTRIES_DEFAULTS: '@appkit/onramp_countries_defaults',
81
- ACTIVE_NAMESPACE: '@appkit/active_namespace',
82
- COINBASE_CONNECTOR_SESSION: '@appkit/coinbase_connector/session'
83
77
  }
84
78
  };
@@ -1 +0,0 @@
1
- {"version":3,"names":["_config","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_message"],"sourceRoot":"../../../../src","sources":["types/siwe/index.ts"],"mappings":";;;;;AACA,IAAAA,OAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,OAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,OAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,OAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,QAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,QAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,QAAA,CAAAL,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAC,QAAA,CAAAL,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
@@ -1,6 +0,0 @@
1
- "use strict";
2
-
3
- // SIWE types barrel export
4
- export * from './config';
5
- export * from './message';
6
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sourceRoot":"../../../../src","sources":["types/siwe/index.ts"],"mappings":";;AAAA;AACA,cAAc,UAAU;AACxB,cAAc,WAAW","ignoreList":[]}
@@ -1,31 +0,0 @@
1
- import type { SIWESession, SIWECreateMessageArgs, SIWEMessageArgs, SIWEVerifyMessageArgs } from './message';
2
- export interface SIWEClientMethods {
3
- getNonce: (address?: string) => Promise<string>;
4
- createMessage: (args: SIWECreateMessageArgs) => string;
5
- verifyMessage: (args: SIWEVerifyMessageArgs) => Promise<boolean>;
6
- getSession: () => Promise<SIWESession | null>;
7
- signOut: () => Promise<boolean>;
8
- getMessageParams?: () => Promise<SIWEMessageArgs>;
9
- onSignIn?: (session?: SIWESession) => void;
10
- onSignOut?: () => void;
11
- }
12
- export interface SIWEConfig extends SIWEClientMethods {
13
- enabled?: boolean;
14
- nonceRefetchIntervalMs?: number;
15
- sessionRefetchIntervalMs?: number;
16
- signOutOnDisconnect?: boolean;
17
- signOutOnAccountChange?: boolean;
18
- signOutOnNetworkChange?: boolean;
19
- }
20
- export interface AppKitSIWEClient extends SIWEClientMethods {
21
- signIn: () => Promise<SIWESession | undefined>;
22
- options: {
23
- enabled: boolean;
24
- nonceRefetchIntervalMs: number;
25
- sessionRefetchIntervalMs: number;
26
- signOutOnDisconnect: boolean;
27
- signOutOnAccountChange: boolean;
28
- signOutOnNetworkChange: boolean;
29
- };
30
- }
31
- //# sourceMappingURL=config.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../src/types/siwe/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,WAAW,EACX,qBAAqB,EACrB,eAAe,EACf,qBAAqB,EACtB,MAAM,WAAW,CAAC;AAEnB,MAAM,WAAW,iBAA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1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/types/siwe/index.ts"],"names":[],"mappings":"AACA,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC"}
@@ -1,57 +0,0 @@
1
- import type { CaipAddress, CaipNetworkId } from '../common';
2
- export interface SIWESession {
3
- address: string;
4
- chainId: number;
5
- }
6
- interface CacaoHeader {
7
- t: 'caip122';
8
- }
9
- export interface SIWECreateMessageArgs {
10
- domain: string;
11
- nonce: string;
12
- uri: string;
13
- address: CaipAddress;
14
- version: '1';
15
- type?: CacaoHeader['t'];
16
- nbf?: string;
17
- exp?: string;
18
- statement?: string;
19
- requestId?: string;
20
- resources?: string[];
21
- expiry?: number;
22
- iat?: string;
23
- }
24
- export type SIWEMessageArgs = {
25
- chains: CaipNetworkId[];
26
- methods?: string[];
27
- } & Omit<SIWECreateMessageArgs, 'address' | 'nonce' | 'version'>;
28
- interface CacaoPayload {
29
- domain: string;
30
- aud: string;
31
- nonce: string;
32
- iss: string;
33
- version?: string;
34
- iat?: string;
35
- nbf?: string;
36
- exp?: string;
37
- statement?: string;
38
- requestId?: string;
39
- resources?: string[];
40
- type?: string;
41
- }
42
- interface Cacao {
43
- h: CacaoHeader;
44
- p: CacaoPayload;
45
- s: {
46
- t: 'eip191' | 'eip1271';
47
- s: string;
48
- m?: string;
49
- };
50
- }
51
- export interface SIWEVerifyMessageArgs {
52
- message: string;
53
- signature: string;
54
- cacao?: Cacao;
55
- }
56
- export {};
57
- //# sourceMappingURL=message.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../../../src/types/siwe/message.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE5D,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,UAAU,WAAW;IACnB,C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D,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;QACxB,CAAC,EAAE,MAAM,CAAC;QACV,CAAC,CAAC,EAAE,MAAM,CAAC;KACZ,CAAC;CACH;AAED,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,KAAK,CAAC;CACf"}
@@ -1,44 +0,0 @@
1
- import type {
2
- SIWESession,
3
- SIWECreateMessageArgs,
4
- SIWEMessageArgs,
5
- SIWEVerifyMessageArgs
6
- } from './message';
7
-
8
- export interface SIWEClientMethods {
9
- getNonce: (address?: string) => Promise<string>;
10
- createMessage: (args: SIWECreateMessageArgs) => string;
11
- verifyMessage: (args: SIWEVerifyMessageArgs) => Promise<boolean>;
12
- getSession: () => Promise<SIWESession | null>;
13
- signOut: () => Promise<boolean>;
14
- getMessageParams?: () => Promise<SIWEMessageArgs>;
15
- onSignIn?: (session?: SIWESession) => void;
16
- onSignOut?: () => void;
17
- }
18
-
19
- export interface SIWEConfig extends SIWEClientMethods {
20
- // Defaults to true
21
- enabled?: boolean;
22
- // In milliseconds, defaults to 5 minutes
23
- nonceRefetchIntervalMs?: number;
24
- // In milliseconds, defaults to 5 minutes
25
- sessionRefetchIntervalMs?: number;
26
- // Defaults to true
27
- signOutOnDisconnect?: boolean;
28
- // Defaults to true
29
- signOutOnAccountChange?: boolean;
30
- // Defaults to true
31
- signOutOnNetworkChange?: boolean;
32
- }
33
-
34
- export interface AppKitSIWEClient extends SIWEClientMethods {
35
- signIn: () => Promise<SIWESession | undefined>;
36
- options: {
37
- enabled: boolean;
38
- nonceRefetchIntervalMs: number;
39
- sessionRefetchIntervalMs: number;
40
- signOutOnDisconnect: boolean;
41
- signOutOnAccountChange: boolean;
42
- signOutOnNetworkChange: boolean;
43
- };
44
- }
@@ -1,3 +0,0 @@
1
- // SIWE types barrel export
2
- export * from './config';
3
- export * from './message';
@@ -1,62 +0,0 @@
1
- import type { CaipAddress, CaipNetworkId } from '../common';
2
-
3
- export interface SIWESession {
4
- address: string;
5
- chainId: number;
6
- }
7
-
8
- interface CacaoHeader {
9
- t: 'caip122';
10
- }
11
-
12
- export interface SIWECreateMessageArgs {
13
- domain: string;
14
- nonce: string;
15
- uri: string;
16
- address: CaipAddress;
17
- version: '1';
18
- type?: CacaoHeader['t'];
19
- nbf?: string;
20
- exp?: string;
21
- statement?: string;
22
- requestId?: string;
23
- resources?: string[];
24
- expiry?: number;
25
- iat?: string;
26
- }
27
-
28
- export type SIWEMessageArgs = {
29
- chains: CaipNetworkId[];
30
- methods?: string[];
31
- } & Omit<SIWECreateMessageArgs, 'address' | 'nonce' | 'version'>;
32
-
33
- interface CacaoPayload {
34
- domain: string;
35
- aud: string;
36
- nonce: string;
37
- iss: string;
38
- version?: string;
39
- iat?: string;
40
- nbf?: string;
41
- exp?: string;
42
- statement?: string;
43
- requestId?: string;
44
- resources?: string[];
45
- type?: string;
46
- }
47
-
48
- interface Cacao {
49
- h: CacaoHeader;
50
- p: CacaoPayload;
51
- s: {
52
- t: 'eip191' | 'eip1271';
53
- s: string;
54
- m?: string;
55
- };
56
- }
57
-
58
- export interface SIWEVerifyMessageArgs {
59
- message: string;
60
- signature: string;
61
- cacao?: Cacao;
62
- }
File without changes
File without changes