Skip to content

remove backend param #82

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 13, 2024
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
1 change: 0 additions & 1 deletion examples/jq.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ async function main() {
const substrate = new Substrate({
apiKey: SUBSTRATE_API_KEY,
baseUrl: "https://api.substrate.run",
backend: "v1",
});

const a = new GenerateJSON({
Expand Down
1 change: 0 additions & 1 deletion examples/kitchen-sink.ts
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,6 @@ async function main() {
const substrate = new Substrate({
apiKey: SUBSTRATE_API_KEY,
baseUrl: env.url.value,
backend: env.backend.value,
});
const tag = `[${env.url.name}:${env.backend.value}]`;

Expand Down
1 change: 0 additions & 1 deletion examples/large-run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ async function main() {
const substrate = new Substrate({
apiKey: SUBSTRATE_API_KEY,
baseUrl: "https://api-staging.substrate.run",
backend: "v1",
});

let nodes = [];
Expand Down
9 changes: 0 additions & 9 deletions src/Substrate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,6 @@ type Configuration = {
*/
timeout?: number;

/**
* Switches between existing backend and newer backend
*/
backend?: "v0" | "v1";

/**
* Add additional headers to each request. These may override headers set by the Substrate client.
*/
Expand All @@ -45,7 +40,6 @@ export class Substrate {
baseUrl: NonNullable<Configuration["baseUrl"]>;
apiVersion: NonNullable<Configuration["apiVersion"]>;
timeout: NonNullable<Configuration["timeout"]>;
backend: NonNullable<Configuration["backend"]>;
additionalHeaders: NonNullable<Configuration["additionalHeaders"]>;

/**
Expand All @@ -56,7 +50,6 @@ export class Substrate {
baseUrl,
apiVersion,
timeout,
backend,
additionalHeaders,
}: Configuration) {
if (!apiKey) {
Expand All @@ -68,7 +61,6 @@ export class Substrate {
this.baseUrl = baseUrl ?? "https://api.substrate.run";
this.apiVersion = apiVersion ?? OpenAPIjson["info"]["version"];
this.timeout = timeout ?? 300_000;
this.backend = backend ?? "v1";
this.additionalHeaders = additionalHeaders ?? {};
}

Expand Down Expand Up @@ -235,7 +227,6 @@ export class Substrate {
headers.append("Content-Type", "application/json");
headers.append("User-Agent", `APIClient/JS ${VERSION}`);
headers.append("X-Substrate-Version", this.apiVersion);
headers.append("X-Substrate-Backend", this.backend); // Switch between old and new backends
headers.append("X-Substrate-Request-Id", randomString(32));

// Auth
Expand Down
Loading