Skip to content

Commit

Permalink
Add connection.enable v5
Browse files Browse the repository at this point in the history
  • Loading branch information
ClementWalter committed Aug 29, 2023
1 parent 738523a commit 19eb8dc
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ export const TransactionsContextProvider = ({
);
})
.catch((error: any) => {
console.log("error", error);
enqueueSnackbar(error.toString(), { variant: "error" });
});
},
Expand Down
14 changes: 12 additions & 2 deletions packages/starksheet-webapp/src/provider/StarknetProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@ export class StarknetProvider implements ChainProvider {
}

this.connection = connection;
await this.connection.enable({ starknetVersion: "v5" });
return normalizeHexString(connection.account.address);
}

Expand Down Expand Up @@ -285,12 +286,21 @@ export class StarknetProvider implements ChainProvider {
...calls,
];
}

console.log("this.connection", this.connection);
console.log("this.connection.account", this.connection.account);
console.log(
"calls",
calls.map((call) => ({
contractAddress: call.to,
entrypoint: call.entrypoint,
calldata: [...call.calldata],
}))
);
return await this.connection.account.execute(
calls.map((call) => ({
contractAddress: call.to,
entrypoint: call.entrypoint,
calldata: call.calldata,
calldata: [...call.calldata],
}))
);
}
Expand Down

0 comments on commit 19eb8dc

Please sign in to comment.