Skip to content

Commit 5190500

Browse files
committed
Add clientName on Entrypoints
1 parent e0d9465 commit 5190500

File tree

1 file changed

+18
-6
lines changed

1 file changed

+18
-6
lines changed

src/entrypoints/entrypoints.ts

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,20 @@ export class NetworkEntrypoint {
2525
private networkProvider: INetworkProvider;
2626
private chainId: string;
2727

28-
constructor(options: { networkProviderUrl: string; networkProviderKind: string; chainId: string }) {
28+
constructor(options: {
29+
networkProviderUrl: string;
30+
networkProviderKind: string;
31+
chainId: string;
32+
clientName?: string;
33+
}) {
2934
if (options.networkProviderKind === "proxy") {
30-
this.networkProvider = new ProxyNetworkProvider(options.networkProviderUrl);
35+
this.networkProvider = new ProxyNetworkProvider(options.networkProviderUrl, {
36+
clientName: options.clientName,
37+
});
3138
} else if (options.networkProviderKind === "api") {
32-
this.networkProvider = new ApiNetworkProvider(options.networkProviderUrl);
39+
this.networkProvider = new ApiNetworkProvider(options.networkProviderUrl, {
40+
clientName: options.clientName,
41+
});
3342
} else {
3443
throw new ErrInvalidNetworkProviderKind();
3544
}
@@ -174,34 +183,37 @@ export class NetworkEntrypoint {
174183
}
175184

176185
export class TestnetEntrypoint extends NetworkEntrypoint {
177-
constructor(url?: string, kind?: string) {
186+
constructor(url?: string, kind?: string, clientName?: string) {
178187
const entrypointConfig = new TestnetEntrypointConfig();
179188
super({
180189
networkProviderUrl: url || entrypointConfig.networkProviderUrl,
181190
networkProviderKind: kind || entrypointConfig.networkProviderKind,
182191
chainId: entrypointConfig.chainId,
192+
clientName: clientName,
183193
});
184194
}
185195
}
186196

187197
export class DevnetEntrypoint extends NetworkEntrypoint {
188-
constructor(url?: string, kind?: string) {
198+
constructor(url?: string, kind?: string, clientName?: string) {
189199
const entrypointConfig = new DevnetEntrypointConfig();
190200
super({
191201
networkProviderUrl: url || entrypointConfig.networkProviderUrl,
192202
networkProviderKind: kind || entrypointConfig.networkProviderKind,
193203
chainId: entrypointConfig.chainId,
204+
clientName: clientName,
194205
});
195206
}
196207
}
197208

198209
export class MainnetEntrypoint extends NetworkEntrypoint {
199-
constructor(url?: string, kind?: string) {
210+
constructor(url?: string, kind?: string, clientName?: string) {
200211
const entrypointConfig = new MainnetEntrypointConfig();
201212
super({
202213
networkProviderUrl: url || entrypointConfig.networkProviderUrl,
203214
networkProviderKind: kind || entrypointConfig.networkProviderKind,
204215
chainId: entrypointConfig.chainId,
216+
clientName: clientName,
205217
});
206218
}
207219
}

0 commit comments

Comments
 (0)