Create a Filecoin Address View Source



Here is an example of an experience for generating a filecoin address using Textile's Powergate


Address name
Address type



Code



0
import * as React from "react";
1
import { CreateFilecoinAddress } 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
    this.setState({ token });
12
  };
13
14
  _handleCreateAddress = async ({ name, type, makeDefault }) => {
15
    const response = await PowerGate.ffs.newAddr(name, type, makeDefault);
16
    console.log(response);
17
  };
18
19
  render() {
20
    return <CreateFilecoinAddress onSubmit={this._handleCreateAddress} />;
21
  }
22
}
23
ExperiencesCreateFilecoinAddressCreateFilecoinStorageDealCreateTokenFilecoinBalancesListFilecoinDealsListFilecoinSettingsFriendsListPeersListSendAddressFilecoin

Components
Avatar GroupButtonsCard TabsCarouselCheckboxesColorsDatepickerDropdownsGlobeHover TileIconsInputsLine ChartList EditorLoadersModalsNotificationsRadiosSlidersStatsTablesTabsTogglesTooltipsTypography
View source