ropsten
Etherspot SDK for our user walletropsten
Etherspot SDK for the Payment Hub on this networksokol
Etherspot SDK for our user walletsokol
Etherspot SDK for the Payment Hub on this networkropsten
and sokol
versions of the SDK. Remember to use the same private key or authentication for both SDK instances to get the same Ethereum address on both Ropsten Testnet and Sokol Testnet.erc-20-abi
package will provide us with the ERC20 token interface to interact with.abi
from the erc-20-abi
package.Ropsten
network to the Sokol
network. To achieve this, we're going to send ETH from our user wallet to the Ropsten
Payment Hub (which itself is an instance of the Etherspot SDK), and the Sokol
Payment Hub (which, again, is another instance of the Etherspot SDK) will send the transferred amount back to the user's wallet on the Sokol
network.p2pDepositAddress
from the Payment Hub Etherspot SDKs. We can get this address as follows:p2pDepositAddress
exists purely to provide liquidity for other operations. Your address
is unaffected.p2pDepositAddress
.p2pDepositAddress
in the ropstenEtherspotPaymentHub
instance, we need to perform the same set of operations for the Sokol
Payment Hub Etherspot SDK.p2pDepositAddress
.p2pDepositAddress
from Sokol
and Ropsten
are funded with Test ETH from their respective faucets and ERC20 tokens from minting/deploying, we're ready to move on.p2pDepositAddress
, the next step is to update the Payment Hubs with the amount of liquidity we wish to provide from our respective p2pDepositAddress
.p2pDepositAddress
has received enough erc20 tokens before adding liquidity using the code above.Sokol
Payment Hub bridged with the Ropsten
network name and you're ready to move on to the next step.Ropsten
user wallet, we first need to transfer the amount of ETH that we want to exchange to ETH on Sokol
to our Ropsten
user wallet's p2pDepositAddress
. We will do this in the normal way that we usually send Transactions.Ropsten
Etherspot SDK Transaction Batch queue. We're keeping the house clean updatePaymentHubDeposit
method on our users Ropsten
Etherspot SDK with the reference to the Ropsten
Payment Hub, and the amount we wish to make available from our p2pDepositAddress
to the Ropsten
Payment HubtransferPaymentHubDeposit
method on our users Ropsten
Etherspot SDK, which will instruct the Payment Hub to move the funds from one Payment Hub to the destination Payment Hub.Sokol
. We're now ready to withdraw the funds on the destination Payment Hub on Sokol
.exchangeAmount
from the destination Sokol Payment Hub, we need to perform a few final steps. Sokol
Payment Hub Etherspot SDK and the Sokol
User Etherspot SDK.updatePaymentHubDeposit
method on the Sokol
Etherspot User's SDK instance.Sokol
Payment Hub. We'll first retrieve a list of uncommitted Payment Hub transaction items.getP2PPaymentChannels
method call.paymentHubChannel.state
is "Opened"
sokolEtherspotUser.state.accountAddress
and the paymentHubChannel.recipient
are the sameexchangeAmount
to the final destination address.getP2PPaymentChannels
on the Etherspot SDK.getP2PPaymentChannels
method call.paymentHubChannel.state
is "Signed"
ropstenEtherspotUser.state.accountAddress
and the paymentHubChannel.recipient
are the samep2pDepositAddress
to sender's Payment Hub p2pDepositAddress
.