3.21.1 • Published 16 days ago

@safe-global/safe-gateway-typescript-sdk v3.21.1

Weekly downloads
-
License
MIT
Repository
github
Last release
16 days ago

Safe Gateway TypeScript SDK

npm

A TypeScript SDK for the Safe Client Gateway

📖 Type reference   |    CGW Swagger

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 @safe-global/safe-gateway-typescript-sdk

Import:

import { getChainsConfig, type ChainListResponse } from '@safe-global/safe-gateway-typescript-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 '@safe-global/safe-gateway-typescript-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.

3.21.1

16 days ago

3.21.0

17 days ago

3.21.0-alpha.3

17 days ago

3.21.0-alpha.2

17 days ago

3.21.0-alpha.1

20 days ago

3.21.0-alpha.0

20 days ago

3.20.0

23 days ago

3.20.0-alpha.1

1 month ago

3.20.0-alpha.0

1 month ago

3.19.0

2 months ago

3.18.0-alpha.2

2 months ago

3.18.0-alpha.1

2 months ago

3.18.0-alpha.0

2 months ago

3.18.0

2 months ago

3.17.0-alpha.4

3 months ago

3.17.0-alpha.3

3 months ago

3.17.0-alpha.2

3 months ago

3.17.0

3 months ago

3.17.0-alpha.1

3 months ago

3.15.0

3 months ago

3.14.1-alpha.2

3 months ago

3.14.1-alpha.0

3 months ago

3.14.0-alpha.2

4 months ago

3.14.0-alpha.3

4 months ago

3.14.0

4 months ago

3.14.0-alpha.1

4 months ago

3.14.0-alpha

4 months ago

3.13.3

5 months ago

3.11.0

8 months ago

3.8.0

10 months ago

3.10.0

9 months ago

3.13.0

7 months ago

3.12.0

8 months ago

3.13.2

6 months ago

3.9.0

9 months ago

3.8.1

9 months ago

3.7.3

1 year ago

3.7.2

1 year ago

3.7.0

1 year ago

3.6.0

1 year ago

3.5.6

1 year ago

3.5.5

1 year ago

3.5.4

1 year ago

3.5.3

1 year ago