constructPactCommandPayload method
PactCommandPayload
constructPactCommandPayload({
- required SignRequest request,
- required String signingPubKey,
override
Takes the SignRequest object, and constructs a Pact Command Payload with it
Implementation
@override
PactCommandPayload constructPactCommandPayload({
required SignRequest request,
required String signingPubKey,
}) {
return PactCommandPayload(
networkId: request.networkId,
payload: CommandPayload(
exec: ExecMessage(
data: request.data ?? request.envData ?? {},
code: request.code ?? request.pactCode ?? '',
),
),
signers: [
SignerCapabilities(
pubKey: request.signingPubKey ?? signingPubKey,
clist: request.caps == null || request.caps!.isEmpty
? null
: request.caps?.map((e) => e.cap).toList(),
),
],
meta: CommandMetadata(
chainId: request.chainId,
gasLimit: request.gasLimit,
gasPrice: request.gasPrice,
sender: request.sender,
ttl: request.ttl,
),
);
}