logo
back
back
Назад

Наборы для разработки программного обеспечения Waves (Waves SDKs)

Выберите разумный путь для разработки

  • < Все функции блокчейна />
  • < Привычный язык программирования />
  • < Примеры />
ГотовыеГотовыеГотовые

Примеры

Мы всегда создаем и поддерживаем актуальные готовые примеры. Просто вставьте их в свой код и используйте его, работая с Waves

  • Issue your own asset
  • Create NFT
  • Create new address
  • Reissue transaction
  • Burn token

Добавьте библиотеку в ваше приложение

Java
Копировать
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
package com.wavesplatform.examples;
import com.wavesplatform.transactions.account.PrivateKey;
import com.wavesplatform.transactions.IssueTransaction;
import com.wavesplatform.wavesj.Node;
import com.wavesplatform.wavesj.Profile;
import com.wavesplatform.wavesj.exceptions.NodeException;
import com.wavesplatform.wavesj.info.IssueTransactionInfo;
import java.io.IOException;

public class WavesExample {
    public static void main(String[] args) throws NodeException, IOException {
        // create a node instance
        Node node = new Node(Profile.TESTNET);
        // create private key from seed
        PrivateKey privateKey = PrivateKey.fromSeed("seed phrase");
        // create IssueTransaction
        IssueTransaction tx = new IssueTransaction(
            privateKey.publicKey(),
            "asset",
            "description",
            1000,
            2,
            false,
            null)
            .addProof(privateKey);
        // publish the transaction and wait for it to be included in the blockchain
        node.waitForTransaction(node.broadcast(tx).id());
        // get transaction info from node
        IssueTransactionInfo txInfo = node.getTransactionInfo(tx.id(), IssueTransactionInfo.class);
        // print all information
        System.out.println("type:" + txInfo.tx().type());
        System.out.println("id:" + txInfo.tx().id());
        System.out.println("fee:" + txInfo.tx().fee().value());
        System.out.println("feeAssetId:" + txInfo.tx().fee().assetId().encoded());
        System.out.println("timestamp:" + txInfo.tx().timestamp());
        System.out.println("version:" + txInfo.tx().version());
        System.out.println("chainId:" + txInfo.tx().chainId());
        System.out.println("sender:" + txInfo.tx().sender().address().encoded());
        System.out.println("senderPublicKey:" + txInfo.tx().sender().encoded());
        System.out.println("proofs:" + txInfo.tx().proofs());
        System.out.println("assetId:" + txInfo.tx().assetId().encoded());
        System.out.println("name:" + txInfo.tx().name());
        System.out.println("quantity:" + txInfo.tx().quantity());
        System.out.println("reissuable:" + txInfo.tx().reissuable());
        System.out.println("decimals:" + txInfo.tx().decimals());
        System.out.println("description:" + txInfo.tx().description());
        System.out.println("script:" + txInfo.tx().script().encoded());
        System.out.println("height:" + txInfo.height());
        System.out.println("applicationStatus:" + txInfo.applicationStatus());
    }
}
  • Issue your own asset

    Добавьте библиотеку в ваше приложение

    Java
    Копировать
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    package com.wavesplatform.examples;
    import com.wavesplatform.transactions.account.PrivateKey;
    import com.wavesplatform.transactions.IssueTransaction;
    import com.wavesplatform.wavesj.Node;
    import com.wavesplatform.wavesj.Profile;
    import com.wavesplatform.wavesj.exceptions.NodeException;
    import com.wavesplatform.wavesj.info.IssueTransactionInfo;
    import java.io.IOException;
    
    public class WavesExample {
        public static void main(String[] args) throws NodeException, IOException {
            // create a node instance
            Node node = new Node(Profile.TESTNET);
            // create private key from seed
            PrivateKey privateKey = PrivateKey.fromSeed("seed phrase");
            // create IssueTransaction
            IssueTransaction tx = new IssueTransaction(
                privateKey.publicKey(),
                "asset",
                "description",
                1000,
                2,
                false,
                null)
                .addProof(privateKey);
            // publish the transaction and wait for it to be included in the blockchain
            node.waitForTransaction(node.broadcast(tx).id());
            // get transaction info from node
            IssueTransactionInfo txInfo = node.getTransactionInfo(tx.id(), IssueTransactionInfo.class);
            // print all information
            System.out.println("type:" + txInfo.tx().type());
            System.out.println("id:" + txInfo.tx().id());
            System.out.println("fee:" + txInfo.tx().fee().value());
            System.out.println("feeAssetId:" + txInfo.tx().fee().assetId().encoded());
            System.out.println("timestamp:" + txInfo.tx().timestamp());
            System.out.println("version:" + txInfo.tx().version());
            System.out.println("chainId:" + txInfo.tx().chainId());
            System.out.println("sender:" + txInfo.tx().sender().address().encoded());
            System.out.println("senderPublicKey:" + txInfo.tx().sender().encoded());
            System.out.println("proofs:" + txInfo.tx().proofs());
            System.out.println("assetId:" + txInfo.tx().assetId().encoded());
            System.out.println("name:" + txInfo.tx().name());
            System.out.println("quantity:" + txInfo.tx().quantity());
            System.out.println("reissuable:" + txInfo.tx().reissuable());
            System.out.println("decimals:" + txInfo.tx().decimals());
            System.out.println("description:" + txInfo.tx().description());
            System.out.println("script:" + txInfo.tx().script().encoded());
            System.out.println("height:" + txInfo.height());
            System.out.println("applicationStatus:" + txInfo.applicationStatus());
        }
    }
  • Create NFT

    Добавьте библиотеку в ваше приложение

    Java
    Копировать
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    package com.wavesplatform.examples;
    import com.wavesplatform.transactions.account.PrivateKey;
    import com.wavesplatform.transactions.IssueTransaction;
    import com.wavesplatform.wavesj.Node;
    import com.wavesplatform.wavesj.Profile;
    import com.wavesplatform.wavesj.exceptions.NodeException;
    import com.wavesplatform.wavesj.info.IssueTransactionInfo;
    import java.io.IOException;
    
    public class WavesExample {
        public static void main(String[] args) throws NodeException, IOException {
            // create a node instance
            Node node = new Node(Profile.TESTNET);
            // create private key from seed
            PrivateKey privateKey = PrivateKey.fromSeed("seed phrase");
            // create IssueTransaction
            IssueTransaction tx = new IssueTransaction(
                privateKey.publicKey(),
                "asset",
                "description",
                1000,
                2,
                false,
                null)
                .addProof(privateKey);
            // publish the transaction and wait for it to be included in the blockchain
            node.waitForTransaction(node.broadcast(tx).id());
            // get transaction info from node
            IssueTransactionInfo txInfo = node.getTransactionInfo(tx.id(), IssueTransactionInfo.class);
            // print all information
            System.out.println("type:" + txInfo.tx().type());
            System.out.println("id:" + txInfo.tx().id());
            System.out.println("fee:" + txInfo.tx().fee().value());
            System.out.println("feeAssetId:" + txInfo.tx().fee().assetId().encoded());
            System.out.println("timestamp:" + txInfo.tx().timestamp());
            System.out.println("version:" + txInfo.tx().version());
            System.out.println("chainId:" + txInfo.tx().chainId());
            System.out.println("sender:" + txInfo.tx().sender().address().encoded());
            System.out.println("senderPublicKey:" + txInfo.tx().sender().encoded());
            System.out.println("proofs:" + txInfo.tx().proofs());
            System.out.println("assetId:" + txInfo.tx().assetId().encoded());
            System.out.println("name:" + txInfo.tx().name());
            System.out.println("quantity:" + txInfo.tx().quantity());
            System.out.println("reissuable:" + txInfo.tx().reissuable());
            System.out.println("decimals:" + txInfo.tx().decimals());
            System.out.println("description:" + txInfo.tx().description());
            System.out.println("script:" + txInfo.tx().script().encoded());
            System.out.println("height:" + txInfo.height());
            System.out.println("applicationStatus:" + txInfo.applicationStatus());
        }
    }
  • Create new address

    Добавьте библиотеку в ваше приложение

    Java
    Копировать
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    package com.wavesplatform.examples;
    import com.wavesplatform.transactions.account.PrivateKey;
    import com.wavesplatform.transactions.IssueTransaction;
    import com.wavesplatform.wavesj.Node;
    import com.wavesplatform.wavesj.Profile;
    import com.wavesplatform.wavesj.exceptions.NodeException;
    import com.wavesplatform.wavesj.info.IssueTransactionInfo;
    import java.io.IOException;
    
    public class WavesExample {
        public static void main(String[] args) throws NodeException, IOException {
            // create a node instance
            Node node = new Node(Profile.TESTNET);
            // create private key from seed
            PrivateKey privateKey = PrivateKey.fromSeed("seed phrase");
            // create IssueTransaction
            IssueTransaction tx = new IssueTransaction(
                privateKey.publicKey(),
                "asset",
                "description",
                1000,
                2,
                false,
                null)
                .addProof(privateKey);
            // publish the transaction and wait for it to be included in the blockchain
            node.waitForTransaction(node.broadcast(tx).id());
            // get transaction info from node
            IssueTransactionInfo txInfo = node.getTransactionInfo(tx.id(), IssueTransactionInfo.class);
            // print all information
            System.out.println("type:" + txInfo.tx().type());
            System.out.println("id:" + txInfo.tx().id());
            System.out.println("fee:" + txInfo.tx().fee().value());
            System.out.println("feeAssetId:" + txInfo.tx().fee().assetId().encoded());
            System.out.println("timestamp:" + txInfo.tx().timestamp());
            System.out.println("version:" + txInfo.tx().version());
            System.out.println("chainId:" + txInfo.tx().chainId());
            System.out.println("sender:" + txInfo.tx().sender().address().encoded());
            System.out.println("senderPublicKey:" + txInfo.tx().sender().encoded());
            System.out.println("proofs:" + txInfo.tx().proofs());
            System.out.println("assetId:" + txInfo.tx().assetId().encoded());
            System.out.println("name:" + txInfo.tx().name());
            System.out.println("quantity:" + txInfo.tx().quantity());
            System.out.println("reissuable:" + txInfo.tx().reissuable());
            System.out.println("decimals:" + txInfo.tx().decimals());
            System.out.println("description:" + txInfo.tx().description());
            System.out.println("script:" + txInfo.tx().script().encoded());
            System.out.println("height:" + txInfo.height());
            System.out.println("applicationStatus:" + txInfo.applicationStatus());
        }
    }
  • Reissue transaction

    Добавьте библиотеку в ваше приложение

    Java
    Копировать
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    package com.wavesplatform.examples;
    import com.wavesplatform.transactions.account.PrivateKey;
    import com.wavesplatform.transactions.IssueTransaction;
    import com.wavesplatform.wavesj.Node;
    import com.wavesplatform.wavesj.Profile;
    import com.wavesplatform.wavesj.exceptions.NodeException;
    import com.wavesplatform.wavesj.info.IssueTransactionInfo;
    import java.io.IOException;
    
    public class WavesExample {
        public static void main(String[] args) throws NodeException, IOException {
            // create a node instance
            Node node = new Node(Profile.TESTNET);
            // create private key from seed
            PrivateKey privateKey = PrivateKey.fromSeed("seed phrase");
            // create IssueTransaction
            IssueTransaction tx = new IssueTransaction(
                privateKey.publicKey(),
                "asset",
                "description",
                1000,
                2,
                false,
                null)
                .addProof(privateKey);
            // publish the transaction and wait for it to be included in the blockchain
            node.waitForTransaction(node.broadcast(tx).id());
            // get transaction info from node
            IssueTransactionInfo txInfo = node.getTransactionInfo(tx.id(), IssueTransactionInfo.class);
            // print all information
            System.out.println("type:" + txInfo.tx().type());
            System.out.println("id:" + txInfo.tx().id());
            System.out.println("fee:" + txInfo.tx().fee().value());
            System.out.println("feeAssetId:" + txInfo.tx().fee().assetId().encoded());
            System.out.println("timestamp:" + txInfo.tx().timestamp());
            System.out.println("version:" + txInfo.tx().version());
            System.out.println("chainId:" + txInfo.tx().chainId());
            System.out.println("sender:" + txInfo.tx().sender().address().encoded());
            System.out.println("senderPublicKey:" + txInfo.tx().sender().encoded());
            System.out.println("proofs:" + txInfo.tx().proofs());
            System.out.println("assetId:" + txInfo.tx().assetId().encoded());
            System.out.println("name:" + txInfo.tx().name());
            System.out.println("quantity:" + txInfo.tx().quantity());
            System.out.println("reissuable:" + txInfo.tx().reissuable());
            System.out.println("decimals:" + txInfo.tx().decimals());
            System.out.println("description:" + txInfo.tx().description());
            System.out.println("script:" + txInfo.tx().script().encoded());
            System.out.println("height:" + txInfo.height());
            System.out.println("applicationStatus:" + txInfo.applicationStatus());
        }
    }
  • Burn token

    Добавьте библиотеку в ваше приложение

    Java
    Копировать
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    package com.wavesplatform.examples;
    import com.wavesplatform.transactions.account.PrivateKey;
    import com.wavesplatform.transactions.IssueTransaction;
    import com.wavesplatform.wavesj.Node;
    import com.wavesplatform.wavesj.Profile;
    import com.wavesplatform.wavesj.exceptions.NodeException;
    import com.wavesplatform.wavesj.info.IssueTransactionInfo;
    import java.io.IOException;
    
    public class WavesExample {
        public static void main(String[] args) throws NodeException, IOException {
            // create a node instance
            Node node = new Node(Profile.TESTNET);
            // create private key from seed
            PrivateKey privateKey = PrivateKey.fromSeed("seed phrase");
            // create IssueTransaction
            IssueTransaction tx = new IssueTransaction(
                privateKey.publicKey(),
                "asset",
                "description",
                1000,
                2,
                false,
                null)
                .addProof(privateKey);
            // publish the transaction and wait for it to be included in the blockchain
            node.waitForTransaction(node.broadcast(tx).id());
            // get transaction info from node
            IssueTransactionInfo txInfo = node.getTransactionInfo(tx.id(), IssueTransactionInfo.class);
            // print all information
            System.out.println("type:" + txInfo.tx().type());
            System.out.println("id:" + txInfo.tx().id());
            System.out.println("fee:" + txInfo.tx().fee().value());
            System.out.println("feeAssetId:" + txInfo.tx().fee().assetId().encoded());
            System.out.println("timestamp:" + txInfo.tx().timestamp());
            System.out.println("version:" + txInfo.tx().version());
            System.out.println("chainId:" + txInfo.tx().chainId());
            System.out.println("sender:" + txInfo.tx().sender().address().encoded());
            System.out.println("senderPublicKey:" + txInfo.tx().sender().encoded());
            System.out.println("proofs:" + txInfo.tx().proofs());
            System.out.println("assetId:" + txInfo.tx().assetId().encoded());
            System.out.println("name:" + txInfo.tx().name());
            System.out.println("quantity:" + txInfo.tx().quantity());
            System.out.println("reissuable:" + txInfo.tx().reissuable());
            System.out.println("decimals:" + txInfo.tx().decimals());
            System.out.println("description:" + txInfo.tx().description());
            System.out.println("script:" + txInfo.tx().script().encoded());
            System.out.println("height:" + txInfo.height());
            System.out.println("applicationStatus:" + txInfo.applicationStatus());
        }
    }
Как начатьКак начатьКак начать

Начать работу с блокчейном Waves очень просто. Нажмите на "Как это использовать?" и перейдите в Waves Lessons, где вы можете узнать, как работать с блокчейном с примерами на вашем языке программирования

  • < Выберите свой язык /> Вы выбрали Java
  • Java
  • GoLang
  • Php
  • Python
  • Rust
  • C#
  • Java Script
ДокументацияДокументацияДокументация

Разделы документации позволят вам быстро погрузиться в разработку

    Использовать плагиныИспользовать плагиныИспользовать плагины

    Приступить к работе

    Создайте свою первую программу / смарт-контракт / или децентрализованное приложение с помощью вашей привычной среды разработки IDE

    Перейти к плагинам

    Используйте

    Waves SignerWaves SignerWaves Signer

    Для подписания транзакций в ваших проектах

    Вы можете использовать различных провайдеров в блокчейне Waves, чтобы обеспечить безопасность пользователей, а также защитить и подписать транзакции

    Начать
    Products
    Keeper Wallet
    Products
    Ledger
    Products
    Waves Exchange
    Products
    Metamask