-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* -wip- initial commit implementing viem * -wip- * -wip- * change dependencies * rename types and fix interfaces * change signer property name and update viem * fix example * change Readme property * accept ethersSigner * allow ethers signer as input * add changeset * Update packages/sdk/src/sdk.interfaces.ts Co-authored-by: elmar <[email protected]> * Update packages/sdk/src/contract/contracts/Erc20/Erc20.ts Co-authored-by: elmar <[email protected]> * implement viem contract instance * fix args * fix type * put ethers and viem as peer dependencies --------- Co-authored-by: elmar <[email protected]>
- Loading branch information
Showing
18 changed files
with
373 additions
and
94 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,6 @@ | ||
--- | ||
'@moonbeam-network/xcm-config': minor | ||
'@moonbeam-network/xcm-sdk': minor | ||
--- | ||
|
||
Allow viem Wallet Client as signer |
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
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 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 |
---|---|---|
@@ -1,15 +1,29 @@ | ||
import type { TransactionResponse } from '@ethersproject/abstract-provider'; | ||
import { Contract, Signer as EthersSigner } from 'ethers'; | ||
import { PublicClient, WalletClient, WriteContractReturnType } from 'viem'; | ||
|
||
export interface BaseContractInterface { | ||
readonly address: string; | ||
} | ||
|
||
export interface TransferContractInterface extends BaseContractInterface { | ||
transfer(): Promise<TransactionResponse>; | ||
transfer(): Promise<TransactionResponse | WriteContractReturnType>; | ||
getFee(amount: bigint): Promise<bigint>; | ||
} | ||
|
||
export interface BalanceContractInterface extends BaseContractInterface { | ||
getBalance(): Promise<bigint>; | ||
getDecimals(): Promise<number>; | ||
} | ||
|
||
export type ContractClient = EthersClient | ViemClient; | ||
|
||
export interface EthersClient { | ||
contract: Contract; | ||
signer: EthersSigner; | ||
} | ||
|
||
export interface ViemClient { | ||
publicClient: PublicClient; | ||
walletClient: WalletClient; | ||
} |
Oops, something went wrong.