@heyanon/sdk 2.3.5 → 2.3.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/dist/index.js CHANGED
@@ -580,20 +580,20 @@ function isAddress(value) {
580
580
  try {
581
581
  result.valid = viem.isAddress(value);
582
582
  if (result.valid) {
583
- result.walletType = "evm" /* EVM */;
583
+ result.type = "evm" /* EVM */;
584
584
  }
585
585
  } catch (_error) {
586
586
  }
587
587
  try {
588
588
  solana_exports.utils.toPublicKey(value);
589
589
  result.valid = true;
590
- result.walletType = "solana" /* SOLANA */;
590
+ result.type = "solana" /* SOLANA */;
591
591
  } catch (_error) {
592
592
  }
593
593
  try {
594
594
  ton.Address.parse(value);
595
595
  result.valid = true;
596
- result.walletType = "ton" /* TON */;
596
+ result.type = "ton" /* TON */;
597
597
  } catch (_error) {
598
598
  }
599
599
  return result;
package/dist/index.mjs CHANGED
@@ -578,20 +578,20 @@ function isAddress(value) {
578
578
  try {
579
579
  result.valid = isAddress$1(value);
580
580
  if (result.valid) {
581
- result.walletType = "evm" /* EVM */;
581
+ result.type = "evm" /* EVM */;
582
582
  }
583
583
  } catch (_error) {
584
584
  }
585
585
  try {
586
586
  solana_exports.utils.toPublicKey(value);
587
587
  result.valid = true;
588
- result.walletType = "solana" /* SOLANA */;
588
+ result.type = "solana" /* SOLANA */;
589
589
  } catch (_error) {
590
590
  }
591
591
  try {
592
592
  Address.parse(value);
593
593
  result.valid = true;
594
- result.walletType = "ton" /* TON */;
594
+ result.type = "ton" /* TON */;
595
595
  } catch (_error) {
596
596
  }
597
597
  return result;
@@ -7,7 +7,7 @@ interface IsAddressResult {
7
7
  /** Whether the address is valid for any supported blockchain */
8
8
  valid: boolean;
9
9
  /** The type of wallet/blockchain the address belongs to (EVM, Solana, or TON) */
10
- walletType?: WalletType;
10
+ type?: WalletType;
11
11
  }
12
12
  /**
13
13
  * Validates a blockchain address and determines its type across multiple blockchain networks
@@ -23,15 +23,15 @@ interface IsAddressResult {
23
23
  * ```typescript
24
24
  * // EVM address validation
25
25
  * const evmResult = isAddress('0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb0');
26
- * // Returns: { valid: true, walletType: WalletType.EVM }
26
+ * // Returns: { valid: true, type: WalletType.EVM }
27
27
  *
28
28
  * // Solana address validation
29
29
  * const solanaResult = isAddress('DYw8jCTfwHNRJhhmFcbXvVDTqWMEVFBX6ZKUmG5CNSKK');
30
- * // Returns: { valid: true, walletType: WalletType.SOLANA }
30
+ * // Returns: { valid: true, type: WalletType.SOLANA }
31
31
  *
32
32
  * // TON address validation
33
33
  * const tonResult = isAddress('EQD4FPq-PRDieyQKkizFTRtSDyucUIqrj0v_zXJmqaDp6_0t');
34
- * // Returns: { valid: true, walletType: WalletType.TON }
34
+ * // Returns: { valid: true, type: WalletType.TON }
35
35
  *
36
36
  * // Invalid address
37
37
  * const invalidResult = isAddress('invalid-address');
@@ -39,24 +39,24 @@ interface IsAddressResult {
39
39
  *
40
40
  * // Routing transactions based on address type
41
41
  * async function sendTokens(recipientAddress: string, amount: bigint) {
42
- * const { valid, walletType } = isAddress(recipientAddress);
42
+ * const { valid, type } = isAddress(recipientAddress);
43
43
  *
44
44
  * if (!valid) {
45
45
  * throw new Error('Invalid recipient address');
46
46
  * }
47
47
  *
48
- * switch (walletType) {
49
- * case WalletType.EVM:
48
+ * switch (type) {
49
+ * case type.EVM:
50
50
  * return await options.evm.sendTransactions({
51
51
  * transactions: [{ to: recipientAddress, value: amount }]
52
52
  * });
53
53
  *
54
- * case WalletType.SOLANA:
54
+ * case type.SOLANA:
55
55
  * return await options.solana.sendTransactions({
56
56
  * transactions: [{ instructions: [...] }]
57
57
  * });
58
58
  *
59
- * case WalletType.TON:
59
+ * case type.TON:
60
60
  * return await options.ton.sendTransactions({
61
61
  * transactions: [{ to: recipientAddress, value: amount }]
62
62
  * });
@@ -65,13 +65,13 @@ interface IsAddressResult {
65
65
  *
66
66
  * // User input validation
67
67
  * function validateUserInput(userAddress: string) {
68
- * const { valid, walletType } = isAddress(userAddress);
68
+ * const { valid, type } = isAddress(userAddress);
69
69
  *
70
70
  * if (!valid) {
71
71
  * return { success: false, error: 'Invalid address format' };
72
72
  * }
73
73
  *
74
- * return { success: true, walletType, address: userAddress };
74
+ * return { success: true, type, address: userAddress };
75
75
  * }
76
76
  * ```
77
77
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@heyanon/sdk",
3
- "version": "2.3.5",
3
+ "version": "2.3.6",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "typings": "dist/index.d.ts",