Security News
JSR Working Group Kicks Off with Ambitious Roadmap and Plans for Open Governance
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
@gnosis.pm/safe-react-gateway-sdk
Advanced tools
[![npm](https://img.shields.io/npm/v/@gnosis.pm/safe-react-gateway-sdk?label=%40gnosis.pm%2Fsafe-react-gateway-sdk)](https://www.npmjs.com/package/@gnosis.pm/safe-react-gateway-sdk)
A TypeScript SDK for the Safe Client Gateway
NB: Safe Client Gateway isn't meant for public use. Please do not use this SDK if you're building, e.g., a Safe App.
Install:
yarn add @gnosis.pm/safe-react-gateway-sdk
Import:
import { getChainsConfig, type ChainListResponse } from '@gnosis.pm/safe-react-gateway-sdk'
Use:
const chains = await getChainsConfig()
The SDK needs no initialization unless you want to override the base URL, which defaults to https://safe-client.gnosis.io. You can set an alternative base URL like so:
import { setBaseUrl } from '@gnosis.pm/safe-react-gateway-sdk'
// Switch the SDK to dev mode
setBaseUrl('https://safe-client.staging.gnosisdev.com')
The full SDK reference can be found here.
Endpoint types are defined in src/types/gateway.ts
.
Each endpoint consists of:
src/index.ts
(e.g. getBalances
)'/chains/{chainId}/safes/{address}/balances/{currency}/'
)safes_balances_list
)To add a new endpoint, follow the pattern set by the existing endpoints.
This command will run before every commit:
yarn eslint:fix
To run the unit and e2e tests locally:
yarn test
N.B.: the e2e tests make actual API calls on staging.
The TypeScript types in this SDK are based on Rust types from the Gateway API.
FAQs
[![npm](https://img.shields.io/npm/v/@gnosis.pm/safe-react-gateway-sdk?label=%40gnosis.pm%2Fsafe-react-gateway-sdk)](https://www.npmjs.com/package/@gnosis.pm/safe-react-gateway-sdk)
We found that @gnosis.pm/safe-react-gateway-sdk demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 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.
Security News
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
Security News
Research
An advanced npm supply chain attack is leveraging Ethereum smart contracts for decentralized, persistent malware control, evading traditional defenses.
Security News
Research
Attackers are impersonating Sindre Sorhus on npm with a fake 'chalk-node' package containing a malicious backdoor to compromise developers' projects.