Skip to content

Commit

Permalink
1173 Comos and Kujira backup endpoints (#1174)
Browse files Browse the repository at this point in the history
  • Loading branch information
0xp3gasus authored May 26, 2024
1 parent 3863979 commit 3c6a033
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
6 changes: 6 additions & 0 deletions .changeset/sixty-birds-learn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@xchainjs/xchain-cosmos': patch
'@xchainjs/xchain-kujira': patch
---

New RPC backup endpoint
5 changes: 4 additions & 1 deletion packages/xchain-cosmos/__e2e__/cosmos-client.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,10 @@ describe('Cosmos client e2e', () => {
const signer = await DirectSecp256k1HdWallet.fromMnemonic(process.env.PHRASE_MAINNET as string, {
hdPaths: [makeCosmoshubPath(senderIndex)],
})
const signingClient = await SigningStargateClient.connectWithSigner(getDefaultClientUrls()[Network.Mainnet], signer)
const signingClient = await SigningStargateClient.connectWithSigner(
getDefaultClientUrls()[Network.Mainnet][0],
signer,
)

const messages: EncodeObject[] = unsignedTx.body.messages.map((message) => {
return { typeUrl: '/cosmos.bank.v1beta1.MsgSend', value: signingClient.registry.decode(message) }
Expand Down
4 changes: 2 additions & 2 deletions packages/xchain-cosmos/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ const TESTNET_EXPLORER_URL = 'https://explorer.theta-testnet.polypore.xyz'
export const getDefaultClientUrls = (): Record<Network, string[]> => {
return {
[Network.Testnet]: ['https://rpc.sentry-02.theta-testnet.polypore.xyz'],
[Network.Stagenet]: ['https://rpc.cosmos.directory/cosmoshub'],
[Network.Mainnet]: ['https://rpc.cosmos.directory/cosmoshub'],
[Network.Stagenet]: ['https://cosmos-rpc.publicnode.com', 'https://rpc.cosmos.directory/cosmoshub'],
[Network.Mainnet]: ['https://cosmos-rpc.publicnode.com', 'https://rpc.cosmos.directory/cosmoshub'],
}
}

Expand Down
2 changes: 2 additions & 0 deletions packages/xchain-kujira/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@ export const getDefaultClientUrls = (): Record<Network, string[]> => {
return {
[Network.Testnet]: ['https://kujira-testnet-rpc.polkachu.com'],
[Network.Stagenet]: [
'https://kujira-rpc.publicnode.com',
'https://rpc.cosmos.directory/kujira',
'https://kujira-rpc.polkachu.com',
'https://kujira.rpc.ghostinnet.com',
'https://kujira-rpc.ibs.team',
],
[Network.Mainnet]: [
'https://kujira-rpc.publicnode.com',
'https://rpc.cosmos.directory/kujira',
'https://kujira-rpc.polkachu.com',
'https://kujira.rpc.ghostinnet.com',
Expand Down

0 comments on commit 3c6a033

Please sign in to comment.