Filecoin Wallet Balances View Source



Here is an example of an experience for getting Filecoin Wallet Balances from Textile's Powergate.


AddressNameTypeAddress
t3ual5q5qo5wolfxsui4ciujfucqwf6gqso4lettcjwl2tyismgol7c4tngvoono5rmytuqotye7oosfjv6g7a
Wallet A
bls
40 FIL
t1n7sjmxtxkhwkmk25ly6hk6xfmvi6sjx5v27wliq
Wallet B
secp256k1
5,000 FIL



Code



0
import * as React from "react";
1
import { FilecoinBalancesList } from "slate-react-system";
2
import { createPow } from "@textile/powergate-client";
3
4
const PowerGate = createPow({ host: "https://grpcweb.slate.textile.io" });
5
6
class Example extends React.Component {
7
  componentDidMount = async () => {
8
    const FFS = await PowerGate.ffs.create();
9
    const token = FFS.token ? FFS.token : null;
10
    PowerGate.setToken(token);
11
    const { info } = await PowerGate.ffs.info();
12
    this.setState({ token, balancesList: info.balancesList });
13
  };
14
15
  render() {
16
    return <FilecoinBalancesList data={this.state.balancesList} />;
17
  }
18
}
19
ExperiencesCreateFilecoinAddressCreateFilecoinStorageDealCreateTokenFilecoinBalancesListFilecoinDealsListFilecoinSettingsFriendsListPeersListSendAddressFilecoin

Components
Avatar GroupButtonsCard TabsCarouselCheckboxesColorsDatepickerDropdownsGlobeHover TileIconsInputsLine ChartList EditorLoadersModalsNotificationsRadiosSlidersStatsTablesTabsTogglesTooltipsTypography
View source