parseRustInput function

Input parseRustInput(
  1. Input rustInput
)

Implementation

Input parseRustInput(fuels.Input rustInput) {
  return rustInput.map(
      inputCoin: (i) => InputCoin(
            owner: addHexPrefix(i.owner),
            amount: BigInt.from(i.amount),
            assetId: addHexPrefix(i.assetId),
            witnessIndex: i.witnessIndex ?? -1,
          ),
      inputContract: (i) =>
          InputContract(contractID: addHexPrefix(i.contractId)),
      inputMessage: (i) => InputMessage(
            amount: BigInt.from(i.amount),
            sender: addHexPrefix(i.sender),
            recipient: addHexPrefix(i.recipient),
            witnessIndex: i.witnessIndex ?? -1,
          ),
      unknownInput: (i) => UnknownInput(raw: Map.identity()));
}