Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/sync 20240912 #39

Open
wants to merge 176 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
176 commits
Select commit Hold shift + click to select a range
dbc3ba6
feat: implement ADR-036
HoangVD2 Apr 23, 2024
c6b4b97
fix: solana lib mobile errors
Apr 25, 2024
623740a
base: remove @xchain packages
HoangVD2 Apr 17, 2024
2a6316b
feat: add osmojs lib to cosmos chain (#206)
JamesNguyen5 May 8, 2024
a591cb5
feat: add base58 encoding to solana package (#242)
danilxdefi Jun 14, 2024
ab8a44d
Version packages
xdefi-bot Jun 14, 2024
bfae648
feat: move verifyAddress method to provider, make it static (#241)
danilxdefi Jun 14, 2024
6b17b72
Version packages
xdefi-bot Jun 14, 2024
d448ed8
feat: gasFeeOptions for chain and indexer should get data from rpc by…
sotatek-tyler-nguyen4 Jun 19, 2024
b009701
Version packages
xdefi-bot Jun 19, 2024
8e7838b
fix: Add the logic to fetch native token balance using multicall and …
sotatek-tyler-nguyen4 Jun 19, 2024
2cb014f
Version packages
xdefi-bot Jun 19, 2024
fe04445
feat: implement fee abstraction on osmosis chain (#204)
sotatek-tyler-nguyen4 Jun 19, 2024
d6fd8b2
Version packages
xdefi-bot Jun 19, 2024
9c61609
feat: XDEFI-7555 build size improvements (#214)
JamesNguyen5 Jun 21, 2024
90fcdde
Version packages
xdefi-bot Jun 21, 2024
62dc1a7
fix: swap and send nft transactions (#249)
danilxdefi Jun 25, 2024
d926fef
Version packages
xdefi-bot Jun 25, 2024
cd79974
chore: install size limit package to develop (#251)
sotatek-tyler-nguyen4 Jun 27, 2024
6ba175e
feat: XDEFI-8304 thorchain nodeurl (#247)
danilxdefi Jun 27, 2024
8581560
feat: thor msg deposit (#248)
liammcaweeney Jun 27, 2024
a37c2b2
Version packages
xdefi-bot Jun 27, 2024
c8af2ed
Chore/install size limit package (#252)
sotatek-tyler-nguyen4 Jun 28, 2024
89c09e8
feat: Split Chains Lib GQL package into binance lib (#230)
JamesNguyen5 Jun 28, 2024
a1137e9
Version packages
xdefi-bot Jun 28, 2024
985b161
chore: configuration size-limit to many packages (#254)
sotatek-tyler-nguyen4 Jun 28, 2024
77a91a7
fix: calculate fee rate to use for bitcoin dusting algorithm (#256)
sotatek-tyler-nguyen4 Jul 1, 2024
64a9266
Version packages
xdefi-bot Jul 1, 2024
e744b98
chore: change build turbo config (#257)
sotatek-tyler-nguyen4 Jul 2, 2024
187d02e
chore: add build size report to pull request (#255)
sotatek-tyler-nguyen4 Jul 3, 2024
0965808
feat: Tron Signers - signMessage, signMessageV2, sign, signTransactio…
JamesNguyen5 Jul 3, 2024
6117078
Version packages
xdefi-bot Jul 3, 2024
05e50b9
fix: dogecoin fee rate (#259)
sotatek-tyler-nguyen4 Jul 4, 2024
289c487
Version packages
xdefi-bot Jul 4, 2024
4e60095
feat: split graphql for evm chain lib (#261)
JamesNguyen5 Jul 4, 2024
ea1164a
Version packages
xdefi-bot Jul 4, 2024
d57e0f9
fix: if tx has data, threat as valid data and proceed (#262)
liammcaweeney Jul 4, 2024
1be5537
feat: add tests for real Network (XDEFI-8307) x tests for createMsg (…
HoangVD2 Jul 4, 2024
6307f1a
Version packages
xdefi-bot Jul 4, 2024
d7c806e
Fix/evm base fee per gas (#263)
liammcaweeney Jul 4, 2024
05241a2
Version packages
xdefi-bot Jul 4, 2024
ff622b7
test: add aproval test cases (#264)
sotatek-tyler-nguyen4 Jul 5, 2024
e9ddaac
perf: re-import osmojs in cosmos lib (#260)
JamesNguyen5 Jul 5, 2024
f362216
Version packages
xdefi-bot Jul 5, 2024
0c6e37c
bump: version (#265)
danilxdefi Jul 5, 2024
b74ba3a
Version packages
xdefi-bot Jul 5, 2024
098115c
fix: lint
davidp94 Jul 5, 2024
f7fb560
bump: version (#266)
liammcaweeney Jul 6, 2024
c7f18be
Version packages
xdefi-bot Jul 6, 2024
c74595f
fix: evm ledger signer (#268)
liammcaweeney Jul 7, 2024
f468210
Version packages
xdefi-bot Jul 7, 2024
8db7c10
feat: added bundle analysis on react app (#267)
liammcaweeney Jul 8, 2024
b038b95
Chore: add tsup config for all packages (skip node modules bundle) (#…
JamesNguyen5 Jul 11, 2024
7634777
Version packages
xdefi-bot Jul 11, 2024
73de4b6
feat: improve msg and provider (#274)
sotatek-tyler-nguyen4 Jul 15, 2024
70eee8c
feat: Implement estimateFee for Tron provider (XDEFI-9048) (#273)
HoangVD2 Jul 15, 2024
bdead5e
Version packages
xdefi-bot Jul 15, 2024
0a4b56e
chore: add default fee config for Cosmos chains (XDEFI-8966) (#275)
HoangVD2 Jul 16, 2024
fcf16fc
Version packages
xdefi-bot Jul 16, 2024
835e272
fix: revert tsup (#278)
JamesNguyen5 Jul 17, 2024
9837e38
Version packages
xdefi-bot Jul 17, 2024
9281ca2
fix: getBalance method indexer datasouce decimals for thorchain/mayac…
danilxdefi Jul 18, 2024
84a4c19
Version packages
xdefi-bot Jul 18, 2024
10c21e4
feat: Ordinals - allow to spend UTXOs without losing the Ordinals (#231)
sotatek-tyler-nguyen4 Jul 19, 2024
751ca98
Version packages
xdefi-bot Jul 19, 2024
87fcf74
feat: XDEFI-9177 add gnosis (#279)
danilxdefi Jul 19, 2024
d80bd38
Version packages
xdefi-bot Jul 19, 2024
117049c
chore: added default usage of fee service for evm estimateFees (#285)
liammcaweeney Jul 22, 2024
0e10f4f
Version packages
xdefi-bot Jul 22, 2024
a1f83c3
feat: add sign mode for cosmos chains (#288)
sotatek-tyler-nguyen4 Jul 26, 2024
e3e48b2
Version packages
xdefi-bot Jul 26, 2024
5599865
fix: getTransaction method for cosmos chains (#289)
danilxdefi Jul 26, 2024
10f9614
Version packages
xdefi-bot Jul 26, 2024
4772052
feat: update tron dataProviderUrl (#290)
danilxdefi Jul 26, 2024
03b9078
Version packages
xdefi-bot Jul 26, 2024
eb56876
feat: add sei chain (#283)
danilxdefi Jul 26, 2024
c26f2f7
Version packages
xdefi-bot Jul 26, 2024
beb7ca4
feat: add getThorChainID to get thor chain id dynamically (#287)
danilxdefi Jul 30, 2024
c669820
Version packages
xdefi-bot Jul 30, 2024
69068a2
feat: add sign raw transfer from sign doc (#291)
sotatek-tyler-nguyen4 Jul 30, 2024
fc06571
Version packages
xdefi-bot Jul 30, 2024
15dcdc9
chore: Add thor deposit example & update default value for the deposi…
sotatek-tyler-nguyen4 Jul 30, 2024
d5e380c
Version packages
xdefi-bot Jul 30, 2024
d0bd102
chore: use protobuf for osmo types (remove osmojs dependency) (#277)
JamesNguyen5 Jul 30, 2024
2d477cf
Version packages
xdefi-bot Jul 30, 2024
db9785b
@szymon/tsup node (#282)
liammcaweeney Jul 30, 2024
1710d12
Version packages
xdefi-bot Jul 30, 2024
4b345c9
fix: ordinals transfer tx not contain fee (#296)
sotatek-tyler-nguyen4 Aug 1, 2024
7231a9b
Version packages
xdefi-bot Aug 1, 2024
3f02695
feat: set no-cache for crypto asset and fetching balance queries (#294)
sotatek-tyler-nguyen4 Aug 2, 2024
3bae69a
Version packages
xdefi-bot Aug 2, 2024
b11f4f9
fix: nft query for smartchain and cronos EVM (#298)
danilxdefi Aug 2, 2024
37a30b2
Version packages
xdefi-bot Aug 2, 2024
ddc892e
Add sign method options and multiSign method (#302)
sotatek-tyler-nguyen4 Aug 7, 2024
619a2e2
Version packages
xdefi-bot Aug 7, 2024
8b8bef6
fix: error in fee estimation (#299)
sotatek-tyler-nguyen4 Aug 12, 2024
55326cf
Version packages
xdefi-bot Aug 12, 2024
accbafd
fix: error when fetching balance on cronos and mars chains (#303)
sotatek-tyler-nguyen4 Aug 12, 2024
c2951d9
Version packages
xdefi-bot Aug 12, 2024
5d83cfc
chore: fix rpcUrl for cronos evm (#306)
davidp94 Aug 12, 2024
093145a
fix: missing strong random number source warning from EVM package (#300)
sotatek-tyler-nguyen4 Aug 12, 2024
7471ede
chore: remove xDai(Gnosis) - unsupported chain (XDEFI-9524) (#305)
HoangVD2 Aug 12, 2024
29ef347
Version packages
xdefi-bot Aug 12, 2024
796b006
feat: add priceChange to getData function (XDEFI-9568) (#301)
HoangVD2 Aug 13, 2024
9dda4cd
Version packages
xdefi-bot Aug 13, 2024
6fa7ed7
chore: update fee estimation on tron (#312)
sotatek-tyler-nguyen4 Aug 14, 2024
5a40ee6
Version packages
xdefi-bot Aug 14, 2024
743cd06
chore: update ledger sign method to take prefix from manifest (#315)
loxator Aug 14, 2024
0f7e4cf
Version packages
xdefi-bot Aug 14, 2024
5d14c4b
chore: Move extra IBC logic into the chains-lib (#307)
sotatek-tyler-nguyen4 Aug 14, 2024
7c40db2
Version packages
xdefi-bot Aug 14, 2024
1a9ba1b
feat: add fallback for calculating fees; (#304)
danilxdefi Aug 15, 2024
792b683
Version packages
xdefi-bot Aug 15, 2024
0b029c0
chore: add example for request adr-36 signature & sign direct aux (#320)
sotatek-tyler-nguyen4 Aug 19, 2024
f4af022
Fix/swap pool manager (#319)
liammcaweeney Aug 20, 2024
fd4ad6b
Version packages
xdefi-bot Aug 20, 2024
53df094
feat: move from bip32/39 to scures bips (#325)
Amurmurmur Aug 22, 2024
54c5e62
Version packages
xdefi-bot Aug 22, 2024
da48d30
fix: send on solana for secondary token to new accounts (#324)
sotatek-tyler-nguyen4 Aug 23, 2024
e9726c7
Version packages
xdefi-bot Aug 23, 2024
c3df3eb
fix: trezor signing for EVM (#327)
loxator Aug 23, 2024
b7ab2ac
Version packages
xdefi-bot Aug 23, 2024
fc2e023
fix: remove 'm/' prefix from derivation in LedgerSigner for Tron and …
loxator Aug 23, 2024
10e736a
Version packages
xdefi-bot Aug 23, 2024
a1006c2
fix: sign to encode for dapps (#329)
liammcaweeney Aug 26, 2024
11b80d5
Version packages
xdefi-bot Aug 26, 2024
7c77721
fix: logic to handle getAccount errors (#336)
sotatek-tyler-nguyen4 Aug 27, 2024
2210e38
chore: Add documentation for afterBlock when using getBalance with RP…
sotatek-tyler-nguyen4 Aug 27, 2024
cbda4b5
Version packages
xdefi-bot Aug 27, 2024
f049ff0
chore: align fee estimation on ChainDatasource with IndexDatasource (…
sotatek-tyler-nguyen4 Aug 27, 2024
5996da0
fix: estimateFee for stargaze NFTs (#338)
sotatek-tyler-nguyen4 Aug 27, 2024
2e11dae
Version packages
xdefi-bot Aug 27, 2024
996a5a8
chore: align HW signers & SeedPhrase signer with the PK signer (#321)
sotatek-tyler-nguyen4 Aug 27, 2024
1a565c9
feat: fix typescript error (#297)
sotatek-tyler-nguyen4 Aug 27, 2024
0724b39
Version packages
xdefi-bot Aug 27, 2024
36ebf5f
feat: add logic to calculate gasPrice when not provided (#293)
sotatek-tyler-nguyen4 Aug 27, 2024
3961f03
Version packages
xdefi-bot Aug 27, 2024
a9cf42d
feat: update cosmos sign + estimateFee to automatically adapt inputs …
liammcaweeney Aug 28, 2024
715a9d6
Version packages
xdefi-bot Aug 28, 2024
fdce99f
Chore/cosmos/auto adapt ibc msg (#342)
liammcaweeney Aug 28, 2024
22a383d
Version packages
xdefi-bot Aug 28, 2024
d116988
fix: buildTx when maxPriorityFeePerGas is 0 (#343)
danilxdefi Aug 29, 2024
286237b
Version packages
xdefi-bot Aug 29, 2024
abe3492
fix: fee estimation for mayachain chain.datasource (#344)
danilxdefi Aug 29, 2024
0b2d64e
Version packages
xdefi-bot Aug 29, 2024
ae787ac
fix: asset.decimals field for indexer data-source (#346)
danilxdefi Aug 29, 2024
86586d7
Version packages
xdefi-bot Aug 29, 2024
76caa4a
feat: add xdefi-trace-id to debug gql issues (#345)
danilxdefi Aug 29, 2024
7195c48
Version packages
xdefi-bot Aug 29, 2024
929198d
fix: added MsgExecuteContract plus sanitiseMsg util (#349)
liammcaweeney Aug 30, 2024
25ae802
Version packages
xdefi-bot Aug 30, 2024
cdd6f8c
fix: add getAccountResource to base datasource to use it in FallbackD…
danilxdefi Sep 3, 2024
283f225
Version packages
xdefi-bot Sep 3, 2024
9e834a3
fix: return null for getFee method (#352)
danilxdefi Sep 3, 2024
2ce8200
Version packages
xdefi-bot Sep 3, 2024
439760a
feat: add dataSourceList to tron provider (#353)
danilxdefi Sep 3, 2024
0ada12e
Version packages
xdefi-bot Sep 3, 2024
27d8af3
Version packages (#354)
liammcaweeney Sep 3, 2024
49804bd
Version packages
xdefi-bot Sep 3, 2024
4856cfe
feat: add updated demo app (#356)
danilxdefi Sep 6, 2024
1f4349e
fix: update buildTx to avoid can't get EIP1559 gas fee error (#355)
danilxdefi Sep 6, 2024
dbe31d5
Version packages
xdefi-bot Sep 6, 2024
65d7382
chore: Pass preflight settings from params for Solana chain (#347)
sotatek-tyler-nguyen4 Sep 9, 2024
31382e3
Version packages
xdefi-bot Sep 9, 2024
cc2301b
fix: add memo to utxo chains using @scure/btc-signer (#360)
danilxdefi Sep 11, 2024
c3dca3e
Version packages
xdefi-bot Sep 11, 2024
4ad6b5b
feat: return balance of native token on custom cosmos chains (#357)
sotatek-tyler-nguyen4 Sep 11, 2024
fbf6474
Version packages
xdefi-bot Sep 11, 2024
844b942
fix: add maxPriorityFeePerGas default value to 1 gwei (#363)
danilxdefi Sep 11, 2024
c3b1e7c
Version packages
xdefi-bot Sep 11, 2024
3bdb466
fix: include missing dependencies to fix externals (#364)
janicduplessis Sep 11, 2024
6fdbb23
Version packages
xdefi-bot Sep 11, 2024
5819436
feat(thor): rename chain id after hard fork (#367)
davidp94 Sep 12, 2024
2281ac3
Version packages
xdefi-bot Sep 12, 2024
bed9209
chore: update yarn.lock
Sep 12, 2024
412bf3e
chore: remove changeset file
Sep 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
22 changes: 22 additions & 0 deletions .github/workflows/size-report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: 'size'

on:
pull_request:
branches:
- develop
jobs:
size:
runs-on: ubuntu-latest
env:
CI_JOB_NUMBER: 1

steps:
- uses: actions/checkout@v3
- name: Enable node
uses: actions/setup-node@v3
with:
node-version: 20.12.0
- uses: andresz1/[email protected]
with:
github_token: ${{ secrets.GIT_TOKEN }}
build_script: size-build
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ yarn-error.log*
.pnpm-debug.log*

# local env files
*.env
.env.local
.env.development.local
.env.test.local
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ npm install @xdefi-tech/chains
yarn add @xdefi-tech/chains
```

## Environment Setup

The `NETWORKED_QUERIES` environment variable is used to control the behavior of network requests in tests. By default, `NETWORKED_QUERIES` is set to `0`, which means that all network requests are mocked, allowing tests to run without actual network dependencies. This ensures that tests are faster, more reliable, and not affected by external factors such as network latency or availability of external services. Setting `NETWORKED_QUERIES` to `1` enables real network requests, allowing tests to interact with actual external services. This can be useful for integration tests where end-to-end verification of network interactions is required. To configure this setting, simply add `NETWORKED_QUERIES=0` or `NETWORKED_QUERIES=1` to your `.env` file as needed.

## Manifest

Each provider may have different manifests, but they share common fields. For more details, please refer to the README of the respective provider.
Expand Down
136 changes: 47 additions & 89 deletions examples/react/components/balances.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,43 +3,31 @@ import {
Box,
Typography,
Button,
Divider,
List,
ListItemAvatar,
ListItem,
ListItemText,
} from '@mui/material';
import { Coin, Chain } from '@xdefi-tech/chains-core';
import { isEmpty } from 'lodash';
import HowToContainer from './containers/how-to.container';

export interface IBalancesComponent {
provider: Chain.Provider;
address: string;
tokenList: string[];
children?: React.ReactNode;
}

const BalancesComponent = (props: IBalancesComponent) => {
const [balances, setBalances] = useState<Coin[]>([]);
const [balanceError, setBalanceError] = useState<null | string>(null);
const [balanceLoader, setBalanceLoader] = useState<boolean>(false);
const [subscription, setSubscription] = useState(null);
const [lastUpdate, setLastUpdate] = useState<Date | null>(null);
useEffect(() => {
handleUnsubscribe();
}, [props.address, props.provider, props.tokenList]);

useEffect(() => {
setBalanceError(null);
}, [props.address]);

const handleUnsubscribe = useCallback(() => {
if (subscription) {
subscription.unsubscribe();
setSubscription(null);
}
setBalanceError(null);
}, [subscription]);

const handleBalanceClick = useCallback(async () => {
try {
setBalanceLoader(true);
Expand All @@ -63,32 +51,9 @@ const BalancesComponent = (props: IBalancesComponent) => {
}
}, [props.address, props.provider, props.tokenList]);

const handleStreamingClick = useCallback(async () => {
try {
if (subscription) {
handleUnsubscribe();
return;
}
if (isEmpty(balances)) {
await handleBalanceClick();
}
const balanceResponse = await props.provider.getBalance(props.address);
const balanceObserver = await balanceResponse.getObserver();
setSubscription(
balanceObserver.subscribe((data) => {
// todo create and update subs list
console.log('subscription data', data);
})
);
} catch (err) {
setBalanceError(err.message);
setSubscription(null);
}
}, [balances, subscription, props.address, props.provider]);

return (
<Box>
<Typography variant="h4">Balances</Typography>
<Typography variant="h6">Balances</Typography>

<Box>
<Button
Expand All @@ -97,63 +62,56 @@ const BalancesComponent = (props: IBalancesComponent) => {
>
Set Balances
</Button>
<Button
onClick={handleStreamingClick}
disabled={balanceLoader || Boolean(balanceError)}
>
{subscription ? 'Disable' : 'Enable'} Stream
</Button>
</Box>

{balanceError && <Typography color="red">{balanceError}</Typography>}

{lastUpdate && (
<Typography color="gray">
{lastUpdate.toDateString()} {lastUpdate.toTimeString()}
</Typography>
)}
{balances.length > 0 && (
<>
{lastUpdate && (
<Typography color="gray">
{lastUpdate.toDateString()} {lastUpdate.toTimeString()}
</Typography>
)}

<List
component="div"
sx={{
width: '100%',
bgcolor: 'background.paper',
maxHeight: 500,
overflow: 'auto',
}}
>
{balances.map((coin: Coin) => {
const priceInUsd = coin.asset.price
? `${coin.amount.multipliedBy(coin.asset.price).toFixed(2)}$`
: 'N/A';
return (
<ListItem button key={coin.asset.id || coin.asset.symbol}>
<ListItemAvatar>
<img
width="30"
height="30"
src={coin.asset.icon}
alt={coin.asset.symbol}
/>
</ListItemAvatar>
<Typography>{coin.asset.symbol}</Typography>
<ListItemText
primary={coin.amount.toFixed(8)}
secondary={priceInUsd}
sx={{ textAlign: 'end' }}
/>
</ListItem>
);
})}
</List>
<List
component="div"
sx={{
width: '100%',
bgcolor: 'background.paper',
maxHeight: 500,
overflow: 'auto',
marginBottom: '1em',
}}
>
{balances.map((coin: Coin) => {
const priceInUsd = coin.asset.price
? `${coin.amount.multipliedBy(coin.asset.price).toFixed(2)}$`
: 'N/A';
return (
<ListItem button key={coin.asset.id || coin.asset.symbol}>
<ListItemAvatar>
<img
width="30"
height="30"
src={coin.asset.icon}
alt={coin.asset.symbol}
/>
</ListItemAvatar>
<Typography>{coin.asset.symbol}</Typography>
<ListItemText
primary={coin.amount.toFixed(8)}
secondary={priceInUsd}
sx={{ textAlign: 'end' }}
/>
</ListItem>
);
})}
</List>
</>
)}

<Divider
sx={{
borderWidth: 3,
my: 3,
borderRadius: 10,
}}
/>
<HowToContainer title="get balances?">{props.children}</HowToContainer>
</Box>
);
};
Expand Down
92 changes: 92 additions & 0 deletions examples/react/components/chains/binance/provider.container.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
import React from 'react';
import { Box, FormControl, OutlinedInput, InputLabel } from '@mui/material';

import { ChainsContext } from '../../../context/chains.context';
import BalancesComponent from '../../balances.component';
import TransactionsComponent from '../../transactions.component';

import { registry } from '../../../constants/registry';
import TransferComponent from './transfer.component';

export interface IProviderContainer {
seedPhrase: string;
providerId: string;
}

const BinanceProviderContainer = (props: IProviderContainer) => {
const chains = React.useContext(ChainsContext);
const provider = React.useMemo(() => {
return chains.getProviderById(props.providerId);
}, []);
const signer = React.useMemo(() => {
return new (provider.getSigners()[0])(props.seedPhrase);
}, [provider]);
const registryManifest = React.useMemo(() => {
const item = registry.find((item) => item.id === props.providerId);
if (!item) {
console.log('Provider not found', props.providerId);
}
return item;
}, []);

const [address, setAddress] = React.useState<string>('');
React.useEffect(() => {
const getAddress = async () => {
setAddress(
await signer.getAddress(
registryManifest.derivation[0].path,
provider.manifest.prefix
)
);
};
getAddress();
}, []);

const handleAddressChange = React.useCallback(
(event: React.ChangeEvent<HTMLInputElement>) => {
setAddress(event.target.value);
},
[]
);

return (
<Box>
<FormControl sx={{ mb: 2 }} fullWidth variant="outlined">
<InputLabel htmlFor="balance-address">Address</InputLabel>
<OutlinedInput
id="balance-address"
value={address}
onChange={handleAddressChange}
label="Seed phrase"
/>
</FormControl>

<BalancesComponent provider={provider} address={address} tokenList={[]}>
{`const provider = new BinanceProvider(
new BinanceProvider.dataSourceList.IndexerDataSource(BINANCE_MANIFEST)
);
const balanceResponse = await provider.getBalance('${address}');
const balanceData = await balanceResponse.getData();
console.log(balanceData);`}
</BalancesComponent>

<TransactionsComponent provider={provider} address={address}>
{`const provider = new BinanceProvider(
new BinanceProvider.dataSourceList.IndexerDataSource(BINANCE_MANIFEST)
);
const transactionsResponse = await provider.getTransactions('${address}');
const transactionsData = await transactionsResponse.getData();
console.log(transactionsData);`}
</TransactionsComponent>

<TransferComponent
provider={provider}
address={address}
signer={signer}
derivation={registryManifest.derivation[0].path}
/>
</Box>
);
};

export default BinanceProviderContainer;
Loading
Loading