Skip to main content

Deposit

Mystiko Deposit Related APIs.

Data Structure

Quote

Retrieve quote information for a deposit.

import 'package:mystiko_flutter/mystiko_flutter.dart';

MystikoDepositApi api = await Mystiko.mystikoDepositApi();
Response<DepositQuote, DepositError> response = await api.quote(QuoteDepositOptions(chainId: 1, asset_symbol: 'MTT'));

QuoteDepositOptions:

ParameterRequiredDescription
chainIdtrue
The chain ID of the asset.
assetSymboltrue
Asset symbol.
queryTimeoutMsfalse
Query timeout in milliseconds.
dstChainIdfalse
Destination chain id.
bridgeTypefalse
Bridge type.

DepositQuote data structure is as follows:

PropertyTypeDescription
assetSymbolString
Asset symbol.
assetDecimalsInt
Asset decimals.
minAmountDouble
Minimum amount.
minDecimalAmountString
Minimum decimal amount.
maxAmountDouble
Maximum amount.
maxDecimalAmountString
Maximum decimal amount.
minRollupFeeAmountDouble
Minimum rollup fee amount.
minRollupFeeDecimalAmountString
Minimum rollup fee decimal amount.
rollupFeeAssetSymbolString
Rollup fee asset symbol.
rollupFeeAssetDecimalsInt
Rollup fee asset decimals.
minBridgeFeeAmountDouble
Minimum bridge fee amount.
minBridgeFeeDecimalAmountString
Minimum bridge fee decimal amount.
bridgeFeeAssetSymbolString
Bridge fee asset symbol.
bridgeFeeAssetDecimalsInt
Bridge fee asset decimals.
minExecutorFeeAmountDouble
Minimum executor fee amount.
minExecutorFeeDecimalAmountString
Minimum executor fee decimal amount.
executorFeeAssetSymbolString
Executor fee asset symbol.
executorFeeAssetDecimalsInt
Executor fee asset decimals.
recommendedAmountsList<Double>
Recommended amounts.
recommendedDecimalAmountsList<String>
Recommended decimal amounts.

Summary

Retrieve summary information for a deposit.

import 'package:mystiko_flutter/mystiko_flutter.dart';

MystikoDepositApi api = await Mystiko.mystikoDepositApi();
CreateDepositOptions options = CreateDepositOptions(
chain_id: 5,
asset_symbol: 'MTT',
amount: 10,
shielded_address: '0x123456789',
);
Response<DepositSummary, DepositError> response = await api.summary(options);

CreateDepositOptions:

ParameterRequiredDescription
chain_idtrue
Chain id.
asset_symboltrue
Asset symbol.
amounttrue
Amount.
shielded_addresstrue
Shielded address.
dst_chain_idfalse
Destination chain id.
rollup_fee_amountfalse
Rollup fee amount.
bridge_fee_amountfalse
Bridge fee amount.
executor_fee_amountfalse
Executor fee amount.
query_timeout_msfalse
Query timeout in milliseconds.
deposit_quotefalse
Deposit quote.
bridge_typefalse
Bridge type.

DepositSummary data structure is as follows:

PropertyTypeDescription
chainIdInt
Chain id.
assetSymbolString
Asset symbol.
assetDecimalsInt
Asset decimals.
amountDouble
Amount.
decimalAmountString
Decimal amount.
shieldedAddressString
Shielded address.
rollupFeeAmountDouble
Rollup fee amount.
rollupFeeDecimalAmountString
Rollup fee decimal amount.
rollupFeeAssetSymbolString
Rollup fee asset symbol.
rollupFeeAssetDecimalsInt
Rollup fee asset decimals.
dstChainIdInt
Destination chain id.
bridgeFeeAmountDouble
Bridge fee amount.
bridgeFeeDecimalAmountString
Bridge fee decimal amount.
bridgeFeeAssetSymbolString
Bridge fee asset symbol.
bridgeFeeAssetDecimalsInt
Bridge fee asset decimals.
executorFeeAmountDouble
Executor fee amount.
executorFeeDecimalAmountString
Executor fee decimal amount.
executorFeeAssetSymbolString
Executor fee asset symbol.
executorFeeAssetDecimalsInt
Executor fee asset decimals.
bridgeTypeBridgeType
Bridge type.
totalAmountsMap<String, Double>
Total amounts.
totalDecimalAmountsMap<String, String>
Total decimal amounts.

Create

Create a Deposit request.

import 'package:mystiko_flutter/mystiko_flutter.dart';

MystikoDepositApi api = await Mystiko.mystikoDepositApi();
CreateDepositOptions options = CreateDepositOptions(
chain_id: 5,
asset_symbol: 'MTT',
amount: 10,
shielded_address: '0x123456789',
);
Response<Deposit, DepositError> response = await api.create(options);

Deposit data structure is as follows:

PropertyTypeDescription
idString
Id.
createdAtInt
Created at.
updatedAtInt
Updated at.
chainIdInt
Chain id.
contractAddressString
Contract address.
poolAddressString
Pool address.
dstChainIdInt
Destination chain id.
dstChainContractAddressString
Destination chain contract address.
dstPoolAddressString
Destination pool address.
commitmentHashString
Commitment hash.
hashKString
Hash K.
randomSString
Random S.
encryptedNoteString
Encrypted note.
assetSymbolString
Asset symbol.
assetDecimalsInt
Asset decimals.
amountDouble
Amount.
decimalAmountString
Decimal amount.
rollupFeeAmountDouble
Rollup fee amount.
rollupFeeDecimalAmountString
Rollup fee decimal amount.
shieldedAddressString
Shielded address.
walletIdString
Wallet id.
assetAddressString
Asset address.
bridgeFeeAmountDouble
Bridge fee amount.
bridgeFeeDecimalAmountString
Bridge fee decimal amount.
executorFeeAmountDouble
Executor fee amount.
executorFeeDecimalAmountString
Executor fee decimal amount.
bridgeFeeAssetAddressString
Bridge fee asset address.
bridgeFeeAssetSymbolString
Bridge fee asset symbol.
bridgeFeeAssetDecimalsInt
Bridge fee asset decimals.
executorFeeAssetAddressString
Executor fee asset address.
executorFeeAssetSymbolString
Executor fee asset symbol.
executorFeeAssetDecimalsInt
Executor fee asset decimals.
queuedTransactionHashString
Queued transaction hash.
includedTransactionHashString
Included transaction hash.
srcChainTransactionHashString
Source chain transaction hash.
assetApproveTransactionHashList<String>
Asset approve transaction hash.
errorMessageString
Error message.
bridgeTypeBridgeType
Bridge type.
statusDepositStatus
Deposit status.

Send

Send a deposit transaction using a private key.

import 'package:mystiko_flutter/mystiko_flutter.dart';

MystikoDepositApi api = await Mystiko.mystikoDepositApi();
SendDepositOptions options = SendDepositOptions(
depositId: 'id',
privateKey: 'privateKey',
);
Response<Deposit, DepositError> response = await api.send(options);

SendDepositOptions:

ParameterRequiredDescription
depositIdtrue
Deposit id.
privateKeytrue
Private key.
signerProviderfalse
Signer provider.
queryTimeoutMsfalse
Query timeout in milliseconds.
assetApproveConfirmationsfalse
Asset approve confirmations.
depositConfirmationsfalse
Deposit confirmations.
txSendTimeoutMsfalse
Transaction send timeout in milliseconds.
txWaitTimeoutMsfalse
Transaction wait timeout in milliseconds.
txWaitIntervalMsfalse
Transaction wait interval in milliseconds.
assetApproveTxfalse
Asset approve transaction.
depositTxfalse
Deposit transaction.
screeningMessagefalse
Screening message.

SendWithGrpc

Send a deposit transaction by signing through the given gRPC interface.

import 'package:mystiko_flutter/mystiko_flutter.dart';

MystikoDepositApi api = await Mystiko.mystikoDepositApi();
SendDepositOptions options = SendDepositOptions(depositId: 'id');
ClientOptions clientOptions = ClientOptions(host: 'localhost', port: 50051);
Response<Deposit, DepositError> response = await api.sendWithGrpc(options, clientOptions);

ClientOptions:

ParameterRequiredDescription
hosttrue
Host.
porttrue
Port.
isSslfalse
Is SSL.
sslCertfalse
SSL cert.
sslCertPathfalse
SSL cert path.
sslServerNamefalse
SSL server name.

Find

Query deposit data using QueryFilter.

import 'package:mystiko_flutter/mystiko_flutter.dart';

MystikoDepositApi api = await Mystiko.mystikoDepositApi();
Response<List<Deposit>, DepositError> response = await api.find(QueryFilter());

FindAll

Query all Deposit data.

import 'package:mystiko_flutter/mystiko_flutter.dart';

MystikoDepositApi api = await Mystiko.mystikoDepositApi();
Response<List<Deposit>, DepositError> response = await api.findAll();

FindOne

Find a single Deposit record using QueryFilter.

import 'package:mystiko_flutter/mystiko_flutter.dart';

MystikoDepositApi api = await Mystiko.mystikoDepositApi();
Response<Deposit, DepositError> response = await api.findOne(QueryFilter);

FindById

Find a single Deposit record by its ID.

import 'package:mystiko_flutter/mystiko_flutter.dart';

MystikoDepositApi api = await Mystiko.mystikoDepositApi();
Response<Deposit, DepositError> response = await api.findById('id');

Count

Query the count of data that matches the QueryFilter criteria.

import 'package:mystiko_flutter/mystiko_flutter.dart';

MystikoDepositApi api = await Mystiko.mystikoDepositApi();
Response<Int64, DepositError> response = await api.count(QueryFilter());

CountAll

Query the total count of all Deposit data.

import 'package:mystiko_flutter/mystiko_flutter.dart';

MystikoDepositApi api = await Mystiko.mystikoDepositApi();
Response<Int64, DepositError> response = await api.countAll();

Update

Update a Deposit record.

import 'package:mystiko_flutter/mystiko_flutter.dart';

MystikoDepositApi api = await Mystiko.mystikoDepositApi();
Response<Deposit, DepositError> response = await api.update(Deposit());

UpdateBatch

Batch update Deposit records.

import 'package:mystiko_flutter/mystiko_flutter.dart';

MystikoDepositApi api = await Mystiko.mystikoDepositApi();
List<Deposit> deposits = [Deposit(), Deposit()];
Response<List<Deposit>, DepositError> response = await api.updateBatch(deposits);

UpdateByFilter

Update Deposit records based on the conditions specified in the QueryFilter.

import 'package:mystiko_flutter/mystiko_flutter.dart';

MystikoDepositApi api = await Mystiko.mystikoDepositApi();
List<ColumnValuePair> pairs = [ColumnValuePair(column: 'chainId', value: ColumnValue(i64Value: 1))];
Response<void, DepositError> response = await api.updateByFilter(pairs, QueryFilter());

UpdateAll

Update all Deposit records.

import 'package:mystiko_flutter/mystiko_flutter.dart';

MystikoDepositApi api = await Mystiko.mystikoDepositApi();
List<ColumnValuePair> pairs = [ColumnValuePair()];
Response<void, DepositError> response = await api.updateAll(pairs);

Delete

Delete a Deposit record.

import 'package:mystiko_flutter/mystiko_flutter.dart';

MystikoDepositApi api = await Mystiko.mystikoDepositApi();
Response<void, DepositError> response = await api.delete(Deposit());

DeleteBatch

Batch delete Deposit records.

import 'package:mystiko_flutter/mystiko_flutter.dart';

MystikoDepositApi api = await Mystiko.mystikoDepositApi();
List<Deposit> deposits = [Deposit(), Deposit()];
Response<void, DepositError> response = await api.deleteBatch(deposits);

DeleteByFilter

Delete Deposit records based on the conditions specified in the QueryFilter.

import 'package:mystiko_flutter/mystiko_flutter.dart';

MystikoDepositApi api = await Mystiko.mystikoDepositApi();
Response<void, DepositError> response = await api.deleteByFilter(QueryFilter());

DeleteAll

Delete all Deposit records.

import 'package:mystiko_flutter/mystiko_flutter.dart';

MystikoDepositApi api = await Mystiko.mystikoDepositApi();
Response<void, DepositError> response = await api.deleteAll();