22 Chain ,
33 ContractFunctionExecutionError ,
44 encodeFunctionData ,
5+ Hex ,
56} from "viem" ;
67import {
78 getAvailableRoutes ,
@@ -43,6 +44,7 @@ import {
4344 getSupportedChains ,
4445 simulateTxOnTenderly ,
4546 TenderlySimulateTxParams ,
47+ assertValidIntegratorId ,
4648} from "./utils" ;
4749import {
4850 AcrossApiSimulationError ,
@@ -53,12 +55,11 @@ import {
5355 ConfiguredPublicClient ,
5456 ConfiguredPublicClientMap ,
5557 ConfiguredWalletClient ,
56- Deposit ,
5758} from "./types" ;
5859
5960const CLIENT_DEFAULTS = {
6061 pollingInterval : 3_000 ,
61- integratorId : "INTEGRATOR_SDK " ,
62+ integratorId : "0xdead " ,
6263 logLevel : "ERROR" ,
6364} as const ;
6465
@@ -67,7 +68,7 @@ export type AcrossClientOptions = {
6768 /**
6869 * An identifier representing the integrator.
6970 */
70- integratorId ?: string ;
71+ integratorId ?: Hex ;
7172 /**
7273 * The chains to use for the Across API. Should be imported from `viem/chains`.
7374 */
@@ -135,7 +136,7 @@ export type AcrossClientOptions = {
135136export class AcrossClient {
136137 private static instance : AcrossClient | null = null ;
137138
138- private integratorId : string ;
139+ private integratorId : Hex ;
139140 private publicClients : ConfiguredPublicClientMap ;
140141 private walletClient ?: ConfiguredWalletClient ;
141142 private apiUrl : string ;
@@ -159,7 +160,10 @@ export class AcrossClient {
159160 }
160161
161162 private constructor ( args : AcrossClientOptions ) {
162- this . integratorId = args ?. integratorId ?? CLIENT_DEFAULTS . integratorId ;
163+ const integratorId = args ?. integratorId ?? CLIENT_DEFAULTS . integratorId ;
164+ assertValidIntegratorId ( integratorId ) ;
165+
166+ this . integratorId = integratorId ;
163167 this . walletClient = args ?. walletClient ;
164168 this . publicClients = configurePublicClients (
165169 args . chains ,
0 commit comments