@settlemint/sdk-viem 2.5.5 → 2.5.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.
- package/README.md +86 -86
- package/dist/browser/viem.js.map +1 -1
- package/dist/viem.cjs.map +1 -1
- package/dist/viem.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -79,7 +79,7 @@ The SettleMint Viem SDK provides a lightweight wrapper that automatically config
|
|
|
79
79
|
|
|
80
80
|
> **getChainId**(`options`): `Promise`\<`number`\>
|
|
81
81
|
|
|
82
|
-
Defined in: [sdk/viem/src/viem.ts:217](https://github.com/settlemint/sdk/blob/v2.5.
|
|
82
|
+
Defined in: [sdk/viem/src/viem.ts:217](https://github.com/settlemint/sdk/blob/v2.5.6/sdk/viem/src/viem.ts#L217)
|
|
83
83
|
|
|
84
84
|
Get the chain id of a blockchain network.
|
|
85
85
|
|
|
@@ -113,7 +113,7 @@ console.log(chainId);
|
|
|
113
113
|
|
|
114
114
|
> **getPublicClient**(`options`): `object`
|
|
115
115
|
|
|
116
|
-
Defined in: [sdk/viem/src/viem.ts:75](https://github.com/settlemint/sdk/blob/v2.5.
|
|
116
|
+
Defined in: [sdk/viem/src/viem.ts:75](https://github.com/settlemint/sdk/blob/v2.5.6/sdk/viem/src/viem.ts#L75)
|
|
117
117
|
|
|
118
118
|
Get a public client. Use this if you need to read from the blockchain.
|
|
119
119
|
|
|
@@ -152,7 +152,7 @@ console.log(block);
|
|
|
152
152
|
|
|
153
153
|
> **getWalletClient**(`options`): (`verificationOptions?`) => `Client`\<`HttpTransport`\<`undefined` \| `RpcSchema`, `boolean`\>, `Chain`, `undefined`, `WalletRpcSchema`, `object` & `object` & `object` & `object` & `object` & `object` & `object` & `WalletActions`\<`Chain`, `undefined`\>\>
|
|
154
154
|
|
|
155
|
-
Defined in: [sdk/viem/src/viem.ts:143](https://github.com/settlemint/sdk/blob/v2.5.
|
|
155
|
+
Defined in: [sdk/viem/src/viem.ts:143](https://github.com/settlemint/sdk/blob/v2.5.6/sdk/viem/src/viem.ts#L143)
|
|
156
156
|
|
|
157
157
|
Get a wallet client. Use this if you need to write to the blockchain.
|
|
158
158
|
|
|
@@ -210,7 +210,7 @@ console.log(transactionHash);
|
|
|
210
210
|
|
|
211
211
|
#### OTPAlgorithm
|
|
212
212
|
|
|
213
|
-
Defined in: [sdk/viem/src/custom-actions/types/wallet-verification.enum.ts:18](https://github.com/settlemint/sdk/blob/v2.5.
|
|
213
|
+
Defined in: [sdk/viem/src/custom-actions/types/wallet-verification.enum.ts:18](https://github.com/settlemint/sdk/blob/v2.5.6/sdk/viem/src/custom-actions/types/wallet-verification.enum.ts#L18)
|
|
214
214
|
|
|
215
215
|
Supported hash algorithms for One-Time Password (OTP) verification.
|
|
216
216
|
These algorithms determine the cryptographic function used to generate OTP codes.
|
|
@@ -219,21 +219,21 @@ These algorithms determine the cryptographic function used to generate OTP codes
|
|
|
219
219
|
|
|
220
220
|
| Enumeration Member | Value | Description | Defined in |
|
|
221
221
|
| ------ | ------ | ------ | ------ |
|
|
222
|
-
| <a id="sha1"></a> `SHA1` | `"SHA1"` | SHA-1 hash algorithm | [sdk/viem/src/custom-actions/types/wallet-verification.enum.ts:20](https://github.com/settlemint/sdk/blob/v2.5.
|
|
223
|
-
| <a id="sha224"></a> `SHA224` | `"SHA224"` | SHA-224 hash algorithm | [sdk/viem/src/custom-actions/types/wallet-verification.enum.ts:22](https://github.com/settlemint/sdk/blob/v2.5.
|
|
224
|
-
| <a id="sha256"></a> `SHA256` | `"SHA256"` | SHA-256 hash algorithm | [sdk/viem/src/custom-actions/types/wallet-verification.enum.ts:24](https://github.com/settlemint/sdk/blob/v2.5.
|
|
225
|
-
| <a id="sha3_224"></a> `SHA3_224` | `"SHA3-224"` | SHA3-224 hash algorithm | [sdk/viem/src/custom-actions/types/wallet-verification.enum.ts:30](https://github.com/settlemint/sdk/blob/v2.5.
|
|
226
|
-
| <a id="sha3_256"></a> `SHA3_256` | `"SHA3-256"` | SHA3-256 hash algorithm | [sdk/viem/src/custom-actions/types/wallet-verification.enum.ts:32](https://github.com/settlemint/sdk/blob/v2.5.
|
|
227
|
-
| <a id="sha3_384"></a> `SHA3_384` | `"SHA3-384"` | SHA3-384 hash algorithm | [sdk/viem/src/custom-actions/types/wallet-verification.enum.ts:34](https://github.com/settlemint/sdk/blob/v2.5.
|
|
228
|
-
| <a id="sha3_512"></a> `SHA3_512` | `"SHA3-512"` | SHA3-512 hash algorithm | [sdk/viem/src/custom-actions/types/wallet-verification.enum.ts:36](https://github.com/settlemint/sdk/blob/v2.5.
|
|
229
|
-
| <a id="sha384"></a> `SHA384` | `"SHA384"` | SHA-384 hash algorithm | [sdk/viem/src/custom-actions/types/wallet-verification.enum.ts:26](https://github.com/settlemint/sdk/blob/v2.5.
|
|
230
|
-
| <a id="sha512"></a> `SHA512` | `"SHA512"` | SHA-512 hash algorithm | [sdk/viem/src/custom-actions/types/wallet-verification.enum.ts:28](https://github.com/settlemint/sdk/blob/v2.5.
|
|
222
|
+
| <a id="sha1"></a> `SHA1` | `"SHA1"` | SHA-1 hash algorithm | [sdk/viem/src/custom-actions/types/wallet-verification.enum.ts:20](https://github.com/settlemint/sdk/blob/v2.5.6/sdk/viem/src/custom-actions/types/wallet-verification.enum.ts#L20) |
|
|
223
|
+
| <a id="sha224"></a> `SHA224` | `"SHA224"` | SHA-224 hash algorithm | [sdk/viem/src/custom-actions/types/wallet-verification.enum.ts:22](https://github.com/settlemint/sdk/blob/v2.5.6/sdk/viem/src/custom-actions/types/wallet-verification.enum.ts#L22) |
|
|
224
|
+
| <a id="sha256"></a> `SHA256` | `"SHA256"` | SHA-256 hash algorithm | [sdk/viem/src/custom-actions/types/wallet-verification.enum.ts:24](https://github.com/settlemint/sdk/blob/v2.5.6/sdk/viem/src/custom-actions/types/wallet-verification.enum.ts#L24) |
|
|
225
|
+
| <a id="sha3_224"></a> `SHA3_224` | `"SHA3-224"` | SHA3-224 hash algorithm | [sdk/viem/src/custom-actions/types/wallet-verification.enum.ts:30](https://github.com/settlemint/sdk/blob/v2.5.6/sdk/viem/src/custom-actions/types/wallet-verification.enum.ts#L30) |
|
|
226
|
+
| <a id="sha3_256"></a> `SHA3_256` | `"SHA3-256"` | SHA3-256 hash algorithm | [sdk/viem/src/custom-actions/types/wallet-verification.enum.ts:32](https://github.com/settlemint/sdk/blob/v2.5.6/sdk/viem/src/custom-actions/types/wallet-verification.enum.ts#L32) |
|
|
227
|
+
| <a id="sha3_384"></a> `SHA3_384` | `"SHA3-384"` | SHA3-384 hash algorithm | [sdk/viem/src/custom-actions/types/wallet-verification.enum.ts:34](https://github.com/settlemint/sdk/blob/v2.5.6/sdk/viem/src/custom-actions/types/wallet-verification.enum.ts#L34) |
|
|
228
|
+
| <a id="sha3_512"></a> `SHA3_512` | `"SHA3-512"` | SHA3-512 hash algorithm | [sdk/viem/src/custom-actions/types/wallet-verification.enum.ts:36](https://github.com/settlemint/sdk/blob/v2.5.6/sdk/viem/src/custom-actions/types/wallet-verification.enum.ts#L36) |
|
|
229
|
+
| <a id="sha384"></a> `SHA384` | `"SHA384"` | SHA-384 hash algorithm | [sdk/viem/src/custom-actions/types/wallet-verification.enum.ts:26](https://github.com/settlemint/sdk/blob/v2.5.6/sdk/viem/src/custom-actions/types/wallet-verification.enum.ts#L26) |
|
|
230
|
+
| <a id="sha512"></a> `SHA512` | `"SHA512"` | SHA-512 hash algorithm | [sdk/viem/src/custom-actions/types/wallet-verification.enum.ts:28](https://github.com/settlemint/sdk/blob/v2.5.6/sdk/viem/src/custom-actions/types/wallet-verification.enum.ts#L28) |
|
|
231
231
|
|
|
232
232
|
***
|
|
233
233
|
|
|
234
234
|
#### WalletVerificationType
|
|
235
235
|
|
|
236
|
-
Defined in: [sdk/viem/src/custom-actions/types/wallet-verification.enum.ts:5](https://github.com/settlemint/sdk/blob/v2.5.
|
|
236
|
+
Defined in: [sdk/viem/src/custom-actions/types/wallet-verification.enum.ts:5](https://github.com/settlemint/sdk/blob/v2.5.6/sdk/viem/src/custom-actions/types/wallet-verification.enum.ts#L5)
|
|
237
237
|
|
|
238
238
|
Types of wallet verification methods supported by the system.
|
|
239
239
|
Used to identify different verification mechanisms when creating or managing wallet verifications.
|
|
@@ -242,15 +242,15 @@ Used to identify different verification mechanisms when creating or managing wal
|
|
|
242
242
|
|
|
243
243
|
| Enumeration Member | Value | Description | Defined in |
|
|
244
244
|
| ------ | ------ | ------ | ------ |
|
|
245
|
-
| <a id="otp"></a> `OTP` | `"OTP"` | One-Time Password verification method | [sdk/viem/src/custom-actions/types/wallet-verification.enum.ts:9](https://github.com/settlemint/sdk/blob/v2.5.
|
|
246
|
-
| <a id="pincode"></a> `PINCODE` | `"PINCODE"` | PIN code verification method | [sdk/viem/src/custom-actions/types/wallet-verification.enum.ts:7](https://github.com/settlemint/sdk/blob/v2.5.
|
|
247
|
-
| <a id="secret_codes"></a> `SECRET_CODES` | `"SECRET_CODES"` | Secret recovery codes verification method | [sdk/viem/src/custom-actions/types/wallet-verification.enum.ts:11](https://github.com/settlemint/sdk/blob/v2.5.
|
|
245
|
+
| <a id="otp"></a> `OTP` | `"OTP"` | One-Time Password verification method | [sdk/viem/src/custom-actions/types/wallet-verification.enum.ts:9](https://github.com/settlemint/sdk/blob/v2.5.6/sdk/viem/src/custom-actions/types/wallet-verification.enum.ts#L9) |
|
|
246
|
+
| <a id="pincode"></a> `PINCODE` | `"PINCODE"` | PIN code verification method | [sdk/viem/src/custom-actions/types/wallet-verification.enum.ts:7](https://github.com/settlemint/sdk/blob/v2.5.6/sdk/viem/src/custom-actions/types/wallet-verification.enum.ts#L7) |
|
|
247
|
+
| <a id="secret_codes"></a> `SECRET_CODES` | `"SECRET_CODES"` | Secret recovery codes verification method | [sdk/viem/src/custom-actions/types/wallet-verification.enum.ts:11](https://github.com/settlemint/sdk/blob/v2.5.6/sdk/viem/src/custom-actions/types/wallet-verification.enum.ts#L11) |
|
|
248
248
|
|
|
249
249
|
### Interfaces
|
|
250
250
|
|
|
251
251
|
#### CreateWalletParameters
|
|
252
252
|
|
|
253
|
-
Defined in: [sdk/viem/src/custom-actions/create-wallet.action.ts:14](https://github.com/settlemint/sdk/blob/v2.5.
|
|
253
|
+
Defined in: [sdk/viem/src/custom-actions/create-wallet.action.ts:14](https://github.com/settlemint/sdk/blob/v2.5.6/sdk/viem/src/custom-actions/create-wallet.action.ts#L14)
|
|
254
254
|
|
|
255
255
|
Parameters for creating a wallet.
|
|
256
256
|
|
|
@@ -258,14 +258,14 @@ Parameters for creating a wallet.
|
|
|
258
258
|
|
|
259
259
|
| Property | Type | Description | Defined in |
|
|
260
260
|
| ------ | ------ | ------ | ------ |
|
|
261
|
-
| <a id="keyvaultid"></a> `keyVaultId` | `string` | The unique name of the key vault where the wallet will be created. | [sdk/viem/src/custom-actions/create-wallet.action.ts:16](https://github.com/settlemint/sdk/blob/v2.5.
|
|
262
|
-
| <a id="walletinfo"></a> `walletInfo` | [`WalletInfo`](#walletinfo-1) | Information about the wallet to be created. | [sdk/viem/src/custom-actions/create-wallet.action.ts:18](https://github.com/settlemint/sdk/blob/v2.5.
|
|
261
|
+
| <a id="keyvaultid"></a> `keyVaultId` | `string` | The unique name of the key vault where the wallet will be created. | [sdk/viem/src/custom-actions/create-wallet.action.ts:16](https://github.com/settlemint/sdk/blob/v2.5.6/sdk/viem/src/custom-actions/create-wallet.action.ts#L16) |
|
|
262
|
+
| <a id="walletinfo"></a> `walletInfo` | [`WalletInfo`](#walletinfo-1) | Information about the wallet to be created. | [sdk/viem/src/custom-actions/create-wallet.action.ts:18](https://github.com/settlemint/sdk/blob/v2.5.6/sdk/viem/src/custom-actions/create-wallet.action.ts#L18) |
|
|
263
263
|
|
|
264
264
|
***
|
|
265
265
|
|
|
266
266
|
#### CreateWalletResponse
|
|
267
267
|
|
|
268
|
-
Defined in: [sdk/viem/src/custom-actions/create-wallet.action.ts:24](https://github.com/settlemint/sdk/blob/v2.5.
|
|
268
|
+
Defined in: [sdk/viem/src/custom-actions/create-wallet.action.ts:24](https://github.com/settlemint/sdk/blob/v2.5.6/sdk/viem/src/custom-actions/create-wallet.action.ts#L24)
|
|
269
269
|
|
|
270
270
|
Response from creating a wallet.
|
|
271
271
|
|
|
@@ -273,16 +273,16 @@ Response from creating a wallet.
|
|
|
273
273
|
|
|
274
274
|
| Property | Type | Description | Defined in |
|
|
275
275
|
| ------ | ------ | ------ | ------ |
|
|
276
|
-
| <a id="address"></a> `address` | `string` | The blockchain address of the wallet. | [sdk/viem/src/custom-actions/create-wallet.action.ts:30](https://github.com/settlemint/sdk/blob/v2.5.
|
|
277
|
-
| <a id="derivationpath"></a> `derivationPath` | `string` | The HD derivation path used to create the wallet. | [sdk/viem/src/custom-actions/create-wallet.action.ts:32](https://github.com/settlemint/sdk/blob/v2.5.
|
|
278
|
-
| <a id="id"></a> `id` | `string` | The unique identifier of the wallet. | [sdk/viem/src/custom-actions/create-wallet.action.ts:26](https://github.com/settlemint/sdk/blob/v2.5.
|
|
279
|
-
| <a id="name"></a> `name` | `string` | The name of the wallet. | [sdk/viem/src/custom-actions/create-wallet.action.ts:28](https://github.com/settlemint/sdk/blob/v2.5.
|
|
276
|
+
| <a id="address"></a> `address` | `string` | The blockchain address of the wallet. | [sdk/viem/src/custom-actions/create-wallet.action.ts:30](https://github.com/settlemint/sdk/blob/v2.5.6/sdk/viem/src/custom-actions/create-wallet.action.ts#L30) |
|
|
277
|
+
| <a id="derivationpath"></a> `derivationPath` | `string` | The HD derivation path used to create the wallet. | [sdk/viem/src/custom-actions/create-wallet.action.ts:32](https://github.com/settlemint/sdk/blob/v2.5.6/sdk/viem/src/custom-actions/create-wallet.action.ts#L32) |
|
|
278
|
+
| <a id="id"></a> `id` | `string` | The unique identifier of the wallet. | [sdk/viem/src/custom-actions/create-wallet.action.ts:26](https://github.com/settlemint/sdk/blob/v2.5.6/sdk/viem/src/custom-actions/create-wallet.action.ts#L26) |
|
|
279
|
+
| <a id="name"></a> `name` | `string` | The name of the wallet. | [sdk/viem/src/custom-actions/create-wallet.action.ts:28](https://github.com/settlemint/sdk/blob/v2.5.6/sdk/viem/src/custom-actions/create-wallet.action.ts#L28) |
|
|
280
280
|
|
|
281
281
|
***
|
|
282
282
|
|
|
283
283
|
#### CreateWalletVerificationChallengesParameters
|
|
284
284
|
|
|
285
|
-
Defined in: [sdk/viem/src/custom-actions/create-wallet-verification-challenges.action.ts:8](https://github.com/settlemint/sdk/blob/v2.5.
|
|
285
|
+
Defined in: [sdk/viem/src/custom-actions/create-wallet-verification-challenges.action.ts:8](https://github.com/settlemint/sdk/blob/v2.5.6/sdk/viem/src/custom-actions/create-wallet-verification-challenges.action.ts#L8)
|
|
286
286
|
|
|
287
287
|
Parameters for creating wallet verification challenges.
|
|
288
288
|
|
|
@@ -290,13 +290,13 @@ Parameters for creating wallet verification challenges.
|
|
|
290
290
|
|
|
291
291
|
| Property | Type | Description | Defined in |
|
|
292
292
|
| ------ | ------ | ------ | ------ |
|
|
293
|
-
| <a id="addressorobject"></a> `addressOrObject` | [`AddressOrObject`](#addressorobject-2) | The wallet address or object containing wallet address and optional verification ID. | [sdk/viem/src/custom-actions/create-wallet-verification-challenges.action.ts:10](https://github.com/settlemint/sdk/blob/v2.5.
|
|
293
|
+
| <a id="addressorobject"></a> `addressOrObject` | [`AddressOrObject`](#addressorobject-2) | The wallet address or object containing wallet address and optional verification ID. | [sdk/viem/src/custom-actions/create-wallet-verification-challenges.action.ts:10](https://github.com/settlemint/sdk/blob/v2.5.6/sdk/viem/src/custom-actions/create-wallet-verification-challenges.action.ts#L10) |
|
|
294
294
|
|
|
295
295
|
***
|
|
296
296
|
|
|
297
297
|
#### CreateWalletVerificationParameters
|
|
298
298
|
|
|
299
|
-
Defined in: [sdk/viem/src/custom-actions/create-wallet-verification.action.ts:59](https://github.com/settlemint/sdk/blob/v2.5.
|
|
299
|
+
Defined in: [sdk/viem/src/custom-actions/create-wallet-verification.action.ts:59](https://github.com/settlemint/sdk/blob/v2.5.6/sdk/viem/src/custom-actions/create-wallet-verification.action.ts#L59)
|
|
300
300
|
|
|
301
301
|
Parameters for creating a wallet verification.
|
|
302
302
|
|
|
@@ -304,14 +304,14 @@ Parameters for creating a wallet verification.
|
|
|
304
304
|
|
|
305
305
|
| Property | Type | Description | Defined in |
|
|
306
306
|
| ------ | ------ | ------ | ------ |
|
|
307
|
-
| <a id="userwalletaddress"></a> `userWalletAddress` | `string` | The wallet address for which to create the verification. | [sdk/viem/src/custom-actions/create-wallet-verification.action.ts:61](https://github.com/settlemint/sdk/blob/v2.5.
|
|
308
|
-
| <a id="walletverificationinfo"></a> `walletVerificationInfo` | [`WalletVerificationInfo`](#walletverificationinfo-1) | The verification information to create. | [sdk/viem/src/custom-actions/create-wallet-verification.action.ts:63](https://github.com/settlemint/sdk/blob/v2.5.
|
|
307
|
+
| <a id="userwalletaddress"></a> `userWalletAddress` | `string` | The wallet address for which to create the verification. | [sdk/viem/src/custom-actions/create-wallet-verification.action.ts:61](https://github.com/settlemint/sdk/blob/v2.5.6/sdk/viem/src/custom-actions/create-wallet-verification.action.ts#L61) |
|
|
308
|
+
| <a id="walletverificationinfo"></a> `walletVerificationInfo` | [`WalletVerificationInfo`](#walletverificationinfo-1) | The verification information to create. | [sdk/viem/src/custom-actions/create-wallet-verification.action.ts:63](https://github.com/settlemint/sdk/blob/v2.5.6/sdk/viem/src/custom-actions/create-wallet-verification.action.ts#L63) |
|
|
309
309
|
|
|
310
310
|
***
|
|
311
311
|
|
|
312
312
|
#### CreateWalletVerificationResponse
|
|
313
313
|
|
|
314
|
-
Defined in: [sdk/viem/src/custom-actions/create-wallet-verification.action.ts:69](https://github.com/settlemint/sdk/blob/v2.5.
|
|
314
|
+
Defined in: [sdk/viem/src/custom-actions/create-wallet-verification.action.ts:69](https://github.com/settlemint/sdk/blob/v2.5.6/sdk/viem/src/custom-actions/create-wallet-verification.action.ts#L69)
|
|
315
315
|
|
|
316
316
|
Response from creating a wallet verification.
|
|
317
317
|
|
|
@@ -319,16 +319,16 @@ Response from creating a wallet verification.
|
|
|
319
319
|
|
|
320
320
|
| Property | Type | Description | Defined in |
|
|
321
321
|
| ------ | ------ | ------ | ------ |
|
|
322
|
-
| <a id="id-1"></a> `id` | `string` | The unique identifier of the verification. | [sdk/viem/src/custom-actions/create-wallet-verification.action.ts:71](https://github.com/settlemint/sdk/blob/v2.5.
|
|
323
|
-
| <a id="name-1"></a> `name` | `string` | The name of the verification method. | [sdk/viem/src/custom-actions/create-wallet-verification.action.ts:73](https://github.com/settlemint/sdk/blob/v2.5.
|
|
324
|
-
| <a id="parameters"></a> `parameters` | `Record`\<`string`, `string`\> | Additional parameters specific to the verification type. | [sdk/viem/src/custom-actions/create-wallet-verification.action.ts:77](https://github.com/settlemint/sdk/blob/v2.5.
|
|
325
|
-
| <a id="verificationtype"></a> `verificationType` | [`WalletVerificationType`](#walletverificationtype) | The type of verification method. | [sdk/viem/src/custom-actions/create-wallet-verification.action.ts:75](https://github.com/settlemint/sdk/blob/v2.5.
|
|
322
|
+
| <a id="id-1"></a> `id` | `string` | The unique identifier of the verification. | [sdk/viem/src/custom-actions/create-wallet-verification.action.ts:71](https://github.com/settlemint/sdk/blob/v2.5.6/sdk/viem/src/custom-actions/create-wallet-verification.action.ts#L71) |
|
|
323
|
+
| <a id="name-1"></a> `name` | `string` | The name of the verification method. | [sdk/viem/src/custom-actions/create-wallet-verification.action.ts:73](https://github.com/settlemint/sdk/blob/v2.5.6/sdk/viem/src/custom-actions/create-wallet-verification.action.ts#L73) |
|
|
324
|
+
| <a id="parameters"></a> `parameters` | `Record`\<`string`, `string`\> | Additional parameters specific to the verification type. | [sdk/viem/src/custom-actions/create-wallet-verification.action.ts:77](https://github.com/settlemint/sdk/blob/v2.5.6/sdk/viem/src/custom-actions/create-wallet-verification.action.ts#L77) |
|
|
325
|
+
| <a id="verificationtype"></a> `verificationType` | [`WalletVerificationType`](#walletverificationtype) | The type of verification method. | [sdk/viem/src/custom-actions/create-wallet-verification.action.ts:75](https://github.com/settlemint/sdk/blob/v2.5.6/sdk/viem/src/custom-actions/create-wallet-verification.action.ts#L75) |
|
|
326
326
|
|
|
327
327
|
***
|
|
328
328
|
|
|
329
329
|
#### DeleteWalletVerificationParameters
|
|
330
330
|
|
|
331
|
-
Defined in: [sdk/viem/src/custom-actions/delete-wallet-verification.action.ts:6](https://github.com/settlemint/sdk/blob/v2.5.
|
|
331
|
+
Defined in: [sdk/viem/src/custom-actions/delete-wallet-verification.action.ts:6](https://github.com/settlemint/sdk/blob/v2.5.6/sdk/viem/src/custom-actions/delete-wallet-verification.action.ts#L6)
|
|
332
332
|
|
|
333
333
|
Parameters for deleting a wallet verification.
|
|
334
334
|
|
|
@@ -336,14 +336,14 @@ Parameters for deleting a wallet verification.
|
|
|
336
336
|
|
|
337
337
|
| Property | Type | Description | Defined in |
|
|
338
338
|
| ------ | ------ | ------ | ------ |
|
|
339
|
-
| <a id="userwalletaddress-1"></a> `userWalletAddress` | `string` | The wallet address for which to delete the verification. | [sdk/viem/src/custom-actions/delete-wallet-verification.action.ts:8](https://github.com/settlemint/sdk/blob/v2.5.
|
|
340
|
-
| <a id="verificationid"></a> `verificationId` | `string` | The unique identifier of the verification to delete. | [sdk/viem/src/custom-actions/delete-wallet-verification.action.ts:10](https://github.com/settlemint/sdk/blob/v2.5.
|
|
339
|
+
| <a id="userwalletaddress-1"></a> `userWalletAddress` | `string` | The wallet address for which to delete the verification. | [sdk/viem/src/custom-actions/delete-wallet-verification.action.ts:8](https://github.com/settlemint/sdk/blob/v2.5.6/sdk/viem/src/custom-actions/delete-wallet-verification.action.ts#L8) |
|
|
340
|
+
| <a id="verificationid"></a> `verificationId` | `string` | The unique identifier of the verification to delete. | [sdk/viem/src/custom-actions/delete-wallet-verification.action.ts:10](https://github.com/settlemint/sdk/blob/v2.5.6/sdk/viem/src/custom-actions/delete-wallet-verification.action.ts#L10) |
|
|
341
341
|
|
|
342
342
|
***
|
|
343
343
|
|
|
344
344
|
#### DeleteWalletVerificationResponse
|
|
345
345
|
|
|
346
|
-
Defined in: [sdk/viem/src/custom-actions/delete-wallet-verification.action.ts:16](https://github.com/settlemint/sdk/blob/v2.5.
|
|
346
|
+
Defined in: [sdk/viem/src/custom-actions/delete-wallet-verification.action.ts:16](https://github.com/settlemint/sdk/blob/v2.5.6/sdk/viem/src/custom-actions/delete-wallet-verification.action.ts#L16)
|
|
347
347
|
|
|
348
348
|
Response from deleting a wallet verification.
|
|
349
349
|
|
|
@@ -351,13 +351,13 @@ Response from deleting a wallet verification.
|
|
|
351
351
|
|
|
352
352
|
| Property | Type | Description | Defined in |
|
|
353
353
|
| ------ | ------ | ------ | ------ |
|
|
354
|
-
| <a id="success"></a> `success` | `boolean` | Whether the deletion was successful. | [sdk/viem/src/custom-actions/delete-wallet-verification.action.ts:18](https://github.com/settlemint/sdk/blob/v2.5.
|
|
354
|
+
| <a id="success"></a> `success` | `boolean` | Whether the deletion was successful. | [sdk/viem/src/custom-actions/delete-wallet-verification.action.ts:18](https://github.com/settlemint/sdk/blob/v2.5.6/sdk/viem/src/custom-actions/delete-wallet-verification.action.ts#L18) |
|
|
355
355
|
|
|
356
356
|
***
|
|
357
357
|
|
|
358
358
|
#### GetWalletVerificationsParameters
|
|
359
359
|
|
|
360
|
-
Defined in: [sdk/viem/src/custom-actions/get-wallet-verifications.action.ts:7](https://github.com/settlemint/sdk/blob/v2.5.
|
|
360
|
+
Defined in: [sdk/viem/src/custom-actions/get-wallet-verifications.action.ts:7](https://github.com/settlemint/sdk/blob/v2.5.6/sdk/viem/src/custom-actions/get-wallet-verifications.action.ts#L7)
|
|
361
361
|
|
|
362
362
|
Parameters for getting wallet verifications.
|
|
363
363
|
|
|
@@ -365,13 +365,13 @@ Parameters for getting wallet verifications.
|
|
|
365
365
|
|
|
366
366
|
| Property | Type | Description | Defined in |
|
|
367
367
|
| ------ | ------ | ------ | ------ |
|
|
368
|
-
| <a id="userwalletaddress-2"></a> `userWalletAddress` | `string` | The wallet address for which to fetch verifications. | [sdk/viem/src/custom-actions/get-wallet-verifications.action.ts:9](https://github.com/settlemint/sdk/blob/v2.5.
|
|
368
|
+
| <a id="userwalletaddress-2"></a> `userWalletAddress` | `string` | The wallet address for which to fetch verifications. | [sdk/viem/src/custom-actions/get-wallet-verifications.action.ts:9](https://github.com/settlemint/sdk/blob/v2.5.6/sdk/viem/src/custom-actions/get-wallet-verifications.action.ts#L9) |
|
|
369
369
|
|
|
370
370
|
***
|
|
371
371
|
|
|
372
372
|
#### VerificationResult
|
|
373
373
|
|
|
374
|
-
Defined in: [sdk/viem/src/custom-actions/verify-wallet-verification-challenge.action.ts:26](https://github.com/settlemint/sdk/blob/v2.5.
|
|
374
|
+
Defined in: [sdk/viem/src/custom-actions/verify-wallet-verification-challenge.action.ts:26](https://github.com/settlemint/sdk/blob/v2.5.6/sdk/viem/src/custom-actions/verify-wallet-verification-challenge.action.ts#L26)
|
|
375
375
|
|
|
376
376
|
Result of a wallet verification challenge.
|
|
377
377
|
|
|
@@ -379,13 +379,13 @@ Result of a wallet verification challenge.
|
|
|
379
379
|
|
|
380
380
|
| Property | Type | Description | Defined in |
|
|
381
381
|
| ------ | ------ | ------ | ------ |
|
|
382
|
-
| <a id="verified"></a> `verified` | `boolean` | Whether the verification was successful. | [sdk/viem/src/custom-actions/verify-wallet-verification-challenge.action.ts:28](https://github.com/settlemint/sdk/blob/v2.5.
|
|
382
|
+
| <a id="verified"></a> `verified` | `boolean` | Whether the verification was successful. | [sdk/viem/src/custom-actions/verify-wallet-verification-challenge.action.ts:28](https://github.com/settlemint/sdk/blob/v2.5.6/sdk/viem/src/custom-actions/verify-wallet-verification-challenge.action.ts#L28) |
|
|
383
383
|
|
|
384
384
|
***
|
|
385
385
|
|
|
386
386
|
#### VerifyWalletVerificationChallengeParameters
|
|
387
387
|
|
|
388
|
-
Defined in: [sdk/viem/src/custom-actions/verify-wallet-verification-challenge.action.ts:16](https://github.com/settlemint/sdk/blob/v2.5.
|
|
388
|
+
Defined in: [sdk/viem/src/custom-actions/verify-wallet-verification-challenge.action.ts:16](https://github.com/settlemint/sdk/blob/v2.5.6/sdk/viem/src/custom-actions/verify-wallet-verification-challenge.action.ts#L16)
|
|
389
389
|
|
|
390
390
|
Parameters for verifying a wallet verification challenge.
|
|
391
391
|
|
|
@@ -393,14 +393,14 @@ Parameters for verifying a wallet verification challenge.
|
|
|
393
393
|
|
|
394
394
|
| Property | Type | Description | Defined in |
|
|
395
395
|
| ------ | ------ | ------ | ------ |
|
|
396
|
-
| <a id="addressorobject-1"></a> `addressOrObject` | [`AddressOrObject`](#addressorobject-2) | The wallet address or object containing wallet address and optional verification ID. | [sdk/viem/src/custom-actions/verify-wallet-verification-challenge.action.ts:18](https://github.com/settlemint/sdk/blob/v2.5.
|
|
397
|
-
| <a id="challengeresponse"></a> `challengeResponse` | `string` | The response to the verification challenge. | [sdk/viem/src/custom-actions/verify-wallet-verification-challenge.action.ts:20](https://github.com/settlemint/sdk/blob/v2.5.
|
|
396
|
+
| <a id="addressorobject-1"></a> `addressOrObject` | [`AddressOrObject`](#addressorobject-2) | The wallet address or object containing wallet address and optional verification ID. | [sdk/viem/src/custom-actions/verify-wallet-verification-challenge.action.ts:18](https://github.com/settlemint/sdk/blob/v2.5.6/sdk/viem/src/custom-actions/verify-wallet-verification-challenge.action.ts#L18) |
|
|
397
|
+
| <a id="challengeresponse"></a> `challengeResponse` | `string` | The response to the verification challenge. | [sdk/viem/src/custom-actions/verify-wallet-verification-challenge.action.ts:20](https://github.com/settlemint/sdk/blob/v2.5.6/sdk/viem/src/custom-actions/verify-wallet-verification-challenge.action.ts#L20) |
|
|
398
398
|
|
|
399
399
|
***
|
|
400
400
|
|
|
401
401
|
#### WalletInfo
|
|
402
402
|
|
|
403
|
-
Defined in: [sdk/viem/src/custom-actions/create-wallet.action.ts:6](https://github.com/settlemint/sdk/blob/v2.5.
|
|
403
|
+
Defined in: [sdk/viem/src/custom-actions/create-wallet.action.ts:6](https://github.com/settlemint/sdk/blob/v2.5.6/sdk/viem/src/custom-actions/create-wallet.action.ts#L6)
|
|
404
404
|
|
|
405
405
|
Information about the wallet to be created.
|
|
406
406
|
|
|
@@ -408,13 +408,13 @@ Information about the wallet to be created.
|
|
|
408
408
|
|
|
409
409
|
| Property | Type | Description | Defined in |
|
|
410
410
|
| ------ | ------ | ------ | ------ |
|
|
411
|
-
| <a id="name-2"></a> `name` | `string` | The name of the wallet. | [sdk/viem/src/custom-actions/create-wallet.action.ts:8](https://github.com/settlemint/sdk/blob/v2.5.
|
|
411
|
+
| <a id="name-2"></a> `name` | `string` | The name of the wallet. | [sdk/viem/src/custom-actions/create-wallet.action.ts:8](https://github.com/settlemint/sdk/blob/v2.5.6/sdk/viem/src/custom-actions/create-wallet.action.ts#L8) |
|
|
412
412
|
|
|
413
413
|
***
|
|
414
414
|
|
|
415
415
|
#### WalletOTPVerificationInfo
|
|
416
416
|
|
|
417
|
-
Defined in: [sdk/viem/src/custom-actions/create-wallet-verification.action.ts:27](https://github.com/settlemint/sdk/blob/v2.5.
|
|
417
|
+
Defined in: [sdk/viem/src/custom-actions/create-wallet-verification.action.ts:27](https://github.com/settlemint/sdk/blob/v2.5.6/sdk/viem/src/custom-actions/create-wallet-verification.action.ts#L27)
|
|
418
418
|
|
|
419
419
|
Information for One-Time Password (OTP) verification.
|
|
420
420
|
|
|
@@ -426,18 +426,18 @@ Information for One-Time Password (OTP) verification.
|
|
|
426
426
|
|
|
427
427
|
| Property | Type | Description | Overrides | Inherited from | Defined in |
|
|
428
428
|
| ------ | ------ | ------ | ------ | ------ | ------ |
|
|
429
|
-
| <a id="algorithm"></a> `algorithm?` | [`OTPAlgorithm`](#otpalgorithm) | The hash algorithm to use for OTP generation. | - | - | [sdk/viem/src/custom-actions/create-wallet-verification.action.ts:31](https://github.com/settlemint/sdk/blob/v2.5.
|
|
430
|
-
| <a id="digits"></a> `digits?` | `number` | The number of digits in the OTP code. | - | - | [sdk/viem/src/custom-actions/create-wallet-verification.action.ts:33](https://github.com/settlemint/sdk/blob/v2.5.
|
|
431
|
-
| <a id="issuer"></a> `issuer?` | `string` | The issuer of the OTP. | - | - | [sdk/viem/src/custom-actions/create-wallet-verification.action.ts:37](https://github.com/settlemint/sdk/blob/v2.5.
|
|
432
|
-
| <a id="name-3"></a> `name` | `string` | The name of the verification method. | - | `BaseWalletVerificationInfo.name` | [sdk/viem/src/custom-actions/create-wallet-verification.action.ts:9](https://github.com/settlemint/sdk/blob/v2.5.
|
|
433
|
-
| <a id="period"></a> `period?` | `number` | The time period in seconds for OTP validity. | - | - | [sdk/viem/src/custom-actions/create-wallet-verification.action.ts:35](https://github.com/settlemint/sdk/blob/v2.5.
|
|
434
|
-
| <a id="verificationtype-1"></a> `verificationType` | [`OTP`](#otp) | The type of verification method. | `BaseWalletVerificationInfo.verificationType` | - | [sdk/viem/src/custom-actions/create-wallet-verification.action.ts:29](https://github.com/settlemint/sdk/blob/v2.5.
|
|
429
|
+
| <a id="algorithm"></a> `algorithm?` | [`OTPAlgorithm`](#otpalgorithm) | The hash algorithm to use for OTP generation. | - | - | [sdk/viem/src/custom-actions/create-wallet-verification.action.ts:31](https://github.com/settlemint/sdk/blob/v2.5.6/sdk/viem/src/custom-actions/create-wallet-verification.action.ts#L31) |
|
|
430
|
+
| <a id="digits"></a> `digits?` | `number` | The number of digits in the OTP code. | - | - | [sdk/viem/src/custom-actions/create-wallet-verification.action.ts:33](https://github.com/settlemint/sdk/blob/v2.5.6/sdk/viem/src/custom-actions/create-wallet-verification.action.ts#L33) |
|
|
431
|
+
| <a id="issuer"></a> `issuer?` | `string` | The issuer of the OTP. | - | - | [sdk/viem/src/custom-actions/create-wallet-verification.action.ts:37](https://github.com/settlemint/sdk/blob/v2.5.6/sdk/viem/src/custom-actions/create-wallet-verification.action.ts#L37) |
|
|
432
|
+
| <a id="name-3"></a> `name` | `string` | The name of the verification method. | - | `BaseWalletVerificationInfo.name` | [sdk/viem/src/custom-actions/create-wallet-verification.action.ts:9](https://github.com/settlemint/sdk/blob/v2.5.6/sdk/viem/src/custom-actions/create-wallet-verification.action.ts#L9) |
|
|
433
|
+
| <a id="period"></a> `period?` | `number` | The time period in seconds for OTP validity. | - | - | [sdk/viem/src/custom-actions/create-wallet-verification.action.ts:35](https://github.com/settlemint/sdk/blob/v2.5.6/sdk/viem/src/custom-actions/create-wallet-verification.action.ts#L35) |
|
|
434
|
+
| <a id="verificationtype-1"></a> `verificationType` | [`OTP`](#otp) | The type of verification method. | `BaseWalletVerificationInfo.verificationType` | - | [sdk/viem/src/custom-actions/create-wallet-verification.action.ts:29](https://github.com/settlemint/sdk/blob/v2.5.6/sdk/viem/src/custom-actions/create-wallet-verification.action.ts#L29) |
|
|
435
435
|
|
|
436
436
|
***
|
|
437
437
|
|
|
438
438
|
#### WalletPincodeVerificationInfo
|
|
439
439
|
|
|
440
|
-
Defined in: [sdk/viem/src/custom-actions/create-wallet-verification.action.ts:17](https://github.com/settlemint/sdk/blob/v2.5.
|
|
440
|
+
Defined in: [sdk/viem/src/custom-actions/create-wallet-verification.action.ts:17](https://github.com/settlemint/sdk/blob/v2.5.6/sdk/viem/src/custom-actions/create-wallet-verification.action.ts#L17)
|
|
441
441
|
|
|
442
442
|
Information for PIN code verification.
|
|
443
443
|
|
|
@@ -449,15 +449,15 @@ Information for PIN code verification.
|
|
|
449
449
|
|
|
450
450
|
| Property | Type | Description | Overrides | Inherited from | Defined in |
|
|
451
451
|
| ------ | ------ | ------ | ------ | ------ | ------ |
|
|
452
|
-
| <a id="name-4"></a> `name` | `string` | The name of the verification method. | - | `BaseWalletVerificationInfo.name` | [sdk/viem/src/custom-actions/create-wallet-verification.action.ts:9](https://github.com/settlemint/sdk/blob/v2.5.
|
|
453
|
-
| <a id="pincode-1"></a> `pincode` | `string` | The PIN code to use for verification. | - | - | [sdk/viem/src/custom-actions/create-wallet-verification.action.ts:21](https://github.com/settlemint/sdk/blob/v2.5.
|
|
454
|
-
| <a id="verificationtype-2"></a> `verificationType` | [`PINCODE`](#pincode) | The type of verification method. | `BaseWalletVerificationInfo.verificationType` | - | [sdk/viem/src/custom-actions/create-wallet-verification.action.ts:19](https://github.com/settlemint/sdk/blob/v2.5.
|
|
452
|
+
| <a id="name-4"></a> `name` | `string` | The name of the verification method. | - | `BaseWalletVerificationInfo.name` | [sdk/viem/src/custom-actions/create-wallet-verification.action.ts:9](https://github.com/settlemint/sdk/blob/v2.5.6/sdk/viem/src/custom-actions/create-wallet-verification.action.ts#L9) |
|
|
453
|
+
| <a id="pincode-1"></a> `pincode` | `string` | The PIN code to use for verification. | - | - | [sdk/viem/src/custom-actions/create-wallet-verification.action.ts:21](https://github.com/settlemint/sdk/blob/v2.5.6/sdk/viem/src/custom-actions/create-wallet-verification.action.ts#L21) |
|
|
454
|
+
| <a id="verificationtype-2"></a> `verificationType` | [`PINCODE`](#pincode) | The type of verification method. | `BaseWalletVerificationInfo.verificationType` | - | [sdk/viem/src/custom-actions/create-wallet-verification.action.ts:19](https://github.com/settlemint/sdk/blob/v2.5.6/sdk/viem/src/custom-actions/create-wallet-verification.action.ts#L19) |
|
|
455
455
|
|
|
456
456
|
***
|
|
457
457
|
|
|
458
458
|
#### WalletSecretCodesVerificationInfo
|
|
459
459
|
|
|
460
|
-
Defined in: [sdk/viem/src/custom-actions/create-wallet-verification.action.ts:43](https://github.com/settlemint/sdk/blob/v2.5.
|
|
460
|
+
Defined in: [sdk/viem/src/custom-actions/create-wallet-verification.action.ts:43](https://github.com/settlemint/sdk/blob/v2.5.6/sdk/viem/src/custom-actions/create-wallet-verification.action.ts#L43)
|
|
461
461
|
|
|
462
462
|
Information for secret recovery codes verification.
|
|
463
463
|
|
|
@@ -469,14 +469,14 @@ Information for secret recovery codes verification.
|
|
|
469
469
|
|
|
470
470
|
| Property | Type | Description | Overrides | Inherited from | Defined in |
|
|
471
471
|
| ------ | ------ | ------ | ------ | ------ | ------ |
|
|
472
|
-
| <a id="name-5"></a> `name` | `string` | The name of the verification method. | - | `BaseWalletVerificationInfo.name` | [sdk/viem/src/custom-actions/create-wallet-verification.action.ts:9](https://github.com/settlemint/sdk/blob/v2.5.
|
|
473
|
-
| <a id="verificationtype-3"></a> `verificationType` | [`SECRET_CODES`](#secret_codes) | The type of verification method. | `BaseWalletVerificationInfo.verificationType` | - | [sdk/viem/src/custom-actions/create-wallet-verification.action.ts:45](https://github.com/settlemint/sdk/blob/v2.5.
|
|
472
|
+
| <a id="name-5"></a> `name` | `string` | The name of the verification method. | - | `BaseWalletVerificationInfo.name` | [sdk/viem/src/custom-actions/create-wallet-verification.action.ts:9](https://github.com/settlemint/sdk/blob/v2.5.6/sdk/viem/src/custom-actions/create-wallet-verification.action.ts#L9) |
|
|
473
|
+
| <a id="verificationtype-3"></a> `verificationType` | [`SECRET_CODES`](#secret_codes) | The type of verification method. | `BaseWalletVerificationInfo.verificationType` | - | [sdk/viem/src/custom-actions/create-wallet-verification.action.ts:45](https://github.com/settlemint/sdk/blob/v2.5.6/sdk/viem/src/custom-actions/create-wallet-verification.action.ts#L45) |
|
|
474
474
|
|
|
475
475
|
***
|
|
476
476
|
|
|
477
477
|
#### WalletVerification
|
|
478
478
|
|
|
479
|
-
Defined in: [sdk/viem/src/custom-actions/get-wallet-verifications.action.ts:15](https://github.com/settlemint/sdk/blob/v2.5.
|
|
479
|
+
Defined in: [sdk/viem/src/custom-actions/get-wallet-verifications.action.ts:15](https://github.com/settlemint/sdk/blob/v2.5.6/sdk/viem/src/custom-actions/get-wallet-verifications.action.ts#L15)
|
|
480
480
|
|
|
481
481
|
Represents a wallet verification.
|
|
482
482
|
|
|
@@ -484,15 +484,15 @@ Represents a wallet verification.
|
|
|
484
484
|
|
|
485
485
|
| Property | Type | Description | Defined in |
|
|
486
486
|
| ------ | ------ | ------ | ------ |
|
|
487
|
-
| <a id="id-2"></a> `id` | `string` | The unique identifier of the verification. | [sdk/viem/src/custom-actions/get-wallet-verifications.action.ts:17](https://github.com/settlemint/sdk/blob/v2.5.
|
|
488
|
-
| <a id="name-6"></a> `name` | `string` | The name of the verification method. | [sdk/viem/src/custom-actions/get-wallet-verifications.action.ts:19](https://github.com/settlemint/sdk/blob/v2.5.
|
|
489
|
-
| <a id="verificationtype-4"></a> `verificationType` | [`WalletVerificationType`](#walletverificationtype) | The type of verification method. | [sdk/viem/src/custom-actions/get-wallet-verifications.action.ts:21](https://github.com/settlemint/sdk/blob/v2.5.
|
|
487
|
+
| <a id="id-2"></a> `id` | `string` | The unique identifier of the verification. | [sdk/viem/src/custom-actions/get-wallet-verifications.action.ts:17](https://github.com/settlemint/sdk/blob/v2.5.6/sdk/viem/src/custom-actions/get-wallet-verifications.action.ts#L17) |
|
|
488
|
+
| <a id="name-6"></a> `name` | `string` | The name of the verification method. | [sdk/viem/src/custom-actions/get-wallet-verifications.action.ts:19](https://github.com/settlemint/sdk/blob/v2.5.6/sdk/viem/src/custom-actions/get-wallet-verifications.action.ts#L19) |
|
|
489
|
+
| <a id="verificationtype-4"></a> `verificationType` | [`WalletVerificationType`](#walletverificationtype) | The type of verification method. | [sdk/viem/src/custom-actions/get-wallet-verifications.action.ts:21](https://github.com/settlemint/sdk/blob/v2.5.6/sdk/viem/src/custom-actions/get-wallet-verifications.action.ts#L21) |
|
|
490
490
|
|
|
491
491
|
***
|
|
492
492
|
|
|
493
493
|
#### WalletVerificationChallenge
|
|
494
494
|
|
|
495
|
-
Defined in: [sdk/viem/src/custom-actions/create-wallet-verification-challenges.action.ts:16](https://github.com/settlemint/sdk/blob/v2.5.
|
|
495
|
+
Defined in: [sdk/viem/src/custom-actions/create-wallet-verification-challenges.action.ts:16](https://github.com/settlemint/sdk/blob/v2.5.6/sdk/viem/src/custom-actions/create-wallet-verification-challenges.action.ts#L16)
|
|
496
496
|
|
|
497
497
|
Represents a wallet verification challenge.
|
|
498
498
|
|
|
@@ -500,16 +500,16 @@ Represents a wallet verification challenge.
|
|
|
500
500
|
|
|
501
501
|
| Property | Type | Description | Defined in |
|
|
502
502
|
| ------ | ------ | ------ | ------ |
|
|
503
|
-
| <a id="challenge"></a> `challenge` | `Record`\<`string`, `string`\> | The challenge parameters specific to the verification type. | [sdk/viem/src/custom-actions/create-wallet-verification-challenges.action.ts:24](https://github.com/settlemint/sdk/blob/v2.5.
|
|
504
|
-
| <a id="id-3"></a> `id` | `string` | The unique identifier of the challenge. | [sdk/viem/src/custom-actions/create-wallet-verification-challenges.action.ts:18](https://github.com/settlemint/sdk/blob/v2.5.
|
|
505
|
-
| <a id="name-7"></a> `name` | `string` | The name of the challenge. | [sdk/viem/src/custom-actions/create-wallet-verification-challenges.action.ts:20](https://github.com/settlemint/sdk/blob/v2.5.
|
|
506
|
-
| <a id="verificationtype-5"></a> `verificationType` | [`WalletVerificationType`](#walletverificationtype) | The type of verification required. | [sdk/viem/src/custom-actions/create-wallet-verification-challenges.action.ts:22](https://github.com/settlemint/sdk/blob/v2.5.
|
|
503
|
+
| <a id="challenge"></a> `challenge` | `Record`\<`string`, `string`\> | The challenge parameters specific to the verification type. | [sdk/viem/src/custom-actions/create-wallet-verification-challenges.action.ts:24](https://github.com/settlemint/sdk/blob/v2.5.6/sdk/viem/src/custom-actions/create-wallet-verification-challenges.action.ts#L24) |
|
|
504
|
+
| <a id="id-3"></a> `id` | `string` | The unique identifier of the challenge. | [sdk/viem/src/custom-actions/create-wallet-verification-challenges.action.ts:18](https://github.com/settlemint/sdk/blob/v2.5.6/sdk/viem/src/custom-actions/create-wallet-verification-challenges.action.ts#L18) |
|
|
505
|
+
| <a id="name-7"></a> `name` | `string` | The name of the challenge. | [sdk/viem/src/custom-actions/create-wallet-verification-challenges.action.ts:20](https://github.com/settlemint/sdk/blob/v2.5.6/sdk/viem/src/custom-actions/create-wallet-verification-challenges.action.ts#L20) |
|
|
506
|
+
| <a id="verificationtype-5"></a> `verificationType` | [`WalletVerificationType`](#walletverificationtype) | The type of verification required. | [sdk/viem/src/custom-actions/create-wallet-verification-challenges.action.ts:22](https://github.com/settlemint/sdk/blob/v2.5.6/sdk/viem/src/custom-actions/create-wallet-verification-challenges.action.ts#L22) |
|
|
507
507
|
|
|
508
508
|
***
|
|
509
509
|
|
|
510
510
|
#### WalletVerificationOptions
|
|
511
511
|
|
|
512
|
-
Defined in: [sdk/viem/src/viem.ts:101](https://github.com/settlemint/sdk/blob/v2.5.
|
|
512
|
+
Defined in: [sdk/viem/src/viem.ts:101](https://github.com/settlemint/sdk/blob/v2.5.6/sdk/viem/src/viem.ts#L101)
|
|
513
513
|
|
|
514
514
|
The options for the wallet client.
|
|
515
515
|
|
|
@@ -517,8 +517,8 @@ The options for the wallet client.
|
|
|
517
517
|
|
|
518
518
|
| Property | Type | Description | Defined in |
|
|
519
519
|
| ------ | ------ | ------ | ------ |
|
|
520
|
-
| <a id="challengeresponse-1"></a> `challengeResponse` | `string` | The challenge response (used for HD wallets) | [sdk/viem/src/viem.ts:109](https://github.com/settlemint/sdk/blob/v2.5.
|
|
521
|
-
| <a id="verificationid-1"></a> `verificationId?` | `string` | The verification id (used for HD wallets), if not provided, the challenge response will be validated against all active verifications. | [sdk/viem/src/viem.ts:105](https://github.com/settlemint/sdk/blob/v2.5.
|
|
520
|
+
| <a id="challengeresponse-1"></a> `challengeResponse` | `string` | The challenge response (used for HD wallets) | [sdk/viem/src/viem.ts:109](https://github.com/settlemint/sdk/blob/v2.5.6/sdk/viem/src/viem.ts#L109) |
|
|
521
|
+
| <a id="verificationid-1"></a> `verificationId?` | `string` | The verification id (used for HD wallets), if not provided, the challenge response will be validated against all active verifications. | [sdk/viem/src/viem.ts:105](https://github.com/settlemint/sdk/blob/v2.5.6/sdk/viem/src/viem.ts#L105) |
|
|
522
522
|
|
|
523
523
|
### Type Aliases
|
|
524
524
|
|
|
@@ -526,7 +526,7 @@ The options for the wallet client.
|
|
|
526
526
|
|
|
527
527
|
> **AddressOrObject** = `string` \| \{ `userWalletAddress`: `string`; `verificationId?`: `string`; \}
|
|
528
528
|
|
|
529
|
-
Defined in: [sdk/viem/src/custom-actions/verify-wallet-verification-challenge.action.ts:6](https://github.com/settlemint/sdk/blob/v2.5.
|
|
529
|
+
Defined in: [sdk/viem/src/custom-actions/verify-wallet-verification-challenge.action.ts:6](https://github.com/settlemint/sdk/blob/v2.5.6/sdk/viem/src/custom-actions/verify-wallet-verification-challenge.action.ts#L6)
|
|
530
530
|
|
|
531
531
|
Represents either a wallet address string or an object containing wallet address and optional verification ID.
|
|
532
532
|
|
|
@@ -536,7 +536,7 @@ Represents either a wallet address string or an object containing wallet address
|
|
|
536
536
|
|
|
537
537
|
> **ClientOptions** = `Omit`\<`z.infer`\<*typeof* [`ClientOptionsSchema`](#clientoptionsschema)\>, `"httpTransportConfig"`\> & `object`
|
|
538
538
|
|
|
539
|
-
Defined in: [sdk/viem/src/viem.ts:51](https://github.com/settlemint/sdk/blob/v2.5.
|
|
539
|
+
Defined in: [sdk/viem/src/viem.ts:51](https://github.com/settlemint/sdk/blob/v2.5.6/sdk/viem/src/viem.ts#L51)
|
|
540
540
|
|
|
541
541
|
Type representing the validated client options.
|
|
542
542
|
|
|
@@ -544,7 +544,7 @@ Type representing the validated client options.
|
|
|
544
544
|
|
|
545
545
|
| Name | Type | Defined in |
|
|
546
546
|
| ------ | ------ | ------ |
|
|
547
|
-
| `httpTransportConfig?` | `HttpTransportConfig` | [sdk/viem/src/viem.ts:52](https://github.com/settlemint/sdk/blob/v2.5.
|
|
547
|
+
| `httpTransportConfig?` | `HttpTransportConfig` | [sdk/viem/src/viem.ts:52](https://github.com/settlemint/sdk/blob/v2.5.6/sdk/viem/src/viem.ts#L52) |
|
|
548
548
|
|
|
549
549
|
***
|
|
550
550
|
|
|
@@ -552,7 +552,7 @@ Type representing the validated client options.
|
|
|
552
552
|
|
|
553
553
|
> **CreateWalletVerificationChallengesResponse** = [`WalletVerificationChallenge`](#walletverificationchallenge)[]
|
|
554
554
|
|
|
555
|
-
Defined in: [sdk/viem/src/custom-actions/create-wallet-verification-challenges.action.ts:30](https://github.com/settlemint/sdk/blob/v2.5.
|
|
555
|
+
Defined in: [sdk/viem/src/custom-actions/create-wallet-verification-challenges.action.ts:30](https://github.com/settlemint/sdk/blob/v2.5.6/sdk/viem/src/custom-actions/create-wallet-verification-challenges.action.ts#L30)
|
|
556
556
|
|
|
557
557
|
Response from creating wallet verification challenges.
|
|
558
558
|
|
|
@@ -562,7 +562,7 @@ Response from creating wallet verification challenges.
|
|
|
562
562
|
|
|
563
563
|
> **GetChainIdOptions** = `Omit`\<`z.infer`\<*typeof* [`GetChainIdOptionsSchema`](#getchainidoptionsschema)\>, `"httpTransportConfig"`\> & `object`
|
|
564
564
|
|
|
565
|
-
Defined in: [sdk/viem/src/viem.ts:198](https://github.com/settlemint/sdk/blob/v2.5.
|
|
565
|
+
Defined in: [sdk/viem/src/viem.ts:198](https://github.com/settlemint/sdk/blob/v2.5.6/sdk/viem/src/viem.ts#L198)
|
|
566
566
|
|
|
567
567
|
Type representing the validated get chain id options.
|
|
568
568
|
|
|
@@ -570,7 +570,7 @@ Type representing the validated get chain id options.
|
|
|
570
570
|
|
|
571
571
|
| Name | Type | Defined in |
|
|
572
572
|
| ------ | ------ | ------ |
|
|
573
|
-
| `httpTransportConfig?` | `HttpTransportConfig` | [sdk/viem/src/viem.ts:199](https://github.com/settlemint/sdk/blob/v2.5.
|
|
573
|
+
| `httpTransportConfig?` | `HttpTransportConfig` | [sdk/viem/src/viem.ts:199](https://github.com/settlemint/sdk/blob/v2.5.6/sdk/viem/src/viem.ts#L199) |
|
|
574
574
|
|
|
575
575
|
***
|
|
576
576
|
|
|
@@ -578,7 +578,7 @@ Type representing the validated get chain id options.
|
|
|
578
578
|
|
|
579
579
|
> **GetWalletVerificationsResponse** = [`WalletVerification`](#walletverification)[]
|
|
580
580
|
|
|
581
|
-
Defined in: [sdk/viem/src/custom-actions/get-wallet-verifications.action.ts:27](https://github.com/settlemint/sdk/blob/v2.5.
|
|
581
|
+
Defined in: [sdk/viem/src/custom-actions/get-wallet-verifications.action.ts:27](https://github.com/settlemint/sdk/blob/v2.5.6/sdk/viem/src/custom-actions/get-wallet-verifications.action.ts#L27)
|
|
582
582
|
|
|
583
583
|
Response from getting wallet verifications.
|
|
584
584
|
|
|
@@ -588,7 +588,7 @@ Response from getting wallet verifications.
|
|
|
588
588
|
|
|
589
589
|
> **VerifyWalletVerificationChallengeResponse** = [`VerificationResult`](#verificationresult)[]
|
|
590
590
|
|
|
591
|
-
Defined in: [sdk/viem/src/custom-actions/verify-wallet-verification-challenge.action.ts:34](https://github.com/settlemint/sdk/blob/v2.5.
|
|
591
|
+
Defined in: [sdk/viem/src/custom-actions/verify-wallet-verification-challenge.action.ts:34](https://github.com/settlemint/sdk/blob/v2.5.6/sdk/viem/src/custom-actions/verify-wallet-verification-challenge.action.ts#L34)
|
|
592
592
|
|
|
593
593
|
Response from verifying a wallet verification challenge.
|
|
594
594
|
|
|
@@ -598,7 +598,7 @@ Response from verifying a wallet verification challenge.
|
|
|
598
598
|
|
|
599
599
|
> **WalletVerificationInfo** = [`WalletPincodeVerificationInfo`](#walletpincodeverificationinfo) \| [`WalletOTPVerificationInfo`](#walletotpverificationinfo) \| [`WalletSecretCodesVerificationInfo`](#walletsecretcodesverificationinfo)
|
|
600
600
|
|
|
601
|
-
Defined in: [sdk/viem/src/custom-actions/create-wallet-verification.action.ts:51](https://github.com/settlemint/sdk/blob/v2.5.
|
|
601
|
+
Defined in: [sdk/viem/src/custom-actions/create-wallet-verification.action.ts:51](https://github.com/settlemint/sdk/blob/v2.5.6/sdk/viem/src/custom-actions/create-wallet-verification.action.ts#L51)
|
|
602
602
|
|
|
603
603
|
Union type of all possible wallet verification information types.
|
|
604
604
|
|
|
@@ -608,7 +608,7 @@ Union type of all possible wallet verification information types.
|
|
|
608
608
|
|
|
609
609
|
> `const` **ClientOptionsSchema**: `ZodObject`\<\{ `accessToken`: `ZodOptional`\<`ZodString`\>; `chainId`: `ZodString`; `chainName`: `ZodString`; `httpTransportConfig`: `ZodOptional`\<`ZodAny`\>; `rpcUrl`: `ZodUnion`\<readonly \[`ZodString`, `ZodString`\]\>; \}, `$strip`\>
|
|
610
610
|
|
|
611
|
-
Defined in: [sdk/viem/src/viem.ts:25](https://github.com/settlemint/sdk/blob/v2.5.
|
|
611
|
+
Defined in: [sdk/viem/src/viem.ts:25](https://github.com/settlemint/sdk/blob/v2.5.6/sdk/viem/src/viem.ts#L25)
|
|
612
612
|
|
|
613
613
|
Schema for the viem client options.
|
|
614
614
|
|
|
@@ -618,7 +618,7 @@ Schema for the viem client options.
|
|
|
618
618
|
|
|
619
619
|
> `const` **GetChainIdOptionsSchema**: `ZodObject`\<\{ `accessToken`: `ZodOptional`\<`ZodString`\>; `httpTransportConfig`: `ZodOptional`\<`ZodAny`\>; `rpcUrl`: `ZodUnion`\<readonly \[`ZodString`, `ZodString`\]\>; \}, `$strip`\>
|
|
620
620
|
|
|
621
|
-
Defined in: [sdk/viem/src/viem.ts:180](https://github.com/settlemint/sdk/blob/v2.5.
|
|
621
|
+
Defined in: [sdk/viem/src/viem.ts:180](https://github.com/settlemint/sdk/blob/v2.5.6/sdk/viem/src/viem.ts#L180)
|
|
622
622
|
|
|
623
623
|
Schema for the viem client options.
|
|
624
624
|
|
package/dist/browser/viem.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"viem.js","names":["client: Client","args: CreateWalletParameters","client: Client","args: CreateWalletVerificationParameters","client: Client","args: CreateWalletVerificationChallengesParameters","client: Client","args: DeleteWalletVerificationParameters","client: Client","args: GetWalletVerificationsParameters","client: Client","args: VerifyWalletVerificationChallengeParameters","options: ClientOptions","validatedOptions: ClientOptions","verificationOptions?: WalletVerificationOptions","options: GetChainIdOptions","validatedOptions: GetChainIdOptions"],"sources":["../../src/custom-actions/create-wallet.action.ts","../../src/custom-actions/create-wallet-verification.action.ts","../../src/custom-actions/create-wallet-verification-challenges.action.ts","../../src/custom-actions/delete-wallet-verification.action.ts","../../src/custom-actions/get-wallet-verifications.action.ts","../../src/custom-actions/verify-wallet-verification-challenge.action.ts","../../src/custom-actions/types/wallet-verification.enum.ts","../../src/viem.ts"],"sourcesContent":["import type { Client } from \"viem\";\n\n/**\n * Information about the wallet to be created.\n */\nexport interface WalletInfo {\n /** The name of the wallet. */\n name: string;\n}\n\n/**\n * Parameters for creating a wallet.\n */\nexport interface CreateWalletParameters {\n /** The unique name of the key vault where the wallet will be created. */\n keyVaultId: string;\n /** Information about the wallet to be created. */\n walletInfo: WalletInfo;\n}\n\n/**\n * Response from creating a wallet.\n */\nexport interface CreateWalletResponse {\n /** The unique identifier of the wallet. */\n id: string;\n /** The name of the wallet. */\n name: string;\n /** The blockchain address of the wallet. */\n address: string;\n /** The HD derivation path used to create the wallet. */\n derivationPath: string;\n}\n\n/**\n * RPC schema for wallet creation.\n */\ntype WalletRpcSchema = {\n Method: \"user_createWallet\";\n Parameters: [keyVaultId: string, walletInfo: WalletInfo];\n ReturnType: CreateWalletResponse[];\n};\n\n/**\n * Creates a wallet action for the given client.\n * @param client - The viem client to use for the request.\n * @returns An object with a createWallet method.\n */\nexport function createWallet(client: Client) {\n return {\n /**\n * Creates a new wallet in the specified key vault.\n * @param args - The parameters for creating a wallet.\n * @returns A promise that resolves to an array of created wallet responses.\n */\n createWallet(args: CreateWalletParameters): Promise<CreateWalletResponse[]> {\n return client.request<WalletRpcSchema>({\n method: \"user_createWallet\",\n params: [args.keyVaultId, args.walletInfo],\n });\n },\n };\n}\n","import type { Client } from \"viem\";\nimport type { OTPAlgorithm, WalletVerificationType } from \"./types/wallet-verification.enum.js\";\n\n/**\n * Base interface for wallet verification information.\n */\ntype BaseWalletVerificationInfo = {\n /** The name of the verification method. */\n name: string;\n /** The type of verification method. */\n verificationType: WalletVerificationType;\n};\n\n/**\n * Information for PIN code verification.\n */\nexport interface WalletPincodeVerificationInfo extends BaseWalletVerificationInfo {\n /** The type of verification method. */\n verificationType: WalletVerificationType.PINCODE;\n /** The PIN code to use for verification. */\n pincode: string;\n}\n\n/**\n * Information for One-Time Password (OTP) verification.\n */\nexport interface WalletOTPVerificationInfo extends BaseWalletVerificationInfo {\n /** The type of verification method. */\n verificationType: WalletVerificationType.OTP;\n /** The hash algorithm to use for OTP generation. */\n algorithm?: OTPAlgorithm;\n /** The number of digits in the OTP code. */\n digits?: number;\n /** The time period in seconds for OTP validity. */\n period?: number;\n /** The issuer of the OTP. */\n issuer?: string;\n}\n\n/**\n * Information for secret recovery codes verification.\n */\nexport interface WalletSecretCodesVerificationInfo extends BaseWalletVerificationInfo {\n /** The type of verification method. */\n verificationType: WalletVerificationType.SECRET_CODES;\n}\n\n/**\n * Union type of all possible wallet verification information types.\n */\nexport type WalletVerificationInfo =\n | WalletPincodeVerificationInfo\n | WalletOTPVerificationInfo\n | WalletSecretCodesVerificationInfo;\n\n/**\n * Parameters for creating a wallet verification.\n */\nexport interface CreateWalletVerificationParameters {\n /** The wallet address for which to create the verification. */\n userWalletAddress: string;\n /** The verification information to create. */\n walletVerificationInfo: WalletVerificationInfo;\n}\n\n/**\n * Response from creating a wallet verification.\n */\nexport interface CreateWalletVerificationResponse {\n /** The unique identifier of the verification. */\n id: string;\n /** The name of the verification method. */\n name: string;\n /** The type of verification method. */\n verificationType: WalletVerificationType;\n /** Additional parameters specific to the verification type. */\n parameters: Record<string, string>;\n}\n\n/**\n * RPC schema for creating a wallet verification.\n */\ntype WalletRpcSchema = {\n Method: \"user_createWalletVerification\";\n Parameters: [userWalletAddress: string, walletVerificationInfo: WalletVerificationInfo];\n ReturnType: CreateWalletVerificationResponse[];\n};\n\n/**\n * Creates a wallet verification action for the given client.\n * @param client - The viem client to use for the request.\n * @returns An object with a createWalletVerification method.\n */\nexport function createWalletVerification(client: Client) {\n return {\n /**\n * Creates a new wallet verification.\n * @param args - The parameters for creating the verification.\n * @returns A promise that resolves to an array of created wallet verification responses.\n */\n createWalletVerification(args: CreateWalletVerificationParameters): Promise<CreateWalletVerificationResponse[]> {\n return client.request<WalletRpcSchema>({\n method: \"user_createWalletVerification\",\n params: [args.userWalletAddress, args.walletVerificationInfo],\n });\n },\n };\n}\n","import type { Client } from \"viem\";\nimport type { WalletVerificationType } from \"./types/wallet-verification.enum.js\";\nimport type { AddressOrObject } from \"./verify-wallet-verification-challenge.action.js\";\n\n/**\n * Parameters for creating wallet verification challenges.\n */\nexport interface CreateWalletVerificationChallengesParameters {\n /** The wallet address or object containing wallet address and optional verification ID. */\n addressOrObject: AddressOrObject;\n}\n\n/**\n * Represents a wallet verification challenge.\n */\nexport interface WalletVerificationChallenge {\n /** The unique identifier of the challenge. */\n id: string;\n /** The name of the challenge. */\n name: string;\n /** The type of verification required. */\n verificationType: WalletVerificationType;\n /** The challenge parameters specific to the verification type. */\n challenge: Record<string, string>;\n}\n\n/**\n * Response from creating wallet verification challenges.\n */\nexport type CreateWalletVerificationChallengesResponse = WalletVerificationChallenge[];\n\n/**\n * RPC schema for creating wallet verification challenges.\n */\ntype WalletRpcSchema = {\n Method: \"user_createWalletVerificationChallenges\";\n Parameters: [addressOrObject: AddressOrObject];\n ReturnType: CreateWalletVerificationChallengesResponse;\n};\n\n/**\n * Creates a wallet verification challenges action for the given client.\n * @param client - The viem client to use for the request.\n * @returns An object with a createWalletVerificationChallenges method.\n */\nexport function createWalletVerificationChallenges(client: Client) {\n return {\n /**\n * Creates verification challenges for a wallet.\n * @param args - The parameters for creating the challenges.\n * @returns A promise that resolves to an array of wallet verification challenges.\n */\n createWalletVerificationChallenges(\n args: CreateWalletVerificationChallengesParameters,\n ): Promise<CreateWalletVerificationChallengesResponse> {\n return client.request<WalletRpcSchema>({\n method: \"user_createWalletVerificationChallenges\",\n params: [args.addressOrObject],\n });\n },\n };\n}\n","import type { Client } from \"viem\";\n\n/**\n * Parameters for deleting a wallet verification.\n */\nexport interface DeleteWalletVerificationParameters {\n /** The wallet address for which to delete the verification. */\n userWalletAddress: string;\n /** The unique identifier of the verification to delete. */\n verificationId: string;\n}\n\n/**\n * Response from deleting a wallet verification.\n */\nexport interface DeleteWalletVerificationResponse {\n /** Whether the deletion was successful. */\n success: boolean;\n}\n\n/**\n * RPC schema for deleting a wallet verification.\n */\ntype WalletRpcSchema = {\n Method: \"user_deleteWalletVerification\";\n Parameters: [userWalletAddress: string, verificationId: string];\n ReturnType: DeleteWalletVerificationResponse[];\n};\n\n/**\n * Creates a wallet verification deletion action for the given client.\n * @param client - The viem client to use for the request.\n * @returns An object with a deleteWalletVerification method.\n */\nexport function deleteWalletVerification(client: Client) {\n return {\n /**\n * Deletes a wallet verification.\n * @param args - The parameters for deleting the verification.\n * @returns A promise that resolves to an array of deletion results.\n */\n deleteWalletVerification(args: DeleteWalletVerificationParameters): Promise<DeleteWalletVerificationResponse[]> {\n return client.request<WalletRpcSchema>({\n method: \"user_deleteWalletVerification\",\n params: [args.userWalletAddress, args.verificationId],\n });\n },\n };\n}\n","import type { Client } from \"viem\";\nimport type { WalletVerificationType } from \"./types/wallet-verification.enum.js\";\n\n/**\n * Parameters for getting wallet verifications.\n */\nexport interface GetWalletVerificationsParameters {\n /** The wallet address for which to fetch verifications. */\n userWalletAddress: string;\n}\n\n/**\n * Represents a wallet verification.\n */\nexport interface WalletVerification {\n /** The unique identifier of the verification. */\n id: string;\n /** The name of the verification method. */\n name: string;\n /** The type of verification method. */\n verificationType: WalletVerificationType;\n}\n\n/**\n * Response from getting wallet verifications.\n */\nexport type GetWalletVerificationsResponse = WalletVerification[];\n\n/**\n * RPC schema for getting wallet verifications.\n */\ntype WalletRpcSchema = {\n Method: \"user_walletVerifications\";\n Parameters: [userWalletAddress: string];\n ReturnType: GetWalletVerificationsResponse;\n};\n\n/**\n * Creates a wallet verifications retrieval action for the given client.\n * @param client - The viem client to use for the request.\n * @returns An object with a getWalletVerifications method.\n */\nexport function getWalletVerifications(client: Client) {\n return {\n /**\n * Gets all verifications for a wallet.\n * @param args - The parameters for getting the verifications.\n * @returns A promise that resolves to an array of wallet verifications.\n */\n getWalletVerifications(args: GetWalletVerificationsParameters): Promise<GetWalletVerificationsResponse> {\n return client.request<WalletRpcSchema>({\n method: \"user_walletVerifications\",\n params: [args.userWalletAddress],\n });\n },\n };\n}\n","import type { Client } from \"viem\";\n\n/**\n * Represents either a wallet address string or an object containing wallet address and optional verification ID.\n */\nexport type AddressOrObject =\n | string\n | {\n userWalletAddress: string;\n verificationId?: string;\n };\n\n/**\n * Parameters for verifying a wallet verification challenge.\n */\nexport interface VerifyWalletVerificationChallengeParameters {\n /** The wallet address or object containing wallet address and optional verification ID. */\n addressOrObject: AddressOrObject;\n /** The response to the verification challenge. */\n challengeResponse: string;\n}\n\n/**\n * Result of a wallet verification challenge.\n */\nexport interface VerificationResult {\n /** Whether the verification was successful. */\n verified: boolean;\n}\n\n/**\n * Response from verifying a wallet verification challenge.\n */\nexport type VerifyWalletVerificationChallengeResponse = VerificationResult[];\n\n/**\n * RPC schema for wallet verification challenge verification.\n */\ntype WalletRpcSchema = {\n Method: \"user_verifyWalletVerificationChallenge\";\n Parameters: [addressOrObject: AddressOrObject, challengeResponse: string];\n ReturnType: VerifyWalletVerificationChallengeResponse;\n};\n\n/**\n * Creates a wallet verification challenge verification action for the given client.\n * @param client - The viem client to use for the request.\n * @returns An object with a verifyWalletVerificationChallenge method.\n */\nexport function verifyWalletVerificationChallenge(client: Client) {\n return {\n /**\n * Verifies a wallet verification challenge.\n * @param args - The parameters for verifying the challenge.\n * @returns A promise that resolves to an array of verification results.\n */\n verifyWalletVerificationChallenge(\n args: VerifyWalletVerificationChallengeParameters,\n ): Promise<VerifyWalletVerificationChallengeResponse> {\n return client.request<WalletRpcSchema>({\n method: \"user_verifyWalletVerificationChallenge\",\n params: [args.addressOrObject, args.challengeResponse],\n });\n },\n };\n}\n","/**\n * Types of wallet verification methods supported by the system.\n * Used to identify different verification mechanisms when creating or managing wallet verifications.\n */\nexport enum WalletVerificationType {\n /** PIN code verification method */\n PINCODE = \"PINCODE\",\n /** One-Time Password verification method */\n OTP = \"OTP\",\n /** Secret recovery codes verification method */\n SECRET_CODES = \"SECRET_CODES\",\n}\n\n/**\n * Supported hash algorithms for One-Time Password (OTP) verification.\n * These algorithms determine the cryptographic function used to generate OTP codes.\n */\nexport enum OTPAlgorithm {\n /** SHA-1 hash algorithm */\n SHA1 = \"SHA1\",\n /** SHA-224 hash algorithm */\n SHA224 = \"SHA224\",\n /** SHA-256 hash algorithm */\n SHA256 = \"SHA256\",\n /** SHA-384 hash algorithm */\n SHA384 = \"SHA384\",\n /** SHA-512 hash algorithm */\n SHA512 = \"SHA512\",\n /** SHA3-224 hash algorithm */\n SHA3_224 = \"SHA3-224\",\n /** SHA3-256 hash algorithm */\n SHA3_256 = \"SHA3-256\",\n /** SHA3-384 hash algorithm */\n SHA3_384 = \"SHA3-384\",\n /** SHA3-512 hash algorithm */\n SHA3_512 = \"SHA3-512\",\n}\n","import { appendHeaders } from \"@settlemint/sdk-utils/http\";\nimport { ensureServer } from \"@settlemint/sdk-utils/runtime\";\nimport { ApplicationAccessTokenSchema, UrlOrPathSchema, validate } from \"@settlemint/sdk-utils/validation\";\nimport {\n createPublicClient,\n createWalletClient,\n defineChain,\n type HttpTransportConfig,\n http,\n publicActions,\n type Chain as ViemChain,\n} from \"viem\";\nimport * as chains from \"viem/chains\";\nimport { z } from \"zod\";\nimport { createWallet } from \"./custom-actions/create-wallet.action.js\";\nimport { createWalletVerification } from \"./custom-actions/create-wallet-verification.action.js\";\nimport { createWalletVerificationChallenges } from \"./custom-actions/create-wallet-verification-challenges.action.js\";\nimport { deleteWalletVerification } from \"./custom-actions/delete-wallet-verification.action.js\";\nimport { getWalletVerifications } from \"./custom-actions/get-wallet-verifications.action.js\";\nimport { verifyWalletVerificationChallenge } from \"./custom-actions/verify-wallet-verification-challenge.action.js\";\n\n/**\n * Schema for the viem client options.\n */\nexport const ClientOptionsSchema = z.object({\n /**\n * The access token\n */\n accessToken: ApplicationAccessTokenSchema.optional(),\n /**\n * The chain id\n */\n chainId: z.string(),\n /**\n * The chain name\n */\n chainName: z.string(),\n /**\n * The json rpc url\n */\n rpcUrl: UrlOrPathSchema,\n /**\n * The http transport config\n */\n httpTransportConfig: z.any().optional(),\n});\n\n/**\n * Type representing the validated client options.\n */\nexport type ClientOptions = Omit<z.infer<typeof ClientOptionsSchema>, \"httpTransportConfig\"> & {\n httpTransportConfig?: HttpTransportConfig;\n};\n\n/**\n * Get a public client. Use this if you need to read from the blockchain.\n * @param options - The options for the public client.\n * @returns The public client. see {@link https://viem.sh/docs/clients/public}\n * @example\n * ```ts\n * import { getPublicClient } from '@settlemint/sdk-viem';\n *\n * const publicClient = getPublicClient({\n * accessToken: process.env.SETTLEMINT_ACCESS_TOKEN,\n * chainId: process.env.SETTLEMINT_BLOCKCHAIN_NETWORK_CHAIN_ID!,\n * chainName: process.env.SETTLEMINT_BLOCKCHAIN_NETWORK!,\n * rpcUrl: process.env.SETTLEMINT_BLOCKCHAIN_NODE_OR_LOAD_BALANCER_JSON_RPC_ENDPOINT!,\n * });\n *\n * // Get the block number\n * const block = await publicClient.getBlockNumber();\n * console.log(block);\n * ```\n */\nexport const getPublicClient = (options: ClientOptions) => {\n ensureServer();\n const validatedOptions: ClientOptions = validate(ClientOptionsSchema, options);\n return createPublicClient({\n chain: getChain({\n chainId: validatedOptions.chainId,\n chainName: validatedOptions.chainName,\n rpcUrl: validatedOptions.rpcUrl,\n }),\n transport: http(validatedOptions.rpcUrl, {\n batch: true,\n timeout: 60_000,\n ...validatedOptions.httpTransportConfig,\n fetchOptions: {\n ...validatedOptions?.httpTransportConfig?.fetchOptions,\n headers: appendHeaders(validatedOptions?.httpTransportConfig?.fetchOptions?.headers, {\n \"x-auth-token\": validatedOptions.accessToken,\n }),\n },\n }),\n });\n};\n\n/**\n * The options for the wallet client.\n */\nexport interface WalletVerificationOptions {\n /**\n * The verification id (used for HD wallets), if not provided, the challenge response will be validated against all active verifications.\n */\n verificationId?: string;\n /**\n * The challenge response (used for HD wallets)\n */\n challengeResponse: string;\n}\n\n/**\n * Get a wallet client. Use this if you need to write to the blockchain.\n * @param options - The options for the wallet client.\n * @returns A function that returns a wallet client. The function can be called with verification options for HD wallets. see {@link https://viem.sh/docs/clients/wallet}\n * @example\n * ```ts\n * import { getWalletClient } from '@settlemint/sdk-viem';\n * import { parseAbi } from \"viem\";\n *\n * const walletClient = getWalletClient({\n * accessToken: process.env.SETTLEMINT_ACCESS_TOKEN,\n * chainId: process.env.SETTLEMINT_BLOCKCHAIN_NETWORK_CHAIN_ID!,\n * chainName: process.env.SETTLEMINT_BLOCKCHAIN_NETWORK!,\n * rpcUrl: process.env.SETTLEMINT_BLOCKCHAIN_NODE_OR_LOAD_BALANCER_JSON_RPC_ENDPOINT!,\n * });\n *\n * // Get the chain id\n * const chainId = await walletClient().getChainId();\n * console.log(chainId);\n *\n * // write to the blockchain\n * const transactionHash = await walletClient().writeContract({\n * account: \"0x0000000000000000000000000000000000000000\",\n * address: \"0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2\",\n * abi: parseAbi([\"function mint(uint32 tokenId) nonpayable\"]),\n * functionName: \"mint\",\n * args: [69420],\n * });\n * console.log(transactionHash);\n * ```\n */\nexport const getWalletClient = (options: ClientOptions) => {\n ensureServer();\n const validatedOptions: ClientOptions = validate(ClientOptionsSchema, options);\n const chain = getChain({\n chainId: validatedOptions.chainId,\n chainName: validatedOptions.chainName,\n rpcUrl: validatedOptions.rpcUrl,\n });\n return (verificationOptions?: WalletVerificationOptions) =>\n createWalletClient({\n chain: chain,\n transport: http(validatedOptions.rpcUrl, {\n batch: true,\n timeout: 60_000,\n ...validatedOptions.httpTransportConfig,\n fetchOptions: {\n ...validatedOptions?.httpTransportConfig?.fetchOptions,\n headers: appendHeaders(validatedOptions?.httpTransportConfig?.fetchOptions?.headers, {\n \"x-auth-token\": validatedOptions.accessToken,\n \"x-auth-challenge-response\": verificationOptions?.challengeResponse ?? \"\",\n \"x-auth-verification-id\": verificationOptions?.verificationId ?? \"\",\n }),\n },\n }),\n })\n .extend(publicActions)\n .extend(createWallet)\n .extend(getWalletVerifications)\n .extend(createWalletVerification)\n .extend(deleteWalletVerification)\n .extend(createWalletVerificationChallenges)\n .extend(verifyWalletVerificationChallenge);\n};\n\n/**\n * Schema for the viem client options.\n */\nexport const GetChainIdOptionsSchema = z.object({\n /**\n * The access token\n */\n accessToken: ApplicationAccessTokenSchema.optional(),\n /**\n * The json rpc url\n */\n rpcUrl: UrlOrPathSchema,\n /**\n * The http transport config\n */\n httpTransportConfig: z.any().optional(),\n});\n\n/**\n * Type representing the validated get chain id options.\n */\nexport type GetChainIdOptions = Omit<z.infer<typeof GetChainIdOptionsSchema>, \"httpTransportConfig\"> & {\n httpTransportConfig?: HttpTransportConfig;\n};\n\n/**\n * Get the chain id of a blockchain network.\n * @param options - The options for the public client.\n * @returns The chain id.\n * @example\n * ```ts\n * import { getChainId } from '@settlemint/sdk-viem';\n *\n * const chainId = await getChainId({\n * accessToken: process.env.SETTLEMINT_ACCESS_TOKEN,\n * rpcUrl: process.env.SETTLEMINT_BLOCKCHAIN_NODE_OR_LOAD_BALANCER_JSON_RPC_ENDPOINT!,\n * });\n * console.log(chainId);\n * ```\n */\nexport async function getChainId(options: GetChainIdOptions): Promise<number> {\n ensureServer();\n const validatedOptions: GetChainIdOptions = validate(GetChainIdOptionsSchema, options);\n const client = createPublicClient({\n transport: http(validatedOptions.rpcUrl, {\n ...validatedOptions.httpTransportConfig,\n fetchOptions: {\n ...validatedOptions?.httpTransportConfig?.fetchOptions,\n headers: appendHeaders(validatedOptions?.httpTransportConfig?.fetchOptions?.headers, {\n \"x-auth-token\": validatedOptions.accessToken,\n }),\n },\n }),\n });\n\n return client.getChainId();\n}\n\nfunction getChain({ chainId, chainName, rpcUrl }: Pick<ClientOptions, \"chainId\" | \"chainName\" | \"rpcUrl\">): ViemChain {\n const knownChain = Object.values(chains).find((chain) => chain.id.toString() === chainId);\n return (\n knownChain ??\n defineChain({\n id: Number(chainId),\n name: chainName,\n rpcUrls: {\n default: {\n http: [rpcUrl],\n },\n },\n nativeCurrency: {\n decimals: 18,\n name: \"Ether\",\n symbol: \"ETH\",\n },\n })\n );\n}\n\nexport type {\n CreateWalletParameters,\n CreateWalletResponse,\n WalletInfo,\n} from \"./custom-actions/create-wallet.action.js\";\nexport type {\n CreateWalletVerificationParameters,\n CreateWalletVerificationResponse,\n WalletOTPVerificationInfo,\n WalletPincodeVerificationInfo,\n WalletSecretCodesVerificationInfo,\n WalletVerificationInfo,\n} from \"./custom-actions/create-wallet-verification.action.js\";\nexport type {\n CreateWalletVerificationChallengesParameters,\n CreateWalletVerificationChallengesResponse,\n WalletVerificationChallenge,\n} from \"./custom-actions/create-wallet-verification-challenges.action.js\";\nexport type {\n DeleteWalletVerificationParameters,\n DeleteWalletVerificationResponse,\n} from \"./custom-actions/delete-wallet-verification.action.js\";\nexport type {\n GetWalletVerificationsParameters,\n GetWalletVerificationsResponse,\n WalletVerification,\n} from \"./custom-actions/get-wallet-verifications.action.js\";\nexport { OTPAlgorithm, WalletVerificationType } from \"./custom-actions/types/wallet-verification.enum.js\";\nexport type {\n AddressOrObject,\n VerificationResult,\n VerifyWalletVerificationChallengeParameters,\n VerifyWalletVerificationChallengeResponse,\n} from \"./custom-actions/verify-wallet-verification-challenge.action.js\";\n"],"mappings":";;;;;;;;;;;;;;AAgDA,SAAgB,aAAaA,QAAgB;AAC3C,QAAO,EAML,aAAaC,MAA+D;AAC1E,SAAO,OAAO,QAAyB;GACrC,QAAQ;GACR,QAAQ,CAAC,KAAK,YAAY,KAAK,UAAW;EAC3C,EAAC;CACH,EACF;AACF;;;;;;;;;AC+BD,SAAgB,yBAAyBC,QAAgB;AACvD,QAAO,EAML,yBAAyBC,MAAuF;AAC9G,SAAO,OAAO,QAAyB;GACrC,QAAQ;GACR,QAAQ,CAAC,KAAK,mBAAmB,KAAK,sBAAuB;EAC9D,EAAC;CACH,EACF;AACF;;;;;;;;;AC9DD,SAAgB,mCAAmCC,QAAgB;AACjE,QAAO,EAML,mCACEC,MACqD;AACrD,SAAO,OAAO,QAAyB;GACrC,QAAQ;GACR,QAAQ,CAAC,KAAK,eAAgB;EAC/B,EAAC;CACH,EACF;AACF;;;;;;;;;AC3BD,SAAgB,yBAAyBC,QAAgB;AACvD,QAAO,EAML,yBAAyBC,MAA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S,SAAS,EAAE,SAAS,WAAW,QAAiE,EAAa;CACpH,MAAM,aAAa,OAAO,OAAO,OAAO,CAAC,KAAK,CAAC,UAAU,MAAM,GAAG,UAAU,KAAK,QAAQ;AACzF,QACE,cACA,YAAY;EACV,IAAI,OAAO,QAAQ;EACnB,MAAM;EACN,SAAS,EACP,SAAS,EACP,MAAM,CAAC,MAAO,EACf,EACF;EACD,gBAAgB;GACd,UAAU;GACV,MAAM;GACN,QAAQ;EACT;CACF,EAAC;AAEL"}
|
|
1
|
+
{"version":3,"file":"viem.js","names":["client: Client","args: CreateWalletParameters","client: Client","args: CreateWalletVerificationParameters","client: Client","args: CreateWalletVerificationChallengesParameters","client: Client","args: DeleteWalletVerificationParameters","client: Client","args: GetWalletVerificationsParameters","client: Client","args: VerifyWalletVerificationChallengeParameters","options: ClientOptions","validatedOptions: ClientOptions","verificationOptions?: WalletVerificationOptions","options: GetChainIdOptions","validatedOptions: GetChainIdOptions"],"sources":["../../src/custom-actions/create-wallet.action.ts","../../src/custom-actions/create-wallet-verification.action.ts","../../src/custom-actions/create-wallet-verification-challenges.action.ts","../../src/custom-actions/delete-wallet-verification.action.ts","../../src/custom-actions/get-wallet-verifications.action.ts","../../src/custom-actions/verify-wallet-verification-challenge.action.ts","../../src/custom-actions/types/wallet-verification.enum.ts","../../src/viem.ts"],"sourcesContent":["import type { Client } from \"viem\";\n\n/**\n * Information about the wallet to be created.\n */\nexport interface WalletInfo {\n /** The name of the wallet. */\n name: string;\n}\n\n/**\n * Parameters for creating a wallet.\n */\nexport interface CreateWalletParameters {\n /** The unique name of the key vault where the wallet will be created. */\n keyVaultId: string;\n /** Information about the wallet to be created. */\n walletInfo: WalletInfo;\n}\n\n/**\n * Response from creating a wallet.\n */\nexport interface CreateWalletResponse {\n /** The unique identifier of the wallet. */\n id: string;\n /** The name of the wallet. */\n name: string;\n /** The blockchain address of the wallet. */\n address: string;\n /** The HD derivation path used to create the wallet. */\n derivationPath: string;\n}\n\n/**\n * RPC schema for wallet creation.\n */\ntype WalletRpcSchema = {\n Method: \"user_createWallet\";\n Parameters: [keyVaultId: string, walletInfo: WalletInfo];\n ReturnType: CreateWalletResponse[];\n};\n\n/**\n * Creates a wallet action for the given client.\n * @param client - The viem client to use for the request.\n * @returns An object with a createWallet method.\n */\nexport function createWallet(client: Client) {\n return {\n /**\n * Creates a new wallet in the specified key vault.\n * @param args - The parameters for creating a wallet.\n * @returns A promise that resolves to an array of created wallet responses.\n */\n createWallet(args: CreateWalletParameters): Promise<CreateWalletResponse[]> {\n return client.request<WalletRpcSchema>({\n method: \"user_createWallet\",\n params: [args.keyVaultId, args.walletInfo],\n });\n },\n };\n}\n","import type { Client } from \"viem\";\nimport type { OTPAlgorithm, WalletVerificationType } from \"./types/wallet-verification.enum.js\";\n\n/**\n * Base interface for wallet verification information.\n */\ntype BaseWalletVerificationInfo = {\n /** The name of the verification method. */\n name: string;\n /** The type of verification method. */\n verificationType: WalletVerificationType;\n};\n\n/**\n * Information for PIN code verification.\n */\nexport interface WalletPincodeVerificationInfo extends BaseWalletVerificationInfo {\n /** The type of verification method. */\n verificationType: WalletVerificationType.PINCODE;\n /** The PIN code to use for verification. */\n pincode: string;\n}\n\n/**\n * Information for One-Time Password (OTP) verification.\n */\nexport interface WalletOTPVerificationInfo extends BaseWalletVerificationInfo {\n /** The type of verification method. */\n verificationType: WalletVerificationType.OTP;\n /** The hash algorithm to use for OTP generation. */\n algorithm?: OTPAlgorithm;\n /** The number of digits in the OTP code. */\n digits?: number;\n /** The time period in seconds for OTP validity. */\n period?: number;\n /** The issuer of the OTP. */\n issuer?: string;\n}\n\n/**\n * Information for secret recovery codes verification.\n */\nexport interface WalletSecretCodesVerificationInfo extends BaseWalletVerificationInfo {\n /** The type of verification method. */\n verificationType: WalletVerificationType.SECRET_CODES;\n}\n\n/**\n * Union type of all possible wallet verification information types.\n */\nexport type WalletVerificationInfo =\n | WalletPincodeVerificationInfo\n | WalletOTPVerificationInfo\n | WalletSecretCodesVerificationInfo;\n\n/**\n * Parameters for creating a wallet verification.\n */\nexport interface CreateWalletVerificationParameters {\n /** The wallet address for which to create the verification. */\n userWalletAddress: string;\n /** The verification information to create. */\n walletVerificationInfo: WalletVerificationInfo;\n}\n\n/**\n * Response from creating a wallet verification.\n */\nexport interface CreateWalletVerificationResponse {\n /** The unique identifier of the verification. */\n id: string;\n /** The name of the verification method. */\n name: string;\n /** The type of verification method. */\n verificationType: WalletVerificationType;\n /** Additional parameters specific to the verification type. */\n parameters: Record<string, string>;\n}\n\n/**\n * RPC schema for creating a wallet verification.\n */\ntype WalletRpcSchema = {\n Method: \"user_createWalletVerification\";\n Parameters: [userWalletAddress: string, walletVerificationInfo: WalletVerificationInfo];\n ReturnType: CreateWalletVerificationResponse[];\n};\n\n/**\n * Creates a wallet verification action for the given client.\n * @param client - The viem client to use for the request.\n * @returns An object with a createWalletVerification method.\n */\nexport function createWalletVerification(client: Client) {\n return {\n /**\n * Creates a new wallet verification.\n * @param args - The parameters for creating the verification.\n * @returns A promise that resolves to an array of created wallet verification responses.\n */\n createWalletVerification(args: CreateWalletVerificationParameters): Promise<CreateWalletVerificationResponse[]> {\n return client.request<WalletRpcSchema>({\n method: \"user_createWalletVerification\",\n params: [args.userWalletAddress, args.walletVerificationInfo],\n });\n },\n };\n}\n","import type { Client } from \"viem\";\nimport type { WalletVerificationType } from \"./types/wallet-verification.enum.js\";\nimport type { AddressOrObject } from \"./verify-wallet-verification-challenge.action.js\";\n\n/**\n * Parameters for creating wallet verification challenges.\n */\nexport interface CreateWalletVerificationChallengesParameters {\n /** The wallet address or object containing wallet address and optional verification ID. */\n addressOrObject: AddressOrObject;\n}\n\n/**\n * Represents a wallet verification challenge.\n */\nexport interface WalletVerificationChallenge {\n /** The unique identifier of the challenge. */\n id: string;\n /** The name of the challenge. */\n name: string;\n /** The type of verification required. */\n verificationType: WalletVerificationType;\n /** The challenge parameters specific to the verification type. */\n challenge: Record<string, string>;\n}\n\n/**\n * Response from creating wallet verification challenges.\n */\nexport type CreateWalletVerificationChallengesResponse = WalletVerificationChallenge[];\n\n/**\n * RPC schema for creating wallet verification challenges.\n */\ntype WalletRpcSchema = {\n Method: \"user_createWalletVerificationChallenges\";\n Parameters: [addressOrObject: AddressOrObject];\n ReturnType: CreateWalletVerificationChallengesResponse;\n};\n\n/**\n * Creates a wallet verification challenges action for the given client.\n * @param client - The viem client to use for the request.\n * @returns An object with a createWalletVerificationChallenges method.\n */\nexport function createWalletVerificationChallenges(client: Client) {\n return {\n /**\n * Creates verification challenges for a wallet.\n * @param args - The parameters for creating the challenges.\n * @returns A promise that resolves to an array of wallet verification challenges.\n */\n createWalletVerificationChallenges(\n args: CreateWalletVerificationChallengesParameters,\n ): Promise<CreateWalletVerificationChallengesResponse> {\n return client.request<WalletRpcSchema>({\n method: \"user_createWalletVerificationChallenges\",\n params: [args.addressOrObject],\n });\n },\n };\n}\n","import type { Client } from \"viem\";\n\n/**\n * Parameters for deleting a wallet verification.\n */\nexport interface DeleteWalletVerificationParameters {\n /** The wallet address for which to delete the verification. */\n userWalletAddress: string;\n /** The unique identifier of the verification to delete. */\n verificationId: string;\n}\n\n/**\n * Response from deleting a wallet verification.\n */\nexport interface DeleteWalletVerificationResponse {\n /** Whether the deletion was successful. */\n success: boolean;\n}\n\n/**\n * RPC schema for deleting a wallet verification.\n */\ntype WalletRpcSchema = {\n Method: \"user_deleteWalletVerification\";\n Parameters: [userWalletAddress: string, verificationId: string];\n ReturnType: DeleteWalletVerificationResponse[];\n};\n\n/**\n * Creates a wallet verification deletion action for the given client.\n * @param client - The viem client to use for the request.\n * @returns An object with a deleteWalletVerification method.\n */\nexport function deleteWalletVerification(client: Client) {\n return {\n /**\n * Deletes a wallet verification.\n * @param args - The parameters for deleting the verification.\n * @returns A promise that resolves to an array of deletion results.\n */\n deleteWalletVerification(args: DeleteWalletVerificationParameters): Promise<DeleteWalletVerificationResponse[]> {\n return client.request<WalletRpcSchema>({\n method: \"user_deleteWalletVerification\",\n params: [args.userWalletAddress, args.verificationId],\n });\n },\n };\n}\n","import type { Client } from \"viem\";\nimport type { WalletVerificationType } from \"./types/wallet-verification.enum.js\";\n\n/**\n * Parameters for getting wallet verifications.\n */\nexport interface GetWalletVerificationsParameters {\n /** The wallet address for which to fetch verifications. */\n userWalletAddress: string;\n}\n\n/**\n * Represents a wallet verification.\n */\nexport interface WalletVerification {\n /** The unique identifier of the verification. */\n id: string;\n /** The name of the verification method. */\n name: string;\n /** The type of verification method. */\n verificationType: WalletVerificationType;\n}\n\n/**\n * Response from getting wallet verifications.\n */\nexport type GetWalletVerificationsResponse = WalletVerification[];\n\n/**\n * RPC schema for getting wallet verifications.\n */\ntype WalletRpcSchema = {\n Method: \"user_walletVerifications\";\n Parameters: [userWalletAddress: string];\n ReturnType: GetWalletVerificationsResponse;\n};\n\n/**\n * Creates a wallet verifications retrieval action for the given client.\n * @param client - The viem client to use for the request.\n * @returns An object with a getWalletVerifications method.\n */\nexport function getWalletVerifications(client: Client) {\n return {\n /**\n * Gets all verifications for a wallet.\n * @param args - The parameters for getting the verifications.\n * @returns A promise that resolves to an array of wallet verifications.\n */\n getWalletVerifications(args: GetWalletVerificationsParameters): Promise<GetWalletVerificationsResponse> {\n return client.request<WalletRpcSchema>({\n method: \"user_walletVerifications\",\n params: [args.userWalletAddress],\n });\n },\n };\n}\n","import type { Client } from \"viem\";\n\n/**\n * Represents either a wallet address string or an object containing wallet address and optional verification ID.\n */\nexport type AddressOrObject =\n | string\n | {\n userWalletAddress: string;\n verificationId?: string;\n };\n\n/**\n * Parameters for verifying a wallet verification challenge.\n */\nexport interface VerifyWalletVerificationChallengeParameters {\n /** The wallet address or object containing wallet address and optional verification ID. */\n addressOrObject: AddressOrObject;\n /** The response to the verification challenge. */\n challengeResponse: string;\n}\n\n/**\n * Result of a wallet verification challenge.\n */\nexport interface VerificationResult {\n /** Whether the verification was successful. */\n verified: boolean;\n}\n\n/**\n * Response from verifying a wallet verification challenge.\n */\nexport type VerifyWalletVerificationChallengeResponse = VerificationResult[];\n\n/**\n * RPC schema for wallet verification challenge verification.\n */\ntype WalletRpcSchema = {\n Method: \"user_verifyWalletVerificationChallenge\";\n Parameters: [addressOrObject: AddressOrObject, challengeResponse: string];\n ReturnType: VerifyWalletVerificationChallengeResponse;\n};\n\n/**\n * Creates a wallet verification challenge verification action for the given client.\n * @param client - The viem client to use for the request.\n * @returns An object with a verifyWalletVerificationChallenge method.\n */\nexport function verifyWalletVerificationChallenge(client: Client) {\n return {\n /**\n * Verifies a wallet verification challenge.\n * @param args - The parameters for verifying the challenge.\n * @returns A promise that resolves to an array of verification results.\n */\n verifyWalletVerificationChallenge(\n args: VerifyWalletVerificationChallengeParameters,\n ): Promise<VerifyWalletVerificationChallengeResponse> {\n return client.request<WalletRpcSchema>({\n method: \"user_verifyWalletVerificationChallenge\",\n params: [args.addressOrObject, args.challengeResponse],\n });\n },\n };\n}\n","/**\n * Types of wallet verification methods supported by the system.\n * Used to identify different verification mechanisms when creating or managing wallet verifications.\n */\nexport enum WalletVerificationType {\n /** PIN code verification method */\n PINCODE = \"PINCODE\",\n /** One-Time Password verification method */\n OTP = \"OTP\",\n /** Secret recovery codes verification method */\n SECRET_CODES = \"SECRET_CODES\",\n}\n\n/**\n * Supported hash algorithms for One-Time Password (OTP) verification.\n * These algorithms determine the cryptographic function used to generate OTP codes.\n */\nexport enum OTPAlgorithm {\n /** SHA-1 hash algorithm */\n SHA1 = \"SHA1\",\n /** SHA-224 hash algorithm */\n SHA224 = \"SHA224\",\n /** SHA-256 hash algorithm */\n SHA256 = \"SHA256\",\n /** SHA-384 hash algorithm */\n SHA384 = \"SHA384\",\n /** SHA-512 hash algorithm */\n SHA512 = \"SHA512\",\n /** SHA3-224 hash algorithm */\n SHA3_224 = \"SHA3-224\",\n /** SHA3-256 hash algorithm */\n SHA3_256 = \"SHA3-256\",\n /** SHA3-384 hash algorithm */\n SHA3_384 = \"SHA3-384\",\n /** SHA3-512 hash algorithm */\n SHA3_512 = \"SHA3-512\",\n}\n","import { appendHeaders } from \"@settlemint/sdk-utils/http\";\nimport { ensureServer } from \"@settlemint/sdk-utils/runtime\";\nimport { ApplicationAccessTokenSchema, UrlOrPathSchema, validate } from \"@settlemint/sdk-utils/validation\";\nimport {\n createPublicClient,\n createWalletClient,\n defineChain,\n type HttpTransportConfig,\n http,\n publicActions,\n type Chain as ViemChain,\n} from \"viem\";\nimport * as chains from \"viem/chains\";\nimport { z } from \"zod\";\nimport { createWallet } from \"./custom-actions/create-wallet.action.js\";\nimport { createWalletVerification } from \"./custom-actions/create-wallet-verification.action.js\";\nimport { createWalletVerificationChallenges } from \"./custom-actions/create-wallet-verification-challenges.action.js\";\nimport { deleteWalletVerification } from \"./custom-actions/delete-wallet-verification.action.js\";\nimport { getWalletVerifications } from \"./custom-actions/get-wallet-verifications.action.js\";\nimport { verifyWalletVerificationChallenge } from \"./custom-actions/verify-wallet-verification-challenge.action.js\";\n\n/**\n * Schema for the viem client options.\n */\nexport const ClientOptionsSchema = z.object({\n /**\n * The access token\n */\n accessToken: ApplicationAccessTokenSchema.optional(),\n /**\n * The chain id\n */\n chainId: z.string(),\n /**\n * The chain name\n */\n chainName: z.string(),\n /**\n * The json rpc url\n */\n rpcUrl: UrlOrPathSchema,\n /**\n * The http transport config\n */\n httpTransportConfig: z.any().optional(),\n});\n\n/**\n * Type representing the validated client options.\n */\nexport type ClientOptions = Omit<z.infer<typeof ClientOptionsSchema>, \"httpTransportConfig\"> & {\n httpTransportConfig?: HttpTransportConfig;\n};\n\n/**\n * Get a public client. Use this if you need to read from the blockchain.\n * @param options - The options for the public client.\n * @returns The public client. see {@link https://viem.sh/docs/clients/public}\n * @example\n * ```ts\n * import { getPublicClient } from '@settlemint/sdk-viem';\n *\n * const publicClient = getPublicClient({\n * accessToken: process.env.SETTLEMINT_ACCESS_TOKEN,\n * chainId: process.env.SETTLEMINT_BLOCKCHAIN_NETWORK_CHAIN_ID!,\n * chainName: process.env.SETTLEMINT_BLOCKCHAIN_NETWORK!,\n * rpcUrl: process.env.SETTLEMINT_BLOCKCHAIN_NODE_OR_LOAD_BALANCER_JSON_RPC_ENDPOINT!,\n * });\n *\n * // Get the block number\n * const block = await publicClient.getBlockNumber();\n * console.log(block);\n * ```\n */\nexport const getPublicClient = (options: ClientOptions) => {\n ensureServer();\n const validatedOptions: ClientOptions = validate(ClientOptionsSchema, options);\n return createPublicClient({\n chain: getChain({\n chainId: validatedOptions.chainId,\n chainName: validatedOptions.chainName,\n rpcUrl: validatedOptions.rpcUrl,\n }),\n transport: http(validatedOptions.rpcUrl, {\n batch: true,\n timeout: 60_000,\n ...validatedOptions.httpTransportConfig,\n fetchOptions: {\n ...validatedOptions?.httpTransportConfig?.fetchOptions,\n headers: appendHeaders(validatedOptions?.httpTransportConfig?.fetchOptions?.headers, {\n \"x-auth-token\": validatedOptions.accessToken,\n }),\n },\n }),\n });\n};\n\n/**\n * The options for the wallet client.\n */\nexport interface WalletVerificationOptions {\n /**\n * The verification id (used for HD wallets), if not provided, the challenge response will be validated against all active verifications.\n */\n verificationId?: string;\n /**\n * The challenge response (used for HD wallets)\n */\n challengeResponse: string;\n}\n\n/**\n * Get a wallet client. Use this if you need to write to the blockchain.\n * @param options - The options for the wallet client.\n * @returns A function that returns a wallet client. The function can be called with verification options for HD wallets. see {@link https://viem.sh/docs/clients/wallet}\n * @example\n * ```ts\n * import { getWalletClient } from '@settlemint/sdk-viem';\n * import { parseAbi } from \"viem\";\n *\n * const walletClient = getWalletClient({\n * accessToken: process.env.SETTLEMINT_ACCESS_TOKEN,\n * chainId: process.env.SETTLEMINT_BLOCKCHAIN_NETWORK_CHAIN_ID!,\n * chainName: process.env.SETTLEMINT_BLOCKCHAIN_NETWORK!,\n * rpcUrl: process.env.SETTLEMINT_BLOCKCHAIN_NODE_OR_LOAD_BALANCER_JSON_RPC_ENDPOINT!,\n * });\n *\n * // Get the chain id\n * const chainId = await walletClient().getChainId();\n * console.log(chainId);\n *\n * // write to the blockchain\n * const transactionHash = await walletClient().writeContract({\n * account: \"0x0000000000000000000000000000000000000000\",\n * address: \"0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2\",\n * abi: parseAbi([\"function mint(uint32 tokenId) nonpayable\"]),\n * functionName: \"mint\",\n * args: [69420],\n * });\n * console.log(transactionHash);\n * ```\n */\nexport const getWalletClient = (options: ClientOptions) => {\n ensureServer();\n const validatedOptions: ClientOptions = validate(ClientOptionsSchema, options);\n const chain = getChain({\n chainId: validatedOptions.chainId,\n chainName: validatedOptions.chainName,\n rpcUrl: validatedOptions.rpcUrl,\n });\n return (verificationOptions?: WalletVerificationOptions) =>\n createWalletClient({\n chain: chain,\n transport: http(validatedOptions.rpcUrl, {\n batch: true,\n timeout: 60_000,\n ...validatedOptions.httpTransportConfig,\n fetchOptions: {\n ...validatedOptions?.httpTransportConfig?.fetchOptions,\n headers: appendHeaders(validatedOptions?.httpTransportConfig?.fetchOptions?.headers, {\n \"x-auth-token\": validatedOptions.accessToken,\n \"x-auth-challenge-response\": verificationOptions?.challengeResponse ?? \"\",\n \"x-auth-verification-id\": verificationOptions?.verificationId ?? \"\",\n }),\n },\n }),\n })\n .extend(publicActions)\n .extend(createWallet)\n .extend(getWalletVerifications)\n .extend(createWalletVerification)\n .extend(deleteWalletVerification)\n .extend(createWalletVerificationChallenges)\n .extend(verifyWalletVerificationChallenge);\n};\n\n/**\n * Schema for the viem client options.\n */\nexport const GetChainIdOptionsSchema = z.object({\n /**\n * The access token\n */\n accessToken: ApplicationAccessTokenSchema.optional(),\n /**\n * The json rpc url\n */\n rpcUrl: UrlOrPathSchema,\n /**\n * The http transport config\n */\n httpTransportConfig: z.any().optional(),\n});\n\n/**\n * Type representing the validated get chain id options.\n */\nexport type GetChainIdOptions = Omit<z.infer<typeof GetChainIdOptionsSchema>, \"httpTransportConfig\"> & {\n httpTransportConfig?: HttpTransportConfig;\n};\n\n/**\n * Get the chain id of a blockchain network.\n * @param options - The options for the public client.\n * @returns The chain id.\n * @example\n * ```ts\n * import { getChainId } from '@settlemint/sdk-viem';\n *\n * const chainId = await getChainId({\n * accessToken: process.env.SETTLEMINT_ACCESS_TOKEN,\n * rpcUrl: process.env.SETTLEMINT_BLOCKCHAIN_NODE_OR_LOAD_BALANCER_JSON_RPC_ENDPOINT!,\n * });\n * console.log(chainId);\n * ```\n */\nexport async function getChainId(options: GetChainIdOptions): Promise<number> {\n ensureServer();\n const validatedOptions: GetChainIdOptions = validate(GetChainIdOptionsSchema, options);\n const client = createPublicClient({\n transport: http(validatedOptions.rpcUrl, {\n ...validatedOptions.httpTransportConfig,\n fetchOptions: {\n ...validatedOptions?.httpTransportConfig?.fetchOptions,\n headers: appendHeaders(validatedOptions?.httpTransportConfig?.fetchOptions?.headers, {\n \"x-auth-token\": validatedOptions.accessToken,\n }),\n },\n }),\n });\n\n return client.getChainId();\n}\n\nfunction getChain({ chainId, chainName, rpcUrl }: Pick<ClientOptions, \"chainId\" | \"chainName\" | \"rpcUrl\">): ViemChain {\n const knownChain = Object.values(chains).find((chain) => chain.id.toString() === chainId);\n return (\n knownChain ??\n defineChain({\n id: Number(chainId),\n name: chainName,\n rpcUrls: {\n default: {\n http: [rpcUrl],\n },\n },\n nativeCurrency: {\n decimals: 18,\n name: \"Ether\",\n symbol: \"ETH\",\n },\n })\n );\n}\n\nexport type {\n CreateWalletParameters,\n CreateWalletResponse,\n WalletInfo,\n} from \"./custom-actions/create-wallet.action.js\";\nexport type {\n CreateWalletVerificationParameters,\n CreateWalletVerificationResponse,\n WalletOTPVerificationInfo,\n WalletPincodeVerificationInfo,\n WalletSecretCodesVerificationInfo,\n WalletVerificationInfo,\n} from \"./custom-actions/create-wallet-verification.action.js\";\nexport type {\n CreateWalletVerificationChallengesParameters,\n CreateWalletVerificationChallengesResponse,\n WalletVerificationChallenge,\n} from \"./custom-actions/create-wallet-verification-challenges.action.js\";\nexport type {\n DeleteWalletVerificationParameters,\n DeleteWalletVerificationResponse,\n} from \"./custom-actions/delete-wallet-verification.action.js\";\nexport type {\n GetWalletVerificationsParameters,\n GetWalletVerificationsResponse,\n WalletVerification,\n} from \"./custom-actions/get-wallet-verifications.action.js\";\nexport { OTPAlgorithm, WalletVerificationType } from \"./custom-actions/types/wallet-verification.enum.js\";\nexport type {\n AddressOrObject,\n VerificationResult,\n VerifyWalletVerificationChallengeParameters,\n VerifyWalletVerificationChallengeResponse,\n} from \"./custom-actions/verify-wallet-verification-challenge.action.js\";\n"],"mappings":";;;;;;;;;;;;;;AAgDA,SAAgB,aAAaA,QAAgB;AAC3C,QAAO,EAML,aAAaC,MAA+D;AAC1E,SAAO,OAAO,QAAyB;GACrC,QAAQ;GACR,QAAQ,CAAC,KAAK,YAAY,KAAK,UAAW;EAC3C,EAAC;CACH,EACF;AACF;;;;;;;;;AC+BD,SAAgB,yBAAyBC,QAAgB;AACvD,QAAO,EAML,yBAAyBC,MAAuF;AAC9G,SAAO,OAAO,QAAyB;GACrC,QAAQ;GACR,QAAQ,CAAC,KAAK,mBAAmB,KAAK,sBAAuB;EAC9D,EAAC;CACH,EACF;AACF;;;;;;;;;AC9DD,SAAgB,mCAAmCC,QAAgB;AACjE,QAAO,EAML,mCACEC,MACqD;AACrD,SAAO,OAAO,QAAyB;GACrC,QAAQ;GACR,QAAQ,CAAC,KAAK,eAAgB;EAC/B,EAAC;CACH,EACF;AACF;;;;;;;;;AC3BD,SAAgB,yBAAyBC,QAAgB;AACvD,QAAO,EAML,yBAAyBC,MAAuF;AAC9G,SAAO,OAAO,QAAyB;GACrC,QAAQ;GACR,QAAQ,CAAC,KAAK,mBAAmB,KAAK,cAAe;EACtD,EAAC;CACH,EACF;AACF;;;;;;;;;ACND,SAAgB,uBAAuBC,QAAgB;AACrD,QAAO,EAML,uBAAuBC,MAAiF;AACtG,SAAO,OAAO,QAAyB;GACrC,QAAQ;GACR,QAAQ,CAAC,KAAK,iBAAkB;EACjC,EAAC;CACH,EACF;AACF;;;;;;;;;ACPD,SAAgB,kCAAkCC,QAAgB;AAChE,QAAO,EAML,kCACEC,MACoD;AACpD,SAAO,OAA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cAAc,kBAAkB,qBAAqB,cAAc,SAAS;KACnF,gBAAgB,iBAAiB;KACjC,6BAA6B,qBAAqB,qBAAqB;KACvE,0BAA0B,qBAAqB,kBAAkB;IAClE,EAAC;GACH;EACF,EAAC;CACH,EAAC,CACC,OAAO,cAAc,CACrB,OAAO,aAAa,CACpB,OAAO,uBAAuB,CAC9B,OAAO,yBAAyB,CAChC,OAAO,yBAAyB,CAChC,OAAO,mCAAmC,CAC1C,OAAO,kCAAkC;AAC/C;;;;AAKD,MAAa,0BAA0B,EAAE,OAAO;CAI9C,aAAa,6BAA6B,UAAU;CAIpD,QAAQ;CAIR,qBAAqB,EAAE,KAAK,CAAC,UAAU;AACxC,EAAC;;;;;;;;;;;;;;;;AAwBF,eAAsB,WAAWC,SAA6C;CAC5E,cAAc;CACd,MAAMC,mBAAsC,SAAS,yBAAyB,QAAQ;CACtF,MAAM,SAAS,mBAAmB,EAChC,WAAW,KAAK,iBAAiB,QAAQ;EACvC,GAAG,iBAAiB;EACpB,cAAc;GACZ,GAAG,kBAAkB,qBAAqB;GAC1C,SAAS,cAAc,kBAAkB,qBAAqB,cAAc,SAAS,EACnF,gBAAgB,iBAAiB,YAClC,EAAC;EACH;CACF,EAAC,CACH,EAAC;AAEF,QAAO,OAAO,YAAY;AAC3B;AAED,SAAS,SAAS,EAAE,SAAS,WAAW,QAAiE,EAAa;CACpH,MAAM,aAAa,OAAO,OAAO,OAAO,CAAC,KAAK,CAAC,UAAU,MAAM,GAAG,UAAU,KAAK,QAAQ;AACzF,QACE,cACA,YAAY;EACV,IAAI,OAAO,QAAQ;EACnB,MAAM;EACN,SAAS,EACP,SAAS,EACP,MAAM,CAAC,MAAO,EACf,EACF;EACD,gBAAgB;GACd,UAAU;GACV,MAAM;GACN,QAAQ;EACT;CACF,EAAC;AAEL"}
|
package/dist/viem.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"viem.cjs","names":["client: Client","args: CreateWalletParameters","client: Client","args: CreateWalletVerificationParameters","client: Client","args: CreateWalletVerificationChallengesParameters","client: Client","args: DeleteWalletVerificationParameters","client: Client","args: GetWalletVerificationsParameters","client: Client","args: VerifyWalletVerificationChallengeParameters","UrlOrPathSchema","options: ClientOptions","validatedOptions: ClientOptions","verificationOptions?: WalletVerificationOptions","publicActions","options: GetChainIdOptions","validatedOptions: GetChainIdOptions","chains"],"sources":["../src/custom-actions/create-wallet.action.ts","../src/custom-actions/create-wallet-verification.action.ts","../src/custom-actions/create-wallet-verification-challenges.action.ts","../src/custom-actions/delete-wallet-verification.action.ts","../src/custom-actions/get-wallet-verifications.action.ts","../src/custom-actions/verify-wallet-verification-challenge.action.ts","../src/custom-actions/types/wallet-verification.enum.ts","../src/viem.ts"],"sourcesContent":["import type { Client } from \"viem\";\n\n/**\n * Information about the wallet to be created.\n */\nexport interface WalletInfo {\n /** The name of the wallet. */\n name: string;\n}\n\n/**\n * Parameters for creating a wallet.\n */\nexport interface CreateWalletParameters {\n /** The unique name of the key vault where the wallet will be created. */\n keyVaultId: string;\n /** Information about the wallet to be created. */\n walletInfo: WalletInfo;\n}\n\n/**\n * Response from creating a wallet.\n */\nexport interface CreateWalletResponse {\n /** The unique identifier of the wallet. */\n id: string;\n /** The name of the wallet. */\n name: string;\n /** The blockchain address of the wallet. */\n address: string;\n /** The HD derivation path used to create the wallet. */\n derivationPath: string;\n}\n\n/**\n * RPC schema for wallet creation.\n */\ntype WalletRpcSchema = {\n Method: \"user_createWallet\";\n Parameters: [keyVaultId: string, walletInfo: WalletInfo];\n ReturnType: CreateWalletResponse[];\n};\n\n/**\n * Creates a wallet action for the given client.\n * @param client - The viem client to use for the request.\n * @returns An object with a createWallet method.\n */\nexport function createWallet(client: Client) {\n return {\n /**\n * Creates a new wallet in the specified key vault.\n * @param args - The parameters for creating a wallet.\n * @returns A promise that resolves to an array of created wallet responses.\n */\n createWallet(args: CreateWalletParameters): Promise<CreateWalletResponse[]> {\n return client.request<WalletRpcSchema>({\n method: \"user_createWallet\",\n params: [args.keyVaultId, args.walletInfo],\n });\n },\n };\n}\n","import type { Client } from \"viem\";\nimport type { OTPAlgorithm, WalletVerificationType } from \"./types/wallet-verification.enum.js\";\n\n/**\n * Base interface for wallet verification information.\n */\ntype BaseWalletVerificationInfo = {\n /** The name of the verification method. */\n name: string;\n /** The type of verification method. */\n verificationType: WalletVerificationType;\n};\n\n/**\n * Information for PIN code verification.\n */\nexport interface WalletPincodeVerificationInfo extends BaseWalletVerificationInfo {\n /** The type of verification method. */\n verificationType: WalletVerificationType.PINCODE;\n /** The PIN code to use for verification. */\n pincode: string;\n}\n\n/**\n * Information for One-Time Password (OTP) verification.\n */\nexport interface WalletOTPVerificationInfo extends BaseWalletVerificationInfo {\n /** The type of verification method. */\n verificationType: WalletVerificationType.OTP;\n /** The hash algorithm to use for OTP generation. */\n algorithm?: OTPAlgorithm;\n /** The number of digits in the OTP code. */\n digits?: number;\n /** The time period in seconds for OTP validity. */\n period?: number;\n /** The issuer of the OTP. */\n issuer?: string;\n}\n\n/**\n * Information for secret recovery codes verification.\n */\nexport interface WalletSecretCodesVerificationInfo extends BaseWalletVerificationInfo {\n /** The type of verification method. */\n verificationType: WalletVerificationType.SECRET_CODES;\n}\n\n/**\n * Union type of all possible wallet verification information types.\n */\nexport type WalletVerificationInfo =\n | WalletPincodeVerificationInfo\n | WalletOTPVerificationInfo\n | WalletSecretCodesVerificationInfo;\n\n/**\n * Parameters for creating a wallet verification.\n */\nexport interface CreateWalletVerificationParameters {\n /** The wallet address for which to create the verification. */\n userWalletAddress: string;\n /** The verification information to create. */\n walletVerificationInfo: WalletVerificationInfo;\n}\n\n/**\n * Response from creating a wallet verification.\n */\nexport interface CreateWalletVerificationResponse {\n /** The unique identifier of the verification. */\n id: string;\n /** The name of the verification method. */\n name: string;\n /** The type of verification method. */\n verificationType: WalletVerificationType;\n /** Additional parameters specific to the verification type. */\n parameters: Record<string, string>;\n}\n\n/**\n * RPC schema for creating a wallet verification.\n */\ntype WalletRpcSchema = {\n Method: \"user_createWalletVerification\";\n Parameters: [userWalletAddress: string, walletVerificationInfo: WalletVerificationInfo];\n ReturnType: CreateWalletVerificationResponse[];\n};\n\n/**\n * Creates a wallet verification action for the given client.\n * @param client - The viem client to use for the request.\n * @returns An object with a createWalletVerification method.\n */\nexport function createWalletVerification(client: Client) {\n return {\n /**\n * Creates a new wallet verification.\n * @param args - The parameters for creating the verification.\n * @returns A promise that resolves to an array of created wallet verification responses.\n */\n createWalletVerification(args: CreateWalletVerificationParameters): Promise<CreateWalletVerificationResponse[]> {\n return client.request<WalletRpcSchema>({\n method: \"user_createWalletVerification\",\n params: [args.userWalletAddress, args.walletVerificationInfo],\n });\n },\n };\n}\n","import type { Client } from \"viem\";\nimport type { WalletVerificationType } from \"./types/wallet-verification.enum.js\";\nimport type { AddressOrObject } from \"./verify-wallet-verification-challenge.action.js\";\n\n/**\n * Parameters for creating wallet verification challenges.\n */\nexport interface CreateWalletVerificationChallengesParameters {\n /** The wallet address or object containing wallet address and optional verification ID. */\n addressOrObject: AddressOrObject;\n}\n\n/**\n * Represents a wallet verification challenge.\n */\nexport interface WalletVerificationChallenge {\n /** The unique identifier of the challenge. */\n id: string;\n /** The name of the challenge. */\n name: string;\n /** The type of verification required. */\n verificationType: WalletVerificationType;\n /** The challenge parameters specific to the verification type. */\n challenge: Record<string, string>;\n}\n\n/**\n * Response from creating wallet verification challenges.\n */\nexport type CreateWalletVerificationChallengesResponse = WalletVerificationChallenge[];\n\n/**\n * RPC schema for creating wallet verification challenges.\n */\ntype WalletRpcSchema = {\n Method: \"user_createWalletVerificationChallenges\";\n Parameters: [addressOrObject: AddressOrObject];\n ReturnType: CreateWalletVerificationChallengesResponse;\n};\n\n/**\n * Creates a wallet verification challenges action for the given client.\n * @param client - The viem client to use for the request.\n * @returns An object with a createWalletVerificationChallenges method.\n */\nexport function createWalletVerificationChallenges(client: Client) {\n return {\n /**\n * Creates verification challenges for a wallet.\n * @param args - The parameters for creating the challenges.\n * @returns A promise that resolves to an array of wallet verification challenges.\n */\n createWalletVerificationChallenges(\n args: CreateWalletVerificationChallengesParameters,\n ): Promise<CreateWalletVerificationChallengesResponse> {\n return client.request<WalletRpcSchema>({\n method: \"user_createWalletVerificationChallenges\",\n params: [args.addressOrObject],\n });\n },\n };\n}\n","import type { Client } from \"viem\";\n\n/**\n * Parameters for deleting a wallet verification.\n */\nexport interface DeleteWalletVerificationParameters {\n /** The wallet address for which to delete the verification. */\n userWalletAddress: string;\n /** The unique identifier of the verification to delete. */\n verificationId: string;\n}\n\n/**\n * Response from deleting a wallet verification.\n */\nexport interface DeleteWalletVerificationResponse {\n /** Whether the deletion was successful. */\n success: boolean;\n}\n\n/**\n * RPC schema for deleting a wallet verification.\n */\ntype WalletRpcSchema = {\n Method: \"user_deleteWalletVerification\";\n Parameters: [userWalletAddress: string, verificationId: string];\n ReturnType: DeleteWalletVerificationResponse[];\n};\n\n/**\n * Creates a wallet verification deletion action for the given client.\n * @param client - The viem client to use for the request.\n * @returns An object with a deleteWalletVerification method.\n */\nexport function deleteWalletVerification(client: Client) {\n return {\n /**\n * Deletes a wallet verification.\n * @param args - The parameters for deleting the verification.\n * @returns A promise that resolves to an array of deletion results.\n */\n deleteWalletVerification(args: DeleteWalletVerificationParameters): Promise<DeleteWalletVerificationResponse[]> {\n return client.request<WalletRpcSchema>({\n method: \"user_deleteWalletVerification\",\n params: [args.userWalletAddress, args.verificationId],\n });\n },\n };\n}\n","import type { Client } from \"viem\";\nimport type { WalletVerificationType } from \"./types/wallet-verification.enum.js\";\n\n/**\n * Parameters for getting wallet verifications.\n */\nexport interface GetWalletVerificationsParameters {\n /** The wallet address for which to fetch verifications. */\n userWalletAddress: string;\n}\n\n/**\n * Represents a wallet verification.\n */\nexport interface WalletVerification {\n /** The unique identifier of the verification. */\n id: string;\n /** The name of the verification method. */\n name: string;\n /** The type of verification method. */\n verificationType: WalletVerificationType;\n}\n\n/**\n * Response from getting wallet verifications.\n */\nexport type GetWalletVerificationsResponse = WalletVerification[];\n\n/**\n * RPC schema for getting wallet verifications.\n */\ntype WalletRpcSchema = {\n Method: \"user_walletVerifications\";\n Parameters: [userWalletAddress: string];\n ReturnType: GetWalletVerificationsResponse;\n};\n\n/**\n * Creates a wallet verifications retrieval action for the given client.\n * @param client - The viem client to use for the request.\n * @returns An object with a getWalletVerifications method.\n */\nexport function getWalletVerifications(client: Client) {\n return {\n /**\n * Gets all verifications for a wallet.\n * @param args - The parameters for getting the verifications.\n * @returns A promise that resolves to an array of wallet verifications.\n */\n getWalletVerifications(args: GetWalletVerificationsParameters): Promise<GetWalletVerificationsResponse> {\n return client.request<WalletRpcSchema>({\n method: \"user_walletVerifications\",\n params: [args.userWalletAddress],\n });\n },\n };\n}\n","import type { Client } from \"viem\";\n\n/**\n * Represents either a wallet address string or an object containing wallet address and optional verification ID.\n */\nexport type AddressOrObject =\n | string\n | {\n userWalletAddress: string;\n verificationId?: string;\n };\n\n/**\n * Parameters for verifying a wallet verification challenge.\n */\nexport interface VerifyWalletVerificationChallengeParameters {\n /** The wallet address or object containing wallet address and optional verification ID. */\n addressOrObject: AddressOrObject;\n /** The response to the verification challenge. */\n challengeResponse: string;\n}\n\n/**\n * Result of a wallet verification challenge.\n */\nexport interface VerificationResult {\n /** Whether the verification was successful. */\n verified: boolean;\n}\n\n/**\n * Response from verifying a wallet verification challenge.\n */\nexport type VerifyWalletVerificationChallengeResponse = VerificationResult[];\n\n/**\n * RPC schema for wallet verification challenge verification.\n */\ntype WalletRpcSchema = {\n Method: \"user_verifyWalletVerificationChallenge\";\n Parameters: [addressOrObject: AddressOrObject, challengeResponse: string];\n ReturnType: VerifyWalletVerificationChallengeResponse;\n};\n\n/**\n * Creates a wallet verification challenge verification action for the given client.\n * @param client - The viem client to use for the request.\n * @returns An object with a verifyWalletVerificationChallenge method.\n */\nexport function verifyWalletVerificationChallenge(client: Client) {\n return {\n /**\n * Verifies a wallet verification challenge.\n * @param args - The parameters for verifying the challenge.\n * @returns A promise that resolves to an array of verification results.\n */\n verifyWalletVerificationChallenge(\n args: VerifyWalletVerificationChallengeParameters,\n ): Promise<VerifyWalletVerificationChallengeResponse> {\n return client.request<WalletRpcSchema>({\n method: \"user_verifyWalletVerificationChallenge\",\n params: [args.addressOrObject, args.challengeResponse],\n });\n },\n };\n}\n","/**\n * Types of wallet verification methods supported by the system.\n * Used to identify different verification mechanisms when creating or managing wallet verifications.\n */\nexport enum WalletVerificationType {\n /** PIN code verification method */\n PINCODE = \"PINCODE\",\n /** One-Time Password verification method */\n OTP = \"OTP\",\n /** Secret recovery codes verification method */\n SECRET_CODES = \"SECRET_CODES\",\n}\n\n/**\n * Supported hash algorithms for One-Time Password (OTP) verification.\n * These algorithms determine the cryptographic function used to generate OTP codes.\n */\nexport enum OTPAlgorithm {\n /** SHA-1 hash algorithm */\n SHA1 = \"SHA1\",\n /** SHA-224 hash algorithm */\n SHA224 = \"SHA224\",\n /** SHA-256 hash algorithm */\n SHA256 = \"SHA256\",\n /** SHA-384 hash algorithm */\n SHA384 = \"SHA384\",\n /** SHA-512 hash algorithm */\n SHA512 = \"SHA512\",\n /** SHA3-224 hash algorithm */\n SHA3_224 = \"SHA3-224\",\n /** SHA3-256 hash algorithm */\n SHA3_256 = \"SHA3-256\",\n /** SHA3-384 hash algorithm */\n SHA3_384 = \"SHA3-384\",\n /** SHA3-512 hash algorithm */\n SHA3_512 = \"SHA3-512\",\n}\n","import { appendHeaders } from \"@settlemint/sdk-utils/http\";\nimport { ensureServer } from \"@settlemint/sdk-utils/runtime\";\nimport { ApplicationAccessTokenSchema, UrlOrPathSchema, validate } from \"@settlemint/sdk-utils/validation\";\nimport {\n createPublicClient,\n createWalletClient,\n defineChain,\n type HttpTransportConfig,\n http,\n publicActions,\n type Chain as ViemChain,\n} from \"viem\";\nimport * as chains from \"viem/chains\";\nimport { z } from \"zod\";\nimport { createWallet } from \"./custom-actions/create-wallet.action.js\";\nimport { createWalletVerification } from \"./custom-actions/create-wallet-verification.action.js\";\nimport { createWalletVerificationChallenges } from \"./custom-actions/create-wallet-verification-challenges.action.js\";\nimport { deleteWalletVerification } from \"./custom-actions/delete-wallet-verification.action.js\";\nimport { getWalletVerifications } from \"./custom-actions/get-wallet-verifications.action.js\";\nimport { verifyWalletVerificationChallenge } from \"./custom-actions/verify-wallet-verification-challenge.action.js\";\n\n/**\n * Schema for the viem client options.\n */\nexport const ClientOptionsSchema = z.object({\n /**\n * The access token\n */\n accessToken: ApplicationAccessTokenSchema.optional(),\n /**\n * The chain id\n */\n chainId: z.string(),\n /**\n * The chain name\n */\n chainName: z.string(),\n /**\n * The json rpc url\n */\n rpcUrl: UrlOrPathSchema,\n /**\n * The http transport config\n */\n httpTransportConfig: z.any().optional(),\n});\n\n/**\n * Type representing the validated client options.\n */\nexport type ClientOptions = Omit<z.infer<typeof ClientOptionsSchema>, \"httpTransportConfig\"> & {\n httpTransportConfig?: HttpTransportConfig;\n};\n\n/**\n * Get a public client. Use this if you need to read from the blockchain.\n * @param options - The options for the public client.\n * @returns The public client. see {@link https://viem.sh/docs/clients/public}\n * @example\n * ```ts\n * import { getPublicClient } from '@settlemint/sdk-viem';\n *\n * const publicClient = getPublicClient({\n * accessToken: process.env.SETTLEMINT_ACCESS_TOKEN,\n * chainId: process.env.SETTLEMINT_BLOCKCHAIN_NETWORK_CHAIN_ID!,\n * chainName: process.env.SETTLEMINT_BLOCKCHAIN_NETWORK!,\n * rpcUrl: process.env.SETTLEMINT_BLOCKCHAIN_NODE_OR_LOAD_BALANCER_JSON_RPC_ENDPOINT!,\n * });\n *\n * // Get the block number\n * const block = await publicClient.getBlockNumber();\n * console.log(block);\n * ```\n */\nexport const getPublicClient = (options: ClientOptions) => {\n ensureServer();\n const validatedOptions: ClientOptions = validate(ClientOptionsSchema, options);\n return createPublicClient({\n chain: getChain({\n chainId: validatedOptions.chainId,\n chainName: validatedOptions.chainName,\n rpcUrl: validatedOptions.rpcUrl,\n }),\n transport: http(validatedOptions.rpcUrl, {\n batch: true,\n timeout: 60_000,\n ...validatedOptions.httpTransportConfig,\n fetchOptions: {\n ...validatedOptions?.httpTransportConfig?.fetchOptions,\n headers: appendHeaders(validatedOptions?.httpTransportConfig?.fetchOptions?.headers, {\n \"x-auth-token\": validatedOptions.accessToken,\n }),\n },\n }),\n });\n};\n\n/**\n * The options for the wallet client.\n */\nexport interface WalletVerificationOptions {\n /**\n * The verification id (used for HD wallets), if not provided, the challenge response will be validated against all active verifications.\n */\n verificationId?: string;\n /**\n * The challenge response (used for HD wallets)\n */\n challengeResponse: string;\n}\n\n/**\n * Get a wallet client. Use this if you need to write to the blockchain.\n * @param options - The options for the wallet client.\n * @returns A function that returns a wallet client. The function can be called with verification options for HD wallets. see {@link https://viem.sh/docs/clients/wallet}\n * @example\n * ```ts\n * import { getWalletClient } from '@settlemint/sdk-viem';\n * import { parseAbi } from \"viem\";\n *\n * const walletClient = getWalletClient({\n * accessToken: process.env.SETTLEMINT_ACCESS_TOKEN,\n * chainId: process.env.SETTLEMINT_BLOCKCHAIN_NETWORK_CHAIN_ID!,\n * chainName: process.env.SETTLEMINT_BLOCKCHAIN_NETWORK!,\n * rpcUrl: process.env.SETTLEMINT_BLOCKCHAIN_NODE_OR_LOAD_BALANCER_JSON_RPC_ENDPOINT!,\n * });\n *\n * // Get the chain id\n * const chainId = await walletClient().getChainId();\n * console.log(chainId);\n *\n * // write to the blockchain\n * const transactionHash = await walletClient().writeContract({\n * account: \"0x0000000000000000000000000000000000000000\",\n * address: \"0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2\",\n * abi: parseAbi([\"function mint(uint32 tokenId) nonpayable\"]),\n * functionName: \"mint\",\n * args: [69420],\n * });\n * console.log(transactionHash);\n * ```\n */\nexport const getWalletClient = (options: ClientOptions) => {\n ensureServer();\n const validatedOptions: ClientOptions = validate(ClientOptionsSchema, options);\n const chain = getChain({\n chainId: validatedOptions.chainId,\n chainName: validatedOptions.chainName,\n rpcUrl: validatedOptions.rpcUrl,\n });\n return (verificationOptions?: WalletVerificationOptions) =>\n createWalletClient({\n chain: chain,\n transport: http(validatedOptions.rpcUrl, {\n batch: true,\n timeout: 60_000,\n ...validatedOptions.httpTransportConfig,\n fetchOptions: {\n ...validatedOptions?.httpTransportConfig?.fetchOptions,\n headers: appendHeaders(validatedOptions?.httpTransportConfig?.fetchOptions?.headers, {\n \"x-auth-token\": validatedOptions.accessToken,\n \"x-auth-challenge-response\": verificationOptions?.challengeResponse ?? \"\",\n \"x-auth-verification-id\": verificationOptions?.verificationId ?? \"\",\n }),\n },\n }),\n })\n .extend(publicActions)\n .extend(createWallet)\n .extend(getWalletVerifications)\n .extend(createWalletVerification)\n .extend(deleteWalletVerification)\n .extend(createWalletVerificationChallenges)\n .extend(verifyWalletVerificationChallenge);\n};\n\n/**\n * Schema for the viem client options.\n */\nexport const GetChainIdOptionsSchema = z.object({\n /**\n * The access token\n */\n accessToken: ApplicationAccessTokenSchema.optional(),\n /**\n * The json rpc url\n */\n rpcUrl: UrlOrPathSchema,\n /**\n * The http transport config\n */\n httpTransportConfig: z.any().optional(),\n});\n\n/**\n * Type representing the validated get chain id options.\n */\nexport type GetChainIdOptions = Omit<z.infer<typeof GetChainIdOptionsSchema>, \"httpTransportConfig\"> & {\n httpTransportConfig?: HttpTransportConfig;\n};\n\n/**\n * Get the chain id of a blockchain network.\n * @param options - The options for the public client.\n * @returns The chain id.\n * @example\n * ```ts\n * import { getChainId } from '@settlemint/sdk-viem';\n *\n * const chainId = await getChainId({\n * accessToken: process.env.SETTLEMINT_ACCESS_TOKEN,\n * rpcUrl: process.env.SETTLEMINT_BLOCKCHAIN_NODE_OR_LOAD_BALANCER_JSON_RPC_ENDPOINT!,\n * });\n * console.log(chainId);\n * ```\n */\nexport async function getChainId(options: GetChainIdOptions): Promise<number> {\n ensureServer();\n const validatedOptions: GetChainIdOptions = validate(GetChainIdOptionsSchema, options);\n const client = createPublicClient({\n transport: http(validatedOptions.rpcUrl, {\n ...validatedOptions.httpTransportConfig,\n fetchOptions: {\n ...validatedOptions?.httpTransportConfig?.fetchOptions,\n headers: appendHeaders(validatedOptions?.httpTransportConfig?.fetchOptions?.headers, {\n \"x-auth-token\": validatedOptions.accessToken,\n }),\n },\n }),\n });\n\n return client.getChainId();\n}\n\nfunction getChain({ chainId, chainName, rpcUrl }: Pick<ClientOptions, \"chainId\" | \"chainName\" | \"rpcUrl\">): ViemChain {\n const knownChain = Object.values(chains).find((chain) => chain.id.toString() === chainId);\n return (\n knownChain ??\n defineChain({\n id: Number(chainId),\n name: chainName,\n rpcUrls: {\n default: {\n http: [rpcUrl],\n },\n },\n nativeCurrency: {\n decimals: 18,\n name: \"Ether\",\n symbol: \"ETH\",\n },\n })\n );\n}\n\nexport type {\n CreateWalletParameters,\n CreateWalletResponse,\n WalletInfo,\n} from \"./custom-actions/create-wallet.action.js\";\nexport type {\n CreateWalletVerificationParameters,\n CreateWalletVerificationResponse,\n WalletOTPVerificationInfo,\n WalletPincodeVerificationInfo,\n WalletSecretCodesVerificationInfo,\n WalletVerificationInfo,\n} from \"./custom-actions/create-wallet-verification.action.js\";\nexport type {\n CreateWalletVerificationChallengesParameters,\n CreateWalletVerificationChallengesResponse,\n WalletVerificationChallenge,\n} from \"./custom-actions/create-wallet-verification-challenges.action.js\";\nexport type {\n DeleteWalletVerificationParameters,\n DeleteWalletVerificationResponse,\n} from \"./custom-actions/delete-wallet-verification.action.js\";\nexport type {\n GetWalletVerificationsParameters,\n GetWalletVerificationsResponse,\n WalletVerification,\n} from \"./custom-actions/get-wallet-verifications.action.js\";\nexport { OTPAlgorithm, WalletVerificationType } from \"./custom-actions/types/wallet-verification.enum.js\";\nexport type {\n AddressOrObject,\n VerificationResult,\n VerifyWalletVerificationChallengeParameters,\n VerifyWalletVerificationChallengeResponse,\n} from \"./custom-actions/verify-wallet-verification-challenge.action.js\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgDA,SAAgB,aAAaA,QAAgB;AAC3C,QAAO,EAML,aAAaC,MAA+D;AAC1E,SAA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AAmC,CAC1C,OAAO,kCAAkC;AAC/C;;;;AAKD,MAAa,0BAA0B,MAAE,OAAO;CAI9C,aAAa,+DAA6B,UAAU;CAIpD,QAAQJ;CAIR,qBAAqB,MAAE,KAAK,CAAC,UAAU;AACxC,EAAC;;;;;;;;;;;;;;;;AAwBF,eAAsB,WAAWK,SAA6C;AAC5E,mDAAc;CACd,MAAMC,mBAAsC,gDAAS,yBAAyB,QAAQ;CACtF,MAAM,SAAS,6BAAmB,EAChC,WAAW,eAAK,iBAAiB,QAAQ;EACvC,GAAG,iBAAiB;EACpB,cAAc;GACZ,GAAG,kBAAkB,qBAAqB;GAC1C,SAAS,+CAAc,kBAAkB,qBAAqB,cAAc,SAAS,EACnF,gBAAgB,iBAAiB,YAClC,EAAC;EACH;CACF,EAAC,CACH,EAAC;AAEF,QAAO,OAAO,YAAY;AAC3B;AAED,SAAS,SAAS,EAAE,SAAS,WAAW,QAAiE,EAAa;CACpH,MAAM,aAAa,OAAO,OAAOC,YAAO,CAAC,KAAK,CAAC,UAAU,MAAM,GAAG,UAAU,KAAK,QAAQ;AACzF,QACE,cACA,sBAAY;EACV,IAAI,OAAO,QAAQ;EACnB,MAAM;EACN,SAAS,EACP,SAAS,EACP,MAAM,CAAC,MAAO,EACf,EACF;EACD,gBAAgB;GACd,UAAU;GACV,MAAM;GACN,QAAQ;EACT;CACF,EAAC;AAEL"}
|
|
1
|
+
{"version":3,"file":"viem.cjs","names":["client: Client","args: CreateWalletParameters","client: Client","args: CreateWalletVerificationParameters","client: Client","args: CreateWalletVerificationChallengesParameters","client: Client","args: DeleteWalletVerificationParameters","client: Client","args: GetWalletVerificationsParameters","client: Client","args: VerifyWalletVerificationChallengeParameters","z","ApplicationAccessTokenSchema","UrlOrPathSchema","options: ClientOptions","validatedOptions: ClientOptions","verificationOptions?: WalletVerificationOptions","publicActions","options: GetChainIdOptions","validatedOptions: GetChainIdOptions","chains"],"sources":["../src/custom-actions/create-wallet.action.ts","../src/custom-actions/create-wallet-verification.action.ts","../src/custom-actions/create-wallet-verification-challenges.action.ts","../src/custom-actions/delete-wallet-verification.action.ts","../src/custom-actions/get-wallet-verifications.action.ts","../src/custom-actions/verify-wallet-verification-challenge.action.ts","../src/custom-actions/types/wallet-verification.enum.ts","../src/viem.ts"],"sourcesContent":["import type { Client } from \"viem\";\n\n/**\n * Information about the wallet to be created.\n */\nexport interface WalletInfo {\n /** The name of the wallet. */\n name: string;\n}\n\n/**\n * Parameters for creating a wallet.\n */\nexport interface CreateWalletParameters {\n /** The unique name of the key vault where the wallet will be created. */\n keyVaultId: string;\n /** Information about the wallet to be created. */\n walletInfo: WalletInfo;\n}\n\n/**\n * Response from creating a wallet.\n */\nexport interface CreateWalletResponse {\n /** The unique identifier of the wallet. */\n id: string;\n /** The name of the wallet. */\n name: string;\n /** The blockchain address of the wallet. */\n address: string;\n /** The HD derivation path used to create the wallet. */\n derivationPath: string;\n}\n\n/**\n * RPC schema for wallet creation.\n */\ntype WalletRpcSchema = {\n Method: \"user_createWallet\";\n Parameters: [keyVaultId: string, walletInfo: WalletInfo];\n ReturnType: CreateWalletResponse[];\n};\n\n/**\n * Creates a wallet action for the given client.\n * @param client - The viem client to use for the request.\n * @returns An object with a createWallet method.\n */\nexport function createWallet(client: Client) {\n return {\n /**\n * Creates a new wallet in the specified key vault.\n * @param args - The parameters for creating a wallet.\n * @returns A promise that resolves to an array of created wallet responses.\n */\n createWallet(args: CreateWalletParameters): Promise<CreateWalletResponse[]> {\n return client.request<WalletRpcSchema>({\n method: \"user_createWallet\",\n params: [args.keyVaultId, args.walletInfo],\n });\n },\n };\n}\n","import type { Client } from \"viem\";\nimport type { OTPAlgorithm, WalletVerificationType } from \"./types/wallet-verification.enum.js\";\n\n/**\n * Base interface for wallet verification information.\n */\ntype BaseWalletVerificationInfo = {\n /** The name of the verification method. */\n name: string;\n /** The type of verification method. */\n verificationType: WalletVerificationType;\n};\n\n/**\n * Information for PIN code verification.\n */\nexport interface WalletPincodeVerificationInfo extends BaseWalletVerificationInfo {\n /** The type of verification method. */\n verificationType: WalletVerificationType.PINCODE;\n /** The PIN code to use for verification. */\n pincode: string;\n}\n\n/**\n * Information for One-Time Password (OTP) verification.\n */\nexport interface WalletOTPVerificationInfo extends BaseWalletVerificationInfo {\n /** The type of verification method. */\n verificationType: WalletVerificationType.OTP;\n /** The hash algorithm to use for OTP generation. */\n algorithm?: OTPAlgorithm;\n /** The number of digits in the OTP code. */\n digits?: number;\n /** The time period in seconds for OTP validity. */\n period?: number;\n /** The issuer of the OTP. */\n issuer?: string;\n}\n\n/**\n * Information for secret recovery codes verification.\n */\nexport interface WalletSecretCodesVerificationInfo extends BaseWalletVerificationInfo {\n /** The type of verification method. */\n verificationType: WalletVerificationType.SECRET_CODES;\n}\n\n/**\n * Union type of all possible wallet verification information types.\n */\nexport type WalletVerificationInfo =\n | WalletPincodeVerificationInfo\n | WalletOTPVerificationInfo\n | WalletSecretCodesVerificationInfo;\n\n/**\n * Parameters for creating a wallet verification.\n */\nexport interface CreateWalletVerificationParameters {\n /** The wallet address for which to create the verification. */\n userWalletAddress: string;\n /** The verification information to create. */\n walletVerificationInfo: WalletVerificationInfo;\n}\n\n/**\n * Response from creating a wallet verification.\n */\nexport interface CreateWalletVerificationResponse {\n /** The unique identifier of the verification. */\n id: string;\n /** The name of the verification method. */\n name: string;\n /** The type of verification method. */\n verificationType: WalletVerificationType;\n /** Additional parameters specific to the verification type. */\n parameters: Record<string, string>;\n}\n\n/**\n * RPC schema for creating a wallet verification.\n */\ntype WalletRpcSchema = {\n Method: \"user_createWalletVerification\";\n Parameters: [userWalletAddress: string, walletVerificationInfo: WalletVerificationInfo];\n ReturnType: CreateWalletVerificationResponse[];\n};\n\n/**\n * Creates a wallet verification action for the given client.\n * @param client - The viem client to use for the request.\n * @returns An object with a createWalletVerification method.\n */\nexport function createWalletVerification(client: Client) {\n return {\n /**\n * Creates a new wallet verification.\n * @param args - The parameters for creating the verification.\n * @returns A promise that resolves to an array of created wallet verification responses.\n */\n createWalletVerification(args: CreateWalletVerificationParameters): Promise<CreateWalletVerificationResponse[]> {\n return client.request<WalletRpcSchema>({\n method: \"user_createWalletVerification\",\n params: [args.userWalletAddress, args.walletVerificationInfo],\n });\n },\n };\n}\n","import type { Client } from \"viem\";\nimport type { WalletVerificationType } from \"./types/wallet-verification.enum.js\";\nimport type { AddressOrObject } from \"./verify-wallet-verification-challenge.action.js\";\n\n/**\n * Parameters for creating wallet verification challenges.\n */\nexport interface CreateWalletVerificationChallengesParameters {\n /** The wallet address or object containing wallet address and optional verification ID. */\n addressOrObject: AddressOrObject;\n}\n\n/**\n * Represents a wallet verification challenge.\n */\nexport interface WalletVerificationChallenge {\n /** The unique identifier of the challenge. */\n id: string;\n /** The name of the challenge. */\n name: string;\n /** The type of verification required. */\n verificationType: WalletVerificationType;\n /** The challenge parameters specific to the verification type. */\n challenge: Record<string, string>;\n}\n\n/**\n * Response from creating wallet verification challenges.\n */\nexport type CreateWalletVerificationChallengesResponse = WalletVerificationChallenge[];\n\n/**\n * RPC schema for creating wallet verification challenges.\n */\ntype WalletRpcSchema = {\n Method: \"user_createWalletVerificationChallenges\";\n Parameters: [addressOrObject: AddressOrObject];\n ReturnType: CreateWalletVerificationChallengesResponse;\n};\n\n/**\n * Creates a wallet verification challenges action for the given client.\n * @param client - The viem client to use for the request.\n * @returns An object with a createWalletVerificationChallenges method.\n */\nexport function createWalletVerificationChallenges(client: Client) {\n return {\n /**\n * Creates verification challenges for a wallet.\n * @param args - The parameters for creating the challenges.\n * @returns A promise that resolves to an array of wallet verification challenges.\n */\n createWalletVerificationChallenges(\n args: CreateWalletVerificationChallengesParameters,\n ): Promise<CreateWalletVerificationChallengesResponse> {\n return client.request<WalletRpcSchema>({\n method: \"user_createWalletVerificationChallenges\",\n params: [args.addressOrObject],\n });\n },\n };\n}\n","import type { Client } from \"viem\";\n\n/**\n * Parameters for deleting a wallet verification.\n */\nexport interface DeleteWalletVerificationParameters {\n /** The wallet address for which to delete the verification. */\n userWalletAddress: string;\n /** The unique identifier of the verification to delete. */\n verificationId: string;\n}\n\n/**\n * Response from deleting a wallet verification.\n */\nexport interface DeleteWalletVerificationResponse {\n /** Whether the deletion was successful. */\n success: boolean;\n}\n\n/**\n * RPC schema for deleting a wallet verification.\n */\ntype WalletRpcSchema = {\n Method: \"user_deleteWalletVerification\";\n Parameters: [userWalletAddress: string, verificationId: string];\n ReturnType: DeleteWalletVerificationResponse[];\n};\n\n/**\n * Creates a wallet verification deletion action for the given client.\n * @param client - The viem client to use for the request.\n * @returns An object with a deleteWalletVerification method.\n */\nexport function deleteWalletVerification(client: Client) {\n return {\n /**\n * Deletes a wallet verification.\n * @param args - The parameters for deleting the verification.\n * @returns A promise that resolves to an array of deletion results.\n */\n deleteWalletVerification(args: DeleteWalletVerificationParameters): Promise<DeleteWalletVerificationResponse[]> {\n return client.request<WalletRpcSchema>({\n method: \"user_deleteWalletVerification\",\n params: [args.userWalletAddress, args.verificationId],\n });\n },\n };\n}\n","import type { Client } from \"viem\";\nimport type { WalletVerificationType } from \"./types/wallet-verification.enum.js\";\n\n/**\n * Parameters for getting wallet verifications.\n */\nexport interface GetWalletVerificationsParameters {\n /** The wallet address for which to fetch verifications. */\n userWalletAddress: string;\n}\n\n/**\n * Represents a wallet verification.\n */\nexport interface WalletVerification {\n /** The unique identifier of the verification. */\n id: string;\n /** The name of the verification method. */\n name: string;\n /** The type of verification method. */\n verificationType: WalletVerificationType;\n}\n\n/**\n * Response from getting wallet verifications.\n */\nexport type GetWalletVerificationsResponse = WalletVerification[];\n\n/**\n * RPC schema for getting wallet verifications.\n */\ntype WalletRpcSchema = {\n Method: \"user_walletVerifications\";\n Parameters: [userWalletAddress: string];\n ReturnType: GetWalletVerificationsResponse;\n};\n\n/**\n * Creates a wallet verifications retrieval action for the given client.\n * @param client - The viem client to use for the request.\n * @returns An object with a getWalletVerifications method.\n */\nexport function getWalletVerifications(client: Client) {\n return {\n /**\n * Gets all verifications for a wallet.\n * @param args - The parameters for getting the verifications.\n * @returns A promise that resolves to an array of wallet verifications.\n */\n getWalletVerifications(args: GetWalletVerificationsParameters): Promise<GetWalletVerificationsResponse> {\n return client.request<WalletRpcSchema>({\n method: \"user_walletVerifications\",\n params: [args.userWalletAddress],\n });\n },\n };\n}\n","import type { Client } from \"viem\";\n\n/**\n * Represents either a wallet address string or an object containing wallet address and optional verification ID.\n */\nexport type AddressOrObject =\n | string\n | {\n userWalletAddress: string;\n verificationId?: string;\n };\n\n/**\n * Parameters for verifying a wallet verification challenge.\n */\nexport interface VerifyWalletVerificationChallengeParameters {\n /** The wallet address or object containing wallet address and optional verification ID. */\n addressOrObject: AddressOrObject;\n /** The response to the verification challenge. */\n challengeResponse: string;\n}\n\n/**\n * Result of a wallet verification challenge.\n */\nexport interface VerificationResult {\n /** Whether the verification was successful. */\n verified: boolean;\n}\n\n/**\n * Response from verifying a wallet verification challenge.\n */\nexport type VerifyWalletVerificationChallengeResponse = VerificationResult[];\n\n/**\n * RPC schema for wallet verification challenge verification.\n */\ntype WalletRpcSchema = {\n Method: \"user_verifyWalletVerificationChallenge\";\n Parameters: [addressOrObject: AddressOrObject, challengeResponse: string];\n ReturnType: VerifyWalletVerificationChallengeResponse;\n};\n\n/**\n * Creates a wallet verification challenge verification action for the given client.\n * @param client - The viem client to use for the request.\n * @returns An object with a verifyWalletVerificationChallenge method.\n */\nexport function verifyWalletVerificationChallenge(client: Client) {\n return {\n /**\n * Verifies a wallet verification challenge.\n * @param args - The parameters for verifying the challenge.\n * @returns A promise that resolves to an array of verification results.\n */\n verifyWalletVerificationChallenge(\n args: VerifyWalletVerificationChallengeParameters,\n ): Promise<VerifyWalletVerificationChallengeResponse> {\n return client.request<WalletRpcSchema>({\n method: \"user_verifyWalletVerificationChallenge\",\n params: [args.addressOrObject, args.challengeResponse],\n });\n },\n };\n}\n","/**\n * Types of wallet verification methods supported by the system.\n * Used to identify different verification mechanisms when creating or managing wallet verifications.\n */\nexport enum WalletVerificationType {\n /** PIN code verification method */\n PINCODE = \"PINCODE\",\n /** One-Time Password verification method */\n OTP = \"OTP\",\n /** Secret recovery codes verification method */\n SECRET_CODES = \"SECRET_CODES\",\n}\n\n/**\n * Supported hash algorithms for One-Time Password (OTP) verification.\n * These algorithms determine the cryptographic function used to generate OTP codes.\n */\nexport enum OTPAlgorithm {\n /** SHA-1 hash algorithm */\n SHA1 = \"SHA1\",\n /** SHA-224 hash algorithm */\n SHA224 = \"SHA224\",\n /** SHA-256 hash algorithm */\n SHA256 = \"SHA256\",\n /** SHA-384 hash algorithm */\n SHA384 = \"SHA384\",\n /** SHA-512 hash algorithm */\n SHA512 = \"SHA512\",\n /** SHA3-224 hash algorithm */\n SHA3_224 = \"SHA3-224\",\n /** SHA3-256 hash algorithm */\n SHA3_256 = \"SHA3-256\",\n /** SHA3-384 hash algorithm */\n SHA3_384 = \"SHA3-384\",\n /** SHA3-512 hash algorithm */\n SHA3_512 = \"SHA3-512\",\n}\n","import { appendHeaders } from \"@settlemint/sdk-utils/http\";\nimport { ensureServer } from \"@settlemint/sdk-utils/runtime\";\nimport { ApplicationAccessTokenSchema, UrlOrPathSchema, validate } from \"@settlemint/sdk-utils/validation\";\nimport {\n createPublicClient,\n createWalletClient,\n defineChain,\n type HttpTransportConfig,\n http,\n publicActions,\n type Chain as ViemChain,\n} from \"viem\";\nimport * as chains from \"viem/chains\";\nimport { z } from \"zod\";\nimport { createWallet } from \"./custom-actions/create-wallet.action.js\";\nimport { createWalletVerification } from \"./custom-actions/create-wallet-verification.action.js\";\nimport { createWalletVerificationChallenges } from \"./custom-actions/create-wallet-verification-challenges.action.js\";\nimport { deleteWalletVerification } from \"./custom-actions/delete-wallet-verification.action.js\";\nimport { getWalletVerifications } from \"./custom-actions/get-wallet-verifications.action.js\";\nimport { verifyWalletVerificationChallenge } from \"./custom-actions/verify-wallet-verification-challenge.action.js\";\n\n/**\n * Schema for the viem client options.\n */\nexport const ClientOptionsSchema = z.object({\n /**\n * The access token\n */\n accessToken: ApplicationAccessTokenSchema.optional(),\n /**\n * The chain id\n */\n chainId: z.string(),\n /**\n * The chain name\n */\n chainName: z.string(),\n /**\n * The json rpc url\n */\n rpcUrl: UrlOrPathSchema,\n /**\n * The http transport config\n */\n httpTransportConfig: z.any().optional(),\n});\n\n/**\n * Type representing the validated client options.\n */\nexport type ClientOptions = Omit<z.infer<typeof ClientOptionsSchema>, \"httpTransportConfig\"> & {\n httpTransportConfig?: HttpTransportConfig;\n};\n\n/**\n * Get a public client. Use this if you need to read from the blockchain.\n * @param options - The options for the public client.\n * @returns The public client. see {@link https://viem.sh/docs/clients/public}\n * @example\n * ```ts\n * import { getPublicClient } from '@settlemint/sdk-viem';\n *\n * const publicClient = getPublicClient({\n * accessToken: process.env.SETTLEMINT_ACCESS_TOKEN,\n * chainId: process.env.SETTLEMINT_BLOCKCHAIN_NETWORK_CHAIN_ID!,\n * chainName: process.env.SETTLEMINT_BLOCKCHAIN_NETWORK!,\n * rpcUrl: process.env.SETTLEMINT_BLOCKCHAIN_NODE_OR_LOAD_BALANCER_JSON_RPC_ENDPOINT!,\n * });\n *\n * // Get the block number\n * const block = await publicClient.getBlockNumber();\n * console.log(block);\n * ```\n */\nexport const getPublicClient = (options: ClientOptions) => {\n ensureServer();\n const validatedOptions: ClientOptions = validate(ClientOptionsSchema, options);\n return createPublicClient({\n chain: getChain({\n chainId: validatedOptions.chainId,\n chainName: validatedOptions.chainName,\n rpcUrl: validatedOptions.rpcUrl,\n }),\n transport: http(validatedOptions.rpcUrl, {\n batch: true,\n timeout: 60_000,\n ...validatedOptions.httpTransportConfig,\n fetchOptions: {\n ...validatedOptions?.httpTransportConfig?.fetchOptions,\n headers: appendHeaders(validatedOptions?.httpTransportConfig?.fetchOptions?.headers, {\n \"x-auth-token\": validatedOptions.accessToken,\n }),\n },\n }),\n });\n};\n\n/**\n * The options for the wallet client.\n */\nexport interface WalletVerificationOptions {\n /**\n * The verification id (used for HD wallets), if not provided, the challenge response will be validated against all active verifications.\n */\n verificationId?: string;\n /**\n * The challenge response (used for HD wallets)\n */\n challengeResponse: string;\n}\n\n/**\n * Get a wallet client. Use this if you need to write to the blockchain.\n * @param options - The options for the wallet client.\n * @returns A function that returns a wallet client. The function can be called with verification options for HD wallets. see {@link https://viem.sh/docs/clients/wallet}\n * @example\n * ```ts\n * import { getWalletClient } from '@settlemint/sdk-viem';\n * import { parseAbi } from \"viem\";\n *\n * const walletClient = getWalletClient({\n * accessToken: process.env.SETTLEMINT_ACCESS_TOKEN,\n * chainId: process.env.SETTLEMINT_BLOCKCHAIN_NETWORK_CHAIN_ID!,\n * chainName: process.env.SETTLEMINT_BLOCKCHAIN_NETWORK!,\n * rpcUrl: process.env.SETTLEMINT_BLOCKCHAIN_NODE_OR_LOAD_BALANCER_JSON_RPC_ENDPOINT!,\n * });\n *\n * // Get the chain id\n * const chainId = await walletClient().getChainId();\n * console.log(chainId);\n *\n * // write to the blockchain\n * const transactionHash = await walletClient().writeContract({\n * account: \"0x0000000000000000000000000000000000000000\",\n * address: \"0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2\",\n * abi: parseAbi([\"function mint(uint32 tokenId) nonpayable\"]),\n * functionName: \"mint\",\n * args: [69420],\n * });\n * console.log(transactionHash);\n * ```\n */\nexport const getWalletClient = (options: ClientOptions) => {\n ensureServer();\n const validatedOptions: ClientOptions = validate(ClientOptionsSchema, options);\n const chain = getChain({\n chainId: validatedOptions.chainId,\n chainName: validatedOptions.chainName,\n rpcUrl: validatedOptions.rpcUrl,\n });\n return (verificationOptions?: WalletVerificationOptions) =>\n createWalletClient({\n chain: chain,\n transport: http(validatedOptions.rpcUrl, {\n batch: true,\n timeout: 60_000,\n ...validatedOptions.httpTransportConfig,\n fetchOptions: {\n ...validatedOptions?.httpTransportConfig?.fetchOptions,\n headers: appendHeaders(validatedOptions?.httpTransportConfig?.fetchOptions?.headers, {\n \"x-auth-token\": validatedOptions.accessToken,\n \"x-auth-challenge-response\": verificationOptions?.challengeResponse ?? \"\",\n \"x-auth-verification-id\": verificationOptions?.verificationId ?? \"\",\n }),\n },\n }),\n })\n .extend(publicActions)\n .extend(createWallet)\n .extend(getWalletVerifications)\n .extend(createWalletVerification)\n .extend(deleteWalletVerification)\n .extend(createWalletVerificationChallenges)\n .extend(verifyWalletVerificationChallenge);\n};\n\n/**\n * Schema for the viem client options.\n */\nexport const GetChainIdOptionsSchema = z.object({\n /**\n * The access token\n */\n accessToken: ApplicationAccessTokenSchema.optional(),\n /**\n * The json rpc url\n */\n rpcUrl: UrlOrPathSchema,\n /**\n * The http transport config\n */\n httpTransportConfig: z.any().optional(),\n});\n\n/**\n * Type representing the validated get chain id options.\n */\nexport type GetChainIdOptions = Omit<z.infer<typeof GetChainIdOptionsSchema>, \"httpTransportConfig\"> & {\n httpTransportConfig?: HttpTransportConfig;\n};\n\n/**\n * Get the chain id of a blockchain network.\n * @param options - The options for the public client.\n * @returns The chain id.\n * @example\n * ```ts\n * import { getChainId } from '@settlemint/sdk-viem';\n *\n * const chainId = await getChainId({\n * accessToken: process.env.SETTLEMINT_ACCESS_TOKEN,\n * rpcUrl: process.env.SETTLEMINT_BLOCKCHAIN_NODE_OR_LOAD_BALANCER_JSON_RPC_ENDPOINT!,\n * });\n * console.log(chainId);\n * ```\n */\nexport async function getChainId(options: GetChainIdOptions): Promise<number> {\n ensureServer();\n const validatedOptions: GetChainIdOptions = validate(GetChainIdOptionsSchema, options);\n const client = createPublicClient({\n transport: http(validatedOptions.rpcUrl, {\n ...validatedOptions.httpTransportConfig,\n fetchOptions: {\n ...validatedOptions?.httpTransportConfig?.fetchOptions,\n headers: appendHeaders(validatedOptions?.httpTransportConfig?.fetchOptions?.headers, {\n \"x-auth-token\": validatedOptions.accessToken,\n }),\n },\n }),\n });\n\n return client.getChainId();\n}\n\nfunction getChain({ chainId, chainName, rpcUrl }: Pick<ClientOptions, \"chainId\" | \"chainName\" | \"rpcUrl\">): ViemChain {\n const knownChain = Object.values(chains).find((chain) => chain.id.toString() === chainId);\n return (\n knownChain ??\n defineChain({\n id: Number(chainId),\n name: chainName,\n rpcUrls: {\n default: {\n http: [rpcUrl],\n },\n },\n nativeCurrency: {\n decimals: 18,\n name: \"Ether\",\n symbol: \"ETH\",\n },\n })\n );\n}\n\nexport type {\n CreateWalletParameters,\n CreateWalletResponse,\n WalletInfo,\n} from \"./custom-actions/create-wallet.action.js\";\nexport type {\n CreateWalletVerificationParameters,\n CreateWalletVerificationResponse,\n WalletOTPVerificationInfo,\n WalletPincodeVerificationInfo,\n WalletSecretCodesVerificationInfo,\n WalletVerificationInfo,\n} from \"./custom-actions/create-wallet-verification.action.js\";\nexport type {\n CreateWalletVerificationChallengesParameters,\n CreateWalletVerificationChallengesResponse,\n WalletVerificationChallenge,\n} from \"./custom-actions/create-wallet-verification-challenges.action.js\";\nexport type {\n DeleteWalletVerificationParameters,\n DeleteWalletVerificationResponse,\n} from \"./custom-actions/delete-wallet-verification.action.js\";\nexport type {\n GetWalletVerificationsParameters,\n GetWalletVerificationsResponse,\n WalletVerification,\n} from \"./custom-actions/get-wallet-verifications.action.js\";\nexport { OTPAlgorithm, WalletVerificationType } from \"./custom-actions/types/wallet-verification.enum.js\";\nexport type {\n AddressOrObject,\n VerificationResult,\n VerifyWalletVerificationChallengeParameters,\n VerifyWalletVerificationChallengeResponse,\n} from \"./custom-actions/verify-wallet-verification-challenge.action.js\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgDA,SAAgB,aAAaA,QAAgB;AAC3C,QAAO,EAML,aAAaC,MAA+D;AAC1E,SAAO,OAAO,QAAyB;GACrC,QAAQ;GACR,QAAQ,CAAC,KAAK,YAAY,KAAK,UAAW;EAC3C,EAAC;CACH,EACF;AACF;;;;;;;;;AC+BD,SAAgB,yBAAyBC,QAAgB;AACvD,QAAO,EAML,yBAAyBC,MAAuF;AAC9G,SAAO,OAAO,QAAyB;GACrC,QAAQ;GACR,QAAQ,CAAC,KAAK,mBAAmB,KAAK,sBAAuB;EAC9D,EAAC;CACH,EACF;AACF;;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qBAAqB,cAAc,SAAS,EACnF,gBAAgB,iBAAiB,YAClC,EAAC;EACH;CACF,EAAC,CACH,EAAC;AAEF,QAAO,OAAO,YAAY;AAC3B;AAED,SAAS,SAAS,EAAE,SAAS,WAAW,QAAiE,EAAa;CACpH,MAAM,aAAa,OAAO,OAAOC,YAAO,CAAC,KAAK,CAAC,UAAU,MAAM,GAAG,UAAU,KAAK,QAAQ;AACzF,QACE,oCACY;EACV,IAAI,OAAO,QAAQ;EACnB,MAAM;EACN,SAAS,EACP,SAAS,EACP,MAAM,CAAC,MAAO,EACf,EACF;EACD,gBAAgB;GACd,UAAU;GACV,MAAM;GACN,QAAQ;EACT;CACF,EAAC;AAEL"}
|
package/dist/viem.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"viem.js","names":["client: Client","args: CreateWalletParameters","client: Client","args: CreateWalletVerificationParameters","client: Client","args: CreateWalletVerificationChallengesParameters","client: Client","args: DeleteWalletVerificationParameters","client: Client","args: GetWalletVerificationsParameters","client: Client","args: VerifyWalletVerificationChallengeParameters","options: ClientOptions","validatedOptions: ClientOptions","verificationOptions?: WalletVerificationOptions","options: GetChainIdOptions","validatedOptions: GetChainIdOptions"],"sources":["../src/custom-actions/create-wallet.action.ts","../src/custom-actions/create-wallet-verification.action.ts","../src/custom-actions/create-wallet-verification-challenges.action.ts","../src/custom-actions/delete-wallet-verification.action.ts","../src/custom-actions/get-wallet-verifications.action.ts","../src/custom-actions/verify-wallet-verification-challenge.action.ts","../src/custom-actions/types/wallet-verification.enum.ts","../src/viem.ts"],"sourcesContent":["import type { Client } from \"viem\";\n\n/**\n * Information about the wallet to be created.\n */\nexport interface WalletInfo {\n /** The name of the wallet. */\n name: string;\n}\n\n/**\n * Parameters for creating a wallet.\n */\nexport interface CreateWalletParameters {\n /** The unique name of the key vault where the wallet will be created. */\n keyVaultId: string;\n /** Information about the wallet to be created. */\n walletInfo: WalletInfo;\n}\n\n/**\n * Response from creating a wallet.\n */\nexport interface CreateWalletResponse {\n /** The unique identifier of the wallet. */\n id: string;\n /** The name of the wallet. */\n name: string;\n /** The blockchain address of the wallet. */\n address: string;\n /** The HD derivation path used to create the wallet. */\n derivationPath: string;\n}\n\n/**\n * RPC schema for wallet creation.\n */\ntype WalletRpcSchema = {\n Method: \"user_createWallet\";\n Parameters: [keyVaultId: string, walletInfo: WalletInfo];\n ReturnType: CreateWalletResponse[];\n};\n\n/**\n * Creates a wallet action for the given client.\n * @param client - The viem client to use for the request.\n * @returns An object with a createWallet method.\n */\nexport function createWallet(client: Client) {\n return {\n /**\n * Creates a new wallet in the specified key vault.\n * @param args - The parameters for creating a wallet.\n * @returns A promise that resolves to an array of created wallet responses.\n */\n createWallet(args: CreateWalletParameters): Promise<CreateWalletResponse[]> {\n return client.request<WalletRpcSchema>({\n method: \"user_createWallet\",\n params: [args.keyVaultId, args.walletInfo],\n });\n },\n };\n}\n","import type { Client } from \"viem\";\nimport type { OTPAlgorithm, WalletVerificationType } from \"./types/wallet-verification.enum.js\";\n\n/**\n * Base interface for wallet verification information.\n */\ntype BaseWalletVerificationInfo = {\n /** The name of the verification method. */\n name: string;\n /** The type of verification method. */\n verificationType: WalletVerificationType;\n};\n\n/**\n * Information for PIN code verification.\n */\nexport interface WalletPincodeVerificationInfo extends BaseWalletVerificationInfo {\n /** The type of verification method. */\n verificationType: WalletVerificationType.PINCODE;\n /** The PIN code to use for verification. */\n pincode: string;\n}\n\n/**\n * Information for One-Time Password (OTP) verification.\n */\nexport interface WalletOTPVerificationInfo extends BaseWalletVerificationInfo {\n /** The type of verification method. */\n verificationType: WalletVerificationType.OTP;\n /** The hash algorithm to use for OTP generation. */\n algorithm?: OTPAlgorithm;\n /** The number of digits in the OTP code. */\n digits?: number;\n /** The time period in seconds for OTP validity. */\n period?: number;\n /** The issuer of the OTP. */\n issuer?: string;\n}\n\n/**\n * Information for secret recovery codes verification.\n */\nexport interface WalletSecretCodesVerificationInfo extends BaseWalletVerificationInfo {\n /** The type of verification method. */\n verificationType: WalletVerificationType.SECRET_CODES;\n}\n\n/**\n * Union type of all possible wallet verification information types.\n */\nexport type WalletVerificationInfo =\n | WalletPincodeVerificationInfo\n | WalletOTPVerificationInfo\n | WalletSecretCodesVerificationInfo;\n\n/**\n * Parameters for creating a wallet verification.\n */\nexport interface CreateWalletVerificationParameters {\n /** The wallet address for which to create the verification. */\n userWalletAddress: string;\n /** The verification information to create. */\n walletVerificationInfo: WalletVerificationInfo;\n}\n\n/**\n * Response from creating a wallet verification.\n */\nexport interface CreateWalletVerificationResponse {\n /** The unique identifier of the verification. */\n id: string;\n /** The name of the verification method. */\n name: string;\n /** The type of verification method. */\n verificationType: WalletVerificationType;\n /** Additional parameters specific to the verification type. */\n parameters: Record<string, string>;\n}\n\n/**\n * RPC schema for creating a wallet verification.\n */\ntype WalletRpcSchema = {\n Method: \"user_createWalletVerification\";\n Parameters: [userWalletAddress: string, walletVerificationInfo: WalletVerificationInfo];\n ReturnType: CreateWalletVerificationResponse[];\n};\n\n/**\n * Creates a wallet verification action for the given client.\n * @param client - The viem client to use for the request.\n * @returns An object with a createWalletVerification method.\n */\nexport function createWalletVerification(client: Client) {\n return {\n /**\n * Creates a new wallet verification.\n * @param args - The parameters for creating the verification.\n * @returns A promise that resolves to an array of created wallet verification responses.\n */\n createWalletVerification(args: CreateWalletVerificationParameters): Promise<CreateWalletVerificationResponse[]> {\n return client.request<WalletRpcSchema>({\n method: \"user_createWalletVerification\",\n params: [args.userWalletAddress, args.walletVerificationInfo],\n });\n },\n };\n}\n","import type { Client } from \"viem\";\nimport type { WalletVerificationType } from \"./types/wallet-verification.enum.js\";\nimport type { AddressOrObject } from \"./verify-wallet-verification-challenge.action.js\";\n\n/**\n * Parameters for creating wallet verification challenges.\n */\nexport interface CreateWalletVerificationChallengesParameters {\n /** The wallet address or object containing wallet address and optional verification ID. */\n addressOrObject: AddressOrObject;\n}\n\n/**\n * Represents a wallet verification challenge.\n */\nexport interface WalletVerificationChallenge {\n /** The unique identifier of the challenge. */\n id: string;\n /** The name of the challenge. */\n name: string;\n /** The type of verification required. */\n verificationType: WalletVerificationType;\n /** The challenge parameters specific to the verification type. */\n challenge: Record<string, string>;\n}\n\n/**\n * Response from creating wallet verification challenges.\n */\nexport type CreateWalletVerificationChallengesResponse = WalletVerificationChallenge[];\n\n/**\n * RPC schema for creating wallet verification challenges.\n */\ntype WalletRpcSchema = {\n Method: \"user_createWalletVerificationChallenges\";\n Parameters: [addressOrObject: AddressOrObject];\n ReturnType: CreateWalletVerificationChallengesResponse;\n};\n\n/**\n * Creates a wallet verification challenges action for the given client.\n * @param client - The viem client to use for the request.\n * @returns An object with a createWalletVerificationChallenges method.\n */\nexport function createWalletVerificationChallenges(client: Client) {\n return {\n /**\n * Creates verification challenges for a wallet.\n * @param args - The parameters for creating the challenges.\n * @returns A promise that resolves to an array of wallet verification challenges.\n */\n createWalletVerificationChallenges(\n args: CreateWalletVerificationChallengesParameters,\n ): Promise<CreateWalletVerificationChallengesResponse> {\n return client.request<WalletRpcSchema>({\n method: \"user_createWalletVerificationChallenges\",\n params: [args.addressOrObject],\n });\n },\n };\n}\n","import type { Client } from \"viem\";\n\n/**\n * Parameters for deleting a wallet verification.\n */\nexport interface DeleteWalletVerificationParameters {\n /** The wallet address for which to delete the verification. */\n userWalletAddress: string;\n /** The unique identifier of the verification to delete. */\n verificationId: string;\n}\n\n/**\n * Response from deleting a wallet verification.\n */\nexport interface DeleteWalletVerificationResponse {\n /** Whether the deletion was successful. */\n success: boolean;\n}\n\n/**\n * RPC schema for deleting a wallet verification.\n */\ntype WalletRpcSchema = {\n Method: \"user_deleteWalletVerification\";\n Parameters: [userWalletAddress: string, verificationId: string];\n ReturnType: DeleteWalletVerificationResponse[];\n};\n\n/**\n * Creates a wallet verification deletion action for the given client.\n * @param client - The viem client to use for the request.\n * @returns An object with a deleteWalletVerification method.\n */\nexport function deleteWalletVerification(client: Client) {\n return {\n /**\n * Deletes a wallet verification.\n * @param args - The parameters for deleting the verification.\n * @returns A promise that resolves to an array of deletion results.\n */\n deleteWalletVerification(args: DeleteWalletVerificationParameters): Promise<DeleteWalletVerificationResponse[]> {\n return client.request<WalletRpcSchema>({\n method: \"user_deleteWalletVerification\",\n params: [args.userWalletAddress, args.verificationId],\n });\n },\n };\n}\n","import type { Client } from \"viem\";\nimport type { WalletVerificationType } from \"./types/wallet-verification.enum.js\";\n\n/**\n * Parameters for getting wallet verifications.\n */\nexport interface GetWalletVerificationsParameters {\n /** The wallet address for which to fetch verifications. */\n userWalletAddress: string;\n}\n\n/**\n * Represents a wallet verification.\n */\nexport interface WalletVerification {\n /** The unique identifier of the verification. */\n id: string;\n /** The name of the verification method. */\n name: string;\n /** The type of verification method. */\n verificationType: WalletVerificationType;\n}\n\n/**\n * Response from getting wallet verifications.\n */\nexport type GetWalletVerificationsResponse = WalletVerification[];\n\n/**\n * RPC schema for getting wallet verifications.\n */\ntype WalletRpcSchema = {\n Method: \"user_walletVerifications\";\n Parameters: [userWalletAddress: string];\n ReturnType: GetWalletVerificationsResponse;\n};\n\n/**\n * Creates a wallet verifications retrieval action for the given client.\n * @param client - The viem client to use for the request.\n * @returns An object with a getWalletVerifications method.\n */\nexport function getWalletVerifications(client: Client) {\n return {\n /**\n * Gets all verifications for a wallet.\n * @param args - The parameters for getting the verifications.\n * @returns A promise that resolves to an array of wallet verifications.\n */\n getWalletVerifications(args: GetWalletVerificationsParameters): Promise<GetWalletVerificationsResponse> {\n return client.request<WalletRpcSchema>({\n method: \"user_walletVerifications\",\n params: [args.userWalletAddress],\n });\n },\n };\n}\n","import type { Client } from \"viem\";\n\n/**\n * Represents either a wallet address string or an object containing wallet address and optional verification ID.\n */\nexport type AddressOrObject =\n | string\n | {\n userWalletAddress: string;\n verificationId?: string;\n };\n\n/**\n * Parameters for verifying a wallet verification challenge.\n */\nexport interface VerifyWalletVerificationChallengeParameters {\n /** The wallet address or object containing wallet address and optional verification ID. */\n addressOrObject: AddressOrObject;\n /** The response to the verification challenge. */\n challengeResponse: string;\n}\n\n/**\n * Result of a wallet verification challenge.\n */\nexport interface VerificationResult {\n /** Whether the verification was successful. */\n verified: boolean;\n}\n\n/**\n * Response from verifying a wallet verification challenge.\n */\nexport type VerifyWalletVerificationChallengeResponse = VerificationResult[];\n\n/**\n * RPC schema for wallet verification challenge verification.\n */\ntype WalletRpcSchema = {\n Method: \"user_verifyWalletVerificationChallenge\";\n Parameters: [addressOrObject: AddressOrObject, challengeResponse: string];\n ReturnType: VerifyWalletVerificationChallengeResponse;\n};\n\n/**\n * Creates a wallet verification challenge verification action for the given client.\n * @param client - The viem client to use for the request.\n * @returns An object with a verifyWalletVerificationChallenge method.\n */\nexport function verifyWalletVerificationChallenge(client: Client) {\n return {\n /**\n * Verifies a wallet verification challenge.\n * @param args - The parameters for verifying the challenge.\n * @returns A promise that resolves to an array of verification results.\n */\n verifyWalletVerificationChallenge(\n args: VerifyWalletVerificationChallengeParameters,\n ): Promise<VerifyWalletVerificationChallengeResponse> {\n return client.request<WalletRpcSchema>({\n method: \"user_verifyWalletVerificationChallenge\",\n params: [args.addressOrObject, args.challengeResponse],\n });\n },\n };\n}\n","/**\n * Types of wallet verification methods supported by the system.\n * Used to identify different verification mechanisms when creating or managing wallet verifications.\n */\nexport enum WalletVerificationType {\n /** PIN code verification method */\n PINCODE = \"PINCODE\",\n /** One-Time Password verification method */\n OTP = \"OTP\",\n /** Secret recovery codes verification method */\n SECRET_CODES = \"SECRET_CODES\",\n}\n\n/**\n * Supported hash algorithms for One-Time Password (OTP) verification.\n * These algorithms determine the cryptographic function used to generate OTP codes.\n */\nexport enum OTPAlgorithm {\n /** SHA-1 hash algorithm */\n SHA1 = \"SHA1\",\n /** SHA-224 hash algorithm */\n SHA224 = \"SHA224\",\n /** SHA-256 hash algorithm */\n SHA256 = \"SHA256\",\n /** SHA-384 hash algorithm */\n SHA384 = \"SHA384\",\n /** SHA-512 hash algorithm */\n SHA512 = \"SHA512\",\n /** SHA3-224 hash algorithm */\n SHA3_224 = \"SHA3-224\",\n /** SHA3-256 hash algorithm */\n SHA3_256 = \"SHA3-256\",\n /** SHA3-384 hash algorithm */\n SHA3_384 = \"SHA3-384\",\n /** SHA3-512 hash algorithm */\n SHA3_512 = \"SHA3-512\",\n}\n","import { appendHeaders } from \"@settlemint/sdk-utils/http\";\nimport { ensureServer } from \"@settlemint/sdk-utils/runtime\";\nimport { ApplicationAccessTokenSchema, UrlOrPathSchema, validate } from \"@settlemint/sdk-utils/validation\";\nimport {\n createPublicClient,\n createWalletClient,\n defineChain,\n type HttpTransportConfig,\n http,\n publicActions,\n type Chain as ViemChain,\n} from \"viem\";\nimport * as chains from \"viem/chains\";\nimport { z } from \"zod\";\nimport { createWallet } from \"./custom-actions/create-wallet.action.js\";\nimport { createWalletVerification } from \"./custom-actions/create-wallet-verification.action.js\";\nimport { createWalletVerificationChallenges } from \"./custom-actions/create-wallet-verification-challenges.action.js\";\nimport { deleteWalletVerification } from \"./custom-actions/delete-wallet-verification.action.js\";\nimport { getWalletVerifications } from \"./custom-actions/get-wallet-verifications.action.js\";\nimport { verifyWalletVerificationChallenge } from \"./custom-actions/verify-wallet-verification-challenge.action.js\";\n\n/**\n * Schema for the viem client options.\n */\nexport const ClientOptionsSchema = z.object({\n /**\n * The access token\n */\n accessToken: ApplicationAccessTokenSchema.optional(),\n /**\n * The chain id\n */\n chainId: z.string(),\n /**\n * The chain name\n */\n chainName: z.string(),\n /**\n * The json rpc url\n */\n rpcUrl: UrlOrPathSchema,\n /**\n * The http transport config\n */\n httpTransportConfig: z.any().optional(),\n});\n\n/**\n * Type representing the validated client options.\n */\nexport type ClientOptions = Omit<z.infer<typeof ClientOptionsSchema>, \"httpTransportConfig\"> & {\n httpTransportConfig?: HttpTransportConfig;\n};\n\n/**\n * Get a public client. Use this if you need to read from the blockchain.\n * @param options - The options for the public client.\n * @returns The public client. see {@link https://viem.sh/docs/clients/public}\n * @example\n * ```ts\n * import { getPublicClient } from '@settlemint/sdk-viem';\n *\n * const publicClient = getPublicClient({\n * accessToken: process.env.SETTLEMINT_ACCESS_TOKEN,\n * chainId: process.env.SETTLEMINT_BLOCKCHAIN_NETWORK_CHAIN_ID!,\n * chainName: process.env.SETTLEMINT_BLOCKCHAIN_NETWORK!,\n * rpcUrl: process.env.SETTLEMINT_BLOCKCHAIN_NODE_OR_LOAD_BALANCER_JSON_RPC_ENDPOINT!,\n * });\n *\n * // Get the block number\n * const block = await publicClient.getBlockNumber();\n * console.log(block);\n * ```\n */\nexport const getPublicClient = (options: ClientOptions) => {\n ensureServer();\n const validatedOptions: ClientOptions = validate(ClientOptionsSchema, options);\n return createPublicClient({\n chain: getChain({\n chainId: validatedOptions.chainId,\n chainName: validatedOptions.chainName,\n rpcUrl: validatedOptions.rpcUrl,\n }),\n transport: http(validatedOptions.rpcUrl, {\n batch: true,\n timeout: 60_000,\n ...validatedOptions.httpTransportConfig,\n fetchOptions: {\n ...validatedOptions?.httpTransportConfig?.fetchOptions,\n headers: appendHeaders(validatedOptions?.httpTransportConfig?.fetchOptions?.headers, {\n \"x-auth-token\": validatedOptions.accessToken,\n }),\n },\n }),\n });\n};\n\n/**\n * The options for the wallet client.\n */\nexport interface WalletVerificationOptions {\n /**\n * The verification id (used for HD wallets), if not provided, the challenge response will be validated against all active verifications.\n */\n verificationId?: string;\n /**\n * The challenge response (used for HD wallets)\n */\n challengeResponse: string;\n}\n\n/**\n * Get a wallet client. Use this if you need to write to the blockchain.\n * @param options - The options for the wallet client.\n * @returns A function that returns a wallet client. The function can be called with verification options for HD wallets. see {@link https://viem.sh/docs/clients/wallet}\n * @example\n * ```ts\n * import { getWalletClient } from '@settlemint/sdk-viem';\n * import { parseAbi } from \"viem\";\n *\n * const walletClient = getWalletClient({\n * accessToken: process.env.SETTLEMINT_ACCESS_TOKEN,\n * chainId: process.env.SETTLEMINT_BLOCKCHAIN_NETWORK_CHAIN_ID!,\n * chainName: process.env.SETTLEMINT_BLOCKCHAIN_NETWORK!,\n * rpcUrl: process.env.SETTLEMINT_BLOCKCHAIN_NODE_OR_LOAD_BALANCER_JSON_RPC_ENDPOINT!,\n * });\n *\n * // Get the chain id\n * const chainId = await walletClient().getChainId();\n * console.log(chainId);\n *\n * // write to the blockchain\n * const transactionHash = await walletClient().writeContract({\n * account: \"0x0000000000000000000000000000000000000000\",\n * address: \"0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2\",\n * abi: parseAbi([\"function mint(uint32 tokenId) nonpayable\"]),\n * functionName: \"mint\",\n * args: [69420],\n * });\n * console.log(transactionHash);\n * ```\n */\nexport const getWalletClient = (options: ClientOptions) => {\n ensureServer();\n const validatedOptions: ClientOptions = validate(ClientOptionsSchema, options);\n const chain = getChain({\n chainId: validatedOptions.chainId,\n chainName: validatedOptions.chainName,\n rpcUrl: validatedOptions.rpcUrl,\n });\n return (verificationOptions?: WalletVerificationOptions) =>\n createWalletClient({\n chain: chain,\n transport: http(validatedOptions.rpcUrl, {\n batch: true,\n timeout: 60_000,\n ...validatedOptions.httpTransportConfig,\n fetchOptions: {\n ...validatedOptions?.httpTransportConfig?.fetchOptions,\n headers: appendHeaders(validatedOptions?.httpTransportConfig?.fetchOptions?.headers, {\n \"x-auth-token\": validatedOptions.accessToken,\n \"x-auth-challenge-response\": verificationOptions?.challengeResponse ?? \"\",\n \"x-auth-verification-id\": verificationOptions?.verificationId ?? \"\",\n }),\n },\n }),\n })\n .extend(publicActions)\n .extend(createWallet)\n .extend(getWalletVerifications)\n .extend(createWalletVerification)\n .extend(deleteWalletVerification)\n .extend(createWalletVerificationChallenges)\n .extend(verifyWalletVerificationChallenge);\n};\n\n/**\n * Schema for the viem client options.\n */\nexport const GetChainIdOptionsSchema = z.object({\n /**\n * The access token\n */\n accessToken: ApplicationAccessTokenSchema.optional(),\n /**\n * The json rpc url\n */\n rpcUrl: UrlOrPathSchema,\n /**\n * The http transport config\n */\n httpTransportConfig: z.any().optional(),\n});\n\n/**\n * Type representing the validated get chain id options.\n */\nexport type GetChainIdOptions = Omit<z.infer<typeof GetChainIdOptionsSchema>, \"httpTransportConfig\"> & {\n httpTransportConfig?: HttpTransportConfig;\n};\n\n/**\n * Get the chain id of a blockchain network.\n * @param options - The options for the public client.\n * @returns The chain id.\n * @example\n * ```ts\n * import { getChainId } from '@settlemint/sdk-viem';\n *\n * const chainId = await getChainId({\n * accessToken: process.env.SETTLEMINT_ACCESS_TOKEN,\n * rpcUrl: process.env.SETTLEMINT_BLOCKCHAIN_NODE_OR_LOAD_BALANCER_JSON_RPC_ENDPOINT!,\n * });\n * console.log(chainId);\n * ```\n */\nexport async function getChainId(options: GetChainIdOptions): Promise<number> {\n ensureServer();\n const validatedOptions: GetChainIdOptions = validate(GetChainIdOptionsSchema, options);\n const client = createPublicClient({\n transport: http(validatedOptions.rpcUrl, {\n ...validatedOptions.httpTransportConfig,\n fetchOptions: {\n ...validatedOptions?.httpTransportConfig?.fetchOptions,\n headers: appendHeaders(validatedOptions?.httpTransportConfig?.fetchOptions?.headers, {\n \"x-auth-token\": validatedOptions.accessToken,\n }),\n },\n }),\n });\n\n return client.getChainId();\n}\n\nfunction getChain({ chainId, chainName, rpcUrl }: Pick<ClientOptions, \"chainId\" | \"chainName\" | \"rpcUrl\">): ViemChain {\n const knownChain = Object.values(chains).find((chain) => chain.id.toString() === chainId);\n return (\n knownChain ??\n defineChain({\n id: Number(chainId),\n name: chainName,\n rpcUrls: {\n default: {\n http: [rpcUrl],\n },\n },\n nativeCurrency: {\n decimals: 18,\n name: \"Ether\",\n symbol: \"ETH\",\n },\n })\n );\n}\n\nexport type {\n CreateWalletParameters,\n CreateWalletResponse,\n WalletInfo,\n} from \"./custom-actions/create-wallet.action.js\";\nexport type {\n CreateWalletVerificationParameters,\n CreateWalletVerificationResponse,\n WalletOTPVerificationInfo,\n WalletPincodeVerificationInfo,\n WalletSecretCodesVerificationInfo,\n WalletVerificationInfo,\n} from \"./custom-actions/create-wallet-verification.action.js\";\nexport type {\n CreateWalletVerificationChallengesParameters,\n CreateWalletVerificationChallengesResponse,\n WalletVerificationChallenge,\n} from \"./custom-actions/create-wallet-verification-challenges.action.js\";\nexport type {\n DeleteWalletVerificationParameters,\n DeleteWalletVerificationResponse,\n} from \"./custom-actions/delete-wallet-verification.action.js\";\nexport type {\n GetWalletVerificationsParameters,\n GetWalletVerificationsResponse,\n WalletVerification,\n} from \"./custom-actions/get-wallet-verifications.action.js\";\nexport { OTPAlgorithm, WalletVerificationType } from \"./custom-actions/types/wallet-verification.enum.js\";\nexport type {\n AddressOrObject,\n VerificationResult,\n VerifyWalletVerificationChallengeParameters,\n VerifyWalletVerificationChallengeResponse,\n} from \"./custom-actions/verify-wallet-verification-challenge.action.js\";\n"],"mappings":";;;;;;;;;;;;;;AAgDA,SAAgB,aAAaA,QAAgB;AAC3C,QAAO,EAML,aAAaC,MAA+D;AAC1E,SAAO,OAAO,QAAyB;GACrC,QAAQ;GACR,QAAQ,CAAC,KAAK,YAAY,KAAK,UAAW;EAC3C,EAAC;CACH,EACF;AACF;;;;;;;;;AC+BD,SAAgB,yBAAyBC,QAAgB;AACvD,QAAO,EAML,yBAAyBC,MAAuF;AAC9G,SAAO,OAAO,QAAyB;GACrC,QAAQ;GACR,QAAQ,CAAC,KAAK,mBAAmB,KAAK,sBAAuB;EAC9D,EAAC;CACH,EACF;AACF;;;;;;;;;AC9DD,SAAgB,mCAAmCC,QAAgB;AACjE,QAAO,EAML,mCACEC,MACqD;AACrD,SAAO,OAAO,QAAyB;GACrC,QAAQ;GACR,QAAQ,CAAC,KAAK,eAAgB;EAC/B,EAAC;CACH,EACF;AACF;;;;;;;;;AC3BD,SAAgB,yBAAyBC,QAAgB;AACvD,QAAO,EAML,yBAAyBC,MAAuF;AAC9G,SAAO,OAAO,QAAyB;GACrC,QAAQ;GACR,QAAQ,CAAC,KAAK,mBAAmB,KAAK,cAAe;EACtD,EAAC;CACH,EACF;AACF;;;;;;;;;ACND,SAAgB,uBAAuBC,QAAgB;AACrD,QAAO,EAML,uBAAuBC,MAAiF;AACtG,SAAO,OAAO,QAAyB;GACrC,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AM,CAAC,MAAO,EACf,EACF;EACD,gBAAgB;GACd,UAAU;GACV,MAAM;GACN,QAAQ;EACT;CACF,EAAC;AAEL"}
|
|
1
|
+
{"version":3,"file":"viem.js","names":["client: Client","args: CreateWalletParameters","client: Client","args: CreateWalletVerificationParameters","client: Client","args: CreateWalletVerificationChallengesParameters","client: Client","args: DeleteWalletVerificationParameters","client: Client","args: GetWalletVerificationsParameters","client: Client","args: VerifyWalletVerificationChallengeParameters","options: ClientOptions","validatedOptions: ClientOptions","verificationOptions?: WalletVerificationOptions","options: GetChainIdOptions","validatedOptions: GetChainIdOptions"],"sources":["../src/custom-actions/create-wallet.action.ts","../src/custom-actions/create-wallet-verification.action.ts","../src/custom-actions/create-wallet-verification-challenges.action.ts","../src/custom-actions/delete-wallet-verification.action.ts","../src/custom-actions/get-wallet-verifications.action.ts","../src/custom-actions/verify-wallet-verification-challenge.action.ts","../src/custom-actions/types/wallet-verification.enum.ts","../src/viem.ts"],"sourcesContent":["import type { Client } from \"viem\";\n\n/**\n * Information about the wallet to be created.\n */\nexport interface WalletInfo {\n /** The name of the wallet. */\n name: string;\n}\n\n/**\n * Parameters for creating a wallet.\n */\nexport interface CreateWalletParameters {\n /** The unique name of the key vault where the wallet will be created. */\n keyVaultId: string;\n /** Information about the wallet to be created. */\n walletInfo: WalletInfo;\n}\n\n/**\n * Response from creating a wallet.\n */\nexport interface CreateWalletResponse {\n /** The unique identifier of the wallet. */\n id: string;\n /** The name of the wallet. */\n name: string;\n /** The blockchain address of the wallet. */\n address: string;\n /** The HD derivation path used to create the wallet. */\n derivationPath: string;\n}\n\n/**\n * RPC schema for wallet creation.\n */\ntype WalletRpcSchema = {\n Method: \"user_createWallet\";\n Parameters: [keyVaultId: string, walletInfo: WalletInfo];\n ReturnType: CreateWalletResponse[];\n};\n\n/**\n * Creates a wallet action for the given client.\n * @param client - The viem client to use for the request.\n * @returns An object with a createWallet method.\n */\nexport function createWallet(client: Client) {\n return {\n /**\n * Creates a new wallet in the specified key vault.\n * @param args - The parameters for creating a wallet.\n * @returns A promise that resolves to an array of created wallet responses.\n */\n createWallet(args: CreateWalletParameters): Promise<CreateWalletResponse[]> {\n return client.request<WalletRpcSchema>({\n method: \"user_createWallet\",\n params: [args.keyVaultId, args.walletInfo],\n });\n },\n };\n}\n","import type { Client } from \"viem\";\nimport type { OTPAlgorithm, WalletVerificationType } from \"./types/wallet-verification.enum.js\";\n\n/**\n * Base interface for wallet verification information.\n */\ntype BaseWalletVerificationInfo = {\n /** The name of the verification method. */\n name: string;\n /** The type of verification method. */\n verificationType: WalletVerificationType;\n};\n\n/**\n * Information for PIN code verification.\n */\nexport interface WalletPincodeVerificationInfo extends BaseWalletVerificationInfo {\n /** The type of verification method. */\n verificationType: WalletVerificationType.PINCODE;\n /** The PIN code to use for verification. */\n pincode: string;\n}\n\n/**\n * Information for One-Time Password (OTP) verification.\n */\nexport interface WalletOTPVerificationInfo extends BaseWalletVerificationInfo {\n /** The type of verification method. */\n verificationType: WalletVerificationType.OTP;\n /** The hash algorithm to use for OTP generation. */\n algorithm?: OTPAlgorithm;\n /** The number of digits in the OTP code. */\n digits?: number;\n /** The time period in seconds for OTP validity. */\n period?: number;\n /** The issuer of the OTP. */\n issuer?: string;\n}\n\n/**\n * Information for secret recovery codes verification.\n */\nexport interface WalletSecretCodesVerificationInfo extends BaseWalletVerificationInfo {\n /** The type of verification method. */\n verificationType: WalletVerificationType.SECRET_CODES;\n}\n\n/**\n * Union type of all possible wallet verification information types.\n */\nexport type WalletVerificationInfo =\n | WalletPincodeVerificationInfo\n | WalletOTPVerificationInfo\n | WalletSecretCodesVerificationInfo;\n\n/**\n * Parameters for creating a wallet verification.\n */\nexport interface CreateWalletVerificationParameters {\n /** The wallet address for which to create the verification. */\n userWalletAddress: string;\n /** The verification information to create. */\n walletVerificationInfo: WalletVerificationInfo;\n}\n\n/**\n * Response from creating a wallet verification.\n */\nexport interface CreateWalletVerificationResponse {\n /** The unique identifier of the verification. */\n id: string;\n /** The name of the verification method. */\n name: string;\n /** The type of verification method. */\n verificationType: WalletVerificationType;\n /** Additional parameters specific to the verification type. */\n parameters: Record<string, string>;\n}\n\n/**\n * RPC schema for creating a wallet verification.\n */\ntype WalletRpcSchema = {\n Method: \"user_createWalletVerification\";\n Parameters: [userWalletAddress: string, walletVerificationInfo: WalletVerificationInfo];\n ReturnType: CreateWalletVerificationResponse[];\n};\n\n/**\n * Creates a wallet verification action for the given client.\n * @param client - The viem client to use for the request.\n * @returns An object with a createWalletVerification method.\n */\nexport function createWalletVerification(client: Client) {\n return {\n /**\n * Creates a new wallet verification.\n * @param args - The parameters for creating the verification.\n * @returns A promise that resolves to an array of created wallet verification responses.\n */\n createWalletVerification(args: CreateWalletVerificationParameters): Promise<CreateWalletVerificationResponse[]> {\n return client.request<WalletRpcSchema>({\n method: \"user_createWalletVerification\",\n params: [args.userWalletAddress, args.walletVerificationInfo],\n });\n },\n };\n}\n","import type { Client } from \"viem\";\nimport type { WalletVerificationType } from \"./types/wallet-verification.enum.js\";\nimport type { AddressOrObject } from \"./verify-wallet-verification-challenge.action.js\";\n\n/**\n * Parameters for creating wallet verification challenges.\n */\nexport interface CreateWalletVerificationChallengesParameters {\n /** The wallet address or object containing wallet address and optional verification ID. */\n addressOrObject: AddressOrObject;\n}\n\n/**\n * Represents a wallet verification challenge.\n */\nexport interface WalletVerificationChallenge {\n /** The unique identifier of the challenge. */\n id: string;\n /** The name of the challenge. */\n name: string;\n /** The type of verification required. */\n verificationType: WalletVerificationType;\n /** The challenge parameters specific to the verification type. */\n challenge: Record<string, string>;\n}\n\n/**\n * Response from creating wallet verification challenges.\n */\nexport type CreateWalletVerificationChallengesResponse = WalletVerificationChallenge[];\n\n/**\n * RPC schema for creating wallet verification challenges.\n */\ntype WalletRpcSchema = {\n Method: \"user_createWalletVerificationChallenges\";\n Parameters: [addressOrObject: AddressOrObject];\n ReturnType: CreateWalletVerificationChallengesResponse;\n};\n\n/**\n * Creates a wallet verification challenges action for the given client.\n * @param client - The viem client to use for the request.\n * @returns An object with a createWalletVerificationChallenges method.\n */\nexport function createWalletVerificationChallenges(client: Client) {\n return {\n /**\n * Creates verification challenges for a wallet.\n * @param args - The parameters for creating the challenges.\n * @returns A promise that resolves to an array of wallet verification challenges.\n */\n createWalletVerificationChallenges(\n args: CreateWalletVerificationChallengesParameters,\n ): Promise<CreateWalletVerificationChallengesResponse> {\n return client.request<WalletRpcSchema>({\n method: \"user_createWalletVerificationChallenges\",\n params: [args.addressOrObject],\n });\n },\n };\n}\n","import type { Client } from \"viem\";\n\n/**\n * Parameters for deleting a wallet verification.\n */\nexport interface DeleteWalletVerificationParameters {\n /** The wallet address for which to delete the verification. */\n userWalletAddress: string;\n /** The unique identifier of the verification to delete. */\n verificationId: string;\n}\n\n/**\n * Response from deleting a wallet verification.\n */\nexport interface DeleteWalletVerificationResponse {\n /** Whether the deletion was successful. */\n success: boolean;\n}\n\n/**\n * RPC schema for deleting a wallet verification.\n */\ntype WalletRpcSchema = {\n Method: \"user_deleteWalletVerification\";\n Parameters: [userWalletAddress: string, verificationId: string];\n ReturnType: DeleteWalletVerificationResponse[];\n};\n\n/**\n * Creates a wallet verification deletion action for the given client.\n * @param client - The viem client to use for the request.\n * @returns An object with a deleteWalletVerification method.\n */\nexport function deleteWalletVerification(client: Client) {\n return {\n /**\n * Deletes a wallet verification.\n * @param args - The parameters for deleting the verification.\n * @returns A promise that resolves to an array of deletion results.\n */\n deleteWalletVerification(args: DeleteWalletVerificationParameters): Promise<DeleteWalletVerificationResponse[]> {\n return client.request<WalletRpcSchema>({\n method: \"user_deleteWalletVerification\",\n params: [args.userWalletAddress, args.verificationId],\n });\n },\n };\n}\n","import type { Client } from \"viem\";\nimport type { WalletVerificationType } from \"./types/wallet-verification.enum.js\";\n\n/**\n * Parameters for getting wallet verifications.\n */\nexport interface GetWalletVerificationsParameters {\n /** The wallet address for which to fetch verifications. */\n userWalletAddress: string;\n}\n\n/**\n * Represents a wallet verification.\n */\nexport interface WalletVerification {\n /** The unique identifier of the verification. */\n id: string;\n /** The name of the verification method. */\n name: string;\n /** The type of verification method. */\n verificationType: WalletVerificationType;\n}\n\n/**\n * Response from getting wallet verifications.\n */\nexport type GetWalletVerificationsResponse = WalletVerification[];\n\n/**\n * RPC schema for getting wallet verifications.\n */\ntype WalletRpcSchema = {\n Method: \"user_walletVerifications\";\n Parameters: [userWalletAddress: string];\n ReturnType: GetWalletVerificationsResponse;\n};\n\n/**\n * Creates a wallet verifications retrieval action for the given client.\n * @param client - The viem client to use for the request.\n * @returns An object with a getWalletVerifications method.\n */\nexport function getWalletVerifications(client: Client) {\n return {\n /**\n * Gets all verifications for a wallet.\n * @param args - The parameters for getting the verifications.\n * @returns A promise that resolves to an array of wallet verifications.\n */\n getWalletVerifications(args: GetWalletVerificationsParameters): Promise<GetWalletVerificationsResponse> {\n return client.request<WalletRpcSchema>({\n method: \"user_walletVerifications\",\n params: [args.userWalletAddress],\n });\n },\n };\n}\n","import type { Client } from \"viem\";\n\n/**\n * Represents either a wallet address string or an object containing wallet address and optional verification ID.\n */\nexport type AddressOrObject =\n | string\n | {\n userWalletAddress: string;\n verificationId?: string;\n };\n\n/**\n * Parameters for verifying a wallet verification challenge.\n */\nexport interface VerifyWalletVerificationChallengeParameters {\n /** The wallet address or object containing wallet address and optional verification ID. */\n addressOrObject: AddressOrObject;\n /** The response to the verification challenge. */\n challengeResponse: string;\n}\n\n/**\n * Result of a wallet verification challenge.\n */\nexport interface VerificationResult {\n /** Whether the verification was successful. */\n verified: boolean;\n}\n\n/**\n * Response from verifying a wallet verification challenge.\n */\nexport type VerifyWalletVerificationChallengeResponse = VerificationResult[];\n\n/**\n * RPC schema for wallet verification challenge verification.\n */\ntype WalletRpcSchema = {\n Method: \"user_verifyWalletVerificationChallenge\";\n Parameters: [addressOrObject: AddressOrObject, challengeResponse: string];\n ReturnType: VerifyWalletVerificationChallengeResponse;\n};\n\n/**\n * Creates a wallet verification challenge verification action for the given client.\n * @param client - The viem client to use for the request.\n * @returns An object with a verifyWalletVerificationChallenge method.\n */\nexport function verifyWalletVerificationChallenge(client: Client) {\n return {\n /**\n * Verifies a wallet verification challenge.\n * @param args - The parameters for verifying the challenge.\n * @returns A promise that resolves to an array of verification results.\n */\n verifyWalletVerificationChallenge(\n args: VerifyWalletVerificationChallengeParameters,\n ): Promise<VerifyWalletVerificationChallengeResponse> {\n return client.request<WalletRpcSchema>({\n method: \"user_verifyWalletVerificationChallenge\",\n params: [args.addressOrObject, args.challengeResponse],\n });\n },\n };\n}\n","/**\n * Types of wallet verification methods supported by the system.\n * Used to identify different verification mechanisms when creating or managing wallet verifications.\n */\nexport enum WalletVerificationType {\n /** PIN code verification method */\n PINCODE = \"PINCODE\",\n /** One-Time Password verification method */\n OTP = \"OTP\",\n /** Secret recovery codes verification method */\n SECRET_CODES = \"SECRET_CODES\",\n}\n\n/**\n * Supported hash algorithms for One-Time Password (OTP) verification.\n * These algorithms determine the cryptographic function used to generate OTP codes.\n */\nexport enum OTPAlgorithm {\n /** SHA-1 hash algorithm */\n SHA1 = \"SHA1\",\n /** SHA-224 hash algorithm */\n SHA224 = \"SHA224\",\n /** SHA-256 hash algorithm */\n SHA256 = \"SHA256\",\n /** SHA-384 hash algorithm */\n SHA384 = \"SHA384\",\n /** SHA-512 hash algorithm */\n SHA512 = \"SHA512\",\n /** SHA3-224 hash algorithm */\n SHA3_224 = \"SHA3-224\",\n /** SHA3-256 hash algorithm */\n SHA3_256 = \"SHA3-256\",\n /** SHA3-384 hash algorithm */\n SHA3_384 = \"SHA3-384\",\n /** SHA3-512 hash algorithm */\n SHA3_512 = \"SHA3-512\",\n}\n","import { appendHeaders } from \"@settlemint/sdk-utils/http\";\nimport { ensureServer } from \"@settlemint/sdk-utils/runtime\";\nimport { ApplicationAccessTokenSchema, UrlOrPathSchema, validate } from \"@settlemint/sdk-utils/validation\";\nimport {\n createPublicClient,\n createWalletClient,\n defineChain,\n type HttpTransportConfig,\n http,\n publicActions,\n type Chain as ViemChain,\n} from \"viem\";\nimport * as chains from \"viem/chains\";\nimport { z } from \"zod\";\nimport { createWallet } from \"./custom-actions/create-wallet.action.js\";\nimport { createWalletVerification } from \"./custom-actions/create-wallet-verification.action.js\";\nimport { createWalletVerificationChallenges } from \"./custom-actions/create-wallet-verification-challenges.action.js\";\nimport { deleteWalletVerification } from \"./custom-actions/delete-wallet-verification.action.js\";\nimport { getWalletVerifications } from \"./custom-actions/get-wallet-verifications.action.js\";\nimport { verifyWalletVerificationChallenge } from \"./custom-actions/verify-wallet-verification-challenge.action.js\";\n\n/**\n * Schema for the viem client options.\n */\nexport const ClientOptionsSchema = z.object({\n /**\n * The access token\n */\n accessToken: ApplicationAccessTokenSchema.optional(),\n /**\n * The chain id\n */\n chainId: z.string(),\n /**\n * The chain name\n */\n chainName: z.string(),\n /**\n * The json rpc url\n */\n rpcUrl: UrlOrPathSchema,\n /**\n * The http transport config\n */\n httpTransportConfig: z.any().optional(),\n});\n\n/**\n * Type representing the validated client options.\n */\nexport type ClientOptions = Omit<z.infer<typeof ClientOptionsSchema>, \"httpTransportConfig\"> & {\n httpTransportConfig?: HttpTransportConfig;\n};\n\n/**\n * Get a public client. Use this if you need to read from the blockchain.\n * @param options - The options for the public client.\n * @returns The public client. see {@link https://viem.sh/docs/clients/public}\n * @example\n * ```ts\n * import { getPublicClient } from '@settlemint/sdk-viem';\n *\n * const publicClient = getPublicClient({\n * accessToken: process.env.SETTLEMINT_ACCESS_TOKEN,\n * chainId: process.env.SETTLEMINT_BLOCKCHAIN_NETWORK_CHAIN_ID!,\n * chainName: process.env.SETTLEMINT_BLOCKCHAIN_NETWORK!,\n * rpcUrl: process.env.SETTLEMINT_BLOCKCHAIN_NODE_OR_LOAD_BALANCER_JSON_RPC_ENDPOINT!,\n * });\n *\n * // Get the block number\n * const block = await publicClient.getBlockNumber();\n * console.log(block);\n * ```\n */\nexport const getPublicClient = (options: ClientOptions) => {\n ensureServer();\n const validatedOptions: ClientOptions = validate(ClientOptionsSchema, options);\n return createPublicClient({\n chain: getChain({\n chainId: validatedOptions.chainId,\n chainName: validatedOptions.chainName,\n rpcUrl: validatedOptions.rpcUrl,\n }),\n transport: http(validatedOptions.rpcUrl, {\n batch: true,\n timeout: 60_000,\n ...validatedOptions.httpTransportConfig,\n fetchOptions: {\n ...validatedOptions?.httpTransportConfig?.fetchOptions,\n headers: appendHeaders(validatedOptions?.httpTransportConfig?.fetchOptions?.headers, {\n \"x-auth-token\": validatedOptions.accessToken,\n }),\n },\n }),\n });\n};\n\n/**\n * The options for the wallet client.\n */\nexport interface WalletVerificationOptions {\n /**\n * The verification id (used for HD wallets), if not provided, the challenge response will be validated against all active verifications.\n */\n verificationId?: string;\n /**\n * The challenge response (used for HD wallets)\n */\n challengeResponse: string;\n}\n\n/**\n * Get a wallet client. Use this if you need to write to the blockchain.\n * @param options - The options for the wallet client.\n * @returns A function that returns a wallet client. The function can be called with verification options for HD wallets. see {@link https://viem.sh/docs/clients/wallet}\n * @example\n * ```ts\n * import { getWalletClient } from '@settlemint/sdk-viem';\n * import { parseAbi } from \"viem\";\n *\n * const walletClient = getWalletClient({\n * accessToken: process.env.SETTLEMINT_ACCESS_TOKEN,\n * chainId: process.env.SETTLEMINT_BLOCKCHAIN_NETWORK_CHAIN_ID!,\n * chainName: process.env.SETTLEMINT_BLOCKCHAIN_NETWORK!,\n * rpcUrl: process.env.SETTLEMINT_BLOCKCHAIN_NODE_OR_LOAD_BALANCER_JSON_RPC_ENDPOINT!,\n * });\n *\n * // Get the chain id\n * const chainId = await walletClient().getChainId();\n * console.log(chainId);\n *\n * // write to the blockchain\n * const transactionHash = await walletClient().writeContract({\n * account: \"0x0000000000000000000000000000000000000000\",\n * address: \"0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2\",\n * abi: parseAbi([\"function mint(uint32 tokenId) nonpayable\"]),\n * functionName: \"mint\",\n * args: [69420],\n * });\n * console.log(transactionHash);\n * ```\n */\nexport const getWalletClient = (options: ClientOptions) => {\n ensureServer();\n const validatedOptions: ClientOptions = validate(ClientOptionsSchema, options);\n const chain = getChain({\n chainId: validatedOptions.chainId,\n chainName: validatedOptions.chainName,\n rpcUrl: validatedOptions.rpcUrl,\n });\n return (verificationOptions?: WalletVerificationOptions) =>\n createWalletClient({\n chain: chain,\n transport: http(validatedOptions.rpcUrl, {\n batch: true,\n timeout: 60_000,\n ...validatedOptions.httpTransportConfig,\n fetchOptions: {\n ...validatedOptions?.httpTransportConfig?.fetchOptions,\n headers: appendHeaders(validatedOptions?.httpTransportConfig?.fetchOptions?.headers, {\n \"x-auth-token\": validatedOptions.accessToken,\n \"x-auth-challenge-response\": verificationOptions?.challengeResponse ?? \"\",\n \"x-auth-verification-id\": verificationOptions?.verificationId ?? \"\",\n }),\n },\n }),\n })\n .extend(publicActions)\n .extend(createWallet)\n .extend(getWalletVerifications)\n .extend(createWalletVerification)\n .extend(deleteWalletVerification)\n .extend(createWalletVerificationChallenges)\n .extend(verifyWalletVerificationChallenge);\n};\n\n/**\n * Schema for the viem client options.\n */\nexport const GetChainIdOptionsSchema = z.object({\n /**\n * The access token\n */\n accessToken: ApplicationAccessTokenSchema.optional(),\n /**\n * The json rpc url\n */\n rpcUrl: UrlOrPathSchema,\n /**\n * The http transport config\n */\n httpTransportConfig: z.any().optional(),\n});\n\n/**\n * Type representing the validated get chain id options.\n */\nexport type GetChainIdOptions = Omit<z.infer<typeof GetChainIdOptionsSchema>, \"httpTransportConfig\"> & {\n httpTransportConfig?: HttpTransportConfig;\n};\n\n/**\n * Get the chain id of a blockchain network.\n * @param options - The options for the public client.\n * @returns The chain id.\n * @example\n * ```ts\n * import { getChainId } from '@settlemint/sdk-viem';\n *\n * const chainId = await getChainId({\n * accessToken: process.env.SETTLEMINT_ACCESS_TOKEN,\n * rpcUrl: process.env.SETTLEMINT_BLOCKCHAIN_NODE_OR_LOAD_BALANCER_JSON_RPC_ENDPOINT!,\n * });\n * console.log(chainId);\n * ```\n */\nexport async function getChainId(options: GetChainIdOptions): Promise<number> {\n ensureServer();\n const validatedOptions: GetChainIdOptions = validate(GetChainIdOptionsSchema, options);\n const client = createPublicClient({\n transport: http(validatedOptions.rpcUrl, {\n ...validatedOptions.httpTransportConfig,\n fetchOptions: {\n ...validatedOptions?.httpTransportConfig?.fetchOptions,\n headers: appendHeaders(validatedOptions?.httpTransportConfig?.fetchOptions?.headers, {\n \"x-auth-token\": validatedOptions.accessToken,\n }),\n },\n }),\n });\n\n return client.getChainId();\n}\n\nfunction getChain({ chainId, chainName, rpcUrl }: Pick<ClientOptions, \"chainId\" | \"chainName\" | \"rpcUrl\">): ViemChain {\n const knownChain = Object.values(chains).find((chain) => chain.id.toString() === chainId);\n return (\n knownChain ??\n defineChain({\n id: Number(chainId),\n name: chainName,\n rpcUrls: {\n default: {\n http: [rpcUrl],\n },\n },\n nativeCurrency: {\n decimals: 18,\n name: \"Ether\",\n symbol: \"ETH\",\n },\n })\n );\n}\n\nexport type {\n CreateWalletParameters,\n CreateWalletResponse,\n WalletInfo,\n} from \"./custom-actions/create-wallet.action.js\";\nexport type {\n CreateWalletVerificationParameters,\n CreateWalletVerificationResponse,\n WalletOTPVerificationInfo,\n WalletPincodeVerificationInfo,\n WalletSecretCodesVerificationInfo,\n WalletVerificationInfo,\n} from \"./custom-actions/create-wallet-verification.action.js\";\nexport type {\n CreateWalletVerificationChallengesParameters,\n CreateWalletVerificationChallengesResponse,\n WalletVerificationChallenge,\n} from \"./custom-actions/create-wallet-verification-challenges.action.js\";\nexport type {\n DeleteWalletVerificationParameters,\n DeleteWalletVerificationResponse,\n} from \"./custom-actions/delete-wallet-verification.action.js\";\nexport type {\n GetWalletVerificationsParameters,\n GetWalletVerificationsResponse,\n WalletVerification,\n} from \"./custom-actions/get-wallet-verifications.action.js\";\nexport { OTPAlgorithm, WalletVerificationType } from \"./custom-actions/types/wallet-verification.enum.js\";\nexport type {\n AddressOrObject,\n VerificationResult,\n VerifyWalletVerificationChallengeParameters,\n VerifyWalletVerificationChallengeResponse,\n} from \"./custom-actions/verify-wallet-verification-challen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yBAAyB,CAChC,OAAO,yBAAyB,CAChC,OAAO,mCAAmC,CAC1C,OAAO,kCAAkC;AAC/C;;;;AAKD,MAAa,0BAA0B,EAAE,OAAO;CAI9C,aAAa,6BAA6B,UAAU;CAIpD,QAAQ;CAIR,qBAAqB,EAAE,KAAK,CAAC,UAAU;AACxC,EAAC;;;;;;;;;;;;;;;;AAwBF,eAAsB,WAAWC,SAA6C;CAC5E,cAAc;CACd,MAAMC,mBAAsC,SAAS,yBAAyB,QAAQ;CACtF,MAAM,SAAS,mBAAmB,EAChC,WAAW,KAAK,iBAAiB,QAAQ;EACvC,GAAG,iBAAiB;EACpB,cAAc;GACZ,GAAG,kBAAkB,qBAAqB;GAC1C,SAAS,cAAc,kBAAkB,qBAAqB,cAAc,SAAS,EACnF,gBAAgB,iBAAiB,YAClC,EAAC;EACH;CACF,EAAC,CACH,EAAC;AAEF,QAAO,OAAO,YAAY;AAC3B;AAED,SAAS,SAAS,EAAE,SAAS,WAAW,QAAiE,EAAa;CACpH,MAAM,aAAa,OAAO,OAAO,OAAO,CAAC,KAAK,CAAC,UAAU,MAAM,GAAG,UAAU,KAAK,QAAQ;AACzF,QACE,cACA,YAAY;EACV,IAAI,OAAO,QAAQ;EACnB,MAAM;EACN,SAAS,EACP,SAAS,EACP,MAAM,CAAC,MAAO,EACf,EACF;EACD,gBAAgB;GACd,UAAU;GACV,MAAM;GACN,QAAQ;EACT;CACF,EAAC;AAEL"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@settlemint/sdk-viem",
|
|
3
3
|
"description": "Viem (TypeScript Interface for Ethereum) module for SettleMint SDK",
|
|
4
|
-
"version": "2.5.
|
|
4
|
+
"version": "2.5.6",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"private": false,
|
|
7
7
|
"license": "FSL-1.1-MIT",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {},
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"@settlemint/sdk-utils": "2.5.
|
|
56
|
+
"@settlemint/sdk-utils": "2.5.6",
|
|
57
57
|
"viem": "^2",
|
|
58
58
|
"zod": "^4"
|
|
59
59
|
},
|