pushCodeParamScript method

dynamic pushCodeParamScript (dynamic obj)

Implementation

pushCodeParamScript(dynamic obj) {
  if (obj is String) {
    pushHexStr(obj);
  } else if (obj is Uint8List) {
    pushHex(obj);
  } else if (obj is bool) {
    pushBool(obj);
  } else if (obj is int) {
    pushInt(obj);
  } else if (obj is BigInt) {
    pushBigInt(obj);
  } else if (obj is Address) {
    pushAddress(obj);
  } else if (obj is Struct) {
    obj.list.forEach((x) {
      pushCodeParamScript(x);
      pushOpcode(OpCode.dupfromaltstack);
      pushOpcode(OpCode.swap);
      pushOpcode(OpCode.append);
    });
  } else {
    throw ArgumentError(
        'Unsupported param type: ' + obj.runtimeType.toString());
  }
}