With wallet.transfer
you can initiate a transaction to transfer an asset from your wallet to a target address.
// setup a provider and two test wallets
const provider = new Provider('http://127.0.0.1:4000/graphql');
const sender = await generateTestWallet(provider, [[100, NativeAssetId]]);
const receiver = await generateTestWallet(provider);
// transfer 1 unit of the base asset
const response = await sender.transfer(receiver.address, 1, NativeAssetId);
await response.wait();
// retrieve balances of both wallets
const senderBalances = await sender.getBalances();
const receiverBalances = await receiver.getBalances();
// validate new balances
expect(senderBalances).toEqual([{ assetId: NativeAssetId, amount: bn(99) }]);
expect(receiverBalances).toEqual([{ assetId: NativeAssetId, amount: bn(1) }]);