Type Definition
utils/address.ts:1
Description
TheAddressType type represents the two blockchain address formats supported by the Points Adapters SDK:
"evm"- Ethereum Virtual Machine addresses (e.g.,0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb)"svm"- Solana Virtual Machine addresses (base58 encoded, e.g.,7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU)
Usage in Adapters
Every adapter must declare which address types it supports via thesupportedAddressTypes field:
adapters/etherfi.ts:83
Multi-chain Support
Adapters can support both address types:Address Validation
The SDK provides utility functions to validate and detect address types:isEvmAddress(address: string): boolean
Validates if a string is a valid EVM address:
utils/address.ts:8-9
isSvmAddress(address: string): boolean
Validates if a string is a valid SVM (Solana) address:
utils/address.ts:11-14
detectAddressType(address: string): AddressType | null
Automatically detects the address type, returning null if unrecognized:
utils/address.ts:16-20
requireAddressType(address: string): AddressType
Same as detectAddressType but throws an error if the address type cannot be determined:
utils/address.ts:23-29
Runtime Validation
When an adapter is executed viarunAdapter(), the SDK automatically validates that the provided address type is supported:
utils/adapter.ts:33-47
Validation Rules
EVM Addresses
- Must start with
0x - Followed by exactly 40 hexadecimal characters (0-9, a-f, A-F)
- Regex:
/^0x[a-fA-F0-9]{40}$/
SVM Addresses
- Base58 encoded string
- Length between 32 and 44 characters
- Contains only valid base58 characters:
[1-9A-HJ-NP-Za-km-z] - Regex:
/^[1-9A-HJ-NP-Za-km-z]+$/
Related Types
- AdapterExport - Uses
supportedAddressTypes: AddressType[] - AdapterResult - Includes
supportedAddressTypes: AddressType[]