Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
30e6d96
Switch concordium-base to the PLT branch
Radiokot Jul 1, 2025
d579ff4
Update Rust
Radiokot Jul 1, 2025
7bb2606
Add tokens to AccountInfo
Radiokot Jul 1, 2025
b256d6b
Add PLT transaction reject reasons
Radiokot Jul 1, 2025
ef985ca
Add PLT update transaction result
Radiokot Jul 1, 2025
65ca3f1
Add Protocol version 9 enum case
Radiokot Jul 1, 2025
3f0a78e
Add PLT creation to AuthorizationsV1
Radiokot Jul 2, 2025
e4741b3
Add missing ValidatorScoreParameters update to ChainUpdateDetails
Radiokot Jul 2, 2025
8db18f0
Add PLT creation updates to Summary
Radiokot Jul 2, 2025
4de5bd7
Remove misleading comment
Radiokot Jul 2, 2025
c951432
Add token creation case for Summary details
Radiokot Jul 3, 2025
51bf67c
Add token update transaction stub
Radiokot Jul 3, 2025
124b306
Add token operation stub
Radiokot Jul 3, 2025
e5ab134
WIP Add transfer token operation with CBOR
Radiokot Jul 4, 2025
7bb1bb6
Fix token operation amount serialization
Radiokot Jul 4, 2025
249fdf9
Fix token holder account serialization
Radiokot Jul 4, 2025
cb0e13d
Fix transfer token op serialization
Radiokot Jul 4, 2025
c6b5856
Fix broken CBOR arrays
Radiokot Jul 7, 2025
1b422e5
Add tagged token holder account test
Radiokot Jul 7, 2025
d153c90
Make CBOR memo serialization match JS SDK
Radiokot Jul 7, 2025
d161e50
Do not include null fields to CBOR
Radiokot Jul 7, 2025
370b52c
Add CBOR serializer for UInt32
Radiokot Jul 7, 2025
594d81b
Add token transfer example
Radiokot Jul 8, 2025
0f1e5ea
Fix type issue in AuthorizationsV1
Radiokot Jul 8, 2025
fde905c
Add tests for token update transaction
Radiokot Jul 8, 2025
ecf4b62
Make symbol in token update tx a plain string
Radiokot Jul 8, 2025
45bb6c3
Add auto TLS config to the readme
Radiokot Jul 8, 2025
71ae4ad
Declare dependencies versions in the parent POM
Radiokot Jul 8, 2025
528c84e
Exclude examples from the parent module list
Radiokot Jul 8, 2025
0e5b095
Update Jackson to 2.19.1
Radiokot Jul 8, 2025
dcdb8c9
Update GRPC to 1.73.0
Radiokot Jul 8, 2025
7bfbc8d
Update Commons
Radiokot Jul 8, 2025
2cb1926
Remove null checks from CBOR serializers
Radiokot Jul 10, 2025
ab40125
Add plus method to UInt32 and UInt64
Radiokot Jul 10, 2025
ae98049
Prettify the example
Radiokot Jul 11, 2025
ee5dc13
Update the version to 11.0.0-plt.1
Radiokot Jul 11, 2025
62c862a
Make examples use PLT release
Radiokot Jul 19, 2025
909bdd6
Update concordium-base to f69906f
Radiokot Aug 1, 2025
1e2926b
Fix switched types of token tx reject reasons
Radiokot Aug 1, 2025
210133a
Update the changelog
Radiokot Aug 1, 2025
7230229
Fix missing break in ChainUpdateDetails
Radiokot Aug 1, 2025
7f052b2
Fix missing break in Summary
Radiokot Aug 1, 2025
c0fc925
Report possible reflection error with more details
Radiokot Aug 1, 2025
5ebaf1d
Fix typo
Radiokot Aug 6, 2025
c2111d5
Remove impossible PLT creation chain update
Radiokot Aug 6, 2025
70338e2
Fix typo
Radiokot Aug 6, 2025
ebe1176
Fix outdated term
Radiokot Aug 6, 2025
7fca43d
Add upper bound check for token op amount decimals
Radiokot Aug 6, 2025
2024857
Fix transitive lombok
Radiokot Aug 21, 2025
ccd5568
Update the version to 11.0.0
Radiokot Aug 21, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# Changelog

## 11.0.0

- Support for Protocol 9
- Added `ProtocolVersion.V9` corresponding to Protocol version 9
- Added `tokens` field to `AccountInfo`, containing list of related protocol level tokens
- Added new account transaction, `TokenUpdate`, used to execute protocol level tokens operations
- Added `TokenOperation` interface for protocol level tokens operations
- Added `TransferTokenOperation` implementing protocol level token transfer
- Added protocol level token transfer example, see `SendTokenTransfer` in `concordium-sdk-examples`
- Added `tokenUpdate` result to `AccountTransactionDetails`
- Added `createPltUpdate` authorization to `AuthorizationsV1`
- Added `RejectReasonTokenUpdateTransactionFailed` and `RejectReasonNotExistentTokenId` transaction reject reasons
- Added `CborMapper` singleton providing Jackson CBOR object mapper
- Fixed having the Lombok library transitive

## 10.0.1

- Added `getPassiveDelegationInfo` endpoint providing information
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ The `ClientV2` must be initialized with a `Connection` which holds information o
Connection connection = Connection.newBuilder()
.host(${node_host})
.port(${node_port})
.useTLS(TLSConfig.auto()) // If the node is under HTTPS
.build();
ClientV2 client = ClientV2.from(connection);
```
Expand Down
23 changes: 9 additions & 14 deletions concordium-android-sdk/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@
<parent>
<groupId>com.concordium.sdk</groupId>
<artifactId>concordium-sdk-base</artifactId>
<version>11.0.0-SNAPSHOT</version>
<version>11.0.0</version>
</parent>

<artifactId>concordium-android-sdk</artifactId>
<groupId>com.concordium.sdk</groupId>
<packaging>aar</packaging>

<properties>
Expand All @@ -33,57 +32,54 @@
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-netty-shaded</artifactId>
<version>1.40.1</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.11.0</version>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.15</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.26</version>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-protobuf</artifactId>
<version>1.40.1</version>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-okhttp</artifactId>
<version>1.60.0</version>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-stub</artifactId>
<version>1.60.0</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.10.1</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-cbor</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
<version>2.10.1</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jdk8</artifactId>
<version>2.10.1</version>
</dependency>
<dependency>
<groupId>org.bitcoinj</groupId>
<artifactId>bitcoinj-core</artifactId>
<version>0.16.2</version>
<exclusions>
<exclusion>
<groupId>com.google.protobuf</groupId>
Expand All @@ -94,7 +90,6 @@
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.14.0</version>
</dependency>
</dependencies>

Expand Down
2 changes: 1 addition & 1 deletion concordium-base
Submodule concordium-base updated 130 files
3 changes: 1 addition & 2 deletions concordium-sdk-examples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@
<dependency>
<groupId>com.concordium.sdk</groupId>
<artifactId>concordium-sdk</artifactId>
<version>11.0.0-SNAPSHOT</version>
<scope>compile</scope>
<version>11.0.0</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
package com.concordium.sdk.examples;

import com.concordium.sdk.ClientV2;
import com.concordium.sdk.Connection;
import com.concordium.sdk.TLSConfig;
import com.concordium.sdk.crypto.ed25519.ED25519SecretKey;
import com.concordium.sdk.exceptions.ClientInitializationException;
import com.concordium.sdk.requests.AccountQuery;
import com.concordium.sdk.requests.BlockQuery;
import com.concordium.sdk.responses.blockitemstatus.FinalizedBlockItem;
import com.concordium.sdk.transactions.*;
import com.concordium.sdk.transactions.tokens.CborMemo;
import com.concordium.sdk.transactions.tokens.TaggedTokenHolderAccount;
import com.concordium.sdk.transactions.tokens.TokenOperationAmount;
import com.concordium.sdk.transactions.tokens.TransferTokenOperation;
import com.concordium.sdk.types.AccountAddress;
import lombok.var;
import picocli.CommandLine;
import picocli.CommandLine.Command;
import picocli.CommandLine.Option;

import java.math.BigDecimal;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Optional;
import java.util.concurrent.Callable;

@Command(name = "SendTokenTransfer", mixinStandardHelpOptions = true)
public class SendTokenTransfer implements Callable<Integer> {
@Option(
names = {"--endpoint"},
description = "GRPC interface of the node.",
defaultValue = "https://grpc.devnet-plt-beta.concordium.com:20000")
private String endpoint;

@Option(
names = {"--timeout"},
description = "GRPC request timeout in milliseconds.",
defaultValue = "100000")
private int timeout;

@Override
public Integer call() throws MalformedURLException, ClientInitializationException {
var endpointUrl = new URL(this.endpoint);

Connection connection = Connection.newBuilder()
.host(endpointUrl.getHost())
.port(endpointUrl.getPort())
.useTLS(TLSConfig.auto())
.build();

String tokenSymbol = "TestLists";
TokenOperationAmount amount = new TokenOperationAmount(
new BigDecimal("0.01"),
10
);
AccountAddress sender = AccountAddress.from("4m9AzH7oeq2LNZpmBu3uW9KJEimevgBMD79PhTMxJeYVmtRdxR");
AccountAddress receiver = AccountAddress.from("386L81BpBVrm2cDrnjEqpaGcuveC8FgiH5ZBxSVdvto4ydVFLX");
Expiry expiry = Expiry.createNew().addMinutes(5);

TransactionSigner signer = TransactionSigner.from(
SignerEntry.from(Index.from(0), Index.from(0),
ED25519SecretKey
.from("ad42d4f5122f4cc758c27b9c776f2d7635f30e55acb8697bb7a97edb3d7f0d88")));

var client = ClientV2.from(connection);
var senderInfo = client.getAccountInfo(BlockQuery.BEST, AccountQuery.from(sender));
var nonce = senderInfo.getNonce();
var txnHash = client.sendTransaction(
TransactionFactory
.newTokenUpdate()
.sender(sender)
.payload(
TokenUpdate
.builder()
.tokenSymbol(tokenSymbol)
.operation(
TransferTokenOperation
.builder()
.recipient(new TaggedTokenHolderAccount(receiver))
.amount(amount)
.memo(CborMemo.from("You must see a multi-byte white woman scientist emoji: 👩🏻‍🔬"))
.build()
)
.build()
)
.nonce(nonce)
.expiry(expiry)
.signer(signer)
.build()
);
System.out.println(txnHash);
Optional<FinalizedBlockItem> finalizedBlockItem = client.waitUntilFinalized(txnHash, this.timeout);
System.out.println(finalizedBlockItem);
return 0;
}

public static void main(String[] args) {
int exitCode = new CommandLine(new SendTokenTransfer()).execute(args);
System.exit(exitCode);
}
}
46 changes: 21 additions & 25 deletions concordium-sdk/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>com.concordium.sdk</groupId>
<groupId>com.concordium.sdk</groupId>
<artifactId>concordium-sdk-base</artifactId>
<version>11.0.0-SNAPSHOT</version>
<version>11.0.0</version>
</parent>

<groupId>com.concordium.sdk</groupId>
<artifactId>concordium-sdk</artifactId>

<name>concordium-sdk</name>
Expand All @@ -26,15 +25,12 @@

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>

<dependencies>
<dependency>
<groupId>org.bitcoinj</groupId>
<artifactId>bitcoinj-core</artifactId>
<version>0.16.2</version>
<exclusions>
<exclusion>
<groupId>com.google.protobuf</groupId>
Expand All @@ -45,75 +41,70 @@
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-netty-shaded</artifactId>
<version>1.40.1</version>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-protobuf</artifactId>
<version>1.40.1</version>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-testing</artifactId>
<version>1.40.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-stub</artifactId>
<version>1.40.1</version>
</dependency>
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.26</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.11.1</version>
<artifactId>jackson-core</artifactId>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.15</version>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.11.0</version>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-cbor</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
<version>2.13.2</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jdk8</artifactId>
<version>2.13.3</version>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>3.3.3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.14.0</version>
</dependency>
</dependencies>

Expand Down Expand Up @@ -359,6 +350,11 @@
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<useIncrementalCompilation>false</useIncrementalCompilation>
</configuration>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1245,6 +1245,14 @@ static Summary to(BlockItemSummary blockItemSummary) {
.chainUpdateDetails(details)
.build());
break;
case TOKEN_CREATION:
val tokenCreationDetails = blockItemSummary.getTokenCreation();
summary.details(Details
.builder()
.type(Type.TOKEN_CREATION)
.tokenCreationDetails(tokenCreationDetails)
.build());
break;
case DETAILS_NOT_SET:
throw new IllegalArgumentException("Unrecognized block item summary");
}
Expand Down
Loading
Loading