@onflow/transport-http
Advanced tools
Comparing version 1.10.0-alpha.3 to 1.10.0-alpha.4
# @onflow/transport-http | ||
## 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 | ||
@@ -4,0 +10,0 @@ |
@@ -742,2 +742,27 @@ 'use strict'; | ||
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"]; | ||
@@ -982,3 +1007,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); | ||
@@ -995,2 +1020,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: | ||
@@ -1012,2 +1039,3 @@ return ix; | ||
exports.sendGetNetworkParameters = sendGetNetworkParameters; | ||
exports.sendGetNodeVersionInfo = sendGetNodeVersionInfo; | ||
exports.sendGetTransaction = sendGetTransaction; | ||
@@ -1014,0 +1042,0 @@ exports.sendGetTransactionStatus = sendGetTransactionStatus; |
@@ -714,2 +714,27 @@ import { invariant } from '@onflow/util-invariant'; | ||
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; | ||
@@ -954,3 +979,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); | ||
@@ -967,2 +992,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: | ||
@@ -973,3 +1000,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 |
@@ -736,2 +736,27 @@ (function (global, factory) { | ||
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"]; | ||
@@ -976,3 +1001,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); | ||
@@ -989,2 +1014,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: | ||
@@ -1006,2 +1033,3 @@ return ix; | ||
exports.sendGetNetworkParameters = sendGetNetworkParameters; | ||
exports.sendGetNodeVersionInfo = sendGetNodeVersionInfo; | ||
exports.sendGetTransaction = sendGetTransaction; | ||
@@ -1008,0 +1036,0 @@ exports.sendGetTransactionStatus = sendGetTransactionStatus; |
{ | ||
"name": "@onflow/transport-http", | ||
"version": "1.10.0-alpha.3", | ||
"version": "1.10.0-alpha.4", | ||
"description": "Flow SDK HTTP Transport Module", | ||
@@ -16,6 +16,6 @@ "license": "Apache-2.0", | ||
"devDependencies": { | ||
"@onflow/fcl-bundle": "1.4.2-alpha.1", | ||
"@onflow/fcl-bundle": "1.4.2-alpha.2", | ||
"@onflow/rlp": "1.2.2-alpha.2", | ||
"@onflow/sdk": "1.4.0-alpha.4", | ||
"@onflow/types": "1.3.0-alpha.2", | ||
"@onflow/sdk": "1.4.0-alpha.8", | ||
"@onflow/types": "1.3.0-alpha.3", | ||
"jest": "^29.5.0" | ||
@@ -22,0 +22,0 @@ }, |
@@ -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
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
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
431429
31
3136