-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* EVM Ledger client * ChainId from provider * Ethereum ledger client * BSC Ledger client * Avalanche ledger client * Changeset version files * Peer dependencies removed * Approve return type updated to string * Changeset version files * Approve return type updated to string * Bug fix * Serialize transaction clean code * Clients renamed * add e2e test & jest config --------- Co-authored-by: Thorianite <100335276+Thorian1te@users.noreply.github.com>
- Loading branch information
1 parent
fb0b13e
commit f432295
Showing
38 changed files
with
1,173 additions
and
413 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,7 @@ | ||
--- | ||
'@xchainjs/xchain-ethereum': minor | ||
'@xchainjs/xchain-avax': minor | ||
'@xchainjs/xchain-bsc': minor | ||
--- | ||
|
||
`signer` parameter removed from `transfer` function for the keystore client |
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,8 @@ | ||
--- | ||
'@xchainjs/xchain-ethereum': minor | ||
'@xchainjs/xchain-avax': minor | ||
'@xchainjs/xchain-bsc': minor | ||
'@xchainjs/xchain-evm': minor | ||
--- | ||
|
||
Ledger client |
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 @@ | ||
--- | ||
'@xchainjs/xchain-evm': patch | ||
'@xchainjs/xchain-wallet': patch | ||
--- | ||
|
||
`approve` return type updated from `ethers.providers.TransactionResponse` to `string` |
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 @@ | ||
--- | ||
'@xchainjs/xchain-ethereum': minor | ||
'@xchainjs/xchain-avax': minor | ||
'@xchainjs/xchain-bsc': minor | ||
--- | ||
|
||
`signer` parameter removed from `approve` function for the keystore client |
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// Import the Client class from '@xchainjs/xchain-evm' module | ||
import { ClientKeystore as EVMClientKeystore } from '@xchainjs/xchain-evm' | ||
|
||
// Import defaultAvaxParams constant from './const' file | ||
import { defaultAvaxParams } from './const' | ||
|
||
// Define and export the Client class as the default exportClientKeystore | ||
export class ClientKeystore extends EVMClientKeystore { | ||
// Constructor function that takes an optional config parameter, defaulting to defaultAvaxParams | ||
constructor(config = defaultAvaxParams) { | ||
super(config) | ||
} | ||
} |
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,22 @@ | ||
/** | ||
* Import statements | ||
* Importing the `Client` class from the '@xchainjs/xchain-evm' module | ||
* Importing the `defaultEthParams` constant from the './const' file | ||
*/ | ||
import { ClientLedger as EVMClientLedger, EVMClientParams } from '@xchainjs/xchain-evm' | ||
|
||
/** | ||
* Class definition for the Avalanche EVM client. | ||
* Extends the `XchainEvmClient` class. | ||
*/ | ||
export class ClientLedger extends EVMClientLedger { | ||
/** | ||
* Constructor for the Avalanche EVM client. | ||
* @param {Object} config - Configuration object for the client (optional). | ||
* Defaults to `defaultEthParams` if not provided. | ||
*/ | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
constructor(config: EVMClientParams & { transport: any }) { | ||
super(config) // Call the constructor of the parent class with the provided config or the default parameters | ||
} | ||
} |
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 |
---|---|---|
@@ -1,5 +1,10 @@ | ||
// Export all elements from the 'client' module | ||
export * from './client' | ||
import { ClientKeystore } from './ClientKeystore' | ||
|
||
export { ClientKeystore, ClientKeystore as Client } from './ClientKeystore' | ||
export { ClientLedger } from './ClientLedger' | ||
|
||
// Export all elements from the 'const' module | ||
export * from './const' | ||
|
||
export default ClientKeystore |
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/** | ||
* Import statements | ||
* Importing the `Client` class from the '@xchainjs/xchain-evm' module | ||
* Importing the `defaultEthParams` constant from the './const' file | ||
*/ | ||
import { ClientLedger as EVMClientLedger, EVMClientParams } from '@xchainjs/xchain-evm' | ||
|
||
/** | ||
* Class definition for the Binance Smart Chain EVM client. | ||
* Extends the `XchainEvmClient` class. | ||
*/ | ||
export class ClientLedger extends EVMClientLedger { | ||
/** | ||
* Constructor for the Binance Smart Chain EVM client. | ||
* @param {Object} config - Configuration object for the client (optional). | ||
* Defaults to `defaultEthParams` if not provided. | ||
*/ | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
constructor(config: EVMClientParams & { transport: any }) { | ||
super(config) // Call the constructor of the parent class with the provided config or the default parameters | ||
} | ||
} |
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,6 +1,10 @@ | ||
/** | ||
* This module re-exports the contents of the `client` and `const` modules. | ||
* By re-exporting these modules, consumers can import all the named exports from these modules using a single import statement. | ||
*/ | ||
export * from './client' // Re-exporting all named exports from the 'client' module | ||
export * from './const' // Re-exporting all named exports from the 'const' module | ||
// Export all elements from the 'client' module | ||
import { ClientKeystore } from './ClientKeystore' | ||
|
||
export { ClientKeystore, ClientKeystore as Client } from './ClientKeystore' | ||
export { ClientLedger } from './ClientLedger' | ||
|
||
// Export all elements from the 'const' module | ||
export * from './const' | ||
|
||
export default ClientKeystore |
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,22 @@ | ||
import TransportNodeHid from '@ledgerhq/hw-transport-node-hid' | ||
// import { Network } from '@xchainjs/xchain-client' | ||
// import { assetAmount, assetToBase } from '@xchainjs/xchain-util' | ||
|
||
import { ClientLedger } from '../src/ClientLedger' | ||
import { defaultEthParams } from '../src/const' | ||
|
||
jest.setTimeout(200000) | ||
|
||
describe('Eth Client Ledger', () => { | ||
let ethClient: ClientLedger | ||
beforeAll(async () => { | ||
const transport = await TransportNodeHid.create() | ||
|
||
ethClient = new ClientLedger({ transport, ...defaultEthParams }) | ||
}) | ||
it('get ledger address async without verification ', async () => { | ||
const address = await ethClient.getAddressAsync() | ||
console.log('address', address) | ||
expect(address).toContain('0') | ||
}) | ||
}) |
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/** | ||
* Import statements | ||
* Importing the `Client` class from the '@xchainjs/xchain-evm' module | ||
* Importing the `defaultEthParams` constant from the './const' file | ||
*/ | ||
import { ClientLedger as EVMClientLedger, EVMClientParams } from '@xchainjs/xchain-evm' | ||
|
||
/** | ||
* Class definition for the Ethereum EVM client. | ||
* Extends the `XchainEvmClient` class. | ||
*/ | ||
export class ClientLedger extends EVMClientLedger { | ||
/** | ||
* Constructor for the Ethereum EVM client. | ||
* @param {Object} config - Configuration object for the client (optional). | ||
* Defaults to `defaultEthParams` if not provided. | ||
*/ | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
constructor(config: EVMClientParams & { transport: any }) { | ||
super(config) // Call the constructor of the parent class with the provided config or the default parameters | ||
} | ||
} |
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,9 +1,10 @@ | ||
/** | ||
* Export all members from the 'client' module. | ||
*/ | ||
export * from './client' | ||
// Export all elements from the 'client' module | ||
import { ClientKeystore } from './ClientKeystore' | ||
|
||
/** | ||
* Export all members from the 'const' module. | ||
*/ | ||
export { ClientKeystore, ClientKeystore as Client } from './ClientKeystore' | ||
export { ClientLedger } from './ClientLedger' | ||
|
||
// Export all elements from the 'const' module | ||
export * from './const' | ||
|
||
export default ClientKeystore |
Oops, something went wrong.