Skip to content

Commit

Permalink
update substrate example
Browse files Browse the repository at this point in the history
  • Loading branch information
Lykhoyda committed Sep 3, 2024
1 parent d94460d commit 1879447
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 7 deletions.
16 changes: 9 additions & 7 deletions examples/substrate-to-evm-fungible-transfer/src/transfer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,17 @@ const substrateTransfer = async (): Promise<void> => {
`Transaction included at blockHash ${status.asInBlock.toString()}`,
);
} else if (status.isFinalized) {
const blockNumber = results.blockNumber.toNumber();
const blockNumber = results.blockNumber?.toNumber();
const extrinsicIndex = results.txIndex;

console.log(
`Transaction finalized at blockHash ${status.asFinalized.toString()}`,
);
console.log(
`Explorer URL: ${getSygmaExplorerTransferUrl({ blockNumber, extrinsicIndex })}`,
);
if (blockNumber && extrinsicIndex) {
console.log(
`Transaction finalized at blockHash ${status.asFinalized.toString()}`,
);
console.log(
`Explorer URL: ${getSygmaExplorerTransferUrl({ blockNumber, extrinsicIndex })}`,
);
}
unsub();
process.exit(0);
}
Expand Down
17 changes: 17 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,23 @@ __metadata:
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"
dependencies:
"@buildwithsygma/core": "workspace:*"
"@buildwithsygma/substrate": "workspace:*"
"@polkadot/api": "npm:^12.3.1"
"@polkadot/keyring": "npm:^12.6.2"
"@polkadot/util-crypto": "npm:^12.6.2"
dotenv: "npm:^16.3.1"
eslint: "npm:8"
ts-node: "npm:10.9.1"
tsx: "npm:^4.15.4"
typescript: "npm:5.0.4"
languageName: unknown
linkType: soft

"@buildwithsygma/evm@workspace:^, @buildwithsygma/evm@workspace:packages/evm":
version: 0.0.0-use.local
resolution: "@buildwithsygma/evm@workspace:packages/evm"
Expand Down

0 comments on commit 1879447

Please sign in to comment.