Skip to content

Commit 9cfc047

Browse files
chore(frontend): support updated nonce (#671)
1 parent c3b6e66 commit 9cfc047

File tree

4 files changed

+20
-8
lines changed

4 files changed

+20
-8
lines changed

js/frontend/src/features/history/graphql/graphql.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -864,6 +864,8 @@ export type Transfer = Node & {
864864
completedAtTxHash: Maybe<Scalars['String']['output']>;
865865
destNetwork: NetworkEnum;
866866
destination: Scalars['String']['output'];
867+
ethBridgeBuiltInMsgHash: Maybe<Scalars['String']['output']>;
868+
ethBridgeBuiltInQueueId: Maybe<Scalars['BigInt']['output']>;
867869
id: Scalars['String']['output'];
868870
/** A globally unique identifier. Can be used in various places throughout the system to identify this single value. */
869871
nodeId: Scalars['ID']['output'];
@@ -900,6 +902,10 @@ export type TransferCondition = {
900902
destNetwork: InputMaybe<NetworkEnum>;
901903
/** Checks for equality with the object’s `destination` field. */
902904
destination: InputMaybe<Scalars['String']['input']>;
905+
/** Checks for equality with the object’s `ethBridgeBuiltInMsgHash` field. */
906+
ethBridgeBuiltInMsgHash: InputMaybe<Scalars['String']['input']>;
907+
/** Checks for equality with the object’s `ethBridgeBuiltInQueueId` field. */
908+
ethBridgeBuiltInQueueId: InputMaybe<Scalars['BigInt']['input']>;
903909
/** Checks for equality with the object’s `id` field. */
904910
id: InputMaybe<Scalars['String']['input']>;
905911
/** Checks for equality with the object’s `nonce` field. */
@@ -942,6 +948,10 @@ export type TransferFilter = {
942948
destNetwork: InputMaybe<NetworkEnumFilter>;
943949
/** Filter by the object’s `destination` field. */
944950
destination: InputMaybe<StringFilter>;
951+
/** Filter by the object’s `ethBridgeBuiltInMsgHash` field. */
952+
ethBridgeBuiltInMsgHash: InputMaybe<StringFilter>;
953+
/** Filter by the object’s `ethBridgeBuiltInQueueId` field. */
954+
ethBridgeBuiltInQueueId: InputMaybe<BigIntFilter>;
945955
/** Filter by the object’s `id` field. */
946956
id: InputMaybe<StringFilter>;
947957
/** Filter by the object’s `nonce` field. */
@@ -1008,6 +1018,10 @@ export enum TransfersOrderBy {
10081018
DestinationDesc = 'DESTINATION_DESC',
10091019
DestNetworkAsc = 'DEST_NETWORK_ASC',
10101020
DestNetworkDesc = 'DEST_NETWORK_DESC',
1021+
EthBridgeBuiltInMsgHashAsc = 'ETH_BRIDGE_BUILT_IN_MSG_HASH_ASC',
1022+
EthBridgeBuiltInMsgHashDesc = 'ETH_BRIDGE_BUILT_IN_MSG_HASH_DESC',
1023+
EthBridgeBuiltInQueueIdAsc = 'ETH_BRIDGE_BUILT_IN_QUEUE_ID_ASC',
1024+
EthBridgeBuiltInQueueIdDesc = 'ETH_BRIDGE_BUILT_IN_QUEUE_ID_DESC',
10111025
IdAsc = 'ID_ASC',
10121026
IdDesc = 'ID_DESC',
10131027
Natural = 'NATURAL',

js/frontend/src/features/swap/components/relay-tx-button/relay-tx-button.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { getErrorMessage, isUndefined, logger } from '@/utils';
1111
import { useIsEthRelayAvailable, useIsVaraRelayAvailable, useRelayEthTx, useRelayVaraTx } from '../../hooks';
1212

1313
type VaraProps = {
14-
nonce: HexString;
14+
nonce: bigint;
1515
blockNumber: string;
1616
onReceipt: () => void;
1717
onConfirmation: () => void;

js/frontend/src/features/swap/hooks/vara/use-relay-vara-tx.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { HexString } from '@gear-js/api';
21
import { relayVaraToEth } from '@gear-js/bridge';
32
import { useMutation } from '@tanstack/react-query';
43
import { useConfig, usePublicClient, useWalletClient } from 'wagmi';
@@ -16,7 +15,7 @@ type Params = {
1615
onError: (error: Error) => void;
1716
};
1817

19-
function useRelayVaraTx(nonce: HexString, blockNumber: bigint) {
18+
function useRelayVaraTx(nonce: bigint, blockNumber: bigint) {
2019
const publicClient = usePublicClient();
2120
const { data: walletClient } = useWalletClient();
2221
const config = useConfig();

js/frontend/src/pages/transaction/transaction.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@ function Transaction() {
117117
const formattedReceiverAddress = isVaraNetwork ? receiver : getVaraAddress(receiver);
118118

119119
const isAwaitingPayment = status === StatusEnum.AwaitingPayment;
120-
const rawNonce = isVaraNetwork ? `0x${nonce.padStart(64, '0')}` : nonce;
121120

122121
return (
123122
<Container className={styles.container}>
@@ -135,13 +134,13 @@ function Transaction() {
135134
<div className={styles.sidebar}>
136135
<div className={styles.buttons}>
137136
{isVaraNetwork && (
138-
<PayVaraFeeButton nonce={rawNonce} onInBlock={optimisticTxUpdate} onFinalization={refetch} />
137+
<PayVaraFeeButton nonce={nonce} onInBlock={optimisticTxUpdate} onFinalization={refetch} />
139138
)}
140139

141140
{isVaraNetwork ? (
142141
bridgingStartedAtBlock && (
143142
<RelayTxButton.Vara
144-
nonce={rawNonce as HexString}
143+
nonce={BigInt(nonce)}
145144
blockNumber={bridgingStartedAtBlock}
146145
onReceipt={optimisticTxUpdate}
147146
onConfirmation={refetch}
@@ -251,8 +250,8 @@ function Transaction() {
251250
</Field>
252251

253252
<Field label="Transaction Nonce">
254-
<Address value={rawNonce} />
255-
<CopyButton value={rawNonce} message="Transaction nonce copied to clipboard" />
253+
<Address value={nonce} />
254+
<CopyButton value={nonce} message="Transaction nonce copied to clipboard" />
256255
</Field>
257256

258257
<Field label="Block Number">

0 commit comments

Comments
 (0)