Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loosen get adapter param types #4835

Merged
merged 2 commits into from
Oct 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ describe('CAIP-25 eth_accounts adapters', () => {
accounts: ['wallet:eip155:0x5'],
},
},
isMultichainOrigin: false,
});

expect(ethAccounts).toStrictEqual([
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,12 @@ const isEip155ScopeString = (scopeString: ScopeString) => {
);
};

export const getEthAccounts = (caip25CaveatValue: Caip25CaveatValue) => {
export const getEthAccounts = (
caip25CaveatValue: Pick<
Caip25CaveatValue,
'requiredScopes' | 'optionalScopes'
>,
) => {
const ethAccounts: string[] = [];
const sessionScopes = mergeScopes(
caip25CaveatValue.requiredScopes,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ describe('CAIP-25 permittedChains adapters', () => {
accounts: ['eip155:100:0x100'],
},
},
isMultichainOrigin: false,
});

expect(ethChainIds).toStrictEqual(['0x1', '0x5', '0xa', '0x64']);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ import {
} from '../scope/types';

export const getPermittedEthChainIds = (
caip25CaveatValue: Caip25CaveatValue,
caip25CaveatValue: Pick<
Caip25CaveatValue,
'requiredScopes' | 'optionalScopes'
>,
) => {
const ethChainIds: Hex[] = [];
const sessionScopes = mergeScopes(
Expand Down
1 change: 0 additions & 1 deletion packages/multichain/src/caip25Permission.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ const specificationBuilder: PermissionSpecificationBuilder<
const ethAccounts = getEthAccounts({
requiredScopes: normalizedRequiredScopes,
optionalScopes: normalizedOptionalScopes,
isMultichainOrigin,
}).map((address) => address.toLowerCase() as Hex);

const allEthAccountsSupported = ethAccounts.every((address) =>
Expand Down
Loading