Skip to content

adamant-api / helpers/transactions / createStateTransaction

Function: createStateTransaction() ​

ts
function createStateTransaction(data): {
  amount: number;
  asset: {
     state: {
        key: string;
        type: 0;
        value: string;
     };
  };
  recipientId: null;
  senderId: `U${string}`;
  senderPublicKey: string;
  signature: string;
  timestamp: number;
  timestampMs?: number;
  type: STATE;
};

Defined in: src/helpers/transactions/index.ts:122

Creates and signs an ADM key-value state transaction.

Parameters ​

ParameterType
dataStateTransactionData

Returns ​

ts
{
  amount: number;
  asset: {
     state: {
        key: string;
        type: 0;
        value: string;
     };
  };
  recipientId: null;
  senderId: `U${string}`;
  senderPublicKey: string;
  signature: string;
  timestamp: number;
  timestampMs?: number;
  type: STATE;
}

amount ​

ts
amount: number;

asset ​

ts
asset: {
  state: {
     key: string;
     type: 0;
     value: string;
  };
};

asset.state ​

ts
state: {
  key: string;
  type: 0;
  value: string;
};

asset.state.key ​

ts
key: string = details.key;

asset.state.type ​

ts
type: 0;

asset.state.value ​

ts
value: string = details.value;

recipientId ​

ts
recipientId: null = null;

senderId ​

ts
senderId: `U${string}`;

senderPublicKey ​

ts
senderPublicKey: string;

signature ​

ts
signature: string;

timestamp ​

ts
timestamp: number;

timestampMs? ​

ts
optional timestampMs?: number;

type ​

ts
type: STATE;

Released under the GPL-3.0 License.