-
Notifications
You must be signed in to change notification settings - Fork 194
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Integrate EigenSDK wallet in batcher (#348)
- Loading branch information
Showing
11 changed files
with
371 additions
and
150 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
package common | ||
|
||
import ( | ||
"github.com/urfave/cli" | ||
) | ||
|
||
const ( | ||
FireblocksAPIKeyFlagName = "fireblocks-api-key" | ||
FireblocksAPISecretPathFlagName = "fireblocks-api-secret-path" | ||
FireblocksBaseURLFlagName = "fireblocks-api-url" | ||
FireblocksVaultAccountNameFlagName = "fireblocks-vault-account-name" | ||
) | ||
|
||
type FireblocksConfig struct { | ||
APIKey string | ||
SecretKeyPath string | ||
BaseURL string | ||
VaultAccountName string | ||
} | ||
|
||
func FireblocksCLIFlags(envPrefix string, flagPrefix string) []cli.Flag { | ||
return []cli.Flag{ | ||
cli.StringFlag{ | ||
Name: PrefixFlag(flagPrefix, FireblocksAPIKeyFlagName), | ||
Usage: "Fireblocks API Key. To configure Fireblocks MPC wallet, this field is required. Otherwise, private key must be configured in eth client so that it can fall back to private key wallet.", | ||
Required: false, | ||
EnvVar: PrefixEnvVar(envPrefix, "FIREBLOCKS_API_KEY"), | ||
}, | ||
cli.StringFlag{ | ||
Name: PrefixFlag(flagPrefix, FireblocksAPISecretPathFlagName), | ||
Usage: "Fireblocks API Secret Path. To configure Fireblocks MPC wallet, this field is required. Otherwise, private key must be configured in eth client so that it can fall back to private key wallet.", | ||
Required: false, | ||
EnvVar: PrefixEnvVar(envPrefix, "FIREBLOCKS_API_SECRET_PATH"), | ||
}, | ||
cli.StringFlag{ | ||
Name: PrefixFlag(flagPrefix, FireblocksBaseURLFlagName), | ||
Usage: "Fireblocks API URL. To configure Fireblocks MPC wallet, this field is required. Otherwise, private key must be configured in eth client so that it can fall back to private key wallet.", | ||
Required: false, | ||
EnvVar: PrefixEnvVar(envPrefix, "FIREBLOCKS_API_URL"), | ||
}, | ||
cli.StringFlag{ | ||
Name: PrefixFlag(flagPrefix, FireblocksVaultAccountNameFlagName), | ||
Usage: "Fireblocks Vault Account Name. To configure Fireblocks MPC wallet, this field is required. Otherwise, private key must be configured in eth client so that it can fall back to private key wallet.", | ||
Required: false, | ||
EnvVar: PrefixEnvVar(envPrefix, "FIREBLOCKS_VAULT_ACCOUNT_NAME"), | ||
}, | ||
} | ||
} | ||
|
||
func ReadFireblocksCLIConfig(ctx *cli.Context, flagPrefix string) FireblocksConfig { | ||
return FireblocksConfig{ | ||
APIKey: ctx.GlobalString(PrefixFlag(flagPrefix, FireblocksAPIKeyFlagName)), | ||
SecretKeyPath: ctx.GlobalString(PrefixFlag(flagPrefix, FireblocksAPISecretPathFlagName)), | ||
BaseURL: ctx.GlobalString(PrefixFlag(flagPrefix, FireblocksBaseURLFlagName)), | ||
VaultAccountName: ctx.GlobalString(PrefixFlag(flagPrefix, FireblocksVaultAccountNameFlagName)), | ||
} | ||
} |
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
Oops, something went wrong.