Skip to content
This repository has been archived by the owner on Sep 4, 2024. It is now read-only.

Commit

Permalink
v0.1.6
Browse files Browse the repository at this point in the history
  • Loading branch information
JesseTheRobot committed Feb 5, 2024
1 parent 317fa77 commit 846f52a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@irys/sdk",
"version": "0.1.6-a2",
"version": "0.1.6",
"description": "JS client for Irys",
"repository": "https://github.com/Bundlr-Network/js-client.git",
"author": "Irys",
Expand Down
5 changes: 3 additions & 2 deletions src/web/shims/viemv2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@ import { InjectedTypedEthereumSigner } from "arbundles/web";
export function augmentViemV2(tokenConfig: EthereumConfig, opts: any): void {
const walletClient = opts.provider as WalletClient;
const publicClient = opts.publicClient as PublicClient<ReturnType<typeof http>, typeof mainnet>;
const accountIndex = opts.accountIndex ?? 0;

tokenConfig.ready = async function () {
await this.getSigner().ready();
this._address = await walletClient.getAddresses().then((r) => r[0].toString().toLowerCase());
this._address = await walletClient.getAddresses().then((r) => r[accountIndex].toString().toLowerCase());
this.providerInstance = this.wallet;
}.bind(tokenConfig);

Expand All @@ -25,7 +26,7 @@ export function augmentViemV2(tokenConfig: EthereumConfig, opts: any): void {
if (!this.signer) {
this.signer = new InjectedTypedEthereumSigner({
getSigner: () => ({
getAddress: async () => walletClient.getAddresses().then((r) => r[0]),
getAddress: async () => walletClient.getAddresses().then((r) => r[accountIndex]),
_signTypedData: async (domain, types, message): Promise<string> => {
message["Transaction hash"] = "0x" + Buffer.from(message["Transaction hash"]).toString("hex");
// @ts-expect-error types
Expand Down

0 comments on commit 846f52a

Please sign in to comment.