# 7.4 Invite a Member

Now that you have purchased a bronze membership you can invite a previously unlisted address provided by direct person to person exchange to the network.

As a Bronze member there is a reward value given to you, if someone you invite buys upgrades to a metal membership. The reward is based on your metal membership type and the membership that any user you have accredited buys.

Invitee / Invited Bronze Silver Gold Black
Bronze 1.25 25 375 5'000

If an address has already been used in the netwok the invitation action is invalid.

You need to obtain this address by direct exchange from the invitee.

Here's how to perform the invitaion.

# Use cases

Sends a new transaction in order to invite the given userDid.

# Tools

The Bitcoin BIP39 Mnemonic code for generating deterministic keys.

The Sacco library, our own open source tool to sign and send transactions to any Cosmos SDK based blockchain, including Commercio.network.

The Commercio SDK, our own open source tool to format transactions to Commercio.network

# Functions and APIs

  • Wallet derive;
  • MembershipHelper inviteUser.

# Step by step sequence

  1. Generate a new mnemonic using bip39;
  2. Set up the network;
  3. Call the wallet derive function;
  4. Finally, execute the MembershipHelper inviteUser to invite a member.

# Code Examples

Here's an example of the implemetation in all the available languages.

# Dart

final newUserMnemonic = bip39.generateMnemonic(strength: 256).split(' ');
final networkInfo = NetworkInfo(
  bech32Hrp: 'did:com:',
  lcdUrl: 'http://localhost:1317',
);
final newUserWallet = Wallet.derive(newUserMnemonic, networkInfo);

final response = await MembershipHelper.inviteUser(
  newUserWallet.bech32Address,
  wallet
);
1
2
3
4
5
6
7
8
9
10
11

# Kotlin

val networkInfo = NetworkInfo(
  bech32Hrp = "did:com:",
  lcdUrl = "http://localhost:1317"
)

val newUserMnemonic = generateMnemonic(strength = 256, wordList = WORDLIST_ENGLISH).split(" ")

val newUserWallet = Wallet.derive(newUserMnemonic, networkInfo)
val fee = StdFee(gas = "200000", amount = listOf(StdCoin(denom = "ucommercio", amount = "10000")))
val response = MembershipHelper.inviteUser(
  user = Did(newUserWallet.bech32Address),
  wallet = wallet,
  fee = fee
)
1
2
3
4
5
6
7
8
9
10
11
12
13
14