Skip to content

Commit

Permalink
fix(sdk): Fix transfer from Polimec to AHP 🔧
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeldev5 committed Nov 26, 2024
1 parent 4d49456 commit 197e55b
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 4 deletions.
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

0 comments on commit 197e55b

Please sign in to comment.