Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ class WalletKitDemoApp :
else -> TONNetwork.MAINNET
}

val domain = if (network.isTetra) TONSignatureDomain.L2(value = 662387) else null
val domain = if (network.isTetra) TONSignatureDomain.L2(globalId = 662387) else null
val signer = kit.createSignerFromMnemonic(walletRecord.mnemonic)
val adapter = when (walletRecord.version) {
WalletVersions.V4R2 -> kit.createV4R2Adapter(signer, network, domain = domain)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,7 @@ class WalletKitViewModel @Inject constructor(
}

// Tetra (L2) wallets require an L2 signature domain
val domain = if (network.isTetra) TONSignatureDomain.L2(value = 662387) else null
val domain = if (network.isTetra) TONSignatureDomain.L2(globalId = 662387) else null

// Create adapter based on wallet version
// Note: You can optionally specify workchain and walletId parameters:
Expand Down Expand Up @@ -739,7 +739,7 @@ class WalletKitViewModel @Inject constructor(
val kit = getKit()
// Generate a new TON mnemonic explicitly (matches JS docs pattern)
val mnemonic = kit.createTonMnemonic()
val domain = if (network.isTetra) TONSignatureDomain.L2(value = 662387) else null
val domain = if (network.isTetra) TONSignatureDomain.L2(globalId = 662387) else null
val signer = when (interfaceType) {
WalletInterfaceType.SIGNER -> {
val customSigner = createDemoSigner(mnemonic, pendingMetadata.name)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ import kotlinx.serialization.Serializable
/**
* State of an account at a specific point in time.
*
* @param hash The state hash of the account
* @param balance
* @param hash The state hash of the account
* @param extraCurrencies Map of extra currency IDs to their amounts. Extra currencies are additional tokens that can be attached to TON messages.
* @param accountStatus
* @param frozenHash The hash of the frozen account state, if the account is frozen
Expand All @@ -45,13 +45,13 @@ import kotlinx.serialization.Serializable
@Serializable
data class TONAccountState(

/* The state hash of the account */
@SerialName(value = "hash")
val hash: kotlin.String,

@SerialName(value = "balance")
val balance: kotlin.String,

/* The state hash of the account */
@SerialName(value = "hash")
val hash: kotlin.String? = null,

/* Map of extra currency IDs to their amounts. Extra currencies are additional tokens that can be attached to TON messages. */
@SerialName(value = "extraCurrencies")
val extraCurrencies: kotlin.collections.Map<kotlin.String, kotlin.String>? = null,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
/*
* Copyright (c) 2025 TonTech
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
@file:Suppress(
"ArrayInDataClass",
"EnumEntryName",
"RemoveRedundantQualifierName",
"UnusedImport",
)

package io.ton.walletkit.api.generated

import io.ton.walletkit.model.TONUserFriendlyAddress
import kotlinx.serialization.Contextual
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable

/**
*
*
* @param status
* @param address
* @param rawBalance
* @param balance The formatted balance
*/
@Serializable
data class TONBalanceUpdate(

@Contextual @SerialName(value = "status")
val status: TONStreamingUpdateStatus,

@Contextual @SerialName(value = "address")
val address: io.ton.walletkit.model.TONUserFriendlyAddress,

@SerialName(value = "rawBalance")
val rawBalance: kotlin.String,

/* The formatted balance */
@SerialName(value = "balance")
val balance: kotlin.String,
@SerialName("type")
val type: kotlin.String = "balance",
) {

companion object
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
/*
* Copyright (c) 2025 TonTech
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
@file:Suppress(
"ArrayInDataClass",
"EnumEntryName",
"RemoveRedundantQualifierName",
"UnusedImport",
)

package io.ton.walletkit.api.generated

import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable

/**
* Provider-specific options for DeDust swap operations
*
* @param referralAddress The address of the referrer
* @param referralFeeBps Referral fee in basis points (max 100 = 1%)
* @param protocols Protocols to use for routing Available: 'dedust', 'dedust_v3', 'dedust_v3_memepad', 'stonfi_v1', 'stonfi_v2', 'tonco', 'memeslab', 'tonfun'
* @param excludeProtocols Protocols to exclude from routing
* @param onlyVerifiedPools Only use verified pools
* @param maxSplits Maximum number of route splits
* @param maxLength Maximum route length (hops)
* @param excludeVolatilePools Exclude volatile pools
*/
@Serializable
data class TONDeDustProviderOptions(

/* The address of the referrer */
@SerialName(value = "referralAddress")
val referralAddress: kotlin.String? = null,

/* Referral fee in basis points (max 100 = 1%) */
@SerialName(value = "referralFeeBps")
val referralFeeBps: kotlin.Int? = null,

/* Protocols to use for routing Available: 'dedust', 'dedust_v3', 'dedust_v3_memepad', 'stonfi_v1', 'stonfi_v2', 'tonco', 'memeslab', 'tonfun' */
@SerialName(value = "protocols")
val protocols: kotlin.collections.List<kotlin.String>? = null,

/* Protocols to exclude from routing */
@SerialName(value = "excludeProtocols")
val excludeProtocols: kotlin.collections.List<kotlin.String>? = null,

/* Only use verified pools */
@SerialName(value = "onlyVerifiedPools")
val onlyVerifiedPools: kotlin.Boolean? = null,

/* Maximum number of route splits */
@SerialName(value = "maxSplits")
val maxSplits: kotlin.Int? = null,

/* Maximum route length (hops) */
@SerialName(value = "maxLength")
val maxLength: kotlin.Int? = null,

/* Exclude volatile pools */
@SerialName(value = "excludeVolatilePools")
val excludeVolatilePools: kotlin.Boolean? = null,

) {

companion object
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/*
* Copyright (c) 2025 TonTech
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
@file:Suppress(
"ArrayInDataClass",
"EnumEntryName",
"RemoveRedundantQualifierName",
"UnusedImport",
)

package io.ton.walletkit.api.generated

import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable

/**
* Metadata stored in SwapQuote for DeDust provider
*
* @param quoteResponse Raw quote response from API
* @param slippageBps Slippage used for the quote in basis points
*/
@Serializable
data class TONDeDustQuoteMetadata(

@SerialName("quoteResponse")
private val quoteResponse: kotlinx.serialization.json.JsonElement,

/* Slippage used for the quote in basis points */
@SerialName(value = "slippageBps")
val slippageBps: kotlin.Int,

) {

companion object
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
/*
* Copyright (c) 2025 TonTech
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
@file:Suppress(
"ArrayInDataClass",
"EnumEntryName",
"RemoveRedundantQualifierName",
"UnusedImport",
)

package io.ton.walletkit.api.generated

import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable

/**
* Quote response from DeDust Router API
*
* @param inAmount
* @param outAmount
* @param swapData
* @param swapIsPossible
* @param priceImpact
* @param improvement
* @param inMinterPrice
* @param outMinterPrice
*/
@Serializable
data class TONDeDustQuoteResponse(

@SerialName(value = "in_amount")
val inAmount: kotlin.String,

@SerialName(value = "out_amount")
val outAmount: kotlin.String,

@SerialName(value = "swap_data")
val swapData: TONDeDustSwapData,

@SerialName(value = "swap_is_possible")
val swapIsPossible: kotlin.Boolean,

@SerialName(value = "price_impact")
val priceImpact: kotlin.Int? = null,

@SerialName(value = "improvement")
val improvement: kotlin.String? = null,

@SerialName(value = "in_minter_price")
val inMinterPrice: kotlin.String? = null,

@SerialName(value = "out_minter_price")
val outMinterPrice: kotlin.String? = null,

) {

companion object
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/*
* Copyright (c) 2025 TonTech
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
@file:Suppress(
"ArrayInDataClass",
"EnumEntryName",
"RemoveRedundantQualifierName",
"UnusedImport",
)

package io.ton.walletkit.api.generated

import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable

/**
* Options for configuring the referral in DeDust swap operations
*
* @param referralAddress The address of the referrer
* @param referralFeeBps Referral fee in basis points (max 100 = 1%)
*/
@Serializable
data class TONDeDustReferralOptions(

/* The address of the referrer */
@SerialName(value = "referralAddress")
val referralAddress: kotlin.String? = null,

/* Referral fee in basis points (max 100 = 1%) */
@SerialName(value = "referralFeeBps")
val referralFeeBps: kotlin.Int? = null,

) {

companion object
}
Loading