Skip to content

Commit

Permalink
Release 0.0.464
Browse files Browse the repository at this point in the history
  • Loading branch information
fern-api[bot] committed Jan 2, 2024
1 parent eecd239 commit 7363b00
Show file tree
Hide file tree
Showing 19 changed files with 84 additions and 69 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@syndicateio/syndicate-node",
"version": "0.0.449",
"name": "@calebguy/testing",
"version": "0.0.464",
"private": false,
"repository": "https://github.com/SyndicateProtocol/syndicate-node",
"main": "./index.js",
Expand All @@ -11,9 +11,9 @@
"prepack": "cp -rv dist/. ."
},
"dependencies": {
"@ungap/url-search-params": "0.2.2",
"url-join": "4.0.1",
"@types/url-join": "4.0.1",
"@ungap/url-search-params": "0.2.2",
"js-base64": "3.7.2",
"axios": "0.27.2"
},
Expand Down
14 changes: 7 additions & 7 deletions src/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
*/

import * as core from "./core";
import { Transact } from "./api/resources/transact/client/Client";
import { Funding } from "./api/resources/funding/client/Client";
import { Transact } from "./api/resources/transact/client/Client";
import { Wallet } from "./api/resources/wallet/client/Client";

export declare namespace SyndicateClient {
Expand All @@ -20,18 +20,18 @@ export declare namespace SyndicateClient {
export class SyndicateClient {
constructor(protected readonly _options: SyndicateClient.Options) {}

protected _transact: Transact | undefined;

public get transact(): Transact {
return (this._transact ??= new Transact(this._options));
}

protected _funding: Funding | undefined;

public get funding(): Funding {
return (this._funding ??= new Funding(this._options));
}

protected _transact: Transact | undefined;

public get transact(): Transact {
return (this._transact ??= new Transact(this._options));
}

protected _wallet: Wallet | undefined;

public get wallet(): Wallet {
Expand Down
4 changes: 2 additions & 2 deletions src/api/resources/funding/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ export class Funding {
headers: {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@syndicateio/syndicate-node",
"X-Fern-SDK-Version": "0.0.449",
"X-Fern-SDK-Name": "@calebguy/testing",
"X-Fern-SDK-Version": "0.0.464",
},
contentType: "application/json",
queryParameters: _queryParams,
Expand Down
2 changes: 1 addition & 1 deletion src/api/resources/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export * as transact from "./transact";
export * as funding from "./funding";
export * as transact from "./transact";
export * as wallet from "./wallet";
25 changes: 16 additions & 9 deletions src/api/resources/transact/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ export class Transact {

/**
* Send transaction to blockchain
* @throws {@link Syndicate.transact.MalformedFunctionDataError}
* @throws {@link Syndicate.transact.ImATeapotError}
* @throws {@link Syndicate.transact.DuplicateTransactionError}
* @throws {@link Syndicate.transact.BadRequestError}
* @throws {@link Syndicate.transact.InternalError}
* @throws {@link Syndicate.transact.InvalidRequestIdError}
*/
Expand All @@ -39,8 +39,8 @@ export class Transact {
headers: {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@syndicateio/syndicate-node",
"X-Fern-SDK-Version": "0.0.449",
"X-Fern-SDK-Name": "@calebguy/testing",
"X-Fern-SDK-Version": "0.0.464",
},
contentType: "application/json",
body: await serializers.transact.SendTransactionRequest.jsonOrThrow(request, {
Expand All @@ -59,22 +59,29 @@ export class Transact {

if (_response.error.reason === "status-code") {
switch (_response.error.statusCode) {
case 409:
throw new Syndicate.transact.DuplicateTransactionError(
await serializers.transact.ErrorBody.parseOrThrow(_response.error.body, {
unrecognizedObjectKeys: "passthrough",
allowUnrecognizedUnionMembers: true,
allowUnrecognizedEnumValues: true,
breadcrumbsPrefix: ["response"],
})
);
case 400:
throw new Syndicate.transact.MalformedFunctionDataError(
await serializers.transact.ErrorWithMessage.parseOrThrow(_response.error.body, {
throw new Syndicate.transact.BadRequestError(
await serializers.transact.ErrorBody.parseOrThrow(_response.error.body, {
unrecognizedObjectKeys: "passthrough",
allowUnrecognizedUnionMembers: true,
allowUnrecognizedEnumValues: true,
breadcrumbsPrefix: ["response"],
})
);
case 418:
throw new Syndicate.transact.ImATeapotError();
case 500:
throw new Syndicate.transact.InternalError();
case 422:
throw new Syndicate.transact.InvalidRequestIdError(
await serializers.transact.ErrorWithMessage.parseOrThrow(_response.error.body, {
await serializers.transact.ErrorBody.parseOrThrow(_response.error.body, {
unrecognizedObjectKeys: "passthrough",
allowUnrecognizedUnionMembers: true,
allowUnrecognizedEnumValues: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
import * as errors from "../../../../errors";
import * as Syndicate from "../../..";

export class MalformedFunctionDataError extends errors.SyndicateError {
constructor(body: Syndicate.transact.ErrorWithMessage) {
export class BadRequestError extends errors.SyndicateError {
constructor(body: Syndicate.transact.ErrorBody) {
super({
statusCode: 400,
body: body,
});
Object.setPrototypeOf(this, MalformedFunctionDataError.prototype);
Object.setPrototypeOf(this, BadRequestError.prototype);
}
}
16 changes: 16 additions & 0 deletions src/api/resources/transact/errors/DuplicateTransactionError.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/

import * as errors from "../../../../errors";
import * as Syndicate from "../../..";

export class DuplicateTransactionError extends errors.SyndicateError {
constructor(body: Syndicate.transact.ErrorBody) {
super({
statusCode: 409,
body: body,
});
Object.setPrototypeOf(this, DuplicateTransactionError.prototype);
}
}
14 changes: 0 additions & 14 deletions src/api/resources/transact/errors/ImATeapotError.ts

This file was deleted.

2 changes: 1 addition & 1 deletion src/api/resources/transact/errors/InvalidRequestIdError.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import * as errors from "../../../../errors";
import * as Syndicate from "../../..";

export class InvalidRequestIdError extends errors.SyndicateError {
constructor(body: Syndicate.transact.ErrorWithMessage) {
constructor(body: Syndicate.transact.ErrorBody) {
super({
statusCode: 422,
body: body,
Expand Down
4 changes: 2 additions & 2 deletions src/api/resources/transact/errors/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export * from "./ImATeapotError";
export * from "./DuplicateTransactionError";
export * from "./InternalError";
export * from "./MalformedFunctionDataError";
export * from "./BadRequestError";
export * from "./InvalidRequestIdError";
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
* This file was auto-generated by Fern from our API Definition.
*/

export interface ErrorWithMessage {
export interface ErrorBody {
message: string;
}
2 changes: 2 additions & 0 deletions src/api/resources/transact/types/SendTransactionRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,6 @@ export interface SendTransactionRequest {
functionSignature: string;
/** (Optional) The function arguments for the transaction if any. The keys are the argument names or index from the provided function signature and the values are the argument values. */
args?: Record<string, unknown>;
organizationId: string;
organizationTier: string;
}
2 changes: 1 addition & 1 deletion src/api/resources/transact/types/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export * from "./ErrorWithMessage";
export * from "./ErrorBody";
export * from "./SendTransactionRequest";
export * from "./SendTransactionResponse";
32 changes: 16 additions & 16 deletions src/api/resources/wallet/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ export class Wallet {
headers: {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@syndicateio/syndicate-node",
"X-Fern-SDK-Version": "0.0.449",
"X-Fern-SDK-Name": "@calebguy/testing",
"X-Fern-SDK-Version": "0.0.464",
},
contentType: "application/json",
body: await serializers.wallet.CreateWalletRequest.jsonOrThrow(request, {
Expand Down Expand Up @@ -103,8 +103,8 @@ export class Wallet {
headers: {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@syndicateio/syndicate-node",
"X-Fern-SDK-Version": "0.0.449",
"X-Fern-SDK-Name": "@calebguy/testing",
"X-Fern-SDK-Version": "0.0.464",
},
contentType: "application/json",
body: await serializers.wallet.RetireWalletRequest.jsonOrThrow(request, {
Expand Down Expand Up @@ -162,8 +162,8 @@ export class Wallet {
headers: {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@syndicateio/syndicate-node",
"X-Fern-SDK-Version": "0.0.449",
"X-Fern-SDK-Name": "@calebguy/testing",
"X-Fern-SDK-Version": "0.0.464",
},
contentType: "application/json",
body: await serializers.wallet.ToggleIsActiveRequest.jsonOrThrow(request, {
Expand Down Expand Up @@ -225,8 +225,8 @@ export class Wallet {
headers: {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@syndicateio/syndicate-node",
"X-Fern-SDK-Version": "0.0.449",
"X-Fern-SDK-Name": "@calebguy/testing",
"X-Fern-SDK-Version": "0.0.464",
},
contentType: "application/json",
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
Expand Down Expand Up @@ -300,8 +300,8 @@ export class Wallet {
headers: {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@syndicateio/syndicate-node",
"X-Fern-SDK-Version": "0.0.449",
"X-Fern-SDK-Name": "@calebguy/testing",
"X-Fern-SDK-Version": "0.0.464",
},
contentType: "application/json",
queryParameters: _queryParams,
Expand Down Expand Up @@ -364,8 +364,8 @@ export class Wallet {
headers: {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@syndicateio/syndicate-node",
"X-Fern-SDK-Version": "0.0.449",
"X-Fern-SDK-Name": "@calebguy/testing",
"X-Fern-SDK-Version": "0.0.464",
},
contentType: "application/json",
queryParameters: _queryParams,
Expand Down Expand Up @@ -449,8 +449,8 @@ export class Wallet {
headers: {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@syndicateio/syndicate-node",
"X-Fern-SDK-Version": "0.0.449",
"X-Fern-SDK-Name": "@calebguy/testing",
"X-Fern-SDK-Version": "0.0.464",
},
contentType: "application/json",
queryParameters: _queryParams,
Expand Down Expand Up @@ -500,8 +500,8 @@ export class Wallet {
headers: {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@syndicateio/syndicate-node",
"X-Fern-SDK-Version": "0.0.449",
"X-Fern-SDK-Name": "@calebguy/testing",
"X-Fern-SDK-Version": "0.0.464",
},
contentType: "application/json",
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
Expand Down
2 changes: 1 addition & 1 deletion src/serialization/resources/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export * as transact from "./transact";
export * as funding from "./funding";
export * as transact from "./transact";
export * as wallet from "./wallet";
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ import * as serializers from "../../..";
import * as Syndicate from "../../../../api";
import * as core from "../../../../core";

export const ErrorWithMessage: core.serialization.ObjectSchema<
serializers.transact.ErrorWithMessage.Raw,
Syndicate.transact.ErrorWithMessage
export const ErrorBody: core.serialization.ObjectSchema<
serializers.transact.ErrorBody.Raw,
Syndicate.transact.ErrorBody
> = core.serialization.object({
message: core.serialization.string(),
});

export declare namespace ErrorWithMessage {
export declare namespace ErrorBody {
interface Raw {
message: string;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ export const SendTransactionRequest: core.serialization.ObjectSchema<
chainId: core.serialization.number(),
functionSignature: core.serialization.string(),
args: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(),
organizationId: core.serialization.string(),
organizationTier: core.serialization.string(),
});

export declare namespace SendTransactionRequest {
Expand All @@ -26,5 +28,7 @@ export declare namespace SendTransactionRequest {
chainId: number;
functionSignature: string;
args?: Record<string, unknown> | null;
organizationId: string;
organizationTier: string;
}
}
2 changes: 1 addition & 1 deletion src/serialization/resources/transact/types/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export * from "./ErrorWithMessage";
export * from "./ErrorBody";
export * from "./SendTransactionRequest";
export * from "./SendTransactionResponse";
6 changes: 3 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ delayed-stream@~1.0.0:
integrity sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==

follow-redirects@^1.14.9:
version "1.15.3"
resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.3.tgz#fe2f3ef2690afce7e82ed0b44db08165b207123a"
integrity sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q==
version "1.15.4"
resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.4.tgz#cdc7d308bf6493126b17ea2191ea0ccf3e535adf"
integrity sha512-Cr4D/5wlrb0z9dgERpUL3LrmPKVDsETIJhaCMeDfuFYcqa5bldGV6wBsAN6X/vxlXQtFBMrXdXxdL8CbDTGniw==

form-data@^4.0.0:
version "4.0.0"
Expand Down

0 comments on commit 7363b00

Please sign in to comment.