Skip to content

Commit

Permalink
Merge branch 'main' of github.com:PureStake/xcm-sdk into update-deps
Browse files Browse the repository at this point in the history
  • Loading branch information
mmaurello committed Feb 9, 2024
2 parents 462f1fd + ec6f53a commit 5769b25
Show file tree
Hide file tree
Showing 21 changed files with 217 additions and 60 deletions.
5 changes: 5 additions & 0 deletions .changeset/short-files-compete.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@moonbeam-network/xcm-config': patch
---

Change Hydra endpoint
4 changes: 2 additions & 2 deletions examples/sdk-simple/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
"author": "",
"license": "MIT",
"dependencies": {
"@moonbeam-network/xcm-config": "1.3.25",
"@moonbeam-network/xcm-sdk": "1.4.21",
"@moonbeam-network/xcm-config": "1.3.27",
"@moonbeam-network/xcm-sdk": "1.4.23",
"@moonbeam-network/xcm-utils": "1.0.4"
},
"devDependencies": {
Expand Down
24 changes: 12 additions & 12 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions packages/builder/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @moonbeam-network/xcm-builder

## 1.0.13

### Patch Changes

- Updated dependencies [[`eb20aee`](https://github.com/moonbeam-foundation/xcm-sdk/commit/eb20aee9d9c9052074501421d0d442bd13022424)]:
- @moonbeam-network/xcm-types@1.0.4

## 1.0.12

### Patch Changes
Expand Down
4 changes: 2 additions & 2 deletions packages/builder/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@moonbeam-network/xcm-builder",
"version": "1.0.12",
"version": "1.0.13",
"description": "Moonbeam XCM builder",
"scripts": {
"build": "tsup",
Expand Down Expand Up @@ -50,7 +50,7 @@
"types": "./build/index.d.ts",
"main": "./build/index.cjs",
"dependencies": {
"@moonbeam-network/xcm-types": "1.0.3",
"@moonbeam-network/xcm-types": "1.0.4",
"@moonbeam-network/xcm-utils": "1.0.4",
"big.js": "^6.2.1",
"type-fest": "^3.8.0"
Expand Down
16 changes: 16 additions & 0 deletions packages/config/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# @moonbeam-network/xcm-config

## 1.3.27

### Patch Changes

- [#179](https://github.com/moonbeam-foundation/xcm-sdk/pull/179) [`eb20aee`](https://github.com/moonbeam-foundation/xcm-sdk/commit/eb20aee9d9c9052074501421d0d442bd13022424) Thanks [@mmaurello](https://github.com/mmaurello)! - USDC wh integration with Moonbeam

- Updated dependencies [[`eb20aee`](https://github.com/moonbeam-foundation/xcm-sdk/commit/eb20aee9d9c9052074501421d0d442bd13022424)]:
- @moonbeam-network/xcm-types@1.0.4
- @moonbeam-network/xcm-builder@1.0.13

## 1.3.26

### Patch Changes

- [#199](https://github.com/moonbeam-foundation/xcm-sdk/pull/199) [`6849ab3`](https://github.com/moonbeam-foundation/xcm-sdk/commit/6849ab3a5aa200d753849bc710d35fad4e2ac5fd) Thanks [@mmaurello](https://github.com/mmaurello)! - bump xcm delivery fees

## 1.3.25

### Patch Changes
Expand Down
6 changes: 3 additions & 3 deletions packages/config/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@moonbeam-network/xcm-config",
"version": "1.3.25",
"version": "1.3.27",
"description": "All necessary configuration to transfer assets from Moonbeam, Moonriver, Moonbase to other parachains and back",
"scripts": {
"build": "tsup",
Expand Down Expand Up @@ -50,8 +50,8 @@
"types": "./build/index.d.ts",
"main": "./build/index.cjs",
"dependencies": {
"@moonbeam-network/xcm-builder": "1.0.12",
"@moonbeam-network/xcm-types": "1.0.3"
"@moonbeam-network/xcm-builder": "1.0.13",
"@moonbeam-network/xcm-types": "1.0.4"
},
"peerDependencies": {
"@polkadot/types": "^10.10.1",
Expand Down
16 changes: 12 additions & 4 deletions packages/config/src/chains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ export const hydraDX = new Parachain({
name: 'HydraDX',
parachainId: 2034,
ss58Format: 63,
ws: 'wss://rpc.hydradx.cloud',
ws: 'wss://hydradx-rpc.dwellir.com',
});

export const interlay = new Parachain({
Expand All @@ -454,13 +454,11 @@ export const interlay = new Parachain({
asset: intr,
decimals: 10,
id: { Token: intr.originSymbol },
metadataId: 0,
},
{
asset: ibtc,
decimals: 8,
id: { Token: ibtc.originSymbol },
metadataId: 0,
},
],
ecosystem: Ecosystem.Polkadot,
Expand Down Expand Up @@ -549,7 +547,6 @@ export const kintsugi = new Parachain({
asset: kbtc,
decimals: 8,
id: { Token: kbtc.originSymbol },
metadataId: 0,
},
],
ecosystem: Ecosystem.Kusama,
Expand Down Expand Up @@ -1400,13 +1397,24 @@ export const uniqueAlpha = new Parachain({
});

export const zeitgeist = new Parachain({
assetsData: [
{
asset: usdcwh,
id: { ForeignAsset: 1 },
},
{
asset: glmr,
id: { ForeignAsset: 3 },
},
],
ecosystem: Ecosystem.Polkadot,
genesisHash:
'0x1bf2a2ecb4a868de66ea8610f2ce7c8c43706561b6476031315f6640fe38e060',
key: 'zeitgeist',
name: 'Zeitgeist',
parachainId: 2092,
ss58Format: 73,
usesChainDecimals: true,
ws: 'wss://zeitgeist-rpc.dwellir.com',
});

Expand Down
2 changes: 1 addition & 1 deletion packages/config/src/configs/kusama.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const kusamaConfig = new ChainConfig({
fee: {
asset: ksm,
balance: BalanceBuilder().substrate().system().account(),
xcmDeliveryFeeAmount: 0.0015,
xcmDeliveryFeeAmount: 0.002,
},
}),
],
Expand Down
4 changes: 2 additions & 2 deletions packages/config/src/configs/kusamaAssetHub.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const kusamaAssetHubConfig = new ChainConfig({
fee: {
asset: ksm,
balance: BalanceBuilder().substrate().system().account(),
xcmDeliveryFeeAmount: 0.00115,
xcmDeliveryFeeAmount: 0.0015,
},
min: AssetMinBuilder().assets().asset(),
}),
Expand All @@ -47,7 +47,7 @@ export const kusamaAssetHubConfig = new ChainConfig({
fee: {
asset: ksm,
balance: BalanceBuilder().substrate().system().account(),
xcmDeliveryFeeAmount: 0.00115,
xcmDeliveryFeeAmount: 0.0015,
},
min: AssetMinBuilder().assets().asset(),
}),
Expand Down
28 changes: 27 additions & 1 deletion packages/config/src/configs/moonbeam.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,18 @@ export const moonbeamConfig = new ChainConfig({
contract: ContractBuilder().Xtokens().transfer(),
destination: pendulum,
destinationFee: {
amount: 0.0002, //
amount: 0.0002,
asset: glmr,
balance: BalanceBuilder().substrate().system().account(),
},
}),
new AssetConfig({
asset: glmr,
balance: BalanceBuilder().substrate().system().account(),
contract: ContractBuilder().Xtokens().transfer(),
destination: zeitgeist,
destinationFee: {
amount: 0.3,
asset: glmr,
balance: BalanceBuilder().substrate().system().account(),
},
Expand Down Expand Up @@ -515,6 +526,21 @@ export const moonbeamConfig = new ChainConfig({
balance: BalanceBuilder().substrate().system().account(),
},
}),
new AssetConfig({
asset: usdcwh,
balance: BalanceBuilder().evm().erc20(),
contract: ContractBuilder().Xtokens().transfer(),
destination: zeitgeist,
destinationFee: {
amount: 0.101,
asset: usdcwh,
balance: BalanceBuilder().evm().erc20(),
},
fee: {
asset: glmr,
balance: BalanceBuilder().substrate().system().account(),
},
}),
new AssetConfig({
asset: usdtwh,
balance: BalanceBuilder().evm().erc20(),
Expand Down
28 changes: 27 additions & 1 deletion packages/config/src/configs/zeitgeist.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
ExtrinsicBuilder,
FeeBuilder,
} from '@moonbeam-network/xcm-builder';
import { ztg } from '../assets';
import { glmr, usdcwh, ztg } from '../assets';
import { moonbeam, zeitgeist } from '../chains';
import { AssetConfig } from '../types/AssetConfig';
import { ChainConfig } from '../types/ChainConfig';
Expand All @@ -21,6 +21,32 @@ export const zeitgeistConfig = new ChainConfig({
},
extrinsic: ExtrinsicBuilder().xTokens().transfer(),
}),
new AssetConfig({
asset: usdcwh,
balance: BalanceBuilder().substrate().tokens().accounts(),
destination: moonbeam,
destinationFee: {
amount: 0.04,
asset: glmr,
balance: BalanceBuilder().substrate().tokens().accounts(),
},
extrinsic: ExtrinsicBuilder().xTokens().transferMultiCurrencies(),
fee: {
asset: ztg,
balance: BalanceBuilder().substrate().system().account(),
},
}),
new AssetConfig({
asset: glmr,
balance: BalanceBuilder().substrate().tokens().accounts(),
destination: moonbeam,
destinationFee: {
amount: 0.01,
asset: glmr,
balance: BalanceBuilder().substrate().tokens().accounts(),
},
extrinsic: ExtrinsicBuilder().xTokens().transfer(),
}),
],
chain: zeitgeist,
});
18 changes: 18 additions & 0 deletions packages/sdk/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
# @moonbeam-network/xcm-sdk

## 1.4.23

### Patch Changes

- [#179](https://github.com/moonbeam-foundation/xcm-sdk/pull/179) [`eb20aee`](https://github.com/moonbeam-foundation/xcm-sdk/commit/eb20aee9d9c9052074501421d0d442bd13022424) Thanks [@mmaurello](https://github.com/mmaurello)! - USDC wh integration with Moonbeam

- Updated dependencies [[`eb20aee`](https://github.com/moonbeam-foundation/xcm-sdk/commit/eb20aee9d9c9052074501421d0d442bd13022424)]:
- @moonbeam-network/xcm-config@1.3.27
- @moonbeam-network/xcm-types@1.0.4
- @moonbeam-network/xcm-builder@1.0.13

## 1.4.22

### Patch Changes

- Updated dependencies [[`6849ab3`](https://github.com/moonbeam-foundation/xcm-sdk/commit/6849ab3a5aa200d753849bc710d35fad4e2ac5fd)]:
- @moonbeam-network/xcm-config@1.3.26

## 1.4.21

### Patch Changes
Expand Down
8 changes: 4 additions & 4 deletions packages/sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@moonbeam-network/xcm-sdk",
"version": "1.4.21",
"version": "1.4.23",
"description": "The Moonbeam XCM SDK enables developers to easily deposit and withdraw assets to Moonbeam/Moonriver from the relay chain and other parachains in the Polkadot/Kusama ecosystem",
"scripts": {
"build": "tsup",
Expand Down Expand Up @@ -51,9 +51,9 @@
"types": "./build/index.d.ts",
"main": "./build/index.cjs",
"dependencies": {
"@moonbeam-network/xcm-builder": "1.0.12",
"@moonbeam-network/xcm-config": "1.3.25",
"@moonbeam-network/xcm-types": "1.0.3",
"@moonbeam-network/xcm-builder": "1.0.13",
"@moonbeam-network/xcm-config": "1.3.27",
"@moonbeam-network/xcm-types": "1.0.4",
"@moonbeam-network/xcm-utils": "1.0.4",
"big.js": "^6.2.1"
},
Expand Down
4 changes: 3 additions & 1 deletion packages/sdk/src/getTransferData/getDestinationData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export async function getDestinationData({
amount: 0n,
decimals: await getDecimals({
address: destinationAddress,
chain,
config,
evmSigner,
polkadot,
Expand All @@ -37,7 +38,9 @@ export async function getDestinationData({

const balance = await getBalance({
address: destinationAddress,
chain,
config,
decimals: zeroAmount.decimals,
evmSigner,
polkadot,
});
Expand All @@ -53,7 +56,6 @@ export async function getDestinationData({
polkadot,
});
const minAmount = zeroAmount.copyWith({ amount: min });

return {
balance: balanceAmount,
chain,
Expand Down
Loading

0 comments on commit 5769b25

Please sign in to comment.