Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(sdk): Fix transfer from Polimec to AHP 🔧 #539

Merged
merged 1 commit into from
Nov 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions packages/sdk/src/nodes/supported/AssetHubPolkadot.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -317,4 +317,10 @@ describe('AssetHubPolkadot', () => {
includeFee: true
})
})

describe('getProvider', () => {
it('should return correct provider', () => {
expect(assetHub.getProvider()).toBeTypeOf('string')
})
})
})
7 changes: 6 additions & 1 deletion packages/sdk/src/nodes/supported/AssetHubPolkadot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import { generateAddressPayload } from '../../utils/generateAddressPayload'
import { ETHEREUM_JUNCTION } from '../../const'
import { createEthereumTokenLocation } from '../../utils/multiLocation/createEthereumTokenLocation'
import { isForeignAsset } from '../../utils/assets'
import { getParaId } from '../config'
import { getNodeProviders, getParaId } from '../config'

const createCustomXcmToBifrost = <TApi, TRes>(
{ api, address, scenario }: TPolkadotXCMTransferOptions<TApi, TRes>,
Expand Down Expand Up @@ -404,6 +404,11 @@ class AssetHubPolkadot<TApi, TRes>
return super.createCurrencySpec(amount, scenario, version, asset)
}
}

getProvider(): string {
// Return the second WebSocket URL because the first one is sometimes unreliable.
return getNodeProviders(this.node)[1]
}
}

export default AssetHubPolkadot
2 changes: 1 addition & 1 deletion packages/sdk/src/nodes/supported/Hydration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ describe('Hydration', () => {

describe('getProvider', () => {
it('should return LiebiEU provider', () => {
expect(hydration.getProvider()).toBe('wss://rpc.helikon.io/hydradx')
expect(hydration.getProvider()).toBe('wss://hydradx.paras.ibp.network')
})
})
})
2 changes: 1 addition & 1 deletion packages/sdk/src/nodes/supported/Hydration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ class Hydration<TApi, TRes>

getProvider(): string {
// Return the second WebSocket URL because the first one is sometimes unreliable.
return getNodeProviders(this.node)[2]
return getNodeProviders(this.node)[3]
}
}

Expand Down
2 changes: 1 addition & 1 deletion packages/sdk/src/nodes/supported/Polimec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class Polimec<TApi, TRes> extends ParachainNode<TApi, TRes> implements IPolkadot
}

private getAssetMultiLocation = (asset: TAsset): TMultiLocation => {
if (!isForeignAsset(asset) && asset.symbol === 'DOT') {
if (asset.symbol === 'DOT') {
return DOT_MULTILOCATION
}

Expand Down