import * as React from "react";
import * as System from "~/components/system";
import SystemPage from "~/components/system/SystemPage";
import ViewSourceLink from "~/components/system/ViewSourceLink";
import CodeBlock from "~/components/system/CodeBlock";
const EXAMPLE_CODE = `import * as React from 'react';
import { SendAddressFilecoin } from 'slate-react-system';
import { createPow } from "@textile/powergate-client";
const PowerGate = createPow({ host: "http://pow.slate.textile.io:6002" });
class Example extends React.Component {
componentDidMount = async () => {
const FFS = await PowerGate.ffs.create();
const token = FFS.token ? FFS.token : null;
PowerGate.setToken(token);
this.setState({ token });
}
_handleSend = async ({ source, target, amount }) => {
const response = await PowerGate.ffs.sendFil(
source,
target,
amount
);
}
render() {
return (
);
}
}
`;
export default class SystemPageSendAddressFilecoin extends React.Component {
_handleSubmit = ({ source, target, amount }) => {
alert(JSON.stringify({ source, target, amount }));
};
render() {
return (
Send an Address Filecoin{" "}
Here is an example of an experience for sending a filecoin address
filecoin using{" "}
Textile's Powergate
Code
{EXAMPLE_CODE}
);
}
}