@radixdlt/networking
Advanced tools
Comparing version 2.1.5 to 2.1.6
@@ -6,2 +6,10 @@ # Change Log | ||
## [2.1.6](https://github.com/radixdlt/radixdlt-javascript/compare/@radixdlt/networking@2.1.5...@radixdlt/networking@2.1.6) (2021-12-01) | ||
**Note:** Version bump only for package @radixdlt/networking | ||
## [2.1.5](https://github.com/radixdlt/radixdlt-javascript/compare/@radixdlt/networking@2.1.4...@radixdlt/networking@2.1.5) (2021-10-25) | ||
@@ -8,0 +16,0 @@ |
@@ -1,5 +0,12 @@ | ||
export declare type Transport = { | ||
call: (endpoint: string, params: unknown[] | Record<string, unknown>) => Promise<unknown>; | ||
import { ResultAsync } from 'neverthrow'; | ||
import { OpenApiClientCall } from './open-api-client'; | ||
import { OpenRPCClientCall } from './open-rpc-client'; | ||
declare type TransportType = 'json-rpc' | 'open-api'; | ||
export declare type Call<Methods, Params, Return> = <Methods, Params, Return>(method: Methods, param: Params) => ResultAsync<Return, Error>; | ||
export declare type Transport<T extends TransportType> = { | ||
type: T; | ||
call: T extends 'open-api' ? OpenApiClientCall : OpenRPCClientCall; | ||
}; | ||
export declare type Client = (url: URL) => Transport; | ||
export declare type Client<T extends TransportType> = (url: URL) => Transport<T>; | ||
export {}; | ||
//# sourceMappingURL=_types.d.ts.map |
export * from './_types'; | ||
export * from './open-rpc-client'; | ||
export * from './open-api/api'; | ||
export * from './open-api-client'; | ||
//# sourceMappingURL=index.d.ts.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const tslib_1 = require("tslib"); | ||
tslib_1.__exportStar(require("./_types"), exports); | ||
tslib_1.__exportStar(require("./open-rpc-client"), exports); | ||
(0, tslib_1.__exportStar)(require("./_types"), exports); | ||
(0, tslib_1.__exportStar)(require("./open-rpc-client"), exports); | ||
(0, tslib_1.__exportStar)(require("./open-api/api"), exports); | ||
(0, tslib_1.__exportStar)(require("./open-api-client"), exports); | ||
//# sourceMappingURL=index.js.map |
import { Client } from './_types'; | ||
export declare const RPCClient: Client; | ||
export declare type OpenRPCClientCall = (endpoint: string, params: unknown[] | Record<string, unknown>) => Promise<unknown>; | ||
export declare const RPCClient: Client<'json-rpc'>; | ||
//# sourceMappingURL=open-rpc-client.d.ts.map |
@@ -54,5 +54,5 @@ "use strict"; | ||
}; | ||
const correlationID = uuid_1.v4(); | ||
const correlationID = (0, uuid_1.v4)(); | ||
const RPCClient = (url) => { | ||
const call = (method, params) => tslib_1.__awaiter(void 0, void 0, void 0, function* () { | ||
const call = (method, params) => (0, tslib_1.__awaiter)(void 0, void 0, void 0, function* () { | ||
// @ts-ignore | ||
@@ -68,3 +68,3 @@ const endpoint = `${url.toString()}${MethodEndpoints[method]}`; | ||
const client = new client_js_1.Client(requestManager); | ||
const filteredParams = util_1.isArray(params) | ||
const filteredParams = (0, util_1.isArray)(params) | ||
? params.filter(item => !!item) | ||
@@ -96,2 +96,3 @@ : params; | ||
return { | ||
type: 'json-rpc', | ||
call, | ||
@@ -98,0 +99,0 @@ }; |
{ | ||
"name": "@radixdlt/networking", | ||
"version": "2.1.5", | ||
"version": "2.1.6", | ||
"description": "Requesting and sending data from/to Radix Core RPC API over HTTP(s).", | ||
@@ -34,2 +34,4 @@ "keywords": [ | ||
"@types/uuid": "^8.3.0", | ||
"axios": "^0.24.0", | ||
"isomorphic-fetch": "^3.0.0", | ||
"neverthrow": "^4.0.1", | ||
@@ -39,3 +41,6 @@ "open-rpc-utils": "^1.1.1", | ||
}, | ||
"gitHead": "07c5fad89c30128c1c9a0ff29d527d1d2f375f35" | ||
"devDependencies": { | ||
"@types/isomorphic-fetch": "^0.0.35" | ||
}, | ||
"gitHead": "f8026eb0c310402ba395025e6a544f7c6baffd66" | ||
} |
@@ -1,8 +0,17 @@ | ||
export type Transport = { | ||
call: ( | ||
endpoint: string, | ||
params: unknown[] | Record<string, unknown>, | ||
) => Promise<unknown> | ||
import { ResultAsync } from 'neverthrow' | ||
import { OpenApiClientCall } from './open-api-client' | ||
import { OpenRPCClientCall } from './open-rpc-client' | ||
type TransportType = 'json-rpc' | 'open-api' | ||
export type Call<Methods, Params, Return> = <Methods, Params, Return>( | ||
method: Methods, | ||
param: Params, | ||
) => ResultAsync<Return, Error> | ||
export type Transport<T extends TransportType> = { | ||
type: T | ||
call: T extends 'open-api' ? OpenApiClientCall : OpenRPCClientCall | ||
} | ||
export type Client = (url: URL) => Transport | ||
export type Client<T extends TransportType> = (url: URL) => Transport<T> |
export * from './_types' | ||
export * from './open-rpc-client' | ||
export * from './open-api/api' | ||
export * from './open-api-client' |
@@ -61,3 +61,8 @@ import { | ||
export const RPCClient: Client = (url: URL): Transport => { | ||
export type OpenRPCClientCall = ( | ||
endpoint: string, | ||
params: unknown[] | Record<string, unknown>, | ||
) => Promise<unknown> | ||
export const RPCClient: Client<'json-rpc'> = (url: URL) => { | ||
const call = async ( | ||
@@ -129,4 +134,5 @@ method: string, | ||
return { | ||
type: 'json-rpc', | ||
call, | ||
} | ||
} |
@@ -5,3 +5,4 @@ { | ||
"rootDir": "src", | ||
"outDir": "dist" | ||
"outDir": "dist", | ||
"typeRoots": ["./src/global-fetch.d.ts"] | ||
}, | ||
@@ -8,0 +9,0 @@ "include": [ |
@@ -7,3 +7,4 @@ { | ||
], | ||
"references": [] | ||
"references": [], | ||
"compilerOptions": {"typeRoots": ["./src/global-fetch.d.ts"]} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
870474
416
15985
10
1
2
+ Addedaxios@^0.24.0
+ Addedisomorphic-fetch@^3.0.0
+ Addedaxios@0.24.0(transitive)
+ Addedfollow-redirects@1.15.9(transitive)