Complex Components
Createmultisig

Create Multi-Signature Account

The "Create Multi-Signature" component allows users to establish a new Multi-Signature wallet.

Features

  • Generates a new Multi-Signature wallet.
  • Collects the (The Owner of the Multi-Signature wallets) agents address.
  • Sets the master key weight to 0. Voiding the Master key for the address.
  • Sets the agents key weight to 1, making the agent the only signer of the wallet with their choosen wallet address.
  • Provides a straightforward way of creating a multi-signature wallet and only needing one key to sign many wallets.

Configuration

  1. Install the Stellar SDK Version required for your project. We are using and recommend the latest Protocol 20 supported SDK.
  2. Open the CreateMultiSig.js file and update the FUNDING ACCOUNT SECRET KEY & AGENT OR OWNER/OPERATOR SECRET KEY variables with your information.
️🚫

IN PRODUCTION , YOU SHOULD NEVER HARDCODE YOUR SECRET KEYS IN YOUR CODE. USE ENVIRONMENT VARIABLES OR A SECURE VAULT.

Additional Resources

Each task is categorized into one of three thresholds: low, medium, or high, each assigned a numeric level between 0 and 255. This level dictates the required signature weight for authorizing the task. For further details, refer to Stellars documentation section on Operations and Transactions.

⚠️

Review the documentation on thresholds below, you can permanently lock yourself out of the account

C#

ℹ️

COMING SOON via NuGet Package Implementation v1.0.1

Javascript

We've provided simple HTML and JavaScript that can be used in your project as partial-components or be customized and integrated into your existing codebase.

Stellar CDN
*Current Version as of 2024-24-02*
<script src="https://cdnjs.cloudflare.com/ajax/libs/stellar-sdk/11.2.2/stellar-sdk.js"></script>
JavaScript
 
<script>
    document.getElementById('tokenForm').addEventListener('submit', function (event) {
        event.preventDefault();
 
    const tokenName = document.getElementById('tokenName').value;
    const tokenSymbol = document.getElementById('tokenSymbol').value;
    const tokenAmount = document.getElementById('tokenAmount').value;
    const issuingSecretKey = document.getElementById('issuingSecretKey').value;
    const recipientPublicKey = document.getElementById('recipientPublicKey').value;
 
    const server = new StellarSdk.Horizon.Server('https://horizon-testnet.stellar.org');
 
    const issuingKeys = StellarSdk.Keypair.fromSecret(issuingSecretKey);
 
    server.loadAccount(issuingKeys.publicKey())
                .then(account => {
                    const customAsset = new StellarSdk.Asset(tokenSymbol, issuingKeys.publicKey());
 
    const transaction = new StellarSdk.TransactionBuilder(account, {
        fee: StellarSdk.BASE_FEE,
    networkPassphrase: StellarSdk.Networks.TESTNET
                    })
    .addOperation(StellarSdk.Operation.payment({
        destination: recipientPublicKey,
    asset: customAsset,
    amount: tokenAmount
                        }))
    .setTimeout(30)
    .build();
 
    transaction.sign(issuingKeys);
 
    return server.submitTransaction(transaction);
                })
                .then(result => {
        console.log('Token creation successful:', result);
    document.getElementById('message').textContent = `Token "${tokenName} (${tokenSymbol})" created successfully with amount ${tokenAmount}.`;
                })
                .catch(error => {
        console.error('Error creating token:', error);
    document.getElementById('message').textContent = 'Failed to create token. Please try again.';
                });
        });
</script>
 
HTML
 
<div id="CreateMultiSig">
    <button id="createFundAndOperateButton">Create MultiSig</button>
</div>