Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Lykhoyda committed Sep 5, 2024
1 parent 5e5e0a0 commit 1319fb4
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 5 deletions.
5 changes: 3 additions & 2 deletions examples/evm-to-evm-fungible-transfer/src/transfer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export async function erc20Transfer(): Promise<void> {
sourceNetworkProvider: web3Provider as unknown as Eip1193Provider,
resource: RESOURCE_ID,
amount: BigInt(1) * BigInt(1e18),
destinationAddress: destinationAddress,
recipientAddress: destinationAddress,
sourceAddress,
};
Expand All @@ -55,15 +56,15 @@ export async function erc20Transfer(): Promise<void> {
const response = await wallet.sendTransaction(approval);
await response.wait();
console.log(
`Approved, transaction: ${getTxExplorerUrl({ txHash: response.hash, chainId: SEPOLIA_CHAIN_ID })}`
`Approved, transaction: ${getTxExplorerUrl({ txHash: response.hash, chainId: SEPOLIA_CHAIN_ID })}`,
);
}

const transferTx = await transfer.getTransferTransaction();
const response = await wallet.sendTransaction(transferTx);
await response.wait();
console.log(
`Depositted, transaction: ${getSygmaScanLink(response.hash, process.env.SYGMA_ENV)}`
`Depositted, transaction: ${getSygmaScanLink(response.hash, process.env.SYGMA_ENV)}`,
);
}

Expand Down
2 changes: 1 addition & 1 deletion examples/evm-to-substrate-fungible-transfer/.env.sample
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
PRIVATE_KEY=""
SOURCE_EVM_RPC_URL="TANGLE_RPC_URL_HERE"
SOURCE_EVM_RPC_URL="SEPOLIA_RPC_URL_HERE"
SYGMA_ENV="testnet"
2 changes: 0 additions & 2 deletions examples/evm-to-substrate-fungible-transfer/src/transfer.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import type { Eip1193Provider } from "@buildwithsygma/core";
import { Environment } from "@buildwithsygma/core";
import { createEvmFungibleAssetTransfer } from "@buildwithsygma/evm";
import dotenv from "dotenv";
import { Wallet, providers } from "ethers";
Expand Down Expand Up @@ -43,7 +42,6 @@ export async function erc20Transfer(): Promise<void> {
resource: RESOURCE_ID,
amount: BigInt(1) * BigInt(1e18),
destinationAddress: destinationAddress,
environment: (process.env.SYGMA_ENV as Environment) || Environment.TESTNET,
sourceAddress: sourceAddress,
};

Expand Down
16 changes: 16 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,22 @@ __metadata:
languageName: unknown
linkType: soft

"@buildwithsygma/evm-to-evm-non-fungible-transfer-example@workspace:examples/evm-to-evm-non-fungible-transfer":
version: 0.0.0-use.local
resolution: "@buildwithsygma/evm-to-evm-non-fungible-transfer-example@workspace:examples/evm-to-evm-non-fungible-transfer"
dependencies:
"@buildwithsygma/core": "workspace:^"
"@buildwithsygma/evm": "workspace:^"
dotenv: "npm:^16.3.1"
eslint: "npm:8"
ethers: "npm:5.7.2"
ts-node: "npm:10.9.1"
tsx: "npm:^4.15.4"
typescript: "npm:5.0.4"
web3-providers-http: "npm:1.10.4"
languageName: unknown
linkType: soft

"@buildwithsygma/evm-to-substrate-fungible-transfer-example@workspace:examples/evm-to-substrate-fungible-transfer":
version: 0.0.0-use.local
resolution: "@buildwithsygma/evm-to-substrate-fungible-transfer-example@workspace:examples/evm-to-substrate-fungible-transfer"
Expand Down

0 comments on commit 1319fb4

Please sign in to comment.