Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 0 additions & 5 deletions docs/01-getting-started/02-quick-start-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,6 @@ Once this association (or "link") is established, you can:
### Implementation

A native wallet linking flow is currently in development. Once it ships, this section will document the end-to-end implementation. In the meantime, you can have users share their wallet address directly (for example, by pasting it into a form) and use that address in the steps below.

:::info Reference
The [Sending Wallet Requests](/02-guides/01-platform/02-managing-users/01-connecting-user-wallets/01-sending-wallet-requests.md) page will become the full in-depth guide once the flow ships.
:::

## 5. Send a Token to a User

### Why Send Tokens?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ Once you've created a collection you're ready to start [creating tokens](/02-gui

Every on-chain action goes through the single `CreateTransaction` mutation. The action itself is selected by which field you set on the `transaction` input — for collections, that's `createCollection`.

:::warning SDKs are not yet available
The C# and C++ SDK examples below are out of date and **will not work against the current Enjin Platform API**. This section will be updated once new SDKs are published. Until then, use the GraphQL, cURL, Javascript, Node.js, or Python examples.
:::info C++ SDK coming soon
The C++ examples on this page target an older version of the Enjin Platform and won't work against the current API. An updated C++ SDK is on the way — for now, use the C# SDK or the GraphQL examples.
:::

<Tabs>
Expand Down Expand Up @@ -84,32 +84,30 @@ curl --location 'https://platform.beta.enjin.io/graphql' \
</TabItem>
<TabItem value="csharp-sdk" label="c# SDK">
```csharp
using System.Text.Json;
using System;
using Enjin.Platform.Sdk;

// Setup the mutation
var createCollection = new CreateCollection()
.SetMintPolicy(new MintPolicy().SetForceCollapsingSupply(false)); //Set to true to enforce collapsing supply mint policy

// Define and assign the return data fragment to the mutation
var transactionFragment = new TransactionFragment()
.WithId()
.WithMethod()
.WithState();

createCollection.Fragment(transactionFragment);

// Create and auth a client to send the request to the platform
var client = PlatformClient.Builder()
.SetBaseAddress("https://platform.beta.enjin.io")
.Build();
client.Auth("Your_Platform_Token_Here");

// Send the request and write the output to the console.
// Only the fields that were requested in the fragment will be filled in,
// other fields which weren't requested in the fragment will be set to null.
var response = await client.SendCreateCollection(createCollection);
Console.WriteLine(JsonSerializer.Serialize(response.Result.Data));
// Create and authenticate the client
using var client = new PlatformClient();
client.Auth("<your-platform-token>");

// Build the CreateTransaction mutation, selecting createCollection as the action
var mutation = new MutationQueryBuilder()
.WithCreateTransaction(
new TransactionQueryBuilder().WithUuid().WithState(),
network: Network.Enjin, // or Network.Canary for testnet
chain: Chain.Matrix,
transaction: new TransactionInput
{
CreateCollection = new CreateCollectionInput
{
ForceCollapsingSupply = false, // set to true to enforce collapsing supply
},
});

// Send the mutation; poll GetTransaction by uuid to track its on-chain state
var response = await client.SendMutation(mutation);
Console.WriteLine(response.Result.Data?.CreateTransaction?.Uuid);
```
</TabItem>
<TabItem value="cplusplus-sdk" label="C++ SDK">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ The collection owner is the only account authorized to make changes to the colle

Transferring collection ownership is a two-step process: the current owner submits a transfer request, and the new owner accepts it.

:::warning SDKs are not yet available
The C# and C++ SDK examples below are out of date and **will not work against the current Enjin Platform API**. This section will be updated once new SDKs are published. Until then, use the GraphQL, cURL, Javascript, Node.js, or Python examples.
:::info C++ SDK coming soon
The C++ examples on this page target an older version of the Enjin Platform and won't work against the current API. An updated C++ SDK is on the way — for now, use the C# SDK or the GraphQL examples.
:::

## Step #1: Sending a transfer ownership request with the [Enjin API](/01-getting-started/05-using-enjin-api/05-using-enjin-api.md)
Expand Down Expand Up @@ -56,37 +56,32 @@ curl --location 'https://platform.beta.enjin.io/graphql' \
</TabItem>
<TabItem value="csharp-sdk" label="c# SDK">
```csharp
using System.Text.Json;
using System;
using Enjin.Platform.Sdk;

// Set up the collection mutation input.
var collectionMutationInput = new CollectionMutationInput()
.SetOwner("cxLU94nRz1en6gHnXnYPyTdtcZZ9dqBasexvexjArj4V1Qr8f"); // Set the new owner account of the collection.

// Set up the mutation
var mutateCollection = new MutateCollection()
.SetCollectionId(36105) // Specify the collection ID.
.SetMutation(collectionMutationInput); // Specify the mutation input.

// Define and assign the return data fragment to the mutation
var transactionFragment = new TransactionFragment()
.WithId()
.WithMethod()
.WithState();

mutateCollection.Fragment(transactionFragment);

// Create and auth a client to send the request to the platform
var client = PlatformClient.Builder()
.SetBaseAddress("https://platform.beta.enjin.io")
.Build();
client.Auth("Your_Platform_Token_Here");

// Send the request and write the output to the console.
// Only the fields that were requested in the fragment will be filled in,
// other fields which weren't requested in the fragment will be set to null.
var response = await client.SendMutateCollection(mutateCollection);
Console.WriteLine(JsonSerializer.Serialize(response.Result.Data));
// Create and authenticate the client
using var client = new PlatformClient();
client.Auth("<your-platform-token>");

// Build the CreateTransaction mutation (one action set on TransactionInput)
// Initiating a collection-ownership transfer is done via the mutateCollection
// action by setting the new owner's address on the Owner field.
var mutation = new MutationQueryBuilder()
.WithCreateTransaction(
new TransactionQueryBuilder().WithUuid().WithState(),
network: Network.Enjin, // or Network.Canary for testnet
chain: Chain.Matrix,
transaction: new TransactionInput
{
MutateCollection = new MutateCollectionInput
{
CollectionId = 36105,
Owner = "cxLU94nRz1en6gHnXnYPyTdtcZZ9dqBasexvexjArj4V1Qr8f", // the new owner
},
});

var response = await client.SendMutation(mutation);
Console.WriteLine(response.Result.Data?.CreateTransaction?.Uuid);
```
</TabItem>
<TabItem value="cplusplus-sdk" label="C++ SDK">
Expand Down Expand Up @@ -253,32 +248,29 @@ curl --location 'https://platform.beta.enjin.io/graphql' \
</TabItem>
<TabItem value="csharp-sdk" label="c# SDK">
```csharp
using System.Text.Json;
using System;
using Enjin.Platform.Sdk;

// Set up the mutation
var acceptCollectionTransfer = new AcceptCollectionTransfer()
.SetCollectionId(36105); // Specify the collection ID.

// Define and assign the return data fragment to the mutation
var transactionFragment = new TransactionFragment()
.WithId()
.WithMethod()
.WithState();

acceptCollectionTransfer.Fragment(transactionFragment);

// Create and auth a client to send the request to the platform
var client = PlatformClient.Builder()
.SetBaseAddress("https://platform.beta.enjin.io")
.Build();
client.Auth("Your_Platform_Token_Here");

// Send the request and write the output to the console.
// Only the fields that were requested in the fragment will be filled in,
// other fields which weren't requested in the fragment will be set to null.
var response = await client.SendAcceptCollectionTransfer(acceptCollectionTransfer);
Console.WriteLine(JsonSerializer.Serialize(response.Result.Data));
// Create and authenticate the client
using var client = new PlatformClient();
client.Auth("<your-platform-token>");

// Build the CreateTransaction mutation (one action set on TransactionInput)
var mutation = new MutationQueryBuilder()
.WithCreateTransaction(
new TransactionQueryBuilder().WithUuid().WithState(),
network: Network.Enjin, // or Network.Canary for testnet
chain: Chain.Matrix,
transaction: new TransactionInput
{
AcceptCollectionTransfer = new AcceptCollectionTransferInput
{
Id = 36105, // the collection id
},
});

var response = await client.SendMutation(mutation);
Console.WriteLine(response.Result.Data?.CreateTransaction?.Uuid);
```
</TabItem>
<TabItem value="cplusplus-sdk" label="C++ SDK">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ Once your token is created, lets give it a new look by [Adding Metadata](/02-gui

To create a currency token, use the standard `createToken` action with the `behavior` field set to `{ type: IS_CURRENCY, name, symbol, decimalCount }`. The rest of the input (recipient, collectionId, tokenId, initialSupply, etc.) follows the same shape as a regular [token create](/02-guides/01-platform/01-managing-tokens/02-creating-tokens/02-creating-tokens.md#option-b-using-the-enjin-api--sdks).

:::warning SDKs are not yet available
The C# and C++ SDK examples below are out of date and **will not work against the current Enjin Platform API**. This section will be updated once new SDKs are published. Until then, use the GraphQL, cURL, Javascript, Node.js, or Python examples.
:::info C++ SDK coming soon
The C++ examples on this page target an older version of the Enjin Platform and won't work against the current API. An updated C++ SDK is on the way — for now, use the C# SDK or the GraphQL examples.
:::

<Tabs>
Expand Down Expand Up @@ -114,47 +114,43 @@ curl --location 'https://platform.beta.enjin.io/graphql' \
</TabItem>
<TabItem value="csharp-sdk" label="c# SDK">
```csharp
using System.Text.Json;
using System;
using Enjin.Platform.Sdk;

// Define the token metadata input
var tokenMetadata = new TokenMetadataInput()
.SetName("Token Name") // Set the token name
.SetSymbol("TKN") // Set the token symbol
.SetDecimalCount(18); // Set the decimal count

// Define the token parameters
var tokenParams = new CreateTokenParams()
.SetTokenId(new EncodableTokenIdInput().SetInteger(1)) //Set the token ID
.SetInitialSupply(1) //Mint initial supply
.SetCap(new TokenMintCap().SetType(TokenMintCapType.Infinite)) //Define supply type
.SetMetadata(tokenMetadata); //Set the token metadata

// Set up the mutation
var createToken = new CreateToken()
.SetRecipient("cxLU94nRz1en6gHnXnYPyTdtcZZ9dqBasexvexjArj4V1Qr8f") //The recipient of the initial supply
.SetCollectionId(2406) //Set the collection ID
.SetParams(tokenParams); //Set the previously defined token params

// Define and assign the return data fragment to the mutation
var createTokenFragment = new TransactionFragment()
.WithId()
.WithMethod()
.WithState();

createToken.Fragment(createTokenFragment);

// Create and auth a client to send the request to the platform
var client = PlatformClient.Builder()
.SetBaseAddress("https://platform.beta.enjin.io")
.Build();
client.Auth("Your_Platform_Token_Here");

// Send the request and write the output to the console.
// Only the fields that were requested in the fragment will be filled in,
// other fields which weren't requested in the fragment will be set to null.
var response = await client.SendCreateToken(createToken);
Console.WriteLine(JsonSerializer.Serialize(response.Result.Data));
// Create and authenticate the client
using var client = new PlatformClient();
client.Auth("<your-platform-token>");

// Build the CreateTransaction mutation, selecting createToken as the action
var mutation = new MutationQueryBuilder()
.WithCreateTransaction(
new TransactionQueryBuilder().WithUuid().WithState(),
network: Network.Enjin, // or Network.Canary for testnet
chain: Chain.Matrix,
transaction: new TransactionInput
{
CreateToken = new CreateTokenInput
{
Recipient = "cxLU94nRz1en6gHnXnYPyTdtcZZ9dqBasexvexjArj4V1Qr8f", // recipient of the initial supply
CollectionId = 2406, // collection to mint into
TokenId = 1, // the new token ID
InitialSupply = 1, // initial supply to mint
ListingForbidden = false,
Infusion = 0,
AnyoneCanInfuse = false,
Behavior = new TokenBehaviorInput // makes this token a currency
{
Type = TokenBehaviorType.IsCurrency,
Name = "Gold Coins",
Symbol = "GOLD",
DecimalCount = 2,
},
},
});

// Send the mutation; poll GetTransaction by uuid to track its on-chain state
var response = await client.SendMutation(mutation);
Console.WriteLine(response.Result.Data?.CreateTransaction?.Uuid);
```
</TabItem>
<TabItem value="cplusplus-sdk" label="C++ SDK">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ Once your token is created, lets give it a new look by [Adding Metadata](/02-gui

All on-chain actions go through the single `CreateTransaction` mutation. For creating a token, set the `createToken` field on the `transaction` input. `tokenId` is a flat `BigInt` scalar, and `cap` is optional — omit it to create a token with unlimited supply.

:::warning SDKs are not yet available
The C# and C++ SDK examples below are out of date and **will not work against the current Enjin Platform API**. This section will be updated once new SDKs are published. Until then, use the GraphQL, cURL, Javascript, Node.js, or Python examples.
:::info C++ SDK coming soon
The C++ examples on this page target an older version of the Enjin Platform and won't work against the current API. An updated C++ SDK is on the way — for now, use the C# SDK or the GraphQL examples.
:::

<Tabs>
Expand Down Expand Up @@ -105,40 +105,38 @@ curl --location 'https://platform.beta.enjin.io/graphql' \
</TabItem>
<TabItem value="csharp-sdk" label="c# SDK">
```csharp
using System.Text.Json;
using System;
using Enjin.Platform.Sdk;

// Define the token parameters
var tokenParams = new CreateTokenParams()
.SetTokenId(new EncodableTokenIdInput().SetInteger(1)) //Set the token ID
.SetInitialSupply(1) //Mint initial supply
.SetCap(new TokenMintCap().SetType(TokenMintCapType.Infinite)); //Define supply type

// Setup the mutation
var createToken = new CreateToken()
.SetRecipient("cxLU94nRz1en6gHnXnYPyTdtcZZ9dqBasexvexjArj4V1Qr8f") //The recipient of the initial supply
.SetCollectionId(2406) //Set the collection ID
.SetParams(tokenParams); //Set the previously defined token params

// Define and assign the return data fragment to the mutation
var createTokenFragment = new TransactionFragment()
.WithId()
.WithMethod()
.WithState();

createToken.Fragment(createTokenFragment);

// Create and auth a client to send the request to the platform
var client = PlatformClient.Builder()
.SetBaseAddress("https://platform.beta.enjin.io")
.Build();
client.Auth("Your_Platform_Token_Here");

// Send the request and write the output to the console.
// Only the fields that were requested in the fragment will be filled in,
// other fields which weren't requested in the fragment will be set to null.
var response = await client.SendCreateToken(createToken);
Console.WriteLine(JsonSerializer.Serialize(response.Result.Data));
// Create and authenticate the client
using var client = new PlatformClient();
client.Auth("<your-platform-token>");

// Build the CreateTransaction mutation, selecting createToken as the action
var mutation = new MutationQueryBuilder()
.WithCreateTransaction(
new TransactionQueryBuilder().WithUuid().WithState(),
network: Network.Enjin, // or Network.Canary for testnet
chain: Chain.Matrix,
transaction: new TransactionInput
{
CreateToken = new CreateTokenInput
{
Recipient = "cxLU94nRz1en6gHnXnYPyTdtcZZ9dqBasexvexjArj4V1Qr8f", // recipient of the initial supply
CollectionId = 2406, // collection to mint into
TokenId = 1, // the new token ID
InitialSupply = 1, // initial supply to mint
ListingForbidden = false, // set true to disallow marketplace listings
Infusion = 0, // ENJ infused per unit (base units)
AnyoneCanInfuse = false,
// Cap omitted for unlimited supply.
// For a finite cap: Cap = new TokenCapInput { Type = TokenCapType.Supply, Supply = 100 }
},
});

// Send the mutation; poll GetTransaction by uuid to track its on-chain state
var response = await client.SendMutation(mutation);
Console.WriteLine(response.Result.Data?.CreateTransaction?.Uuid);
```
</TabItem>
<TabItem value="cplusplus-sdk" label="C++ SDK">
Expand Down
Loading
Loading