-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[sdk vault methods] update sdk multicall
- Loading branch information
1 parent
5d4d664
commit 69cd1e8
Showing
27 changed files
with
169 additions
and
176 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
4 changes: 2 additions & 2 deletions
4
...vault/operations/multicall/checkAccess.ts → ...vault/transactions/operate/checkAccess.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
import { validateArgs } from '../../../../utils' | ||
import { vaultMulticall } from '../../../../contracts' | ||
import type { MulticallInput } from './types' | ||
|
||
import getMetadataParams from './util/params/getMetadataParams' | ||
import getBlocklistParams from './util/params/getBlocklistParams' | ||
import getWhitelistParams from './util/params/getWhitelistParams' | ||
import getKeysManagerParams from './util/params/getKeysManagerParams' | ||
import getWhitelisterParams from './util/params/getWhitelisterParams' | ||
import getFeeRecipientParams from './util/params/getFeeRecipientParams' | ||
import getValidatorsRootParams from './util/params/getValidatorsRootParams' | ||
import getBlocklistManagerParams from './util/params/getBlocklistManagerParams' | ||
|
||
|
||
export const commonLogic = (values: MulticallInput) => { | ||
const { | ||
options, contracts, userAddress, vaultAddress, provider, | ||
blocklist, whitelist, keysManager, whitelister, feeRecipient, validatorsRoot, blocklistManager, metadataIpfsHash, | ||
} = values | ||
|
||
validateArgs.address({ vaultAddress, userAddress }) | ||
|
||
const baseMulticall = { | ||
vaultContract: contracts.helpers.createBlocklistedVault(vaultAddress), | ||
keeperContract: contracts.base.keeper, | ||
vaultAddress, | ||
userAddress, | ||
options, | ||
} | ||
|
||
const baseInput = { | ||
options, | ||
provider, | ||
contracts, | ||
userAddress, | ||
vaultAddress, | ||
} | ||
|
||
const params: Parameters<typeof vaultMulticall>[0]['request']['params'] = [] | ||
|
||
if (blocklist) { | ||
const blocklistParams = getBlocklistParams({ ...baseInput, blocklist }) | ||
|
||
params.push(...blocklistParams) | ||
} | ||
if (whitelist) { | ||
const whitelistParams = getWhitelistParams({ ...baseInput, whitelist }) | ||
|
||
params.push(...whitelistParams) | ||
} | ||
if (keysManager) { | ||
const keysManagerParams = getKeysManagerParams({ ...baseInput, keysManager }) | ||
|
||
params.push(...keysManagerParams) | ||
} | ||
if (whitelister) { | ||
const whitelisterParams = getWhitelisterParams({ ...baseInput, whitelister }) | ||
|
||
params.push(...whitelisterParams) | ||
} | ||
if (feeRecipient) { | ||
const feeRecipientParams = getFeeRecipientParams({ ...baseInput, feeRecipient }) | ||
|
||
params.push(...feeRecipientParams) | ||
} | ||
if (validatorsRoot) { | ||
const validatorsRootParams = getValidatorsRootParams({ ...baseInput, validatorsRoot }) | ||
|
||
params.push(...validatorsRootParams) | ||
} | ||
if (metadataIpfsHash) { | ||
const metadataParams = getMetadataParams({ ...baseInput, metadataIpfsHash }) | ||
|
||
params.push(...metadataParams) | ||
} | ||
if (blocklistManager) { | ||
const blocklistManagerParams = getBlocklistManagerParams({ ...baseInput, blocklistManager }) | ||
|
||
params.push(...blocklistManagerParams) | ||
} | ||
|
||
return { | ||
...baseMulticall, | ||
request: { | ||
params, | ||
}, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export type { Action, CheckInput } from './check/types' | ||
export { default as validateList } from './validateList' | ||
export { default as checkAccessCommon } from './check/checkAccessCommon' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.