Props

identifier of the Telepath channel. If omitted a new random channel id will be created.

channelKey

a symmetric key of the Telepath channel. If omitted a new random key will be created.

appName

the name of the app. Cogito app shows the appName when requesting user signature.

onTelepathChanged

function to be called when the telepath channel has been updated. Provides an object { channelId, channelKey, appName } as an argument.

render

render prop - a function that will be called every time the component is updated. It provides { web3, channel, contracts } as an argument, where web3 is an instance of Web3 that uses CogitoProvider, channel is an instance of Telepath, and contracts is an object holding the references to either deployed contracts or the raw proxies (see Working with Contracts below). If this prop is present, it will take precedence over the childrens.

Working with Contracts

Developers working with Ethereum contract often use a convenience package truffle-contract.
To get an instance of a contract you first import truffle-contract. What you will get from importing truffle-contract is a function that takes a contract definition as an argument and returns a proxy object that you can use to interact with your contract. Before you can do that, however, you still need to set the provider on the returned proxy object:

To get the actual instance of the contract, you can either request the deployed version that will
return an instance of the contract deployed at the default address managed by the contract itself, or
a raw version for which you can request an instance of the contract at a specific address. The
deployed contracts are often used as a facade that represents a fixed entry point to some more
complex functionality. When you call methods of the deployed contracts, they often emit events
carrying addresses of other contract instances created as a result of the method invocation. In order to
get a grip on those contract instances, you need to be able to call the at method of the contract
proxy object.

The raw representation is therefore more versatile, because you can either request a deployed
version by calling deployed() method on the proxy object, or you can call at(address) to get
an instance at a given address.

You can choose which contracts you would like to have returned as deployed contracts and which ones as raw contracts. Here is an example: