Skip to content

adamant-api / helpers/transactions / createVoteTransaction

Function: createVoteTransaction() ​

ts
function createVoteTransaction(data): {
  amount: number;
  asset: {
     votes: string[];
  };
  recipientId: `U${string}`;
  senderId: `U${string}`;
  senderPublicKey: string;
  signature: string;
  timestamp: number;
  timestampMs?: number;
  type: VOTE;
};

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

Creates and signs an ADM delegate vote transaction.

Parameters ​

ParameterType
dataVoteTransactionData

Returns ​

ts
{
  amount: number;
  asset: {
     votes: string[];
  };
  recipientId: `U${string}`;
  senderId: `U${string}`;
  senderPublicKey: string;
  signature: string;
  timestamp: number;
  timestampMs?: number;
  type: VOTE;
}

amount ​

ts
amount: number;

asset ​

ts
asset: {
  votes: string[];
};

asset.votes ​

ts
votes: string[] = details.votes;

recipientId ​

ts
recipientId: `U${string}` = basicTransaction.senderId;

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: VOTE;

Released under the GPL-3.0 License.