13.0.4 • Published 9 months ago

@reservoir0x/relay-ethers-wallet-adapter v13.0.4

Weekly downloads
-
License
-
Repository
github
Last release
9 months ago

Installation

yarn add @reservoir0x/relay-ethers-wallet-adapter @reservoir0x/relay-sdk

Also make sure to install the peer dependencies required by the adapter if your application doesn't already include them:

yarn add ethers viem @reservoir0x/relay-sdk

Usage

To use the adapter simply pass in your ethers signer and receive a normalized AdaptedWallet object:

import { getClient } from "@reservoir0x/relay-sdk";
import { adaptEthersSigner } from "@reservoir0x/relay-ethers-wallet-adapter";
import { useSigner } from "wagmi";

const { data: signer } = useSigner();
const wallet = adaptEthersSigner(signer);

const quote = getClient().actions.getQuote({
  chainId: 7777777,
  toChainId: 8453,
  txs: [{ to: "0x30385bce01da4b415cae1db21d41e9f6eab3ba50", value: "1000000" }],
  wallet: wallet,
});

getClient().actions.execute({
  quote: quote,
  wallet: wallet,
  onProgress: (steps) => {
    console.log(steps);
  },
});

In the code snippet above we use the wagmi useSigner method, which is not required, you can create your ethers signer however you wish. We then adapt the signer to the AdaptedWallet object and pass this into any of the SDK methods. Here we pass it into the call method along with the other required parameters.

13.0.4

9 months ago

13.0.2

9 months ago

13.0.3

9 months ago

13.0.1

9 months ago

13.0.0

9 months ago

12.0.4

9 months ago

12.0.3

10 months ago

12.0.1

10 months ago

12.0.2

10 months ago

12.0.0

10 months ago

11.0.2

10 months ago

11.0.1

11 months ago

9.0.9

1 year ago

9.0.8

1 year ago

9.0.7

1 year ago

9.0.6

1 year ago

9.0.5

1 year ago

9.0.4

1 year ago

9.0.3

1 year ago

10.0.0

11 months ago

10.0.1

11 months ago

10.0.2

11 months ago

9.0.13

12 months ago

9.0.12

12 months ago

9.0.11

12 months ago

9.0.10

12 months ago

11.0.0

11 months ago

7.0.0

1 year ago

7.0.2

1 year ago

7.0.1

1 year ago

8.0.0

1 year ago

9.0.2

1 year ago

9.0.1

1 year ago

9.0.0

1 year ago

6.0.4

1 year ago

6.0.3

1 year ago

6.0.1

1 year ago

6.0.2

1 year ago

6.0.0

1 year ago

5.0.0

1 year ago

4.0.10

1 year ago

4.0.9

1 year ago

4.0.8

1 year ago

4.0.5

1 year ago

4.0.4

1 year ago

4.0.7

1 year ago

4.0.6

1 year ago

4.0.3

1 year ago

4.0.2

1 year ago

4.0.1

1 year ago

4.0.0

1 year ago

3.0.5

1 year ago

3.0.4

1 year ago

3.0.3

1 year ago

3.0.2

1 year ago

3.0.1

1 year ago

3.0.0

1 year ago

2.0.0

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago