Skip to content

Commit

Permalink
fix: selector
Browse files Browse the repository at this point in the history
  • Loading branch information
JackHamer09 committed Nov 27, 2024
1 parent 1b3f841 commit 8f6ec49
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions examples/nft-quest/stores/connector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ export const useConnectorStore = defineStore("connector", () => {
if (!chain) throw new Error(`Chain with id ${runtimeConfig.public.chain.id} was not found in supported chains list`);

const connector = zksyncSsoConnector({
metadata: {
icon: `${runtimeConfig.public.baseUrl}/icon-192.png`,
},
authServerUrl: runtimeConfig.public.authServerUrl,
session: {
feeLimit: parseEther("0.001"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
data-testid="connect"
@click="confirmConnection()"
>
{{ isLoggedIn ? "Connect" : "Create" }}
Connect
</ZkButton>
</ZkHighlightWrapper>
</div>
Expand Down
2 changes: 1 addition & 1 deletion packages/sdk/src/client-auth-server/session/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ export function formatSessionPreferences(
feeLimit: preferences.feeLimit ? formatLimitPreferences(preferences.feeLimit) : defaults.feeLimit,
callPolicies: preferences.contractCalls?.map((policy) => {
const allowedStateMutability: ContractWriteMutability[] = ["nonpayable", "payable"];
const abiFunction = (policy.abi as Abi).find((fn) => fn.type === "function" && (allowedStateMutability as AbiStateMutability[]).includes(fn.stateMutability)) as AbiFunction;
const abiFunction = (policy.abi as Abi).find((fn) => fn.type === "function" && fn.name === policy.functionName && (allowedStateMutability as AbiStateMutability[]).includes(fn.stateMutability)) as AbiFunction;
if (!abiFunction) throw new Error(`Function not found in the provided ABI: ${policy.functionName}`);

const selector = toFunctionSelector(abiFunction);
Expand Down

0 comments on commit 8f6ec49

Please sign in to comment.