Skip to content

Commit

Permalink
custom rpc
Browse files Browse the repository at this point in the history
  • Loading branch information
talentlessguy committed Nov 4, 2023
1 parent 7732c1d commit e1c0024
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/actions/ens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ export const ensAction = async (
cid: string,
domain: string,
{
chain: chainName, safe: safeAddress, operationType
}: { chain: ChainName; } & Partial<{ safe: Address | EIP3770Address, operationType: OperationType }>,
chain: chainName, safe: safeAddress, operationType, rpcUrl
}: { chain: ChainName; } & Partial<{ safe: Address | EIP3770Address, operationType: OperationType; rpcUrl:string }>,
) => {
const chain = chainName === 'mainnet' ? mainnet : goerli
const publicClient = createPublicClient({
transport: http(chain.id === 1 ? 'https://rpc.ankr.com/eth' : 'https://rpc.ankr.com/eth_goerli'),
transport: http(rpcUrl ?? chain.id === 1 ? 'https://rpc.ankr.com/eth' : 'https://rpc.ankr.com/eth_goerli'),
chain
})

Expand Down
8 changes: 5 additions & 3 deletions src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import { cac } from 'cac'
import { ensAction } from './actions/ens.js'
import { statusAction } from './actions/status.js'
import { deployAction } from './actions/deploy.js'
import { OperationType } from '@stauro/piggybank/types'

import './polyfills/fetch.js'
import { OperationType } from '@stauro/piggybank/types'

const cli = cac('blumen')

Expand All @@ -19,11 +19,13 @@ cli
.option('--name <name>', 'Name of the distribution (without file extension)')
.option('--dist <dist>', 'Directory to store the distribution file')
.action(deployAction)
.example('blumen deploy --strict ./dist')

cli
.command('status <cid>', 'Check IPFS pinning status')
.option('--providers <providers>', 'List providers to check status from')
.action(statusAction)
.example('blumen status bafybeibp54tslsez36quqptgzwyda3vo66za3rraujksmsb3d5q247uht4 --providers web3.storage')

cli
.command(
Expand All @@ -33,9 +35,9 @@ cli
.option('--chain <chain>', 'Chain to use', { default: 'mainnet' })
.option('--safe <safe>', 'Deploy using a Safe multisig wallet')
.option('--operation-type <number>', 'Operation type to use for a Safe multisig wallet (0 - Call, 1 - DelegateCall)', { default: OperationType.Call })
.option('--rpc-url <url>', 'Custom Ethereum RPC')
.action(ensAction)

cli.help()
cli.version('0.0.0-dev.1')
cli.example('blumen deploy --strict ./dist')
cli.version('0.1.0')
cli.parse()

0 comments on commit e1c0024

Please sign in to comment.