Skip to content

adamant-api / helpers/transactions / createDelegateTransaction

Function: createDelegateTransaction() ​

ts
function createDelegateTransaction(data): {
  amount: number;
  asset: {
     delegate: {
        publicKey: string;
        username: string;
     };
  };
  recipientId: null;
  senderId: `U${string}`;
  senderPublicKey: string;
  signature: string;
  timestamp: number;
  timestampMs?: number;
  type: DELEGATE;
};

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

Creates and signs an ADM delegate registration transaction.

Parameters ​

ParameterType
dataDelegateTransactionData

Returns ​

ts
{
  amount: number;
  asset: {
     delegate: {
        publicKey: string;
        username: string;
     };
  };
  recipientId: null;
  senderId: `U${string}`;
  senderPublicKey: string;
  signature: string;
  timestamp: number;
  timestampMs?: number;
  type: DELEGATE;
}

amount ​

ts
amount: number;

asset ​

ts
asset: {
  delegate: {
     publicKey: string;
     username: string;
  };
};

asset.delegate ​

ts
delegate: {
  publicKey: string;
  username: string;
};

asset.delegate.publicKey ​

ts
publicKey: string;

asset.delegate.username ​

ts
username: string = details.username;

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

Released under the GPL-3.0 License.