Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@polymarket/builder-signing-sdk",
"description": "Polymarket SDK for creating builder headers",
"version": "0.0.7",
"version": "0.0.8",
"contributors": [
{
"name": "Jonathan Amenechi",
Expand Down
17 changes: 8 additions & 9 deletions src/config.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
import { URL } from 'url';

import { BuilderSigner } from "./signer";
import { post } from "./http-helpers";
import { BuilderApiKeyCreds, BuilderHeaderPayload, BuilderType, RemoteBuilderConfig, RemoteSignerPayload } from "./types";
import {
BuilderApiKeyCreds,
BuilderHeaderPayload,
BuilderType,
RemoteBuilderConfig,
RemoteSignerPayload
} from "./types";
import { AxiosRequestHeaders } from 'axios';

export class BuilderConfig {
Expand Down Expand Up @@ -119,12 +123,7 @@ export class BuilderConfig {

private static hasValidRemoteUrl(remoteUrl?: string): boolean {
if (!remoteUrl?.trim()) return false;
try {
const url = new URL(remoteUrl.trim());
return url.protocol === "http:" || url.protocol === "https:";
} catch {
return false;
}
return remoteUrl.startsWith("http://") || remoteUrl.startsWith("https://");
Comment thread
JonathanAmenechi marked this conversation as resolved.
Comment thread
JonathanAmenechi marked this conversation as resolved.
}

private ensureValid(): void {
Expand Down