-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(sdk): sdk exports and initial types (#2624)
Initial SDK exports / defining export strategy and initial types issue: none
- Loading branch information
Showing
15 changed files
with
308 additions
and
3 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 @@ | ||
export { omniPortalAbi } from "./omniPortal.js" |
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,58 @@ | ||
import type { Chain } from "../types/chain.js" | ||
|
||
/** | ||
* @summary We will want to eventually define chains in submodules, and re-export from here, | ||
* to allow for lazy loading for consumers. But this is fine for now while we work | ||
* with a small number of chains. | ||
*/ | ||
|
||
export const mainnet: Chain = { | ||
name: "Ethereum Mainnet", | ||
id: 1, | ||
testnet: false, | ||
portalContract: "0x0000000000000000000000000000000000000000", | ||
nativeCurrency: { name: "Ether", symbol: "ETH", decimals: 18 }, | ||
} | ||
|
||
//////////////////////////////////////////////////////////// | ||
/// TESTNETS | ||
//////////////////////////////////////////////////////////// | ||
export const omniOmega: Chain = { | ||
name: "Omni Omega", | ||
id: 164, | ||
testnet: true, | ||
portalContract: "0xcB60A0451831E4865bC49f41F9C67665Fc9b75C3", | ||
nativeCurrency: { name: "Omni", symbol: "OMNI", decimals: 18 }, | ||
} | ||
|
||
export const holesky: Chain = { | ||
name: "Ethereum Holesky", | ||
id: 17000, | ||
testnet: true, | ||
portalContract: "0xcB60A0451831E4865bC49f41F9C67665Fc9b75C3", | ||
nativeCurrency: { name: "Ether", symbol: "ETH", decimals: 18 }, | ||
} | ||
|
||
export const baseSepolia: Chain = { | ||
name: "Base Sepolia", | ||
id: 84532, | ||
testnet: true, | ||
portalContract: "0xcB60A0451831E4865bC49f41F9C67665Fc9b75C3", | ||
nativeCurrency: { name: "Ether", symbol: "ETH", decimals: 18 }, | ||
} | ||
|
||
export const arbitrumSepolia: Chain = { | ||
name: "Arbitrum Sepolia", | ||
id: 421614, | ||
testnet: true, | ||
portalContract: "0xcB60A0451831E4865bC49f41F9C67665Fc9b75C3", | ||
nativeCurrency: { name: "Ether", symbol: "ETH", decimals: 18 }, | ||
} | ||
|
||
export const optimismSepolia: Chain = { | ||
name: "Optimism Sepolia", | ||
id: 11155420, | ||
testnet: true, | ||
portalContract: "0xcB60A0451831E4865bC49f41F9C67665Fc9b75C3", | ||
nativeCurrency: { name: "Ether", symbol: "ETH", decimals: 18 }, | ||
} |
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,7 @@ | ||
import { http, createPublicClient } from "viem" | ||
import { mainnet } from "viem/chains" | ||
|
||
export const publicClient = createPublicClient({ | ||
chain: mainnet, | ||
transport: http(), | ||
}) |
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 |
---|---|---|
@@ -1 +1,5 @@ | ||
export * from "./types/index.js" | ||
export { omniPortalAbi } from "./abi/omniPortal.js" | ||
export type { Chain } from "./types/chain.js" | ||
export type { NativeCurrency } from "./types/nativeCurrency.js" | ||
export type { XMsg } from "./types/xMsg.js" | ||
export type { XReceipt } from "./types/xReceipt.js" |
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,9 @@ | ||
import type { NativeCurrency } from "./nativeCurrency.js" | ||
|
||
export type Chain = { | ||
name: string | ||
id: number | ||
testnet: boolean | ||
portalContract: string | ||
nativeCurrency: NativeCurrency | ||
} |
This file was deleted.
Oops, something went wrong.
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,5 @@ | ||
export type NativeCurrency = { | ||
name: string | ||
symbol: string | ||
decimals: number | ||
} |
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,12 @@ | ||
/** | ||
* Represents an xMsg event - emitted when an xcall is made to the OmniPortal | ||
* | ||
* @param destinationChainId - The destination chain ID the xcall is aimed at | ||
* @param shardId - The shard ID - TODO | ||
* @param offset - The xMsg offset - unique identifier for this XMsg in the source -> destination XStream | ||
*/ | ||
export type XMsg = { | ||
destinationChainId: number | ||
shardId: number | ||
offset: number | ||
} |
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,12 @@ | ||
/** | ||
* Represents an XReceipt event - emitted when an XMsg is executed on its destination chain | ||
* | ||
* @param sourceChainId - The source chain ID the XMsg was sent | ||
* @param shardId - The shard ID - TODO | ||
* @param offset - The xMsg offset - unique identifier for this XMsg in the source -> destination XStream | ||
*/ | ||
export type XReceipt = { | ||
sourceChainId: number | ||
shardId: number | ||
offset: number | ||
} |
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,14 @@ | ||
/** | ||
* Checks the status of an xMsg. | ||
* | ||
* @param sourceChain - The source chain | ||
* @param destinationChain - The destination chain | ||
* @param offset - The xMsg offset - unique identifier for this XMsg in the source -> destination XStream | ||
* | ||
* @returns TODO | ||
* | ||
* @example TODO | ||
*/ | ||
export function checkXMsgStatus() { | ||
// TODO | ||
} |
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 |
---|---|---|
@@ -1 +1 @@ | ||
// TODO export | ||
export { checkXMsgStatus } from "./checkXMsgStatus.js" |