
Research
/Security News
Toptal’s GitHub Organization Hijacked: 10 Malicious Packages Published
Threat actors hijacked Toptal’s GitHub org, publishing npm packages with malicious payloads that steal tokens and attempt to wipe victim systems.
@openzeppelin/defender-sdk-key-value-store-client
Advanced tools
The [Defender Actions](https://docs.openzeppelin.com/defender/v2/module/actions) service allows you to run small code snippets on a regular basis or via webhooks that can make calls to the Ethereum network or to external APIs. Thanks to tight integration
The Defender Actions service allows you to run small code snippets on a regular basis or via webhooks that can make calls to the Ethereum network or to external APIs. Thanks to tight integration to Defender Relayers, you can use Actions to automate regular operations on your contracts.
This client allows you to access a simple key-value data store from your Actions code, so you can persist data throughout executions and across different Actions.
Note that this package will not work outisde the Actions environment.
This package is included in the latest Actions runtime environment, so you do not need to bundle it in your code. To install it for local development and typescript type completion, run:
npm install @openzeppelin/defender-sdk-key-value-store
yarn add @openzeppelin/defender-sdk-key-value-store
You can interact with your key-value store through an instance of Defender
, which is initialized with the payload injected in the your Action handler
function. Once initialized, you can call kvstore.get
, kvstore.put
, or kvstore.del
.
const { Defender } = require('@openzeppelin/defender-sdk');
exports.handler = async function (event) {
// Creates an instance of the key-value store client
const client = new Defender(event);
// Associates myValue to myKey
await client.keyValueStore.put('myKey', 'myValue');
// Returns myValue associated to myKey
const value = await client.keyValueStore.get('myKey');
// Deletes the entry for myKey
await client.keyValueStore.del('myKey');
};
The Defender key-value store is only accessible from within an Action. To simplify local development, you can create an instance using Defender.localKVStoreClient
providing an object with a path
property. The client will use a local json file at that path for all operations.
const { Defender } = require('@openzeppelin/defender-sdk');
async function local() {
// Creates an instance of the client that will write to a local file
const store = Defender.localKVStoreClient({ path: '/tmp/foo/store.json' });
// The store.json file will contain { myKey: myValue }
await store.put('myKey', 'myValue');
}
put
into the store.FAQs
The [Defender Actions](https://docs.openzeppelin.com/defender/v2/module/actions) service allows you to run small code snippets on a regular basis or via webhooks that can make calls to the Ethereum network or to external APIs. Thanks to tight integration
We found that @openzeppelin/defender-sdk-key-value-store-client demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 8 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
/Security News
Threat actors hijacked Toptal’s GitHub org, publishing npm packages with malicious payloads that steal tokens and attempt to wipe victim systems.
Research
/Security News
Socket researchers investigate 4 malicious npm and PyPI packages with 56,000+ downloads that install surveillance malware.
Security News
The ongoing npm phishing campaign escalates as attackers hijack the popular 'is' package, embedding malware in multiple versions.