Skip to content

Commit

Permalink
base sdk (#360)
Browse files Browse the repository at this point in the history
* first pass base

* guess it doesn't exist in ethers despite their docs :()

* address comments

---------

Co-authored-by: Kunal Roy <kunal@alchemyapi.io>
  • Loading branch information
kunal365roy and Kunal Roy authored Aug 23, 2023
1 parent 8199582 commit efc0500
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

### Major Changes

- Add support for Base

### Minor Changes

## 2.9.2
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ The SDK currently supports the following chains:
- **Arbitrum**: Mainnet, Goerli, Rinkeby
- **Astar**: Mainnet
- **PolygonZKEVM**: Mainnet, Testnet
- **Base**: Mainnet, Goerli

You can find per-method documentation of the Alchemy SDK endpoints at the [Alchemy Docs linked in the sidebar](https://docs.alchemy.com/reference/alchemy-sdk-quickstart).

Expand Down
4 changes: 3 additions & 1 deletion src/types/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,9 @@ export enum Network {
MATIC_MUMBAI = 'polygon-mumbai',
ASTAR_MAINNET = 'astar-mainnet',
POLYGONZKEVM_MAINNET = 'polygonzkevm-mainnet',
POLYGONZKEVM_TESTNET = 'polygonzkevm-testnet'
POLYGONZKEVM_TESTNET = 'polygonzkevm-testnet',
BASE_MAINNET = 'base-mainnet',
BASE_GOERLI = 'base-goerli'
}

/** Token Types for the `getTokenBalances()` endpoint. */
Expand Down
12 changes: 11 additions & 1 deletion src/util/const.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ export const EthersNetwork = {
[Network.MATIC_MUMBAI]: 'maticmum',
[Network.ASTAR_MAINNET]: 'astar-mainnet',
[Network.POLYGONZKEVM_MAINNET]: 'polygonzkevm-mainnet',
[Network.POLYGONZKEVM_TESTNET]: 'polygonzkevm-testnet'
[Network.POLYGONZKEVM_TESTNET]: 'polygonzkevm-testnet',
[Network.BASE_MAINNET]: 'base-mainnet',
[Network.BASE_GOERLI]: 'base-goerli'
};

/**
Expand Down Expand Up @@ -84,6 +86,14 @@ export const CustomNetworks: { [key: string]: NetworkFromEthers } = {
'polygonzkevm-testnet': {
chainId: 1442,
name: 'polygonzkevm-testnet'
},
'base-mainnet': {
chainId: 8453,
name: 'base-mainnet'
},
'base-goerli': {
chainId: 84531,
name: 'base-goerli'
}
};

Expand Down

0 comments on commit efc0500

Please sign in to comment.