@sudobility/types 1.8.21
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/CLAUDE.md +285 -0
- package/README.md +310 -0
- package/dist/index.cjs +62 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +62 -0
- package/dist/index.js.map +1 -0
- package/dist/types/blockchain/common.cjs +102 -0
- package/dist/types/blockchain/common.d.ts +262 -0
- package/dist/types/blockchain/common.d.ts.map +1 -0
- package/dist/types/blockchain/common.js +102 -0
- package/dist/types/blockchain/common.js.map +1 -0
- package/dist/types/blockchain/index.cjs +18 -0
- package/dist/types/blockchain/index.d.ts +4 -0
- package/dist/types/blockchain/index.d.ts.map +1 -0
- package/dist/types/blockchain/index.js +18 -0
- package/dist/types/blockchain/index.js.map +1 -0
- package/dist/types/blockchain/validation.cjs +88 -0
- package/dist/types/blockchain/validation.d.ts +9 -0
- package/dist/types/blockchain/validation.d.ts.map +1 -0
- package/dist/types/blockchain/validation.js +88 -0
- package/dist/types/blockchain/validation.js.map +1 -0
- package/dist/types/business/enums.cjs +314 -0
- package/dist/types/business/enums.d.ts +227 -0
- package/dist/types/business/enums.d.ts.map +1 -0
- package/dist/types/business/enums.js +314 -0
- package/dist/types/business/enums.js.map +1 -0
- package/dist/types/business/index.cjs +33 -0
- package/dist/types/business/index.d.ts +5 -0
- package/dist/types/business/index.d.ts.map +1 -0
- package/dist/types/business/index.js +33 -0
- package/dist/types/business/index.js.map +1 -0
- package/dist/types/business/wallet-status.cjs +38 -0
- package/dist/types/business/wallet-status.d.ts +32 -0
- package/dist/types/business/wallet-status.d.ts.map +1 -0
- package/dist/types/business/wallet-status.js +38 -0
- package/dist/types/business/wallet-status.js.map +1 -0
- package/dist/types/common.cjs +6 -0
- package/dist/types/common.d.ts +142 -0
- package/dist/types/common.d.ts.map +1 -0
- package/dist/types/common.js +6 -0
- package/dist/types/common.js.map +1 -0
- package/dist/types/config/app-config.cjs +6 -0
- package/dist/types/config/app-config.d.ts +67 -0
- package/dist/types/config/app-config.d.ts.map +1 -0
- package/dist/types/config/app-config.js +6 -0
- package/dist/types/config/app-config.js.map +1 -0
- package/dist/types/config/environment.cjs +24 -0
- package/dist/types/config/environment.d.ts +68 -0
- package/dist/types/config/environment.d.ts.map +1 -0
- package/dist/types/config/environment.js +24 -0
- package/dist/types/config/environment.js.map +1 -0
- package/dist/types/config/index.cjs +6 -0
- package/dist/types/config/index.d.ts +4 -0
- package/dist/types/config/index.d.ts.map +1 -0
- package/dist/types/config/index.js +6 -0
- package/dist/types/config/index.js.map +1 -0
- package/dist/types/index.cjs +35 -0
- package/dist/types/index.d.ts +10 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +35 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/indexer/index.cjs +19 -0
- package/dist/types/indexer/index.d.ts +3 -0
- package/dist/types/indexer/index.d.ts.map +1 -0
- package/dist/types/indexer/index.js +19 -0
- package/dist/types/indexer/index.js.map +1 -0
- package/dist/types/indexer/indexer-guards.cjs +145 -0
- package/dist/types/indexer/indexer-guards.d.ts +26 -0
- package/dist/types/indexer/indexer-guards.d.ts.map +1 -0
- package/dist/types/indexer/indexer-guards.js +145 -0
- package/dist/types/indexer/indexer-guards.js.map +1 -0
- package/dist/types/indexer/indexer-responses.cjs +8 -0
- package/dist/types/indexer/indexer-responses.d.ts +136 -0
- package/dist/types/indexer/indexer-responses.d.ts.map +1 -0
- package/dist/types/indexer/indexer-responses.js +8 -0
- package/dist/types/indexer/indexer-responses.js.map +1 -0
- package/dist/types/infrastructure/analytics.cjs +212 -0
- package/dist/types/infrastructure/analytics.d.ts +449 -0
- package/dist/types/infrastructure/analytics.d.ts.map +1 -0
- package/dist/types/infrastructure/analytics.js +212 -0
- package/dist/types/infrastructure/analytics.js.map +1 -0
- package/dist/types/infrastructure/api.cjs +17 -0
- package/dist/types/infrastructure/api.d.ts +152 -0
- package/dist/types/infrastructure/api.d.ts.map +1 -0
- package/dist/types/infrastructure/api.js +17 -0
- package/dist/types/infrastructure/api.js.map +1 -0
- package/dist/types/infrastructure/index.cjs +14 -0
- package/dist/types/infrastructure/index.d.ts +9 -0
- package/dist/types/infrastructure/index.d.ts.map +1 -0
- package/dist/types/infrastructure/index.js +14 -0
- package/dist/types/infrastructure/index.js.map +1 -0
- package/dist/types/infrastructure/navigation.cjs +3 -0
- package/dist/types/infrastructure/navigation.d.ts +56 -0
- package/dist/types/infrastructure/navigation.d.ts.map +1 -0
- package/dist/types/infrastructure/navigation.js +3 -0
- package/dist/types/infrastructure/navigation.js.map +1 -0
- package/dist/types/infrastructure/network.cjs +18 -0
- package/dist/types/infrastructure/network.d.ts +48 -0
- package/dist/types/infrastructure/network.d.ts.map +1 -0
- package/dist/types/infrastructure/network.js +18 -0
- package/dist/types/infrastructure/network.js.map +1 -0
- package/dist/types/infrastructure/wallet.cjs +37 -0
- package/dist/types/infrastructure/wallet.d.ts +33 -0
- package/dist/types/infrastructure/wallet.d.ts.map +1 -0
- package/dist/types/infrastructure/wallet.js +37 -0
- package/dist/types/infrastructure/wallet.js.map +1 -0
- package/dist/types/kyc/index.cjs +19 -0
- package/dist/types/kyc/index.d.ts +2 -0
- package/dist/types/kyc/index.d.ts.map +1 -0
- package/dist/types/kyc/index.js +19 -0
- package/dist/types/kyc/index.js.map +1 -0
- package/dist/types/kyc/kyc-types.cjs +12 -0
- package/dist/types/kyc/kyc-types.d.ts +260 -0
- package/dist/types/kyc/kyc-types.d.ts.map +1 -0
- package/dist/types/kyc/kyc-types.js +12 -0
- package/dist/types/kyc/kyc-types.js.map +1 -0
- package/dist/types/mailer/index.cjs +19 -0
- package/dist/types/mailer/index.d.ts +2 -0
- package/dist/types/mailer/index.d.ts.map +1 -0
- package/dist/types/mailer/index.js +19 -0
- package/dist/types/mailer/index.js.map +1 -0
- package/dist/types/mailer/mail-types.cjs +38 -0
- package/dist/types/mailer/mail-types.d.ts +296 -0
- package/dist/types/mailer/mail-types.d.ts.map +1 -0
- package/dist/types/mailer/mail-types.js +38 -0
- package/dist/types/mailer/mail-types.js.map +1 -0
- package/dist/types/wildduck/index.cjs +19 -0
- package/dist/types/wildduck/index.d.ts +2 -0
- package/dist/types/wildduck/index.d.ts.map +1 -0
- package/dist/types/wildduck/index.js +19 -0
- package/dist/types/wildduck/index.js.map +1 -0
- package/dist/types/wildduck/wildduck-types.cjs +48 -0
- package/dist/types/wildduck/wildduck-types.d.ts +1239 -0
- package/dist/types/wildduck/wildduck-types.d.ts.map +1 -0
- package/dist/types/wildduck/wildduck-types.js +48 -0
- package/dist/types/wildduck/wildduck-types.js.map +1 -0
- package/dist/utils/async-helpers.cjs +130 -0
- package/dist/utils/async-helpers.d.ts +35 -0
- package/dist/utils/async-helpers.d.ts.map +1 -0
- package/dist/utils/async-helpers.js +130 -0
- package/dist/utils/async-helpers.js.map +1 -0
- package/dist/utils/auth/auth.cjs +96 -0
- package/dist/utils/auth/auth.d.ts +40 -0
- package/dist/utils/auth/auth.d.ts.map +1 -0
- package/dist/utils/auth/auth.js +96 -0
- package/dist/utils/auth/auth.js.map +1 -0
- package/dist/utils/auth/index.cjs +14 -0
- package/dist/utils/auth/index.d.ts +2 -0
- package/dist/utils/auth/index.d.ts.map +1 -0
- package/dist/utils/auth/index.js +14 -0
- package/dist/utils/auth/index.js.map +1 -0
- package/dist/utils/blockchain/address.cjs +231 -0
- package/dist/utils/blockchain/address.d.ts +65 -0
- package/dist/utils/blockchain/address.d.ts.map +1 -0
- package/dist/utils/blockchain/address.js +231 -0
- package/dist/utils/blockchain/address.js.map +1 -0
- package/dist/utils/blockchain/event-helpers.cjs +143 -0
- package/dist/utils/blockchain/event-helpers.d.ts +87 -0
- package/dist/utils/blockchain/event-helpers.d.ts.map +1 -0
- package/dist/utils/blockchain/event-helpers.js +143 -0
- package/dist/utils/blockchain/event-helpers.js.map +1 -0
- package/dist/utils/blockchain/index.cjs +30 -0
- package/dist/utils/blockchain/index.d.ts +8 -0
- package/dist/utils/blockchain/index.d.ts.map +1 -0
- package/dist/utils/blockchain/index.js +30 -0
- package/dist/utils/blockchain/index.js.map +1 -0
- package/dist/utils/blockchain/rpc-helpers.cjs +865 -0
- package/dist/utils/blockchain/rpc-helpers.d.ts +251 -0
- package/dist/utils/blockchain/rpc-helpers.d.ts.map +1 -0
- package/dist/utils/blockchain/rpc-helpers.js +865 -0
- package/dist/utils/blockchain/rpc-helpers.js.map +1 -0
- package/dist/utils/constants/application.cjs +158 -0
- package/dist/utils/constants/application.d.ts +119 -0
- package/dist/utils/constants/application.d.ts.map +1 -0
- package/dist/utils/constants/application.js +158 -0
- package/dist/utils/constants/application.js.map +1 -0
- package/dist/utils/constants/index.cjs +30 -0
- package/dist/utils/constants/index.d.ts +7 -0
- package/dist/utils/constants/index.d.ts.map +1 -0
- package/dist/utils/constants/index.js +30 -0
- package/dist/utils/constants/index.js.map +1 -0
- package/dist/utils/constants/status-values.cjs +14 -0
- package/dist/utils/constants/status-values.d.ts +12 -0
- package/dist/utils/constants/status-values.d.ts.map +1 -0
- package/dist/utils/constants/status-values.js +14 -0
- package/dist/utils/constants/status-values.js.map +1 -0
- package/dist/utils/formatting/currency.cjs +36 -0
- package/dist/utils/formatting/currency.d.ts +26 -0
- package/dist/utils/formatting/currency.d.ts.map +1 -0
- package/dist/utils/formatting/currency.js +36 -0
- package/dist/utils/formatting/currency.js.map +1 -0
- package/dist/utils/formatting/date.cjs +138 -0
- package/dist/utils/formatting/date.d.ts +33 -0
- package/dist/utils/formatting/date.d.ts.map +1 -0
- package/dist/utils/formatting/date.js +138 -0
- package/dist/utils/formatting/date.js.map +1 -0
- package/dist/utils/formatting/index.cjs +37 -0
- package/dist/utils/formatting/index.d.ts +4 -0
- package/dist/utils/formatting/index.d.ts.map +1 -0
- package/dist/utils/formatting/index.js +37 -0
- package/dist/utils/formatting/index.js.map +1 -0
- package/dist/utils/formatting/string.cjs +193 -0
- package/dist/utils/formatting/string.d.ts +69 -0
- package/dist/utils/formatting/string.d.ts.map +1 -0
- package/dist/utils/formatting/string.js +193 -0
- package/dist/utils/formatting/string.js.map +1 -0
- package/dist/utils/index.cjs +28 -0
- package/dist/utils/index.d.ts +12 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +28 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/logging/index.cjs +16 -0
- package/dist/utils/logging/index.d.ts +5 -0
- package/dist/utils/logging/index.d.ts.map +1 -0
- package/dist/utils/logging/index.js +16 -0
- package/dist/utils/logging/index.js.map +1 -0
- package/dist/utils/logging/logger.cjs +92 -0
- package/dist/utils/logging/logger.d.ts +70 -0
- package/dist/utils/logging/logger.d.ts.map +1 -0
- package/dist/utils/logging/logger.js +92 -0
- package/dist/utils/logging/logger.js.map +1 -0
- package/dist/utils/url/index.cjs +13 -0
- package/dist/utils/url/index.d.ts +5 -0
- package/dist/utils/url/index.d.ts.map +1 -0
- package/dist/utils/url/index.js +13 -0
- package/dist/utils/url/index.js.map +1 -0
- package/dist/utils/url/url-params.cjs +128 -0
- package/dist/utils/url/url-params.d.ts +36 -0
- package/dist/utils/url/url-params.d.ts.map +1 -0
- package/dist/utils/url/url-params.js +128 -0
- package/dist/utils/url/url-params.js.map +1 -0
- package/dist/utils/validation/index.cjs +25 -0
- package/dist/utils/validation/index.d.ts +5 -0
- package/dist/utils/validation/index.d.ts.map +1 -0
- package/dist/utils/validation/index.js +25 -0
- package/dist/utils/validation/index.js.map +1 -0
- package/dist/utils/validation/type-validation.cjs +167 -0
- package/dist/utils/validation/type-validation.d.ts +68 -0
- package/dist/utils/validation/type-validation.d.ts.map +1 -0
- package/dist/utils/validation/type-validation.js +167 -0
- package/dist/utils/validation/type-validation.js.map +1 -0
- package/dist/utils/validation/web3-username-validator.cjs +132 -0
- package/dist/utils/validation/web3-username-validator.d.ts +43 -0
- package/dist/utils/validation/web3-username-validator.d.ts.map +1 -0
- package/dist/utils/validation/web3-username-validator.js +132 -0
- package/dist/utils/validation/web3-username-validator.js.map +1 -0
- package/package.json +80 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"address.js","sourceRoot":"","sources":["../../../src/utils/blockchain/address.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAoCH,8BAiCC;AAMD,8BA8CC;AAMD,wCA8BC;AAKD,oDA2BC;AAKD,4CAqBC;AAKD,8CAsBC;AAMD,kDAiBC;AAKD,kDAaC;AAzRD,sDAAuD;AAEvD,qDAAqD;AACrD,0DAA8E;AAE9E;;GAEG;AACH,IAAY,WAMX;AAND,WAAY,WAAW;IACrB,wCAAyB,CAAA;IACzB,8CAA+B,CAAA;IAC/B,kCAAmB,CAAA;IACnB,kCAAmB,CAAA;IACnB,kCAAmB,CAAA;AACrB,CAAC,EANW,WAAW,2BAAX,WAAW,QAMtB;AAcD,wEAAwE;AACxE,4EAA4E;AAE5E;;GAEG;AACH,SAAgB,SAAS,CAAC,OAAe;IACvC,MAAM,YAAY,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;IAE3C,kCAAkC;IAClC,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;QACrE,OAAO,KAAK,CAAC;IACf,CAAC;IAED,+CAA+C;IAC/C,MAAM,cAAc,GAAG,YAAY,CAAC,QAAQ,CAAC,MAAM,CAAC;QAClD,CAAC,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QAC3B,CAAC,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAE9B,IAAI,cAAc,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAChC,OAAO,KAAK,CAAC;IACf,CAAC;IAED,uDAAuD;IACvD,MAAM,MAAM,GAAG,cAAc,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAEzC,2BAA2B;IAC3B,MAAM,eAAe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pure utility functions for multi-chain event processing
|
|
5
|
+
* @version 2.0.0
|
|
6
|
+
*
|
|
7
|
+
* This file provides clean, type-safe utility functions with no external dependencies:
|
|
8
|
+
* - Multi-chain ID generation
|
|
9
|
+
* - Address normalization
|
|
10
|
+
* - BigInt formatting
|
|
11
|
+
* - Address validation
|
|
12
|
+
* - Testnet detection
|
|
13
|
+
*/
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.createMultiChainId = createMultiChainId;
|
|
16
|
+
exports.createUserMultiChainId = createUserMultiChainId;
|
|
17
|
+
exports.createChainStatsId = createChainStatsId;
|
|
18
|
+
exports.createDelegationId = createDelegationId;
|
|
19
|
+
exports.normalizeAddress = normalizeAddress;
|
|
20
|
+
exports.formatBigInt = formatBigInt;
|
|
21
|
+
exports.isZeroAddress = isZeroAddress;
|
|
22
|
+
exports.isTestNet = isTestNet;
|
|
23
|
+
exports.validateEventArgs = validateEventArgs;
|
|
24
|
+
// ========================================
|
|
25
|
+
// ID GENERATION UTILITIES
|
|
26
|
+
// ========================================
|
|
27
|
+
/**
|
|
28
|
+
* Generate unique multi-chain entity ID
|
|
29
|
+
*
|
|
30
|
+
* @param chainId - Network chain ID (e.g., 1 for Ethereum)
|
|
31
|
+
* @param txHash - Transaction hash
|
|
32
|
+
* @param logIndex - Event log index within transaction
|
|
33
|
+
* @returns Formatted ID: "chainId-txHash-logIndex"
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* ```typescript
|
|
37
|
+
* const id = createMultiChainId(1, "0x123...", 0);
|
|
38
|
+
* // Result: "1-0x123...-0"
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
function createMultiChainId(chainId, txHash, logIndex) {
|
|
42
|
+
return `${chainId}-${txHash}-${logIndex}`;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Generate user-specific multi-chain ID
|
|
46
|
+
*
|
|
47
|
+
* @param chainId - Network chain ID
|
|
48
|
+
* @param address - User wallet address (will be normalized to lowercase)
|
|
49
|
+
* @returns Formatted ID: "chainId-address"
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* ```typescript
|
|
53
|
+
* const userId = createUserMultiChainId(137, "0xABC...");
|
|
54
|
+
* // Result: "137-0xabc..."
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
function createUserMultiChainId(chainId, address) {
|
|
58
|
+
return `${chainId}-${address.toLowerCase()}`;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Generate chain-specific statistics ID
|
|
62
|
+
*
|
|
63
|
+
* @param chainId - Network chain ID
|
|
64
|
+
* @returns Formatted ID: "chainId-global"
|
|
65
|
+
*/
|
|
66
|
+
function createChainStatsId(chainId) {
|
|
67
|
+
return `${chainId}-global`;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Generate delegation ID based on delegator address and testnet status
|
|
71
|
+
*
|
|
72
|
+
* @param delegatorAddress - The wallet address that is delegating
|
|
73
|
+
* @param isTestNet - Whether the chain is a testnet
|
|
74
|
+
* @returns Formatted ID: "delegatorAddress-testNet"
|
|
75
|
+
*/
|
|
76
|
+
function createDelegationId(delegatorAddress, isTestNet) {
|
|
77
|
+
return `${delegatorAddress.toLowerCase()}-${isTestNet}`;
|
|
78
|
+
}
|
|
79
|
+
// ========================================
|
|
80
|
+
// UTILITY FUNCTIONS
|
|
81
|
+
// ========================================
|
|
82
|
+
/**
|
|
83
|
+
* Normalize address to lowercase
|
|
84
|
+
*/
|
|
85
|
+
function normalizeAddress(address) {
|
|
86
|
+
return address.toLowerCase();
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Format bigint for display
|
|
90
|
+
*/
|
|
91
|
+
function formatBigInt(value, decimals = 18) {
|
|
92
|
+
const divisor = BigInt(10 ** decimals);
|
|
93
|
+
const whole = value / divisor;
|
|
94
|
+
const fraction = value % divisor;
|
|
95
|
+
if (fraction === 0n) {
|
|
96
|
+
return whole.toString();
|
|
97
|
+
}
|
|
98
|
+
return `${whole}.${fraction.toString().padStart(decimals, '0').replace(/0+$/, '')}`;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Check if address is zero address (delegation clearing)
|
|
102
|
+
*/
|
|
103
|
+
function isZeroAddress(address) {
|
|
104
|
+
return address.toLowerCase() === '0x0000000000000000000000000000000000000000';
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Determine if a chain ID represents a testnet
|
|
108
|
+
* @param chainId The blockchain chain ID
|
|
109
|
+
* @returns true if the chain is a testnet, false if mainnet
|
|
110
|
+
*/
|
|
111
|
+
function isTestNet(chainId) {
|
|
112
|
+
// EVM Testnets (positive chain IDs)
|
|
113
|
+
const evmTestnets = new Set([
|
|
114
|
+
31337, // Hardhat (local development)
|
|
115
|
+
11155111, // Ethereum Sepolia
|
|
116
|
+
80001, // Polygon Mumbai (if configured)
|
|
117
|
+
80002, // Polygon Amoy (if configured)
|
|
118
|
+
421614, // Arbitrum Sepolia (if configured)
|
|
119
|
+
11155420, // OP Sepolia (if configured)
|
|
120
|
+
84532, // Base Sepolia (if configured)
|
|
121
|
+
43113, // Avalanche Fuji (if configured)
|
|
122
|
+
]);
|
|
123
|
+
// Solana Testnets (negative chain IDs)
|
|
124
|
+
const solanaTestnets = new Set([
|
|
125
|
+
-102, // Solana Devnet
|
|
126
|
+
-103, // Solana Testnet
|
|
127
|
+
-104, // Solana Localnet
|
|
128
|
+
]);
|
|
129
|
+
return evmTestnets.has(chainId) || solanaTestnets.has(chainId);
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Validate event arguments
|
|
133
|
+
*/
|
|
134
|
+
function validateEventArgs(args, requiredFields) {
|
|
135
|
+
for (const field of requiredFields) {
|
|
136
|
+
if (args[field] === undefined || args[field] === null) {
|
|
137
|
+
console.error(`❌ Missing required field: ${String(field)}`);
|
|
138
|
+
return false;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
return true;
|
|
142
|
+
}
|
|
143
|
+
//# sourceMappingURL=event-helpers.js.map
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Pure Event Helper Functions
|
|
3
|
+
* @description Pure utility functions for multi-chain event processing
|
|
4
|
+
* @version 2.0.0
|
|
5
|
+
*
|
|
6
|
+
* This file provides clean, type-safe utility functions with no external dependencies:
|
|
7
|
+
* - Multi-chain ID generation
|
|
8
|
+
* - Address normalization
|
|
9
|
+
* - BigInt formatting
|
|
10
|
+
* - Address validation
|
|
11
|
+
* - Testnet detection
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* Generate unique multi-chain entity ID
|
|
15
|
+
*
|
|
16
|
+
* @param chainId - Network chain ID (e.g., 1 for Ethereum)
|
|
17
|
+
* @param txHash - Transaction hash
|
|
18
|
+
* @param logIndex - Event log index within transaction
|
|
19
|
+
* @returns Formatted ID: "chainId-txHash-logIndex"
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```typescript
|
|
23
|
+
* const id = createMultiChainId(1, "0x123...", 0);
|
|
24
|
+
* // Result: "1-0x123...-0"
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
export declare function createMultiChainId(chainId: number, txHash: string, logIndex: number): string;
|
|
28
|
+
/**
|
|
29
|
+
* Generate user-specific multi-chain ID
|
|
30
|
+
*
|
|
31
|
+
* @param chainId - Network chain ID
|
|
32
|
+
* @param address - User wallet address (will be normalized to lowercase)
|
|
33
|
+
* @returns Formatted ID: "chainId-address"
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* ```typescript
|
|
37
|
+
* const userId = createUserMultiChainId(137, "0xABC...");
|
|
38
|
+
* // Result: "137-0xabc..."
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
export declare function createUserMultiChainId(chainId: number, address: string): string;
|
|
42
|
+
/**
|
|
43
|
+
* Generate chain-specific statistics ID
|
|
44
|
+
*
|
|
45
|
+
* @param chainId - Network chain ID
|
|
46
|
+
* @returns Formatted ID: "chainId-global"
|
|
47
|
+
*/
|
|
48
|
+
export declare function createChainStatsId(chainId: number): string;
|
|
49
|
+
/**
|
|
50
|
+
* Generate delegation ID based on delegator address and testnet status
|
|
51
|
+
*
|
|
52
|
+
* @param delegatorAddress - The wallet address that is delegating
|
|
53
|
+
* @param isTestNet - Whether the chain is a testnet
|
|
54
|
+
* @returns Formatted ID: "delegatorAddress-testNet"
|
|
55
|
+
*/
|
|
56
|
+
export declare function createDelegationId(delegatorAddress: string, isTestNet: boolean): string;
|
|
57
|
+
/**
|
|
58
|
+
* Normalize address to lowercase
|
|
59
|
+
*/
|
|
60
|
+
export declare function normalizeAddress(address: string): string;
|
|
61
|
+
/**
|
|
62
|
+
* Format bigint for display
|
|
63
|
+
*/
|
|
64
|
+
export declare function formatBigInt(value: bigint, decimals?: number): string;
|
|
65
|
+
/**
|
|
66
|
+
* Check if address is zero address (delegation clearing)
|
|
67
|
+
*/
|
|
68
|
+
export declare function isZeroAddress(address: string): boolean;
|
|
69
|
+
/**
|
|
70
|
+
* Determine if a chain ID represents a testnet
|
|
71
|
+
* @param chainId The blockchain chain ID
|
|
72
|
+
* @returns true if the chain is a testnet, false if mainnet
|
|
73
|
+
*/
|
|
74
|
+
export declare function isTestNet(chainId: number): boolean;
|
|
75
|
+
/**
|
|
76
|
+
* Validate event arguments
|
|
77
|
+
*/
|
|
78
|
+
export declare function validateEventArgs<T extends Record<string, unknown>>(args: T, requiredFields: (keyof T)[]): boolean;
|
|
79
|
+
/**
|
|
80
|
+
* Multi-chain ID generator function signature
|
|
81
|
+
*/
|
|
82
|
+
export type MultiChainIdGenerator = (chainId: number, txHash: string, logIndex: number) => string;
|
|
83
|
+
/**
|
|
84
|
+
* User-specific multi-chain ID generator function signature
|
|
85
|
+
*/
|
|
86
|
+
export type UserChainIdGenerator = (chainId: number, address: string) => string;
|
|
87
|
+
//# sourceMappingURL=event-helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event-helpers.d.ts","sourceRoot":"","sources":["../../../src/utils/blockchain/event-helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAMH;;;;;;;;;;;;;GAaG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,GACf,MAAM,CAER;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,GACd,MAAM,CAER;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAE1D;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAChC,gBAAgB,EAAE,MAAM,EACxB,SAAS,EAAE,OAAO,GACjB,MAAM,CAER;AAMD;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAExD;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,GAAE,MAAW,GAAG,MAAM,CAUzE;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAEtD;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAqBlD;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACjE,IAAI,EAAE,CAAC,EACP,cAAc,EAAE,CAAC,MAAM,CAAC,CAAC,EAAE,GAC1B,OAAO,CAQT;AAMD;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG,CAClC,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,KACb,MAAM,CAAC;AAEZ;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,MAAM,CAAC"}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @fileoverview Pure Event Helper Functions
|
|
4
|
+
* @description Pure utility functions for multi-chain event processing
|
|
5
|
+
* @version 2.0.0
|
|
6
|
+
*
|
|
7
|
+
* This file provides clean, type-safe utility functions with no external dependencies:
|
|
8
|
+
* - Multi-chain ID generation
|
|
9
|
+
* - Address normalization
|
|
10
|
+
* - BigInt formatting
|
|
11
|
+
* - Address validation
|
|
12
|
+
* - Testnet detection
|
|
13
|
+
*/
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.createMultiChainId = createMultiChainId;
|
|
16
|
+
exports.createUserMultiChainId = createUserMultiChainId;
|
|
17
|
+
exports.createChainStatsId = createChainStatsId;
|
|
18
|
+
exports.createDelegationId = createDelegationId;
|
|
19
|
+
exports.normalizeAddress = normalizeAddress;
|
|
20
|
+
exports.formatBigInt = formatBigInt;
|
|
21
|
+
exports.isZeroAddress = isZeroAddress;
|
|
22
|
+
exports.isTestNet = isTestNet;
|
|
23
|
+
exports.validateEventArgs = validateEventArgs;
|
|
24
|
+
// ========================================
|
|
25
|
+
// ID GENERATION UTILITIES
|
|
26
|
+
// ========================================
|
|
27
|
+
/**
|
|
28
|
+
* Generate unique multi-chain entity ID
|
|
29
|
+
*
|
|
30
|
+
* @param chainId - Network chain ID (e.g., 1 for Ethereum)
|
|
31
|
+
* @param txHash - Transaction hash
|
|
32
|
+
* @param logIndex - Event log index within transaction
|
|
33
|
+
* @returns Formatted ID: "chainId-txHash-logIndex"
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* ```typescript
|
|
37
|
+
* const id = createMultiChainId(1, "0x123...", 0);
|
|
38
|
+
* // Result: "1-0x123...-0"
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
function createMultiChainId(chainId, txHash, logIndex) {
|
|
42
|
+
return `${chainId}-${txHash}-${logIndex}`;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Generate user-specific multi-chain ID
|
|
46
|
+
*
|
|
47
|
+
* @param chainId - Network chain ID
|
|
48
|
+
* @param address - User wallet address (will be normalized to lowercase)
|
|
49
|
+
* @returns Formatted ID: "chainId-address"
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* ```typescript
|
|
53
|
+
* const userId = createUserMultiChainId(137, "0xABC...");
|
|
54
|
+
* // Result: "137-0xabc..."
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
function createUserMultiChainId(chainId, address) {
|
|
58
|
+
return `${chainId}-${address.toLowerCase()}`;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Generate chain-specific statistics ID
|
|
62
|
+
*
|
|
63
|
+
* @param chainId - Network chain ID
|
|
64
|
+
* @returns Formatted ID: "chainId-global"
|
|
65
|
+
*/
|
|
66
|
+
function createChainStatsId(chainId) {
|
|
67
|
+
return `${chainId}-global`;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Generate delegation ID based on delegator address and testnet status
|
|
71
|
+
*
|
|
72
|
+
* @param delegatorAddress - The wallet address that is delegating
|
|
73
|
+
* @param isTestNet - Whether the chain is a testnet
|
|
74
|
+
* @returns Formatted ID: "delegatorAddress-testNet"
|
|
75
|
+
*/
|
|
76
|
+
function createDelegationId(delegatorAddress, isTestNet) {
|
|
77
|
+
return `${delegatorAddress.toLowerCase()}-${isTestNet}`;
|
|
78
|
+
}
|
|
79
|
+
// ========================================
|
|
80
|
+
// UTILITY FUNCTIONS
|
|
81
|
+
// ========================================
|
|
82
|
+
/**
|
|
83
|
+
* Normalize address to lowercase
|
|
84
|
+
*/
|
|
85
|
+
function normalizeAddress(address) {
|
|
86
|
+
return address.toLowerCase();
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Format bigint for display
|
|
90
|
+
*/
|
|
91
|
+
function formatBigInt(value, decimals = 18) {
|
|
92
|
+
const divisor = BigInt(10 ** decimals);
|
|
93
|
+
const whole = value / divisor;
|
|
94
|
+
const fraction = value % divisor;
|
|
95
|
+
if (fraction === 0n) {
|
|
96
|
+
return whole.toString();
|
|
97
|
+
}
|
|
98
|
+
return `${whole}.${fraction.toString().padStart(decimals, '0').replace(/0+$/, '')}`;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Check if address is zero address (delegation clearing)
|
|
102
|
+
*/
|
|
103
|
+
function isZeroAddress(address) {
|
|
104
|
+
return address.toLowerCase() === '0x0000000000000000000000000000000000000000';
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Determine if a chain ID represents a testnet
|
|
108
|
+
* @param chainId The blockchain chain ID
|
|
109
|
+
* @returns true if the chain is a testnet, false if mainnet
|
|
110
|
+
*/
|
|
111
|
+
function isTestNet(chainId) {
|
|
112
|
+
// EVM Testnets (positive chain IDs)
|
|
113
|
+
const evmTestnets = new Set([
|
|
114
|
+
31337, // Hardhat (local development)
|
|
115
|
+
11155111, // Ethereum Sepolia
|
|
116
|
+
80001, // Polygon Mumbai (if configured)
|
|
117
|
+
80002, // Polygon Amoy (if configured)
|
|
118
|
+
421614, // Arbitrum Sepolia (if configured)
|
|
119
|
+
11155420, // OP Sepolia (if configured)
|
|
120
|
+
84532, // Base Sepolia (if configured)
|
|
121
|
+
43113, // Avalanche Fuji (if configured)
|
|
122
|
+
]);
|
|
123
|
+
// Solana Testnets (negative chain IDs)
|
|
124
|
+
const solanaTestnets = new Set([
|
|
125
|
+
-102, // Solana Devnet
|
|
126
|
+
-103, // Solana Testnet
|
|
127
|
+
-104, // Solana Localnet
|
|
128
|
+
]);
|
|
129
|
+
return evmTestnets.has(chainId) || solanaTestnets.has(chainId);
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Validate event arguments
|
|
133
|
+
*/
|
|
134
|
+
function validateEventArgs(args, requiredFields) {
|
|
135
|
+
for (const field of requiredFields) {
|
|
136
|
+
if (args[field] === undefined || args[field] === null) {
|
|
137
|
+
console.error(`❌ Missing required field: ${String(field)}`);
|
|
138
|
+
return false;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
return true;
|
|
142
|
+
}
|
|
143
|
+
//# sourceMappingURL=event-helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"event-helpers.js","sourceRoot":"","sources":["../../../src/utils/blockchain/event-helpers.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;GAWG;;AAoBH,gDAMC;AAeD,wDAKC;AAQD,gDAEC;AASD,gDAKC;AASD,4CAEC;AAKD,oCAUC;AAKD,sCAEC;AAOD,8BAqBC;AAKD,8CAWC;AAjJD,2CAA2C;AAC3C,0BAA0B;AAC1B,2CAA2C;AAE3C;;;;;;;;;;;;;GAaG;AACH,SAAgB,kBAAkB,CAChC,OAAe,EACf,MAAc,EACd,QAAgB;IAEhB,OAAO,GAAG,OAAO,IAAI,MAAM,IAAI,QAAQ,EAAE,CAAC;AAC5C,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,SAAgB,sBAAsB,CACpC,OAAe,EACf,OAAe;IAEf,OAAO,GAAG,OAAO,IAAI,OAAO,CAAC,WAAW,EAAE,EAAE,CAAC;AAC/C,CAAC;AAED;;;;;GAKG;AACH,SAAgB,kBAAkB,CAAC,OAAe;IAChD,OAAO,GAAG,OAAO,SAAS,CAAC;AAC7B,CAAC;AAED;;;;;;GAMG;AACH,SAAgB,kBAAkB,CAChC,gBAAwB,EACxB,SAAkB;IAElB,OAAO,GAAG,gBAAgB,CAAC,WAAW,EAAE,IAAI,SAAS,EAAE,CAAC;AAC1D,CAAC;AAED,2CAA2C;AAC3C,oBAAoB;AACpB,2CAA2C;AAE3C;;GAEG;AACH,SAAgB,gBAAgB,CAAC,OAAe;IAC9C,OAAO,OAAO,CAAC,WAAW,EAAE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C;AACjE,CAAC;AAED;;GAEG;AACH,SAAgB,iBAAiB,CAC/B,IAAO,EACP,cAA2B;IAE3B,KAAK,MAAM,KAAK,IAAI,cAAc,EAAE,CAAC;QACnC,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,SAAS,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,IAAI,EAAE,CAAC;YACtD,OAAO,CAAC,KAAK,CAAC,6BAA6B,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;YAC5D,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RpcHelpers = exports.validateEventArgs = exports.normalizeAddress = exports.isZeroAddress = exports.isTestNet = exports.formatBigInt = exports.createUserMultiChainId = exports.createMultiChainId = exports.createDelegationId = exports.createChainStatsId = exports.isSolanaAddress = exports.isEvmAddress = exports.parseEmailAddress = exports.isValidWalletAddress = exports.isValidSignature = exports.isSNSName = exports.isENSName = exports.getChainDisplayName = exports.getAddressType = exports.formatWalletAddress = exports.AddressType = void 0;
|
|
4
|
+
var address_1 = require("./address");
|
|
5
|
+
Object.defineProperty(exports, "AddressType", { enumerable: true, get: function () { return address_1.AddressType; } });
|
|
6
|
+
Object.defineProperty(exports, "formatWalletAddress", { enumerable: true, get: function () { return address_1.formatWalletAddress; } });
|
|
7
|
+
Object.defineProperty(exports, "getAddressType", { enumerable: true, get: function () { return address_1.getAddressType; } });
|
|
8
|
+
Object.defineProperty(exports, "getChainDisplayName", { enumerable: true, get: function () { return address_1.getChainDisplayName; } });
|
|
9
|
+
Object.defineProperty(exports, "isENSName", { enumerable: true, get: function () { return address_1.isENSName; } });
|
|
10
|
+
Object.defineProperty(exports, "isSNSName", { enumerable: true, get: function () { return address_1.isSNSName; } });
|
|
11
|
+
Object.defineProperty(exports, "isValidSignature", { enumerable: true, get: function () { return address_1.isValidSignature; } });
|
|
12
|
+
Object.defineProperty(exports, "isValidWalletAddress", { enumerable: true, get: function () { return address_1.isValidWalletAddress; } });
|
|
13
|
+
Object.defineProperty(exports, "parseEmailAddress", { enumerable: true, get: function () { return address_1.parseEmailAddress; } });
|
|
14
|
+
// Export address validation functions from common.ts
|
|
15
|
+
var common_1 = require("../../types/blockchain/common");
|
|
16
|
+
Object.defineProperty(exports, "isEvmAddress", { enumerable: true, get: function () { return common_1.isEvmAddress; } });
|
|
17
|
+
Object.defineProperty(exports, "isSolanaAddress", { enumerable: true, get: function () { return common_1.isSolanaAddress; } });
|
|
18
|
+
var event_helpers_1 = require("./event-helpers");
|
|
19
|
+
Object.defineProperty(exports, "createChainStatsId", { enumerable: true, get: function () { return event_helpers_1.createChainStatsId; } });
|
|
20
|
+
Object.defineProperty(exports, "createDelegationId", { enumerable: true, get: function () { return event_helpers_1.createDelegationId; } });
|
|
21
|
+
Object.defineProperty(exports, "createMultiChainId", { enumerable: true, get: function () { return event_helpers_1.createMultiChainId; } });
|
|
22
|
+
Object.defineProperty(exports, "createUserMultiChainId", { enumerable: true, get: function () { return event_helpers_1.createUserMultiChainId; } });
|
|
23
|
+
Object.defineProperty(exports, "formatBigInt", { enumerable: true, get: function () { return event_helpers_1.formatBigInt; } });
|
|
24
|
+
Object.defineProperty(exports, "isTestNet", { enumerable: true, get: function () { return event_helpers_1.isTestNet; } });
|
|
25
|
+
Object.defineProperty(exports, "isZeroAddress", { enumerable: true, get: function () { return event_helpers_1.isZeroAddress; } });
|
|
26
|
+
Object.defineProperty(exports, "normalizeAddress", { enumerable: true, get: function () { return event_helpers_1.normalizeAddress; } });
|
|
27
|
+
Object.defineProperty(exports, "validateEventArgs", { enumerable: true, get: function () { return event_helpers_1.validateEventArgs; } });
|
|
28
|
+
var rpc_helpers_1 = require("./rpc-helpers");
|
|
29
|
+
Object.defineProperty(exports, "RpcHelpers", { enumerable: true, get: function () { return rpc_helpers_1.RpcHelpers; } });
|
|
30
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type { ParsedEmailAddress } from './address';
|
|
2
|
+
export { AddressType, formatWalletAddress, getAddressType, getChainDisplayName, isENSName, isSNSName, isValidSignature, isValidWalletAddress, parseEmailAddress, } from './address';
|
|
3
|
+
export { isEvmAddress, isSolanaAddress } from '../../types/blockchain/common';
|
|
4
|
+
export type { MultiChainIdGenerator, UserChainIdGenerator, } from './event-helpers';
|
|
5
|
+
export { createChainStatsId, createDelegationId, createMultiChainId, createUserMultiChainId, formatBigInt, isTestNet, isZeroAddress, normalizeAddress, validateEventArgs, } from './event-helpers';
|
|
6
|
+
export type { BlockchainApis } from './rpc-helpers';
|
|
7
|
+
export { RpcHelpers } from './rpc-helpers';
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/blockchain/index.ts"],"names":[],"mappings":"AACA,YAAY,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAEpD,OAAO,EACL,WAAW,EACX,mBAAmB,EACnB,cAAc,EACd,mBAAmB,EACnB,SAAS,EACT,SAAS,EACT,gBAAgB,EAChB,oBAAoB,EACpB,iBAAiB,GAClB,MAAM,WAAW,CAAC;AAGnB,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAG9E,YAAY,EACV,qBAAqB,EACrB,oBAAoB,GACrB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACL,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,sBAAsB,EACtB,YAAY,EACZ,SAAS,EACT,aAAa,EACb,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,iBAAiB,CAAC;AAGzB,YAAY,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RpcHelpers = exports.validateEventArgs = exports.normalizeAddress = exports.isZeroAddress = exports.isTestNet = exports.formatBigInt = exports.createUserMultiChainId = exports.createMultiChainId = exports.createDelegationId = exports.createChainStatsId = exports.isSolanaAddress = exports.isEvmAddress = exports.parseEmailAddress = exports.isValidWalletAddress = exports.isValidSignature = exports.isSNSName = exports.isENSName = exports.getChainDisplayName = exports.getAddressType = exports.formatWalletAddress = exports.AddressType = void 0;
|
|
4
|
+
var address_1 = require("./address");
|
|
5
|
+
Object.defineProperty(exports, "AddressType", { enumerable: true, get: function () { return address_1.AddressType; } });
|
|
6
|
+
Object.defineProperty(exports, "formatWalletAddress", { enumerable: true, get: function () { return address_1.formatWalletAddress; } });
|
|
7
|
+
Object.defineProperty(exports, "getAddressType", { enumerable: true, get: function () { return address_1.getAddressType; } });
|
|
8
|
+
Object.defineProperty(exports, "getChainDisplayName", { enumerable: true, get: function () { return address_1.getChainDisplayName; } });
|
|
9
|
+
Object.defineProperty(exports, "isENSName", { enumerable: true, get: function () { return address_1.isENSName; } });
|
|
10
|
+
Object.defineProperty(exports, "isSNSName", { enumerable: true, get: function () { return address_1.isSNSName; } });
|
|
11
|
+
Object.defineProperty(exports, "isValidSignature", { enumerable: true, get: function () { return address_1.isValidSignature; } });
|
|
12
|
+
Object.defineProperty(exports, "isValidWalletAddress", { enumerable: true, get: function () { return address_1.isValidWalletAddress; } });
|
|
13
|
+
Object.defineProperty(exports, "parseEmailAddress", { enumerable: true, get: function () { return address_1.parseEmailAddress; } });
|
|
14
|
+
// Export address validation functions from common.ts
|
|
15
|
+
var common_1 = require("../../types/blockchain/common");
|
|
16
|
+
Object.defineProperty(exports, "isEvmAddress", { enumerable: true, get: function () { return common_1.isEvmAddress; } });
|
|
17
|
+
Object.defineProperty(exports, "isSolanaAddress", { enumerable: true, get: function () { return common_1.isSolanaAddress; } });
|
|
18
|
+
var event_helpers_1 = require("./event-helpers");
|
|
19
|
+
Object.defineProperty(exports, "createChainStatsId", { enumerable: true, get: function () { return event_helpers_1.createChainStatsId; } });
|
|
20
|
+
Object.defineProperty(exports, "createDelegationId", { enumerable: true, get: function () { return event_helpers_1.createDelegationId; } });
|
|
21
|
+
Object.defineProperty(exports, "createMultiChainId", { enumerable: true, get: function () { return event_helpers_1.createMultiChainId; } });
|
|
22
|
+
Object.defineProperty(exports, "createUserMultiChainId", { enumerable: true, get: function () { return event_helpers_1.createUserMultiChainId; } });
|
|
23
|
+
Object.defineProperty(exports, "formatBigInt", { enumerable: true, get: function () { return event_helpers_1.formatBigInt; } });
|
|
24
|
+
Object.defineProperty(exports, "isTestNet", { enumerable: true, get: function () { return event_helpers_1.isTestNet; } });
|
|
25
|
+
Object.defineProperty(exports, "isZeroAddress", { enumerable: true, get: function () { return event_helpers_1.isZeroAddress; } });
|
|
26
|
+
Object.defineProperty(exports, "normalizeAddress", { enumerable: true, get: function () { return event_helpers_1.normalizeAddress; } });
|
|
27
|
+
Object.defineProperty(exports, "validateEventArgs", { enumerable: true, get: function () { return event_helpers_1.validateEventArgs; } });
|
|
28
|
+
var rpc_helpers_1 = require("./rpc-helpers");
|
|
29
|
+
Object.defineProperty(exports, "RpcHelpers", { enumerable: true, get: function () { return rpc_helpers_1.RpcHelpers; } });
|
|
30
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/blockchain/index.ts"],"names":[],"mappings":";;;AAGA,qCAUmB;AATjB,sGAAA,WAAW,OAAA;AACX,8GAAA,mBAAmB,OAAA;AACnB,yGAAA,cAAc,OAAA;AACd,8GAAA,mBAAmB,OAAA;AACnB,oGAAA,SAAS,OAAA;AACT,oGAAA,SAAS,OAAA;AACT,2GAAA,gBAAgB,OAAA;AAChB,+GAAA,oBAAoB,OAAA;AACpB,4GAAA,iBAAiB,OAAA;AAGnB,qDAAqD;AACrD,wDAA8E;AAArE,sGAAA,YAAY,OAAA;AAAE,yGAAA,eAAe,OAAA;AAQtC,iDAUyB;AATvB,mHAAA,kBAAkB,OAAA;AAClB,mHAAA,kBAAkB,OAAA;AAClB,mHAAA,kBAAkB,OAAA;AAClB,uHAAA,sBAAsB,OAAA;AACtB,6GAAA,YAAY,OAAA;AACZ,0GAAA,SAAS,OAAA;AACT,8GAAA,aAAa,OAAA;AACb,iHAAA,gBAAgB,OAAA;AAChB,kHAAA,iBAAiB,OAAA;AAKnB,6CAA2C;AAAlC,yGAAA,UAAU,OAAA"}
|