Skip to content

Commit

Permalink
Merge pull request #174 from multiversx/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
arhtudormorar authored Mar 13, 2024
2 parents 8bca128 + e499c04 commit 99c73bf
Show file tree
Hide file tree
Showing 56 changed files with 1,895 additions and 1,438 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy-devnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: '16.x'
node-version: '18.x'
- name: Setup yarn
run: npm install -g yarn
- run: yarn install
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: '16.x'
node-version: '18.x'
- name: Setup yarn
run: npm install -g yarn
- run: yarn install
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy-mainnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: '16.x'
node-version: '18.x'
- name: Setup yarn
run: npm install -g yarn
- run: yarn install
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy-testnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: '16.x'
node-version: '18.x'
- name: Setup yarn
run: npm install -g yarn
- run: yarn install
Expand Down
7 changes: 0 additions & 7 deletions cypress/constants/enums.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,3 @@ export const enum GlobalDataEnum {
confirmedToast = 'transactions successful',
cancelToast = 'Transaction canceled'
}

export const enum GlobalSelectorsEnum {
connect = 'Connect',
signAutoSend = 'sign-auto-send',
sendTransactions = 'send-transactions',
swapLock = 'swap-lock'
}
2 changes: 1 addition & 1 deletion cypress/support/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Cypress.Commands.add('login', (walletID, selector) => {
}
cy.getSelector(GlobalSelectorsEnum.keystoreBtn).click();
cy.checkUrl(RoutesEnum.keystoreRoute);
cy.getSelector(GlobalSelectorsEnum.submitButton)).click();
cy.getSelector(GlobalSelectorsEnum.submitButton).click();

cy.get('input[type=file]').selectFile('./cypress/assets/testKeystore.json', {
force: true
Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
"license": "GPL-3.0-or-later",
"repository": "@multiversx/mx-template-dapp",
"dependencies": {
"@fortawesome/fontawesome-svg-core": "6.4.0",
"@fortawesome/free-solid-svg-icons": "6.4.0",
"@fortawesome/fontawesome-svg-core": "6.5.1",
"@fortawesome/free-solid-svg-icons": "6.5.1",
"@fortawesome/react-fontawesome": "0.2.0",
"@multiversx/sdk-core": "12.16.0",
"@multiversx/sdk-dapp": "2.25.2",
"@multiversx/sdk-network-providers": "2.2.0",
"axios": "1.6.2",
"@multiversx/sdk-core": "13.0.0-beta.4",
"@multiversx/sdk-dapp": "2.29.0-beta.3",
"@multiversx/sdk-network-providers": "2.2.1",
"axios": "1.6.5",
"classnames": "2.3.2",
"moment": "2.29.4",
"react": "18.2.0",
Expand Down
4 changes: 3 additions & 1 deletion src/components/Card/Card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,17 @@ interface CardType extends PropsWithChildren, WithClassnameType {
title: string;
description?: string;
reference: string;
anchor?: string;
}

export const Card = (props: CardType) => {
const { title, children, description, reference } = props;
const { title, children, description, reference, anchor } = props;

return (
<div
className='flex flex-col flex-1 rounded-xl bg-white p-6 justify-center'
data-testid={props['data-testid']}
id={anchor}
>
<h2 className='flex text-xl font-medium group'>
{title}
Expand Down
18 changes: 18 additions & 0 deletions src/config/sharedConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,21 @@ export const walletConnectV2ProjectId = '9b1a9564f91cb659ffe21b73d5c4e2d8';
export const apiTimeout = 6000;
export const transactionSize = 10;
export const nativeAuth = true;
export const BATCH_TRANSACTIONS_SC = {
egld_wEGLD: {
contract: 'erd1qqqqqqqqqqqqqpgqpv09kfzry5y4sj05udcngesat07umyj70n4sa2c0rp',
data: 'wrapEgld'
},
wEGLD_USDC: {
contract: 'erd1qqqqqqqqqqqqqpgqtqfhy99su9xzjjrq59kpzpp25udtc9eq0n4sr90ax6',
data: 'ESDTTransfer@5745474C442D613238633539@06f05b59d3b20000@73776170546f6b656e734669786564496e707574@555344432D333530633465@01'
},
wEGLD_MEX: {
contract: 'erd1qqqqqqqqqqqqqpgqzw0d0tj25qme9e4ukverjjjqle6xamay0n4s5r0v9g',
data: 'ESDTTransfer@5745474C442D613238633539@06f05b59d3b20000@73776170546f6b656e734669786564496e707574@4D45582D613635396430@01'
},
lock_MEX: {
contract: 'erd1qqqqqqqqqqqqqpgq2l97gw2j4wnlem4y2rx7dudqlssjtwpu0n4sd0u3w2',
data: 'ESDTTransfer@4D45582D613635396430@0de0b6b3a7640000@6c6f636b546f6b656e73@05a0'
}
};
1 change: 1 addition & 0 deletions src/helpers/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export * from './sdkDappHelpers';
export * from './pingPong';
export * from './signAndSendTransactions';
1 change: 1 addition & 0 deletions src/helpers/sdkDappHelpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ export { refreshAccount } from '@multiversx/sdk-dapp/utils/account/refreshAccoun
export { logout } from '@multiversx/sdk-dapp/utils/logout';
export { signTransactions } from '@multiversx/sdk-dapp/services/transactions/signTransactions';
export { trimUsernameDomain } from '@multiversx/sdk-dapp/hooks/account/helpers';
export { newTransaction } from '@multiversx/sdk-dapp/models';
26 changes: 26 additions & 0 deletions src/helpers/signAndSendTransactions.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { Transaction, TransactionsDisplayInfoType } from 'types';

import { refreshAccount, sendTransactions } from './sdkDappHelpers';

type SignAndSendTransactionsProps = {
transactions: Transaction[];
callbackRoute: string;
transactionsDisplayInfo: TransactionsDisplayInfoType;
};

export const signAndSendTransactions = async ({
transactions,
callbackRoute,
transactionsDisplayInfo
}: SignAndSendTransactionsProps) => {
await refreshAccount();

const { sessionId } = await sendTransactions({
transactions,
transactionsDisplayInfo,
redirectAfterSign: false,
callbackRoute
});

return sessionId;
};
2 changes: 2 additions & 0 deletions src/hooks/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
export * from './sdkDappHooks';
export * from './withPageTitle';
export * from './transactions';
export * from './useScrollToElement';
export * from './useIsWebProvider';
1 change: 1 addition & 0 deletions src/hooks/sdkDappHooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ export { useCheckBatch } from '@multiversx/sdk-dapp/hooks/transactions/batch/tra
export { useSignTransactions } from '@multiversx/sdk-dapp/hooks/transactions/useSignTransactions';
export { useBatchTransactionsTracker } from '@multiversx/sdk-dapp/hooks/transactions/batch/tracker/useBatchTransactionsTracker';
export { useGetSignedTransactions } from '@multiversx/sdk-dapp/hooks/transactions/useGetSignedTransactions';
export { useGetAccountProvider } from '@multiversx/sdk-dapp/hooks/account/useGetAccountProvider';
Loading

0 comments on commit 99c73bf

Please sign in to comment.