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

@onflow/config

Package Overview
Dependencies
Maintainers
13
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@onflow/config - npm Package Compare versions

Comparing version 1.2.2-event-streaming.1 to 1.3.0-alpha.3

26

CHANGELOG.md
# @onflow/config
## 1.2.2-event-streaming.1
## 1.3.0-alpha.3
### Minor Changes
- [#1848](https://github.com/onflow/fcl-js/pull/1848) [`fdd52c45`](https://github.com/onflow/fcl-js/commit/fdd52c45b3a64210c5f716e13aa4d08d3796370c) Thanks [@jribbink](https://github.com/jribbink)! - Add support for new dependencies field in flow.json
## 1.2.2-alpha.2
### Patch Changes
- Add subscribeEvents export to FCL & fix build
- [#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 []:
- @onflow/util-invariant@1.2.2-event-streaming.1
- @onflow/util-logger@1.3.2-event-streaming.1
- @onflow/util-actor@1.3.2-event-streaming.1
- Updated dependencies [[`e74c4a60`](https://github.com/onflow/fcl-js/commit/e74c4a60f38f366874aa1391ca1c890a7ad3a42a)]:
- @onflow/util-invariant@1.2.2-alpha.2
- @onflow/util-logger@1.3.2-alpha.2
- @onflow/util-actor@1.3.2-alpha.2
## 1.2.2-event-streaming.0
## 1.2.2-alpha.1

@@ -21,5 +27,5 @@ ### Patch Changes

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

@@ -26,0 +32,0 @@ ## 1.2.1

@@ -110,2 +110,9 @@ 'use strict';

/**
* @description Filter out dependencies section of flow.json.
* @param obj - Flow JSON
* @returns Dependencies section of Flow JSON
*/
const filterDependencies = obj => obj.dependencies ? obj.dependencies : {};
/**
* @description Gathers contract addresses by network

@@ -125,11 +132,27 @@ * @param network - Network to gather addresses for

};
const mapDeploymentsToNetworkAddress = network => _ref2 => {
/**
* @description Gathers dependency addresses by network
* @param network - Network to gather addresses for
* @returns Dependency names by addresses mapping e.g { "HelloWorld": "0x123" }
*/
const mapDependencyAliasesToNetworkAddress = network => dependencies => {
return Object.entries(dependencies).reduce((c, _ref2) => {
let [key, value] = _ref2;
const networkDependencyAlias = value?.aliases?.[network];
if (networkDependencyAlias) {
c[key] = networkDependencyAlias;
}
return c;
}, {});
};
const mapDeploymentsToNetworkAddress = network => _ref3 => {
let {
deployments = {},
accounts = {}
} = _ref2;
} = _ref3;
const networkDeployment = deployments?.[network];
if (!networkDeployment) return {};
return Object.entries(networkDeployment).reduce((c, _ref3) => {
let [key, value] = _ref3;
return Object.entries(networkDeployment).reduce((c, _ref4) => {
let [key, value] = _ref4;
// Resolve account address

@@ -156,3 +179,3 @@ const accountAddress = accounts[key]?.address;

const getContracts = (jsons, network) => {
return pipe(mergeFlowJSONs, mergePipe(mapDeploymentsToNetworkAddress(network), pipe(filterContracts, mapContractAliasesToNetworkAddress(network))))(jsons);
return pipe(mergeFlowJSONs, mergePipe(mapDeploymentsToNetworkAddress(network), pipe(filterContracts, mapContractAliasesToNetworkAddress(network)), pipe(filterDependencies, mapDependencyAliasesToNetworkAddress(network))))(jsons);
};

@@ -177,4 +200,4 @@

const hasPrivateKeys = flowJSON => {
return Object.entries(flowJSON?.accounts ?? []).reduce((hasPrivateKey, _ref4) => {
let [, value] = _ref4;
return Object.entries(flowJSON?.accounts ?? []).reduce((hasPrivateKey, _ref5) => {
let [, value] = _ref5;
if (hasPrivateKey) return true;

@@ -181,0 +204,0 @@ return value && Object.prototype.hasOwnProperty.call(value, "key") && isHexidecimal(value?.key);

@@ -86,2 +86,9 @@ import { spawn, SUBSCRIBE, UNSUBSCRIBE, send, subscriber } from '@onflow/util-actor';

/**
* @description Filter out dependencies section of flow.json.
* @param obj - Flow JSON
* @returns Dependencies section of Flow JSON
*/
const filterDependencies = obj => obj.dependencies ? obj.dependencies : {};
/**
* @description Gathers contract addresses by network

@@ -101,11 +108,27 @@ * @param network - Network to gather addresses for

};
const mapDeploymentsToNetworkAddress = network => _ref2 => {
/**
* @description Gathers dependency addresses by network
* @param network - Network to gather addresses for
* @returns Dependency names by addresses mapping e.g { "HelloWorld": "0x123" }
*/
const mapDependencyAliasesToNetworkAddress = network => dependencies => {
return Object.entries(dependencies).reduce((c, _ref2) => {
let [key, value] = _ref2;
const networkDependencyAlias = value?.aliases?.[network];
if (networkDependencyAlias) {
c[key] = networkDependencyAlias;
}
return c;
}, {});
};
const mapDeploymentsToNetworkAddress = network => _ref3 => {
let {
deployments = {},
accounts = {}
} = _ref2;
} = _ref3;
const networkDeployment = deployments?.[network];
if (!networkDeployment) return {};
return Object.entries(networkDeployment).reduce((c, _ref3) => {
let [key, value] = _ref3;
return Object.entries(networkDeployment).reduce((c, _ref4) => {
let [key, value] = _ref4;
// Resolve account address

@@ -132,3 +155,3 @@ const accountAddress = accounts[key]?.address;

const getContracts = (jsons, network) => {
return pipe(mergeFlowJSONs, mergePipe(mapDeploymentsToNetworkAddress(network), pipe(filterContracts, mapContractAliasesToNetworkAddress(network))))(jsons);
return pipe(mergeFlowJSONs, mergePipe(mapDeploymentsToNetworkAddress(network), pipe(filterContracts, mapContractAliasesToNetworkAddress(network)), pipe(filterDependencies, mapDependencyAliasesToNetworkAddress(network))))(jsons);
};

@@ -153,4 +176,4 @@

const hasPrivateKeys = flowJSON => {
return Object.entries(flowJSON?.accounts ?? []).reduce((hasPrivateKey, _ref4) => {
let [, value] = _ref4;
return Object.entries(flowJSON?.accounts ?? []).reduce((hasPrivateKey, _ref5) => {
let [, value] = _ref5;
if (hasPrivateKey) return true;

@@ -157,0 +180,0 @@ return value && Object.prototype.hasOwnProperty.call(value, "key") && isHexidecimal(value?.key);

@@ -108,2 +108,9 @@ (function (global, factory) {

/**
* @description Filter out dependencies section of flow.json.
* @param obj - Flow JSON
* @returns Dependencies section of Flow JSON
*/
const filterDependencies = obj => obj.dependencies ? obj.dependencies : {};
/**
* @description Gathers contract addresses by network

@@ -123,11 +130,27 @@ * @param network - Network to gather addresses for

};
const mapDeploymentsToNetworkAddress = network => _ref2 => {
/**
* @description Gathers dependency addresses by network
* @param network - Network to gather addresses for
* @returns Dependency names by addresses mapping e.g { "HelloWorld": "0x123" }
*/
const mapDependencyAliasesToNetworkAddress = network => dependencies => {
return Object.entries(dependencies).reduce((c, _ref2) => {
let [key, value] = _ref2;
const networkDependencyAlias = value?.aliases?.[network];
if (networkDependencyAlias) {
c[key] = networkDependencyAlias;
}
return c;
}, {});
};
const mapDeploymentsToNetworkAddress = network => _ref3 => {
let {
deployments = {},
accounts = {}
} = _ref2;
} = _ref3;
const networkDeployment = deployments?.[network];
if (!networkDeployment) return {};
return Object.entries(networkDeployment).reduce((c, _ref3) => {
let [key, value] = _ref3;
return Object.entries(networkDeployment).reduce((c, _ref4) => {
let [key, value] = _ref4;
// Resolve account address

@@ -154,3 +177,3 @@ const accountAddress = accounts[key]?.address;

const getContracts = (jsons, network) => {
return pipe(mergeFlowJSONs, mergePipe(mapDeploymentsToNetworkAddress(network), pipe(filterContracts, mapContractAliasesToNetworkAddress(network))))(jsons);
return pipe(mergeFlowJSONs, mergePipe(mapDeploymentsToNetworkAddress(network), pipe(filterContracts, mapContractAliasesToNetworkAddress(network)), pipe(filterDependencies, mapDependencyAliasesToNetworkAddress(network))))(jsons);
};

@@ -175,4 +198,4 @@

const hasPrivateKeys = flowJSON => {
return Object.entries(flowJSON?.accounts ?? []).reduce((hasPrivateKey, _ref4) => {
let [, value] = _ref4;
return Object.entries(flowJSON?.accounts ?? []).reduce((hasPrivateKey, _ref5) => {
let [, value] = _ref5;
if (hasPrivateKey) return true;

@@ -179,0 +202,0 @@ return value && Object.prototype.hasOwnProperty.call(value, "key") && isHexidecimal(value?.key);

{
"name": "@onflow/config",
"version": "1.2.2-event-streaming.1",
"version": "1.3.0-alpha.3",
"description": "Config for FCL-JS",

@@ -17,3 +17,3 @@ "license": "Apache-2.0",

"@babel/preset-typescript": "^7.22.11",
"@onflow/fcl-bundle": "^1.4.2-event-streaming.1",
"@onflow/fcl-bundle": "1.4.2-alpha.2",
"@types/estree": "^1.0.1",

@@ -24,3 +24,3 @@ "@types/jest": "^29.5.4",

"eslint": "^8.48.0",
"eslint-plugin-jsdoc": "^46.5.1",
"eslint-plugin-jsdoc": "^46.9.0",
"jest": "^29.5.0",

@@ -44,8 +44,8 @@ "typescript": "^4.9.5"

"@babel/runtime": "^7.18.6",
"@onflow/util-actor": "^1.3.2-event-streaming.1",
"@onflow/util-invariant": "^1.2.2-event-streaming.1",
"@onflow/util-logger": "^1.3.2-event-streaming.1",
"@onflow/util-actor": "1.3.2-alpha.2",
"@onflow/util-invariant": "1.2.2-alpha.2",
"@onflow/util-logger": "1.3.2-alpha.2",
"eslint": "^8.34.0",
"eslint-plugin-jsdoc": "^40.0.0"
"eslint-plugin-jsdoc": "^46.9.0"
}
}

@@ -20,2 +20,11 @@ type FlowNetwork = "emulator" | "testnet" | "mainnet";

};
dependencies?: {
[key: string]: {
source: string;
hash: string;
aliases: {
[key in FlowNetwork]?: string;
};
};
};
deployments?: {

@@ -22,0 +31,0 @@ [key in FlowNetwork]?: {

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