パッケージの詳細

@safe-global/safe-apps-provider

safe-global1.2mMIT0.18.6

A provider wrapper of Safe Apps SDK

readme

Safe Apps Provider

npm

This is a provider that follows common standards (e.g. EIP-1193) and can be used with various Web3 libraries (e.g. web3.js or Ethers)

How to use

  • Add npm package
yarn add @safe-global/safe-apps-provider

npm i @safe-global/safe-apps-provider

SafeAppProvider

The provider can be used with the safe-apps-react-sdk and common web3 libraries.

With Ethers.js

import React, { useMemo } from 'react';
import { ethers } from 'ethers';
import { useSafeAppsSDK } from '@safe-global/safe-apps-react-sdk';
import { SafeAppProvider } from '@safe-global/safe-apps-provider';

const App = () => {
  const { sdk, safe } = useSafeAppsSDK();
  const web3Provider = useMemo(() => new ethers.providers.Web3Provider(new SafeAppProvider(safe, sdk)), [sdk, safe]);

  // use provider with contracts

  return;
};

export default App;

With web3.js

import React, { useMemo } from 'react';
import Web3 from 'web3';
import { useSafeAppsSDK } from '@safe-global/safe-apps-react-sdk';
import { SafeAppProvider } from '@safe-global/safe-apps-provider';

const App = () => {
  const { sdk, safe } = useSafeAppsSDK();
  const web3Provider = useMemo(() => new Web3(new SafeAppProvider(safe, sdk)), [sdk, safe]);

  // use provider with contracts

  return;
};

export default App;

A note on gas limit

The ethereum transaction gas limit passed to the safe-apps-provider will be treated as safeTxGas, which is an equivalent of the ethereum transaction gas limit in the Safe context. To learn more about the safe transaction gas, read here:
https://github.com/safe-global/safe-contracts/blob/c36bcab46578a442862d043e12a83fec41143dec/docs/safe_tx_gas.md

If you don't want to pass a calculation and leave it to the Safe, pass 0 as the gas limit.

More scenarios

For the SDK overview documentation, please refer to the safe-apps-sdk documentation

更新履歴

@safe-global/safe-apps-provider

0.18.6

Patch Changes

  • 8036c19: Update EIP-5792 according to spec.
  • 2081b24: Update EIP-5792 implementation according to spec. and fix pending status

0.18.5

Patch Changes

  • 5219a05: Update EIP-5792 implementation according to spec. and fix pending status

0.18.4

Patch Changes

  • 21ffde5: Add EIP-5792 support

0.18.3

Patch Changes

  • 55342f0: chore: bump dependencies
  • Updated dependencies [e0710be]
  • Updated dependencies [55342f0]
  • Updated dependencies [2cc8919]
    • @safe-global/safe-apps-sdk@9.1.0

0.18.2

Patch Changes

  • Updated dependencies [767e262]
  • Updated dependencies [9fb93b1]
    • @safe-global/safe-apps-sdk@9.0.0

0.18.2-next.0

Patch Changes

  • Updated dependencies [9fb93b1]
    • @safe-global/safe-apps-sdk@9.0.0-next.0

0.18.1

Patch Changes

  • d6baa64: fallback value and data were overwritten with undefined

0.18.0

Minor Changes

  • 077d2cc: Add sideEffects false to package.json to improve tree-shaking
  • b24cde9: chore: bump dependencies

Patch Changes

  • Updated dependencies [077d2cc]
  • Updated dependencies [b24cde9]
    • @safe-global/safe-apps-sdk@8.1.0

0.17.1

Patch Changes

  • Updated dependencies [dfb7fae]
    • @safe-global/safe-apps-sdk@8.0.0

0.17.0

Minor Changes

  • bdae5af: Signing methods return the signature instead of 0x

Patch Changes

  • Updated dependencies [bdae5af]
    • @safe-global/safe-apps-sdk@7.11.0

0.16.1

Patch Changes

  • Updated dependencies [d759219]
    • @safe-global/safe-apps-sdk@7.10.1

0.16.0

Minor Changes

  • f89c36f: Adds the new setSafeSettings and getOffChainSignature methods.

Patch Changes

  • Updated dependencies [f89c36f]
    • @safe-global/safe-apps-sdk@7.10.0

0.15.2

Patch Changes

  • Updated dependencies [6bdd4f9]
    • @safe-global/safe-apps-sdk@7.9.0

0.15.1

Patch Changes

  • b6c00b8: Convert gaslimit hex-encoded string to a decimal number

0.15.0

Minor Changes

  • 6762218: Pass the gas limit to safeTxGas when sending a transaction through the Safe app provider

0.14.0

Minor Changes

  • b7b203f: Accept string as message argument in eth_signTypedData

0.13.2

Patch Changes

  • 50853a2: Fix eth_signTypedData message params ordering

0.13.1

Patch Changes

  • Updated dependencies [0abb796]
    • @gnosis.pm/safe-apps-sdk@7.8.0

0.13.0

Minor Changes

  • a0991c0: add support for the eip-712 signature method

Patch Changes

  • Updated dependencies [a0991c0]
    • @gnosis.pm/safe-apps-sdk@7.7.0

0.12.0

Minor Changes

  • 7c10204: Added support for EIP-2255

Patch Changes

  • Updated dependencies [7c10204]
    • @gnosis.pm/safe-apps-sdk@7.6.0

0.11.3

Patch Changes

  • Updated dependencies [32b773c]
    • @gnosis.pm/safe-apps-sdk@7.5.0

0.11.2

Patch Changes

  • Updated dependencies [b5ec379]
    • @gnosis.pm/safe-apps-sdk@7.4.1

0.11.1

Patch Changes

  • Updated dependencies [19b1831]
  • Updated dependencies [f00202a]
    • @gnosis.pm/safe-apps-sdk@7.4.0

0.11.0

Minor Changes

  • df5f7ff: Add getEnvironmentInfo method and isReadOnly prop to SafeInfo

Patch Changes

  • Updated dependencies [df5f7ff]
    • @gnosis.pm/safe-apps-sdk@7.3.0

0.10.3

Patch Changes

  • Updated dependencies [760c63c]
    • @gnosis.pm/safe-apps-sdk@7.2.0

0.10.2

Patch Changes

  • Updated dependencies [0a3ddd3]
    • @gnosis.pm/safe-apps-sdk@7.1.0

0.10.1

Patch Changes

  • Updated dependencies [43651c0]
    • @gnosis.pm/safe-apps-sdk@7.0.0

0.10.0

Minor Changes

  • 45199f6: Use safe-react-gateway for gateway types. Bump dependencies

Patch Changes

  • Updated dependencies [45199f6]
    • @gnosis.pm/safe-apps-sdk@6.3.0

0.9.3

Patch Changes

  • Updated dependencies [d1ef969]
    • @gnosis.pm/safe-apps-sdk@6.2.0

0.9.2

Patch Changes

  • Updated dependencies [0ee4c94]
    • @gnosis.pm/safe-apps-sdk@6.1.1

0.9.1

Patch Changes

  • Updated dependencies [87984be]
    • @gnosis.pm/safe-apps-sdk@6.1.0

0.9.0

Minor Changes

  • 8c1d1e4: Extend the provider from Node.js EventEmitter class

Patch Changes

  • Updated dependencies [630800f]
    • @gnosis.pm/safe-apps-sdk@6.0.0

0.8.1

Patch Changes

  • 2b56d7e: move unecessary dependencies to dev-dependencies
  • Updated dependencies [2b56d7e]
  • Updated dependencies [9a4d3a4]
    • @gnosis.pm/safe-apps-sdk@5.0.0

0.8.1-next.1

Patch Changes

  • Updated dependencies [9a4d3a4]
    • @gnosis.pm/safe-apps-sdk@5.0.0-next.1

0.8.1-next.0

Patch Changes

  • 2b56d7e: move unecessary dependencies to dev-dependencies
  • Updated dependencies [2b56d7e]
    • @gnosis.pm/safe-apps-sdk@4.3.1-next.0

0.8.0

Minor Changes

  • 8d86ff2: support eth_sign and personal_sign

Patch Changes

  • Updated dependencies [5286af8]
  • Updated dependencies [035159a]
  • Updated dependencies [8777635]
    • @gnosis.pm/safe-apps-sdk@4.3.0

0.8.0-next.3

Minor Changes

  • 8d86ff2: support eth_sign and personal_sign

0.7.2-next.2

Patch Changes

  • Updated dependencies [8777635]
    • @gnosis.pm/safe-apps-sdk@4.3.0-next.2

0.7.2-next.1

Patch Changes

  • Updated dependencies [5286af8]
    • @gnosis.pm/safe-apps-sdk@4.3.0-next.1

0.7.2-next.0

Patch Changes

  • Updated dependencies [035159a]
    • @gnosis.pm/safe-apps-sdk@4.3.0-next.0

0.7.1

Patch Changes

  • Updated dependencies [4108134]
    • @gnosis.pm/safe-apps-sdk@4.2.0

0.7.0

Minor Changes

  • f9d1a18: Support eth_gasPrice rpc method
  • 9f91d38: Add support for eth_getTransactionCount rpc call

Patch Changes

  • Updated dependencies [9f91d38]
  • Updated dependencies [f9d1a18]
    • @gnosis.pm/safe-apps-sdk@4.1.0

0.7.0-next.1

Minor Changes

  • f9d1a18: Support eth_gasPrice rpc method

Patch Changes

  • Updated dependencies [f9d1a18]
    • @gnosis.pm/safe-apps-sdk@4.1.0-next.1

0.7.0-next.0

Minor Changes

  • 9f91d38: Add support for eth_getTransactionCount rpc call

Patch Changes

  • Updated dependencies [9f91d38]
    • @gnosis.pm/safe-apps-sdk@4.1.0-next.0