3.5.2 ā€¢ Published 1 year ago

@gnosis.pm/safe-react-gateway-sdk v3.5.2

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Safe Gateway TypeScript SDK

npm

A TypeScript SDK for the Safe Client Gateway

šŸ“– API reference

Usage policy

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.

Using the SDK

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. 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.5afe.dev')

The full SDK reference can be found here.

Adding an endpoint

Endpoint types are defined in src/types/gateway.ts.

Each endpoint consists of:

  • a function defined in src/index.ts (e.g. getBalances)
  • a path definition (e.g. '/chains/{chainId}/safes/{address}/balances/{currency}/')
  • operation definition (e.g. safes_balances_list)
  • response definition

To add a new endpoint, follow the pattern set by the existing endpoints.

Eslint & prettier

This command will run before every commit:

yarn eslint:fix

Tests

To run the unit and e2e tests locally:

yarn test

N.B.: the e2e tests make actual API calls on staging.

Gateway API docs

The TypeScript types in this SDK are based on Rust types from the Gateway API.

3.4.4

2 years ago

3.4.3

2 years ago

3.4.6

1 year ago

3.4.5

2 years ago

3.5.2

1 year ago

3.5.1

1 year ago

3.5.0

1 year ago

3.4.2

2 years ago

3.4.0

2 years ago

3.4.1

2 years ago

3.2.1

2 years ago

3.2.0

2 years ago

3.2.4

2 years ago

3.2.3

2 years ago

3.1.3

2 years ago

3.1.2

2 years ago

3.3.5

2 years ago

3.3.4

2 years ago

3.1.4

2 years ago

3.1.1

2 years ago

3.0.1

2 years ago

3.0.0

2 years ago

2.10.2

2 years ago

2.10.3

2 years ago

2.10.1

2 years ago

2.10.0

2 years ago

2.7.0

2 years ago

2.6.0

2 years ago

2.9.0

2 years ago

2.8.1

2 years ago

2.7.2

2 years ago

2.8.0

2 years ago

2.7.1

2 years ago

2.8.3

2 years ago

2.7.4

2 years ago

2.8.2

2 years ago

2.8.5

2 years ago

2.8.4

2 years ago

2.7.5

2 years ago

2.8.6

2 years ago

2.5.8

2 years ago

2.5.7

2 years ago

2.5.6

2 years ago

2.5.5

2 years ago

2.5.4

2 years ago

2.5.3

2 years ago

2.5.2

3 years ago

2.5.1

3 years ago

2.5.0

3 years ago

2.4.0

3 years ago

2.3.1

3 years ago

2.3.0

3 years ago

2.2.2

3 years ago

2.2.1

3 years ago

2.2.0

3 years ago

2.1.0

3 years ago

2.0.1

3 years ago

2.0.0

3 years ago

1.2.0

3 years ago

1.2.1

3 years ago

1.1.0

3 years ago

1.0.0

3 years ago