Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@onflow/transport-http

Package Overview
Dependencies
Maintainers
13
Versions
61
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@onflow/transport-http - npm Package Compare versions

Comparing version 1.10.0-event-streaming.1 to 1.10.0

types/send-get-node-version-info.d.ts

75

CHANGELOG.md
# @onflow/transport-http
## 1.10.0-event-streaming.1
## 1.10.0
### Minor Changes
- [#1802](https://github.com/onflow/fcl-js/pull/1802) [`699303cf`](https://github.com/onflow/fcl-js/commit/699303cfd5e0545267632c9236f8c91833ce1259) Thanks [@nialexsan](https://github.com/nialexsan)! - Typescript improvements
- [#1794](https://github.com/onflow/fcl-js/pull/1794) [`acf90a78`](https://github.com/onflow/fcl-js/commit/acf90a7841f843227d5d9edb450ef08322c77c4d) Thanks [@jribbink](https://github.com/jribbink)! - Add support for event streaming API interaction
- [#1855](https://github.com/onflow/fcl-js/pull/1855) [`80db8166`](https://github.com/onflow/fcl-js/commit/80db816620d7643c35a0fca7149c15de92f7bc88) Thanks [@jribbink](https://github.com/jribbink)! - Add GetNodeVersionInfo SDK Interaction
### Patch Changes
- Add subscribeEvents export to FCL & fix build
- [#1830](https://github.com/onflow/fcl-js/pull/1830) [`72e8f796`](https://github.com/onflow/fcl-js/commit/72e8f796caf8f62a829cba3641e395c20466547a) Thanks [@jribbink](https://github.com/jribbink)! - Use URL to join httpRequest hostname to path instead of string manipulation (allows for trailing slashes/less error prone)
- Updated dependencies []:
- @onflow/util-invariant@1.2.2-event-streaming.1
- @onflow/util-template@1.2.2-event-streaming.1
- @onflow/util-address@1.2.2-event-streaming.1
- @onflow/util-logger@1.3.2-event-streaming.1
- [#1821](https://github.com/onflow/fcl-js/pull/1821) [`b9c078ce`](https://github.com/onflow/fcl-js/commit/b9c078ce87869c2b41dff07b861cea09a294c6a1) Thanks [@nialexsan](https://github.com/nialexsan)! - Split packages into `@onflow/fcl`, `@onflow/fcl-core`, and `@onflow/fcl-react-native`.
## 1.10.0-event-streaming.0
- [#1827](https://github.com/onflow/fcl-js/pull/1827) [`e74c4a60`](https://github.com/onflow/fcl-js/commit/e74c4a60f38f366874aa1391ca1c890a7ad3a42a) Thanks [@nialexsan](https://github.com/nialexsan)! - Pin internal dependencies to exact versions
- [#1832](https://github.com/onflow/fcl-js/pull/1832) [`037dc2f9`](https://github.com/onflow/fcl-js/commit/037dc2f9db9c22185e3c048c65e23e0efa70085f) Thanks [@jribbink](https://github.com/jribbink)! - Update access modifiers to support Cadence 1.0
- [#1814](https://github.com/onflow/fcl-js/pull/1814) [`0d09d838`](https://github.com/onflow/fcl-js/commit/0d09d8386c2fc472833df7152467d477f36dddc4) Thanks [@jribbink](https://github.com/jribbink)! - Fix type declarations not fully being generated
- Updated dependencies [[`7ed491c5`](https://github.com/onflow/fcl-js/commit/7ed491c5d2335fbbff04444d41f1f1580763d8d3), [`b9c078ce`](https://github.com/onflow/fcl-js/commit/b9c078ce87869c2b41dff07b861cea09a294c6a1), [`e74c4a60`](https://github.com/onflow/fcl-js/commit/e74c4a60f38f366874aa1391ca1c890a7ad3a42a), [`0d09d838`](https://github.com/onflow/fcl-js/commit/0d09d8386c2fc472833df7152467d477f36dddc4)]:
- @onflow/util-address@1.2.2
- @onflow/util-invariant@1.2.2
- @onflow/util-template@1.2.2
- @onflow/util-logger@1.3.2
## 1.10.0-alpha.5
### Patch Changes
- Updated dependencies [[`7ed491c5`](https://github.com/onflow/fcl-js/commit/7ed491c5d2335fbbff04444d41f1f1580763d8d3)]:
- @onflow/util-address@1.2.2-alpha.3
## 1.10.0-alpha.4
### Minor Changes
- [#1855](https://github.com/onflow/fcl-js/pull/1855) [`80db8166`](https://github.com/onflow/fcl-js/commit/80db816620d7643c35a0fca7149c15de92f7bc88) Thanks [@jribbink](https://github.com/jribbink)! - Add GetNodeVersionInfo SDK Interaction
## 1.10.0-alpha.3
### Patch Changes
- [#1830](https://github.com/onflow/fcl-js/pull/1830) [`72e8f796`](https://github.com/onflow/fcl-js/commit/72e8f796caf8f62a829cba3641e395c20466547a) Thanks [@jribbink](https://github.com/jribbink)! - Use URL to join httpRequest hostname to path instead of string manipulation (allows for trailing slashes/less error prone)
- [#1832](https://github.com/onflow/fcl-js/pull/1832) [`037dc2f9`](https://github.com/onflow/fcl-js/commit/037dc2f9db9c22185e3c048c65e23e0efa70085f) Thanks [@jribbink](https://github.com/jribbink)! - Update access modifiers to support Cadence 1.0
## 1.10.0-alpha.2
### Patch Changes
- [#1827](https://github.com/onflow/fcl-js/pull/1827) [`e74c4a60`](https://github.com/onflow/fcl-js/commit/e74c4a60f38f366874aa1391ca1c890a7ad3a42a) Thanks [@nialexsan](https://github.com/nialexsan)! - pin versions
- Updated dependencies [[`e74c4a60`](https://github.com/onflow/fcl-js/commit/e74c4a60f38f366874aa1391ca1c890a7ad3a42a)]:
- @onflow/util-invariant@1.2.2-alpha.2
- @onflow/util-template@1.2.2-alpha.2
- @onflow/util-address@1.2.2-alpha.2
- @onflow/util-logger@1.3.2-alpha.2
## 1.10.0-alpha.1
### Minor Changes
- [#1802](https://github.com/onflow/fcl-js/pull/1802) [`699303cf`](https://github.com/onflow/fcl-js/commit/699303cfd5e0545267632c9236f8c91833ce1259) Thanks [@nialexsan](https://github.com/nialexsan)! - TS conversion
- [#1794](https://github.com/onflow/fcl-js/pull/1794) [`59debea5`](https://github.com/onflow/fcl-js/commit/59debea55209adab984d2c0a139aeedf8f09186b) Thanks [@jribbink](https://github.com/jribbink)! - Add support for event streaming API interaction (subscribeEvents)
- [#1794](https://github.com/onflow/fcl-js/pull/1794) [`acf90a78`](https://github.com/onflow/fcl-js/commit/acf90a7841f843227d5d9edb450ef08322c77c4d) Thanks [@jribbink](https://github.com/jribbink)! - Add support for event streaming API interaction (subscribeEvents)

@@ -28,6 +77,6 @@ ### Patch Changes

- Updated dependencies [[`0d09d838`](https://github.com/onflow/fcl-js/commit/0d09d8386c2fc472833df7152467d477f36dddc4)]:
- @onflow/util-invariant@1.2.2-event-streaming.0
- @onflow/util-template@1.2.2-event-streaming.0
- @onflow/util-address@1.2.2-event-streaming.0
- @onflow/util-logger@1.3.2-event-streaming.0
- @onflow/util-invariant@1.2.2-alpha.1
- @onflow/util-template@1.2.2-alpha.1
- @onflow/util-address@1.2.2-alpha.1
- @onflow/util-logger@1.3.2-alpha.1

@@ -34,0 +83,0 @@ ## 1.9.0

@@ -110,3 +110,3 @@ 'use strict';

}, timeoutLimit);
return fetchTransport__default["default"](`${hostname}${path}`, {
return fetchTransport__default["default"](new URL(path, hostname).toString(), {
method: method,

@@ -743,2 +743,27 @@ body: bodyJSON,

async function sendGetNodeVersionInfo(ix) {
let context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
let opts = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
utilInvariant.invariant(opts.node, `SDK Send Get Node Version Info Error: opts.node must be defined.`);
utilInvariant.invariant(context.response, `SDK Send Get Node Verison Info Error: context.response must be defined.`);
const httpRequest$1 = opts.httpRequest || httpRequest;
ix = await ix;
const res = await httpRequest$1({
hostname: opts.node,
path: `/v1/node_version_info`,
method: "GET"
});
let ret = context.response();
ret.tag = ix.tag;
ret.nodeVersionInfo = {
semver: res.semver,
commit: res.commit,
sporkId: res.spork_id,
protocolVersion: parseInt(res.protocol_version),
sporkRootBlockHeight: parseInt(res.spork_root_block_height),
nodeRootBlockHeight: parseInt(res.node_root_block_height)
};
return ret;
}
const WebSocket = _WebSocket__default["default"];

@@ -937,3 +962,3 @@

connection.on("data", data => {
const responseData = constructData(ix, context, data);
const responseData = constructData(resolvedIx, context, data);
lastBlockHeight = responseData.heartbeat.blockHeight;

@@ -961,3 +986,3 @@ outputEmitter.emit("data", responseData);

};
return constructResponse(ix, context, responseStream);
return constructResponse(resolvedIx, context, responseStream);
}

@@ -985,3 +1010,3 @@

return opts.sendGetEvents ? opts.sendGetEvents(ix, context, opts) : sendGetEvents(ix, context, opts);
case context.ix.isSubscribeEvents(ix):
case context.ix.isSubscribeEvents?.(ix):
return opts.connectSubscribeEvents ? opts.connectSubscribeEvents(ix, context, opts) : connectSubscribeEvents(ix, context, opts);

@@ -998,2 +1023,4 @@ case context.ix.isGetBlock(ix):

return opts.sendGetNetworkParameters ? opts.sendGetNetworkParameters(ix, context, opts) : sendGetNetworkParameters(ix, context, opts);
case context.ix.isGetNodeVersionInfo?.(ix):
return opts.sendGetNodeVersionInfo ? opts.sendGetNodeVersionInfo(ix, context, opts) : sendGetNodeVersionInfo(ix, context, opts);
default:

@@ -1015,2 +1042,3 @@ return ix;

exports.sendGetNetworkParameters = sendGetNetworkParameters;
exports.sendGetNodeVersionInfo = sendGetNodeVersionInfo;
exports.sendGetTransaction = sendGetTransaction;

@@ -1017,0 +1045,0 @@ exports.sendGetTransactionStatus = sendGetTransactionStatus;

@@ -82,3 +82,3 @@ import { invariant } from '@onflow/util-invariant';

}, timeoutLimit);
return fetchTransport(`${hostname}${path}`, {
return fetchTransport(new URL(path, hostname).toString(), {
method: method,

@@ -715,2 +715,27 @@ body: bodyJSON,

async function sendGetNodeVersionInfo(ix) {
let context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
let opts = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
invariant(opts.node, `SDK Send Get Node Version Info Error: opts.node must be defined.`);
invariant(context.response, `SDK Send Get Node Verison Info Error: context.response must be defined.`);
const httpRequest$1 = opts.httpRequest || httpRequest;
ix = await ix;
const res = await httpRequest$1({
hostname: opts.node,
path: `/v1/node_version_info`,
method: "GET"
});
let ret = context.response();
ret.tag = ix.tag;
ret.nodeVersionInfo = {
semver: res.semver,
commit: res.commit,
sporkId: res.spork_id,
protocolVersion: parseInt(res.protocol_version),
sporkRootBlockHeight: parseInt(res.spork_root_block_height),
nodeRootBlockHeight: parseInt(res.node_root_block_height)
};
return ret;
}
const WebSocket = _WebSocket;

@@ -909,3 +934,3 @@

connection.on("data", data => {
const responseData = constructData(ix, context, data);
const responseData = constructData(resolvedIx, context, data);
lastBlockHeight = responseData.heartbeat.blockHeight;

@@ -933,3 +958,3 @@ outputEmitter.emit("data", responseData);

};
return constructResponse(ix, context, responseStream);
return constructResponse(resolvedIx, context, responseStream);
}

@@ -957,3 +982,3 @@

return opts.sendGetEvents ? opts.sendGetEvents(ix, context, opts) : sendGetEvents(ix, context, opts);
case context.ix.isSubscribeEvents(ix):
case context.ix.isSubscribeEvents?.(ix):
return opts.connectSubscribeEvents ? opts.connectSubscribeEvents(ix, context, opts) : connectSubscribeEvents(ix, context, opts);

@@ -970,2 +995,4 @@ case context.ix.isGetBlock(ix):

return opts.sendGetNetworkParameters ? opts.sendGetNetworkParameters(ix, context, opts) : sendGetNetworkParameters(ix, context, opts);
case context.ix.isGetNodeVersionInfo?.(ix):
return opts.sendGetNodeVersionInfo ? opts.sendGetNodeVersionInfo(ix, context, opts) : sendGetNodeVersionInfo(ix, context, opts);
default:

@@ -976,3 +1003,3 @@ return ix;

export { HTTPRequestError, WebsocketError, connectSubscribeEvents, send, sendExecuteScript, sendGetAccount, sendGetBlock, sendGetBlockHeader, sendGetCollection, sendGetEvents, sendGetNetworkParameters, sendGetTransaction, sendGetTransactionStatus, sendPing, sendTransaction };
export { HTTPRequestError, WebsocketError, connectSubscribeEvents, send, sendExecuteScript, sendGetAccount, sendGetBlock, sendGetBlockHeader, sendGetCollection, sendGetEvents, sendGetNetworkParameters, sendGetNodeVersionInfo, sendGetTransaction, sendGetTransactionStatus, sendPing, sendTransaction };
//# sourceMappingURL=sdk-send-http.module.js.map

@@ -104,3 +104,3 @@ (function (global, factory) {

}, timeoutLimit);
return fetchTransport__default["default"](`${hostname}${path}`, {
return fetchTransport__default["default"](new URL(path, hostname).toString(), {
method: method,

@@ -737,2 +737,27 @@ body: bodyJSON,

async function sendGetNodeVersionInfo(ix) {
let context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
let opts = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
utilInvariant.invariant(opts.node, `SDK Send Get Node Version Info Error: opts.node must be defined.`);
utilInvariant.invariant(context.response, `SDK Send Get Node Verison Info Error: context.response must be defined.`);
const httpRequest$1 = opts.httpRequest || httpRequest;
ix = await ix;
const res = await httpRequest$1({
hostname: opts.node,
path: `/v1/node_version_info`,
method: "GET"
});
let ret = context.response();
ret.tag = ix.tag;
ret.nodeVersionInfo = {
semver: res.semver,
commit: res.commit,
sporkId: res.spork_id,
protocolVersion: parseInt(res.protocol_version),
sporkRootBlockHeight: parseInt(res.spork_root_block_height),
nodeRootBlockHeight: parseInt(res.node_root_block_height)
};
return ret;
}
const WebSocket = _WebSocket__default["default"];

@@ -931,3 +956,3 @@

connection.on("data", data => {
const responseData = constructData(ix, context, data);
const responseData = constructData(resolvedIx, context, data);
lastBlockHeight = responseData.heartbeat.blockHeight;

@@ -955,3 +980,3 @@ outputEmitter.emit("data", responseData);

};
return constructResponse(ix, context, responseStream);
return constructResponse(resolvedIx, context, responseStream);
}

@@ -979,3 +1004,3 @@

return opts.sendGetEvents ? opts.sendGetEvents(ix, context, opts) : sendGetEvents(ix, context, opts);
case context.ix.isSubscribeEvents(ix):
case context.ix.isSubscribeEvents?.(ix):
return opts.connectSubscribeEvents ? opts.connectSubscribeEvents(ix, context, opts) : connectSubscribeEvents(ix, context, opts);

@@ -992,2 +1017,4 @@ case context.ix.isGetBlock(ix):

return opts.sendGetNetworkParameters ? opts.sendGetNetworkParameters(ix, context, opts) : sendGetNetworkParameters(ix, context, opts);
case context.ix.isGetNodeVersionInfo?.(ix):
return opts.sendGetNodeVersionInfo ? opts.sendGetNodeVersionInfo(ix, context, opts) : sendGetNodeVersionInfo(ix, context, opts);
default:

@@ -1009,2 +1036,3 @@ return ix;

exports.sendGetNetworkParameters = sendGetNetworkParameters;
exports.sendGetNodeVersionInfo = sendGetNodeVersionInfo;
exports.sendGetTransaction = sendGetTransaction;

@@ -1011,0 +1039,0 @@ exports.sendGetTransactionStatus = sendGetTransactionStatus;

18

package.json
{
"name": "@onflow/transport-http",
"version": "1.10.0-event-streaming.1",
"version": "1.10.0",
"description": "Flow SDK HTTP Transport Module",

@@ -16,6 +16,6 @@ "license": "Apache-2.0",

"devDependencies": {
"@onflow/fcl-bundle": "^1.4.2-event-streaming.1",
"@onflow/rlp": "^1.2.2-event-streaming.1",
"@onflow/sdk": "^1.4.0-event-streaming.1",
"@onflow/types": "^1.3.0-event-streaming.1",
"@onflow/fcl-bundle": "1.4.2",
"@onflow/rlp": "1.2.2",
"@onflow/sdk": "1.4.0",
"@onflow/types": "1.3.0",
"jest": "^29.5.0"

@@ -38,6 +38,6 @@ },

"@babel/runtime": "^7.18.6",
"@onflow/util-address": "^1.2.2-event-streaming.1",
"@onflow/util-invariant": "^1.2.2-event-streaming.1",
"@onflow/util-logger": "^1.3.2-event-streaming.1",
"@onflow/util-template": "^1.2.2-event-streaming.1",
"@onflow/util-address": "1.2.2",
"@onflow/util-invariant": "1.2.2",
"@onflow/util-logger": "1.3.2",
"@onflow/util-template": "1.2.2",
"abort-controller": "^3.0.0",

@@ -44,0 +44,0 @@ "cross-fetch": "^3.1.6",

@@ -12,2 +12,3 @@ export { sendExecuteScript } from "./send-execute-script";

export { sendGetNetworkParameters } from "./send-get-network-parameters";
export { sendGetNodeVersionInfo } from "./send-get-node-version-info";
export { connectSubscribeEvents } from "./connect-subscribe-events";

@@ -14,0 +15,0 @@ export { send } from "./send-http";

@@ -15,3 +15,4 @@ import { ISendPingContext } from "./send-ping";

isGetNetworkParameters: (ix: Interaction) => boolean;
isSubscribeEvents: (ix: Interaction) => boolean;
isSubscribeEvents?: (ix: Interaction) => boolean;
isGetNodeVersionInfo?: (ix: Interaction) => boolean;
}

@@ -37,4 +38,5 @@ interface IContext extends ISendPingContext {

connectSubscribeEvents?: (ix: Interaction, context: IContext, opts: IOptsCommon) => void;
sendGetNodeVersionInfo?: (ix: Interaction, context: IContext, opts: IOptsCommon) => void;
}
export declare const send: (ix: Interaction, context: IContext, opts?: IOpts) => Promise<any>;
export {};

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc