/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version 4.0.2
 *
 * This file is not intended to be easily readable and contains a number of
 * coding conventions designed to improve portability and efficiency. Do not make
 * changes to this file unless you know what you are doing--modify the SWIG
 * interface file instead.
 * ----------------------------------------------------------------------------- */


#ifndef SWIGPYTHON
#define SWIGPYTHON
#endif

#define SWIG_PYTHON_DIRECTOR_NO_VTABLE

/* -----------------------------------------------------------------------------
 *  This section contains generic SWIG labels for method/variable
 *  declarations/attributes, and other compiler dependent labels.
 * ----------------------------------------------------------------------------- */

/* template workaround for compilers that cannot correctly implement the C++ standard */
#ifndef SWIGTEMPLATEDISAMBIGUATOR
# if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
#  define SWIGTEMPLATEDISAMBIGUATOR template
# elif defined(__HP_aCC)
/* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
/* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
#  define SWIGTEMPLATEDISAMBIGUATOR template
# else
#  define SWIGTEMPLATEDISAMBIGUATOR
# endif
#endif

/* inline attribute */
#ifndef SWIGINLINE
# if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
#   define SWIGINLINE inline
# else
#   define SWIGINLINE
# endif
#endif

/* attribute recognised by some compilers to avoid 'unused' warnings */
#ifndef SWIGUNUSED
# if defined(__GNUC__)
#   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
#     define SWIGUNUSED __attribute__ ((__unused__))
#   else
#     define SWIGUNUSED
#   endif
# elif defined(__ICC)
#   define SWIGUNUSED __attribute__ ((__unused__))
# else
#   define SWIGUNUSED
# endif
#endif

#ifndef SWIG_MSC_UNSUPPRESS_4505
# if defined(_MSC_VER)
#   pragma warning(disable : 4505) /* unreferenced local function has been removed */
# endif
#endif

#ifndef SWIGUNUSEDPARM
# ifdef __cplusplus
#   define SWIGUNUSEDPARM(p)
# else
#   define SWIGUNUSEDPARM(p) p SWIGUNUSED
# endif
#endif

/* internal SWIG method */
#ifndef SWIGINTERN
# define SWIGINTERN static SWIGUNUSED
#endif

/* internal inline SWIG method */
#ifndef SWIGINTERNINLINE
# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
#endif

/* exporting methods */
#if defined(__GNUC__)
#  if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
#    ifndef GCC_HASCLASSVISIBILITY
#      define GCC_HASCLASSVISIBILITY
#    endif
#  endif
#endif

#ifndef SWIGEXPORT
# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
#   if defined(STATIC_LINKED)
#     define SWIGEXPORT
#   else
#     define SWIGEXPORT __declspec(dllexport)
#   endif
# else
#   if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
#     define SWIGEXPORT __attribute__ ((visibility("default")))
#   else
#     define SWIGEXPORT
#   endif
# endif
#endif

/* calling conventions for Windows */
#ifndef SWIGSTDCALL
# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
#   define SWIGSTDCALL __stdcall
# else
#   define SWIGSTDCALL
# endif
#endif

/* Deal with Microsoft's attempt at deprecating C standard runtime functions */
#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
# define _CRT_SECURE_NO_DEPRECATE
#endif

/* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
#if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
# define _SCL_SECURE_NO_DEPRECATE
#endif

/* Deal with Apple's deprecated 'AssertMacros.h' from Carbon-framework */
#if defined(__APPLE__) && !defined(__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES)
# define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 0
#endif

/* Intel's compiler complains if a variable which was never initialised is
 * cast to void, which is a common idiom which we use to indicate that we
 * are aware a variable isn't used.  So we just silence that warning.
 * See: https://github.com/swig/swig/issues/192 for more discussion.
 */
#ifdef __INTEL_COMPILER
# pragma warning disable 592
#endif


#if defined(__GNUC__) && defined(_WIN32) && !defined(SWIG_PYTHON_NO_HYPOT_WORKAROUND)
/* Workaround for '::hypot' has not been declared', see https://bugs.python.org/issue11566 */
# include <math.h>
#endif

#if defined(_DEBUG) && defined(SWIG_PYTHON_INTERPRETER_NO_DEBUG)
/* Use debug wrappers with the Python release dll */
# undef _DEBUG
# include <Python.h>
# define _DEBUG 1
#else
# include <Python.h>
#endif

/* -----------------------------------------------------------------------------
 * swigrun.swg
 *
 * This file contains generic C API SWIG runtime support for pointer
 * type checking.
 * ----------------------------------------------------------------------------- */

/* This should only be incremented when either the layout of swig_type_info changes,
   or for whatever reason, the runtime changes incompatibly */
#define SWIG_RUNTIME_VERSION "4"

/* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */
#ifdef SWIG_TYPE_TABLE
# define SWIG_QUOTE_STRING(x) #x
# define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x)
# define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE)
#else
# define SWIG_TYPE_TABLE_NAME
#endif

/*
  You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
  creating a static or dynamic library from the SWIG runtime code.
  In 99.9% of the cases, SWIG just needs to declare them as 'static'.

  But only do this if strictly necessary, ie, if you have problems
  with your compiler or suchlike.
*/

#ifndef SWIGRUNTIME
# define SWIGRUNTIME SWIGINTERN
#endif

#ifndef SWIGRUNTIMEINLINE
# define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE
#endif

/*  Generic buffer size */
#ifndef SWIG_BUFFER_SIZE
# define SWIG_BUFFER_SIZE 1024
#endif

/* Flags for pointer conversions */
#define SWIG_POINTER_DISOWN        0x1
#define SWIG_CAST_NEW_MEMORY       0x2
#define SWIG_POINTER_NO_NULL       0x4

/* Flags for new pointer objects */
#define SWIG_POINTER_OWN           0x1


/*
   Flags/methods for returning states.

   The SWIG conversion methods, as ConvertPtr, return an integer
   that tells if the conversion was successful or not. And if not,
   an error code can be returned (see swigerrors.swg for the codes).

   Use the following macros/flags to set or process the returning
   states.

   In old versions of SWIG, code such as the following was usually written:

     if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) {
       // success code
     } else {
       //fail code
     }

   Now you can be more explicit:

    int res = SWIG_ConvertPtr(obj,vptr,ty.flags);
    if (SWIG_IsOK(res)) {
      // success code
    } else {
      // fail code
    }

   which is the same really, but now you can also do

    Type *ptr;
    int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags);
    if (SWIG_IsOK(res)) {
      // success code
      if (SWIG_IsNewObj(res) {
        ...
	delete *ptr;
      } else {
        ...
      }
    } else {
      // fail code
    }

   I.e., now SWIG_ConvertPtr can return new objects and you can
   identify the case and take care of the deallocation. Of course that
   also requires SWIG_ConvertPtr to return new result values, such as

      int SWIG_ConvertPtr(obj, ptr,...) {
        if (<obj is ok>) {
          if (<need new object>) {
            *ptr = <ptr to new allocated object>;
            return SWIG_NEWOBJ;
          } else {
            *ptr = <ptr to old object>;
            return SWIG_OLDOBJ;
          }
        } else {
          return SWIG_BADOBJ;
        }
      }

   Of course, returning the plain '0(success)/-1(fail)' still works, but you can be
   more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the
   SWIG errors code.

   Finally, if the SWIG_CASTRANK_MODE is enabled, the result code
   allows to return the 'cast rank', for example, if you have this

       int food(double)
       int fooi(int);

   and you call

      food(1)   // cast rank '1'  (1 -> 1.0)
      fooi(1)   // cast rank '0'

   just use the SWIG_AddCast()/SWIG_CheckState()
*/

#define SWIG_OK                    (0)
#define SWIG_ERROR                 (-1)
#define SWIG_IsOK(r)               (r >= 0)
#define SWIG_ArgError(r)           ((r != SWIG_ERROR) ? r : SWIG_TypeError)

/* The CastRankLimit says how many bits are used for the cast rank */
#define SWIG_CASTRANKLIMIT         (1 << 8)
/* The NewMask denotes the object was created (using new/malloc) */
#define SWIG_NEWOBJMASK            (SWIG_CASTRANKLIMIT  << 1)
/* The TmpMask is for in/out typemaps that use temporal objects */
#define SWIG_TMPOBJMASK            (SWIG_NEWOBJMASK << 1)
/* Simple returning values */
#define SWIG_BADOBJ                (SWIG_ERROR)
#define SWIG_OLDOBJ                (SWIG_OK)
#define SWIG_NEWOBJ                (SWIG_OK | SWIG_NEWOBJMASK)
#define SWIG_TMPOBJ                (SWIG_OK | SWIG_TMPOBJMASK)
/* Check, add and del mask methods */
#define SWIG_AddNewMask(r)         (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r)
#define SWIG_DelNewMask(r)         (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r)
#define SWIG_IsNewObj(r)           (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK))
#define SWIG_AddTmpMask(r)         (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r)
#define SWIG_DelTmpMask(r)         (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r)
#define SWIG_IsTmpObj(r)           (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK))

/* Cast-Rank Mode */
#if defined(SWIG_CASTRANK_MODE)
#  ifndef SWIG_TypeRank
#    define SWIG_TypeRank             unsigned long
#  endif
#  ifndef SWIG_MAXCASTRANK            /* Default cast allowed */
#    define SWIG_MAXCASTRANK          (2)
#  endif
#  define SWIG_CASTRANKMASK          ((SWIG_CASTRANKLIMIT) -1)
#  define SWIG_CastRank(r)           (r & SWIG_CASTRANKMASK)
SWIGINTERNINLINE int SWIG_AddCast(int r) {
  return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r;
}
SWIGINTERNINLINE int SWIG_CheckState(int r) {
  return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0;
}
#else /* no cast-rank mode */
#  define SWIG_AddCast(r) (r)
#  define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0)
#endif


#include <string.h>

#ifdef __cplusplus
extern "C" {
#endif

typedef void *(*swig_converter_func)(void *, int *);
typedef struct swig_type_info *(*swig_dycast_func)(void **);

/* Structure to store information on one type */
typedef struct swig_type_info {
  const char             *name;			/* mangled name of this type */
  const char             *str;			/* human readable name of this type */
  swig_dycast_func        dcast;		/* dynamic cast function down a hierarchy */
  struct swig_cast_info  *cast;			/* linked list of types that can cast into this type */
  void                   *clientdata;		/* language specific type data */
  int                    owndata;		/* flag if the structure owns the clientdata */
} swig_type_info;

/* Structure to store a type and conversion function used for casting */
typedef struct swig_cast_info {
  swig_type_info         *type;			/* pointer to type that is equivalent to this type */
  swig_converter_func     converter;		/* function to cast the void pointers */
  struct swig_cast_info  *next;			/* pointer to next cast in linked list */
  struct swig_cast_info  *prev;			/* pointer to the previous cast */
} swig_cast_info;

/* Structure used to store module information
 * Each module generates one structure like this, and the runtime collects
 * all of these structures and stores them in a circularly linked list.*/
typedef struct swig_module_info {
  swig_type_info         **types;		/* Array of pointers to swig_type_info structures that are in this module */
  size_t                 size;		        /* Number of types in this module */
  struct swig_module_info *next;		/* Pointer to next element in circularly linked list */
  swig_type_info         **type_initial;	/* Array of initially generated type structures */
  swig_cast_info         **cast_initial;	/* Array of initially generated casting structures */
  void                    *clientdata;		/* Language specific module data */
} swig_module_info;

/*
  Compare two type names skipping the space characters, therefore
  "char*" == "char *" and "Class<int>" == "Class<int >", etc.

  Return 0 when the two name types are equivalent, as in
  strncmp, but skipping ' '.
*/
SWIGRUNTIME int
SWIG_TypeNameComp(const char *f1, const char *l1,
		  const char *f2, const char *l2) {
  for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) {
    while ((*f1 == ' ') && (f1 != l1)) ++f1;
    while ((*f2 == ' ') && (f2 != l2)) ++f2;
    if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1;
  }
  return (int)((l1 - f1) - (l2 - f2));
}

/*
  Check type equivalence in a name list like <name1>|<name2>|...
  Return 0 if equal, -1 if nb < tb, 1 if nb > tb
*/
SWIGRUNTIME int
SWIG_TypeCmp(const char *nb, const char *tb) {
  int equiv = 1;
  const char* te = tb + strlen(tb);
  const char* ne = nb;
  while (equiv != 0 && *ne) {
    for (nb = ne; *ne; ++ne) {
      if (*ne == '|') break;
    }
    equiv = SWIG_TypeNameComp(nb, ne, tb, te);
    if (*ne) ++ne;
  }
  return equiv;
}

/*
  Check type equivalence in a name list like <name1>|<name2>|...
  Return 0 if not equal, 1 if equal
*/
SWIGRUNTIME int
SWIG_TypeEquiv(const char *nb, const char *tb) {
  return SWIG_TypeCmp(nb, tb) == 0 ? 1 : 0;
}

/*
  Check the typename
*/
SWIGRUNTIME swig_cast_info *
SWIG_TypeCheck(const char *c, swig_type_info *ty) {
  if (ty) {
    swig_cast_info *iter = ty->cast;
    while (iter) {
      if (strcmp(iter->type->name, c) == 0) {
        if (iter == ty->cast)
          return iter;
        /* Move iter to the top of the linked list */
        iter->prev->next = iter->next;
        if (iter->next)
          iter->next->prev = iter->prev;
        iter->next = ty->cast;
        iter->prev = 0;
        if (ty->cast) ty->cast->prev = iter;
        ty->cast = iter;
        return iter;
      }
      iter = iter->next;
    }
  }
  return 0;
}

/*
  Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison
*/
SWIGRUNTIME swig_cast_info *
SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty) {
  if (ty) {
    swig_cast_info *iter = ty->cast;
    while (iter) {
      if (iter->type == from) {
        if (iter == ty->cast)
          return iter;
        /* Move iter to the top of the linked list */
        iter->prev->next = iter->next;
        if (iter->next)
          iter->next->prev = iter->prev;
        iter->next = ty->cast;
        iter->prev = 0;
        if (ty->cast) ty->cast->prev = iter;
        ty->cast = iter;
        return iter;
      }
      iter = iter->next;
    }
  }
  return 0;
}

/*
  Cast a pointer up an inheritance hierarchy
*/
SWIGRUNTIMEINLINE void *
SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) {
  return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory);
}

/*
   Dynamic pointer casting. Down an inheritance hierarchy
*/
SWIGRUNTIME swig_type_info *
SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) {
  swig_type_info *lastty = ty;
  if (!ty || !ty->dcast) return ty;
  while (ty && (ty->dcast)) {
    ty = (*ty->dcast)(ptr);
    if (ty) lastty = ty;
  }
  return lastty;
}

/*
  Return the name associated with this type
*/
SWIGRUNTIMEINLINE const char *
SWIG_TypeName(const swig_type_info *ty) {
  return ty->name;
}

/*
  Return the pretty name associated with this type,
  that is an unmangled type name in a form presentable to the user.
*/
SWIGRUNTIME const char *
SWIG_TypePrettyName(const swig_type_info *type) {
  /* The "str" field contains the equivalent pretty names of the
     type, separated by vertical-bar characters.  We choose
     to print the last name, as it is often (?) the most
     specific. */
  if (!type) return NULL;
  if (type->str != NULL) {
    const char *last_name = type->str;
    const char *s;
    for (s = type->str; *s; s++)
      if (*s == '|') last_name = s+1;
    return last_name;
  }
  else
    return type->name;
}

/*
   Set the clientdata field for a type
*/
SWIGRUNTIME void
SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
  swig_cast_info *cast = ti->cast;
  /* if (ti->clientdata == clientdata) return; */
  ti->clientdata = clientdata;

  while (cast) {
    if (!cast->converter) {
      swig_type_info *tc = cast->type;
      if (!tc->clientdata) {
	SWIG_TypeClientData(tc, clientdata);
      }
    }
    cast = cast->next;
  }
}
SWIGRUNTIME void
SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) {
  SWIG_TypeClientData(ti, clientdata);
  ti->owndata = 1;
}

/*
  Search for a swig_type_info structure only by mangled name
  Search is a O(log #types)

  We start searching at module start, and finish searching when start == end.
  Note: if start == end at the beginning of the function, we go all the way around
  the circular list.
*/
SWIGRUNTIME swig_type_info *
SWIG_MangledTypeQueryModule(swig_module_info *start,
                            swig_module_info *end,
		            const char *name) {
  swig_module_info *iter = start;
  do {
    if (iter->size) {
      size_t l = 0;
      size_t r = iter->size - 1;
      do {
	/* since l+r >= 0, we can (>> 1) instead (/ 2) */
	size_t i = (l + r) >> 1;
	const char *iname = iter->types[i]->name;
	if (iname) {
	  int compare = strcmp(name, iname);
	  if (compare == 0) {
	    return iter->types[i];
	  } else if (compare < 0) {
	    if (i) {
	      r = i - 1;
	    } else {
	      break;
	    }
	  } else if (compare > 0) {
	    l = i + 1;
	  }
	} else {
	  break; /* should never happen */
	}
      } while (l <= r);
    }
    iter = iter->next;
  } while (iter != end);
  return 0;
}

/*
  Search for a swig_type_info structure for either a mangled name or a human readable name.
  It first searches the mangled names of the types, which is a O(log #types)
  If a type is not found it then searches the human readable names, which is O(#types).

  We start searching at module start, and finish searching when start == end.
  Note: if start == end at the beginning of the function, we go all the way around
  the circular list.
*/
SWIGRUNTIME swig_type_info *
SWIG_TypeQueryModule(swig_module_info *start,
                     swig_module_info *end,
		     const char *name) {
  /* STEP 1: Search the name field using binary search */
  swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
  if (ret) {
    return ret;
  } else {
    /* STEP 2: If the type hasn't been found, do a complete search
       of the str field (the human readable name) */
    swig_module_info *iter = start;
    do {
      size_t i = 0;
      for (; i < iter->size; ++i) {
	if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name)))
	  return iter->types[i];
      }
      iter = iter->next;
    } while (iter != end);
  }

  /* neither found a match */
  return 0;
}

/*
   Pack binary data into a string
*/
SWIGRUNTIME char *
SWIG_PackData(char *c, void *ptr, size_t sz) {
  static const char hex[17] = "0123456789abcdef";
  const unsigned char *u = (unsigned char *) ptr;
  const unsigned char *eu =  u + sz;
  for (; u != eu; ++u) {
    unsigned char uu = *u;
    *(c++) = hex[(uu & 0xf0) >> 4];
    *(c++) = hex[uu & 0xf];
  }
  return c;
}

/*
   Unpack binary data from a string
*/
SWIGRUNTIME const char *
SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
  unsigned char *u = (unsigned char *) ptr;
  const unsigned char *eu = u + sz;
  for (; u != eu; ++u) {
    char d = *(c++);
    unsigned char uu;
    if ((d >= '0') && (d <= '9'))
      uu = (unsigned char)((d - '0') << 4);
    else if ((d >= 'a') && (d <= 'f'))
      uu = (unsigned char)((d - ('a'-10)) << 4);
    else
      return (char *) 0;
    d = *(c++);
    if ((d >= '0') && (d <= '9'))
      uu |= (unsigned char)(d - '0');
    else if ((d >= 'a') && (d <= 'f'))
      uu |= (unsigned char)(d - ('a'-10));
    else
      return (char *) 0;
    *u = uu;
  }
  return c;
}

/*
   Pack 'void *' into a string buffer.
*/
SWIGRUNTIME char *
SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) {
  char *r = buff;
  if ((2*sizeof(void *) + 2) > bsz) return 0;
  *(r++) = '_';
  r = SWIG_PackData(r,&ptr,sizeof(void *));
  if (strlen(name) + 1 > (bsz - (r - buff))) return 0;
  strcpy(r,name);
  return buff;
}

SWIGRUNTIME const char *
SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) {
  if (*c != '_') {
    if (strcmp(c,"NULL") == 0) {
      *ptr = (void *) 0;
      return name;
    } else {
      return 0;
    }
  }
  return SWIG_UnpackData(++c,ptr,sizeof(void *));
}

SWIGRUNTIME char *
SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) {
  char *r = buff;
  size_t lname = (name ? strlen(name) : 0);
  if ((2*sz + 2 + lname) > bsz) return 0;
  *(r++) = '_';
  r = SWIG_PackData(r,ptr,sz);
  if (lname) {
    strncpy(r,name,lname+1);
  } else {
    *r = 0;
  }
  return buff;
}

SWIGRUNTIME const char *
SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
  if (*c != '_') {
    if (strcmp(c,"NULL") == 0) {
      memset(ptr,0,sz);
      return name;
    } else {
      return 0;
    }
  }
  return SWIG_UnpackData(++c,ptr,sz);
}

#ifdef __cplusplus
}
#endif

/*  Errors in SWIG */
#define  SWIG_UnknownError    	   -1
#define  SWIG_IOError        	   -2
#define  SWIG_RuntimeError   	   -3
#define  SWIG_IndexError     	   -4
#define  SWIG_TypeError      	   -5
#define  SWIG_DivisionByZero 	   -6
#define  SWIG_OverflowError  	   -7
#define  SWIG_SyntaxError    	   -8
#define  SWIG_ValueError     	   -9
#define  SWIG_SystemError    	   -10
#define  SWIG_AttributeError 	   -11
#define  SWIG_MemoryError    	   -12
#define  SWIG_NullReferenceError   -13



/* Compatibility macros for Python 3 */
#if PY_VERSION_HEX >= 0x03000000

#define PyClass_Check(obj) PyObject_IsInstance(obj, (PyObject *)&PyType_Type)
#define PyInt_Check(x) PyLong_Check(x)
#define PyInt_AsLong(x) PyLong_AsLong(x)
#define PyInt_FromLong(x) PyLong_FromLong(x)
#define PyInt_FromSize_t(x) PyLong_FromSize_t(x)
#define PyString_Check(name) PyBytes_Check(name)
#define PyString_FromString(x) PyUnicode_FromString(x)
#define PyString_Format(fmt, args)  PyUnicode_Format(fmt, args)
#define PyString_AsString(str) PyBytes_AsString(str)
#define PyString_Size(str) PyBytes_Size(str)	
#define PyString_InternFromString(key) PyUnicode_InternFromString(key)
#define Py_TPFLAGS_HAVE_CLASS Py_TPFLAGS_BASETYPE
#define PyString_AS_STRING(x) PyUnicode_AS_STRING(x)
#define _PyLong_FromSsize_t(x) PyLong_FromSsize_t(x)

#endif

#ifndef Py_TYPE
#  define Py_TYPE(op) ((op)->ob_type)
#endif

/* SWIG APIs for compatibility of both Python 2 & 3 */

#if PY_VERSION_HEX >= 0x03000000
#  define SWIG_Python_str_FromFormat PyUnicode_FromFormat
#else
#  define SWIG_Python_str_FromFormat PyString_FromFormat
#endif


/* Warning: This function will allocate a new string in Python 3,
 * so please call SWIG_Python_str_DelForPy3(x) to free the space.
 */
SWIGINTERN char*
SWIG_Python_str_AsChar(PyObject *str)
{
#if PY_VERSION_HEX >= 0x03030000
  return (char *)PyUnicode_AsUTF8(str);
#elif PY_VERSION_HEX >= 0x03000000
  char *newstr = 0;
  str = PyUnicode_AsUTF8String(str);
  if (str) {
    char *cstr;
    Py_ssize_t len;
    if (PyBytes_AsStringAndSize(str, &cstr, &len) != -1) {
      newstr = (char *) malloc(len+1);
      if (newstr)
        memcpy(newstr, cstr, len+1);
    }
    Py_XDECREF(str);
  }
  return newstr;
#else
  return PyString_AsString(str);
#endif
}

#if PY_VERSION_HEX >= 0x03030000 || PY_VERSION_HEX < 0x03000000
#  define SWIG_Python_str_DelForPy3(x)
#else
#  define SWIG_Python_str_DelForPy3(x) free( (void*) (x) )
#endif


SWIGINTERN PyObject*
SWIG_Python_str_FromChar(const char *c)
{
#if PY_VERSION_HEX >= 0x03000000
  return PyUnicode_FromString(c); 
#else
  return PyString_FromString(c);
#endif
}

#ifndef PyObject_DEL
# define PyObject_DEL PyObject_Del
#endif

// SWIGPY_USE_CAPSULE is no longer used within SWIG itself, but some user
// interface files check for it.
# define SWIGPY_USE_CAPSULE
# define SWIGPY_CAPSULE_NAME ("swig_runtime_data" SWIG_RUNTIME_VERSION ".type_pointer_capsule" SWIG_TYPE_TABLE_NAME)

#if PY_VERSION_HEX < 0x03020000
#define PyDescr_TYPE(x) (((PyDescrObject *)(x))->d_type)
#define PyDescr_NAME(x) (((PyDescrObject *)(x))->d_name)
#define Py_hash_t long
#endif

/* -----------------------------------------------------------------------------
 * error manipulation
 * ----------------------------------------------------------------------------- */

SWIGRUNTIME PyObject*
SWIG_Python_ErrorType(int code) {
  PyObject* type = 0;
  switch(code) {
  case SWIG_MemoryError:
    type = PyExc_MemoryError;
    break;
  case SWIG_IOError:
    type = PyExc_IOError;
    break;
  case SWIG_RuntimeError:
    type = PyExc_RuntimeError;
    break;
  case SWIG_IndexError:
    type = PyExc_IndexError;
    break;
  case SWIG_TypeError:
    type = PyExc_TypeError;
    break;
  case SWIG_DivisionByZero:
    type = PyExc_ZeroDivisionError;
    break;
  case SWIG_OverflowError:
    type = PyExc_OverflowError;
    break;
  case SWIG_SyntaxError:
    type = PyExc_SyntaxError;
    break;
  case SWIG_ValueError:
    type = PyExc_ValueError;
    break;
  case SWIG_SystemError:
    type = PyExc_SystemError;
    break;
  case SWIG_AttributeError:
    type = PyExc_AttributeError;
    break;
  default:
    type = PyExc_RuntimeError;
  }
  return type;
}


SWIGRUNTIME void
SWIG_Python_AddErrorMsg(const char* mesg)
{
  PyObject *type = 0;
  PyObject *value = 0;
  PyObject *traceback = 0;

  if (PyErr_Occurred())
    PyErr_Fetch(&type, &value, &traceback);
  if (value) {
    PyObject *old_str = PyObject_Str(value);
    const char *tmp = SWIG_Python_str_AsChar(old_str);
    PyErr_Clear();
    Py_XINCREF(type);
    if (tmp)
      PyErr_Format(type, "%s %s", tmp, mesg);
    else
      PyErr_Format(type, "%s", mesg);
    SWIG_Python_str_DelForPy3(tmp);
    Py_DECREF(old_str);
    Py_DECREF(value);
  } else {
    PyErr_SetString(PyExc_RuntimeError, mesg);
  }
}

SWIGRUNTIME int
SWIG_Python_TypeErrorOccurred(PyObject *obj)
{
  PyObject *error;
  if (obj)
    return 0;
  error = PyErr_Occurred();
  return error && PyErr_GivenExceptionMatches(error, PyExc_TypeError);
}

SWIGRUNTIME void
SWIG_Python_RaiseOrModifyTypeError(const char *message)
{
  if (SWIG_Python_TypeErrorOccurred(NULL)) {
    /* Use existing TypeError to preserve stacktrace and enhance with given message */
    PyObject *newvalue;
    PyObject *type = NULL, *value = NULL, *traceback = NULL;
    PyErr_Fetch(&type, &value, &traceback);
#if PY_VERSION_HEX >= 0x03000000
    newvalue = PyUnicode_FromFormat("%S\nAdditional information:\n%s", value, message);
#else
    newvalue = PyString_FromFormat("%s\nAdditional information:\n%s", PyString_AsString(value), message);
#endif
    Py_XDECREF(value);
    PyErr_Restore(type, newvalue, traceback);
  } else {
    /* Raise TypeError using given message */
    PyErr_SetString(PyExc_TypeError, message);
  }
}

#if defined(SWIG_PYTHON_NO_THREADS)
#  if defined(SWIG_PYTHON_THREADS)
#    undef SWIG_PYTHON_THREADS
#  endif
#endif
#if defined(SWIG_PYTHON_THREADS) /* Threading support is enabled */
#  if !defined(SWIG_PYTHON_USE_GIL) && !defined(SWIG_PYTHON_NO_USE_GIL)
#    define SWIG_PYTHON_USE_GIL
#  endif
#  if defined(SWIG_PYTHON_USE_GIL) /* Use PyGILState threads calls */
#    ifndef SWIG_PYTHON_INITIALIZE_THREADS
#     define SWIG_PYTHON_INITIALIZE_THREADS  PyEval_InitThreads() 
#    endif
#    ifdef __cplusplus /* C++ code */
       class SWIG_Python_Thread_Block {
         bool status;
         PyGILState_STATE state;
       public:
         void end() { if (status) { PyGILState_Release(state); status = false;} }
         SWIG_Python_Thread_Block() : status(true), state(PyGILState_Ensure()) {}
         ~SWIG_Python_Thread_Block() { end(); }
       };
       class SWIG_Python_Thread_Allow {
         bool status;
         PyThreadState *save;
       public:
         void end() { if (status) { PyEval_RestoreThread(save); status = false; }}
         SWIG_Python_Thread_Allow() : status(true), save(PyEval_SaveThread()) {}
         ~SWIG_Python_Thread_Allow() { end(); }
       };
#      define SWIG_PYTHON_THREAD_BEGIN_BLOCK   SWIG_Python_Thread_Block _swig_thread_block
#      define SWIG_PYTHON_THREAD_END_BLOCK     _swig_thread_block.end()
#      define SWIG_PYTHON_THREAD_BEGIN_ALLOW   SWIG_Python_Thread_Allow _swig_thread_allow
#      define SWIG_PYTHON_THREAD_END_ALLOW     _swig_thread_allow.end()
#    else /* C code */
#      define SWIG_PYTHON_THREAD_BEGIN_BLOCK   PyGILState_STATE _swig_thread_block = PyGILState_Ensure()
#      define SWIG_PYTHON_THREAD_END_BLOCK     PyGILState_Release(_swig_thread_block)
#      define SWIG_PYTHON_THREAD_BEGIN_ALLOW   PyThreadState *_swig_thread_allow = PyEval_SaveThread()
#      define SWIG_PYTHON_THREAD_END_ALLOW     PyEval_RestoreThread(_swig_thread_allow)
#    endif
#  else /* Old thread way, not implemented, user must provide it */
#    if !defined(SWIG_PYTHON_INITIALIZE_THREADS)
#      define SWIG_PYTHON_INITIALIZE_THREADS
#    endif
#    if !defined(SWIG_PYTHON_THREAD_BEGIN_BLOCK)
#      define SWIG_PYTHON_THREAD_BEGIN_BLOCK
#    endif
#    if !defined(SWIG_PYTHON_THREAD_END_BLOCK)
#      define SWIG_PYTHON_THREAD_END_BLOCK
#    endif
#    if !defined(SWIG_PYTHON_THREAD_BEGIN_ALLOW)
#      define SWIG_PYTHON_THREAD_BEGIN_ALLOW
#    endif
#    if !defined(SWIG_PYTHON_THREAD_END_ALLOW)
#      define SWIG_PYTHON_THREAD_END_ALLOW
#    endif
#  endif
#else /* No thread support */
#  define SWIG_PYTHON_INITIALIZE_THREADS
#  define SWIG_PYTHON_THREAD_BEGIN_BLOCK
#  define SWIG_PYTHON_THREAD_END_BLOCK
#  define SWIG_PYTHON_THREAD_BEGIN_ALLOW
#  define SWIG_PYTHON_THREAD_END_ALLOW
#endif

/* -----------------------------------------------------------------------------
 * Python API portion that goes into the runtime
 * ----------------------------------------------------------------------------- */

#ifdef __cplusplus
extern "C" {
#endif

/* -----------------------------------------------------------------------------
 * Constant declarations
 * ----------------------------------------------------------------------------- */

/* Constant Types */
#define SWIG_PY_POINTER 4
#define SWIG_PY_BINARY  5

/* Constant information structure */
typedef struct swig_const_info {
  int type;
  const char *name;
  long lvalue;
  double dvalue;
  void   *pvalue;
  swig_type_info **ptype;
} swig_const_info;

#ifdef __cplusplus
}
#endif


/* -----------------------------------------------------------------------------
 * pyrun.swg
 *
 * This file contains the runtime support for Python modules
 * and includes code for managing global variables and pointer
 * type checking.
 *
 * ----------------------------------------------------------------------------- */

#if PY_VERSION_HEX < 0x02070000 /* 2.7.0 */
# error "This version of SWIG only supports Python >= 2.7"
#endif

#if PY_VERSION_HEX >= 0x03000000 && PY_VERSION_HEX < 0x03020000
# error "This version of SWIG only supports Python 3 >= 3.2"
#endif

/* Common SWIG API */

/* for raw pointers */
#define SWIG_Python_ConvertPtr(obj, pptr, type, flags)  SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, 0)
#define SWIG_ConvertPtr(obj, pptr, type, flags)         SWIG_Python_ConvertPtr(obj, pptr, type, flags)
#define SWIG_ConvertPtrAndOwn(obj,pptr,type,flags,own)  SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, own)

#ifdef SWIGPYTHON_BUILTIN
#define SWIG_NewPointerObj(ptr, type, flags)            SWIG_Python_NewPointerObj(self, ptr, type, flags)
#else
#define SWIG_NewPointerObj(ptr, type, flags)            SWIG_Python_NewPointerObj(NULL, ptr, type, flags)
#endif

#define SWIG_InternalNewPointerObj(ptr, type, flags)	SWIG_Python_NewPointerObj(NULL, ptr, type, flags)

#define SWIG_CheckImplicit(ty)                          SWIG_Python_CheckImplicit(ty) 
#define SWIG_AcquirePtr(ptr, src)                       SWIG_Python_AcquirePtr(ptr, src)
#define swig_owntype                                    int

/* for raw packed data */
#define SWIG_ConvertPacked(obj, ptr, sz, ty)            SWIG_Python_ConvertPacked(obj, ptr, sz, ty)
#define SWIG_NewPackedObj(ptr, sz, type)                SWIG_Python_NewPackedObj(ptr, sz, type)

/* for class or struct pointers */
#define SWIG_ConvertInstance(obj, pptr, type, flags)    SWIG_ConvertPtr(obj, pptr, type, flags)
#define SWIG_NewInstanceObj(ptr, type, flags)           SWIG_NewPointerObj(ptr, type, flags)

/* for C or C++ function pointers */
#define SWIG_ConvertFunctionPtr(obj, pptr, type)        SWIG_Python_ConvertFunctionPtr(obj, pptr, type)
#define SWIG_NewFunctionPtrObj(ptr, type)               SWIG_Python_NewPointerObj(NULL, ptr, type, 0)

/* for C++ member pointers, ie, member methods */
#define SWIG_ConvertMember(obj, ptr, sz, ty)            SWIG_Python_ConvertPacked(obj, ptr, sz, ty)
#define SWIG_NewMemberObj(ptr, sz, type)                SWIG_Python_NewPackedObj(ptr, sz, type)


/* Runtime API */

#define SWIG_GetModule(clientdata)                      SWIG_Python_GetModule(clientdata)
#define SWIG_SetModule(clientdata, pointer)             SWIG_Python_SetModule(pointer)
#define SWIG_NewClientData(obj)                         SwigPyClientData_New(obj)

#define SWIG_SetErrorObj                                SWIG_Python_SetErrorObj                            
#define SWIG_SetErrorMsg                        	SWIG_Python_SetErrorMsg				   
#define SWIG_ErrorType(code)                    	SWIG_Python_ErrorType(code)                        
#define SWIG_Error(code, msg)            		SWIG_Python_SetErrorMsg(SWIG_ErrorType(code), msg) 
#define SWIG_fail                        		goto fail					   


/* Runtime API implementation */

/* Error manipulation */

SWIGINTERN void 
SWIG_Python_SetErrorObj(PyObject *errtype, PyObject *obj) {
  SWIG_PYTHON_THREAD_BEGIN_BLOCK; 
  PyErr_SetObject(errtype, obj);
  Py_DECREF(obj);
  SWIG_PYTHON_THREAD_END_BLOCK;
}

SWIGINTERN void 
SWIG_Python_SetErrorMsg(PyObject *errtype, const char *msg) {
  SWIG_PYTHON_THREAD_BEGIN_BLOCK;
  PyErr_SetString(errtype, msg);
  SWIG_PYTHON_THREAD_END_BLOCK;
}

#define SWIG_Python_Raise(obj, type, desc)  SWIG_Python_SetErrorObj(SWIG_Python_ExceptionType(desc), obj)

/* Set a constant value */

#if defined(SWIGPYTHON_BUILTIN)

SWIGINTERN void
SwigPyBuiltin_AddPublicSymbol(PyObject *seq, const char *key) {
  PyObject *s = PyString_InternFromString(key);
  PyList_Append(seq, s);
  Py_DECREF(s);
}

SWIGINTERN void
SWIG_Python_SetConstant(PyObject *d, PyObject *public_interface, const char *name, PyObject *obj) {   
  PyDict_SetItemString(d, name, obj);
  Py_DECREF(obj);
  if (public_interface)
    SwigPyBuiltin_AddPublicSymbol(public_interface, name);
}

#else

SWIGINTERN void
SWIG_Python_SetConstant(PyObject *d, const char *name, PyObject *obj) {   
  PyDict_SetItemString(d, name, obj);
  Py_DECREF(obj);                            
}

#endif

/* Append a value to the result obj */

SWIGINTERN PyObject*
SWIG_Python_AppendOutput(PyObject* result, PyObject* obj) {
  if (!result) {
    result = obj;
  } else if (result == Py_None) {
    Py_DECREF(result);
    result = obj;
  } else {
    if (!PyList_Check(result)) {
      PyObject *o2 = result;
      result = PyList_New(1);
      PyList_SetItem(result, 0, o2);
    }
    PyList_Append(result,obj);
    Py_DECREF(obj);
  }
  return result;
}

/* Unpack the argument tuple */

SWIGINTERN Py_ssize_t
SWIG_Python_UnpackTuple(PyObject *args, const char *name, Py_ssize_t min, Py_ssize_t max, PyObject **objs)
{
  if (!args) {
    if (!min && !max) {
      return 1;
    } else {
      PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got none", 
		   name, (min == max ? "" : "at least "), (int)min);
      return 0;
    }
  }  
  if (!PyTuple_Check(args)) {
    if (min <= 1 && max >= 1) {
      Py_ssize_t i;
      objs[0] = args;
      for (i = 1; i < max; ++i) {
	objs[i] = 0;
      }
      return 2;
    }
    PyErr_SetString(PyExc_SystemError, "UnpackTuple() argument list is not a tuple");
    return 0;
  } else {
    Py_ssize_t l = PyTuple_GET_SIZE(args);
    if (l < min) {
      PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got %d", 
		   name, (min == max ? "" : "at least "), (int)min, (int)l);
      return 0;
    } else if (l > max) {
      PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got %d", 
		   name, (min == max ? "" : "at most "), (int)max, (int)l);
      return 0;
    } else {
      Py_ssize_t i;
      for (i = 0; i < l; ++i) {
	objs[i] = PyTuple_GET_ITEM(args, i);
      }
      for (; l < max; ++l) {
	objs[l] = 0;
      }
      return i + 1;
    }    
  }
}

SWIGINTERN int
SWIG_Python_CheckNoKeywords(PyObject *kwargs, const char *name) {
  int no_kwargs = 1;
  if (kwargs) {
    assert(PyDict_Check(kwargs));
    if (PyDict_Size(kwargs) > 0) {
      PyErr_Format(PyExc_TypeError, "%s() does not take keyword arguments", name);
      no_kwargs = 0;
    }
  }
  return no_kwargs;
}

/* A functor is a function object with one single object argument */
#define SWIG_Python_CallFunctor(functor, obj)	        PyObject_CallFunctionObjArgs(functor, obj, NULL);

/*
  Helper for static pointer initialization for both C and C++ code, for example
  static PyObject *SWIG_STATIC_POINTER(MyVar) = NewSomething(...);
*/
#ifdef __cplusplus
#define SWIG_STATIC_POINTER(var)  var
#else
#define SWIG_STATIC_POINTER(var)  var = 0; if (!var) var
#endif

/* -----------------------------------------------------------------------------
 * Pointer declarations
 * ----------------------------------------------------------------------------- */

/* Flags for new pointer objects */
#define SWIG_POINTER_NOSHADOW       (SWIG_POINTER_OWN      << 1)
#define SWIG_POINTER_NEW            (SWIG_POINTER_NOSHADOW | SWIG_POINTER_OWN)

#define SWIG_POINTER_IMPLICIT_CONV  (SWIG_POINTER_DISOWN   << 1)

#define SWIG_BUILTIN_TP_INIT	    (SWIG_POINTER_OWN << 2)
#define SWIG_BUILTIN_INIT	    (SWIG_BUILTIN_TP_INIT | SWIG_POINTER_OWN)

#ifdef __cplusplus
extern "C" {
#endif

/* The python void return value */

SWIGRUNTIMEINLINE PyObject * 
SWIG_Py_Void(void)
{
  PyObject *none = Py_None;
  Py_INCREF(none);
  return none;
}

/* SwigPyClientData */

typedef struct {
  PyObject *klass;
  PyObject *newraw;
  PyObject *newargs;
  PyObject *destroy;
  int delargs;
  int implicitconv;
  PyTypeObject *pytype;
} SwigPyClientData;

SWIGRUNTIMEINLINE int 
SWIG_Python_CheckImplicit(swig_type_info *ty)
{
  SwigPyClientData *data = (SwigPyClientData *)ty->clientdata;
  int fail = data ? data->implicitconv : 0;
  if (fail)
    PyErr_SetString(PyExc_TypeError, "Implicit conversion is prohibited for explicit constructors.");
  return fail;
}

SWIGRUNTIMEINLINE PyObject *
SWIG_Python_ExceptionType(swig_type_info *desc) {
  SwigPyClientData *data = desc ? (SwigPyClientData *) desc->clientdata : 0;
  PyObject *klass = data ? data->klass : 0;
  return (klass ? klass : PyExc_RuntimeError);
}


SWIGRUNTIME SwigPyClientData * 
SwigPyClientData_New(PyObject* obj)
{
  if (!obj) {
    return 0;
  } else {
    SwigPyClientData *data = (SwigPyClientData *)malloc(sizeof(SwigPyClientData));
    /* the klass element */
    data->klass = obj;
    Py_INCREF(data->klass);
    /* the newraw method and newargs arguments used to create a new raw instance */
    if (PyClass_Check(obj)) {
      data->newraw = 0;
      data->newargs = obj;
      Py_INCREF(obj);
    } else {
      data->newraw = PyObject_GetAttrString(data->klass, "__new__");
      if (data->newraw) {
	Py_INCREF(data->newraw);
	data->newargs = PyTuple_New(1);
	PyTuple_SetItem(data->newargs, 0, obj);
      } else {
	data->newargs = obj;
      }
      Py_INCREF(data->newargs);
    }
    /* the destroy method, aka as the C++ delete method */
    data->destroy = PyObject_GetAttrString(data->klass, "__swig_destroy__");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      data->destroy = 0;
    }
    if (data->destroy) {
      int flags;
      Py_INCREF(data->destroy);
      flags = PyCFunction_GET_FLAGS(data->destroy);
      data->delargs = !(flags & (METH_O));
    } else {
      data->delargs = 0;
    }
    data->implicitconv = 0;
    data->pytype = 0;
    return data;
  }
}

SWIGRUNTIME void 
SwigPyClientData_Del(SwigPyClientData *data) {
  Py_XDECREF(data->newraw);
  Py_XDECREF(data->newargs);
  Py_XDECREF(data->destroy);
}

/* =============== SwigPyObject =====================*/

typedef struct {
  PyObject_HEAD
  void *ptr;
  swig_type_info *ty;
  int own;
  PyObject *next;
#ifdef SWIGPYTHON_BUILTIN
  PyObject *dict;
#endif
} SwigPyObject;


#ifdef SWIGPYTHON_BUILTIN

SWIGRUNTIME PyObject *
SwigPyObject_get___dict__(PyObject *v, PyObject *SWIGUNUSEDPARM(args))
{
  SwigPyObject *sobj = (SwigPyObject *)v;

  if (!sobj->dict)
    sobj->dict = PyDict_New();

  Py_INCREF(sobj->dict);
  return sobj->dict;
}

#endif

SWIGRUNTIME PyObject *
SwigPyObject_long(SwigPyObject *v)
{
  return PyLong_FromVoidPtr(v->ptr);
}

SWIGRUNTIME PyObject *
SwigPyObject_format(const char* fmt, SwigPyObject *v)
{
  PyObject *res = NULL;
  PyObject *args = PyTuple_New(1);
  if (args) {
    if (PyTuple_SetItem(args, 0, SwigPyObject_long(v)) == 0) {
      PyObject *ofmt = SWIG_Python_str_FromChar(fmt);
      if (ofmt) {
#if PY_VERSION_HEX >= 0x03000000
	res = PyUnicode_Format(ofmt,args);
#else
	res = PyString_Format(ofmt,args);
#endif
	Py_DECREF(ofmt);
      }
      Py_DECREF(args);
    }
  }
  return res;
}

SWIGRUNTIME PyObject *
SwigPyObject_oct(SwigPyObject *v)
{
  return SwigPyObject_format("%o",v);
}

SWIGRUNTIME PyObject *
SwigPyObject_hex(SwigPyObject *v)
{
  return SwigPyObject_format("%x",v);
}

SWIGRUNTIME PyObject *
SwigPyObject_repr(SwigPyObject *v)
{
  const char *name = SWIG_TypePrettyName(v->ty);
  PyObject *repr = SWIG_Python_str_FromFormat("<Swig Object of type '%s' at %p>", (name ? name : "unknown"), (void *)v);
  if (v->next) {
    PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next);
# if PY_VERSION_HEX >= 0x03000000
    PyObject *joined = PyUnicode_Concat(repr, nrep);
    Py_DecRef(repr);
    Py_DecRef(nrep);
    repr = joined;
# else
    PyString_ConcatAndDel(&repr,nrep);
# endif
  }
  return repr;  
}

/* We need a version taking two PyObject* parameters so it's a valid
 * PyCFunction to use in swigobject_methods[]. */
SWIGRUNTIME PyObject *
SwigPyObject_repr2(PyObject *v, PyObject *SWIGUNUSEDPARM(args))
{
  return SwigPyObject_repr((SwigPyObject*)v);
}

SWIGRUNTIME int
SwigPyObject_compare(SwigPyObject *v, SwigPyObject *w)
{
  void *i = v->ptr;
  void *j = w->ptr;
  return (i < j) ? -1 : ((i > j) ? 1 : 0);
}

/* Added for Python 3.x, would it also be useful for Python 2.x? */
SWIGRUNTIME PyObject*
SwigPyObject_richcompare(SwigPyObject *v, SwigPyObject *w, int op)
{
  PyObject* res;
  if( op != Py_EQ && op != Py_NE ) {
    Py_INCREF(Py_NotImplemented);
    return Py_NotImplemented;
  }
  res = PyBool_FromLong( (SwigPyObject_compare(v, w)==0) == (op == Py_EQ) ? 1 : 0);
  return res;  
}


SWIGRUNTIME PyTypeObject* SwigPyObject_TypeOnce(void);

#ifdef SWIGPYTHON_BUILTIN
static swig_type_info *SwigPyObject_stype = 0;
SWIGRUNTIME PyTypeObject*
SwigPyObject_type(void) {
    SwigPyClientData *cd;
    assert(SwigPyObject_stype);
    cd = (SwigPyClientData*) SwigPyObject_stype->clientdata;
    assert(cd);
    assert(cd->pytype);
    return cd->pytype;
}
#else
SWIGRUNTIME PyTypeObject*
SwigPyObject_type(void) {
  static PyTypeObject *SWIG_STATIC_POINTER(type) = SwigPyObject_TypeOnce();
  return type;
}
#endif

SWIGRUNTIMEINLINE int
SwigPyObject_Check(PyObject *op) {
#ifdef SWIGPYTHON_BUILTIN
  PyTypeObject *target_tp = SwigPyObject_type();
  if (PyType_IsSubtype(op->ob_type, target_tp))
    return 1;
  return (strcmp(op->ob_type->tp_name, "SwigPyObject") == 0);
#else
  return (Py_TYPE(op) == SwigPyObject_type())
    || (strcmp(Py_TYPE(op)->tp_name,"SwigPyObject") == 0);
#endif
}

SWIGRUNTIME PyObject *
SwigPyObject_New(void *ptr, swig_type_info *ty, int own);

SWIGRUNTIME void
SwigPyObject_dealloc(PyObject *v)
{
  SwigPyObject *sobj = (SwigPyObject *) v;
  PyObject *next = sobj->next;
  if (sobj->own == SWIG_POINTER_OWN) {
    swig_type_info *ty = sobj->ty;
    SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0;
    PyObject *destroy = data ? data->destroy : 0;
    if (destroy) {
      /* destroy is always a VARARGS method */
      PyObject *res;

      /* PyObject_CallFunction() has the potential to silently drop
         the active exception.  In cases of unnamed temporary
         variable or where we just finished iterating over a generator
         StopIteration will be active right now, and this needs to
         remain true upon return from SwigPyObject_dealloc.  So save
         and restore. */
      
      PyObject *type = NULL, *value = NULL, *traceback = NULL;
      PyErr_Fetch(&type, &value, &traceback);

      if (data->delargs) {
        /* we need to create a temporary object to carry the destroy operation */
        PyObject *tmp = SwigPyObject_New(sobj->ptr, ty, 0);
        res = SWIG_Python_CallFunctor(destroy, tmp);
        Py_DECREF(tmp);
      } else {
        PyCFunction meth = PyCFunction_GET_FUNCTION(destroy);
        PyObject *mself = PyCFunction_GET_SELF(destroy);
        res = ((*meth)(mself, v));
      }
      if (!res)
        PyErr_WriteUnraisable(destroy);

      PyErr_Restore(type, value, traceback);

      Py_XDECREF(res);
    } 
#if !defined(SWIG_PYTHON_SILENT_MEMLEAK)
    else {
      const char *name = SWIG_TypePrettyName(ty);
      printf("swig/python detected a memory leak of type '%s', no destructor found.\n", (name ? name : "unknown"));
    }
#endif
  } 
  Py_XDECREF(next);
  PyObject_DEL(v);
}

SWIGRUNTIME PyObject* 
SwigPyObject_append(PyObject* v, PyObject* next)
{
  SwigPyObject *sobj = (SwigPyObject *) v;
  if (!SwigPyObject_Check(next)) {
    PyErr_SetString(PyExc_TypeError, "Attempt to append a non SwigPyObject");
    return NULL;
  }
  sobj->next = next;
  Py_INCREF(next);
  return SWIG_Py_Void();
}

SWIGRUNTIME PyObject* 
SwigPyObject_next(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
{
  SwigPyObject *sobj = (SwigPyObject *) v;
  if (sobj->next) {    
    Py_INCREF(sobj->next);
    return sobj->next;
  } else {
    return SWIG_Py_Void();
  }
}

SWIGINTERN PyObject*
SwigPyObject_disown(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
{
  SwigPyObject *sobj = (SwigPyObject *)v;
  sobj->own = 0;
  return SWIG_Py_Void();
}

SWIGINTERN PyObject*
SwigPyObject_acquire(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
{
  SwigPyObject *sobj = (SwigPyObject *)v;
  sobj->own = SWIG_POINTER_OWN;
  return SWIG_Py_Void();
}

SWIGINTERN PyObject*
SwigPyObject_own(PyObject *v, PyObject *args)
{
  PyObject *val = 0;
  if (!PyArg_UnpackTuple(args, "own", 0, 1, &val)) {
    return NULL;
  } else {
    SwigPyObject *sobj = (SwigPyObject *)v;
    PyObject *obj = PyBool_FromLong(sobj->own);
    if (val) {
      if (PyObject_IsTrue(val)) {
        SwigPyObject_acquire(v,args);
      } else {
        SwigPyObject_disown(v,args);
      }
    } 
    return obj;
  }
}

static PyMethodDef
swigobject_methods[] = {
  {"disown",  SwigPyObject_disown,  METH_NOARGS,  "releases ownership of the pointer"},
  {"acquire", SwigPyObject_acquire, METH_NOARGS,  "acquires ownership of the pointer"},
  {"own",     SwigPyObject_own,     METH_VARARGS, "returns/sets ownership of the pointer"},
  {"append",  SwigPyObject_append,  METH_O,       "appends another 'this' object"},
  {"next",    SwigPyObject_next,    METH_NOARGS,  "returns the next 'this' object"},
  {"__repr__",SwigPyObject_repr2,   METH_NOARGS,  "returns object representation"},
  {0, 0, 0, 0}  
};

SWIGRUNTIME PyTypeObject*
SwigPyObject_TypeOnce(void) {
  static char swigobject_doc[] = "Swig object carries a C/C++ instance pointer";

  static PyNumberMethods SwigPyObject_as_number = {
    (binaryfunc)0, /*nb_add*/
    (binaryfunc)0, /*nb_subtract*/
    (binaryfunc)0, /*nb_multiply*/
    /* nb_divide removed in Python 3 */
#if PY_VERSION_HEX < 0x03000000
    (binaryfunc)0, /*nb_divide*/
#endif
    (binaryfunc)0, /*nb_remainder*/
    (binaryfunc)0, /*nb_divmod*/
    (ternaryfunc)0,/*nb_power*/
    (unaryfunc)0,  /*nb_negative*/
    (unaryfunc)0,  /*nb_positive*/
    (unaryfunc)0,  /*nb_absolute*/
    (inquiry)0,    /*nb_nonzero*/
    0,		   /*nb_invert*/
    0,		   /*nb_lshift*/
    0,		   /*nb_rshift*/
    0,		   /*nb_and*/
    0,		   /*nb_xor*/
    0,		   /*nb_or*/
#if PY_VERSION_HEX < 0x03000000
    0,   /*nb_coerce*/
#endif
    (unaryfunc)SwigPyObject_long, /*nb_int*/
#if PY_VERSION_HEX < 0x03000000
    (unaryfunc)SwigPyObject_long, /*nb_long*/
#else
    0, /*nb_reserved*/
#endif
    (unaryfunc)0,                 /*nb_float*/
#if PY_VERSION_HEX < 0x03000000
    (unaryfunc)SwigPyObject_oct,  /*nb_oct*/
    (unaryfunc)SwigPyObject_hex,  /*nb_hex*/
#endif
#if PY_VERSION_HEX >= 0x03050000 /* 3.5 */
    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_matrix_multiply */
#elif PY_VERSION_HEX >= 0x03000000 /* 3.0 */
    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index, nb_inplace_divide removed */
#else
    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index */
#endif
  };

  static PyTypeObject swigpyobject_type;
  static int type_init = 0;
  if (!type_init) {
    const PyTypeObject tmp = {
#if PY_VERSION_HEX >= 0x03000000
      PyVarObject_HEAD_INIT(NULL, 0)
#else
      PyObject_HEAD_INIT(NULL)
      0,                                    /* ob_size */
#endif
      "SwigPyObject",                       /* tp_name */
      sizeof(SwigPyObject),                 /* tp_basicsize */
      0,                                    /* tp_itemsize */
      (destructor)SwigPyObject_dealloc,     /* tp_dealloc */
      0,                                    /* tp_print */
      (getattrfunc)0,                       /* tp_getattr */
      (setattrfunc)0,                       /* tp_setattr */
#if PY_VERSION_HEX >= 0x03000000
      0, /* tp_reserved in 3.0.1, tp_compare in 3.0.0 but not used */
#else
      (cmpfunc)SwigPyObject_compare,        /* tp_compare */
#endif
      (reprfunc)SwigPyObject_repr,          /* tp_repr */
      &SwigPyObject_as_number,              /* tp_as_number */
      0,                                    /* tp_as_sequence */
      0,                                    /* tp_as_mapping */
      (hashfunc)0,                          /* tp_hash */
      (ternaryfunc)0,                       /* tp_call */
      0,                                    /* tp_str */
      PyObject_GenericGetAttr,              /* tp_getattro */
      0,                                    /* tp_setattro */
      0,                                    /* tp_as_buffer */
      Py_TPFLAGS_DEFAULT,                   /* tp_flags */
      swigobject_doc,                       /* tp_doc */
      0,                                    /* tp_traverse */
      0,                                    /* tp_clear */
      (richcmpfunc)SwigPyObject_richcompare,/* tp_richcompare */
      0,                                    /* tp_weaklistoffset */
      0,                                    /* tp_iter */
      0,                                    /* tp_iternext */
      swigobject_methods,                   /* tp_methods */
      0,                                    /* tp_members */
      0,                                    /* tp_getset */
      0,                                    /* tp_base */
      0,                                    /* tp_dict */
      0,                                    /* tp_descr_get */
      0,                                    /* tp_descr_set */
      0,                                    /* tp_dictoffset */
      0,                                    /* tp_init */
      0,                                    /* tp_alloc */
      0,                                    /* tp_new */
      0,                                    /* tp_free */
      0,                                    /* tp_is_gc */
      0,                                    /* tp_bases */
      0,                                    /* tp_mro */
      0,                                    /* tp_cache */
      0,                                    /* tp_subclasses */
      0,                                    /* tp_weaklist */
      0,                                    /* tp_del */
      0,                                    /* tp_version_tag */
#if PY_VERSION_HEX >= 0x03040000
      0,                                    /* tp_finalize */
#endif
#if PY_VERSION_HEX >= 0x03080000
      0,                                    /* tp_vectorcall */
#endif
#if (PY_VERSION_HEX >= 0x03080000) && (PY_VERSION_HEX < 0x03090000)
      0,                                    /* tp_print */
#endif
#ifdef COUNT_ALLOCS
      0,                                    /* tp_allocs */
      0,                                    /* tp_frees */
      0,                                    /* tp_maxalloc */
      0,                                    /* tp_prev */
      0                                     /* tp_next */
#endif
    };
    swigpyobject_type = tmp;
    type_init = 1;
    if (PyType_Ready(&swigpyobject_type) < 0)
      return NULL;
  }
  return &swigpyobject_type;
}

SWIGRUNTIME PyObject *
SwigPyObject_New(void *ptr, swig_type_info *ty, int own)
{
  SwigPyObject *sobj = PyObject_NEW(SwigPyObject, SwigPyObject_type());
  if (sobj) {
    sobj->ptr  = ptr;
    sobj->ty   = ty;
    sobj->own  = own;
    sobj->next = 0;
  }
  return (PyObject *)sobj;
}

/* -----------------------------------------------------------------------------
 * Implements a simple Swig Packed type, and use it instead of string
 * ----------------------------------------------------------------------------- */

typedef struct {
  PyObject_HEAD
  void *pack;
  swig_type_info *ty;
  size_t size;
} SwigPyPacked;

SWIGRUNTIME PyObject *
SwigPyPacked_repr(SwigPyPacked *v)
{
  char result[SWIG_BUFFER_SIZE];
  if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))) {
    return SWIG_Python_str_FromFormat("<Swig Packed at %s%s>", result, v->ty->name);
  } else {
    return SWIG_Python_str_FromFormat("<Swig Packed %s>", v->ty->name);
  }  
}

SWIGRUNTIME PyObject *
SwigPyPacked_str(SwigPyPacked *v)
{
  char result[SWIG_BUFFER_SIZE];
  if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))){
    return SWIG_Python_str_FromFormat("%s%s", result, v->ty->name);
  } else {
    return SWIG_Python_str_FromChar(v->ty->name);
  }  
}

SWIGRUNTIME int
SwigPyPacked_compare(SwigPyPacked *v, SwigPyPacked *w)
{
  size_t i = v->size;
  size_t j = w->size;
  int s = (i < j) ? -1 : ((i > j) ? 1 : 0);
  return s ? s : strncmp((const char *)v->pack, (const char *)w->pack, 2*v->size);
}

SWIGRUNTIME PyTypeObject* SwigPyPacked_TypeOnce(void);

SWIGRUNTIME PyTypeObject*
SwigPyPacked_type(void) {
  static PyTypeObject *SWIG_STATIC_POINTER(type) = SwigPyPacked_TypeOnce();
  return type;
}

SWIGRUNTIMEINLINE int
SwigPyPacked_Check(PyObject *op) {
  return ((op)->ob_type == SwigPyPacked_TypeOnce()) 
    || (strcmp((op)->ob_type->tp_name,"SwigPyPacked") == 0);
}

SWIGRUNTIME void
SwigPyPacked_dealloc(PyObject *v)
{
  if (SwigPyPacked_Check(v)) {
    SwigPyPacked *sobj = (SwigPyPacked *) v;
    free(sobj->pack);
  }
  PyObject_DEL(v);
}

SWIGRUNTIME PyTypeObject*
SwigPyPacked_TypeOnce(void) {
  static char swigpacked_doc[] = "Swig object carries a C/C++ instance pointer";
  static PyTypeObject swigpypacked_type;
  static int type_init = 0;
  if (!type_init) {
    const PyTypeObject tmp = {
#if PY_VERSION_HEX>=0x03000000
      PyVarObject_HEAD_INIT(NULL, 0)
#else
      PyObject_HEAD_INIT(NULL)
      0,                                    /* ob_size */
#endif
      "SwigPyPacked",                       /* tp_name */
      sizeof(SwigPyPacked),                 /* tp_basicsize */
      0,                                    /* tp_itemsize */
      (destructor)SwigPyPacked_dealloc,     /* tp_dealloc */
      0,                                    /* tp_print */
      (getattrfunc)0,                       /* tp_getattr */
      (setattrfunc)0,                       /* tp_setattr */
#if PY_VERSION_HEX>=0x03000000
      0, /* tp_reserved in 3.0.1 */
#else
      (cmpfunc)SwigPyPacked_compare,        /* tp_compare */
#endif
      (reprfunc)SwigPyPacked_repr,          /* tp_repr */
      0,                                    /* tp_as_number */
      0,                                    /* tp_as_sequence */
      0,                                    /* tp_as_mapping */
      (hashfunc)0,                          /* tp_hash */
      (ternaryfunc)0,                       /* tp_call */
      (reprfunc)SwigPyPacked_str,           /* tp_str */
      PyObject_GenericGetAttr,              /* tp_getattro */
      0,                                    /* tp_setattro */
      0,                                    /* tp_as_buffer */
      Py_TPFLAGS_DEFAULT,                   /* tp_flags */
      swigpacked_doc,                       /* tp_doc */
      0,                                    /* tp_traverse */
      0,                                    /* tp_clear */
      0,                                    /* tp_richcompare */
      0,                                    /* tp_weaklistoffset */
      0,                                    /* tp_iter */
      0,                                    /* tp_iternext */
      0,                                    /* tp_methods */
      0,                                    /* tp_members */
      0,                                    /* tp_getset */
      0,                                    /* tp_base */
      0,                                    /* tp_dict */
      0,                                    /* tp_descr_get */
      0,                                    /* tp_descr_set */
      0,                                    /* tp_dictoffset */
      0,                                    /* tp_init */
      0,                                    /* tp_alloc */
      0,                                    /* tp_new */
      0,                                    /* tp_free */
      0,                                    /* tp_is_gc */
      0,                                    /* tp_bases */
      0,                                    /* tp_mro */
      0,                                    /* tp_cache */
      0,                                    /* tp_subclasses */
      0,                                    /* tp_weaklist */
      0,                                    /* tp_del */
      0,                                    /* tp_version_tag */
#if PY_VERSION_HEX >= 0x03040000
      0,                                    /* tp_finalize */
#endif
#if PY_VERSION_HEX >= 0x03080000
      0,                                    /* tp_vectorcall */
#endif
#if (PY_VERSION_HEX >= 0x03080000) && (PY_VERSION_HEX < 0x03090000)
      0,                                    /* tp_print */
#endif
#ifdef COUNT_ALLOCS
      0,                                    /* tp_allocs */
      0,                                    /* tp_frees */
      0,                                    /* tp_maxalloc */
      0,                                    /* tp_prev */
      0                                     /* tp_next */
#endif
    };
    swigpypacked_type = tmp;
    type_init = 1;
    if (PyType_Ready(&swigpypacked_type) < 0)
      return NULL;
  }
  return &swigpypacked_type;
}

SWIGRUNTIME PyObject *
SwigPyPacked_New(void *ptr, size_t size, swig_type_info *ty)
{
  SwigPyPacked *sobj = PyObject_NEW(SwigPyPacked, SwigPyPacked_type());
  if (sobj) {
    void *pack = malloc(size);
    if (pack) {
      memcpy(pack, ptr, size);
      sobj->pack = pack;
      sobj->ty   = ty;
      sobj->size = size;
    } else {
      PyObject_DEL((PyObject *) sobj);
      sobj = 0;
    }
  }
  return (PyObject *) sobj;
}

SWIGRUNTIME swig_type_info *
SwigPyPacked_UnpackData(PyObject *obj, void *ptr, size_t size)
{
  if (SwigPyPacked_Check(obj)) {
    SwigPyPacked *sobj = (SwigPyPacked *)obj;
    if (sobj->size != size) return 0;
    memcpy(ptr, sobj->pack, size);
    return sobj->ty;
  } else {
    return 0;
  }
}

/* -----------------------------------------------------------------------------
 * pointers/data manipulation
 * ----------------------------------------------------------------------------- */

static PyObject *Swig_This_global = NULL;

SWIGRUNTIME PyObject *
SWIG_This(void)
{
  if (Swig_This_global == NULL)
    Swig_This_global = SWIG_Python_str_FromChar("this");
  return Swig_This_global;
}

/* #define SWIG_PYTHON_SLOW_GETSET_THIS */

/* TODO: I don't know how to implement the fast getset in Python 3 right now */
#if PY_VERSION_HEX>=0x03000000
#define SWIG_PYTHON_SLOW_GETSET_THIS 
#endif

SWIGRUNTIME SwigPyObject *
SWIG_Python_GetSwigThis(PyObject *pyobj) 
{
  PyObject *obj;

  if (SwigPyObject_Check(pyobj))
    return (SwigPyObject *) pyobj;

#ifdef SWIGPYTHON_BUILTIN
  (void)obj;
# ifdef PyWeakref_CheckProxy
  if (PyWeakref_CheckProxy(pyobj)) {
    pyobj = PyWeakref_GET_OBJECT(pyobj);
    if (pyobj && SwigPyObject_Check(pyobj))
      return (SwigPyObject*) pyobj;
  }
# endif
  return NULL;
#else

  obj = 0;

#if !defined(SWIG_PYTHON_SLOW_GETSET_THIS)
  if (PyInstance_Check(pyobj)) {
    obj = _PyInstance_Lookup(pyobj, SWIG_This());      
  } else {
    PyObject **dictptr = _PyObject_GetDictPtr(pyobj);
    if (dictptr != NULL) {
      PyObject *dict = *dictptr;
      obj = dict ? PyDict_GetItem(dict, SWIG_This()) : 0;
    } else {
#ifdef PyWeakref_CheckProxy
      if (PyWeakref_CheckProxy(pyobj)) {
	PyObject *wobj = PyWeakref_GET_OBJECT(pyobj);
	return wobj ? SWIG_Python_GetSwigThis(wobj) : 0;
      }
#endif
      obj = PyObject_GetAttr(pyobj,SWIG_This());
      if (obj) {
	Py_DECREF(obj);
      } else {
	if (PyErr_Occurred()) PyErr_Clear();
	return 0;
      }
    }
  }
#else
  obj = PyObject_GetAttr(pyobj,SWIG_This());
  if (obj) {
    Py_DECREF(obj);
  } else {
    if (PyErr_Occurred()) PyErr_Clear();
    return 0;
  }
#endif
  if (obj && !SwigPyObject_Check(obj)) {
    /* a PyObject is called 'this', try to get the 'real this'
       SwigPyObject from it */ 
    return SWIG_Python_GetSwigThis(obj);
  }
  return (SwigPyObject *)obj;
#endif
}

/* Acquire a pointer value */

SWIGRUNTIME int
SWIG_Python_AcquirePtr(PyObject *obj, int own) {
  if (own == SWIG_POINTER_OWN) {
    SwigPyObject *sobj = SWIG_Python_GetSwigThis(obj);
    if (sobj) {
      int oldown = sobj->own;
      sobj->own = own;
      return oldown;
    }
  }
  return 0;
}

/* Convert a pointer value */

SWIGRUNTIME int
SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int flags, int *own) {
  int res;
  SwigPyObject *sobj;
  int implicit_conv = (flags & SWIG_POINTER_IMPLICIT_CONV) != 0;

  if (!obj)
    return SWIG_ERROR;
  if (obj == Py_None && !implicit_conv) {
    if (ptr)
      *ptr = 0;
    return (flags & SWIG_POINTER_NO_NULL) ? SWIG_NullReferenceError : SWIG_OK;
  }

  res = SWIG_ERROR;

  sobj = SWIG_Python_GetSwigThis(obj);
  if (own)
    *own = 0;
  while (sobj) {
    void *vptr = sobj->ptr;
    if (ty) {
      swig_type_info *to = sobj->ty;
      if (to == ty) {
        /* no type cast needed */
        if (ptr) *ptr = vptr;
        break;
      } else {
        swig_cast_info *tc = SWIG_TypeCheck(to->name,ty);
        if (!tc) {
          sobj = (SwigPyObject *)sobj->next;
        } else {
          if (ptr) {
            int newmemory = 0;
            *ptr = SWIG_TypeCast(tc,vptr,&newmemory);
            if (newmemory == SWIG_CAST_NEW_MEMORY) {
              assert(own); /* badly formed typemap which will lead to a memory leak - it must set and use own to delete *ptr */
              if (own)
                *own = *own | SWIG_CAST_NEW_MEMORY;
            }
          }
          break;
        }
      }
    } else {
      if (ptr) *ptr = vptr;
      break;
    }
  }
  if (sobj) {
    if (own)
      *own = *own | sobj->own;
    if (flags & SWIG_POINTER_DISOWN) {
      sobj->own = 0;
    }
    res = SWIG_OK;
  } else {
    if (implicit_conv) {
      SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0;
      if (data && !data->implicitconv) {
        PyObject *klass = data->klass;
        if (klass) {
          PyObject *impconv;
          data->implicitconv = 1; /* avoid recursion and call 'explicit' constructors*/
          impconv = SWIG_Python_CallFunctor(klass, obj);
          data->implicitconv = 0;
          if (PyErr_Occurred()) {
            PyErr_Clear();
            impconv = 0;
          }
          if (impconv) {
            SwigPyObject *iobj = SWIG_Python_GetSwigThis(impconv);
            if (iobj) {
              void *vptr;
              res = SWIG_Python_ConvertPtrAndOwn((PyObject*)iobj, &vptr, ty, 0, 0);
              if (SWIG_IsOK(res)) {
                if (ptr) {
                  *ptr = vptr;
                  /* transfer the ownership to 'ptr' */
                  iobj->own = 0;
                  res = SWIG_AddCast(res);
                  res = SWIG_AddNewMask(res);
                } else {
                  res = SWIG_AddCast(res);		    
                }
              }
            }
            Py_DECREF(impconv);
          }
        }
      }
      if (!SWIG_IsOK(res) && obj == Py_None) {
        if (ptr)
          *ptr = 0;
        if (PyErr_Occurred())
          PyErr_Clear();
        res = SWIG_OK;
      }
    }
  }
  return res;
}

/* Convert a function ptr value */

SWIGRUNTIME int
SWIG_Python_ConvertFunctionPtr(PyObject *obj, void **ptr, swig_type_info *ty) {
  if (!PyCFunction_Check(obj)) {
    return SWIG_ConvertPtr(obj, ptr, ty, 0);
  } else {
    void *vptr = 0;
    swig_cast_info *tc;

    /* here we get the method pointer for callbacks */
    const char *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc);
    const char *desc = doc ? strstr(doc, "swig_ptr: ") : 0;
    if (desc)
      desc = ty ? SWIG_UnpackVoidPtr(desc + 10, &vptr, ty->name) : 0;
    if (!desc)
      return SWIG_ERROR;
    tc = SWIG_TypeCheck(desc,ty);
    if (tc) {
      int newmemory = 0;
      *ptr = SWIG_TypeCast(tc,vptr,&newmemory);
      assert(!newmemory); /* newmemory handling not yet implemented */
    } else {
      return SWIG_ERROR;
    }
    return SWIG_OK;
  }
}

/* Convert a packed pointer value */

SWIGRUNTIME int
SWIG_Python_ConvertPacked(PyObject *obj, void *ptr, size_t sz, swig_type_info *ty) {
  swig_type_info *to = SwigPyPacked_UnpackData(obj, ptr, sz);
  if (!to) return SWIG_ERROR;
  if (ty) {
    if (to != ty) {
      /* check type cast? */
      swig_cast_info *tc = SWIG_TypeCheck(to->name,ty);
      if (!tc) return SWIG_ERROR;
    }
  }
  return SWIG_OK;
}  

/* -----------------------------------------------------------------------------
 * Create a new pointer object
 * ----------------------------------------------------------------------------- */

/*
  Create a new instance object, without calling __init__, and set the
  'this' attribute.
*/

SWIGRUNTIME PyObject* 
SWIG_Python_NewShadowInstance(SwigPyClientData *data, PyObject *swig_this)
{
  PyObject *inst = 0;
  PyObject *newraw = data->newraw;
  if (newraw) {
    inst = PyObject_Call(newraw, data->newargs, NULL);
    if (inst) {
#if !defined(SWIG_PYTHON_SLOW_GETSET_THIS)
      PyObject **dictptr = _PyObject_GetDictPtr(inst);
      if (dictptr != NULL) {
	PyObject *dict = *dictptr;
	if (dict == NULL) {
	  dict = PyDict_New();
	  *dictptr = dict;
	  PyDict_SetItem(dict, SWIG_This(), swig_this);
	}
      }
#else
      if (PyObject_SetAttr(inst, SWIG_This(), swig_this) == -1) {
        Py_DECREF(inst);
        inst = 0;
      }
#endif
    }
  } else {
#if PY_VERSION_HEX >= 0x03000000
    PyObject *empty_args = PyTuple_New(0);
    if (empty_args) {
      PyObject *empty_kwargs = PyDict_New();
      if (empty_kwargs) {
        inst = ((PyTypeObject *)data->newargs)->tp_new((PyTypeObject *)data->newargs, empty_args, empty_kwargs);
        Py_DECREF(empty_kwargs);
        if (inst) {
          if (PyObject_SetAttr(inst, SWIG_This(), swig_this) == -1) {
            Py_DECREF(inst);
            inst = 0;
          } else {
            Py_TYPE(inst)->tp_flags &= ~Py_TPFLAGS_VALID_VERSION_TAG;
          }
        }
      }
      Py_DECREF(empty_args);
    }
#else
    PyObject *dict = PyDict_New();
    if (dict) {
      PyDict_SetItem(dict, SWIG_This(), swig_this);
      inst = PyInstance_NewRaw(data->newargs, dict);
      Py_DECREF(dict);
    }
#endif
  }
  return inst;
}

SWIGRUNTIME int
SWIG_Python_SetSwigThis(PyObject *inst, PyObject *swig_this)
{
#if !defined(SWIG_PYTHON_SLOW_GETSET_THIS)
  PyObject **dictptr = _PyObject_GetDictPtr(inst);
  if (dictptr != NULL) {
    PyObject *dict = *dictptr;
    if (dict == NULL) {
      dict = PyDict_New();
      *dictptr = dict;
    }
    return PyDict_SetItem(dict, SWIG_This(), swig_this);
  }
#endif
  return PyObject_SetAttr(inst, SWIG_This(), swig_this);
} 


SWIGINTERN PyObject *
SWIG_Python_InitShadowInstance(PyObject *args) {
  PyObject *obj[2];
  if (!SWIG_Python_UnpackTuple(args, "swiginit", 2, 2, obj)) {
    return NULL;
  } else {
    SwigPyObject *sthis = SWIG_Python_GetSwigThis(obj[0]);
    if (sthis) {
      SwigPyObject_append((PyObject*) sthis, obj[1]);
    } else {
      if (SWIG_Python_SetSwigThis(obj[0], obj[1]) != 0)
        return NULL;
    }
    return SWIG_Py_Void();
  }
}

/* Create a new pointer object */

SWIGRUNTIME PyObject *
SWIG_Python_NewPointerObj(PyObject *self, void *ptr, swig_type_info *type, int flags) {
  SwigPyClientData *clientdata;
  PyObject * robj;
  int own;

  if (!ptr)
    return SWIG_Py_Void();

  clientdata = type ? (SwigPyClientData *)(type->clientdata) : 0;
  own = (flags & SWIG_POINTER_OWN) ? SWIG_POINTER_OWN : 0;
  if (clientdata && clientdata->pytype) {
    SwigPyObject *newobj;
    if (flags & SWIG_BUILTIN_TP_INIT) {
      newobj = (SwigPyObject*) self;
      if (newobj->ptr) {
        PyObject *next_self = clientdata->pytype->tp_alloc(clientdata->pytype, 0);
        while (newobj->next)
	  newobj = (SwigPyObject *) newobj->next;
        newobj->next = next_self;
        newobj = (SwigPyObject *)next_self;
#ifdef SWIGPYTHON_BUILTIN
        newobj->dict = 0;
#endif
      }
    } else {
      newobj = PyObject_New(SwigPyObject, clientdata->pytype);
#ifdef SWIGPYTHON_BUILTIN
      newobj->dict = 0;
#endif
    }
    if (newobj) {
      newobj->ptr = ptr;
      newobj->ty = type;
      newobj->own = own;
      newobj->next = 0;
      return (PyObject*) newobj;
    }
    return SWIG_Py_Void();
  }

  assert(!(flags & SWIG_BUILTIN_TP_INIT));

  robj = SwigPyObject_New(ptr, type, own);
  if (robj && clientdata && !(flags & SWIG_POINTER_NOSHADOW)) {
    PyObject *inst = SWIG_Python_NewShadowInstance(clientdata, robj);
    Py_DECREF(robj);
    robj = inst;
  }
  return robj;
}

/* Create a new packed object */

SWIGRUNTIMEINLINE PyObject *
SWIG_Python_NewPackedObj(void *ptr, size_t sz, swig_type_info *type) {
  return ptr ? SwigPyPacked_New((void *) ptr, sz, type) : SWIG_Py_Void();
}

/* -----------------------------------------------------------------------------*
 *  Get type list 
 * -----------------------------------------------------------------------------*/

#ifdef SWIG_LINK_RUNTIME
void *SWIG_ReturnGlobalTypeList(void *);
#endif

SWIGRUNTIME swig_module_info *
SWIG_Python_GetModule(void *SWIGUNUSEDPARM(clientdata)) {
  static void *type_pointer = (void *)0;
  /* first check if module already created */
  if (!type_pointer) {
#ifdef SWIG_LINK_RUNTIME
    type_pointer = SWIG_ReturnGlobalTypeList((void *)0);
#else
    type_pointer = PyCapsule_Import(SWIGPY_CAPSULE_NAME, 0);
    if (PyErr_Occurred()) {
      PyErr_Clear();
      type_pointer = (void *)0;
    }
#endif
  }
  return (swig_module_info *) type_pointer;
}

SWIGRUNTIME void
SWIG_Python_DestroyModule(PyObject *obj)
{
  swig_module_info *swig_module = (swig_module_info *) PyCapsule_GetPointer(obj, SWIGPY_CAPSULE_NAME);
  swig_type_info **types = swig_module->types;
  size_t i;
  for (i =0; i < swig_module->size; ++i) {
    swig_type_info *ty = types[i];
    if (ty->owndata) {
      SwigPyClientData *data = (SwigPyClientData *) ty->clientdata;
      if (data) SwigPyClientData_Del(data);
    }
  }
  Py_DECREF(SWIG_This());
  Swig_This_global = NULL;
}

SWIGRUNTIME void
SWIG_Python_SetModule(swig_module_info *swig_module) {
#if PY_VERSION_HEX >= 0x03000000
 /* Add a dummy module object into sys.modules */
  PyObject *module = PyImport_AddModule("swig_runtime_data" SWIG_RUNTIME_VERSION);
#else
  static PyMethodDef swig_empty_runtime_method_table[] = { {NULL, NULL, 0, NULL} }; /* Sentinel */
  PyObject *module = Py_InitModule("swig_runtime_data" SWIG_RUNTIME_VERSION, swig_empty_runtime_method_table);
#endif
  PyObject *pointer = PyCapsule_New((void *) swig_module, SWIGPY_CAPSULE_NAME, SWIG_Python_DestroyModule);
  if (pointer && module) {
    PyModule_AddObject(module, "type_pointer_capsule" SWIG_TYPE_TABLE_NAME, pointer);
  } else {
    Py_XDECREF(pointer);
  }
}

/* The python cached type query */
SWIGRUNTIME PyObject *
SWIG_Python_TypeCache(void) {
  static PyObject *SWIG_STATIC_POINTER(cache) = PyDict_New();
  return cache;
}

SWIGRUNTIME swig_type_info *
SWIG_Python_TypeQuery(const char *type)
{
  PyObject *cache = SWIG_Python_TypeCache();
  PyObject *key = SWIG_Python_str_FromChar(type); 
  PyObject *obj = PyDict_GetItem(cache, key);
  swig_type_info *descriptor;
  if (obj) {
    descriptor = (swig_type_info *) PyCapsule_GetPointer(obj, NULL);
  } else {
    swig_module_info *swig_module = SWIG_GetModule(0);
    descriptor = SWIG_TypeQueryModule(swig_module, swig_module, type);
    if (descriptor) {
      obj = PyCapsule_New((void*) descriptor, NULL, NULL);
      PyDict_SetItem(cache, key, obj);
      Py_DECREF(obj);
    }
  }
  Py_DECREF(key);
  return descriptor;
}

/* 
   For backward compatibility only
*/
#define SWIG_POINTER_EXCEPTION  0
#define SWIG_arg_fail(arg)      SWIG_Python_ArgFail(arg)
#define SWIG_MustGetPtr(p, type, argnum, flags)  SWIG_Python_MustGetPtr(p, type, argnum, flags)

SWIGRUNTIME int
SWIG_Python_AddErrMesg(const char* mesg, int infront)
{  
  if (PyErr_Occurred()) {
    PyObject *type = 0;
    PyObject *value = 0;
    PyObject *traceback = 0;
    PyErr_Fetch(&type, &value, &traceback);
    if (value) {
      PyObject *old_str = PyObject_Str(value);
      const char *tmp = SWIG_Python_str_AsChar(old_str);
      const char *errmesg = tmp ? tmp : "Invalid error message";
      Py_XINCREF(type);
      PyErr_Clear();
      if (infront) {
	PyErr_Format(type, "%s %s", mesg, errmesg);
      } else {
	PyErr_Format(type, "%s %s", errmesg, mesg);
      }
      SWIG_Python_str_DelForPy3(tmp);
      Py_DECREF(old_str);
    }
    return 1;
  } else {
    return 0;
  }
}
  
SWIGRUNTIME int
SWIG_Python_ArgFail(int argnum)
{
  if (PyErr_Occurred()) {
    /* add information about failing argument */
    char mesg[256];
    PyOS_snprintf(mesg, sizeof(mesg), "argument number %d:", argnum);
    return SWIG_Python_AddErrMesg(mesg, 1);
  } else {
    return 0;
  }
}

SWIGRUNTIMEINLINE const char *
SwigPyObject_GetDesc(PyObject *self)
{
  SwigPyObject *v = (SwigPyObject *)self;
  swig_type_info *ty = v ? v->ty : 0;
  return ty ? ty->str : "";
}

SWIGRUNTIME void
SWIG_Python_TypeError(const char *type, PyObject *obj)
{
  if (type) {
#if defined(SWIG_COBJECT_TYPES)
    if (obj && SwigPyObject_Check(obj)) {
      const char *otype = (const char *) SwigPyObject_GetDesc(obj);
      if (otype) {
	PyErr_Format(PyExc_TypeError, "a '%s' is expected, 'SwigPyObject(%s)' is received",
		     type, otype);
	return;
      }
    } else 
#endif      
    {
      const char *otype = (obj ? obj->ob_type->tp_name : 0); 
      if (otype) {
	PyObject *str = PyObject_Str(obj);
	const char *cstr = str ? SWIG_Python_str_AsChar(str) : 0;
	if (cstr) {
	  PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s(%s)' is received",
		       type, otype, cstr);
          SWIG_Python_str_DelForPy3(cstr);
	} else {
	  PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s' is received",
		       type, otype);
	}
	Py_XDECREF(str);
	return;
      }
    }   
    PyErr_Format(PyExc_TypeError, "a '%s' is expected", type);
  } else {
    PyErr_Format(PyExc_TypeError, "unexpected type is received");
  }
}


/* Convert a pointer value, signal an exception on a type mismatch */
SWIGRUNTIME void *
SWIG_Python_MustGetPtr(PyObject *obj, swig_type_info *ty, int SWIGUNUSEDPARM(argnum), int flags) {
  void *result;
  if (SWIG_Python_ConvertPtr(obj, &result, ty, flags) == -1) {
    PyErr_Clear();
#if SWIG_POINTER_EXCEPTION
    if (flags) {
      SWIG_Python_TypeError(SWIG_TypePrettyName(ty), obj);
      SWIG_Python_ArgFail(argnum);
    }
#endif
  }
  return result;
}

#ifdef SWIGPYTHON_BUILTIN
SWIGRUNTIME int
SWIG_Python_NonDynamicSetAttr(PyObject *obj, PyObject *name, PyObject *value) {
  PyTypeObject *tp = obj->ob_type;
  PyObject *descr;
  PyObject *encoded_name;
  descrsetfunc f;
  int res = -1;

# ifdef Py_USING_UNICODE
  if (PyString_Check(name)) {
    name = PyUnicode_Decode(PyString_AsString(name), PyString_Size(name), NULL, NULL);
    if (!name)
      return -1;
  } else if (!PyUnicode_Check(name))
# else
  if (!PyString_Check(name))
# endif
  {
    PyErr_Format(PyExc_TypeError, "attribute name must be string, not '%.200s'", name->ob_type->tp_name);
    return -1;
  } else {
    Py_INCREF(name);
  }

  if (!tp->tp_dict) {
    if (PyType_Ready(tp) < 0)
      goto done;
  }

  descr = _PyType_Lookup(tp, name);
  f = NULL;
  if (descr != NULL)
    f = descr->ob_type->tp_descr_set;
  if (!f) {
    if (PyString_Check(name)) {
      encoded_name = name;
      Py_INCREF(name);
    } else {
      encoded_name = PyUnicode_AsUTF8String(name);
      if (!encoded_name)
        return -1;
    }
    PyErr_Format(PyExc_AttributeError, "'%.100s' object has no attribute '%.200s'", tp->tp_name, PyString_AsString(encoded_name));
    Py_DECREF(encoded_name);
  } else {
    res = f(descr, obj, value);
  }
  
  done:
  Py_DECREF(name);
  return res;
}
#endif


#ifdef __cplusplus
}
#endif



#define SWIG_exception_fail(code, msg) do { SWIG_Error(code, msg); SWIG_fail; } while(0) 

#define SWIG_contract_assert(expr, msg) if (!(expr)) { SWIG_Error(SWIG_RuntimeError, msg); SWIG_fail; } else 



#ifdef __cplusplus
extern "C" {
#endif

/* Method creation and docstring support functions */

SWIGINTERN PyMethodDef *SWIG_PythonGetProxyDoc(const char *name);
SWIGINTERN PyObject *SWIG_PyInstanceMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func);
SWIGINTERN PyObject *SWIG_PyStaticMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func);

#ifdef __cplusplus
}
#endif


  #define SWIG_exception(code, msg) do { SWIG_Error(code, msg); SWIG_fail;; } while(0) 


/* -------- TYPES TABLE (BEGIN) -------- */

#define SWIGTYPE_p_char swig_types[0]
#define SWIGTYPE_p_ext_key swig_types[1]
#define SWIGTYPE_p_int swig_types[2]
#define SWIGTYPE_p_long_long swig_types[3]
#define SWIGTYPE_p_p_char swig_types[4]
#define SWIGTYPE_p_p_ext_key swig_types[5]
#define SWIGTYPE_p_p_wally_descriptor swig_types[6]
#define SWIGTYPE_p_p_wally_map swig_types[7]
#define SWIGTYPE_p_p_wally_psbt swig_types[8]
#define SWIGTYPE_p_p_wally_tx swig_types[9]
#define SWIGTYPE_p_p_wally_tx_input swig_types[10]
#define SWIGTYPE_p_p_wally_tx_output swig_types[11]
#define SWIGTYPE_p_p_wally_tx_witness_stack swig_types[12]
#define SWIGTYPE_p_p_words swig_types[13]
#define SWIGTYPE_p_short swig_types[14]
#define SWIGTYPE_p_signed_char swig_types[15]
#define SWIGTYPE_p_size_t swig_types[16]
#define SWIGTYPE_p_unsigned_char swig_types[17]
#define SWIGTYPE_p_unsigned_int swig_types[18]
#define SWIGTYPE_p_unsigned_long_long swig_types[19]
#define SWIGTYPE_p_unsigned_short swig_types[20]
#define SWIGTYPE_p_wally_descriptor swig_types[21]
#define SWIGTYPE_p_wally_map swig_types[22]
#define SWIGTYPE_p_wally_psbt swig_types[23]
#define SWIGTYPE_p_wally_psbt_input swig_types[24]
#define SWIGTYPE_p_wally_psbt_output swig_types[25]
#define SWIGTYPE_p_wally_tx swig_types[26]
#define SWIGTYPE_p_wally_tx_input swig_types[27]
#define SWIGTYPE_p_wally_tx_output swig_types[28]
#define SWIGTYPE_p_wally_tx_witness_stack swig_types[29]
#define SWIGTYPE_p_words swig_types[30]
static swig_type_info *swig_types[32];
static swig_module_info swig_module = {swig_types, 31, 0, 0, 0, 0};
#define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
#define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)

/* -------- TYPES TABLE (END) -------- */

#ifdef SWIG_TypeQuery
# undef SWIG_TypeQuery
#endif
#define SWIG_TypeQuery SWIG_Python_TypeQuery

/*-----------------------------------------------
              @(target):= _wallycore.so
  ------------------------------------------------*/
#if PY_VERSION_HEX >= 0x03000000
#  define SWIG_init    PyInit__wallycore

#else
#  define SWIG_init    init_wallycore

#endif
#define SWIG_name    "_wallycore"

#define SWIGVERSION 0x040002 
#define SWIG_VERSION SWIGVERSION


#define SWIG_as_voidptr(a) (void *)((const void *)(a)) 
#define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),(void**)(a)) 


#define SWIG_FILE_WITH_INIT
#include <stdbool.h>
#include "../include/wally_core.h"
#include "../include/wally_address.h"
#include "../include/wally_anti_exfil.h"
#include "../include/wally_bip32.h"
#include "bip32_int.h"
#include "../include/wally_bip38.h"
#include "../include/wally_bip39.h"
#include "../include/wally_bip85.h"
#include "../include/wally_coinselection.h"
#include "../include/wally_crypto.h"
#include "../include/wally_descriptor.h"
#include "../include/wally_map.h"
#include "../include/wally_psbt.h"
#include "../include/wally_psbt_members.h"
#include "../include/wally_script.h"
#include "../include/wally_symmetric.h"
#include "../include/wally_transaction.h"
#include "../include/wally_transaction_members.h"
#include "../include/wally_elements.h"
#include "../internal.h"

#undef malloc
#undef free
#define malloc(size) wally_malloc(size)
#define free(ptr) wally_free(ptr)

static int check_result(int result)
{
    switch (result) {
    case WALLY_OK:
        break;
    case WALLY_EINVAL:
        PyErr_SetString(PyExc_ValueError, "Invalid argument");
        break;
    case WALLY_ENOMEM:
        PyErr_SetString(PyExc_MemoryError, "Out of memory");
        break;
    default: /* WALLY_ERROR */
         PyErr_SetString(PyExc_RuntimeError, "Failed");
         break;
    }
    return result;
}

static bool size_t_cast(PyObject *item, size_t *val)
{
    if (PyLong_Check(item)) {
        *val = PyLong_AsSize_t(item);
        if (!PyErr_Occurred())
          return true;
        PyErr_Clear();
    }
    return false;
}

static bool ulonglong_cast(PyObject *item, unsigned long long *val)
{
    if (PyLong_Check(item)) {
        *val = PyLong_AsUnsignedLongLong(item);
        if (!PyErr_Occurred())
          return true;
        PyErr_Clear();
    }
    return false;
}

#define capsule_dtor(name, fn) static void destroy_##name(PyObject *obj) { \
    struct name *p = obj == Py_None ? NULL : (struct name *)PyCapsule_GetPointer(obj, "struct " #name " *"); \
    if (p) fn(p); }

capsule_dtor(ext_key, bip32_key_free)
capsule_dtor(wally_descriptor, wally_descriptor_free)
capsule_dtor(wally_psbt, wally_psbt_free)
capsule_dtor(wally_tx, wally_tx_free)
capsule_dtor(wally_tx_input, wally_tx_input_free)
capsule_dtor(wally_tx_output, wally_tx_output_free)
capsule_dtor(wally_tx_witness_stack, wally_tx_witness_stack_free)
capsule_dtor(wally_map, wally_map_free)
static void destroy_words(PyObject *obj) { (void)obj; }

#define MAX_LOCAL_STACK 256u


#include <stdint.h>		// Use the C99 official header


SWIGINTERNINLINE PyObject*
  SWIG_From_int  (int value)
{
  return PyInt_FromLong((long) value);
}


#include <limits.h>
#if !defined(SWIG_NO_LLONG_MAX)
# if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__)
#   define LLONG_MAX __LONG_LONG_MAX__
#   define LLONG_MIN (-LLONG_MAX - 1LL)
#   define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL)
# endif
#endif


SWIGINTERN int
SWIG_AsVal_double (PyObject *obj, double *val)
{
  int res = SWIG_TypeError;
  if (PyFloat_Check(obj)) {
    if (val) *val = PyFloat_AsDouble(obj);
    return SWIG_OK;
#if PY_VERSION_HEX < 0x03000000
  } else if (PyInt_Check(obj)) {
    if (val) *val = (double) PyInt_AsLong(obj);
    return SWIG_OK;
#endif
  } else if (PyLong_Check(obj)) {
    double v = PyLong_AsDouble(obj);
    if (!PyErr_Occurred()) {
      if (val) *val = v;
      return SWIG_OK;
    } else {
      PyErr_Clear();
    }
  }
#ifdef SWIG_PYTHON_CAST_MODE
  {
    int dispatch = 0;
    double d = PyFloat_AsDouble(obj);
    if (!PyErr_Occurred()) {
      if (val) *val = d;
      return SWIG_AddCast(SWIG_OK);
    } else {
      PyErr_Clear();
    }
    if (!dispatch) {
      long v = PyLong_AsLong(obj);
      if (!PyErr_Occurred()) {
	if (val) *val = v;
	return SWIG_AddCast(SWIG_AddCast(SWIG_OK));
      } else {
	PyErr_Clear();
      }
    }
  }
#endif
  return res;
}


#include <float.h>


#include <math.h>


SWIGINTERNINLINE int
SWIG_CanCastAsInteger(double *d, double min, double max) {
  double x = *d;
  if ((min <= x && x <= max)) {
   double fx = floor(x);
   double cx = ceil(x);
   double rd =  ((x - fx) < 0.5) ? fx : cx; /* simple rint */
   if ((errno == EDOM) || (errno == ERANGE)) {
     errno = 0;
   } else {
     double summ, reps, diff;
     if (rd < x) {
       diff = x - rd;
     } else if (rd > x) {
       diff = rd - x;
     } else {
       return 1;
     }
     summ = rd + x;
     reps = diff/summ;
     if (reps < 8*DBL_EPSILON) {
       *d = rd;
       return 1;
     }
   }
  }
  return 0;
}


SWIGINTERN int
SWIG_AsVal_unsigned_SS_long (PyObject *obj, unsigned long *val) 
{
#if PY_VERSION_HEX < 0x03000000
  if (PyInt_Check(obj)) {
    long v = PyInt_AsLong(obj);
    if (v >= 0) {
      if (val) *val = v;
      return SWIG_OK;
    } else {
      return SWIG_OverflowError;
    }
  } else
#endif
  if (PyLong_Check(obj)) {
    unsigned long v = PyLong_AsUnsignedLong(obj);
    if (!PyErr_Occurred()) {
      if (val) *val = v;
      return SWIG_OK;
    } else {
      PyErr_Clear();
      return SWIG_OverflowError;
    }
  }
#ifdef SWIG_PYTHON_CAST_MODE
  {
    int dispatch = 0;
    unsigned long v = PyLong_AsUnsignedLong(obj);
    if (!PyErr_Occurred()) {
      if (val) *val = v;
      return SWIG_AddCast(SWIG_OK);
    } else {
      PyErr_Clear();
    }
    if (!dispatch) {
      double d;
      int res = SWIG_AddCast(SWIG_AsVal_double (obj,&d));
      if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, 0, ULONG_MAX)) {
	if (val) *val = (unsigned long)(d);
	return res;
      }
    }
  }
#endif
  return SWIG_TypeError;
}


SWIGINTERN int
SWIG_AsVal_unsigned_SS_int (PyObject * obj, unsigned int *val)
{
  unsigned long v;
  int res = SWIG_AsVal_unsigned_SS_long (obj, &v);
  if (SWIG_IsOK(res)) {
    if ((v > UINT_MAX)) {
      return SWIG_OverflowError;
    } else {
      if (val) *val = (unsigned int)(v);
    }
  }  
  return res;
}


#if defined(LLONG_MAX) && !defined(SWIG_LONG_LONG_AVAILABLE)
#  define SWIG_LONG_LONG_AVAILABLE
#endif


#ifdef SWIG_LONG_LONG_AVAILABLE
SWIGINTERN int
SWIG_AsVal_unsigned_SS_long_SS_long (PyObject *obj, unsigned long long *val)
{
  int res = SWIG_TypeError;
  if (PyLong_Check(obj)) {
    unsigned long long v = PyLong_AsUnsignedLongLong(obj);
    if (!PyErr_Occurred()) {
      if (val) *val = v;
      return SWIG_OK;
    } else {
      PyErr_Clear();
      res = SWIG_OverflowError;
    }
  } else {
    unsigned long v;
    res = SWIG_AsVal_unsigned_SS_long (obj,&v);
    if (SWIG_IsOK(res)) {
      if (val) *val = v;
      return res;
    }
  }
#ifdef SWIG_PYTHON_CAST_MODE
  {
    const double mant_max = 1LL << DBL_MANT_DIG;
    double d;
    res = SWIG_AsVal_double (obj,&d);
    if (SWIG_IsOK(res) && !SWIG_CanCastAsInteger(&d, 0, mant_max))
      return SWIG_OverflowError;
    if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, 0, mant_max)) {
      if (val) *val = (unsigned long long)(d);
      return SWIG_AddCast(res);
    }
    res = SWIG_TypeError;
  }
#endif
  return res;
}
#endif


SWIGINTERNINLINE int
SWIG_AsVal_size_t (PyObject * obj, size_t *val)
{
  int res = SWIG_TypeError;
#ifdef SWIG_LONG_LONG_AVAILABLE
  if (sizeof(size_t) <= sizeof(unsigned long)) {
#endif
    unsigned long v;
    res = SWIG_AsVal_unsigned_SS_long (obj, val ? &v : 0);
    if (SWIG_IsOK(res) && val) *val = (size_t)(v);
#ifdef SWIG_LONG_LONG_AVAILABLE
  } else if (sizeof(size_t) <= sizeof(unsigned long long)) {
    unsigned long long v;
    res = SWIG_AsVal_unsigned_SS_long_SS_long (obj, val ? &v : 0);
    if (SWIG_IsOK(res) && val) *val = (size_t)(v);
  }
#endif
  return res;
}


SWIGINTERN swig_type_info*
SWIG_pchar_descriptor(void)
{
  static int init = 0;
  static swig_type_info* info = 0;
  if (!init) {
    info = SWIG_TypeQuery("_p_char");
    init = 1;
  }
  return info;
}


SWIGINTERN int
SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize, int *alloc)
{
#if PY_VERSION_HEX>=0x03000000
#if defined(SWIG_PYTHON_STRICT_BYTE_CHAR)
  if (PyBytes_Check(obj))
#else
  if (PyUnicode_Check(obj))
#endif
#else  
  if (PyString_Check(obj))
#endif
  {
    char *cstr; Py_ssize_t len;
    int ret = SWIG_OK;
#if PY_VERSION_HEX>=0x03000000
#if !defined(SWIG_PYTHON_STRICT_BYTE_CHAR)
    if (!alloc && cptr) {
        /* We can't allow converting without allocation, since the internal
           representation of string in Python 3 is UCS-2/UCS-4 but we require
           a UTF-8 representation.
           TODO(bhy) More detailed explanation */
        return SWIG_RuntimeError;
    }
    obj = PyUnicode_AsUTF8String(obj);
    if (!obj)
      return SWIG_TypeError;
    if (alloc)
      *alloc = SWIG_NEWOBJ;
#endif
    if (PyBytes_AsStringAndSize(obj, &cstr, &len) == -1)
      return SWIG_TypeError;
#else
    if (PyString_AsStringAndSize(obj, &cstr, &len) == -1)
      return SWIG_TypeError;
#endif
    if (cptr) {
      if (alloc) {
	if (*alloc == SWIG_NEWOBJ) {
	  *cptr = (char *)memcpy(malloc((len + 1)*sizeof(char)), cstr, sizeof(char)*(len + 1));
	  *alloc = SWIG_NEWOBJ;
	} else {
	  *cptr = cstr;
	  *alloc = SWIG_OLDOBJ;
	}
      } else {
#if PY_VERSION_HEX>=0x03000000
#if defined(SWIG_PYTHON_STRICT_BYTE_CHAR)
	*cptr = PyBytes_AsString(obj);
#else
	assert(0); /* Should never reach here with Unicode strings in Python 3 */
#endif
#else
	*cptr = SWIG_Python_str_AsChar(obj);
        if (!*cptr)
          ret = SWIG_TypeError;
#endif
      }
    }
    if (psize) *psize = len + 1;
#if PY_VERSION_HEX>=0x03000000 && !defined(SWIG_PYTHON_STRICT_BYTE_CHAR)
    Py_XDECREF(obj);
#endif
    return ret;
  } else {
#if defined(SWIG_PYTHON_2_UNICODE)
#if defined(SWIG_PYTHON_STRICT_BYTE_CHAR)
#error "Cannot use both SWIG_PYTHON_2_UNICODE and SWIG_PYTHON_STRICT_BYTE_CHAR at once"
#endif
#if PY_VERSION_HEX<0x03000000
    if (PyUnicode_Check(obj)) {
      char *cstr; Py_ssize_t len;
      if (!alloc && cptr) {
        return SWIG_RuntimeError;
      }
      obj = PyUnicode_AsUTF8String(obj);
      if (!obj)
        return SWIG_TypeError;
      if (PyString_AsStringAndSize(obj, &cstr, &len) != -1) {
        if (cptr) {
          if (alloc) *alloc = SWIG_NEWOBJ;
          *cptr = (char *)memcpy(malloc((len + 1)*sizeof(char)), cstr, sizeof(char)*(len + 1));
        }
        if (psize) *psize = len + 1;

        Py_XDECREF(obj);
        return SWIG_OK;
      } else {
        Py_XDECREF(obj);
      }
    }
#endif
#endif

    swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
    if (pchar_descriptor) {
      void* vptr = 0;
      if (SWIG_ConvertPtr(obj, &vptr, pchar_descriptor, 0) == SWIG_OK) {
	if (cptr) *cptr = (char *) vptr;
	if (psize) *psize = vptr ? (strlen((char *)vptr) + 1) : 0;
	if (alloc) *alloc = SWIG_OLDOBJ;
	return SWIG_OK;
      }
    }
  }
  return SWIG_TypeError;
}





SWIGINTERN int
SWIG_AsVal_long (PyObject *obj, long* val)
{
#if PY_VERSION_HEX < 0x03000000
  if (PyInt_Check(obj)) {
    if (val) *val = PyInt_AsLong(obj);
    return SWIG_OK;
  } else
#endif
  if (PyLong_Check(obj)) {
    long v = PyLong_AsLong(obj);
    if (!PyErr_Occurred()) {
      if (val) *val = v;
      return SWIG_OK;
    } else {
      PyErr_Clear();
      return SWIG_OverflowError;
    }
  }
#ifdef SWIG_PYTHON_CAST_MODE
  {
    int dispatch = 0;
    long v = PyInt_AsLong(obj);
    if (!PyErr_Occurred()) {
      if (val) *val = v;
      return SWIG_AddCast(SWIG_OK);
    } else {
      PyErr_Clear();
    }
    if (!dispatch) {
      double d;
      int res = SWIG_AddCast(SWIG_AsVal_double (obj,&d));
      if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, LONG_MIN, LONG_MAX)) {
	if (val) *val = (long)(d);
	return res;
      }
    }
  }
#endif
  return SWIG_TypeError;
}


SWIGINTERN int
SWIG_AsVal_int (PyObject * obj, int *val)
{
  long v;
  int res = SWIG_AsVal_long (obj, &v);
  if (SWIG_IsOK(res)) {
    if ((v < INT_MIN || v > INT_MAX)) {
      return SWIG_OverflowError;
    } else {
      if (val) *val = (int)(v);
    }
  }  
  return res;
}

#ifdef __cplusplus
extern "C" {
#endif
SWIGINTERN PyObject *_wrap_init(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  uint32_t arg1 ;
  unsigned int val1 ;
  int ecode1 = 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  ecode1 = SWIG_AsVal_unsigned_SS_int(swig_obj[0], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "init" "', argument " "1"" of type '" "uint32_t""'");
  } 
  arg1 = (uint32_t)(val1);
  {
    result = (int)wally_init(arg1);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_cleanup(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  uint32_t arg1 ;
  unsigned int val1 ;
  int ecode1 = 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  ecode1 = SWIG_AsVal_unsigned_SS_int(swig_obj[0], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "cleanup" "', argument " "1"" of type '" "uint32_t""'");
  } 
  arg1 = (uint32_t)(val1);
  {
    result = (int)wally_cleanup(arg1);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_get_build_version(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  uint32_t *arg1 = (uint32_t *) 0 ;
  uint32_t val1 ;
  int result;
  
  {
    val1 = 0; arg1 = (uint32_t *)&val1;
  }
  if (!SWIG_Python_UnpackTuple(args, "get_build_version", 0, 0, 0)) SWIG_fail;
  {
    result = (int)wally_get_build_version(arg1);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyLong_FromUnsignedLong(*arg1);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_bzero(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  void *arg1 = (void *) 0 ;
  size_t arg2 ;
  PyObject *swig_obj[1] ;
  int result;
  
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "bzero" "', argument " "1"" of type '" "(void* bytes, size_t bytes_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (void *) buf;
      arg2 = (size_t) (size / sizeof(void));
    }
  }
  {
    result = (int)wally_bzero(arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_free_string(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  char *arg1 = (char *) 0 ;
  int res1 ;
  char *buf1 = 0 ;
  int alloc1 = 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  res1 = SWIG_AsCharPtrAndSize(swig_obj[0], &buf1, NULL, &alloc1);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "free_string" "', argument " "1"" of type '" "char *""'");
  }
  arg1 = (char *)(buf1);
  {
    result = (int)wally_free_string(arg1);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
  return resultobj;
fail:
  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
  return NULL;
}


SWIGINTERN PyObject *_wrap_secp_randomize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  PyObject *swig_obj[1] ;
  int result;
  
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "secp_randomize" "', argument " "1"" of type '" "(const unsigned char* bytes, size_t bytes_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_secp_randomize((unsigned char const *)arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_hex_verify(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  char *arg1 = (char *) 0 ;
  int res1 ;
  char *buf1 = 0 ;
  int alloc1 = 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  res1 = SWIG_AsCharPtrAndSize(swig_obj[0], &buf1, NULL, &alloc1);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "hex_verify" "', argument " "1"" of type '" "char const *""'");
  }
  arg1 = (char *)(buf1);
  {
    result = (int)wally_hex_verify((char const *)arg1);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
  return resultobj;
fail:
  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
  return NULL;
}


SWIGINTERN PyObject *_wrap_hex_n_verify(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  char *arg1 = (char *) 0 ;
  size_t arg2 ;
  int res1 ;
  char *buf1 = 0 ;
  int alloc1 = 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "hex_n_verify", 2, 2, swig_obj)) SWIG_fail;
  res1 = SWIG_AsCharPtrAndSize(swig_obj[0], &buf1, NULL, &alloc1);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "hex_n_verify" "', argument " "1"" of type '" "char const *""'");
  }
  arg1 = (char *)(buf1);
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "hex_n_verify" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_hex_n_verify((char const *)arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
  return resultobj;
fail:
  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
  return NULL;
}


SWIGINTERN PyObject *_wrap_hex_from_bytes(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  char **arg3 = (char **) 0 ;
  char *txt3 ;
  PyObject *swig_obj[1] ;
  int result;
  
  {
    txt3 = NULL;
    arg3 = (char **)&txt3;
  }
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "hex_from_bytes" "', argument " "1"" of type '" "(const unsigned char* bytes, size_t bytes_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_hex_from_bytes((unsigned char const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    if (*arg3 != NULL) {
      Py_DecRef(resultobj);
      resultobj = PyString_FromString(*arg3);
      wally_free_string(*arg3);
    }
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_hex_to_bytes(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  char *arg1 = (char *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  size_t *arg4 = (size_t *) 0 ;
  int res1 ;
  char *buf1 = 0 ;
  int alloc1 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg4 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "hex_to_bytes", 2, 2, swig_obj)) SWIG_fail;
  res1 = SWIG_AsCharPtrAndSize(swig_obj[0], &buf1, NULL, &alloc1);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "hex_to_bytes" "', argument " "1"" of type '" "char const *""'");
  }
  arg1 = (char *)(buf1);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "hex_to_bytes" "', argument " "2"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg2 = (unsigned char *) buf;
    arg3 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_hex_to_bytes((char const *)arg1,arg2,arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg4);
  }
  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
  return resultobj;
fail:
  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
  return NULL;
}


SWIGINTERN PyObject *_wrap_hex_n_to_bytes(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  char *arg1 = (char *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t *arg5 = (size_t *) 0 ;
  int res1 ;
  char *buf1 = 0 ;
  int alloc1 = 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  size_t written = 0; arg5 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "hex_n_to_bytes", 3, 3, swig_obj)) SWIG_fail;
  res1 = SWIG_AsCharPtrAndSize(swig_obj[0], &buf1, NULL, &alloc1);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "hex_n_to_bytes" "', argument " "1"" of type '" "char const *""'");
  }
  arg1 = (char *)(buf1);
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "hex_n_to_bytes" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "hex_n_to_bytes" "', argument " "3"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg3 = (unsigned char *) buf;
    arg4 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_hex_n_to_bytes((char const *)arg1,arg2,arg3,arg4,arg5);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg5);
  }
  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
  return resultobj;
fail:
  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
  return NULL;
}


SWIGINTERN PyObject *_wrap_base58_from_bytes(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  uint32_t arg3 ;
  char **arg4 = (char **) 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  char *txt4 ;
  PyObject *swig_obj[2] ;
  int result;
  
  {
    txt4 = NULL;
    arg4 = (char **)&txt4;
  }
  if (!SWIG_Python_UnpackTuple(args, "base58_from_bytes", 2, 2, swig_obj)) SWIG_fail;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "base58_from_bytes" "', argument " "1"" of type '" "(const unsigned char* bytes, size_t bytes_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  ecode3 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "base58_from_bytes" "', argument " "3"" of type '" "uint32_t""'");
  } 
  arg3 = (uint32_t)(val3);
  {
    result = (int)wally_base58_from_bytes((unsigned char const *)arg1,arg2,arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    if (*arg4 != NULL) {
      Py_DecRef(resultobj);
      resultobj = PyString_FromString(*arg4);
      wally_free_string(*arg4);
    }
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_base58_to_bytes(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  char *arg1 = (char *) 0 ;
  uint32_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t *arg5 = (size_t *) 0 ;
  int res1 ;
  char *buf1 = 0 ;
  int alloc1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  size_t written = 0; arg5 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "base58_to_bytes", 3, 3, swig_obj)) SWIG_fail;
  res1 = SWIG_AsCharPtrAndSize(swig_obj[0], &buf1, NULL, &alloc1);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "base58_to_bytes" "', argument " "1"" of type '" "char const *""'");
  }
  arg1 = (char *)(buf1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "base58_to_bytes" "', argument " "2"" of type '" "uint32_t""'");
  } 
  arg2 = (uint32_t)(val2);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "base58_to_bytes" "', argument " "3"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg3 = (unsigned char *) buf;
    arg4 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_base58_to_bytes((char const *)arg1,arg2,arg3,arg4,arg5);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg5);
  }
  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
  return resultobj;
fail:
  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
  return NULL;
}


SWIGINTERN PyObject *_wrap_base58_n_to_bytes(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  char *arg1 = (char *) 0 ;
  size_t arg2 ;
  uint32_t arg3 ;
  unsigned char *arg4 = (unsigned char *) 0 ;
  size_t arg5 ;
  size_t *arg6 = (size_t *) 0 ;
  int res1 ;
  char *buf1 = 0 ;
  int alloc1 = 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  PyObject *swig_obj[4] ;
  int result;
  
  size_t written = 0; arg6 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "base58_n_to_bytes", 4, 4, swig_obj)) SWIG_fail;
  res1 = SWIG_AsCharPtrAndSize(swig_obj[0], &buf1, NULL, &alloc1);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "base58_n_to_bytes" "', argument " "1"" of type '" "char const *""'");
  }
  arg1 = (char *)(buf1);
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "base58_n_to_bytes" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  ecode3 = SWIG_AsVal_unsigned_SS_int(swig_obj[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "base58_n_to_bytes" "', argument " "3"" of type '" "uint32_t""'");
  } 
  arg3 = (uint32_t)(val3);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[3], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "base58_n_to_bytes" "', argument " "4"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg4 = (unsigned char *) buf;
    arg5 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_base58_n_to_bytes((char const *)arg1,arg2,arg3,arg4,arg5,arg6);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg6);
  }
  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
  return resultobj;
fail:
  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
  return NULL;
}


SWIGINTERN PyObject *_wrap_base58_get_length(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  char *arg1 = (char *) 0 ;
  size_t *arg2 = (size_t *) 0 ;
  int res1 ;
  char *buf1 = 0 ;
  int alloc1 = 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  size_t written = 0; arg2 = (size_t *)&written;
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  res1 = SWIG_AsCharPtrAndSize(swig_obj[0], &buf1, NULL, &alloc1);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "base58_get_length" "', argument " "1"" of type '" "char const *""'");
  }
  arg1 = (char *)(buf1);
  {
    result = (int)wally_base58_get_length((char const *)arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg2);
  }
  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
  return resultobj;
fail:
  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
  return NULL;
}


SWIGINTERN PyObject *_wrap_base58_n_get_length(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  char *arg1 = (char *) 0 ;
  size_t arg2 ;
  size_t *arg3 = (size_t *) 0 ;
  int res1 ;
  char *buf1 = 0 ;
  int alloc1 = 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg3 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "base58_n_get_length", 2, 2, swig_obj)) SWIG_fail;
  res1 = SWIG_AsCharPtrAndSize(swig_obj[0], &buf1, NULL, &alloc1);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "base58_n_get_length" "', argument " "1"" of type '" "char const *""'");
  }
  arg1 = (char *)(buf1);
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "base58_n_get_length" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_base58_n_get_length((char const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg3);
  }
  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
  return resultobj;
fail:
  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
  return NULL;
}


SWIGINTERN PyObject *_wrap_base64_from_bytes(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  uint32_t arg3 ;
  char **arg4 = (char **) 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  char *txt4 ;
  PyObject *swig_obj[2] ;
  int result;
  
  {
    txt4 = NULL;
    arg4 = (char **)&txt4;
  }
  if (!SWIG_Python_UnpackTuple(args, "base64_from_bytes", 2, 2, swig_obj)) SWIG_fail;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "base64_from_bytes" "', argument " "1"" of type '" "(const unsigned char* bytes, size_t bytes_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  ecode3 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "base64_from_bytes" "', argument " "3"" of type '" "uint32_t""'");
  } 
  arg3 = (uint32_t)(val3);
  {
    result = (int)wally_base64_from_bytes((unsigned char const *)arg1,arg2,arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    if (*arg4 != NULL) {
      Py_DecRef(resultobj);
      resultobj = PyString_FromString(*arg4);
      wally_free_string(*arg4);
    }
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_base64_to_bytes(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  char *arg1 = (char *) 0 ;
  uint32_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t *arg5 = (size_t *) 0 ;
  int res1 ;
  char *buf1 = 0 ;
  int alloc1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  size_t written = 0; arg5 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "base64_to_bytes", 3, 3, swig_obj)) SWIG_fail;
  res1 = SWIG_AsCharPtrAndSize(swig_obj[0], &buf1, NULL, &alloc1);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "base64_to_bytes" "', argument " "1"" of type '" "char const *""'");
  }
  arg1 = (char *)(buf1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "base64_to_bytes" "', argument " "2"" of type '" "uint32_t""'");
  } 
  arg2 = (uint32_t)(val2);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "base64_to_bytes" "', argument " "3"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg3 = (unsigned char *) buf;
    arg4 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_base64_to_bytes((char const *)arg1,arg2,arg3,arg4,arg5);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg5);
  }
  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
  return resultobj;
fail:
  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
  return NULL;
}


SWIGINTERN PyObject *_wrap_base64_n_to_bytes(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  char *arg1 = (char *) 0 ;
  size_t arg2 ;
  uint32_t arg3 ;
  unsigned char *arg4 = (unsigned char *) 0 ;
  size_t arg5 ;
  size_t *arg6 = (size_t *) 0 ;
  int res1 ;
  char *buf1 = 0 ;
  int alloc1 = 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  PyObject *swig_obj[4] ;
  int result;
  
  size_t written = 0; arg6 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "base64_n_to_bytes", 4, 4, swig_obj)) SWIG_fail;
  res1 = SWIG_AsCharPtrAndSize(swig_obj[0], &buf1, NULL, &alloc1);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "base64_n_to_bytes" "', argument " "1"" of type '" "char const *""'");
  }
  arg1 = (char *)(buf1);
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "base64_n_to_bytes" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  ecode3 = SWIG_AsVal_unsigned_SS_int(swig_obj[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "base64_n_to_bytes" "', argument " "3"" of type '" "uint32_t""'");
  } 
  arg3 = (uint32_t)(val3);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[3], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "base64_n_to_bytes" "', argument " "4"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg4 = (unsigned char *) buf;
    arg5 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_base64_n_to_bytes((char const *)arg1,arg2,arg3,arg4,arg5,arg6);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg6);
  }
  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
  return resultobj;
fail:
  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
  return NULL;
}


SWIGINTERN PyObject *_wrap_base64_get_maximum_length(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  char *arg1 = (char *) 0 ;
  uint32_t arg2 ;
  size_t *arg3 = (size_t *) 0 ;
  int res1 ;
  char *buf1 = 0 ;
  int alloc1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg3 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "base64_get_maximum_length", 2, 2, swig_obj)) SWIG_fail;
  res1 = SWIG_AsCharPtrAndSize(swig_obj[0], &buf1, NULL, &alloc1);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "base64_get_maximum_length" "', argument " "1"" of type '" "char const *""'");
  }
  arg1 = (char *)(buf1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "base64_get_maximum_length" "', argument " "2"" of type '" "uint32_t""'");
  } 
  arg2 = (uint32_t)(val2);
  {
    result = (int)wally_base64_get_maximum_length((char const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg3);
  }
  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
  return resultobj;
fail:
  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
  return NULL;
}


SWIGINTERN PyObject *_wrap_base64_n_get_maximum_length(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  char *arg1 = (char *) 0 ;
  size_t arg2 ;
  uint32_t arg3 ;
  size_t *arg4 = (size_t *) 0 ;
  int res1 ;
  char *buf1 = 0 ;
  int alloc1 = 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  size_t written = 0; arg4 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "base64_n_get_maximum_length", 3, 3, swig_obj)) SWIG_fail;
  res1 = SWIG_AsCharPtrAndSize(swig_obj[0], &buf1, NULL, &alloc1);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "base64_n_get_maximum_length" "', argument " "1"" of type '" "char const *""'");
  }
  arg1 = (char *)(buf1);
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "base64_n_get_maximum_length" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  ecode3 = SWIG_AsVal_unsigned_SS_int(swig_obj[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "base64_n_get_maximum_length" "', argument " "3"" of type '" "uint32_t""'");
  } 
  arg3 = (uint32_t)(val3);
  {
    result = (int)wally_base64_n_get_maximum_length((char const *)arg1,arg2,arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg4);
  }
  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
  return resultobj;
fail:
  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
  return NULL;
}


SWIGINTERN PyObject *_wrap_is_elements_build(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  size_t *arg1 = (size_t *) 0 ;
  int result;
  
  size_t written = 0; arg1 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "is_elements_build", 0, 0, 0)) SWIG_fail;
  {
    result = (int)wally_is_elements_build(arg1);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg1);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_addr_segwit_from_bytes(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  char *arg3 = (char *) 0 ;
  uint32_t arg4 ;
  char **arg5 = (char **) 0 ;
  int res3 ;
  char *buf3 = 0 ;
  int alloc3 = 0 ;
  unsigned int val4 ;
  int ecode4 = 0 ;
  char *txt5 ;
  PyObject *swig_obj[3] ;
  int result;
  
  {
    txt5 = NULL;
    arg5 = (char **)&txt5;
  }
  if (!SWIG_Python_UnpackTuple(args, "addr_segwit_from_bytes", 3, 3, swig_obj)) SWIG_fail;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "addr_segwit_from_bytes" "', argument " "1"" of type '" "(const unsigned char* bytes, size_t bytes_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  res3 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf3, NULL, &alloc3);
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "addr_segwit_from_bytes" "', argument " "3"" of type '" "char const *""'");
  }
  arg3 = (char *)(buf3);
  ecode4 = SWIG_AsVal_unsigned_SS_int(swig_obj[2], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "addr_segwit_from_bytes" "', argument " "4"" of type '" "uint32_t""'");
  } 
  arg4 = (uint32_t)(val4);
  {
    result = (int)wally_addr_segwit_from_bytes((unsigned char const *)arg1,arg2,(char const *)arg3,arg4,arg5);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    if (*arg5 != NULL) {
      Py_DecRef(resultobj);
      resultobj = PyString_FromString(*arg5);
      wally_free_string(*arg5);
    }
  }
  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
  return resultobj;
fail:
  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
  return NULL;
}


SWIGINTERN PyObject *_wrap_addr_segwit_to_bytes(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  char *arg1 = (char *) 0 ;
  char *arg2 = (char *) 0 ;
  uint32_t arg3 ;
  unsigned char *arg4 = (unsigned char *) 0 ;
  size_t arg5 ;
  size_t *arg6 = (size_t *) 0 ;
  int res1 ;
  char *buf1 = 0 ;
  int alloc1 = 0 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  PyObject *swig_obj[4] ;
  int result;
  
  size_t written = 0; arg6 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "addr_segwit_to_bytes", 4, 4, swig_obj)) SWIG_fail;
  res1 = SWIG_AsCharPtrAndSize(swig_obj[0], &buf1, NULL, &alloc1);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "addr_segwit_to_bytes" "', argument " "1"" of type '" "char const *""'");
  }
  arg1 = (char *)(buf1);
  res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "addr_segwit_to_bytes" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = (char *)(buf2);
  ecode3 = SWIG_AsVal_unsigned_SS_int(swig_obj[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "addr_segwit_to_bytes" "', argument " "3"" of type '" "uint32_t""'");
  } 
  arg3 = (uint32_t)(val3);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[3], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "addr_segwit_to_bytes" "', argument " "4"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg4 = (unsigned char *) buf;
    arg5 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_addr_segwit_to_bytes((char const *)arg1,(char const *)arg2,arg3,arg4,arg5,arg6);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg6);
  }
  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  return resultobj;
fail:
  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  return NULL;
}


SWIGINTERN PyObject *_wrap_addr_segwit_n_to_bytes(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  char *arg1 = (char *) 0 ;
  size_t arg2 ;
  char *arg3 = (char *) 0 ;
  size_t arg4 ;
  uint32_t arg5 ;
  unsigned char *arg6 = (unsigned char *) 0 ;
  size_t arg7 ;
  size_t *arg8 = (size_t *) 0 ;
  int res1 ;
  char *buf1 = 0 ;
  int alloc1 = 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  int res3 ;
  char *buf3 = 0 ;
  int alloc3 = 0 ;
  size_t val4 ;
  int ecode4 = 0 ;
  unsigned int val5 ;
  int ecode5 = 0 ;
  PyObject *swig_obj[6] ;
  int result;
  
  size_t written = 0; arg8 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "addr_segwit_n_to_bytes", 6, 6, swig_obj)) SWIG_fail;
  res1 = SWIG_AsCharPtrAndSize(swig_obj[0], &buf1, NULL, &alloc1);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "addr_segwit_n_to_bytes" "', argument " "1"" of type '" "char const *""'");
  }
  arg1 = (char *)(buf1);
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "addr_segwit_n_to_bytes" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  res3 = SWIG_AsCharPtrAndSize(swig_obj[2], &buf3, NULL, &alloc3);
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "addr_segwit_n_to_bytes" "', argument " "3"" of type '" "char const *""'");
  }
  arg3 = (char *)(buf3);
  ecode4 = SWIG_AsVal_size_t(swig_obj[3], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "addr_segwit_n_to_bytes" "', argument " "4"" of type '" "size_t""'");
  } 
  arg4 = (size_t)(val4);
  ecode5 = SWIG_AsVal_unsigned_SS_int(swig_obj[4], &val5);
  if (!SWIG_IsOK(ecode5)) {
    SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "addr_segwit_n_to_bytes" "', argument " "5"" of type '" "uint32_t""'");
  } 
  arg5 = (uint32_t)(val5);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[5], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "addr_segwit_n_to_bytes" "', argument " "6"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg6 = (unsigned char *) buf;
    arg7 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_addr_segwit_n_to_bytes((char const *)arg1,arg2,(char const *)arg3,arg4,arg5,arg6,arg7,arg8);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg8);
  }
  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
  return resultobj;
fail:
  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
  return NULL;
}


SWIGINTERN PyObject *_wrap_addr_segwit_get_version(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  char *arg1 = (char *) 0 ;
  char *arg2 = (char *) 0 ;
  uint32_t arg3 ;
  size_t *arg4 = (size_t *) 0 ;
  int res1 ;
  char *buf1 = 0 ;
  int alloc1 = 0 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  size_t written = 0; arg4 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "addr_segwit_get_version", 3, 3, swig_obj)) SWIG_fail;
  res1 = SWIG_AsCharPtrAndSize(swig_obj[0], &buf1, NULL, &alloc1);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "addr_segwit_get_version" "', argument " "1"" of type '" "char const *""'");
  }
  arg1 = (char *)(buf1);
  res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "addr_segwit_get_version" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = (char *)(buf2);
  ecode3 = SWIG_AsVal_unsigned_SS_int(swig_obj[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "addr_segwit_get_version" "', argument " "3"" of type '" "uint32_t""'");
  } 
  arg3 = (uint32_t)(val3);
  {
    result = (int)wally_addr_segwit_get_version((char const *)arg1,(char const *)arg2,arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg4);
  }
  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  return resultobj;
fail:
  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  return NULL;
}


SWIGINTERN PyObject *_wrap_addr_segwit_n_get_version(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  char *arg1 = (char *) 0 ;
  size_t arg2 ;
  char *arg3 = (char *) 0 ;
  size_t arg4 ;
  uint32_t arg5 ;
  size_t *arg6 = (size_t *) 0 ;
  int res1 ;
  char *buf1 = 0 ;
  int alloc1 = 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  int res3 ;
  char *buf3 = 0 ;
  int alloc3 = 0 ;
  size_t val4 ;
  int ecode4 = 0 ;
  unsigned int val5 ;
  int ecode5 = 0 ;
  PyObject *swig_obj[5] ;
  int result;
  
  size_t written = 0; arg6 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "addr_segwit_n_get_version", 5, 5, swig_obj)) SWIG_fail;
  res1 = SWIG_AsCharPtrAndSize(swig_obj[0], &buf1, NULL, &alloc1);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "addr_segwit_n_get_version" "', argument " "1"" of type '" "char const *""'");
  }
  arg1 = (char *)(buf1);
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "addr_segwit_n_get_version" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  res3 = SWIG_AsCharPtrAndSize(swig_obj[2], &buf3, NULL, &alloc3);
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "addr_segwit_n_get_version" "', argument " "3"" of type '" "char const *""'");
  }
  arg3 = (char *)(buf3);
  ecode4 = SWIG_AsVal_size_t(swig_obj[3], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "addr_segwit_n_get_version" "', argument " "4"" of type '" "size_t""'");
  } 
  arg4 = (size_t)(val4);
  ecode5 = SWIG_AsVal_unsigned_SS_int(swig_obj[4], &val5);
  if (!SWIG_IsOK(ecode5)) {
    SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "addr_segwit_n_get_version" "', argument " "5"" of type '" "uint32_t""'");
  } 
  arg5 = (uint32_t)(val5);
  {
    result = (int)wally_addr_segwit_n_get_version((char const *)arg1,arg2,(char const *)arg3,arg4,arg5,arg6);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg6);
  }
  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
  return resultobj;
fail:
  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
  return NULL;
}


SWIGINTERN PyObject *_wrap_address_to_scriptpubkey(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  char *arg1 = (char *) 0 ;
  uint32_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t *arg5 = (size_t *) 0 ;
  int res1 ;
  char *buf1 = 0 ;
  int alloc1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  size_t written = 0; arg5 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "address_to_scriptpubkey", 3, 3, swig_obj)) SWIG_fail;
  res1 = SWIG_AsCharPtrAndSize(swig_obj[0], &buf1, NULL, &alloc1);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "address_to_scriptpubkey" "', argument " "1"" of type '" "char const *""'");
  }
  arg1 = (char *)(buf1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "address_to_scriptpubkey" "', argument " "2"" of type '" "uint32_t""'");
  } 
  arg2 = (uint32_t)(val2);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "address_to_scriptpubkey" "', argument " "3"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg3 = (unsigned char *) buf;
    arg4 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_address_to_scriptpubkey((char const *)arg1,arg2,arg3,arg4,arg5);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg5);
  }
  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
  return resultobj;
fail:
  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
  return NULL;
}


SWIGINTERN PyObject *_wrap_scriptpubkey_to_address(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  uint32_t arg3 ;
  char **arg4 = (char **) 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  char *txt4 ;
  PyObject *swig_obj[2] ;
  int result;
  
  {
    txt4 = NULL;
    arg4 = (char **)&txt4;
  }
  if (!SWIG_Python_UnpackTuple(args, "scriptpubkey_to_address", 2, 2, swig_obj)) SWIG_fail;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "scriptpubkey_to_address" "', argument " "1"" of type '" "(const unsigned char* scriptpubkey, size_t scriptpubkey_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  ecode3 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "scriptpubkey_to_address" "', argument " "3"" of type '" "uint32_t""'");
  } 
  arg3 = (uint32_t)(val3);
  {
    result = (int)wally_scriptpubkey_to_address((unsigned char const *)arg1,arg2,arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    if (*arg4 != NULL) {
      Py_DecRef(resultobj);
      resultobj = PyString_FromString(*arg4);
      wally_free_string(*arg4);
    }
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_wif_from_bytes(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  uint32_t arg3 ;
  uint32_t arg4 ;
  char **arg5 = (char **) 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  unsigned int val4 ;
  int ecode4 = 0 ;
  char *txt5 ;
  PyObject *swig_obj[3] ;
  int result;
  
  {
    txt5 = NULL;
    arg5 = (char **)&txt5;
  }
  if (!SWIG_Python_UnpackTuple(args, "wif_from_bytes", 3, 3, swig_obj)) SWIG_fail;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "wif_from_bytes" "', argument " "1"" of type '" "(const unsigned char* priv_key, size_t priv_key_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  ecode3 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "wif_from_bytes" "', argument " "3"" of type '" "uint32_t""'");
  } 
  arg3 = (uint32_t)(val3);
  ecode4 = SWIG_AsVal_unsigned_SS_int(swig_obj[2], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "wif_from_bytes" "', argument " "4"" of type '" "uint32_t""'");
  } 
  arg4 = (uint32_t)(val4);
  {
    result = (int)wally_wif_from_bytes((unsigned char const *)arg1,arg2,arg3,arg4,arg5);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    if (*arg5 != NULL) {
      Py_DecRef(resultobj);
      resultobj = PyString_FromString(*arg5);
      wally_free_string(*arg5);
    }
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_wif_to_bytes(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  char *arg1 = (char *) 0 ;
  uint32_t arg2 ;
  uint32_t arg3 ;
  unsigned char *arg4 = (unsigned char *) 0 ;
  size_t arg5 ;
  int res1 ;
  char *buf1 = 0 ;
  int alloc1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  PyObject *swig_obj[4] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "wif_to_bytes", 4, 4, swig_obj)) SWIG_fail;
  res1 = SWIG_AsCharPtrAndSize(swig_obj[0], &buf1, NULL, &alloc1);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "wif_to_bytes" "', argument " "1"" of type '" "char const *""'");
  }
  arg1 = (char *)(buf1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "wif_to_bytes" "', argument " "2"" of type '" "uint32_t""'");
  } 
  arg2 = (uint32_t)(val2);
  ecode3 = SWIG_AsVal_unsigned_SS_int(swig_obj[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "wif_to_bytes" "', argument " "3"" of type '" "uint32_t""'");
  } 
  arg3 = (uint32_t)(val3);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[3], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "wif_to_bytes" "', argument " "4"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg4 = (unsigned char *) buf;
    arg5 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_wif_to_bytes((char const *)arg1,arg2,arg3,arg4,arg5);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
  return resultobj;
fail:
  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
  return NULL;
}


SWIGINTERN PyObject *_wrap_wif_is_uncompressed(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  char *arg1 = (char *) 0 ;
  size_t *arg2 = (size_t *) 0 ;
  int res1 ;
  char *buf1 = 0 ;
  int alloc1 = 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  size_t written = 0; arg2 = (size_t *)&written;
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  res1 = SWIG_AsCharPtrAndSize(swig_obj[0], &buf1, NULL, &alloc1);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "wif_is_uncompressed" "', argument " "1"" of type '" "char const *""'");
  }
  arg1 = (char *)(buf1);
  {
    result = (int)wally_wif_is_uncompressed((char const *)arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg2);
  }
  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
  return resultobj;
fail:
  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
  return NULL;
}


SWIGINTERN PyObject *_wrap_wif_to_public_key(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  char *arg1 = (char *) 0 ;
  uint32_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t *arg5 = (size_t *) 0 ;
  int res1 ;
  char *buf1 = 0 ;
  int alloc1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  size_t written = 0; arg5 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "wif_to_public_key", 3, 3, swig_obj)) SWIG_fail;
  res1 = SWIG_AsCharPtrAndSize(swig_obj[0], &buf1, NULL, &alloc1);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "wif_to_public_key" "', argument " "1"" of type '" "char const *""'");
  }
  arg1 = (char *)(buf1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "wif_to_public_key" "', argument " "2"" of type '" "uint32_t""'");
  } 
  arg2 = (uint32_t)(val2);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "wif_to_public_key" "', argument " "3"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg3 = (unsigned char *) buf;
    arg4 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_wif_to_public_key((char const *)arg1,arg2,arg3,arg4,arg5);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg5);
  }
  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
  return resultobj;
fail:
  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
  return NULL;
}


SWIGINTERN PyObject *_wrap_bip32_key_to_address(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct ext_key *arg1 = (struct ext_key *) 0 ;
  uint32_t arg2 ;
  uint32_t arg3 ;
  char **arg4 = (char **) 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  char *txt4 ;
  PyObject *swig_obj[3] ;
  int result;
  
  {
    txt4 = NULL;
    arg4 = (char **)&txt4;
  }
  if (!SWIG_Python_UnpackTuple(args, "bip32_key_to_address", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct ext_key *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "bip32_key_to_address" "', argument " "1"" of type '" "(ext_key)""'");
    }
  }
  ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "bip32_key_to_address" "', argument " "2"" of type '" "uint32_t""'");
  } 
  arg2 = (uint32_t)(val2);
  ecode3 = SWIG_AsVal_unsigned_SS_int(swig_obj[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "bip32_key_to_address" "', argument " "3"" of type '" "uint32_t""'");
  } 
  arg3 = (uint32_t)(val3);
  {
    result = (int)wally_bip32_key_to_address((struct ext_key const *)arg1,arg2,arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    if (*arg4 != NULL) {
      Py_DecRef(resultobj);
      resultobj = PyString_FromString(*arg4);
      wally_free_string(*arg4);
    }
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_bip32_key_to_addr_segwit(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct ext_key *arg1 = (struct ext_key *) 0 ;
  char *arg2 = (char *) 0 ;
  uint32_t arg3 ;
  char **arg4 = (char **) 0 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  char *txt4 ;
  PyObject *swig_obj[3] ;
  int result;
  
  {
    txt4 = NULL;
    arg4 = (char **)&txt4;
  }
  if (!SWIG_Python_UnpackTuple(args, "bip32_key_to_addr_segwit", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct ext_key *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "bip32_key_to_addr_segwit" "', argument " "1"" of type '" "(ext_key)""'");
    }
  }
  res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "bip32_key_to_addr_segwit" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = (char *)(buf2);
  ecode3 = SWIG_AsVal_unsigned_SS_int(swig_obj[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "bip32_key_to_addr_segwit" "', argument " "3"" of type '" "uint32_t""'");
  } 
  arg3 = (uint32_t)(val3);
  {
    result = (int)wally_bip32_key_to_addr_segwit((struct ext_key const *)arg1,(char const *)arg2,arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    if (*arg4 != NULL) {
      Py_DecRef(resultobj);
      resultobj = PyString_FromString(*arg4);
      wally_free_string(*arg4);
    }
  }
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  return resultobj;
fail:
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  return NULL;
}


SWIGINTERN PyObject *_wrap_wif_to_address(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  char *arg1 = (char *) 0 ;
  uint32_t arg2 ;
  uint32_t arg3 ;
  char **arg4 = (char **) 0 ;
  int res1 ;
  char *buf1 = 0 ;
  int alloc1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  char *txt4 ;
  PyObject *swig_obj[3] ;
  int result;
  
  {
    txt4 = NULL;
    arg4 = (char **)&txt4;
  }
  if (!SWIG_Python_UnpackTuple(args, "wif_to_address", 3, 3, swig_obj)) SWIG_fail;
  res1 = SWIG_AsCharPtrAndSize(swig_obj[0], &buf1, NULL, &alloc1);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "wif_to_address" "', argument " "1"" of type '" "char const *""'");
  }
  arg1 = (char *)(buf1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "wif_to_address" "', argument " "2"" of type '" "uint32_t""'");
  } 
  arg2 = (uint32_t)(val2);
  ecode3 = SWIG_AsVal_unsigned_SS_int(swig_obj[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "wif_to_address" "', argument " "3"" of type '" "uint32_t""'");
  } 
  arg3 = (uint32_t)(val3);
  {
    result = (int)wally_wif_to_address((char const *)arg1,arg2,arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    if (*arg4 != NULL) {
      Py_DecRef(resultobj);
      resultobj = PyString_FromString(*arg4);
      wally_free_string(*arg4);
    }
  }
  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
  return resultobj;
fail:
  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
  return NULL;
}


SWIGINTERN PyObject *_wrap_confidential_addr_to_addr(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  char *arg1 = (char *) 0 ;
  uint32_t arg2 ;
  char **arg3 = (char **) 0 ;
  int res1 ;
  char *buf1 = 0 ;
  int alloc1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  char *txt3 ;
  PyObject *swig_obj[2] ;
  int result;
  
  {
    txt3 = NULL;
    arg3 = (char **)&txt3;
  }
  if (!SWIG_Python_UnpackTuple(args, "confidential_addr_to_addr", 2, 2, swig_obj)) SWIG_fail;
  res1 = SWIG_AsCharPtrAndSize(swig_obj[0], &buf1, NULL, &alloc1);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "confidential_addr_to_addr" "', argument " "1"" of type '" "char const *""'");
  }
  arg1 = (char *)(buf1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "confidential_addr_to_addr" "', argument " "2"" of type '" "uint32_t""'");
  } 
  arg2 = (uint32_t)(val2);
  {
    result = (int)wally_confidential_addr_to_addr((char const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    if (*arg3 != NULL) {
      Py_DecRef(resultobj);
      resultobj = PyString_FromString(*arg3);
      wally_free_string(*arg3);
    }
  }
  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
  return resultobj;
fail:
  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
  return NULL;
}


SWIGINTERN PyObject *_wrap_confidential_addr_to_ec_public_key(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  char *arg1 = (char *) 0 ;
  uint32_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  int res1 ;
  char *buf1 = 0 ;
  int alloc1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "confidential_addr_to_ec_public_key", 3, 3, swig_obj)) SWIG_fail;
  res1 = SWIG_AsCharPtrAndSize(swig_obj[0], &buf1, NULL, &alloc1);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "confidential_addr_to_ec_public_key" "', argument " "1"" of type '" "char const *""'");
  }
  arg1 = (char *)(buf1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "confidential_addr_to_ec_public_key" "', argument " "2"" of type '" "uint32_t""'");
  } 
  arg2 = (uint32_t)(val2);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "confidential_addr_to_ec_public_key" "', argument " "3"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg3 = (unsigned char *) buf;
    arg4 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_confidential_addr_to_ec_public_key((char const *)arg1,arg2,arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
  return resultobj;
fail:
  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
  return NULL;
}


SWIGINTERN PyObject *_wrap_confidential_addr_from_addr(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  char *arg1 = (char *) 0 ;
  uint32_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  char **arg5 = (char **) 0 ;
  int res1 ;
  char *buf1 = 0 ;
  int alloc1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  char *txt5 ;
  PyObject *swig_obj[3] ;
  int result;
  
  {
    txt5 = NULL;
    arg5 = (char **)&txt5;
  }
  if (!SWIG_Python_UnpackTuple(args, "confidential_addr_from_addr", 3, 3, swig_obj)) SWIG_fail;
  res1 = SWIG_AsCharPtrAndSize(swig_obj[0], &buf1, NULL, &alloc1);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "confidential_addr_from_addr" "', argument " "1"" of type '" "char const *""'");
  }
  arg1 = (char *)(buf1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "confidential_addr_from_addr" "', argument " "2"" of type '" "uint32_t""'");
  } 
  arg2 = (uint32_t)(val2);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[2] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "confidential_addr_from_addr" "', argument " "3"" of type '" "(const unsigned char* pub_key, size_t pub_key_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_confidential_addr_from_addr((char const *)arg1,arg2,(unsigned char const *)arg3,arg4,arg5);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    if (*arg5 != NULL) {
      Py_DecRef(resultobj);
      resultobj = PyString_FromString(*arg5);
      wally_free_string(*arg5);
    }
  }
  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
  return resultobj;
fail:
  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
  return NULL;
}


SWIGINTERN PyObject *_wrap_confidential_addr_to_addr_segwit(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  char *arg1 = (char *) 0 ;
  char *arg2 = (char *) 0 ;
  char *arg3 = (char *) 0 ;
  char **arg4 = (char **) 0 ;
  int res1 ;
  char *buf1 = 0 ;
  int alloc1 = 0 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  int res3 ;
  char *buf3 = 0 ;
  int alloc3 = 0 ;
  char *txt4 ;
  PyObject *swig_obj[3] ;
  int result;
  
  {
    txt4 = NULL;
    arg4 = (char **)&txt4;
  }
  if (!SWIG_Python_UnpackTuple(args, "confidential_addr_to_addr_segwit", 3, 3, swig_obj)) SWIG_fail;
  res1 = SWIG_AsCharPtrAndSize(swig_obj[0], &buf1, NULL, &alloc1);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "confidential_addr_to_addr_segwit" "', argument " "1"" of type '" "char const *""'");
  }
  arg1 = (char *)(buf1);
  res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "confidential_addr_to_addr_segwit" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = (char *)(buf2);
  res3 = SWIG_AsCharPtrAndSize(swig_obj[2], &buf3, NULL, &alloc3);
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "confidential_addr_to_addr_segwit" "', argument " "3"" of type '" "char const *""'");
  }
  arg3 = (char *)(buf3);
  {
    result = (int)wally_confidential_addr_to_addr_segwit((char const *)arg1,(char const *)arg2,(char const *)arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    if (*arg4 != NULL) {
      Py_DecRef(resultobj);
      resultobj = PyString_FromString(*arg4);
      wally_free_string(*arg4);
    }
  }
  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
  return resultobj;
fail:
  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
  return NULL;
}


SWIGINTERN PyObject *_wrap_confidential_addr_segwit_to_ec_public_key(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  char *arg1 = (char *) 0 ;
  char *arg2 = (char *) 0 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  int res1 ;
  char *buf1 = 0 ;
  int alloc1 = 0 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "confidential_addr_segwit_to_ec_public_key", 3, 3, swig_obj)) SWIG_fail;
  res1 = SWIG_AsCharPtrAndSize(swig_obj[0], &buf1, NULL, &alloc1);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "confidential_addr_segwit_to_ec_public_key" "', argument " "1"" of type '" "char const *""'");
  }
  arg1 = (char *)(buf1);
  res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "confidential_addr_segwit_to_ec_public_key" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = (char *)(buf2);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "confidential_addr_segwit_to_ec_public_key" "', argument " "3"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg3 = (unsigned char *) buf;
    arg4 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_confidential_addr_segwit_to_ec_public_key((char const *)arg1,(char const *)arg2,arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  return resultobj;
fail:
  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  return NULL;
}


SWIGINTERN PyObject *_wrap_confidential_addr_from_addr_segwit(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  char *arg1 = (char *) 0 ;
  char *arg2 = (char *) 0 ;
  char *arg3 = (char *) 0 ;
  unsigned char *arg4 = (unsigned char *) 0 ;
  size_t arg5 ;
  char **arg6 = (char **) 0 ;
  int res1 ;
  char *buf1 = 0 ;
  int alloc1 = 0 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  int res3 ;
  char *buf3 = 0 ;
  int alloc3 = 0 ;
  char *txt6 ;
  PyObject *swig_obj[4] ;
  int result;
  
  {
    txt6 = NULL;
    arg6 = (char **)&txt6;
  }
  if (!SWIG_Python_UnpackTuple(args, "confidential_addr_from_addr_segwit", 4, 4, swig_obj)) SWIG_fail;
  res1 = SWIG_AsCharPtrAndSize(swig_obj[0], &buf1, NULL, &alloc1);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "confidential_addr_from_addr_segwit" "', argument " "1"" of type '" "char const *""'");
  }
  arg1 = (char *)(buf1);
  res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "confidential_addr_from_addr_segwit" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = (char *)(buf2);
  res3 = SWIG_AsCharPtrAndSize(swig_obj[2], &buf3, NULL, &alloc3);
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "confidential_addr_from_addr_segwit" "', argument " "3"" of type '" "char const *""'");
  }
  arg3 = (char *)(buf3);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[3] == Py_None)
    arg5 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[3], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "confidential_addr_from_addr_segwit" "', argument " "4"" of type '" "(const unsigned char* pub_key, size_t pub_key_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg4 = (unsigned char *) buf;
      arg5 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_confidential_addr_from_addr_segwit((char const *)arg1,(char const *)arg2,(char const *)arg3,(unsigned char const *)arg4,arg5,arg6);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    if (*arg6 != NULL) {
      Py_DecRef(resultobj);
      resultobj = PyString_FromString(*arg6);
      wally_free_string(*arg6);
    }
  }
  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
  return resultobj;
fail:
  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
  return NULL;
}


SWIGINTERN PyObject *_wrap_ae_host_commit_from_bytes(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  uint32_t arg3 ;
  unsigned char *arg4 = (unsigned char *) 0 ;
  size_t arg5 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "ae_host_commit_from_bytes", 3, 3, swig_obj)) SWIG_fail;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "ae_host_commit_from_bytes" "', argument " "1"" of type '" "(const unsigned char* entropy, size_t entropy_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  ecode3 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "ae_host_commit_from_bytes" "', argument " "3"" of type '" "uint32_t""'");
  } 
  arg3 = (uint32_t)(val3);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "ae_host_commit_from_bytes" "', argument " "4"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg4 = (unsigned char *) buf;
    arg5 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_ae_host_commit_from_bytes((unsigned char const *)arg1,arg2,arg3,arg4,arg5);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_ae_signer_commit_from_bytes(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  unsigned char *arg5 = (unsigned char *) 0 ;
  size_t arg6 ;
  uint32_t arg7 ;
  unsigned char *arg8 = (unsigned char *) 0 ;
  size_t arg9 ;
  unsigned int val7 ;
  int ecode7 = 0 ;
  PyObject *swig_obj[5] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "ae_signer_commit_from_bytes", 5, 5, swig_obj)) SWIG_fail;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "ae_signer_commit_from_bytes" "', argument " "1"" of type '" "(const unsigned char* priv_key, size_t priv_key_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "ae_signer_commit_from_bytes" "', argument " "3"" of type '" "(const unsigned char* bytes, size_t bytes_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[2] == Py_None)
    arg6 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "ae_signer_commit_from_bytes" "', argument " "5"" of type '" "(const unsigned char* commitment, size_t commitment_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg5 = (unsigned char *) buf;
      arg6 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  ecode7 = SWIG_AsVal_unsigned_SS_int(swig_obj[3], &val7);
  if (!SWIG_IsOK(ecode7)) {
    SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "ae_signer_commit_from_bytes" "', argument " "7"" of type '" "uint32_t""'");
  } 
  arg7 = (uint32_t)(val7);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[4], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "ae_signer_commit_from_bytes" "', argument " "8"" of type '" "(unsigned char* s2c_opening_out, size_t s2c_opening_out_len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg8 = (unsigned char *) buf;
    arg9 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_ae_signer_commit_from_bytes((unsigned char const *)arg1,arg2,(unsigned char const *)arg3,arg4,(unsigned char const *)arg5,arg6,arg7,arg8,arg9);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_ae_sig_from_bytes(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  unsigned char *arg5 = (unsigned char *) 0 ;
  size_t arg6 ;
  uint32_t arg7 ;
  unsigned char *arg8 = (unsigned char *) 0 ;
  size_t arg9 ;
  unsigned int val7 ;
  int ecode7 = 0 ;
  PyObject *swig_obj[5] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "ae_sig_from_bytes", 5, 5, swig_obj)) SWIG_fail;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "ae_sig_from_bytes" "', argument " "1"" of type '" "(const unsigned char* priv_key, size_t priv_key_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "ae_sig_from_bytes" "', argument " "3"" of type '" "(const unsigned char* bytes, size_t bytes_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[2] == Py_None)
    arg6 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "ae_sig_from_bytes" "', argument " "5"" of type '" "(const unsigned char* entropy, size_t entropy_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg5 = (unsigned char *) buf;
      arg6 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  ecode7 = SWIG_AsVal_unsigned_SS_int(swig_obj[3], &val7);
  if (!SWIG_IsOK(ecode7)) {
    SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "ae_sig_from_bytes" "', argument " "7"" of type '" "uint32_t""'");
  } 
  arg7 = (uint32_t)(val7);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[4], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "ae_sig_from_bytes" "', argument " "8"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg8 = (unsigned char *) buf;
    arg9 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_ae_sig_from_bytes((unsigned char const *)arg1,arg2,(unsigned char const *)arg3,arg4,(unsigned char const *)arg5,arg6,arg7,arg8,arg9);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_ae_verify(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  unsigned char *arg5 = (unsigned char *) 0 ;
  size_t arg6 ;
  unsigned char *arg7 = (unsigned char *) 0 ;
  size_t arg8 ;
  uint32_t arg9 ;
  unsigned char *arg10 = (unsigned char *) 0 ;
  size_t arg11 ;
  unsigned int val9 ;
  int ecode9 = 0 ;
  PyObject *swig_obj[6] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "ae_verify", 6, 6, swig_obj)) SWIG_fail;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "ae_verify" "', argument " "1"" of type '" "(const unsigned char* pub_key, size_t pub_key_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "ae_verify" "', argument " "3"" of type '" "(const unsigned char* bytes, size_t bytes_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[2] == Py_None)
    arg6 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "ae_verify" "', argument " "5"" of type '" "(const unsigned char* entropy, size_t entropy_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg5 = (unsigned char *) buf;
      arg6 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[3] == Py_None)
    arg8 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[3], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "ae_verify" "', argument " "7"" of type '" "(const unsigned char* s2c_opening, size_t s2c_opening_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg7 = (unsigned char *) buf;
      arg8 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  ecode9 = SWIG_AsVal_unsigned_SS_int(swig_obj[4], &val9);
  if (!SWIG_IsOK(ecode9)) {
    SWIG_exception_fail(SWIG_ArgError(ecode9), "in method '" "ae_verify" "', argument " "9"" of type '" "uint32_t""'");
  } 
  arg9 = (uint32_t)(val9);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[5] == Py_None)
    arg11 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[5], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "ae_verify" "', argument " "10"" of type '" "(const unsigned char* sig, size_t sig_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg10 = (unsigned char *) buf;
      arg11 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_ae_verify((unsigned char const *)arg1,arg2,(unsigned char const *)arg3,arg4,(unsigned char const *)arg5,arg6,(unsigned char const *)arg7,arg8,arg9,(unsigned char const *)arg10,arg11);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_bip32_key_free(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct ext_key *arg1 = (struct ext_key *) 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct ext_key *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "bip32_key_free" "', argument " "1"" of type '" "(ext_key)""'");
    }
  }
  {
    result = (int)bip32_key_free((struct ext_key const *)arg1);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_bip32_key_init_alloc(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  uint32_t arg1 ;
  uint32_t arg2 ;
  uint32_t arg3 ;
  unsigned char *arg4 = (unsigned char *) 0 ;
  size_t arg5 ;
  unsigned char *arg6 = (unsigned char *) 0 ;
  size_t arg7 ;
  unsigned char *arg8 = (unsigned char *) 0 ;
  size_t arg9 ;
  unsigned char *arg10 = (unsigned char *) 0 ;
  size_t arg11 ;
  unsigned char *arg12 = (unsigned char *) 0 ;
  size_t arg13 ;
  struct ext_key **arg14 = (struct ext_key **) 0 ;
  unsigned int val1 ;
  int ecode1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  struct ext_key *w14 ;
  PyObject *swig_obj[8] ;
  int result;
  
  {
    w14 = 0; arg14 = (struct ext_key **)&w14;
  }
  if (!SWIG_Python_UnpackTuple(args, "bip32_key_init_alloc", 8, 8, swig_obj)) SWIG_fail;
  ecode1 = SWIG_AsVal_unsigned_SS_int(swig_obj[0], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "bip32_key_init_alloc" "', argument " "1"" of type '" "uint32_t""'");
  } 
  arg1 = (uint32_t)(val1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "bip32_key_init_alloc" "', argument " "2"" of type '" "uint32_t""'");
  } 
  arg2 = (uint32_t)(val2);
  ecode3 = SWIG_AsVal_unsigned_SS_int(swig_obj[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "bip32_key_init_alloc" "', argument " "3"" of type '" "uint32_t""'");
  } 
  arg3 = (uint32_t)(val3);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[3] == Py_None)
    arg5 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[3], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "bip32_key_init_alloc" "', argument " "4"" of type '" "(const unsigned char* chain_code, size_t chain_code_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg4 = (unsigned char *) buf;
      arg5 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[4] == Py_None)
    arg7 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[4], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "bip32_key_init_alloc" "', argument " "6"" of type '" "(const unsigned char* pub_key, size_t pub_key_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg6 = (unsigned char *) buf;
      arg7 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[5] == Py_None)
    arg9 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[5], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "bip32_key_init_alloc" "', argument " "8"" of type '" "(const unsigned char* priv_key, size_t priv_key_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg8 = (unsigned char *) buf;
      arg9 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[6] == Py_None)
    arg11 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[6], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "bip32_key_init_alloc" "', argument " "10"" of type '" "(const unsigned char* hash160, size_t hash160_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg10 = (unsigned char *) buf;
      arg11 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[7] == Py_None)
    arg13 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[7], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "bip32_key_init_alloc" "', argument " "12"" of type '" "(const unsigned char* parent160, size_t parent160_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg12 = (unsigned char *) buf;
      arg13 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)bip32_key_init_alloc(arg1,arg2,arg3,(unsigned char const *)arg4,arg5,(unsigned char const *)arg6,arg7,(unsigned char const *)arg8,arg9,(unsigned char const *)arg10,arg11,(unsigned char const *)arg12,arg13,arg14);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    if (*arg14 != NULL) {
      Py_DecRef(resultobj);
      resultobj = PyCapsule_New(*arg14, "struct ext_key *", destroy_ext_key);
    }
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_bip32_key_from_seed_custom_alloc(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  uint32_t arg3 ;
  unsigned char *arg4 = (unsigned char *) 0 ;
  size_t arg5 ;
  uint32_t arg6 ;
  struct ext_key **arg7 = (struct ext_key **) 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  unsigned int val6 ;
  int ecode6 = 0 ;
  struct ext_key *w7 ;
  PyObject *swig_obj[4] ;
  int result;
  
  {
    w7 = 0; arg7 = (struct ext_key **)&w7;
  }
  if (!SWIG_Python_UnpackTuple(args, "bip32_key_from_seed_custom_alloc", 4, 4, swig_obj)) SWIG_fail;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "bip32_key_from_seed_custom_alloc" "', argument " "1"" of type '" "(const unsigned char* bytes, size_t bytes_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  ecode3 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "bip32_key_from_seed_custom_alloc" "', argument " "3"" of type '" "uint32_t""'");
  } 
  arg3 = (uint32_t)(val3);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[2] == Py_None)
    arg5 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "bip32_key_from_seed_custom_alloc" "', argument " "4"" of type '" "(const unsigned char* hmac_key, size_t hmac_key_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg4 = (unsigned char *) buf;
      arg5 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  ecode6 = SWIG_AsVal_unsigned_SS_int(swig_obj[3], &val6);
  if (!SWIG_IsOK(ecode6)) {
    SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "bip32_key_from_seed_custom_alloc" "', argument " "6"" of type '" "uint32_t""'");
  } 
  arg6 = (uint32_t)(val6);
  {
    result = (int)bip32_key_from_seed_custom_alloc((unsigned char const *)arg1,arg2,arg3,(unsigned char const *)arg4,arg5,arg6,arg7);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    if (*arg7 != NULL) {
      Py_DecRef(resultobj);
      resultobj = PyCapsule_New(*arg7, "struct ext_key *", destroy_ext_key);
    }
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_bip32_key_from_seed_alloc(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  uint32_t arg3 ;
  uint32_t arg4 ;
  struct ext_key **arg5 = (struct ext_key **) 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  unsigned int val4 ;
  int ecode4 = 0 ;
  struct ext_key *w5 ;
  PyObject *swig_obj[3] ;
  int result;
  
  {
    w5 = 0; arg5 = (struct ext_key **)&w5;
  }
  if (!SWIG_Python_UnpackTuple(args, "bip32_key_from_seed_alloc", 3, 3, swig_obj)) SWIG_fail;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "bip32_key_from_seed_alloc" "', argument " "1"" of type '" "(const unsigned char* bytes, size_t bytes_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  ecode3 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "bip32_key_from_seed_alloc" "', argument " "3"" of type '" "uint32_t""'");
  } 
  arg3 = (uint32_t)(val3);
  ecode4 = SWIG_AsVal_unsigned_SS_int(swig_obj[2], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "bip32_key_from_seed_alloc" "', argument " "4"" of type '" "uint32_t""'");
  } 
  arg4 = (uint32_t)(val4);
  {
    result = (int)bip32_key_from_seed_alloc((unsigned char const *)arg1,arg2,arg3,arg4,arg5);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    if (*arg5 != NULL) {
      Py_DecRef(resultobj);
      resultobj = PyCapsule_New(*arg5, "struct ext_key *", destroy_ext_key);
    }
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_bip32_key_serialize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct ext_key *arg1 = (struct ext_key *) 0 ;
  uint32_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "bip32_key_serialize", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct ext_key *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "bip32_key_serialize" "', argument " "1"" of type '" "(ext_key)""'");
    }
  }
  ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "bip32_key_serialize" "', argument " "2"" of type '" "uint32_t""'");
  } 
  arg2 = (uint32_t)(val2);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "bip32_key_serialize" "', argument " "3"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg3 = (unsigned char *) buf;
    arg4 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)bip32_key_serialize((struct ext_key const *)arg1,arg2,arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_bip32_key_unserialize_alloc(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  struct ext_key **arg3 = (struct ext_key **) 0 ;
  struct ext_key *w3 ;
  PyObject *swig_obj[1] ;
  int result;
  
  {
    w3 = 0; arg3 = (struct ext_key **)&w3;
  }
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "bip32_key_unserialize_alloc" "', argument " "1"" of type '" "(const unsigned char* bytes, size_t bytes_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)bip32_key_unserialize_alloc((unsigned char const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    if (*arg3 != NULL) {
      Py_DecRef(resultobj);
      resultobj = PyCapsule_New(*arg3, "struct ext_key *", destroy_ext_key);
    }
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_bip32_key_from_parent_alloc(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct ext_key *arg1 = (struct ext_key *) 0 ;
  uint32_t arg2 ;
  uint32_t arg3 ;
  struct ext_key **arg4 = (struct ext_key **) 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  struct ext_key *w4 ;
  PyObject *swig_obj[3] ;
  int result;
  
  {
    w4 = 0; arg4 = (struct ext_key **)&w4;
  }
  if (!SWIG_Python_UnpackTuple(args, "bip32_key_from_parent_alloc", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct ext_key *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "bip32_key_from_parent_alloc" "', argument " "1"" of type '" "(ext_key)""'");
    }
  }
  ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "bip32_key_from_parent_alloc" "', argument " "2"" of type '" "uint32_t""'");
  } 
  arg2 = (uint32_t)(val2);
  ecode3 = SWIG_AsVal_unsigned_SS_int(swig_obj[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "bip32_key_from_parent_alloc" "', argument " "3"" of type '" "uint32_t""'");
  } 
  arg3 = (uint32_t)(val3);
  {
    result = (int)bip32_key_from_parent_alloc((struct ext_key const *)arg1,arg2,arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    if (*arg4 != NULL) {
      Py_DecRef(resultobj);
      resultobj = PyCapsule_New(*arg4, "struct ext_key *", destroy_ext_key);
    }
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_bip32_key_from_parent_path_alloc(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct ext_key *arg1 = (struct ext_key *) 0 ;
  uint32_t *arg2 = (uint32_t *) 0 ;
  size_t arg3 ;
  uint32_t arg4 ;
  struct ext_key **arg5 = (struct ext_key **) 0 ;
  uint32_t tmp_buf2[MAX_LOCAL_STACK/sizeof(uint32_t)] ;
  unsigned int val4 ;
  int ecode4 = 0 ;
  struct ext_key *w5 ;
  PyObject *swig_obj[3] ;
  int result;
  
  {
    w5 = 0; arg5 = (struct ext_key **)&w5;
  }
  if (!SWIG_Python_UnpackTuple(args, "bip32_key_from_parent_path_alloc", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct ext_key *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "bip32_key_from_parent_path_alloc" "', argument " "1"" of type '" "(ext_key)""'");
    }
  }
  {
    size_t i;
    if (!PyList_Check(swig_obj[1])) {
      check_result(WALLY_EINVAL);
      SWIG_fail;
    }
    arg3 = PyList_Size(swig_obj[1]);
    arg2 = tmp_buf2;
    if (arg3 * sizeof(uint32_t) > sizeof(tmp_buf2))
    if (!(arg2 = (uint32_t *) wally_malloc((arg3) * sizeof(uint32_t)))) {
      check_result(WALLY_ENOMEM);
      SWIG_fail;
    }
    for (i = 0; i < arg3; ++i) {
      PyObject *item = PyList_GET_ITEM(swig_obj[1], i);
      unsigned long long v;
      if (!ulonglong_cast(item, &v) || v > 0xffffffffull) {
        PyErr_SetString(PyExc_OverflowError, "Invalid unsigned integer");
        SWIG_fail;
      }
      arg2[i] = (uint32_t)v;
    }
  }
  ecode4 = SWIG_AsVal_unsigned_SS_int(swig_obj[2], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "bip32_key_from_parent_path_alloc" "', argument " "4"" of type '" "uint32_t""'");
  } 
  arg4 = (uint32_t)(val4);
  {
    result = (int)bip32_key_from_parent_path_alloc((struct ext_key const *)arg1,(unsigned int const *)arg2,arg3,arg4,arg5);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    if (*arg5 != NULL) {
      Py_DecRef(resultobj);
      resultobj = PyCapsule_New(*arg5, "struct ext_key *", destroy_ext_key);
    }
  }
  {
    if (arg2 && arg2 != tmp_buf2)
    wally_free(arg2);
  }
  return resultobj;
fail:
  {
    if (arg2 && arg2 != tmp_buf2)
    wally_free(arg2);
  }
  return NULL;
}


SWIGINTERN PyObject *_wrap_bip32_key_from_parent_path_str_alloc(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct ext_key *arg1 = (struct ext_key *) 0 ;
  char *arg2 = (char *) 0 ;
  uint32_t arg3 ;
  uint32_t arg4 ;
  struct ext_key **arg5 = (struct ext_key **) 0 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  unsigned int val4 ;
  int ecode4 = 0 ;
  struct ext_key *w5 ;
  PyObject *swig_obj[4] ;
  int result;
  
  {
    w5 = 0; arg5 = (struct ext_key **)&w5;
  }
  if (!SWIG_Python_UnpackTuple(args, "bip32_key_from_parent_path_str_alloc", 4, 4, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct ext_key *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "bip32_key_from_parent_path_str_alloc" "', argument " "1"" of type '" "(ext_key)""'");
    }
  }
  res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "bip32_key_from_parent_path_str_alloc" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = (char *)(buf2);
  ecode3 = SWIG_AsVal_unsigned_SS_int(swig_obj[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "bip32_key_from_parent_path_str_alloc" "', argument " "3"" of type '" "uint32_t""'");
  } 
  arg3 = (uint32_t)(val3);
  ecode4 = SWIG_AsVal_unsigned_SS_int(swig_obj[3], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "bip32_key_from_parent_path_str_alloc" "', argument " "4"" of type '" "uint32_t""'");
  } 
  arg4 = (uint32_t)(val4);
  {
    result = (int)bip32_key_from_parent_path_str_alloc((struct ext_key const *)arg1,(char const *)arg2,arg3,arg4,arg5);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    if (*arg5 != NULL) {
      Py_DecRef(resultobj);
      resultobj = PyCapsule_New(*arg5, "struct ext_key *", destroy_ext_key);
    }
  }
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  return resultobj;
fail:
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  return NULL;
}


SWIGINTERN PyObject *_wrap_bip32_key_from_parent_path_str_n_alloc(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct ext_key *arg1 = (struct ext_key *) 0 ;
  char *arg2 = (char *) 0 ;
  size_t arg3 ;
  uint32_t arg4 ;
  uint32_t arg5 ;
  struct ext_key **arg6 = (struct ext_key **) 0 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  size_t val3 ;
  int ecode3 = 0 ;
  unsigned int val4 ;
  int ecode4 = 0 ;
  unsigned int val5 ;
  int ecode5 = 0 ;
  struct ext_key *w6 ;
  PyObject *swig_obj[5] ;
  int result;
  
  {
    w6 = 0; arg6 = (struct ext_key **)&w6;
  }
  if (!SWIG_Python_UnpackTuple(args, "bip32_key_from_parent_path_str_n_alloc", 5, 5, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct ext_key *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "bip32_key_from_parent_path_str_n_alloc" "', argument " "1"" of type '" "(ext_key)""'");
    }
  }
  res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "bip32_key_from_parent_path_str_n_alloc" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = (char *)(buf2);
  ecode3 = SWIG_AsVal_size_t(swig_obj[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "bip32_key_from_parent_path_str_n_alloc" "', argument " "3"" of type '" "size_t""'");
  } 
  arg3 = (size_t)(val3);
  ecode4 = SWIG_AsVal_unsigned_SS_int(swig_obj[3], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "bip32_key_from_parent_path_str_n_alloc" "', argument " "4"" of type '" "uint32_t""'");
  } 
  arg4 = (uint32_t)(val4);
  ecode5 = SWIG_AsVal_unsigned_SS_int(swig_obj[4], &val5);
  if (!SWIG_IsOK(ecode5)) {
    SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "bip32_key_from_parent_path_str_n_alloc" "', argument " "5"" of type '" "uint32_t""'");
  } 
  arg5 = (uint32_t)(val5);
  {
    result = (int)bip32_key_from_parent_path_str_n_alloc((struct ext_key const *)arg1,(char const *)arg2,arg3,arg4,arg5,arg6);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    if (*arg6 != NULL) {
      Py_DecRef(resultobj);
      resultobj = PyCapsule_New(*arg6, "struct ext_key *", destroy_ext_key);
    }
  }
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  return resultobj;
fail:
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  return NULL;
}


SWIGINTERN PyObject *_wrap_bip32_key_with_tweak_from_parent_path_alloc(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct ext_key *arg1 = (struct ext_key *) 0 ;
  uint32_t *arg2 = (uint32_t *) 0 ;
  size_t arg3 ;
  uint32_t arg4 ;
  struct ext_key **arg5 = (struct ext_key **) 0 ;
  uint32_t tmp_buf2[MAX_LOCAL_STACK/sizeof(uint32_t)] ;
  unsigned int val4 ;
  int ecode4 = 0 ;
  struct ext_key *w5 ;
  PyObject *swig_obj[3] ;
  int result;
  
  {
    w5 = 0; arg5 = (struct ext_key **)&w5;
  }
  if (!SWIG_Python_UnpackTuple(args, "bip32_key_with_tweak_from_parent_path_alloc", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct ext_key *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "bip32_key_with_tweak_from_parent_path_alloc" "', argument " "1"" of type '" "(ext_key)""'");
    }
  }
  {
    size_t i;
    if (!PyList_Check(swig_obj[1])) {
      check_result(WALLY_EINVAL);
      SWIG_fail;
    }
    arg3 = PyList_Size(swig_obj[1]);
    arg2 = tmp_buf2;
    if (arg3 * sizeof(uint32_t) > sizeof(tmp_buf2))
    if (!(arg2 = (uint32_t *) wally_malloc((arg3) * sizeof(uint32_t)))) {
      check_result(WALLY_ENOMEM);
      SWIG_fail;
    }
    for (i = 0; i < arg3; ++i) {
      PyObject *item = PyList_GET_ITEM(swig_obj[1], i);
      unsigned long long v;
      if (!ulonglong_cast(item, &v) || v > 0xffffffffull) {
        PyErr_SetString(PyExc_OverflowError, "Invalid unsigned integer");
        SWIG_fail;
      }
      arg2[i] = (uint32_t)v;
    }
  }
  ecode4 = SWIG_AsVal_unsigned_SS_int(swig_obj[2], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "bip32_key_with_tweak_from_parent_path_alloc" "', argument " "4"" of type '" "uint32_t""'");
  } 
  arg4 = (uint32_t)(val4);
  {
    result = (int)bip32_key_with_tweak_from_parent_path_alloc((struct ext_key const *)arg1,(unsigned int const *)arg2,arg3,arg4,arg5);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    if (*arg5 != NULL) {
      Py_DecRef(resultobj);
      resultobj = PyCapsule_New(*arg5, "struct ext_key *", destroy_ext_key);
    }
  }
  {
    if (arg2 && arg2 != tmp_buf2)
    wally_free(arg2);
  }
  return resultobj;
fail:
  {
    if (arg2 && arg2 != tmp_buf2)
    wally_free(arg2);
  }
  return NULL;
}


SWIGINTERN PyObject *_wrap_bip32_key_to_base58(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct ext_key *arg1 = (struct ext_key *) 0 ;
  uint32_t arg2 ;
  char **arg3 = (char **) 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  char *txt3 ;
  PyObject *swig_obj[2] ;
  int result;
  
  {
    txt3 = NULL;
    arg3 = (char **)&txt3;
  }
  if (!SWIG_Python_UnpackTuple(args, "bip32_key_to_base58", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct ext_key *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "bip32_key_to_base58" "', argument " "1"" of type '" "(ext_key)""'");
    }
  }
  ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "bip32_key_to_base58" "', argument " "2"" of type '" "uint32_t""'");
  } 
  arg2 = (uint32_t)(val2);
  {
    result = (int)bip32_key_to_base58((struct ext_key const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    if (*arg3 != NULL) {
      Py_DecRef(resultobj);
      resultobj = PyString_FromString(*arg3);
      wally_free_string(*arg3);
    }
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_bip32_key_from_base58_alloc(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  char *arg1 = (char *) 0 ;
  struct ext_key **arg2 = (struct ext_key **) 0 ;
  int res1 ;
  char *buf1 = 0 ;
  int alloc1 = 0 ;
  struct ext_key *w2 ;
  PyObject *swig_obj[1] ;
  int result;
  
  {
    w2 = 0; arg2 = (struct ext_key **)&w2;
  }
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  res1 = SWIG_AsCharPtrAndSize(swig_obj[0], &buf1, NULL, &alloc1);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bip32_key_from_base58_alloc" "', argument " "1"" of type '" "char const *""'");
  }
  arg1 = (char *)(buf1);
  {
    result = (int)bip32_key_from_base58_alloc((char const *)arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    if (*arg2 != NULL) {
      Py_DecRef(resultobj);
      resultobj = PyCapsule_New(*arg2, "struct ext_key *", destroy_ext_key);
    }
  }
  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
  return resultobj;
fail:
  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
  return NULL;
}


SWIGINTERN PyObject *_wrap_bip32_key_from_base58_n_alloc(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  char *arg1 = (char *) 0 ;
  size_t arg2 ;
  struct ext_key **arg3 = (struct ext_key **) 0 ;
  int res1 ;
  char *buf1 = 0 ;
  int alloc1 = 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  struct ext_key *w3 ;
  PyObject *swig_obj[2] ;
  int result;
  
  {
    w3 = 0; arg3 = (struct ext_key **)&w3;
  }
  if (!SWIG_Python_UnpackTuple(args, "bip32_key_from_base58_n_alloc", 2, 2, swig_obj)) SWIG_fail;
  res1 = SWIG_AsCharPtrAndSize(swig_obj[0], &buf1, NULL, &alloc1);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bip32_key_from_base58_n_alloc" "', argument " "1"" of type '" "char const *""'");
  }
  arg1 = (char *)(buf1);
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "bip32_key_from_base58_n_alloc" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)bip32_key_from_base58_n_alloc((char const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    if (*arg3 != NULL) {
      Py_DecRef(resultobj);
      resultobj = PyCapsule_New(*arg3, "struct ext_key *", destroy_ext_key);
    }
  }
  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
  return resultobj;
fail:
  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
  return NULL;
}


SWIGINTERN PyObject *_wrap_bip32_key_strip_private_key(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct ext_key *arg1 = (struct ext_key *) 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct ext_key *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "bip32_key_strip_private_key" "', argument " "1"" of type '" "(ext_key)""'");
    }
  }
  {
    result = (int)bip32_key_strip_private_key(arg1);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_bip32_key_get_fingerprint(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct ext_key *arg1 = (struct ext_key *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "bip32_key_get_fingerprint", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct ext_key *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "bip32_key_get_fingerprint" "', argument " "1"" of type '" "(ext_key)""'");
    }
  }
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "bip32_key_get_fingerprint" "', argument " "2"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg2 = (unsigned char *) buf;
    arg3 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)bip32_key_get_fingerprint(arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_bip32_path_from_str_len(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  char *arg1 = (char *) 0 ;
  uint32_t arg2 ;
  uint32_t arg3 ;
  uint32_t arg4 ;
  size_t *arg5 = (size_t *) 0 ;
  int res1 ;
  char *buf1 = 0 ;
  int alloc1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  unsigned int val4 ;
  int ecode4 = 0 ;
  PyObject *swig_obj[4] ;
  int result;
  
  size_t written = 0; arg5 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "bip32_path_from_str_len", 4, 4, swig_obj)) SWIG_fail;
  res1 = SWIG_AsCharPtrAndSize(swig_obj[0], &buf1, NULL, &alloc1);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bip32_path_from_str_len" "', argument " "1"" of type '" "char const *""'");
  }
  arg1 = (char *)(buf1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "bip32_path_from_str_len" "', argument " "2"" of type '" "uint32_t""'");
  } 
  arg2 = (uint32_t)(val2);
  ecode3 = SWIG_AsVal_unsigned_SS_int(swig_obj[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "bip32_path_from_str_len" "', argument " "3"" of type '" "uint32_t""'");
  } 
  arg3 = (uint32_t)(val3);
  ecode4 = SWIG_AsVal_unsigned_SS_int(swig_obj[3], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "bip32_path_from_str_len" "', argument " "4"" of type '" "uint32_t""'");
  } 
  arg4 = (uint32_t)(val4);
  {
    result = (int)bip32_path_from_str_len((char const *)arg1,arg2,arg3,arg4,arg5);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg5);
  }
  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
  return resultobj;
fail:
  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
  return NULL;
}


SWIGINTERN PyObject *_wrap_bip32_path_from_str(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  char *arg1 = (char *) 0 ;
  uint32_t arg2 ;
  uint32_t arg3 ;
  uint32_t arg4 ;
  uint32_t *arg5 = (uint32_t *) 0 ;
  size_t arg6 ;
  size_t *arg7 = (size_t *) 0 ;
  int res1 ;
  char *buf1 = 0 ;
  int alloc1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  unsigned int val4 ;
  int ecode4 = 0 ;
  uint32_t tmp_buf5[MAX_LOCAL_STACK/sizeof(uint32_t)] ;
  PyObject *swig_obj[5] ;
  int result;
  
  size_t written = 0; arg7 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "bip32_path_from_str", 5, 5, swig_obj)) SWIG_fail;
  res1 = SWIG_AsCharPtrAndSize(swig_obj[0], &buf1, NULL, &alloc1);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bip32_path_from_str" "', argument " "1"" of type '" "char const *""'");
  }
  arg1 = (char *)(buf1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "bip32_path_from_str" "', argument " "2"" of type '" "uint32_t""'");
  } 
  arg2 = (uint32_t)(val2);
  ecode3 = SWIG_AsVal_unsigned_SS_int(swig_obj[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "bip32_path_from_str" "', argument " "3"" of type '" "uint32_t""'");
  } 
  arg3 = (uint32_t)(val3);
  ecode4 = SWIG_AsVal_unsigned_SS_int(swig_obj[3], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "bip32_path_from_str" "', argument " "4"" of type '" "uint32_t""'");
  } 
  arg4 = (uint32_t)(val4);
  {
    if (!PyList_CheckExact(swig_obj[4])) {
      check_result(WALLY_EINVAL);
      SWIG_fail;
    }
    arg6 = PyList_Size(swig_obj[4]);
    arg5 = tmp_buf5;
    if (arg6 * sizeof(uint32_t) > sizeof(tmp_buf5)) {
      if (!(arg5 = (uint32_t *) wally_malloc(arg6 * sizeof(uint32_t)))) {
        check_result(WALLY_ENOMEM);
        SWIG_fail;
      }
    }
  }
  {
    result = (int)bip32_path_from_str((char const *)arg1,arg2,arg3,arg4,arg5,arg6,arg7);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    if (arg6 && PyList_SetSlice(swig_obj[4], 0, arg6, NULL))
    SWIG_fail;
    if (written <= arg6) {
      for (size_t i = 0; i < written; ++i) {
        PyObject* p = PyLong_FromUnsignedLong(arg5[i]);
        if (PyList_Append(swig_obj[4], p)) {
          PyList_SetSlice(swig_obj[4], 0, PyList_Size(swig_obj[4]), NULL);
          SWIG_fail;
        }
      }
    }
  }
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg7);
  }
  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
  {
    if (arg5 && arg5 != tmp_buf5)
    wally_free(arg5);
  }
  return resultobj;
fail:
  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
  {
    if (arg5 && arg5 != tmp_buf5)
    wally_free(arg5);
  }
  return NULL;
}


SWIGINTERN PyObject *_wrap_bip32_path_from_str_n_len(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  char *arg1 = (char *) 0 ;
  size_t arg2 ;
  uint32_t arg3 ;
  uint32_t arg4 ;
  uint32_t arg5 ;
  size_t *arg6 = (size_t *) 0 ;
  int res1 ;
  char *buf1 = 0 ;
  int alloc1 = 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  unsigned int val4 ;
  int ecode4 = 0 ;
  unsigned int val5 ;
  int ecode5 = 0 ;
  PyObject *swig_obj[5] ;
  int result;
  
  size_t written = 0; arg6 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "bip32_path_from_str_n_len", 5, 5, swig_obj)) SWIG_fail;
  res1 = SWIG_AsCharPtrAndSize(swig_obj[0], &buf1, NULL, &alloc1);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bip32_path_from_str_n_len" "', argument " "1"" of type '" "char const *""'");
  }
  arg1 = (char *)(buf1);
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "bip32_path_from_str_n_len" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  ecode3 = SWIG_AsVal_unsigned_SS_int(swig_obj[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "bip32_path_from_str_n_len" "', argument " "3"" of type '" "uint32_t""'");
  } 
  arg3 = (uint32_t)(val3);
  ecode4 = SWIG_AsVal_unsigned_SS_int(swig_obj[3], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "bip32_path_from_str_n_len" "', argument " "4"" of type '" "uint32_t""'");
  } 
  arg4 = (uint32_t)(val4);
  ecode5 = SWIG_AsVal_unsigned_SS_int(swig_obj[4], &val5);
  if (!SWIG_IsOK(ecode5)) {
    SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "bip32_path_from_str_n_len" "', argument " "5"" of type '" "uint32_t""'");
  } 
  arg5 = (uint32_t)(val5);
  {
    result = (int)bip32_path_from_str_n_len((char const *)arg1,arg2,arg3,arg4,arg5,arg6);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg6);
  }
  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
  return resultobj;
fail:
  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
  return NULL;
}


SWIGINTERN PyObject *_wrap_bip32_path_from_str_n(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  char *arg1 = (char *) 0 ;
  size_t arg2 ;
  uint32_t arg3 ;
  uint32_t arg4 ;
  uint32_t arg5 ;
  uint32_t *arg6 = (uint32_t *) 0 ;
  size_t arg7 ;
  size_t *arg8 = (size_t *) 0 ;
  int res1 ;
  char *buf1 = 0 ;
  int alloc1 = 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  unsigned int val4 ;
  int ecode4 = 0 ;
  unsigned int val5 ;
  int ecode5 = 0 ;
  uint32_t tmp_buf6[MAX_LOCAL_STACK/sizeof(uint32_t)] ;
  PyObject *swig_obj[6] ;
  int result;
  
  size_t written = 0; arg8 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "bip32_path_from_str_n", 6, 6, swig_obj)) SWIG_fail;
  res1 = SWIG_AsCharPtrAndSize(swig_obj[0], &buf1, NULL, &alloc1);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bip32_path_from_str_n" "', argument " "1"" of type '" "char const *""'");
  }
  arg1 = (char *)(buf1);
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "bip32_path_from_str_n" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  ecode3 = SWIG_AsVal_unsigned_SS_int(swig_obj[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "bip32_path_from_str_n" "', argument " "3"" of type '" "uint32_t""'");
  } 
  arg3 = (uint32_t)(val3);
  ecode4 = SWIG_AsVal_unsigned_SS_int(swig_obj[3], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "bip32_path_from_str_n" "', argument " "4"" of type '" "uint32_t""'");
  } 
  arg4 = (uint32_t)(val4);
  ecode5 = SWIG_AsVal_unsigned_SS_int(swig_obj[4], &val5);
  if (!SWIG_IsOK(ecode5)) {
    SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "bip32_path_from_str_n" "', argument " "5"" of type '" "uint32_t""'");
  } 
  arg5 = (uint32_t)(val5);
  {
    if (!PyList_CheckExact(swig_obj[5])) {
      check_result(WALLY_EINVAL);
      SWIG_fail;
    }
    arg7 = PyList_Size(swig_obj[5]);
    arg6 = tmp_buf6;
    if (arg7 * sizeof(uint32_t) > sizeof(tmp_buf6)) {
      if (!(arg6 = (uint32_t *) wally_malloc(arg7 * sizeof(uint32_t)))) {
        check_result(WALLY_ENOMEM);
        SWIG_fail;
      }
    }
  }
  {
    result = (int)bip32_path_from_str_n((char const *)arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    if (arg7 && PyList_SetSlice(swig_obj[5], 0, arg7, NULL))
    SWIG_fail;
    if (written <= arg7) {
      for (size_t i = 0; i < written; ++i) {
        PyObject* p = PyLong_FromUnsignedLong(arg6[i]);
        if (PyList_Append(swig_obj[5], p)) {
          PyList_SetSlice(swig_obj[5], 0, PyList_Size(swig_obj[5]), NULL);
          SWIG_fail;
        }
      }
    }
  }
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg8);
  }
  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
  {
    if (arg6 && arg6 != tmp_buf6)
    wally_free(arg6);
  }
  return resultobj;
fail:
  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
  {
    if (arg6 && arg6 != tmp_buf6)
    wally_free(arg6);
  }
  return NULL;
}


SWIGINTERN PyObject *_wrap_bip32_path_str_get_features(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  char *arg1 = (char *) 0 ;
  uint32_t *arg2 = (uint32_t *) 0 ;
  int res1 ;
  char *buf1 = 0 ;
  int alloc1 = 0 ;
  uint32_t val2 ;
  PyObject *swig_obj[1] ;
  int result;
  
  {
    val2 = 0; arg2 = (uint32_t *)&val2;
  }
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  res1 = SWIG_AsCharPtrAndSize(swig_obj[0], &buf1, NULL, &alloc1);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bip32_path_str_get_features" "', argument " "1"" of type '" "char const *""'");
  }
  arg1 = (char *)(buf1);
  {
    result = (int)bip32_path_str_get_features((char const *)arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyLong_FromUnsignedLong(*arg2);
  }
  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
  return resultobj;
fail:
  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
  return NULL;
}


SWIGINTERN PyObject *_wrap_bip32_path_str_n_get_features(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  char *arg1 = (char *) 0 ;
  size_t arg2 ;
  uint32_t *arg3 = (uint32_t *) 0 ;
  int res1 ;
  char *buf1 = 0 ;
  int alloc1 = 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  uint32_t val3 ;
  PyObject *swig_obj[2] ;
  int result;
  
  {
    val3 = 0; arg3 = (uint32_t *)&val3;
  }
  if (!SWIG_Python_UnpackTuple(args, "bip32_path_str_n_get_features", 2, 2, swig_obj)) SWIG_fail;
  res1 = SWIG_AsCharPtrAndSize(swig_obj[0], &buf1, NULL, &alloc1);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bip32_path_str_n_get_features" "', argument " "1"" of type '" "char const *""'");
  }
  arg1 = (char *)(buf1);
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "bip32_path_str_n_get_features" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)bip32_path_str_n_get_features((char const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyLong_FromUnsignedLong(*arg3);
  }
  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
  return resultobj;
fail:
  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
  return NULL;
}


SWIGINTERN PyObject *_wrap_bip32_key_get_chain_code(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct ext_key *arg1 = (struct ext_key *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "bip32_key_get_chain_code", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct ext_key *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "bip32_key_get_chain_code" "', argument " "1"" of type '" "(ext_key)""'");
    }
  }
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "bip32_key_get_chain_code" "', argument " "2"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg2 = (unsigned char *) buf;
    arg3 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)bip32_key_get_chain_code((struct ext_key const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_bip32_key_get_parent160(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct ext_key *arg1 = (struct ext_key *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "bip32_key_get_parent160", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct ext_key *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "bip32_key_get_parent160" "', argument " "1"" of type '" "(ext_key)""'");
    }
  }
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "bip32_key_get_parent160" "', argument " "2"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg2 = (unsigned char *) buf;
    arg3 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)bip32_key_get_parent160((struct ext_key const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_bip32_key_get_priv_key(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct ext_key *arg1 = (struct ext_key *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "bip32_key_get_priv_key", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct ext_key *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "bip32_key_get_priv_key" "', argument " "1"" of type '" "(ext_key)""'");
    }
  }
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "bip32_key_get_priv_key" "', argument " "2"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg2 = (unsigned char *) buf;
    arg3 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)bip32_key_get_priv_key((struct ext_key const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_bip32_key_get_hash160(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct ext_key *arg1 = (struct ext_key *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "bip32_key_get_hash160", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct ext_key *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "bip32_key_get_hash160" "', argument " "1"" of type '" "(ext_key)""'");
    }
  }
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "bip32_key_get_hash160" "', argument " "2"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg2 = (unsigned char *) buf;
    arg3 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)bip32_key_get_hash160((struct ext_key const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_bip32_key_get_pub_key(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct ext_key *arg1 = (struct ext_key *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "bip32_key_get_pub_key", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct ext_key *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "bip32_key_get_pub_key" "', argument " "1"" of type '" "(ext_key)""'");
    }
  }
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "bip32_key_get_pub_key" "', argument " "2"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg2 = (unsigned char *) buf;
    arg3 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)bip32_key_get_pub_key((struct ext_key const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_bip32_key_get_pub_key_tweak_sum(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct ext_key *arg1 = (struct ext_key *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "bip32_key_get_pub_key_tweak_sum", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct ext_key *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "bip32_key_get_pub_key_tweak_sum" "', argument " "1"" of type '" "(ext_key)""'");
    }
  }
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "bip32_key_get_pub_key_tweak_sum" "', argument " "2"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg2 = (unsigned char *) buf;
    arg3 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)bip32_key_get_pub_key_tweak_sum((struct ext_key const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_bip32_key_get_depth(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct ext_key *arg1 = (struct ext_key *) 0 ;
  size_t *arg2 = (size_t *) 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  size_t written = 0; arg2 = (size_t *)&written;
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct ext_key *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "bip32_key_get_depth" "', argument " "1"" of type '" "(ext_key)""'");
    }
  }
  {
    result = (int)bip32_key_get_depth((struct ext_key const *)arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg2);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_bip32_key_get_child_num(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct ext_key *arg1 = (struct ext_key *) 0 ;
  size_t *arg2 = (size_t *) 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  size_t written = 0; arg2 = (size_t *)&written;
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct ext_key *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "bip32_key_get_child_num" "', argument " "1"" of type '" "(ext_key)""'");
    }
  }
  {
    result = (int)bip32_key_get_child_num((struct ext_key const *)arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg2);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_bip32_key_get_version(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct ext_key *arg1 = (struct ext_key *) 0 ;
  size_t *arg2 = (size_t *) 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  size_t written = 0; arg2 = (size_t *)&written;
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct ext_key *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "bip32_key_get_version" "', argument " "1"" of type '" "(ext_key)""'");
    }
  }
  {
    result = (int)bip32_key_get_version((struct ext_key const *)arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg2);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_bip38_raw_from_private_key(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  uint32_t arg5 ;
  unsigned char *arg6 = (unsigned char *) 0 ;
  size_t arg7 ;
  unsigned int val5 ;
  int ecode5 = 0 ;
  PyObject *swig_obj[4] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "bip38_raw_from_private_key", 4, 4, swig_obj)) SWIG_fail;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "bip38_raw_from_private_key" "', argument " "1"" of type '" "(const unsigned char* bytes, size_t bytes_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "bip38_raw_from_private_key" "', argument " "3"" of type '" "(const unsigned char* pass, size_t pass_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  ecode5 = SWIG_AsVal_unsigned_SS_int(swig_obj[2], &val5);
  if (!SWIG_IsOK(ecode5)) {
    SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "bip38_raw_from_private_key" "', argument " "5"" of type '" "uint32_t""'");
  } 
  arg5 = (uint32_t)(val5);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[3], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "bip38_raw_from_private_key" "', argument " "6"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg6 = (unsigned char *) buf;
    arg7 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)bip38_raw_from_private_key((unsigned char const *)arg1,arg2,(unsigned char const *)arg3,arg4,arg5,arg6,arg7);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_bip38_from_private_key(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  uint32_t arg5 ;
  char **arg6 = (char **) 0 ;
  unsigned int val5 ;
  int ecode5 = 0 ;
  char *txt6 ;
  PyObject *swig_obj[3] ;
  int result;
  
  {
    txt6 = NULL;
    arg6 = (char **)&txt6;
  }
  if (!SWIG_Python_UnpackTuple(args, "bip38_from_private_key", 3, 3, swig_obj)) SWIG_fail;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "bip38_from_private_key" "', argument " "1"" of type '" "(const unsigned char* bytes, size_t bytes_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "bip38_from_private_key" "', argument " "3"" of type '" "(const unsigned char* pass, size_t pass_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  ecode5 = SWIG_AsVal_unsigned_SS_int(swig_obj[2], &val5);
  if (!SWIG_IsOK(ecode5)) {
    SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "bip38_from_private_key" "', argument " "5"" of type '" "uint32_t""'");
  } 
  arg5 = (uint32_t)(val5);
  {
    result = (int)bip38_from_private_key((unsigned char const *)arg1,arg2,(unsigned char const *)arg3,arg4,arg5,arg6);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    if (*arg6 != NULL) {
      Py_DecRef(resultobj);
      resultobj = PyString_FromString(*arg6);
      wally_free_string(*arg6);
    }
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_bip38_raw_to_private_key(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  uint32_t arg5 ;
  unsigned char *arg6 = (unsigned char *) 0 ;
  size_t arg7 ;
  unsigned int val5 ;
  int ecode5 = 0 ;
  PyObject *swig_obj[4] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "bip38_raw_to_private_key", 4, 4, swig_obj)) SWIG_fail;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "bip38_raw_to_private_key" "', argument " "1"" of type '" "(const unsigned char* bytes, size_t bytes_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "bip38_raw_to_private_key" "', argument " "3"" of type '" "(const unsigned char* pass, size_t pass_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  ecode5 = SWIG_AsVal_unsigned_SS_int(swig_obj[2], &val5);
  if (!SWIG_IsOK(ecode5)) {
    SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "bip38_raw_to_private_key" "', argument " "5"" of type '" "uint32_t""'");
  } 
  arg5 = (uint32_t)(val5);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[3], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "bip38_raw_to_private_key" "', argument " "6"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg6 = (unsigned char *) buf;
    arg7 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)bip38_raw_to_private_key((unsigned char const *)arg1,arg2,(unsigned char const *)arg3,arg4,arg5,arg6,arg7);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_bip38_to_private_key(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  char *arg1 = (char *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  uint32_t arg4 ;
  unsigned char *arg5 = (unsigned char *) 0 ;
  size_t arg6 ;
  int res1 ;
  char *buf1 = 0 ;
  int alloc1 = 0 ;
  unsigned int val4 ;
  int ecode4 = 0 ;
  PyObject *swig_obj[4] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "bip38_to_private_key", 4, 4, swig_obj)) SWIG_fail;
  res1 = SWIG_AsCharPtrAndSize(swig_obj[0], &buf1, NULL, &alloc1);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bip38_to_private_key" "', argument " "1"" of type '" "char const *""'");
  }
  arg1 = (char *)(buf1);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg3 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "bip38_to_private_key" "', argument " "2"" of type '" "(const unsigned char* pass, size_t pass_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg2 = (unsigned char *) buf;
      arg3 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  ecode4 = SWIG_AsVal_unsigned_SS_int(swig_obj[2], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "bip38_to_private_key" "', argument " "4"" of type '" "uint32_t""'");
  } 
  arg4 = (uint32_t)(val4);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[3], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "bip38_to_private_key" "', argument " "5"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg5 = (unsigned char *) buf;
    arg6 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)bip38_to_private_key((char const *)arg1,(unsigned char const *)arg2,arg3,arg4,arg5,arg6);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
  return resultobj;
fail:
  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
  return NULL;
}


SWIGINTERN PyObject *_wrap_bip38_raw_get_flags(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  size_t *arg3 = (size_t *) 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  size_t written = 0; arg3 = (size_t *)&written;
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "bip38_raw_get_flags" "', argument " "1"" of type '" "(const unsigned char* bytes, size_t bytes_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)bip38_raw_get_flags((unsigned char const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg3);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_bip38_get_flags(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  char *arg1 = (char *) 0 ;
  size_t *arg2 = (size_t *) 0 ;
  int res1 ;
  char *buf1 = 0 ;
  int alloc1 = 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  size_t written = 0; arg2 = (size_t *)&written;
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  res1 = SWIG_AsCharPtrAndSize(swig_obj[0], &buf1, NULL, &alloc1);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bip38_get_flags" "', argument " "1"" of type '" "char const *""'");
  }
  arg1 = (char *)(buf1);
  {
    result = (int)bip38_get_flags((char const *)arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg2);
  }
  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
  return resultobj;
fail:
  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
  return NULL;
}


SWIGINTERN PyObject *_wrap_bip39_get_languages(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  char **arg1 = (char **) 0 ;
  char *txt1 ;
  int result;
  
  {
    txt1 = NULL;
    arg1 = (char **)&txt1;
  }
  if (!SWIG_Python_UnpackTuple(args, "bip39_get_languages", 0, 0, 0)) SWIG_fail;
  {
    result = (int)bip39_get_languages(arg1);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    if (*arg1 != NULL) {
      Py_DecRef(resultobj);
      resultobj = PyString_FromString(*arg1);
      wally_free_string(*arg1);
    }
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_bip39_get_wordlist(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  char *arg1 = (char *) 0 ;
  struct words **arg2 = (struct words **) 0 ;
  int res1 ;
  char *buf1 = 0 ;
  int alloc1 = 0 ;
  struct words *w2 ;
  PyObject *swig_obj[1] ;
  int result;
  
  {
    w2 = 0; arg2 = (struct words **)&w2;
  }
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  res1 = SWIG_AsCharPtrAndSize(swig_obj[0], &buf1, NULL, &alloc1);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bip39_get_wordlist" "', argument " "1"" of type '" "char const *""'");
  }
  arg1 = (char *)(buf1);
  {
    result = (int)bip39_get_wordlist((char const *)arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    if (*arg2 != NULL) {
      Py_DecRef(resultobj);
      resultobj = PyCapsule_New(*arg2, "struct words *", destroy_words);
    }
  }
  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
  return resultobj;
fail:
  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
  return NULL;
}


SWIGINTERN PyObject *_wrap_bip39_get_word(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct words *arg1 = (struct words *) 0 ;
  size_t arg2 ;
  char **arg3 = (char **) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  char *txt3 ;
  PyObject *swig_obj[2] ;
  int result;
  
  {
    txt3 = NULL;
    arg3 = (char **)&txt3;
  }
  if (!SWIG_Python_UnpackTuple(args, "bip39_get_word", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct words *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "bip39_get_word" "', argument " "1"" of type '" "(words)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "bip39_get_word" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)bip39_get_word((struct words const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    if (*arg3 != NULL) {
      Py_DecRef(resultobj);
      resultobj = PyString_FromString(*arg3);
      wally_free_string(*arg3);
    }
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_bip39_mnemonic_from_bytes(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct words *arg1 = (struct words *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  char **arg4 = (char **) 0 ;
  char *txt4 ;
  PyObject *swig_obj[2] ;
  int result;
  
  {
    txt4 = NULL;
    arg4 = (char **)&txt4;
  }
  if (!SWIG_Python_UnpackTuple(args, "bip39_mnemonic_from_bytes", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct words *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "bip39_mnemonic_from_bytes" "', argument " "1"" of type '" "(words)""'");
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg3 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "bip39_mnemonic_from_bytes" "', argument " "2"" of type '" "(const unsigned char* bytes, size_t bytes_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg2 = (unsigned char *) buf;
      arg3 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)bip39_mnemonic_from_bytes((struct words const *)arg1,(unsigned char const *)arg2,arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    if (*arg4 != NULL) {
      Py_DecRef(resultobj);
      resultobj = PyString_FromString(*arg4);
      wally_free_string(*arg4);
    }
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_bip39_mnemonic_to_bytes(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct words *arg1 = (struct words *) 0 ;
  char *arg2 = (char *) 0 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t *arg5 = (size_t *) 0 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  size_t written = 0; arg5 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "bip39_mnemonic_to_bytes", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct words *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "bip39_mnemonic_to_bytes" "', argument " "1"" of type '" "(words)""'");
    }
  }
  res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "bip39_mnemonic_to_bytes" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = (char *)(buf2);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "bip39_mnemonic_to_bytes" "', argument " "3"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg3 = (unsigned char *) buf;
    arg4 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)bip39_mnemonic_to_bytes((struct words const *)arg1,(char const *)arg2,arg3,arg4,arg5);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg5);
  }
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  return resultobj;
fail:
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  return NULL;
}


SWIGINTERN PyObject *_wrap_bip39_mnemonic_validate(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct words *arg1 = (struct words *) 0 ;
  char *arg2 = (char *) 0 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "bip39_mnemonic_validate", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct words *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "bip39_mnemonic_validate" "', argument " "1"" of type '" "(words)""'");
    }
  }
  res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "bip39_mnemonic_validate" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = (char *)(buf2);
  {
    result = (int)bip39_mnemonic_validate((struct words const *)arg1,(char const *)arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  return resultobj;
fail:
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  return NULL;
}


SWIGINTERN PyObject *_wrap_bip39_mnemonic_to_seed(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  char *arg1 = (char *) 0 ;
  char *arg2 = (char *) 0 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t *arg5 = (size_t *) 0 ;
  int res1 ;
  char *buf1 = 0 ;
  int alloc1 = 0 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  size_t written = 0; arg5 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "bip39_mnemonic_to_seed", 3, 3, swig_obj)) SWIG_fail;
  res1 = SWIG_AsCharPtrAndSize(swig_obj[0], &buf1, NULL, &alloc1);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bip39_mnemonic_to_seed" "', argument " "1"" of type '" "char const *""'");
  }
  arg1 = (char *)(buf1);
  res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "bip39_mnemonic_to_seed" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = (char *)(buf2);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "bip39_mnemonic_to_seed" "', argument " "3"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg3 = (unsigned char *) buf;
    arg4 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)bip39_mnemonic_to_seed((char const *)arg1,(char const *)arg2,arg3,arg4,arg5);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg5);
  }
  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  return resultobj;
fail:
  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  return NULL;
}


SWIGINTERN PyObject *_wrap_bip39_mnemonic_to_seed512(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  char *arg1 = (char *) 0 ;
  char *arg2 = (char *) 0 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  int res1 ;
  char *buf1 = 0 ;
  int alloc1 = 0 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "bip39_mnemonic_to_seed512", 3, 3, swig_obj)) SWIG_fail;
  res1 = SWIG_AsCharPtrAndSize(swig_obj[0], &buf1, NULL, &alloc1);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bip39_mnemonic_to_seed512" "', argument " "1"" of type '" "char const *""'");
  }
  arg1 = (char *)(buf1);
  res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "bip39_mnemonic_to_seed512" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = (char *)(buf2);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "bip39_mnemonic_to_seed512" "', argument " "3"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg3 = (unsigned char *) buf;
    arg4 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)bip39_mnemonic_to_seed512((char const *)arg1,(char const *)arg2,arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  return resultobj;
fail:
  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  return NULL;
}


SWIGINTERN PyObject *_wrap_bip85_get_languages(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  char **arg1 = (char **) 0 ;
  char *txt1 ;
  int result;
  
  {
    txt1 = NULL;
    arg1 = (char **)&txt1;
  }
  if (!SWIG_Python_UnpackTuple(args, "bip85_get_languages", 0, 0, 0)) SWIG_fail;
  {
    result = (int)bip85_get_languages(arg1);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    if (*arg1 != NULL) {
      Py_DecRef(resultobj);
      resultobj = PyString_FromString(*arg1);
      wally_free_string(*arg1);
    }
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_bip85_get_bip39_entropy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct ext_key *arg1 = (struct ext_key *) 0 ;
  char *arg2 = (char *) 0 ;
  uint32_t arg3 ;
  uint32_t arg4 ;
  unsigned char *arg5 = (unsigned char *) 0 ;
  size_t arg6 ;
  size_t *arg7 = (size_t *) 0 ;
  int res2 ;
  char *buf2 = 0 ;
  int alloc2 = 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  unsigned int val4 ;
  int ecode4 = 0 ;
  PyObject *swig_obj[5] ;
  int result;
  
  size_t written = 0; arg7 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "bip85_get_bip39_entropy", 5, 5, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct ext_key *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "bip85_get_bip39_entropy" "', argument " "1"" of type '" "(ext_key)""'");
    }
  }
  res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "bip85_get_bip39_entropy" "', argument " "2"" of type '" "char const *""'");
  }
  arg2 = (char *)(buf2);
  ecode3 = SWIG_AsVal_unsigned_SS_int(swig_obj[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "bip85_get_bip39_entropy" "', argument " "3"" of type '" "uint32_t""'");
  } 
  arg3 = (uint32_t)(val3);
  ecode4 = SWIG_AsVal_unsigned_SS_int(swig_obj[3], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "bip85_get_bip39_entropy" "', argument " "4"" of type '" "uint32_t""'");
  } 
  arg4 = (uint32_t)(val4);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[4], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "bip85_get_bip39_entropy" "', argument " "5"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg5 = (unsigned char *) buf;
    arg6 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)bip85_get_bip39_entropy((struct ext_key const *)arg1,(char const *)arg2,arg3,arg4,arg5,arg6,arg7);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg7);
  }
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  return resultobj;
fail:
  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
  return NULL;
}


SWIGINTERN PyObject *_wrap_bip85_get_rsa_entropy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct ext_key *arg1 = (struct ext_key *) 0 ;
  uint32_t arg2 ;
  uint32_t arg3 ;
  unsigned char *arg4 = (unsigned char *) 0 ;
  size_t arg5 ;
  size_t *arg6 = (size_t *) 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  PyObject *swig_obj[4] ;
  int result;
  
  size_t written = 0; arg6 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "bip85_get_rsa_entropy", 4, 4, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct ext_key *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "bip85_get_rsa_entropy" "', argument " "1"" of type '" "(ext_key)""'");
    }
  }
  ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "bip85_get_rsa_entropy" "', argument " "2"" of type '" "uint32_t""'");
  } 
  arg2 = (uint32_t)(val2);
  ecode3 = SWIG_AsVal_unsigned_SS_int(swig_obj[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "bip85_get_rsa_entropy" "', argument " "3"" of type '" "uint32_t""'");
  } 
  arg3 = (uint32_t)(val3);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[3], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "bip85_get_rsa_entropy" "', argument " "4"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg4 = (unsigned char *) buf;
    arg5 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)bip85_get_rsa_entropy((struct ext_key const *)arg1,arg2,arg3,arg4,arg5,arg6);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg6);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_coinselect_assets(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  uint64_t *arg1 = (uint64_t *) 0 ;
  size_t arg2 ;
  uint64_t arg3 ;
  uint64_t arg4 ;
  uint32_t arg5 ;
  uint32_t *arg6 = (uint32_t *) 0 ;
  size_t arg7 ;
  size_t *arg8 = (size_t *) 0 ;
  uint64_t tmp_buf1[MAX_LOCAL_STACK/sizeof(uint64_t)] ;
  unsigned long long val3 ;
  int ecode3 = 0 ;
  unsigned long long val4 ;
  int ecode4 = 0 ;
  unsigned int val5 ;
  int ecode5 = 0 ;
  uint32_t tmp_buf6[MAX_LOCAL_STACK/sizeof(uint32_t)] ;
  PyObject *swig_obj[5] ;
  int result;
  
  size_t written = 0; arg8 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "coinselect_assets", 5, 5, swig_obj)) SWIG_fail;
  {
    size_t i;
    if (!PyList_Check(swig_obj[0])) {
      check_result(WALLY_EINVAL);
      SWIG_fail;
    }
    arg2 = PyList_Size(swig_obj[0]);
    arg1 = tmp_buf1;
    if (arg2 * sizeof(uint64_t) > sizeof(tmp_buf1))
    if (!(arg1 = (uint64_t *) wally_malloc((arg2) * sizeof(uint64_t)))) {
      check_result(WALLY_ENOMEM);
      SWIG_fail;
    }
    for (i = 0; i < arg2; ++i) {
      PyObject *item = PyList_GET_ITEM(swig_obj[0], i);
      unsigned long long v;
      if (!ulonglong_cast(item, &v) || v > 0xffffffffffffffffull) {
        PyErr_SetString(PyExc_OverflowError, "Invalid unsigned integer");
        SWIG_fail;
      }
      arg1[i] = (uint64_t)v;
    }
  }
  ecode3 = SWIG_AsVal_unsigned_SS_long_SS_long(swig_obj[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "coinselect_assets" "', argument " "3"" of type '" "uint64_t""'");
  } 
  arg3 = (uint64_t)(val3);
  ecode4 = SWIG_AsVal_unsigned_SS_long_SS_long(swig_obj[2], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "coinselect_assets" "', argument " "4"" of type '" "uint64_t""'");
  } 
  arg4 = (uint64_t)(val4);
  ecode5 = SWIG_AsVal_unsigned_SS_int(swig_obj[3], &val5);
  if (!SWIG_IsOK(ecode5)) {
    SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "coinselect_assets" "', argument " "5"" of type '" "uint32_t""'");
  } 
  arg5 = (uint32_t)(val5);
  {
    if (!PyList_CheckExact(swig_obj[4])) {
      check_result(WALLY_EINVAL);
      SWIG_fail;
    }
    arg7 = PyList_Size(swig_obj[4]);
    arg6 = tmp_buf6;
    if (arg7 * sizeof(uint32_t) > sizeof(tmp_buf6)) {
      if (!(arg6 = (uint32_t *) wally_malloc(arg7 * sizeof(uint32_t)))) {
        check_result(WALLY_ENOMEM);
        SWIG_fail;
      }
    }
  }
  {
    result = (int)wally_coinselect_assets((uint64_t const *)arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    if (arg7 && PyList_SetSlice(swig_obj[4], 0, arg7, NULL))
    SWIG_fail;
    if (written <= arg7) {
      for (size_t i = 0; i < written; ++i) {
        PyObject* p = PyLong_FromUnsignedLong(arg6[i]);
        if (PyList_Append(swig_obj[4], p)) {
          PyList_SetSlice(swig_obj[4], 0, PyList_Size(swig_obj[4]), NULL);
          SWIG_fail;
        }
      }
    }
  }
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg8);
  }
  {
    if (arg1 && arg1 != tmp_buf1)
    wally_free(arg1);
  }
  {
    if (arg6 && arg6 != tmp_buf6)
    wally_free(arg6);
  }
  return resultobj;
fail:
  {
    if (arg1 && arg1 != tmp_buf1)
    wally_free(arg1);
  }
  {
    if (arg6 && arg6 != tmp_buf6)
    wally_free(arg6);
  }
  return NULL;
}


SWIGINTERN PyObject *_wrap_scrypt(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  uint32_t arg5 ;
  uint32_t arg6 ;
  uint32_t arg7 ;
  unsigned char *arg8 = (unsigned char *) 0 ;
  size_t arg9 ;
  unsigned int val5 ;
  int ecode5 = 0 ;
  unsigned int val6 ;
  int ecode6 = 0 ;
  unsigned int val7 ;
  int ecode7 = 0 ;
  PyObject *swig_obj[6] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "scrypt", 6, 6, swig_obj)) SWIG_fail;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "scrypt" "', argument " "1"" of type '" "(const unsigned char* pass, size_t pass_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "scrypt" "', argument " "3"" of type '" "(const unsigned char* salt, size_t salt_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  ecode5 = SWIG_AsVal_unsigned_SS_int(swig_obj[2], &val5);
  if (!SWIG_IsOK(ecode5)) {
    SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "scrypt" "', argument " "5"" of type '" "uint32_t""'");
  } 
  arg5 = (uint32_t)(val5);
  ecode6 = SWIG_AsVal_unsigned_SS_int(swig_obj[3], &val6);
  if (!SWIG_IsOK(ecode6)) {
    SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "scrypt" "', argument " "6"" of type '" "uint32_t""'");
  } 
  arg6 = (uint32_t)(val6);
  ecode7 = SWIG_AsVal_unsigned_SS_int(swig_obj[4], &val7);
  if (!SWIG_IsOK(ecode7)) {
    SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "scrypt" "', argument " "7"" of type '" "uint32_t""'");
  } 
  arg7 = (uint32_t)(val7);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[5], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "scrypt" "', argument " "8"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg8 = (unsigned char *) buf;
    arg9 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_scrypt((unsigned char const *)arg1,arg2,(unsigned char const *)arg3,arg4,arg5,arg6,arg7,arg8,arg9);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_aes_len(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  uint32_t arg5 ;
  size_t *arg6 = (size_t *) 0 ;
  unsigned int val5 ;
  int ecode5 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  size_t written = 0; arg6 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "aes_len", 3, 3, swig_obj)) SWIG_fail;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "aes_len" "', argument " "1"" of type '" "(const unsigned char* key, size_t key_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "aes_len" "', argument " "3"" of type '" "(const unsigned char* bytes, size_t bytes_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  ecode5 = SWIG_AsVal_unsigned_SS_int(swig_obj[2], &val5);
  if (!SWIG_IsOK(ecode5)) {
    SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "aes_len" "', argument " "5"" of type '" "uint32_t""'");
  } 
  arg5 = (uint32_t)(val5);
  {
    result = (int)wally_aes_len((unsigned char const *)arg1,arg2,(unsigned char const *)arg3,arg4,arg5,arg6);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg6);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_aes(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  uint32_t arg5 ;
  unsigned char *arg6 = (unsigned char *) 0 ;
  size_t arg7 ;
  unsigned int val5 ;
  int ecode5 = 0 ;
  PyObject *swig_obj[4] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "aes", 4, 4, swig_obj)) SWIG_fail;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "aes" "', argument " "1"" of type '" "(const unsigned char* key, size_t key_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "aes" "', argument " "3"" of type '" "(const unsigned char* bytes, size_t bytes_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  ecode5 = SWIG_AsVal_unsigned_SS_int(swig_obj[2], &val5);
  if (!SWIG_IsOK(ecode5)) {
    SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "aes" "', argument " "5"" of type '" "uint32_t""'");
  } 
  arg5 = (uint32_t)(val5);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[3], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "aes" "', argument " "6"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg6 = (unsigned char *) buf;
    arg7 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_aes((unsigned char const *)arg1,arg2,(unsigned char const *)arg3,arg4,arg5,arg6,arg7);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_aes_cbc_get_maximum_length(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  unsigned char *arg5 = (unsigned char *) 0 ;
  size_t arg6 ;
  uint32_t arg7 ;
  size_t *arg8 = (size_t *) 0 ;
  unsigned int val7 ;
  int ecode7 = 0 ;
  PyObject *swig_obj[4] ;
  int result;
  
  size_t written = 0; arg8 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "aes_cbc_get_maximum_length", 4, 4, swig_obj)) SWIG_fail;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "aes_cbc_get_maximum_length" "', argument " "1"" of type '" "(const unsigned char* key, size_t key_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "aes_cbc_get_maximum_length" "', argument " "3"" of type '" "(const unsigned char* iv, size_t iv_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[2] == Py_None)
    arg6 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "aes_cbc_get_maximum_length" "', argument " "5"" of type '" "(const unsigned char* bytes, size_t bytes_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg5 = (unsigned char *) buf;
      arg6 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  ecode7 = SWIG_AsVal_unsigned_SS_int(swig_obj[3], &val7);
  if (!SWIG_IsOK(ecode7)) {
    SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "aes_cbc_get_maximum_length" "', argument " "7"" of type '" "uint32_t""'");
  } 
  arg7 = (uint32_t)(val7);
  {
    result = (int)wally_aes_cbc_get_maximum_length((unsigned char const *)arg1,arg2,(unsigned char const *)arg3,arg4,(unsigned char const *)arg5,arg6,arg7,arg8);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg8);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_aes_cbc(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  unsigned char *arg5 = (unsigned char *) 0 ;
  size_t arg6 ;
  uint32_t arg7 ;
  unsigned char *arg8 = (unsigned char *) 0 ;
  size_t arg9 ;
  size_t *arg10 = (size_t *) 0 ;
  unsigned int val7 ;
  int ecode7 = 0 ;
  PyObject *swig_obj[5] ;
  int result;
  
  size_t written = 0; arg10 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "aes_cbc", 5, 5, swig_obj)) SWIG_fail;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "aes_cbc" "', argument " "1"" of type '" "(const unsigned char* key, size_t key_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "aes_cbc" "', argument " "3"" of type '" "(const unsigned char* iv, size_t iv_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[2] == Py_None)
    arg6 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "aes_cbc" "', argument " "5"" of type '" "(const unsigned char* bytes, size_t bytes_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg5 = (unsigned char *) buf;
      arg6 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  ecode7 = SWIG_AsVal_unsigned_SS_int(swig_obj[3], &val7);
  if (!SWIG_IsOK(ecode7)) {
    SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "aes_cbc" "', argument " "7"" of type '" "uint32_t""'");
  } 
  arg7 = (uint32_t)(val7);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[4], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "aes_cbc" "', argument " "8"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg8 = (unsigned char *) buf;
    arg9 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_aes_cbc((unsigned char const *)arg1,arg2,(unsigned char const *)arg3,arg4,(unsigned char const *)arg5,arg6,arg7,arg8,arg9,arg10);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg10);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_sha256(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "sha256", 2, 2, swig_obj)) SWIG_fail;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "sha256" "', argument " "1"" of type '" "(const unsigned char* bytes, size_t bytes_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "sha256" "', argument " "3"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg3 = (unsigned char *) buf;
    arg4 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_sha256((unsigned char const *)arg1,arg2,arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_sha256_midstate(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "sha256_midstate", 2, 2, swig_obj)) SWIG_fail;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "sha256_midstate" "', argument " "1"" of type '" "(const unsigned char* bytes, size_t bytes_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "sha256_midstate" "', argument " "3"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg3 = (unsigned char *) buf;
    arg4 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_sha256_midstate((unsigned char const *)arg1,arg2,arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_sha256d(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "sha256d", 2, 2, swig_obj)) SWIG_fail;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "sha256d" "', argument " "1"" of type '" "(const unsigned char* bytes, size_t bytes_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "sha256d" "', argument " "3"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg3 = (unsigned char *) buf;
    arg4 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_sha256d((unsigned char const *)arg1,arg2,arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_sha512(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "sha512", 2, 2, swig_obj)) SWIG_fail;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "sha512" "', argument " "1"" of type '" "(const unsigned char* bytes, size_t bytes_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "sha512" "', argument " "3"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg3 = (unsigned char *) buf;
    arg4 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_sha512((unsigned char const *)arg1,arg2,arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_bip340_tagged_hash(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  char *arg3 = (char *) 0 ;
  unsigned char *arg4 = (unsigned char *) 0 ;
  size_t arg5 ;
  int res3 ;
  char *buf3 = 0 ;
  int alloc3 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "bip340_tagged_hash", 3, 3, swig_obj)) SWIG_fail;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "bip340_tagged_hash" "', argument " "1"" of type '" "(const unsigned char* bytes, size_t bytes_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  res3 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf3, NULL, &alloc3);
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "bip340_tagged_hash" "', argument " "3"" of type '" "char const *""'");
  }
  arg3 = (char *)(buf3);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "bip340_tagged_hash" "', argument " "4"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg4 = (unsigned char *) buf;
    arg5 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_bip340_tagged_hash((unsigned char const *)arg1,arg2,(char const *)arg3,arg4,arg5);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
  return resultobj;
fail:
  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
  return NULL;
}


SWIGINTERN PyObject *_wrap_ripemd160(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "ripemd160", 2, 2, swig_obj)) SWIG_fail;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "ripemd160" "', argument " "1"" of type '" "(const unsigned char* bytes, size_t bytes_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "ripemd160" "', argument " "3"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg3 = (unsigned char *) buf;
    arg4 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_ripemd160((unsigned char const *)arg1,arg2,arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_hash160(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "hash160", 2, 2, swig_obj)) SWIG_fail;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "hash160" "', argument " "1"" of type '" "(const unsigned char* bytes, size_t bytes_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "hash160" "', argument " "3"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg3 = (unsigned char *) buf;
    arg4 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_hash160((unsigned char const *)arg1,arg2,arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_hmac_sha256(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  unsigned char *arg5 = (unsigned char *) 0 ;
  size_t arg6 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "hmac_sha256", 3, 3, swig_obj)) SWIG_fail;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "hmac_sha256" "', argument " "1"" of type '" "(const unsigned char* key, size_t key_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "hmac_sha256" "', argument " "3"" of type '" "(const unsigned char* bytes, size_t bytes_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "hmac_sha256" "', argument " "5"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg5 = (unsigned char *) buf;
    arg6 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_hmac_sha256((unsigned char const *)arg1,arg2,(unsigned char const *)arg3,arg4,arg5,arg6);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_hmac_sha512(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  unsigned char *arg5 = (unsigned char *) 0 ;
  size_t arg6 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "hmac_sha512", 3, 3, swig_obj)) SWIG_fail;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "hmac_sha512" "', argument " "1"" of type '" "(const unsigned char* key, size_t key_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "hmac_sha512" "', argument " "3"" of type '" "(const unsigned char* bytes, size_t bytes_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "hmac_sha512" "', argument " "5"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg5 = (unsigned char *) buf;
    arg6 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_hmac_sha512((unsigned char const *)arg1,arg2,(unsigned char const *)arg3,arg4,arg5,arg6);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_pbkdf2_hmac_sha256(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  uint32_t arg5 ;
  uint32_t arg6 ;
  unsigned char *arg7 = (unsigned char *) 0 ;
  size_t arg8 ;
  unsigned int val5 ;
  int ecode5 = 0 ;
  unsigned int val6 ;
  int ecode6 = 0 ;
  PyObject *swig_obj[5] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "pbkdf2_hmac_sha256", 5, 5, swig_obj)) SWIG_fail;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "pbkdf2_hmac_sha256" "', argument " "1"" of type '" "(const unsigned char* pass, size_t pass_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "pbkdf2_hmac_sha256" "', argument " "3"" of type '" "(const unsigned char* salt, size_t salt_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  ecode5 = SWIG_AsVal_unsigned_SS_int(swig_obj[2], &val5);
  if (!SWIG_IsOK(ecode5)) {
    SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "pbkdf2_hmac_sha256" "', argument " "5"" of type '" "uint32_t""'");
  } 
  arg5 = (uint32_t)(val5);
  ecode6 = SWIG_AsVal_unsigned_SS_int(swig_obj[3], &val6);
  if (!SWIG_IsOK(ecode6)) {
    SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "pbkdf2_hmac_sha256" "', argument " "6"" of type '" "uint32_t""'");
  } 
  arg6 = (uint32_t)(val6);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[4], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "pbkdf2_hmac_sha256" "', argument " "7"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg7 = (unsigned char *) buf;
    arg8 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_pbkdf2_hmac_sha256((unsigned char const *)arg1,arg2,(unsigned char const *)arg3,arg4,arg5,arg6,arg7,arg8);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_pbkdf2_hmac_sha512(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  uint32_t arg5 ;
  uint32_t arg6 ;
  unsigned char *arg7 = (unsigned char *) 0 ;
  size_t arg8 ;
  unsigned int val5 ;
  int ecode5 = 0 ;
  unsigned int val6 ;
  int ecode6 = 0 ;
  PyObject *swig_obj[5] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "pbkdf2_hmac_sha512", 5, 5, swig_obj)) SWIG_fail;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "pbkdf2_hmac_sha512" "', argument " "1"" of type '" "(const unsigned char* pass, size_t pass_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "pbkdf2_hmac_sha512" "', argument " "3"" of type '" "(const unsigned char* salt, size_t salt_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  ecode5 = SWIG_AsVal_unsigned_SS_int(swig_obj[2], &val5);
  if (!SWIG_IsOK(ecode5)) {
    SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "pbkdf2_hmac_sha512" "', argument " "5"" of type '" "uint32_t""'");
  } 
  arg5 = (uint32_t)(val5);
  ecode6 = SWIG_AsVal_unsigned_SS_int(swig_obj[3], &val6);
  if (!SWIG_IsOK(ecode6)) {
    SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "pbkdf2_hmac_sha512" "', argument " "6"" of type '" "uint32_t""'");
  } 
  arg6 = (uint32_t)(val6);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[4], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "pbkdf2_hmac_sha512" "', argument " "7"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg7 = (unsigned char *) buf;
    arg8 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_pbkdf2_hmac_sha512((unsigned char const *)arg1,arg2,(unsigned char const *)arg3,arg4,arg5,arg6,arg7,arg8);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_ec_private_key_verify(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  PyObject *swig_obj[1] ;
  int result;
  
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "ec_private_key_verify" "', argument " "1"" of type '" "(const unsigned char* priv_key, size_t priv_key_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_ec_private_key_verify((unsigned char const *)arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_ec_public_key_verify(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  PyObject *swig_obj[1] ;
  int result;
  
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "ec_public_key_verify" "', argument " "1"" of type '" "(const unsigned char* pub_key, size_t pub_key_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_ec_public_key_verify((unsigned char const *)arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_ec_xonly_public_key_verify(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  PyObject *swig_obj[1] ;
  int result;
  
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "ec_xonly_public_key_verify" "', argument " "1"" of type '" "(const unsigned char* pub_key, size_t pub_key_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_ec_xonly_public_key_verify((unsigned char const *)arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_ec_public_key_from_private_key(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "ec_public_key_from_private_key", 2, 2, swig_obj)) SWIG_fail;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "ec_public_key_from_private_key" "', argument " "1"" of type '" "(const unsigned char* priv_key, size_t priv_key_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "ec_public_key_from_private_key" "', argument " "3"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg3 = (unsigned char *) buf;
    arg4 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_ec_public_key_from_private_key((unsigned char const *)arg1,arg2,arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_ec_public_key_decompress(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "ec_public_key_decompress", 2, 2, swig_obj)) SWIG_fail;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "ec_public_key_decompress" "', argument " "1"" of type '" "(const unsigned char* pub_key, size_t pub_key_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "ec_public_key_decompress" "', argument " "3"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg3 = (unsigned char *) buf;
    arg4 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_ec_public_key_decompress((unsigned char const *)arg1,arg2,arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_ec_public_key_negate(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "ec_public_key_negate", 2, 2, swig_obj)) SWIG_fail;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "ec_public_key_negate" "', argument " "1"" of type '" "(const unsigned char* pub_key, size_t pub_key_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "ec_public_key_negate" "', argument " "3"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg3 = (unsigned char *) buf;
    arg4 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_ec_public_key_negate((unsigned char const *)arg1,arg2,arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_ec_public_key_tweak(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  unsigned char *arg5 = (unsigned char *) 0 ;
  size_t arg6 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "ec_public_key_tweak", 3, 3, swig_obj)) SWIG_fail;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "ec_public_key_tweak" "', argument " "1"" of type '" "(const unsigned char* pub_key, size_t pub_key_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "ec_public_key_tweak" "', argument " "3"" of type '" "(const unsigned char* tweak, size_t tweak_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "ec_public_key_tweak" "', argument " "5"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg5 = (unsigned char *) buf;
    arg6 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_ec_public_key_tweak((unsigned char const *)arg1,arg2,(unsigned char const *)arg3,arg4,arg5,arg6);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_ec_public_key_bip341_tweak(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  uint32_t arg5 ;
  unsigned char *arg6 = (unsigned char *) 0 ;
  size_t arg7 ;
  unsigned int val5 ;
  int ecode5 = 0 ;
  PyObject *swig_obj[4] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "ec_public_key_bip341_tweak", 4, 4, swig_obj)) SWIG_fail;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "ec_public_key_bip341_tweak" "', argument " "1"" of type '" "(const unsigned char* pub_key, size_t pub_key_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "ec_public_key_bip341_tweak" "', argument " "3"" of type '" "(const unsigned char* merkle_root, size_t merkle_root_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  ecode5 = SWIG_AsVal_unsigned_SS_int(swig_obj[2], &val5);
  if (!SWIG_IsOK(ecode5)) {
    SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "ec_public_key_bip341_tweak" "', argument " "5"" of type '" "uint32_t""'");
  } 
  arg5 = (uint32_t)(val5);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[3], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "ec_public_key_bip341_tweak" "', argument " "6"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg6 = (unsigned char *) buf;
    arg7 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_ec_public_key_bip341_tweak((unsigned char const *)arg1,arg2,(unsigned char const *)arg3,arg4,arg5,arg6,arg7);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_ec_private_key_bip341_tweak(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  uint32_t arg5 ;
  unsigned char *arg6 = (unsigned char *) 0 ;
  size_t arg7 ;
  unsigned int val5 ;
  int ecode5 = 0 ;
  PyObject *swig_obj[4] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "ec_private_key_bip341_tweak", 4, 4, swig_obj)) SWIG_fail;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "ec_private_key_bip341_tweak" "', argument " "1"" of type '" "(const unsigned char* priv_key, size_t priv_key_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "ec_private_key_bip341_tweak" "', argument " "3"" of type '" "(const unsigned char* merkle_root, size_t merkle_root_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  ecode5 = SWIG_AsVal_unsigned_SS_int(swig_obj[2], &val5);
  if (!SWIG_IsOK(ecode5)) {
    SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "ec_private_key_bip341_tweak" "', argument " "5"" of type '" "uint32_t""'");
  } 
  arg5 = (uint32_t)(val5);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[3], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "ec_private_key_bip341_tweak" "', argument " "6"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg6 = (unsigned char *) buf;
    arg7 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_ec_private_key_bip341_tweak((unsigned char const *)arg1,arg2,(unsigned char const *)arg3,arg4,arg5,arg6,arg7);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_ec_sig_from_bytes_len(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  uint32_t arg5 ;
  size_t *arg6 = (size_t *) 0 ;
  unsigned int val5 ;
  int ecode5 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  size_t written = 0; arg6 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "ec_sig_from_bytes_len", 3, 3, swig_obj)) SWIG_fail;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "ec_sig_from_bytes_len" "', argument " "1"" of type '" "(const unsigned char* priv_key, size_t priv_key_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "ec_sig_from_bytes_len" "', argument " "3"" of type '" "(const unsigned char* bytes, size_t bytes_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  ecode5 = SWIG_AsVal_unsigned_SS_int(swig_obj[2], &val5);
  if (!SWIG_IsOK(ecode5)) {
    SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "ec_sig_from_bytes_len" "', argument " "5"" of type '" "uint32_t""'");
  } 
  arg5 = (uint32_t)(val5);
  {
    result = (int)wally_ec_sig_from_bytes_len((unsigned char const *)arg1,arg2,(unsigned char const *)arg3,arg4,arg5,arg6);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg6);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_ec_sig_from_bytes(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  uint32_t arg5 ;
  unsigned char *arg6 = (unsigned char *) 0 ;
  size_t arg7 ;
  unsigned int val5 ;
  int ecode5 = 0 ;
  PyObject *swig_obj[4] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "ec_sig_from_bytes", 4, 4, swig_obj)) SWIG_fail;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "ec_sig_from_bytes" "', argument " "1"" of type '" "(const unsigned char* priv_key, size_t priv_key_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "ec_sig_from_bytes" "', argument " "3"" of type '" "(const unsigned char* bytes, size_t bytes_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  ecode5 = SWIG_AsVal_unsigned_SS_int(swig_obj[2], &val5);
  if (!SWIG_IsOK(ecode5)) {
    SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "ec_sig_from_bytes" "', argument " "5"" of type '" "uint32_t""'");
  } 
  arg5 = (uint32_t)(val5);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[3], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "ec_sig_from_bytes" "', argument " "6"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg6 = (unsigned char *) buf;
    arg7 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_ec_sig_from_bytes((unsigned char const *)arg1,arg2,(unsigned char const *)arg3,arg4,arg5,arg6,arg7);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_ec_sig_from_bytes_aux_len(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  unsigned char *arg5 = (unsigned char *) 0 ;
  size_t arg6 ;
  uint32_t arg7 ;
  size_t *arg8 = (size_t *) 0 ;
  unsigned int val7 ;
  int ecode7 = 0 ;
  PyObject *swig_obj[4] ;
  int result;
  
  size_t written = 0; arg8 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "ec_sig_from_bytes_aux_len", 4, 4, swig_obj)) SWIG_fail;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "ec_sig_from_bytes_aux_len" "', argument " "1"" of type '" "(const unsigned char* priv_key, size_t priv_key_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "ec_sig_from_bytes_aux_len" "', argument " "3"" of type '" "(const unsigned char* bytes, size_t bytes_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[2] == Py_None)
    arg6 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "ec_sig_from_bytes_aux_len" "', argument " "5"" of type '" "(const unsigned char* aux_rand, size_t aux_rand_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg5 = (unsigned char *) buf;
      arg6 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  ecode7 = SWIG_AsVal_unsigned_SS_int(swig_obj[3], &val7);
  if (!SWIG_IsOK(ecode7)) {
    SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "ec_sig_from_bytes_aux_len" "', argument " "7"" of type '" "uint32_t""'");
  } 
  arg7 = (uint32_t)(val7);
  {
    result = (int)wally_ec_sig_from_bytes_aux_len((unsigned char const *)arg1,arg2,(unsigned char const *)arg3,arg4,(unsigned char const *)arg5,arg6,arg7,arg8);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg8);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_ec_sig_from_bytes_aux(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  unsigned char *arg5 = (unsigned char *) 0 ;
  size_t arg6 ;
  uint32_t arg7 ;
  unsigned char *arg8 = (unsigned char *) 0 ;
  size_t arg9 ;
  unsigned int val7 ;
  int ecode7 = 0 ;
  PyObject *swig_obj[5] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "ec_sig_from_bytes_aux", 5, 5, swig_obj)) SWIG_fail;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "ec_sig_from_bytes_aux" "', argument " "1"" of type '" "(const unsigned char* priv_key, size_t priv_key_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "ec_sig_from_bytes_aux" "', argument " "3"" of type '" "(const unsigned char* bytes, size_t bytes_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[2] == Py_None)
    arg6 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "ec_sig_from_bytes_aux" "', argument " "5"" of type '" "(const unsigned char* aux_rand, size_t aux_rand_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg5 = (unsigned char *) buf;
      arg6 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  ecode7 = SWIG_AsVal_unsigned_SS_int(swig_obj[3], &val7);
  if (!SWIG_IsOK(ecode7)) {
    SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "ec_sig_from_bytes_aux" "', argument " "7"" of type '" "uint32_t""'");
  } 
  arg7 = (uint32_t)(val7);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[4], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "ec_sig_from_bytes_aux" "', argument " "8"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg8 = (unsigned char *) buf;
    arg9 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_ec_sig_from_bytes_aux((unsigned char const *)arg1,arg2,(unsigned char const *)arg3,arg4,(unsigned char const *)arg5,arg6,arg7,arg8,arg9);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_ec_sig_normalize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "ec_sig_normalize", 2, 2, swig_obj)) SWIG_fail;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "ec_sig_normalize" "', argument " "1"" of type '" "(const unsigned char* sig, size_t sig_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "ec_sig_normalize" "', argument " "3"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg3 = (unsigned char *) buf;
    arg4 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_ec_sig_normalize((unsigned char const *)arg1,arg2,arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_ec_sig_to_der(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t *arg5 = (size_t *) 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg5 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "ec_sig_to_der", 2, 2, swig_obj)) SWIG_fail;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "ec_sig_to_der" "', argument " "1"" of type '" "(const unsigned char* sig, size_t sig_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "ec_sig_to_der" "', argument " "3"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg3 = (unsigned char *) buf;
    arg4 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_ec_sig_to_der((unsigned char const *)arg1,arg2,arg3,arg4,arg5);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg5);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_ec_sig_from_der(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "ec_sig_from_der", 2, 2, swig_obj)) SWIG_fail;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "ec_sig_from_der" "', argument " "1"" of type '" "(const unsigned char* bytes, size_t bytes_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "ec_sig_from_der" "', argument " "3"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg3 = (unsigned char *) buf;
    arg4 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_ec_sig_from_der((unsigned char const *)arg1,arg2,arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_ec_sig_verify(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  uint32_t arg5 ;
  unsigned char *arg6 = (unsigned char *) 0 ;
  size_t arg7 ;
  unsigned int val5 ;
  int ecode5 = 0 ;
  PyObject *swig_obj[4] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "ec_sig_verify", 4, 4, swig_obj)) SWIG_fail;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "ec_sig_verify" "', argument " "1"" of type '" "(const unsigned char* pub_key, size_t pub_key_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "ec_sig_verify" "', argument " "3"" of type '" "(const unsigned char* bytes, size_t bytes_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  ecode5 = SWIG_AsVal_unsigned_SS_int(swig_obj[2], &val5);
  if (!SWIG_IsOK(ecode5)) {
    SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "ec_sig_verify" "', argument " "5"" of type '" "uint32_t""'");
  } 
  arg5 = (uint32_t)(val5);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[3] == Py_None)
    arg7 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[3], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "ec_sig_verify" "', argument " "6"" of type '" "(const unsigned char* sig, size_t sig_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg6 = (unsigned char *) buf;
      arg7 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_ec_sig_verify((unsigned char const *)arg1,arg2,(unsigned char const *)arg3,arg4,arg5,(unsigned char const *)arg6,arg7);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_ec_sig_to_public_key(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  unsigned char *arg5 = (unsigned char *) 0 ;
  size_t arg6 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "ec_sig_to_public_key", 3, 3, swig_obj)) SWIG_fail;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "ec_sig_to_public_key" "', argument " "1"" of type '" "(const unsigned char* bytes, size_t bytes_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "ec_sig_to_public_key" "', argument " "3"" of type '" "(const unsigned char* sig, size_t sig_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "ec_sig_to_public_key" "', argument " "5"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg5 = (unsigned char *) buf;
    arg6 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_ec_sig_to_public_key((unsigned char const *)arg1,arg2,(unsigned char const *)arg3,arg4,arg5,arg6);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_ec_scalar_verify(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  PyObject *swig_obj[1] ;
  int result;
  
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "ec_scalar_verify" "', argument " "1"" of type '" "(const unsigned char* scalar, size_t scalar_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_ec_scalar_verify((unsigned char const *)arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_ec_scalar_add(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  unsigned char *arg5 = (unsigned char *) 0 ;
  size_t arg6 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "ec_scalar_add", 3, 3, swig_obj)) SWIG_fail;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "ec_scalar_add" "', argument " "1"" of type '" "(const unsigned char* scalar, size_t scalar_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "ec_scalar_add" "', argument " "3"" of type '" "(const unsigned char* operand, size_t operand_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "ec_scalar_add" "', argument " "5"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg5 = (unsigned char *) buf;
    arg6 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_ec_scalar_add((unsigned char const *)arg1,arg2,(unsigned char const *)arg3,arg4,arg5,arg6);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_ec_scalar_subtract(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  unsigned char *arg5 = (unsigned char *) 0 ;
  size_t arg6 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "ec_scalar_subtract", 3, 3, swig_obj)) SWIG_fail;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "ec_scalar_subtract" "', argument " "1"" of type '" "(const unsigned char* scalar, size_t scalar_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "ec_scalar_subtract" "', argument " "3"" of type '" "(const unsigned char* operand, size_t operand_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "ec_scalar_subtract" "', argument " "5"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg5 = (unsigned char *) buf;
    arg6 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_ec_scalar_subtract((unsigned char const *)arg1,arg2,(unsigned char const *)arg3,arg4,arg5,arg6);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_ec_scalar_multiply(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  unsigned char *arg5 = (unsigned char *) 0 ;
  size_t arg6 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "ec_scalar_multiply", 3, 3, swig_obj)) SWIG_fail;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "ec_scalar_multiply" "', argument " "1"" of type '" "(const unsigned char* scalar, size_t scalar_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "ec_scalar_multiply" "', argument " "3"" of type '" "(const unsigned char* operand, size_t operand_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "ec_scalar_multiply" "', argument " "5"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg5 = (unsigned char *) buf;
    arg6 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_ec_scalar_multiply((unsigned char const *)arg1,arg2,(unsigned char const *)arg3,arg4,arg5,arg6);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_format_bitcoin_message(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  uint32_t arg3 ;
  unsigned char *arg4 = (unsigned char *) 0 ;
  size_t arg5 ;
  size_t *arg6 = (size_t *) 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  size_t written = 0; arg6 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "format_bitcoin_message", 3, 3, swig_obj)) SWIG_fail;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "format_bitcoin_message" "', argument " "1"" of type '" "(const unsigned char* bytes, size_t bytes_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  ecode3 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "format_bitcoin_message" "', argument " "3"" of type '" "uint32_t""'");
  } 
  arg3 = (uint32_t)(val3);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "format_bitcoin_message" "', argument " "4"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg4 = (unsigned char *) buf;
    arg5 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_format_bitcoin_message((unsigned char const *)arg1,arg2,arg3,arg4,arg5,arg6);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg6);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_ecdh(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  unsigned char *arg5 = (unsigned char *) 0 ;
  size_t arg6 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "ecdh", 3, 3, swig_obj)) SWIG_fail;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "ecdh" "', argument " "1"" of type '" "(const unsigned char* pub_key, size_t pub_key_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "ecdh" "', argument " "3"" of type '" "(const unsigned char* priv_key, size_t priv_key_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "ecdh" "', argument " "5"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg5 = (unsigned char *) buf;
    arg6 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_ecdh((unsigned char const *)arg1,arg2,(unsigned char const *)arg3,arg4,arg5,arg6);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_s2c_sig_from_bytes(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  unsigned char *arg5 = (unsigned char *) 0 ;
  size_t arg6 ;
  uint32_t arg7 ;
  unsigned char *arg8 = (unsigned char *) 0 ;
  size_t arg9 ;
  unsigned char *arg10 = (unsigned char *) 0 ;
  size_t arg11 ;
  unsigned int val7 ;
  int ecode7 = 0 ;
  PyObject *swig_obj[6] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "s2c_sig_from_bytes", 6, 6, swig_obj)) SWIG_fail;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "s2c_sig_from_bytes" "', argument " "1"" of type '" "(const unsigned char* priv_key, size_t priv_key_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "s2c_sig_from_bytes" "', argument " "3"" of type '" "(const unsigned char* bytes, size_t bytes_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[2] == Py_None)
    arg6 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "s2c_sig_from_bytes" "', argument " "5"" of type '" "(const unsigned char* s2c_data, size_t s2c_data_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg5 = (unsigned char *) buf;
      arg6 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  ecode7 = SWIG_AsVal_unsigned_SS_int(swig_obj[3], &val7);
  if (!SWIG_IsOK(ecode7)) {
    SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "s2c_sig_from_bytes" "', argument " "7"" of type '" "uint32_t""'");
  } 
  arg7 = (uint32_t)(val7);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[4], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "s2c_sig_from_bytes" "', argument " "8"" of type '" "(unsigned char* s2c_opening_out, size_t s2c_opening_out_len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg8 = (unsigned char *) buf;
    arg9 = (size_t) (size/sizeof(unsigned char));
  }
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[5], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "s2c_sig_from_bytes" "', argument " "10"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg10 = (unsigned char *) buf;
    arg11 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_s2c_sig_from_bytes((unsigned char const *)arg1,arg2,(unsigned char const *)arg3,arg4,(unsigned char const *)arg5,arg6,arg7,arg8,arg9,arg10,arg11);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_s2c_commitment_verify(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  unsigned char *arg5 = (unsigned char *) 0 ;
  size_t arg6 ;
  uint32_t arg7 ;
  unsigned int val7 ;
  int ecode7 = 0 ;
  PyObject *swig_obj[4] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "s2c_commitment_verify", 4, 4, swig_obj)) SWIG_fail;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "s2c_commitment_verify" "', argument " "1"" of type '" "(const unsigned char* sig, size_t sig_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "s2c_commitment_verify" "', argument " "3"" of type '" "(const unsigned char* s2c_data, size_t s2c_data_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[2] == Py_None)
    arg6 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "s2c_commitment_verify" "', argument " "5"" of type '" "(const unsigned char* s2c_opening, size_t s2c_opening_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg5 = (unsigned char *) buf;
      arg6 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  ecode7 = SWIG_AsVal_unsigned_SS_int(swig_obj[3], &val7);
  if (!SWIG_IsOK(ecode7)) {
    SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "s2c_commitment_verify" "', argument " "7"" of type '" "uint32_t""'");
  } 
  arg7 = (uint32_t)(val7);
  {
    result = (int)wally_s2c_commitment_verify((unsigned char const *)arg1,arg2,(unsigned char const *)arg3,arg4,(unsigned char const *)arg5,arg6,arg7);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_aes_cbc_with_ecdh_key_get_maximum_length(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  unsigned char *arg5 = (unsigned char *) 0 ;
  size_t arg6 ;
  unsigned char *arg7 = (unsigned char *) 0 ;
  size_t arg8 ;
  unsigned char *arg9 = (unsigned char *) 0 ;
  size_t arg10 ;
  uint32_t arg11 ;
  size_t *arg12 = (size_t *) 0 ;
  unsigned int val11 ;
  int ecode11 = 0 ;
  PyObject *swig_obj[6] ;
  int result;
  
  size_t written = 0; arg12 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "aes_cbc_with_ecdh_key_get_maximum_length", 6, 6, swig_obj)) SWIG_fail;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "aes_cbc_with_ecdh_key_get_maximum_length" "', argument " "1"" of type '" "(const unsigned char* priv_key, size_t priv_key_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "aes_cbc_with_ecdh_key_get_maximum_length" "', argument " "3"" of type '" "(const unsigned char* iv, size_t iv_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[2] == Py_None)
    arg6 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "aes_cbc_with_ecdh_key_get_maximum_length" "', argument " "5"" of type '" "(const unsigned char* bytes, size_t bytes_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg5 = (unsigned char *) buf;
      arg6 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[3] == Py_None)
    arg8 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[3], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "aes_cbc_with_ecdh_key_get_maximum_length" "', argument " "7"" of type '" "(const unsigned char* pub_key, size_t pub_key_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg7 = (unsigned char *) buf;
      arg8 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[4] == Py_None)
    arg10 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[4], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "aes_cbc_with_ecdh_key_get_maximum_length" "', argument " "9"" of type '" "(const unsigned char* label, size_t label_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg9 = (unsigned char *) buf;
      arg10 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  ecode11 = SWIG_AsVal_unsigned_SS_int(swig_obj[5], &val11);
  if (!SWIG_IsOK(ecode11)) {
    SWIG_exception_fail(SWIG_ArgError(ecode11), "in method '" "aes_cbc_with_ecdh_key_get_maximum_length" "', argument " "11"" of type '" "uint32_t""'");
  } 
  arg11 = (uint32_t)(val11);
  {
    result = (int)wally_aes_cbc_with_ecdh_key_get_maximum_length((unsigned char const *)arg1,arg2,(unsigned char const *)arg3,arg4,(unsigned char const *)arg5,arg6,(unsigned char const *)arg7,arg8,(unsigned char const *)arg9,arg10,arg11,arg12);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg12);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_aes_cbc_with_ecdh_key(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  unsigned char *arg5 = (unsigned char *) 0 ;
  size_t arg6 ;
  unsigned char *arg7 = (unsigned char *) 0 ;
  size_t arg8 ;
  unsigned char *arg9 = (unsigned char *) 0 ;
  size_t arg10 ;
  uint32_t arg11 ;
  unsigned char *arg12 = (unsigned char *) 0 ;
  size_t arg13 ;
  size_t *arg14 = (size_t *) 0 ;
  unsigned int val11 ;
  int ecode11 = 0 ;
  PyObject *swig_obj[7] ;
  int result;
  
  size_t written = 0; arg14 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "aes_cbc_with_ecdh_key", 7, 7, swig_obj)) SWIG_fail;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "aes_cbc_with_ecdh_key" "', argument " "1"" of type '" "(const unsigned char* priv_key, size_t priv_key_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "aes_cbc_with_ecdh_key" "', argument " "3"" of type '" "(const unsigned char* iv, size_t iv_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[2] == Py_None)
    arg6 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "aes_cbc_with_ecdh_key" "', argument " "5"" of type '" "(const unsigned char* bytes, size_t bytes_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg5 = (unsigned char *) buf;
      arg6 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[3] == Py_None)
    arg8 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[3], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "aes_cbc_with_ecdh_key" "', argument " "7"" of type '" "(const unsigned char* pub_key, size_t pub_key_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg7 = (unsigned char *) buf;
      arg8 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[4] == Py_None)
    arg10 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[4], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "aes_cbc_with_ecdh_key" "', argument " "9"" of type '" "(const unsigned char* label, size_t label_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg9 = (unsigned char *) buf;
      arg10 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  ecode11 = SWIG_AsVal_unsigned_SS_int(swig_obj[5], &val11);
  if (!SWIG_IsOK(ecode11)) {
    SWIG_exception_fail(SWIG_ArgError(ecode11), "in method '" "aes_cbc_with_ecdh_key" "', argument " "11"" of type '" "uint32_t""'");
  } 
  arg11 = (uint32_t)(val11);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[6], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "aes_cbc_with_ecdh_key" "', argument " "12"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg12 = (unsigned char *) buf;
    arg13 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_aes_cbc_with_ecdh_key((unsigned char const *)arg1,arg2,(unsigned char const *)arg3,arg4,(unsigned char const *)arg5,arg6,(unsigned char const *)arg7,arg8,(unsigned char const *)arg9,arg10,arg11,arg12,arg13,arg14);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg14);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_descriptor_parse(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  char *arg1 = (char *) 0 ;
  struct wally_map *arg2 = (struct wally_map *) 0 ;
  uint32_t arg3 ;
  uint32_t arg4 ;
  struct wally_descriptor **arg5 = (struct wally_descriptor **) 0 ;
  int res1 ;
  char *buf1 = 0 ;
  int alloc1 = 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  unsigned int val4 ;
  int ecode4 = 0 ;
  struct wally_descriptor *w5 ;
  PyObject *swig_obj[4] ;
  int result;
  
  {
    w5 = 0; arg5 = (struct wally_descriptor **)&w5;
  }
  if (!SWIG_Python_UnpackTuple(args, "descriptor_parse", 4, 4, swig_obj)) SWIG_fail;
  res1 = SWIG_AsCharPtrAndSize(swig_obj[0], &buf1, NULL, &alloc1);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "descriptor_parse" "', argument " "1"" of type '" "char const *""'");
  }
  arg1 = (char *)(buf1);
  {
    arg2 = swig_obj[1] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[1], "struct wally_map *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "descriptor_parse" "', argument " "2"" of type '" "(wally_map)""'");
    }
  }
  ecode3 = SWIG_AsVal_unsigned_SS_int(swig_obj[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "descriptor_parse" "', argument " "3"" of type '" "uint32_t""'");
  } 
  arg3 = (uint32_t)(val3);
  ecode4 = SWIG_AsVal_unsigned_SS_int(swig_obj[3], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "descriptor_parse" "', argument " "4"" of type '" "uint32_t""'");
  } 
  arg4 = (uint32_t)(val4);
  {
    result = (int)wally_descriptor_parse((char const *)arg1,(struct wally_map const *)arg2,arg3,arg4,arg5);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    if (*arg5 != NULL) {
      Py_DecRef(resultobj);
      resultobj = PyCapsule_New(*arg5, "struct wally_descriptor *", destroy_wally_descriptor);
    }
  }
  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
  return resultobj;
fail:
  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
  return NULL;
}


SWIGINTERN PyObject *_wrap_descriptor_free(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_descriptor *arg1 = (struct wally_descriptor *) 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_descriptor *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "descriptor_free" "', argument " "1"" of type '" "(wally_descriptor)""'");
    }
  }
  {
    result = (int)wally_descriptor_free(arg1);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_descriptor_canonicalize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_descriptor *arg1 = (struct wally_descriptor *) 0 ;
  uint32_t arg2 ;
  char **arg3 = (char **) 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  char *txt3 ;
  PyObject *swig_obj[2] ;
  int result;
  
  {
    txt3 = NULL;
    arg3 = (char **)&txt3;
  }
  if (!SWIG_Python_UnpackTuple(args, "descriptor_canonicalize", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_descriptor *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "descriptor_canonicalize" "', argument " "1"" of type '" "(wally_descriptor)""'");
    }
  }
  ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "descriptor_canonicalize" "', argument " "2"" of type '" "uint32_t""'");
  } 
  arg2 = (uint32_t)(val2);
  {
    result = (int)wally_descriptor_canonicalize((struct wally_descriptor const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    if (*arg3 != NULL) {
      Py_DecRef(resultobj);
      resultobj = PyString_FromString(*arg3);
      wally_free_string(*arg3);
    }
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_descriptor_get_checksum(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_descriptor *arg1 = (struct wally_descriptor *) 0 ;
  uint32_t arg2 ;
  char **arg3 = (char **) 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  char *txt3 ;
  PyObject *swig_obj[2] ;
  int result;
  
  {
    txt3 = NULL;
    arg3 = (char **)&txt3;
  }
  if (!SWIG_Python_UnpackTuple(args, "descriptor_get_checksum", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_descriptor *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "descriptor_get_checksum" "', argument " "1"" of type '" "(wally_descriptor)""'");
    }
  }
  ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "descriptor_get_checksum" "', argument " "2"" of type '" "uint32_t""'");
  } 
  arg2 = (uint32_t)(val2);
  {
    result = (int)wally_descriptor_get_checksum((struct wally_descriptor const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    if (*arg3 != NULL) {
      Py_DecRef(resultobj);
      resultobj = PyString_FromString(*arg3);
      wally_free_string(*arg3);
    }
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_descriptor_get_network(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_descriptor *arg1 = (struct wally_descriptor *) 0 ;
  uint32_t *arg2 = (uint32_t *) 0 ;
  uint32_t val2 ;
  PyObject *swig_obj[1] ;
  int result;
  
  {
    val2 = 0; arg2 = (uint32_t *)&val2;
  }
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_descriptor *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "descriptor_get_network" "', argument " "1"" of type '" "(wally_descriptor)""'");
    }
  }
  {
    result = (int)wally_descriptor_get_network((struct wally_descriptor const *)arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyLong_FromUnsignedLong(*arg2);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_descriptor_set_network(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_descriptor *arg1 = (struct wally_descriptor *) 0 ;
  uint32_t arg2 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "descriptor_set_network", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_descriptor *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "descriptor_set_network" "', argument " "1"" of type '" "(wally_descriptor)""'");
    }
  }
  ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "descriptor_set_network" "', argument " "2"" of type '" "uint32_t""'");
  } 
  arg2 = (uint32_t)(val2);
  {
    result = (int)wally_descriptor_set_network(arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_descriptor_get_features(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_descriptor *arg1 = (struct wally_descriptor *) 0 ;
  uint32_t *arg2 = (uint32_t *) 0 ;
  uint32_t val2 ;
  PyObject *swig_obj[1] ;
  int result;
  
  {
    val2 = 0; arg2 = (uint32_t *)&val2;
  }
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_descriptor *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "descriptor_get_features" "', argument " "1"" of type '" "(wally_descriptor)""'");
    }
  }
  {
    result = (int)wally_descriptor_get_features((struct wally_descriptor const *)arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyLong_FromUnsignedLong(*arg2);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_descriptor_get_num_variants(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_descriptor *arg1 = (struct wally_descriptor *) 0 ;
  uint32_t *arg2 = (uint32_t *) 0 ;
  uint32_t val2 ;
  PyObject *swig_obj[1] ;
  int result;
  
  {
    val2 = 0; arg2 = (uint32_t *)&val2;
  }
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_descriptor *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "descriptor_get_num_variants" "', argument " "1"" of type '" "(wally_descriptor)""'");
    }
  }
  {
    result = (int)wally_descriptor_get_num_variants((struct wally_descriptor const *)arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyLong_FromUnsignedLong(*arg2);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_descriptor_get_num_paths(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_descriptor *arg1 = (struct wally_descriptor *) 0 ;
  uint32_t *arg2 = (uint32_t *) 0 ;
  uint32_t val2 ;
  PyObject *swig_obj[1] ;
  int result;
  
  {
    val2 = 0; arg2 = (uint32_t *)&val2;
  }
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_descriptor *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "descriptor_get_num_paths" "', argument " "1"" of type '" "(wally_descriptor)""'");
    }
  }
  {
    result = (int)wally_descriptor_get_num_paths((struct wally_descriptor const *)arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyLong_FromUnsignedLong(*arg2);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_descriptor_get_depth(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_descriptor *arg1 = (struct wally_descriptor *) 0 ;
  uint32_t *arg2 = (uint32_t *) 0 ;
  uint32_t val2 ;
  PyObject *swig_obj[1] ;
  int result;
  
  {
    val2 = 0; arg2 = (uint32_t *)&val2;
  }
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_descriptor *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "descriptor_get_depth" "', argument " "1"" of type '" "(wally_descriptor)""'");
    }
  }
  {
    result = (int)wally_descriptor_get_depth((struct wally_descriptor const *)arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyLong_FromUnsignedLong(*arg2);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_descriptor_get_num_keys(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_descriptor *arg1 = (struct wally_descriptor *) 0 ;
  uint32_t *arg2 = (uint32_t *) 0 ;
  uint32_t val2 ;
  PyObject *swig_obj[1] ;
  int result;
  
  {
    val2 = 0; arg2 = (uint32_t *)&val2;
  }
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_descriptor *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "descriptor_get_num_keys" "', argument " "1"" of type '" "(wally_descriptor)""'");
    }
  }
  {
    result = (int)wally_descriptor_get_num_keys((struct wally_descriptor const *)arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyLong_FromUnsignedLong(*arg2);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_descriptor_get_key(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_descriptor *arg1 = (struct wally_descriptor *) 0 ;
  size_t arg2 ;
  char **arg3 = (char **) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  char *txt3 ;
  PyObject *swig_obj[2] ;
  int result;
  
  {
    txt3 = NULL;
    arg3 = (char **)&txt3;
  }
  if (!SWIG_Python_UnpackTuple(args, "descriptor_get_key", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_descriptor *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "descriptor_get_key" "', argument " "1"" of type '" "(wally_descriptor)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "descriptor_get_key" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_descriptor_get_key((struct wally_descriptor const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    if (*arg3 != NULL) {
      Py_DecRef(resultobj);
      resultobj = PyString_FromString(*arg3);
      wally_free_string(*arg3);
    }
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_descriptor_get_key_features(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_descriptor *arg1 = (struct wally_descriptor *) 0 ;
  size_t arg2 ;
  uint32_t *arg3 = (uint32_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  uint32_t val3 ;
  PyObject *swig_obj[2] ;
  int result;
  
  {
    val3 = 0; arg3 = (uint32_t *)&val3;
  }
  if (!SWIG_Python_UnpackTuple(args, "descriptor_get_key_features", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_descriptor *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "descriptor_get_key_features" "', argument " "1"" of type '" "(wally_descriptor)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "descriptor_get_key_features" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_descriptor_get_key_features((struct wally_descriptor const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyLong_FromUnsignedLong(*arg3);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_descriptor_get_key_child_path_str_len(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_descriptor *arg1 = (struct wally_descriptor *) 0 ;
  size_t arg2 ;
  size_t *arg3 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg3 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "descriptor_get_key_child_path_str_len", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_descriptor *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "descriptor_get_key_child_path_str_len" "', argument " "1"" of type '" "(wally_descriptor)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "descriptor_get_key_child_path_str_len" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_descriptor_get_key_child_path_str_len((struct wally_descriptor const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg3);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_descriptor_get_key_child_path_str(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_descriptor *arg1 = (struct wally_descriptor *) 0 ;
  size_t arg2 ;
  char **arg3 = (char **) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  char *txt3 ;
  PyObject *swig_obj[2] ;
  int result;
  
  {
    txt3 = NULL;
    arg3 = (char **)&txt3;
  }
  if (!SWIG_Python_UnpackTuple(args, "descriptor_get_key_child_path_str", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_descriptor *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "descriptor_get_key_child_path_str" "', argument " "1"" of type '" "(wally_descriptor)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "descriptor_get_key_child_path_str" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_descriptor_get_key_child_path_str((struct wally_descriptor const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    if (*arg3 != NULL) {
      Py_DecRef(resultobj);
      resultobj = PyString_FromString(*arg3);
      wally_free_string(*arg3);
    }
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_descriptor_get_key_origin_fingerprint(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_descriptor *arg1 = (struct wally_descriptor *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "descriptor_get_key_origin_fingerprint", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_descriptor *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "descriptor_get_key_origin_fingerprint" "', argument " "1"" of type '" "(wally_descriptor)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "descriptor_get_key_origin_fingerprint" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "descriptor_get_key_origin_fingerprint" "', argument " "3"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg3 = (unsigned char *) buf;
    arg4 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_descriptor_get_key_origin_fingerprint((struct wally_descriptor const *)arg1,arg2,arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_descriptor_get_key_origin_path_str_len(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_descriptor *arg1 = (struct wally_descriptor *) 0 ;
  size_t arg2 ;
  size_t *arg3 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg3 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "descriptor_get_key_origin_path_str_len", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_descriptor *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "descriptor_get_key_origin_path_str_len" "', argument " "1"" of type '" "(wally_descriptor)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "descriptor_get_key_origin_path_str_len" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_descriptor_get_key_origin_path_str_len((struct wally_descriptor const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg3);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_descriptor_get_key_origin_path_str(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_descriptor *arg1 = (struct wally_descriptor *) 0 ;
  size_t arg2 ;
  char **arg3 = (char **) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  char *txt3 ;
  PyObject *swig_obj[2] ;
  int result;
  
  {
    txt3 = NULL;
    arg3 = (char **)&txt3;
  }
  if (!SWIG_Python_UnpackTuple(args, "descriptor_get_key_origin_path_str", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_descriptor *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "descriptor_get_key_origin_path_str" "', argument " "1"" of type '" "(wally_descriptor)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "descriptor_get_key_origin_path_str" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_descriptor_get_key_origin_path_str((struct wally_descriptor const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    if (*arg3 != NULL) {
      Py_DecRef(resultobj);
      resultobj = PyString_FromString(*arg3);
      wally_free_string(*arg3);
    }
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_descriptor_to_script_get_maximum_length(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_descriptor *arg1 = (struct wally_descriptor *) 0 ;
  uint32_t arg2 ;
  uint32_t arg3 ;
  uint32_t arg4 ;
  uint32_t arg5 ;
  uint32_t arg6 ;
  uint32_t arg7 ;
  size_t *arg8 = (size_t *) 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  unsigned int val4 ;
  int ecode4 = 0 ;
  unsigned int val5 ;
  int ecode5 = 0 ;
  unsigned int val6 ;
  int ecode6 = 0 ;
  unsigned int val7 ;
  int ecode7 = 0 ;
  PyObject *swig_obj[7] ;
  int result;
  
  size_t written = 0; arg8 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "descriptor_to_script_get_maximum_length", 7, 7, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_descriptor *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "descriptor_to_script_get_maximum_length" "', argument " "1"" of type '" "(wally_descriptor)""'");
    }
  }
  ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "descriptor_to_script_get_maximum_length" "', argument " "2"" of type '" "uint32_t""'");
  } 
  arg2 = (uint32_t)(val2);
  ecode3 = SWIG_AsVal_unsigned_SS_int(swig_obj[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "descriptor_to_script_get_maximum_length" "', argument " "3"" of type '" "uint32_t""'");
  } 
  arg3 = (uint32_t)(val3);
  ecode4 = SWIG_AsVal_unsigned_SS_int(swig_obj[3], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "descriptor_to_script_get_maximum_length" "', argument " "4"" of type '" "uint32_t""'");
  } 
  arg4 = (uint32_t)(val4);
  ecode5 = SWIG_AsVal_unsigned_SS_int(swig_obj[4], &val5);
  if (!SWIG_IsOK(ecode5)) {
    SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "descriptor_to_script_get_maximum_length" "', argument " "5"" of type '" "uint32_t""'");
  } 
  arg5 = (uint32_t)(val5);
  ecode6 = SWIG_AsVal_unsigned_SS_int(swig_obj[5], &val6);
  if (!SWIG_IsOK(ecode6)) {
    SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "descriptor_to_script_get_maximum_length" "', argument " "6"" of type '" "uint32_t""'");
  } 
  arg6 = (uint32_t)(val6);
  ecode7 = SWIG_AsVal_unsigned_SS_int(swig_obj[6], &val7);
  if (!SWIG_IsOK(ecode7)) {
    SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "descriptor_to_script_get_maximum_length" "', argument " "7"" of type '" "uint32_t""'");
  } 
  arg7 = (uint32_t)(val7);
  {
    result = (int)wally_descriptor_to_script_get_maximum_length((struct wally_descriptor const *)arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg8);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_descriptor_to_script(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_descriptor *arg1 = (struct wally_descriptor *) 0 ;
  uint32_t arg2 ;
  uint32_t arg3 ;
  uint32_t arg4 ;
  uint32_t arg5 ;
  uint32_t arg6 ;
  uint32_t arg7 ;
  unsigned char *arg8 = (unsigned char *) 0 ;
  size_t arg9 ;
  size_t *arg10 = (size_t *) 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  unsigned int val4 ;
  int ecode4 = 0 ;
  unsigned int val5 ;
  int ecode5 = 0 ;
  unsigned int val6 ;
  int ecode6 = 0 ;
  unsigned int val7 ;
  int ecode7 = 0 ;
  PyObject *swig_obj[8] ;
  int result;
  
  size_t written = 0; arg10 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "descriptor_to_script", 8, 8, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_descriptor *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "descriptor_to_script" "', argument " "1"" of type '" "(wally_descriptor)""'");
    }
  }
  ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "descriptor_to_script" "', argument " "2"" of type '" "uint32_t""'");
  } 
  arg2 = (uint32_t)(val2);
  ecode3 = SWIG_AsVal_unsigned_SS_int(swig_obj[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "descriptor_to_script" "', argument " "3"" of type '" "uint32_t""'");
  } 
  arg3 = (uint32_t)(val3);
  ecode4 = SWIG_AsVal_unsigned_SS_int(swig_obj[3], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "descriptor_to_script" "', argument " "4"" of type '" "uint32_t""'");
  } 
  arg4 = (uint32_t)(val4);
  ecode5 = SWIG_AsVal_unsigned_SS_int(swig_obj[4], &val5);
  if (!SWIG_IsOK(ecode5)) {
    SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "descriptor_to_script" "', argument " "5"" of type '" "uint32_t""'");
  } 
  arg5 = (uint32_t)(val5);
  ecode6 = SWIG_AsVal_unsigned_SS_int(swig_obj[5], &val6);
  if (!SWIG_IsOK(ecode6)) {
    SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "descriptor_to_script" "', argument " "6"" of type '" "uint32_t""'");
  } 
  arg6 = (uint32_t)(val6);
  ecode7 = SWIG_AsVal_unsigned_SS_int(swig_obj[6], &val7);
  if (!SWIG_IsOK(ecode7)) {
    SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "descriptor_to_script" "', argument " "7"" of type '" "uint32_t""'");
  } 
  arg7 = (uint32_t)(val7);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[7], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "descriptor_to_script" "', argument " "8"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg8 = (unsigned char *) buf;
    arg9 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_descriptor_to_script((struct wally_descriptor const *)arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg10);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_descriptor_to_address(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_descriptor *arg1 = (struct wally_descriptor *) 0 ;
  uint32_t arg2 ;
  uint32_t arg3 ;
  uint32_t arg4 ;
  uint32_t arg5 ;
  char **arg6 = (char **) 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  unsigned int val4 ;
  int ecode4 = 0 ;
  unsigned int val5 ;
  int ecode5 = 0 ;
  char *txt6 ;
  PyObject *swig_obj[5] ;
  int result;
  
  {
    txt6 = NULL;
    arg6 = (char **)&txt6;
  }
  if (!SWIG_Python_UnpackTuple(args, "descriptor_to_address", 5, 5, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_descriptor *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "descriptor_to_address" "', argument " "1"" of type '" "(wally_descriptor)""'");
    }
  }
  ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "descriptor_to_address" "', argument " "2"" of type '" "uint32_t""'");
  } 
  arg2 = (uint32_t)(val2);
  ecode3 = SWIG_AsVal_unsigned_SS_int(swig_obj[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "descriptor_to_address" "', argument " "3"" of type '" "uint32_t""'");
  } 
  arg3 = (uint32_t)(val3);
  ecode4 = SWIG_AsVal_unsigned_SS_int(swig_obj[3], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "descriptor_to_address" "', argument " "4"" of type '" "uint32_t""'");
  } 
  arg4 = (uint32_t)(val4);
  ecode5 = SWIG_AsVal_unsigned_SS_int(swig_obj[4], &val5);
  if (!SWIG_IsOK(ecode5)) {
    SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "descriptor_to_address" "', argument " "5"" of type '" "uint32_t""'");
  } 
  arg5 = (uint32_t)(val5);
  {
    result = (int)wally_descriptor_to_address((struct wally_descriptor const *)arg1,arg2,arg3,arg4,arg5,arg6);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    if (*arg6 != NULL) {
      Py_DecRef(resultobj);
      resultobj = PyString_FromString(*arg6);
      wally_free_string(*arg6);
    }
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_descriptor_to_addresses(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_descriptor *arg1 = (struct wally_descriptor *) 0 ;
  uint32_t arg2 ;
  uint32_t arg3 ;
  uint32_t arg4 ;
  uint32_t arg5 ;
  char **arg6 = (char **) 0 ;
  size_t arg7 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  unsigned int val4 ;
  int ecode4 = 0 ;
  unsigned int val5 ;
  int ecode5 = 0 ;
  PyObject *swig_obj[6] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "descriptor_to_addresses", 6, 6, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_descriptor *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "descriptor_to_addresses" "', argument " "1"" of type '" "(wally_descriptor)""'");
    }
  }
  ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "descriptor_to_addresses" "', argument " "2"" of type '" "uint32_t""'");
  } 
  arg2 = (uint32_t)(val2);
  ecode3 = SWIG_AsVal_unsigned_SS_int(swig_obj[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "descriptor_to_addresses" "', argument " "3"" of type '" "uint32_t""'");
  } 
  arg3 = (uint32_t)(val3);
  ecode4 = SWIG_AsVal_unsigned_SS_int(swig_obj[3], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "descriptor_to_addresses" "', argument " "4"" of type '" "uint32_t""'");
  } 
  arg4 = (uint32_t)(val4);
  ecode5 = SWIG_AsVal_unsigned_SS_int(swig_obj[4], &val5);
  if (!SWIG_IsOK(ecode5)) {
    SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "descriptor_to_addresses" "', argument " "5"" of type '" "uint32_t""'");
  } 
  arg5 = (uint32_t)(val5);
  {
    if (!size_t_cast(swig_obj[5], &arg7)) {
      PyErr_SetString(PyExc_OverflowError, "Invalid output size");
      SWIG_fail;
    }
    arg6 = (void *) wally_malloc(arg7 * sizeof(char*));
  }
  {
    result = (int)wally_descriptor_to_addresses((struct wally_descriptor const *)arg1,arg2,arg3,arg4,arg5,arg6,arg7);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    if (arg6 != NULL) {
      size_t i;
      Py_DecRef(resultobj);
      resultobj = PyList_New(arg7);
      for (i = 0; i < arg7; i++) {
        PyObject *s = PyString_FromString(arg6[i]);
        PyList_SetItem(resultobj, i, s);
        wally_free_string(arg6[i]);
      }
      wally_free(arg6);
    }
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_map_init_alloc(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  size_t arg1 ;
  wally_map_verify_fn_t arg2 = (wally_map_verify_fn_t) 0 ;
  struct wally_map **arg3 = (struct wally_map **) 0 ;
  size_t val1 ;
  int ecode1 = 0 ;
  int res2 ;
  struct wally_map *w3 ;
  PyObject *swig_obj[2] ;
  int result;
  
  {
    w3 = 0; arg3 = (struct wally_map **)&w3;
  }
  if (!SWIG_Python_UnpackTuple(args, "map_init_alloc", 2, 2, swig_obj)) SWIG_fail;
  ecode1 = SWIG_AsVal_size_t(swig_obj[0], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "map_init_alloc" "', argument " "1"" of type '" "size_t""'");
  } 
  arg1 = (size_t)(val1);
  res2 = SWIG_ConvertPtr(swig_obj[1],SWIG_as_voidptrptr(&arg2), 0, 0);
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "map_init_alloc" "', argument " "2"" of type '" "wally_map_verify_fn_t""'"); 
  }
  {
    result = (int)wally_map_init_alloc(arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    if (*arg3 != NULL) {
      Py_DecRef(resultobj);
      resultobj = PyCapsule_New(*arg3, "struct wally_map *", destroy_wally_map);
    }
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_map_free(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_map *arg1 = (struct wally_map *) 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_map *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "map_free" "', argument " "1"" of type '" "(wally_map)""'");
    }
  }
  {
    result = (int)wally_map_free(arg1);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_map_clear(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_map *arg1 = (struct wally_map *) 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_map *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "map_clear" "', argument " "1"" of type '" "(wally_map)""'");
    }
  }
  {
    result = (int)wally_map_clear(arg1);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_map_add(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_map *arg1 = (struct wally_map *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  unsigned char *arg4 = (unsigned char *) 0 ;
  size_t arg5 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "map_add", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_map *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "map_add" "', argument " "1"" of type '" "(wally_map)""'");
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg3 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "map_add" "', argument " "2"" of type '" "(const unsigned char* key, size_t key_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg2 = (unsigned char *) buf;
      arg3 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[2] == Py_None)
    arg5 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "map_add" "', argument " "4"" of type '" "(const unsigned char* value, size_t value_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg4 = (unsigned char *) buf;
      arg5 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_map_add(arg1,(unsigned char const *)arg2,arg3,(unsigned char const *)arg4,arg5);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_map_add_integer(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_map *arg1 = (struct wally_map *) 0 ;
  uint32_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "map_add_integer", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_map *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "map_add_integer" "', argument " "1"" of type '" "(wally_map)""'");
    }
  }
  ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "map_add_integer" "', argument " "2"" of type '" "uint32_t""'");
  } 
  arg2 = (uint32_t)(val2);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[2] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "map_add_integer" "', argument " "3"" of type '" "(const unsigned char* value, size_t value_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_map_add_integer(arg1,arg2,(unsigned char const *)arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_map_replace(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_map *arg1 = (struct wally_map *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  unsigned char *arg4 = (unsigned char *) 0 ;
  size_t arg5 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "map_replace", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_map *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "map_replace" "', argument " "1"" of type '" "(wally_map)""'");
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg3 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "map_replace" "', argument " "2"" of type '" "(const unsigned char* key, size_t key_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg2 = (unsigned char *) buf;
      arg3 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[2] == Py_None)
    arg5 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "map_replace" "', argument " "4"" of type '" "(const unsigned char* value, size_t value_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg4 = (unsigned char *) buf;
      arg5 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_map_replace(arg1,(unsigned char const *)arg2,arg3,(unsigned char const *)arg4,arg5);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_map_replace_integer(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_map *arg1 = (struct wally_map *) 0 ;
  uint32_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "map_replace_integer", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_map *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "map_replace_integer" "', argument " "1"" of type '" "(wally_map)""'");
    }
  }
  ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "map_replace_integer" "', argument " "2"" of type '" "uint32_t""'");
  } 
  arg2 = (uint32_t)(val2);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[2] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "map_replace_integer" "', argument " "3"" of type '" "(const unsigned char* value, size_t value_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_map_replace_integer(arg1,arg2,(unsigned char const *)arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_map_remove(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_map *arg1 = (struct wally_map *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "map_remove", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_map *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "map_remove" "', argument " "1"" of type '" "(wally_map)""'");
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg3 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "map_remove" "', argument " "2"" of type '" "(const unsigned char* key, size_t key_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg2 = (unsigned char *) buf;
      arg3 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_map_remove(arg1,(unsigned char const *)arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_map_remove_integer(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_map *arg1 = (struct wally_map *) 0 ;
  uint32_t arg2 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "map_remove_integer", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_map *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "map_remove_integer" "', argument " "1"" of type '" "(wally_map)""'");
    }
  }
  ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "map_remove_integer" "', argument " "2"" of type '" "uint32_t""'");
  } 
  arg2 = (uint32_t)(val2);
  {
    result = (int)wally_map_remove_integer(arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_map_find_from(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_map *arg1 = (struct wally_map *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t *arg5 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  size_t written = 0; arg5 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "map_find_from", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_map *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "map_find_from" "', argument " "1"" of type '" "(wally_map)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "map_find_from" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[2] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "map_find_from" "', argument " "3"" of type '" "(const unsigned char* key, size_t key_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_map_find_from((struct wally_map const *)arg1,arg2,(unsigned char const *)arg3,arg4,arg5);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg5);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_map_find(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_map *arg1 = (struct wally_map *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  size_t *arg4 = (size_t *) 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg4 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "map_find", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_map *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "map_find" "', argument " "1"" of type '" "(wally_map)""'");
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg3 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "map_find" "', argument " "2"" of type '" "(const unsigned char* key, size_t key_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg2 = (unsigned char *) buf;
      arg3 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_map_find((struct wally_map const *)arg1,(unsigned char const *)arg2,arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg4);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_map_find_integer(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_map *arg1 = (struct wally_map *) 0 ;
  uint32_t arg2 ;
  size_t *arg3 = (size_t *) 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg3 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "map_find_integer", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_map *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "map_find_integer" "', argument " "1"" of type '" "(wally_map)""'");
    }
  }
  ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "map_find_integer" "', argument " "2"" of type '" "uint32_t""'");
  } 
  arg2 = (uint32_t)(val2);
  {
    result = (int)wally_map_find_integer((struct wally_map const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg3);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_map_get_num_items(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_map *arg1 = (struct wally_map *) 0 ;
  size_t *arg2 = (size_t *) 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  size_t written = 0; arg2 = (size_t *)&written;
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_map *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "map_get_num_items" "', argument " "1"" of type '" "(wally_map)""'");
    }
  }
  {
    result = (int)wally_map_get_num_items((struct wally_map const *)arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg2);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_map_get_item_key_length(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_map *arg1 = (struct wally_map *) 0 ;
  size_t arg2 ;
  size_t *arg3 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg3 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "map_get_item_key_length", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_map *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "map_get_item_key_length" "', argument " "1"" of type '" "(wally_map)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "map_get_item_key_length" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_map_get_item_key_length((struct wally_map const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg3);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_map_get_item_key(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_map *arg1 = (struct wally_map *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t *arg5 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  size_t written = 0; arg5 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "map_get_item_key", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_map *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "map_get_item_key" "', argument " "1"" of type '" "(wally_map)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "map_get_item_key" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "map_get_item_key" "', argument " "3"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg3 = (unsigned char *) buf;
    arg4 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_map_get_item_key((struct wally_map const *)arg1,arg2,arg3,arg4,arg5);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg5);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_map_get_item_integer_key(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_map *arg1 = (struct wally_map *) 0 ;
  size_t arg2 ;
  size_t *arg3 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg3 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "map_get_item_integer_key", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_map *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "map_get_item_integer_key" "', argument " "1"" of type '" "(wally_map)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "map_get_item_integer_key" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_map_get_item_integer_key((struct wally_map const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg3);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_map_get_item_length(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_map *arg1 = (struct wally_map *) 0 ;
  size_t arg2 ;
  size_t *arg3 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg3 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "map_get_item_length", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_map *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "map_get_item_length" "', argument " "1"" of type '" "(wally_map)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "map_get_item_length" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_map_get_item_length((struct wally_map const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg3);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_map_get_item(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_map *arg1 = (struct wally_map *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t *arg5 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  size_t written = 0; arg5 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "map_get_item", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_map *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "map_get_item" "', argument " "1"" of type '" "(wally_map)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "map_get_item" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "map_get_item" "', argument " "3"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg3 = (unsigned char *) buf;
    arg4 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_map_get_item((struct wally_map const *)arg1,arg2,arg3,arg4,arg5);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg5);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_map_sort(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_map *arg1 = (struct wally_map *) 0 ;
  uint32_t arg2 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "map_sort", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_map *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "map_sort" "', argument " "1"" of type '" "(wally_map)""'");
    }
  }
  ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "map_sort" "', argument " "2"" of type '" "uint32_t""'");
  } 
  arg2 = (uint32_t)(val2);
  {
    result = (int)wally_map_sort(arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_map_combine(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_map *arg1 = (struct wally_map *) 0 ;
  struct wally_map *arg2 = (struct wally_map *) 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "map_combine", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_map *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "map_combine" "', argument " "1"" of type '" "(wally_map)""'");
    }
  }
  {
    arg2 = swig_obj[1] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[1], "struct wally_map *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "map_combine" "', argument " "2"" of type '" "(wally_map)""'");
    }
  }
  {
    result = (int)wally_map_combine(arg1,(struct wally_map const *)arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_map_assign(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_map *arg1 = (struct wally_map *) 0 ;
  struct wally_map *arg2 = (struct wally_map *) 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "map_assign", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_map *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "map_assign" "', argument " "1"" of type '" "(wally_map)""'");
    }
  }
  {
    arg2 = swig_obj[1] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[1], "struct wally_map *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "map_assign" "', argument " "2"" of type '" "(wally_map)""'");
    }
  }
  {
    result = (int)wally_map_assign(arg1,(struct wally_map const *)arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_map_find_bip32_public_key_from(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_map *arg1 = (struct wally_map *) 0 ;
  size_t arg2 ;
  struct ext_key *arg3 = (struct ext_key *) 0 ;
  size_t *arg4 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  size_t written = 0; arg4 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "map_find_bip32_public_key_from", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_map *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "map_find_bip32_public_key_from" "', argument " "1"" of type '" "(wally_map)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "map_find_bip32_public_key_from" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    arg3 = swig_obj[2] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[2], "struct ext_key *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "map_find_bip32_public_key_from" "', argument " "3"" of type '" "(ext_key)""'");
    }
  }
  {
    result = (int)wally_map_find_bip32_public_key_from((struct wally_map const *)arg1,arg2,(struct ext_key const *)arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg4);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_map_keypath_get_bip32_key_from_alloc(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_map *arg1 = (struct wally_map *) 0 ;
  size_t arg2 ;
  struct ext_key *arg3 = (struct ext_key *) 0 ;
  struct ext_key **arg4 = (struct ext_key **) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  struct ext_key *w4 ;
  PyObject *swig_obj[3] ;
  int result;
  
  {
    w4 = 0; arg4 = (struct ext_key **)&w4;
  }
  if (!SWIG_Python_UnpackTuple(args, "map_keypath_get_bip32_key_from_alloc", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_map *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "map_keypath_get_bip32_key_from_alloc" "', argument " "1"" of type '" "(wally_map)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "map_keypath_get_bip32_key_from_alloc" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    arg3 = swig_obj[2] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[2], "struct ext_key *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "map_keypath_get_bip32_key_from_alloc" "', argument " "3"" of type '" "(ext_key)""'");
    }
  }
  {
    result = (int)wally_map_keypath_get_bip32_key_from_alloc((struct wally_map const *)arg1,arg2,(struct ext_key const *)arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    if (*arg4 != NULL) {
      Py_DecRef(resultobj);
      resultobj = PyCapsule_New(*arg4, "struct ext_key *", destroy_ext_key);
    }
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_keypath_bip32_verify(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "keypath_bip32_verify", 2, 2, swig_obj)) SWIG_fail;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "keypath_bip32_verify" "', argument " "1"" of type '" "(const unsigned char* key, size_t key_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "keypath_bip32_verify" "', argument " "3"" of type '" "(const unsigned char* val, size_t val_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_keypath_bip32_verify((unsigned char const *)arg1,arg2,(unsigned char const *)arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_keypath_public_key_verify(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "keypath_public_key_verify", 2, 2, swig_obj)) SWIG_fail;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "keypath_public_key_verify" "', argument " "1"" of type '" "(const unsigned char* key, size_t key_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "keypath_public_key_verify" "', argument " "3"" of type '" "(const unsigned char* val, size_t val_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_keypath_public_key_verify((unsigned char const *)arg1,arg2,(unsigned char const *)arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_keypath_xonly_public_key_verify(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "keypath_xonly_public_key_verify", 2, 2, swig_obj)) SWIG_fail;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "keypath_xonly_public_key_verify" "', argument " "1"" of type '" "(const unsigned char* key, size_t key_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "keypath_xonly_public_key_verify" "', argument " "3"" of type '" "(const unsigned char* val, size_t val_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_keypath_xonly_public_key_verify((unsigned char const *)arg1,arg2,(unsigned char const *)arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_merkle_path_xonly_public_key_verify(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "merkle_path_xonly_public_key_verify", 2, 2, swig_obj)) SWIG_fail;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "merkle_path_xonly_public_key_verify" "', argument " "1"" of type '" "(const unsigned char* key, size_t key_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "merkle_path_xonly_public_key_verify" "', argument " "3"" of type '" "(const unsigned char* val, size_t val_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_merkle_path_xonly_public_key_verify((unsigned char const *)arg1,arg2,(unsigned char const *)arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_bip341_control_block_verify(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  PyObject *swig_obj[1] ;
  int result;
  
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "bip341_control_block_verify" "', argument " "1"" of type '" "(const unsigned char* bytes, size_t bytes_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_bip341_control_block_verify((unsigned char const *)arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_map_keypath_bip32_init_alloc(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  size_t arg1 ;
  struct wally_map **arg2 = (struct wally_map **) 0 ;
  size_t val1 ;
  int ecode1 = 0 ;
  struct wally_map *w2 ;
  PyObject *swig_obj[1] ;
  int result;
  
  {
    w2 = 0; arg2 = (struct wally_map **)&w2;
  }
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  ecode1 = SWIG_AsVal_size_t(swig_obj[0], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "map_keypath_bip32_init_alloc" "', argument " "1"" of type '" "size_t""'");
  } 
  arg1 = (size_t)(val1);
  {
    result = (int)wally_map_keypath_bip32_init_alloc(arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    if (*arg2 != NULL) {
      Py_DecRef(resultobj);
      resultobj = PyCapsule_New(*arg2, "struct wally_map *", destroy_wally_map);
    }
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_map_keypath_public_key_init_alloc(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  size_t arg1 ;
  struct wally_map **arg2 = (struct wally_map **) 0 ;
  size_t val1 ;
  int ecode1 = 0 ;
  struct wally_map *w2 ;
  PyObject *swig_obj[1] ;
  int result;
  
  {
    w2 = 0; arg2 = (struct wally_map **)&w2;
  }
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  ecode1 = SWIG_AsVal_size_t(swig_obj[0], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "map_keypath_public_key_init_alloc" "', argument " "1"" of type '" "size_t""'");
  } 
  arg1 = (size_t)(val1);
  {
    result = (int)wally_map_keypath_public_key_init_alloc(arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    if (*arg2 != NULL) {
      Py_DecRef(resultobj);
      resultobj = PyCapsule_New(*arg2, "struct wally_map *", destroy_wally_map);
    }
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_map_keypath_add(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_map *arg1 = (struct wally_map *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  unsigned char *arg4 = (unsigned char *) 0 ;
  size_t arg5 ;
  uint32_t *arg6 = (uint32_t *) 0 ;
  size_t arg7 ;
  uint32_t tmp_buf6[MAX_LOCAL_STACK/sizeof(uint32_t)] ;
  PyObject *swig_obj[4] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "map_keypath_add", 4, 4, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_map *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "map_keypath_add" "', argument " "1"" of type '" "(wally_map)""'");
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg3 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "map_keypath_add" "', argument " "2"" of type '" "(const unsigned char* pub_key, size_t pub_key_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg2 = (unsigned char *) buf;
      arg3 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[2] == Py_None)
    arg5 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "map_keypath_add" "', argument " "4"" of type '" "(const unsigned char* fingerprint, size_t fingerprint_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg4 = (unsigned char *) buf;
      arg5 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    size_t i;
    if (!PyList_Check(swig_obj[3])) {
      check_result(WALLY_EINVAL);
      SWIG_fail;
    }
    arg7 = PyList_Size(swig_obj[3]);
    arg6 = tmp_buf6;
    if (arg7 * sizeof(uint32_t) > sizeof(tmp_buf6))
    if (!(arg6 = (uint32_t *) wally_malloc((arg7) * sizeof(uint32_t)))) {
      check_result(WALLY_ENOMEM);
      SWIG_fail;
    }
    for (i = 0; i < arg7; ++i) {
      PyObject *item = PyList_GET_ITEM(swig_obj[3], i);
      unsigned long long v;
      if (!ulonglong_cast(item, &v) || v > 0xffffffffull) {
        PyErr_SetString(PyExc_OverflowError, "Invalid unsigned integer");
        SWIG_fail;
      }
      arg6[i] = (uint32_t)v;
    }
  }
  {
    result = (int)wally_map_keypath_add(arg1,(unsigned char const *)arg2,arg3,(unsigned char const *)arg4,arg5,(unsigned int const *)arg6,arg7);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    if (arg6 && arg6 != tmp_buf6)
    wally_free(arg6);
  }
  return resultobj;
fail:
  {
    if (arg6 && arg6 != tmp_buf6)
    wally_free(arg6);
  }
  return NULL;
}


SWIGINTERN PyObject *_wrap_map_merkle_path_add(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_map *arg1 = (struct wally_map *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  unsigned char *arg4 = (unsigned char *) 0 ;
  size_t arg5 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "map_merkle_path_add", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_map *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "map_merkle_path_add" "', argument " "1"" of type '" "(wally_map)""'");
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg3 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "map_merkle_path_add" "', argument " "2"" of type '" "(const unsigned char* pub_key, size_t pub_key_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg2 = (unsigned char *) buf;
      arg3 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[2] == Py_None)
    arg5 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "map_merkle_path_add" "', argument " "4"" of type '" "(const unsigned char* merkle_hashes, size_t merkle_hashes_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg4 = (unsigned char *) buf;
      arg5 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_map_merkle_path_add(arg1,(unsigned char const *)arg2,arg3,(unsigned char const *)arg4,arg5);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_keypath_get_fingerprint(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "keypath_get_fingerprint", 2, 2, swig_obj)) SWIG_fail;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "keypath_get_fingerprint" "', argument " "1"" of type '" "(const unsigned char* val, size_t val_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "keypath_get_fingerprint" "', argument " "3"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg3 = (unsigned char *) buf;
    arg4 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_keypath_get_fingerprint((unsigned char const *)arg1,arg2,arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_map_keypath_get_item_fingerprint(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_map *arg1 = (struct wally_map *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "map_keypath_get_item_fingerprint", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_map *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "map_keypath_get_item_fingerprint" "', argument " "1"" of type '" "(wally_map)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "map_keypath_get_item_fingerprint" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "map_keypath_get_item_fingerprint" "', argument " "3"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg3 = (unsigned char *) buf;
    arg4 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_map_keypath_get_item_fingerprint((struct wally_map const *)arg1,arg2,arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_keypath_get_path_len(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  size_t *arg3 = (size_t *) 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  size_t written = 0; arg3 = (size_t *)&written;
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "keypath_get_path_len" "', argument " "1"" of type '" "(const unsigned char* val, size_t val_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_keypath_get_path_len((unsigned char const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg3);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_map_keypath_get_item_path_len(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_map *arg1 = (struct wally_map *) 0 ;
  size_t arg2 ;
  size_t *arg3 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg3 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "map_keypath_get_item_path_len", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_map *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "map_keypath_get_item_path_len" "', argument " "1"" of type '" "(wally_map)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "map_keypath_get_item_path_len" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_map_keypath_get_item_path_len((struct wally_map const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg3);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_keypath_get_path(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  uint32_t *arg3 = (uint32_t *) 0 ;
  size_t arg4 ;
  size_t *arg5 = (size_t *) 0 ;
  uint32_t tmp_buf3[MAX_LOCAL_STACK/sizeof(uint32_t)] ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg5 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "keypath_get_path", 2, 2, swig_obj)) SWIG_fail;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "keypath_get_path" "', argument " "1"" of type '" "(const unsigned char* val, size_t val_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    if (!PyList_CheckExact(swig_obj[1])) {
      check_result(WALLY_EINVAL);
      SWIG_fail;
    }
    arg4 = PyList_Size(swig_obj[1]);
    arg3 = tmp_buf3;
    if (arg4 * sizeof(uint32_t) > sizeof(tmp_buf3)) {
      if (!(arg3 = (uint32_t *) wally_malloc(arg4 * sizeof(uint32_t)))) {
        check_result(WALLY_ENOMEM);
        SWIG_fail;
      }
    }
  }
  {
    result = (int)wally_keypath_get_path((unsigned char const *)arg1,arg2,arg3,arg4,arg5);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    if (arg4 && PyList_SetSlice(swig_obj[1], 0, arg4, NULL))
    SWIG_fail;
    if (written <= arg4) {
      for (size_t i = 0; i < written; ++i) {
        PyObject* p = PyLong_FromUnsignedLong(arg3[i]);
        if (PyList_Append(swig_obj[1], p)) {
          PyList_SetSlice(swig_obj[1], 0, PyList_Size(swig_obj[1]), NULL);
          SWIG_fail;
        }
      }
    }
  }
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg5);
  }
  {
    if (arg3 && arg3 != tmp_buf3)
    wally_free(arg3);
  }
  return resultobj;
fail:
  {
    if (arg3 && arg3 != tmp_buf3)
    wally_free(arg3);
  }
  return NULL;
}


SWIGINTERN PyObject *_wrap_map_keypath_get_item_path(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_map *arg1 = (struct wally_map *) 0 ;
  size_t arg2 ;
  uint32_t *arg3 = (uint32_t *) 0 ;
  size_t arg4 ;
  size_t *arg5 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  uint32_t tmp_buf3[MAX_LOCAL_STACK/sizeof(uint32_t)] ;
  PyObject *swig_obj[3] ;
  int result;
  
  size_t written = 0; arg5 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "map_keypath_get_item_path", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_map *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "map_keypath_get_item_path" "', argument " "1"" of type '" "(wally_map)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "map_keypath_get_item_path" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    if (!PyList_CheckExact(swig_obj[2])) {
      check_result(WALLY_EINVAL);
      SWIG_fail;
    }
    arg4 = PyList_Size(swig_obj[2]);
    arg3 = tmp_buf3;
    if (arg4 * sizeof(uint32_t) > sizeof(tmp_buf3)) {
      if (!(arg3 = (uint32_t *) wally_malloc(arg4 * sizeof(uint32_t)))) {
        check_result(WALLY_ENOMEM);
        SWIG_fail;
      }
    }
  }
  {
    result = (int)wally_map_keypath_get_item_path((struct wally_map const *)arg1,arg2,arg3,arg4,arg5);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    if (arg4 && PyList_SetSlice(swig_obj[2], 0, arg4, NULL))
    SWIG_fail;
    if (written <= arg4) {
      for (size_t i = 0; i < written; ++i) {
        PyObject* p = PyLong_FromUnsignedLong(arg3[i]);
        if (PyList_Append(swig_obj[2], p)) {
          PyList_SetSlice(swig_obj[2], 0, PyList_Size(swig_obj[2]), NULL);
          SWIG_fail;
        }
      }
    }
  }
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg5);
  }
  {
    if (arg3 && arg3 != tmp_buf3)
    wally_free(arg3);
  }
  return resultobj;
fail:
  {
    if (arg3 && arg3 != tmp_buf3)
    wally_free(arg3);
  }
  return NULL;
}


SWIGINTERN PyObject *_wrap_map_hash_preimage_verify(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "map_hash_preimage_verify", 2, 2, swig_obj)) SWIG_fail;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "map_hash_preimage_verify" "', argument " "1"" of type '" "(const unsigned char* key, size_t key_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "map_hash_preimage_verify" "', argument " "3"" of type '" "(const unsigned char* val, size_t val_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_map_hash_preimage_verify((unsigned char const *)arg1,arg2,(unsigned char const *)arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_map_preimage_init_alloc(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  size_t arg1 ;
  struct wally_map **arg2 = (struct wally_map **) 0 ;
  size_t val1 ;
  int ecode1 = 0 ;
  struct wally_map *w2 ;
  PyObject *swig_obj[1] ;
  int result;
  
  {
    w2 = 0; arg2 = (struct wally_map **)&w2;
  }
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  ecode1 = SWIG_AsVal_size_t(swig_obj[0], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "map_preimage_init_alloc" "', argument " "1"" of type '" "size_t""'");
  } 
  arg1 = (size_t)(val1);
  {
    result = (int)wally_map_preimage_init_alloc(arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    if (*arg2 != NULL) {
      Py_DecRef(resultobj);
      resultobj = PyCapsule_New(*arg2, "struct wally_map *", destroy_wally_map);
    }
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_map_preimage_ripemd160_add(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_map *arg1 = (struct wally_map *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "map_preimage_ripemd160_add", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_map *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "map_preimage_ripemd160_add" "', argument " "1"" of type '" "(wally_map)""'");
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg3 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "map_preimage_ripemd160_add" "', argument " "2"" of type '" "(const unsigned char* value, size_t value_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg2 = (unsigned char *) buf;
      arg3 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_map_preimage_ripemd160_add(arg1,(unsigned char const *)arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_map_preimage_sha256_add(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_map *arg1 = (struct wally_map *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "map_preimage_sha256_add", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_map *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "map_preimage_sha256_add" "', argument " "1"" of type '" "(wally_map)""'");
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg3 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "map_preimage_sha256_add" "', argument " "2"" of type '" "(const unsigned char* value, size_t value_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg2 = (unsigned char *) buf;
      arg3 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_map_preimage_sha256_add(arg1,(unsigned char const *)arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_map_preimage_hash160_add(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_map *arg1 = (struct wally_map *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "map_preimage_hash160_add", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_map *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "map_preimage_hash160_add" "', argument " "1"" of type '" "(wally_map)""'");
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg3 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "map_preimage_hash160_add" "', argument " "2"" of type '" "(const unsigned char* value, size_t value_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg2 = (unsigned char *) buf;
      arg3 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_map_preimage_hash160_add(arg1,(unsigned char const *)arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_map_preimage_sha256d_add(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_map *arg1 = (struct wally_map *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "map_preimage_sha256d_add", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_map *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "map_preimage_sha256d_add" "', argument " "1"" of type '" "(wally_map)""'");
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg3 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "map_preimage_sha256d_add" "', argument " "2"" of type '" "(const unsigned char* value, size_t value_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg2 = (unsigned char *) buf;
      arg3 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_map_preimage_sha256d_add(arg1,(unsigned char const *)arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_input_set_previous_txid(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_input *arg1 = (struct wally_psbt_input *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_input_set_previous_txid", 2, 2, swig_obj)) SWIG_fail;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_input, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_input_set_previous_txid" "', argument " "1"" of type '" "struct wally_psbt_input *""'"); 
  }
  arg1 = (struct wally_psbt_input *)(argp1);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg3 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_input_set_previous_txid" "', argument " "2"" of type '" "(const unsigned char* txhash, size_t txhash_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg2 = (unsigned char *) buf;
      arg3 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_psbt_input_set_previous_txid(arg1,(unsigned char const *)arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_input_set_output_index(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_input *arg1 = (struct wally_psbt_input *) 0 ;
  uint32_t arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_input_set_output_index", 2, 2, swig_obj)) SWIG_fail;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_input, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_input_set_output_index" "', argument " "1"" of type '" "struct wally_psbt_input *""'"); 
  }
  arg1 = (struct wally_psbt_input *)(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_input_set_output_index" "', argument " "2"" of type '" "uint32_t""'");
  } 
  arg2 = (uint32_t)(val2);
  {
    result = (int)wally_psbt_input_set_output_index(arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_input_set_sequence(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_input *arg1 = (struct wally_psbt_input *) 0 ;
  uint32_t arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_input_set_sequence", 2, 2, swig_obj)) SWIG_fail;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_input, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_input_set_sequence" "', argument " "1"" of type '" "struct wally_psbt_input *""'"); 
  }
  arg1 = (struct wally_psbt_input *)(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_input_set_sequence" "', argument " "2"" of type '" "uint32_t""'");
  } 
  arg2 = (uint32_t)(val2);
  {
    result = (int)wally_psbt_input_set_sequence(arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_input_clear_sequence(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_input *arg1 = (struct wally_psbt_input *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_input, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_input_clear_sequence" "', argument " "1"" of type '" "struct wally_psbt_input *""'"); 
  }
  arg1 = (struct wally_psbt_input *)(argp1);
  {
    result = (int)wally_psbt_input_clear_sequence(arg1);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_input_set_utxo(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_input *arg1 = (struct wally_psbt_input *) 0 ;
  struct wally_tx *arg2 = (struct wally_tx *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_input_set_utxo", 2, 2, swig_obj)) SWIG_fail;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_input, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_input_set_utxo" "', argument " "1"" of type '" "struct wally_psbt_input *""'"); 
  }
  arg1 = (struct wally_psbt_input *)(argp1);
  {
    arg2 = swig_obj[1] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[1], "struct wally_tx *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_input_set_utxo" "', argument " "2"" of type '" "(wally_tx)""'");
    }
  }
  {
    result = (int)wally_psbt_input_set_utxo(arg1,(struct wally_tx const *)arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_input_set_witness_utxo(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_input *arg1 = (struct wally_psbt_input *) 0 ;
  struct wally_tx_output *arg2 = (struct wally_tx_output *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_input_set_witness_utxo", 2, 2, swig_obj)) SWIG_fail;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_input, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_input_set_witness_utxo" "', argument " "1"" of type '" "struct wally_psbt_input *""'"); 
  }
  arg1 = (struct wally_psbt_input *)(argp1);
  {
    arg2 = swig_obj[1] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[1], "struct wally_tx_output *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_input_set_witness_utxo" "', argument " "2"" of type '" "(wally_tx_output)""'");
    }
  }
  {
    result = (int)wally_psbt_input_set_witness_utxo(arg1,(struct wally_tx_output const *)arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_input_set_witness_utxo_from_tx(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_input *arg1 = (struct wally_psbt_input *) 0 ;
  struct wally_tx *arg2 = (struct wally_tx *) 0 ;
  uint32_t arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_input_set_witness_utxo_from_tx", 3, 3, swig_obj)) SWIG_fail;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_input, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_input_set_witness_utxo_from_tx" "', argument " "1"" of type '" "struct wally_psbt_input *""'"); 
  }
  arg1 = (struct wally_psbt_input *)(argp1);
  {
    arg2 = swig_obj[1] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[1], "struct wally_tx *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_input_set_witness_utxo_from_tx" "', argument " "2"" of type '" "(wally_tx)""'");
    }
  }
  ecode3 = SWIG_AsVal_unsigned_SS_int(swig_obj[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "psbt_input_set_witness_utxo_from_tx" "', argument " "3"" of type '" "uint32_t""'");
  } 
  arg3 = (uint32_t)(val3);
  {
    result = (int)wally_psbt_input_set_witness_utxo_from_tx(arg1,(struct wally_tx const *)arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_input_set_redeem_script(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_input *arg1 = (struct wally_psbt_input *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_input_set_redeem_script", 2, 2, swig_obj)) SWIG_fail;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_input, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_input_set_redeem_script" "', argument " "1"" of type '" "struct wally_psbt_input *""'"); 
  }
  arg1 = (struct wally_psbt_input *)(argp1);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg3 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_input_set_redeem_script" "', argument " "2"" of type '" "(const unsigned char* script, size_t script_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg2 = (unsigned char *) buf;
      arg3 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_psbt_input_set_redeem_script(arg1,(unsigned char const *)arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_input_set_witness_script(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_input *arg1 = (struct wally_psbt_input *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_input_set_witness_script", 2, 2, swig_obj)) SWIG_fail;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_input, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_input_set_witness_script" "', argument " "1"" of type '" "struct wally_psbt_input *""'"); 
  }
  arg1 = (struct wally_psbt_input *)(argp1);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg3 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_input_set_witness_script" "', argument " "2"" of type '" "(const unsigned char* script, size_t script_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg2 = (unsigned char *) buf;
      arg3 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_psbt_input_set_witness_script(arg1,(unsigned char const *)arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_input_set_final_scriptsig(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_input *arg1 = (struct wally_psbt_input *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_input_set_final_scriptsig", 2, 2, swig_obj)) SWIG_fail;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_input, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_input_set_final_scriptsig" "', argument " "1"" of type '" "struct wally_psbt_input *""'"); 
  }
  arg1 = (struct wally_psbt_input *)(argp1);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg3 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_input_set_final_scriptsig" "', argument " "2"" of type '" "(const unsigned char* final_scriptsig, size_t final_scriptsig_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg2 = (unsigned char *) buf;
      arg3 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_psbt_input_set_final_scriptsig(arg1,(unsigned char const *)arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_input_set_final_witness(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_input *arg1 = (struct wally_psbt_input *) 0 ;
  struct wally_tx_witness_stack *arg2 = (struct wally_tx_witness_stack *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_input_set_final_witness", 2, 2, swig_obj)) SWIG_fail;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_input, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_input_set_final_witness" "', argument " "1"" of type '" "struct wally_psbt_input *""'"); 
  }
  arg1 = (struct wally_psbt_input *)(argp1);
  {
    arg2 = swig_obj[1] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[1], "struct wally_tx_witness_stack *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_input_set_final_witness" "', argument " "2"" of type '" "(wally_tx_witness_stack)""'");
    }
  }
  {
    result = (int)wally_psbt_input_set_final_witness(arg1,(struct wally_tx_witness_stack const *)arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_input_set_keypaths(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_input *arg1 = (struct wally_psbt_input *) 0 ;
  struct wally_map *arg2 = (struct wally_map *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_input_set_keypaths", 2, 2, swig_obj)) SWIG_fail;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_input, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_input_set_keypaths" "', argument " "1"" of type '" "struct wally_psbt_input *""'"); 
  }
  arg1 = (struct wally_psbt_input *)(argp1);
  {
    arg2 = swig_obj[1] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[1], "struct wally_map *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_input_set_keypaths" "', argument " "2"" of type '" "(wally_map)""'");
    }
  }
  {
    result = (int)wally_psbt_input_set_keypaths(arg1,(struct wally_map const *)arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_input_find_keypath(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_input *arg1 = (struct wally_psbt_input *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  size_t *arg4 = (size_t *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg4 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_input_find_keypath", 2, 2, swig_obj)) SWIG_fail;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_input, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_input_find_keypath" "', argument " "1"" of type '" "struct wally_psbt_input const *""'"); 
  }
  arg1 = (struct wally_psbt_input *)(argp1);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg3 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_input_find_keypath" "', argument " "2"" of type '" "(const unsigned char* pub_key, size_t pub_key_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg2 = (unsigned char *) buf;
      arg3 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_psbt_input_find_keypath((struct wally_psbt_input const *)arg1,(unsigned char const *)arg2,arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg4);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_input_keypath_add(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_input *arg1 = (struct wally_psbt_input *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  unsigned char *arg4 = (unsigned char *) 0 ;
  size_t arg5 ;
  uint32_t *arg6 = (uint32_t *) 0 ;
  size_t arg7 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  uint32_t tmp_buf6[MAX_LOCAL_STACK/sizeof(uint32_t)] ;
  PyObject *swig_obj[4] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_input_keypath_add", 4, 4, swig_obj)) SWIG_fail;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_input, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_input_keypath_add" "', argument " "1"" of type '" "struct wally_psbt_input *""'"); 
  }
  arg1 = (struct wally_psbt_input *)(argp1);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg3 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_input_keypath_add" "', argument " "2"" of type '" "(const unsigned char* pub_key, size_t pub_key_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg2 = (unsigned char *) buf;
      arg3 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[2] == Py_None)
    arg5 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_input_keypath_add" "', argument " "4"" of type '" "(const unsigned char* fingerprint, size_t fingerprint_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg4 = (unsigned char *) buf;
      arg5 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    size_t i;
    if (!PyList_Check(swig_obj[3])) {
      check_result(WALLY_EINVAL);
      SWIG_fail;
    }
    arg7 = PyList_Size(swig_obj[3]);
    arg6 = tmp_buf6;
    if (arg7 * sizeof(uint32_t) > sizeof(tmp_buf6))
    if (!(arg6 = (uint32_t *) wally_malloc((arg7) * sizeof(uint32_t)))) {
      check_result(WALLY_ENOMEM);
      SWIG_fail;
    }
    for (i = 0; i < arg7; ++i) {
      PyObject *item = PyList_GET_ITEM(swig_obj[3], i);
      unsigned long long v;
      if (!ulonglong_cast(item, &v) || v > 0xffffffffull) {
        PyErr_SetString(PyExc_OverflowError, "Invalid unsigned integer");
        SWIG_fail;
      }
      arg6[i] = (uint32_t)v;
    }
  }
  {
    result = (int)wally_psbt_input_keypath_add(arg1,(unsigned char const *)arg2,arg3,(unsigned char const *)arg4,arg5,(unsigned int const *)arg6,arg7);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    if (arg6 && arg6 != tmp_buf6)
    wally_free(arg6);
  }
  return resultobj;
fail:
  {
    if (arg6 && arg6 != tmp_buf6)
    wally_free(arg6);
  }
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_input_taproot_keypath_add(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_input *arg1 = (struct wally_psbt_input *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  unsigned char *arg4 = (unsigned char *) 0 ;
  size_t arg5 ;
  unsigned char *arg6 = (unsigned char *) 0 ;
  size_t arg7 ;
  uint32_t *arg8 = (uint32_t *) 0 ;
  size_t arg9 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  uint32_t tmp_buf8[MAX_LOCAL_STACK/sizeof(uint32_t)] ;
  PyObject *swig_obj[5] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_input_taproot_keypath_add", 5, 5, swig_obj)) SWIG_fail;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_input, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_input_taproot_keypath_add" "', argument " "1"" of type '" "struct wally_psbt_input *""'"); 
  }
  arg1 = (struct wally_psbt_input *)(argp1);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg3 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_input_taproot_keypath_add" "', argument " "2"" of type '" "(const unsigned char* pub_key, size_t pub_key_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg2 = (unsigned char *) buf;
      arg3 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[2] == Py_None)
    arg5 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_input_taproot_keypath_add" "', argument " "4"" of type '" "(const unsigned char* tapleaf_hashes, size_t tapleaf_hashes_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg4 = (unsigned char *) buf;
      arg5 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[3] == Py_None)
    arg7 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[3], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_input_taproot_keypath_add" "', argument " "6"" of type '" "(const unsigned char* fingerprint, size_t fingerprint_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg6 = (unsigned char *) buf;
      arg7 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    size_t i;
    if (!PyList_Check(swig_obj[4])) {
      check_result(WALLY_EINVAL);
      SWIG_fail;
    }
    arg9 = PyList_Size(swig_obj[4]);
    arg8 = tmp_buf8;
    if (arg9 * sizeof(uint32_t) > sizeof(tmp_buf8))
    if (!(arg8 = (uint32_t *) wally_malloc((arg9) * sizeof(uint32_t)))) {
      check_result(WALLY_ENOMEM);
      SWIG_fail;
    }
    for (i = 0; i < arg9; ++i) {
      PyObject *item = PyList_GET_ITEM(swig_obj[4], i);
      unsigned long long v;
      if (!ulonglong_cast(item, &v) || v > 0xffffffffull) {
        PyErr_SetString(PyExc_OverflowError, "Invalid unsigned integer");
        SWIG_fail;
      }
      arg8[i] = (uint32_t)v;
    }
  }
  {
    result = (int)wally_psbt_input_taproot_keypath_add(arg1,(unsigned char const *)arg2,arg3,(unsigned char const *)arg4,arg5,(unsigned char const *)arg6,arg7,(unsigned int const *)arg8,arg9);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    if (arg8 && arg8 != tmp_buf8)
    wally_free(arg8);
  }
  return resultobj;
fail:
  {
    if (arg8 && arg8 != tmp_buf8)
    wally_free(arg8);
  }
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_input_set_signatures(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_input *arg1 = (struct wally_psbt_input *) 0 ;
  struct wally_map *arg2 = (struct wally_map *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_input_set_signatures", 2, 2, swig_obj)) SWIG_fail;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_input, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_input_set_signatures" "', argument " "1"" of type '" "struct wally_psbt_input *""'"); 
  }
  arg1 = (struct wally_psbt_input *)(argp1);
  {
    arg2 = swig_obj[1] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[1], "struct wally_map *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_input_set_signatures" "', argument " "2"" of type '" "(wally_map)""'");
    }
  }
  {
    result = (int)wally_psbt_input_set_signatures(arg1,(struct wally_map const *)arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_input_set_taproot_signature(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_input *arg1 = (struct wally_psbt_input *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_input_set_taproot_signature", 2, 2, swig_obj)) SWIG_fail;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_input, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_input_set_taproot_signature" "', argument " "1"" of type '" "struct wally_psbt_input *""'"); 
  }
  arg1 = (struct wally_psbt_input *)(argp1);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg3 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_input_set_taproot_signature" "', argument " "2"" of type '" "(const unsigned char* tap_sig, size_t tap_sig_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg2 = (unsigned char *) buf;
      arg3 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_psbt_input_set_taproot_signature(arg1,(unsigned char const *)arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_input_set_taproot_internal_key(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_input *arg1 = (struct wally_psbt_input *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_input_set_taproot_internal_key", 2, 2, swig_obj)) SWIG_fail;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_input, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_input_set_taproot_internal_key" "', argument " "1"" of type '" "struct wally_psbt_input *""'"); 
  }
  arg1 = (struct wally_psbt_input *)(argp1);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg3 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_input_set_taproot_internal_key" "', argument " "2"" of type '" "(const unsigned char* pub_key, size_t pub_key_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg2 = (unsigned char *) buf;
      arg3 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_psbt_input_set_taproot_internal_key(arg1,(unsigned char const *)arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_input_find_signature(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_input *arg1 = (struct wally_psbt_input *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  size_t *arg4 = (size_t *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg4 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_input_find_signature", 2, 2, swig_obj)) SWIG_fail;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_input, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_input_find_signature" "', argument " "1"" of type '" "struct wally_psbt_input const *""'"); 
  }
  arg1 = (struct wally_psbt_input *)(argp1);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg3 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_input_find_signature" "', argument " "2"" of type '" "(const unsigned char* pub_key, size_t pub_key_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg2 = (unsigned char *) buf;
      arg3 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_psbt_input_find_signature((struct wally_psbt_input const *)arg1,(unsigned char const *)arg2,arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg4);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_input_add_signature(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_input *arg1 = (struct wally_psbt_input *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  unsigned char *arg4 = (unsigned char *) 0 ;
  size_t arg5 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_input_add_signature", 3, 3, swig_obj)) SWIG_fail;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_input, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_input_add_signature" "', argument " "1"" of type '" "struct wally_psbt_input *""'"); 
  }
  arg1 = (struct wally_psbt_input *)(argp1);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg3 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_input_add_signature" "', argument " "2"" of type '" "(const unsigned char* pub_key, size_t pub_key_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg2 = (unsigned char *) buf;
      arg3 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[2] == Py_None)
    arg5 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_input_add_signature" "', argument " "4"" of type '" "(const unsigned char* sig, size_t sig_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg4 = (unsigned char *) buf;
      arg5 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_psbt_input_add_signature(arg1,(unsigned char const *)arg2,arg3,(unsigned char const *)arg4,arg5);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_input_set_unknowns(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_input *arg1 = (struct wally_psbt_input *) 0 ;
  struct wally_map *arg2 = (struct wally_map *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_input_set_unknowns", 2, 2, swig_obj)) SWIG_fail;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_input, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_input_set_unknowns" "', argument " "1"" of type '" "struct wally_psbt_input *""'"); 
  }
  arg1 = (struct wally_psbt_input *)(argp1);
  {
    arg2 = swig_obj[1] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[1], "struct wally_map *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_input_set_unknowns" "', argument " "2"" of type '" "(wally_map)""'");
    }
  }
  {
    result = (int)wally_psbt_input_set_unknowns(arg1,(struct wally_map const *)arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_input_find_unknown(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_input *arg1 = (struct wally_psbt_input *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  size_t *arg4 = (size_t *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg4 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_input_find_unknown", 2, 2, swig_obj)) SWIG_fail;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_input, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_input_find_unknown" "', argument " "1"" of type '" "struct wally_psbt_input const *""'"); 
  }
  arg1 = (struct wally_psbt_input *)(argp1);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg3 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_input_find_unknown" "', argument " "2"" of type '" "(const unsigned char* key, size_t key_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg2 = (unsigned char *) buf;
      arg3 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_psbt_input_find_unknown((struct wally_psbt_input const *)arg1,(unsigned char const *)arg2,arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg4);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_input_set_sighash(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_input *arg1 = (struct wally_psbt_input *) 0 ;
  uint32_t arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_input_set_sighash", 2, 2, swig_obj)) SWIG_fail;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_input, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_input_set_sighash" "', argument " "1"" of type '" "struct wally_psbt_input *""'"); 
  }
  arg1 = (struct wally_psbt_input *)(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_input_set_sighash" "', argument " "2"" of type '" "uint32_t""'");
  } 
  arg2 = (uint32_t)(val2);
  {
    result = (int)wally_psbt_input_set_sighash(arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_input_set_required_locktime(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_input *arg1 = (struct wally_psbt_input *) 0 ;
  uint32_t arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_input_set_required_locktime", 2, 2, swig_obj)) SWIG_fail;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_input, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_input_set_required_locktime" "', argument " "1"" of type '" "struct wally_psbt_input *""'"); 
  }
  arg1 = (struct wally_psbt_input *)(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_input_set_required_locktime" "', argument " "2"" of type '" "uint32_t""'");
  } 
  arg2 = (uint32_t)(val2);
  {
    result = (int)wally_psbt_input_set_required_locktime(arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_input_clear_required_locktime(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_input *arg1 = (struct wally_psbt_input *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_input, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_input_clear_required_locktime" "', argument " "1"" of type '" "struct wally_psbt_input *""'"); 
  }
  arg1 = (struct wally_psbt_input *)(argp1);
  {
    result = (int)wally_psbt_input_clear_required_locktime(arg1);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_input_set_required_lockheight(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_input *arg1 = (struct wally_psbt_input *) 0 ;
  uint32_t arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_input_set_required_lockheight", 2, 2, swig_obj)) SWIG_fail;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_input, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_input_set_required_lockheight" "', argument " "1"" of type '" "struct wally_psbt_input *""'"); 
  }
  arg1 = (struct wally_psbt_input *)(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_input_set_required_lockheight" "', argument " "2"" of type '" "uint32_t""'");
  } 
  arg2 = (uint32_t)(val2);
  {
    result = (int)wally_psbt_input_set_required_lockheight(arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_input_clear_required_lockheight(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_input *arg1 = (struct wally_psbt_input *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_input, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_input_clear_required_lockheight" "', argument " "1"" of type '" "struct wally_psbt_input *""'"); 
  }
  arg1 = (struct wally_psbt_input *)(argp1);
  {
    result = (int)wally_psbt_input_clear_required_lockheight(arg1);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_input_set_amount(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_input *arg1 = (struct wally_psbt_input *) 0 ;
  uint64_t arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned long long val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_input_set_amount", 2, 2, swig_obj)) SWIG_fail;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_input, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_input_set_amount" "', argument " "1"" of type '" "struct wally_psbt_input *""'"); 
  }
  arg1 = (struct wally_psbt_input *)(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_long_SS_long(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_input_set_amount" "', argument " "2"" of type '" "uint64_t""'");
  } 
  arg2 = (uint64_t)(val2);
  {
    result = (int)wally_psbt_input_set_amount(arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_input_get_amount_rangeproof(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_input *arg1 = (struct wally_psbt_input *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  size_t *arg4 = (size_t *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg4 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_input_get_amount_rangeproof", 2, 2, swig_obj)) SWIG_fail;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_input, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_input_get_amount_rangeproof" "', argument " "1"" of type '" "struct wally_psbt_input const *""'"); 
  }
  arg1 = (struct wally_psbt_input *)(argp1);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_input_get_amount_rangeproof" "', argument " "2"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg2 = (unsigned char *) buf;
    arg3 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_psbt_input_get_amount_rangeproof((struct wally_psbt_input const *)arg1,arg2,arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg4);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_input_get_amount_rangeproof_len(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_input *arg1 = (struct wally_psbt_input *) 0 ;
  size_t *arg2 = (size_t *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  size_t written = 0; arg2 = (size_t *)&written;
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_input, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_input_get_amount_rangeproof_len" "', argument " "1"" of type '" "struct wally_psbt_input const *""'"); 
  }
  arg1 = (struct wally_psbt_input *)(argp1);
  {
    result = (int)wally_psbt_input_get_amount_rangeproof_len((struct wally_psbt_input const *)arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg2);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_input_set_amount_rangeproof(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_input *arg1 = (struct wally_psbt_input *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_input_set_amount_rangeproof", 2, 2, swig_obj)) SWIG_fail;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_input, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_input_set_amount_rangeproof" "', argument " "1"" of type '" "struct wally_psbt_input *""'"); 
  }
  arg1 = (struct wally_psbt_input *)(argp1);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg3 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_input_set_amount_rangeproof" "', argument " "2"" of type '" "(const unsigned char* rangeproof, size_t rangeproof_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg2 = (unsigned char *) buf;
      arg3 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_psbt_input_set_amount_rangeproof(arg1,(unsigned char const *)arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_input_clear_amount_rangeproof(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_input *arg1 = (struct wally_psbt_input *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_input, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_input_clear_amount_rangeproof" "', argument " "1"" of type '" "struct wally_psbt_input *""'"); 
  }
  arg1 = (struct wally_psbt_input *)(argp1);
  {
    result = (int)wally_psbt_input_clear_amount_rangeproof(arg1);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_input_get_asset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_input *arg1 = (struct wally_psbt_input *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  size_t *arg4 = (size_t *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg4 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_input_get_asset", 2, 2, swig_obj)) SWIG_fail;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_input, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_input_get_asset" "', argument " "1"" of type '" "struct wally_psbt_input const *""'"); 
  }
  arg1 = (struct wally_psbt_input *)(argp1);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_input_get_asset" "', argument " "2"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg2 = (unsigned char *) buf;
    arg3 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_psbt_input_get_asset((struct wally_psbt_input const *)arg1,arg2,arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg4);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_input_get_asset_len(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_input *arg1 = (struct wally_psbt_input *) 0 ;
  size_t *arg2 = (size_t *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  size_t written = 0; arg2 = (size_t *)&written;
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_input, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_input_get_asset_len" "', argument " "1"" of type '" "struct wally_psbt_input const *""'"); 
  }
  arg1 = (struct wally_psbt_input *)(argp1);
  {
    result = (int)wally_psbt_input_get_asset_len((struct wally_psbt_input const *)arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg2);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_input_set_asset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_input *arg1 = (struct wally_psbt_input *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_input_set_asset", 2, 2, swig_obj)) SWIG_fail;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_input, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_input_set_asset" "', argument " "1"" of type '" "struct wally_psbt_input *""'"); 
  }
  arg1 = (struct wally_psbt_input *)(argp1);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg3 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_input_set_asset" "', argument " "2"" of type '" "(const unsigned char* asset, size_t asset_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg2 = (unsigned char *) buf;
      arg3 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_psbt_input_set_asset(arg1,(unsigned char const *)arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_input_clear_asset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_input *arg1 = (struct wally_psbt_input *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_input, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_input_clear_asset" "', argument " "1"" of type '" "struct wally_psbt_input *""'"); 
  }
  arg1 = (struct wally_psbt_input *)(argp1);
  {
    result = (int)wally_psbt_input_clear_asset(arg1);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_input_get_asset_surjectionproof(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_input *arg1 = (struct wally_psbt_input *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  size_t *arg4 = (size_t *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg4 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_input_get_asset_surjectionproof", 2, 2, swig_obj)) SWIG_fail;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_input, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_input_get_asset_surjectionproof" "', argument " "1"" of type '" "struct wally_psbt_input const *""'"); 
  }
  arg1 = (struct wally_psbt_input *)(argp1);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_input_get_asset_surjectionproof" "', argument " "2"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg2 = (unsigned char *) buf;
    arg3 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_psbt_input_get_asset_surjectionproof((struct wally_psbt_input const *)arg1,arg2,arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg4);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_input_get_asset_surjectionproof_len(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_input *arg1 = (struct wally_psbt_input *) 0 ;
  size_t *arg2 = (size_t *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  size_t written = 0; arg2 = (size_t *)&written;
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_input, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_input_get_asset_surjectionproof_len" "', argument " "1"" of type '" "struct wally_psbt_input const *""'"); 
  }
  arg1 = (struct wally_psbt_input *)(argp1);
  {
    result = (int)wally_psbt_input_get_asset_surjectionproof_len((struct wally_psbt_input const *)arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg2);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_input_set_asset_surjectionproof(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_input *arg1 = (struct wally_psbt_input *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_input_set_asset_surjectionproof", 2, 2, swig_obj)) SWIG_fail;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_input, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_input_set_asset_surjectionproof" "', argument " "1"" of type '" "struct wally_psbt_input *""'"); 
  }
  arg1 = (struct wally_psbt_input *)(argp1);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg3 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_input_set_asset_surjectionproof" "', argument " "2"" of type '" "(const unsigned char* surjectionproof, size_t surjectionproof_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg2 = (unsigned char *) buf;
      arg3 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_psbt_input_set_asset_surjectionproof(arg1,(unsigned char const *)arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_input_clear_asset_surjectionproof(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_input *arg1 = (struct wally_psbt_input *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_input, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_input_clear_asset_surjectionproof" "', argument " "1"" of type '" "struct wally_psbt_input *""'"); 
  }
  arg1 = (struct wally_psbt_input *)(argp1);
  {
    result = (int)wally_psbt_input_clear_asset_surjectionproof(arg1);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_input_set_issuance_amount(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_input *arg1 = (struct wally_psbt_input *) 0 ;
  uint64_t arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned long long val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_input_set_issuance_amount", 2, 2, swig_obj)) SWIG_fail;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_input, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_input_set_issuance_amount" "', argument " "1"" of type '" "struct wally_psbt_input *""'"); 
  }
  arg1 = (struct wally_psbt_input *)(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_long_SS_long(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_input_set_issuance_amount" "', argument " "2"" of type '" "uint64_t""'");
  } 
  arg2 = (uint64_t)(val2);
  {
    result = (int)wally_psbt_input_set_issuance_amount(arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_input_set_inflation_keys(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_input *arg1 = (struct wally_psbt_input *) 0 ;
  uint64_t arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned long long val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_input_set_inflation_keys", 2, 2, swig_obj)) SWIG_fail;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_input, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_input_set_inflation_keys" "', argument " "1"" of type '" "struct wally_psbt_input *""'"); 
  }
  arg1 = (struct wally_psbt_input *)(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_long_SS_long(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_input_set_inflation_keys" "', argument " "2"" of type '" "uint64_t""'");
  } 
  arg2 = (uint64_t)(val2);
  {
    result = (int)wally_psbt_input_set_inflation_keys(arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_input_set_pegin_amount(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_input *arg1 = (struct wally_psbt_input *) 0 ;
  uint64_t arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned long long val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_input_set_pegin_amount", 2, 2, swig_obj)) SWIG_fail;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_input, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_input_set_pegin_amount" "', argument " "1"" of type '" "struct wally_psbt_input *""'"); 
  }
  arg1 = (struct wally_psbt_input *)(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_long_SS_long(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_input_set_pegin_amount" "', argument " "2"" of type '" "uint64_t""'");
  } 
  arg2 = (uint64_t)(val2);
  {
    result = (int)wally_psbt_input_set_pegin_amount(arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_input_set_pegin_tx(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_input *arg1 = (struct wally_psbt_input *) 0 ;
  struct wally_tx *arg2 = (struct wally_tx *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_input_set_pegin_tx", 2, 2, swig_obj)) SWIG_fail;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_input, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_input_set_pegin_tx" "', argument " "1"" of type '" "struct wally_psbt_input *""'"); 
  }
  arg1 = (struct wally_psbt_input *)(argp1);
  {
    arg2 = swig_obj[1] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[1], "struct wally_tx *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_input_set_pegin_tx" "', argument " "2"" of type '" "(wally_tx)""'");
    }
  }
  {
    result = (int)wally_psbt_input_set_pegin_tx(arg1,(struct wally_tx const *)arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_input_set_pegin_witness(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_input *arg1 = (struct wally_psbt_input *) 0 ;
  struct wally_tx_witness_stack *arg2 = (struct wally_tx_witness_stack *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_input_set_pegin_witness", 2, 2, swig_obj)) SWIG_fail;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_input, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_input_set_pegin_witness" "', argument " "1"" of type '" "struct wally_psbt_input *""'"); 
  }
  arg1 = (struct wally_psbt_input *)(argp1);
  {
    arg2 = swig_obj[1] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[1], "struct wally_tx_witness_stack *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_input_set_pegin_witness" "', argument " "2"" of type '" "(wally_tx_witness_stack)""'");
    }
  }
  {
    result = (int)wally_psbt_input_set_pegin_witness(arg1,(struct wally_tx_witness_stack const *)arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_input_get_pegin_txout_proof(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_input *arg1 = (struct wally_psbt_input *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  size_t *arg4 = (size_t *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg4 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_input_get_pegin_txout_proof", 2, 2, swig_obj)) SWIG_fail;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_input, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_input_get_pegin_txout_proof" "', argument " "1"" of type '" "struct wally_psbt_input const *""'"); 
  }
  arg1 = (struct wally_psbt_input *)(argp1);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_input_get_pegin_txout_proof" "', argument " "2"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg2 = (unsigned char *) buf;
    arg3 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_psbt_input_get_pegin_txout_proof((struct wally_psbt_input const *)arg1,arg2,arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg4);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_input_get_pegin_txout_proof_len(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_input *arg1 = (struct wally_psbt_input *) 0 ;
  size_t *arg2 = (size_t *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  size_t written = 0; arg2 = (size_t *)&written;
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_input, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_input_get_pegin_txout_proof_len" "', argument " "1"" of type '" "struct wally_psbt_input const *""'"); 
  }
  arg1 = (struct wally_psbt_input *)(argp1);
  {
    result = (int)wally_psbt_input_get_pegin_txout_proof_len((struct wally_psbt_input const *)arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg2);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_input_set_pegin_txout_proof(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_input *arg1 = (struct wally_psbt_input *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_input_set_pegin_txout_proof", 2, 2, swig_obj)) SWIG_fail;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_input, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_input_set_pegin_txout_proof" "', argument " "1"" of type '" "struct wally_psbt_input *""'"); 
  }
  arg1 = (struct wally_psbt_input *)(argp1);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg3 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_input_set_pegin_txout_proof" "', argument " "2"" of type '" "(const unsigned char* txout_proof, size_t txout_proof_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg2 = (unsigned char *) buf;
      arg3 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_psbt_input_set_pegin_txout_proof(arg1,(unsigned char const *)arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_input_clear_pegin_txout_proof(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_input *arg1 = (struct wally_psbt_input *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_input, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_input_clear_pegin_txout_proof" "', argument " "1"" of type '" "struct wally_psbt_input *""'"); 
  }
  arg1 = (struct wally_psbt_input *)(argp1);
  {
    result = (int)wally_psbt_input_clear_pegin_txout_proof(arg1);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_input_get_pegin_genesis_blockhash(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_input *arg1 = (struct wally_psbt_input *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  size_t *arg4 = (size_t *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg4 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_input_get_pegin_genesis_blockhash", 2, 2, swig_obj)) SWIG_fail;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_input, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_input_get_pegin_genesis_blockhash" "', argument " "1"" of type '" "struct wally_psbt_input const *""'"); 
  }
  arg1 = (struct wally_psbt_input *)(argp1);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_input_get_pegin_genesis_blockhash" "', argument " "2"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg2 = (unsigned char *) buf;
    arg3 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_psbt_input_get_pegin_genesis_blockhash((struct wally_psbt_input const *)arg1,arg2,arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg4);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_input_get_pegin_genesis_blockhash_len(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_input *arg1 = (struct wally_psbt_input *) 0 ;
  size_t *arg2 = (size_t *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  size_t written = 0; arg2 = (size_t *)&written;
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_input, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_input_get_pegin_genesis_blockhash_len" "', argument " "1"" of type '" "struct wally_psbt_input const *""'"); 
  }
  arg1 = (struct wally_psbt_input *)(argp1);
  {
    result = (int)wally_psbt_input_get_pegin_genesis_blockhash_len((struct wally_psbt_input const *)arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg2);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_input_set_pegin_genesis_blockhash(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_input *arg1 = (struct wally_psbt_input *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_input_set_pegin_genesis_blockhash", 2, 2, swig_obj)) SWIG_fail;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_input, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_input_set_pegin_genesis_blockhash" "', argument " "1"" of type '" "struct wally_psbt_input *""'"); 
  }
  arg1 = (struct wally_psbt_input *)(argp1);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg3 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_input_set_pegin_genesis_blockhash" "', argument " "2"" of type '" "(const unsigned char* genesis_blockhash, size_t genesis_blockhash_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg2 = (unsigned char *) buf;
      arg3 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_psbt_input_set_pegin_genesis_blockhash(arg1,(unsigned char const *)arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_input_clear_pegin_genesis_blockhash(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_input *arg1 = (struct wally_psbt_input *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_input, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_input_clear_pegin_genesis_blockhash" "', argument " "1"" of type '" "struct wally_psbt_input *""'"); 
  }
  arg1 = (struct wally_psbt_input *)(argp1);
  {
    result = (int)wally_psbt_input_clear_pegin_genesis_blockhash(arg1);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_input_get_pegin_claim_script(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_input *arg1 = (struct wally_psbt_input *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  size_t *arg4 = (size_t *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg4 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_input_get_pegin_claim_script", 2, 2, swig_obj)) SWIG_fail;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_input, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_input_get_pegin_claim_script" "', argument " "1"" of type '" "struct wally_psbt_input const *""'"); 
  }
  arg1 = (struct wally_psbt_input *)(argp1);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_input_get_pegin_claim_script" "', argument " "2"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg2 = (unsigned char *) buf;
    arg3 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_psbt_input_get_pegin_claim_script((struct wally_psbt_input const *)arg1,arg2,arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg4);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_input_get_pegin_claim_script_len(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_input *arg1 = (struct wally_psbt_input *) 0 ;
  size_t *arg2 = (size_t *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  size_t written = 0; arg2 = (size_t *)&written;
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_input, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_input_get_pegin_claim_script_len" "', argument " "1"" of type '" "struct wally_psbt_input const *""'"); 
  }
  arg1 = (struct wally_psbt_input *)(argp1);
  {
    result = (int)wally_psbt_input_get_pegin_claim_script_len((struct wally_psbt_input const *)arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg2);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_input_set_pegin_claim_script(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_input *arg1 = (struct wally_psbt_input *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_input_set_pegin_claim_script", 2, 2, swig_obj)) SWIG_fail;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_input, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_input_set_pegin_claim_script" "', argument " "1"" of type '" "struct wally_psbt_input *""'"); 
  }
  arg1 = (struct wally_psbt_input *)(argp1);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg3 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_input_set_pegin_claim_script" "', argument " "2"" of type '" "(const unsigned char* script, size_t script_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg2 = (unsigned char *) buf;
      arg3 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_psbt_input_set_pegin_claim_script(arg1,(unsigned char const *)arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_input_clear_pegin_claim_script(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_input *arg1 = (struct wally_psbt_input *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_input, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_input_clear_pegin_claim_script" "', argument " "1"" of type '" "struct wally_psbt_input *""'"); 
  }
  arg1 = (struct wally_psbt_input *)(argp1);
  {
    result = (int)wally_psbt_input_clear_pegin_claim_script(arg1);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_input_get_issuance_amount_commitment(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_input *arg1 = (struct wally_psbt_input *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  size_t *arg4 = (size_t *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg4 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_input_get_issuance_amount_commitment", 2, 2, swig_obj)) SWIG_fail;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_input, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_input_get_issuance_amount_commitment" "', argument " "1"" of type '" "struct wally_psbt_input const *""'"); 
  }
  arg1 = (struct wally_psbt_input *)(argp1);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_input_get_issuance_amount_commitment" "', argument " "2"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg2 = (unsigned char *) buf;
    arg3 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_psbt_input_get_issuance_amount_commitment((struct wally_psbt_input const *)arg1,arg2,arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg4);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_input_get_issuance_amount_commitment_len(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_input *arg1 = (struct wally_psbt_input *) 0 ;
  size_t *arg2 = (size_t *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  size_t written = 0; arg2 = (size_t *)&written;
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_input, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_input_get_issuance_amount_commitment_len" "', argument " "1"" of type '" "struct wally_psbt_input const *""'"); 
  }
  arg1 = (struct wally_psbt_input *)(argp1);
  {
    result = (int)wally_psbt_input_get_issuance_amount_commitment_len((struct wally_psbt_input const *)arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg2);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_input_set_issuance_amount_commitment(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_input *arg1 = (struct wally_psbt_input *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_input_set_issuance_amount_commitment", 2, 2, swig_obj)) SWIG_fail;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_input, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_input_set_issuance_amount_commitment" "', argument " "1"" of type '" "struct wally_psbt_input *""'"); 
  }
  arg1 = (struct wally_psbt_input *)(argp1);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg3 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_input_set_issuance_amount_commitment" "', argument " "2"" of type '" "(const unsigned char* commitment, size_t commitment_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg2 = (unsigned char *) buf;
      arg3 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_psbt_input_set_issuance_amount_commitment(arg1,(unsigned char const *)arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_input_clear_issuance_amount_commitment(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_input *arg1 = (struct wally_psbt_input *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_input, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_input_clear_issuance_amount_commitment" "', argument " "1"" of type '" "struct wally_psbt_input *""'"); 
  }
  arg1 = (struct wally_psbt_input *)(argp1);
  {
    result = (int)wally_psbt_input_clear_issuance_amount_commitment(arg1);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_input_get_issuance_amount_rangeproof(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_input *arg1 = (struct wally_psbt_input *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  size_t *arg4 = (size_t *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg4 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_input_get_issuance_amount_rangeproof", 2, 2, swig_obj)) SWIG_fail;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_input, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_input_get_issuance_amount_rangeproof" "', argument " "1"" of type '" "struct wally_psbt_input const *""'"); 
  }
  arg1 = (struct wally_psbt_input *)(argp1);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_input_get_issuance_amount_rangeproof" "', argument " "2"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg2 = (unsigned char *) buf;
    arg3 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_psbt_input_get_issuance_amount_rangeproof((struct wally_psbt_input const *)arg1,arg2,arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg4);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_input_get_issuance_amount_rangeproof_len(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_input *arg1 = (struct wally_psbt_input *) 0 ;
  size_t *arg2 = (size_t *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  size_t written = 0; arg2 = (size_t *)&written;
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_input, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_input_get_issuance_amount_rangeproof_len" "', argument " "1"" of type '" "struct wally_psbt_input const *""'"); 
  }
  arg1 = (struct wally_psbt_input *)(argp1);
  {
    result = (int)wally_psbt_input_get_issuance_amount_rangeproof_len((struct wally_psbt_input const *)arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg2);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_input_set_issuance_amount_rangeproof(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_input *arg1 = (struct wally_psbt_input *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_input_set_issuance_amount_rangeproof", 2, 2, swig_obj)) SWIG_fail;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_input, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_input_set_issuance_amount_rangeproof" "', argument " "1"" of type '" "struct wally_psbt_input *""'"); 
  }
  arg1 = (struct wally_psbt_input *)(argp1);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg3 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_input_set_issuance_amount_rangeproof" "', argument " "2"" of type '" "(const unsigned char* rangeproof, size_t rangeproof_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg2 = (unsigned char *) buf;
      arg3 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_psbt_input_set_issuance_amount_rangeproof(arg1,(unsigned char const *)arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_input_clear_issuance_amount_rangeproof(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_input *arg1 = (struct wally_psbt_input *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_input, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_input_clear_issuance_amount_rangeproof" "', argument " "1"" of type '" "struct wally_psbt_input *""'"); 
  }
  arg1 = (struct wally_psbt_input *)(argp1);
  {
    result = (int)wally_psbt_input_clear_issuance_amount_rangeproof(arg1);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_input_get_issuance_blinding_nonce(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_input *arg1 = (struct wally_psbt_input *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  size_t *arg4 = (size_t *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg4 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_input_get_issuance_blinding_nonce", 2, 2, swig_obj)) SWIG_fail;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_input, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_input_get_issuance_blinding_nonce" "', argument " "1"" of type '" "struct wally_psbt_input const *""'"); 
  }
  arg1 = (struct wally_psbt_input *)(argp1);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_input_get_issuance_blinding_nonce" "', argument " "2"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg2 = (unsigned char *) buf;
    arg3 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_psbt_input_get_issuance_blinding_nonce((struct wally_psbt_input const *)arg1,arg2,arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg4);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_input_get_issuance_blinding_nonce_len(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_input *arg1 = (struct wally_psbt_input *) 0 ;
  size_t *arg2 = (size_t *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  size_t written = 0; arg2 = (size_t *)&written;
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_input, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_input_get_issuance_blinding_nonce_len" "', argument " "1"" of type '" "struct wally_psbt_input const *""'"); 
  }
  arg1 = (struct wally_psbt_input *)(argp1);
  {
    result = (int)wally_psbt_input_get_issuance_blinding_nonce_len((struct wally_psbt_input const *)arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg2);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_input_set_issuance_blinding_nonce(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_input *arg1 = (struct wally_psbt_input *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_input_set_issuance_blinding_nonce", 2, 2, swig_obj)) SWIG_fail;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_input, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_input_set_issuance_blinding_nonce" "', argument " "1"" of type '" "struct wally_psbt_input *""'"); 
  }
  arg1 = (struct wally_psbt_input *)(argp1);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg3 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_input_set_issuance_blinding_nonce" "', argument " "2"" of type '" "(const unsigned char* nonce, size_t nonce_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg2 = (unsigned char *) buf;
      arg3 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_psbt_input_set_issuance_blinding_nonce(arg1,(unsigned char const *)arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_input_clear_issuance_blinding_nonce(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_input *arg1 = (struct wally_psbt_input *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_input, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_input_clear_issuance_blinding_nonce" "', argument " "1"" of type '" "struct wally_psbt_input *""'"); 
  }
  arg1 = (struct wally_psbt_input *)(argp1);
  {
    result = (int)wally_psbt_input_clear_issuance_blinding_nonce(arg1);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_input_get_issuance_asset_entropy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_input *arg1 = (struct wally_psbt_input *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  size_t *arg4 = (size_t *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg4 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_input_get_issuance_asset_entropy", 2, 2, swig_obj)) SWIG_fail;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_input, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_input_get_issuance_asset_entropy" "', argument " "1"" of type '" "struct wally_psbt_input const *""'"); 
  }
  arg1 = (struct wally_psbt_input *)(argp1);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_input_get_issuance_asset_entropy" "', argument " "2"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg2 = (unsigned char *) buf;
    arg3 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_psbt_input_get_issuance_asset_entropy((struct wally_psbt_input const *)arg1,arg2,arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg4);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_input_get_issuance_asset_entropy_len(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_input *arg1 = (struct wally_psbt_input *) 0 ;
  size_t *arg2 = (size_t *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  size_t written = 0; arg2 = (size_t *)&written;
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_input, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_input_get_issuance_asset_entropy_len" "', argument " "1"" of type '" "struct wally_psbt_input const *""'"); 
  }
  arg1 = (struct wally_psbt_input *)(argp1);
  {
    result = (int)wally_psbt_input_get_issuance_asset_entropy_len((struct wally_psbt_input const *)arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg2);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_input_set_issuance_asset_entropy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_input *arg1 = (struct wally_psbt_input *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_input_set_issuance_asset_entropy", 2, 2, swig_obj)) SWIG_fail;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_input, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_input_set_issuance_asset_entropy" "', argument " "1"" of type '" "struct wally_psbt_input *""'"); 
  }
  arg1 = (struct wally_psbt_input *)(argp1);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg3 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_input_set_issuance_asset_entropy" "', argument " "2"" of type '" "(const unsigned char* entropy, size_t entropy_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg2 = (unsigned char *) buf;
      arg3 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_psbt_input_set_issuance_asset_entropy(arg1,(unsigned char const *)arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_input_clear_issuance_asset_entropy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_input *arg1 = (struct wally_psbt_input *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_input, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_input_clear_issuance_asset_entropy" "', argument " "1"" of type '" "struct wally_psbt_input *""'"); 
  }
  arg1 = (struct wally_psbt_input *)(argp1);
  {
    result = (int)wally_psbt_input_clear_issuance_asset_entropy(arg1);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_input_get_issuance_amount_blinding_rangeproof(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_input *arg1 = (struct wally_psbt_input *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  size_t *arg4 = (size_t *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg4 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_input_get_issuance_amount_blinding_rangeproof", 2, 2, swig_obj)) SWIG_fail;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_input, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_input_get_issuance_amount_blinding_rangeproof" "', argument " "1"" of type '" "struct wally_psbt_input const *""'"); 
  }
  arg1 = (struct wally_psbt_input *)(argp1);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_input_get_issuance_amount_blinding_rangeproof" "', argument " "2"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg2 = (unsigned char *) buf;
    arg3 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_psbt_input_get_issuance_amount_blinding_rangeproof((struct wally_psbt_input const *)arg1,arg2,arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg4);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_input_get_issuance_amount_blinding_rangeproof_len(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_input *arg1 = (struct wally_psbt_input *) 0 ;
  size_t *arg2 = (size_t *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  size_t written = 0; arg2 = (size_t *)&written;
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_input, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_input_get_issuance_amount_blinding_rangeproof_len" "', argument " "1"" of type '" "struct wally_psbt_input const *""'"); 
  }
  arg1 = (struct wally_psbt_input *)(argp1);
  {
    result = (int)wally_psbt_input_get_issuance_amount_blinding_rangeproof_len((struct wally_psbt_input const *)arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg2);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_input_set_issuance_amount_blinding_rangeproof(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_input *arg1 = (struct wally_psbt_input *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_input_set_issuance_amount_blinding_rangeproof", 2, 2, swig_obj)) SWIG_fail;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_input, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_input_set_issuance_amount_blinding_rangeproof" "', argument " "1"" of type '" "struct wally_psbt_input *""'"); 
  }
  arg1 = (struct wally_psbt_input *)(argp1);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg3 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_input_set_issuance_amount_blinding_rangeproof" "', argument " "2"" of type '" "(const unsigned char* rangeproof, size_t rangeproof_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg2 = (unsigned char *) buf;
      arg3 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_psbt_input_set_issuance_amount_blinding_rangeproof(arg1,(unsigned char const *)arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_input_clear_issuance_amount_blinding_rangeproof(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_input *arg1 = (struct wally_psbt_input *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_input, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_input_clear_issuance_amount_blinding_rangeproof" "', argument " "1"" of type '" "struct wally_psbt_input *""'"); 
  }
  arg1 = (struct wally_psbt_input *)(argp1);
  {
    result = (int)wally_psbt_input_clear_issuance_amount_blinding_rangeproof(arg1);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_input_get_inflation_keys_commitment(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_input *arg1 = (struct wally_psbt_input *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  size_t *arg4 = (size_t *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg4 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_input_get_inflation_keys_commitment", 2, 2, swig_obj)) SWIG_fail;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_input, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_input_get_inflation_keys_commitment" "', argument " "1"" of type '" "struct wally_psbt_input const *""'"); 
  }
  arg1 = (struct wally_psbt_input *)(argp1);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_input_get_inflation_keys_commitment" "', argument " "2"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg2 = (unsigned char *) buf;
    arg3 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_psbt_input_get_inflation_keys_commitment((struct wally_psbt_input const *)arg1,arg2,arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg4);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_input_get_inflation_keys_commitment_len(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_input *arg1 = (struct wally_psbt_input *) 0 ;
  size_t *arg2 = (size_t *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  size_t written = 0; arg2 = (size_t *)&written;
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_input, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_input_get_inflation_keys_commitment_len" "', argument " "1"" of type '" "struct wally_psbt_input const *""'"); 
  }
  arg1 = (struct wally_psbt_input *)(argp1);
  {
    result = (int)wally_psbt_input_get_inflation_keys_commitment_len((struct wally_psbt_input const *)arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg2);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_input_set_inflation_keys_commitment(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_input *arg1 = (struct wally_psbt_input *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_input_set_inflation_keys_commitment", 2, 2, swig_obj)) SWIG_fail;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_input, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_input_set_inflation_keys_commitment" "', argument " "1"" of type '" "struct wally_psbt_input *""'"); 
  }
  arg1 = (struct wally_psbt_input *)(argp1);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg3 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_input_set_inflation_keys_commitment" "', argument " "2"" of type '" "(const unsigned char* commitment, size_t commitment_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg2 = (unsigned char *) buf;
      arg3 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_psbt_input_set_inflation_keys_commitment(arg1,(unsigned char const *)arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_input_clear_inflation_keys_commitment(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_input *arg1 = (struct wally_psbt_input *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_input, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_input_clear_inflation_keys_commitment" "', argument " "1"" of type '" "struct wally_psbt_input *""'"); 
  }
  arg1 = (struct wally_psbt_input *)(argp1);
  {
    result = (int)wally_psbt_input_clear_inflation_keys_commitment(arg1);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_input_get_inflation_keys_rangeproof(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_input *arg1 = (struct wally_psbt_input *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  size_t *arg4 = (size_t *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg4 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_input_get_inflation_keys_rangeproof", 2, 2, swig_obj)) SWIG_fail;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_input, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_input_get_inflation_keys_rangeproof" "', argument " "1"" of type '" "struct wally_psbt_input const *""'"); 
  }
  arg1 = (struct wally_psbt_input *)(argp1);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_input_get_inflation_keys_rangeproof" "', argument " "2"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg2 = (unsigned char *) buf;
    arg3 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_psbt_input_get_inflation_keys_rangeproof((struct wally_psbt_input const *)arg1,arg2,arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg4);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_input_get_inflation_keys_rangeproof_len(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_input *arg1 = (struct wally_psbt_input *) 0 ;
  size_t *arg2 = (size_t *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  size_t written = 0; arg2 = (size_t *)&written;
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_input, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_input_get_inflation_keys_rangeproof_len" "', argument " "1"" of type '" "struct wally_psbt_input const *""'"); 
  }
  arg1 = (struct wally_psbt_input *)(argp1);
  {
    result = (int)wally_psbt_input_get_inflation_keys_rangeproof_len((struct wally_psbt_input const *)arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg2);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_input_set_inflation_keys_rangeproof(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_input *arg1 = (struct wally_psbt_input *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_input_set_inflation_keys_rangeproof", 2, 2, swig_obj)) SWIG_fail;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_input, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_input_set_inflation_keys_rangeproof" "', argument " "1"" of type '" "struct wally_psbt_input *""'"); 
  }
  arg1 = (struct wally_psbt_input *)(argp1);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg3 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_input_set_inflation_keys_rangeproof" "', argument " "2"" of type '" "(const unsigned char* rangeproof, size_t rangeproof_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg2 = (unsigned char *) buf;
      arg3 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_psbt_input_set_inflation_keys_rangeproof(arg1,(unsigned char const *)arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_input_clear_inflation_keys_rangeproof(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_input *arg1 = (struct wally_psbt_input *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_input, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_input_clear_inflation_keys_rangeproof" "', argument " "1"" of type '" "struct wally_psbt_input *""'"); 
  }
  arg1 = (struct wally_psbt_input *)(argp1);
  {
    result = (int)wally_psbt_input_clear_inflation_keys_rangeproof(arg1);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_input_get_inflation_keys_blinding_rangeproof(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_input *arg1 = (struct wally_psbt_input *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  size_t *arg4 = (size_t *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg4 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_input_get_inflation_keys_blinding_rangeproof", 2, 2, swig_obj)) SWIG_fail;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_input, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_input_get_inflation_keys_blinding_rangeproof" "', argument " "1"" of type '" "struct wally_psbt_input const *""'"); 
  }
  arg1 = (struct wally_psbt_input *)(argp1);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_input_get_inflation_keys_blinding_rangeproof" "', argument " "2"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg2 = (unsigned char *) buf;
    arg3 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_psbt_input_get_inflation_keys_blinding_rangeproof((struct wally_psbt_input const *)arg1,arg2,arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg4);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_input_get_inflation_keys_blinding_rangeproof_len(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_input *arg1 = (struct wally_psbt_input *) 0 ;
  size_t *arg2 = (size_t *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  size_t written = 0; arg2 = (size_t *)&written;
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_input, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_input_get_inflation_keys_blinding_rangeproof_len" "', argument " "1"" of type '" "struct wally_psbt_input const *""'"); 
  }
  arg1 = (struct wally_psbt_input *)(argp1);
  {
    result = (int)wally_psbt_input_get_inflation_keys_blinding_rangeproof_len((struct wally_psbt_input const *)arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg2);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_input_set_inflation_keys_blinding_rangeproof(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_input *arg1 = (struct wally_psbt_input *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_input_set_inflation_keys_blinding_rangeproof", 2, 2, swig_obj)) SWIG_fail;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_input, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_input_set_inflation_keys_blinding_rangeproof" "', argument " "1"" of type '" "struct wally_psbt_input *""'"); 
  }
  arg1 = (struct wally_psbt_input *)(argp1);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg3 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_input_set_inflation_keys_blinding_rangeproof" "', argument " "2"" of type '" "(const unsigned char* rangeproof, size_t rangeproof_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg2 = (unsigned char *) buf;
      arg3 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_psbt_input_set_inflation_keys_blinding_rangeproof(arg1,(unsigned char const *)arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_input_clear_inflation_keys_blinding_rangeproof(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_input *arg1 = (struct wally_psbt_input *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_input, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_input_clear_inflation_keys_blinding_rangeproof" "', argument " "1"" of type '" "struct wally_psbt_input *""'"); 
  }
  arg1 = (struct wally_psbt_input *)(argp1);
  {
    result = (int)wally_psbt_input_clear_inflation_keys_blinding_rangeproof(arg1);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_input_get_utxo_rangeproof(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_input *arg1 = (struct wally_psbt_input *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  size_t *arg4 = (size_t *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg4 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_input_get_utxo_rangeproof", 2, 2, swig_obj)) SWIG_fail;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_input, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_input_get_utxo_rangeproof" "', argument " "1"" of type '" "struct wally_psbt_input const *""'"); 
  }
  arg1 = (struct wally_psbt_input *)(argp1);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_input_get_utxo_rangeproof" "', argument " "2"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg2 = (unsigned char *) buf;
    arg3 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_psbt_input_get_utxo_rangeproof((struct wally_psbt_input const *)arg1,arg2,arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg4);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_input_get_utxo_rangeproof_len(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_input *arg1 = (struct wally_psbt_input *) 0 ;
  size_t *arg2 = (size_t *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  size_t written = 0; arg2 = (size_t *)&written;
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_input, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_input_get_utxo_rangeproof_len" "', argument " "1"" of type '" "struct wally_psbt_input const *""'"); 
  }
  arg1 = (struct wally_psbt_input *)(argp1);
  {
    result = (int)wally_psbt_input_get_utxo_rangeproof_len((struct wally_psbt_input const *)arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg2);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_input_set_utxo_rangeproof(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_input *arg1 = (struct wally_psbt_input *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_input_set_utxo_rangeproof", 2, 2, swig_obj)) SWIG_fail;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_input, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_input_set_utxo_rangeproof" "', argument " "1"" of type '" "struct wally_psbt_input *""'"); 
  }
  arg1 = (struct wally_psbt_input *)(argp1);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg3 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_input_set_utxo_rangeproof" "', argument " "2"" of type '" "(const unsigned char* rangeproof, size_t rangeproof_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg2 = (unsigned char *) buf;
      arg3 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_psbt_input_set_utxo_rangeproof(arg1,(unsigned char const *)arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_input_clear_utxo_rangeproof(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_input *arg1 = (struct wally_psbt_input *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_input, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_input_clear_utxo_rangeproof" "', argument " "1"" of type '" "struct wally_psbt_input *""'"); 
  }
  arg1 = (struct wally_psbt_input *)(argp1);
  {
    result = (int)wally_psbt_input_clear_utxo_rangeproof(arg1);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_input_generate_explicit_proofs(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_input *arg1 = (struct wally_psbt_input *) 0 ;
  uint64_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  unsigned char *arg5 = (unsigned char *) 0 ;
  size_t arg6 ;
  unsigned char *arg7 = (unsigned char *) 0 ;
  size_t arg8 ;
  unsigned char *arg9 = (unsigned char *) 0 ;
  size_t arg10 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned long long val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[6] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_input_generate_explicit_proofs", 6, 6, swig_obj)) SWIG_fail;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_input, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_input_generate_explicit_proofs" "', argument " "1"" of type '" "struct wally_psbt_input *""'"); 
  }
  arg1 = (struct wally_psbt_input *)(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_long_SS_long(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_input_generate_explicit_proofs" "', argument " "2"" of type '" "uint64_t""'");
  } 
  arg2 = (uint64_t)(val2);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[2] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_input_generate_explicit_proofs" "', argument " "3"" of type '" "(const unsigned char* asset, size_t asset_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[3] == Py_None)
    arg6 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[3], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_input_generate_explicit_proofs" "', argument " "5"" of type '" "(const unsigned char* abf, size_t abf_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg5 = (unsigned char *) buf;
      arg6 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[4] == Py_None)
    arg8 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[4], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_input_generate_explicit_proofs" "', argument " "7"" of type '" "(const unsigned char* vbf, size_t vbf_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg7 = (unsigned char *) buf;
      arg8 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[5] == Py_None)
    arg10 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[5], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_input_generate_explicit_proofs" "', argument " "9"" of type '" "(const unsigned char* entropy, size_t entropy_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg9 = (unsigned char *) buf;
      arg10 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_psbt_input_generate_explicit_proofs(arg1,arg2,(unsigned char const *)arg3,arg4,(unsigned char const *)arg5,arg6,(unsigned char const *)arg7,arg8,(unsigned char const *)arg9,arg10);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_input_is_finalized(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_input *arg1 = (struct wally_psbt_input *) 0 ;
  size_t *arg2 = (size_t *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  size_t written = 0; arg2 = (size_t *)&written;
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_input, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_input_is_finalized" "', argument " "1"" of type '" "struct wally_psbt_input const *""'"); 
  }
  arg1 = (struct wally_psbt_input *)(argp1);
  {
    result = (int)wally_psbt_input_is_finalized((struct wally_psbt_input const *)arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg2);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_output_set_redeem_script(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_output *arg1 = (struct wally_psbt_output *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_output_set_redeem_script", 2, 2, swig_obj)) SWIG_fail;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_output, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_output_set_redeem_script" "', argument " "1"" of type '" "struct wally_psbt_output *""'"); 
  }
  arg1 = (struct wally_psbt_output *)(argp1);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg3 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_output_set_redeem_script" "', argument " "2"" of type '" "(const unsigned char* script, size_t script_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg2 = (unsigned char *) buf;
      arg3 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_psbt_output_set_redeem_script(arg1,(unsigned char const *)arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_output_set_witness_script(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_output *arg1 = (struct wally_psbt_output *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_output_set_witness_script", 2, 2, swig_obj)) SWIG_fail;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_output, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_output_set_witness_script" "', argument " "1"" of type '" "struct wally_psbt_output *""'"); 
  }
  arg1 = (struct wally_psbt_output *)(argp1);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg3 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_output_set_witness_script" "', argument " "2"" of type '" "(const unsigned char* script, size_t script_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg2 = (unsigned char *) buf;
      arg3 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_psbt_output_set_witness_script(arg1,(unsigned char const *)arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_output_set_keypaths(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_output *arg1 = (struct wally_psbt_output *) 0 ;
  struct wally_map *arg2 = (struct wally_map *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_output_set_keypaths", 2, 2, swig_obj)) SWIG_fail;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_output, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_output_set_keypaths" "', argument " "1"" of type '" "struct wally_psbt_output *""'"); 
  }
  arg1 = (struct wally_psbt_output *)(argp1);
  {
    arg2 = swig_obj[1] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[1], "struct wally_map *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_output_set_keypaths" "', argument " "2"" of type '" "(wally_map)""'");
    }
  }
  {
    result = (int)wally_psbt_output_set_keypaths(arg1,(struct wally_map const *)arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_output_find_keypath(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_output *arg1 = (struct wally_psbt_output *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  size_t *arg4 = (size_t *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg4 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_output_find_keypath", 2, 2, swig_obj)) SWIG_fail;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_output, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_output_find_keypath" "', argument " "1"" of type '" "struct wally_psbt_output const *""'"); 
  }
  arg1 = (struct wally_psbt_output *)(argp1);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg3 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_output_find_keypath" "', argument " "2"" of type '" "(const unsigned char* pub_key, size_t pub_key_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg2 = (unsigned char *) buf;
      arg3 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_psbt_output_find_keypath((struct wally_psbt_output const *)arg1,(unsigned char const *)arg2,arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg4);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_output_keypath_add(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_output *arg1 = (struct wally_psbt_output *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  unsigned char *arg4 = (unsigned char *) 0 ;
  size_t arg5 ;
  uint32_t *arg6 = (uint32_t *) 0 ;
  size_t arg7 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  uint32_t tmp_buf6[MAX_LOCAL_STACK/sizeof(uint32_t)] ;
  PyObject *swig_obj[4] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_output_keypath_add", 4, 4, swig_obj)) SWIG_fail;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_output, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_output_keypath_add" "', argument " "1"" of type '" "struct wally_psbt_output *""'"); 
  }
  arg1 = (struct wally_psbt_output *)(argp1);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg3 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_output_keypath_add" "', argument " "2"" of type '" "(const unsigned char* pub_key, size_t pub_key_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg2 = (unsigned char *) buf;
      arg3 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[2] == Py_None)
    arg5 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_output_keypath_add" "', argument " "4"" of type '" "(const unsigned char* fingerprint, size_t fingerprint_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg4 = (unsigned char *) buf;
      arg5 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    size_t i;
    if (!PyList_Check(swig_obj[3])) {
      check_result(WALLY_EINVAL);
      SWIG_fail;
    }
    arg7 = PyList_Size(swig_obj[3]);
    arg6 = tmp_buf6;
    if (arg7 * sizeof(uint32_t) > sizeof(tmp_buf6))
    if (!(arg6 = (uint32_t *) wally_malloc((arg7) * sizeof(uint32_t)))) {
      check_result(WALLY_ENOMEM);
      SWIG_fail;
    }
    for (i = 0; i < arg7; ++i) {
      PyObject *item = PyList_GET_ITEM(swig_obj[3], i);
      unsigned long long v;
      if (!ulonglong_cast(item, &v) || v > 0xffffffffull) {
        PyErr_SetString(PyExc_OverflowError, "Invalid unsigned integer");
        SWIG_fail;
      }
      arg6[i] = (uint32_t)v;
    }
  }
  {
    result = (int)wally_psbt_output_keypath_add(arg1,(unsigned char const *)arg2,arg3,(unsigned char const *)arg4,arg5,(unsigned int const *)arg6,arg7);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    if (arg6 && arg6 != tmp_buf6)
    wally_free(arg6);
  }
  return resultobj;
fail:
  {
    if (arg6 && arg6 != tmp_buf6)
    wally_free(arg6);
  }
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_output_taproot_keypath_add(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_output *arg1 = (struct wally_psbt_output *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  unsigned char *arg4 = (unsigned char *) 0 ;
  size_t arg5 ;
  unsigned char *arg6 = (unsigned char *) 0 ;
  size_t arg7 ;
  uint32_t *arg8 = (uint32_t *) 0 ;
  size_t arg9 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  uint32_t tmp_buf8[MAX_LOCAL_STACK/sizeof(uint32_t)] ;
  PyObject *swig_obj[5] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_output_taproot_keypath_add", 5, 5, swig_obj)) SWIG_fail;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_output, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_output_taproot_keypath_add" "', argument " "1"" of type '" "struct wally_psbt_output *""'"); 
  }
  arg1 = (struct wally_psbt_output *)(argp1);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg3 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_output_taproot_keypath_add" "', argument " "2"" of type '" "(const unsigned char* pub_key, size_t pub_key_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg2 = (unsigned char *) buf;
      arg3 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[2] == Py_None)
    arg5 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_output_taproot_keypath_add" "', argument " "4"" of type '" "(const unsigned char* tapleaf_hashes, size_t tapleaf_hashes_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg4 = (unsigned char *) buf;
      arg5 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[3] == Py_None)
    arg7 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[3], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_output_taproot_keypath_add" "', argument " "6"" of type '" "(const unsigned char* fingerprint, size_t fingerprint_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg6 = (unsigned char *) buf;
      arg7 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    size_t i;
    if (!PyList_Check(swig_obj[4])) {
      check_result(WALLY_EINVAL);
      SWIG_fail;
    }
    arg9 = PyList_Size(swig_obj[4]);
    arg8 = tmp_buf8;
    if (arg9 * sizeof(uint32_t) > sizeof(tmp_buf8))
    if (!(arg8 = (uint32_t *) wally_malloc((arg9) * sizeof(uint32_t)))) {
      check_result(WALLY_ENOMEM);
      SWIG_fail;
    }
    for (i = 0; i < arg9; ++i) {
      PyObject *item = PyList_GET_ITEM(swig_obj[4], i);
      unsigned long long v;
      if (!ulonglong_cast(item, &v) || v > 0xffffffffull) {
        PyErr_SetString(PyExc_OverflowError, "Invalid unsigned integer");
        SWIG_fail;
      }
      arg8[i] = (uint32_t)v;
    }
  }
  {
    result = (int)wally_psbt_output_taproot_keypath_add(arg1,(unsigned char const *)arg2,arg3,(unsigned char const *)arg4,arg5,(unsigned char const *)arg6,arg7,(unsigned int const *)arg8,arg9);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    if (arg8 && arg8 != tmp_buf8)
    wally_free(arg8);
  }
  return resultobj;
fail:
  {
    if (arg8 && arg8 != tmp_buf8)
    wally_free(arg8);
  }
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_output_set_unknowns(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_output *arg1 = (struct wally_psbt_output *) 0 ;
  struct wally_map *arg2 = (struct wally_map *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_output_set_unknowns", 2, 2, swig_obj)) SWIG_fail;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_output, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_output_set_unknowns" "', argument " "1"" of type '" "struct wally_psbt_output *""'"); 
  }
  arg1 = (struct wally_psbt_output *)(argp1);
  {
    arg2 = swig_obj[1] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[1], "struct wally_map *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_output_set_unknowns" "', argument " "2"" of type '" "(wally_map)""'");
    }
  }
  {
    result = (int)wally_psbt_output_set_unknowns(arg1,(struct wally_map const *)arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_output_find_unknown(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_output *arg1 = (struct wally_psbt_output *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  size_t *arg4 = (size_t *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg4 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_output_find_unknown", 2, 2, swig_obj)) SWIG_fail;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_output, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_output_find_unknown" "', argument " "1"" of type '" "struct wally_psbt_output const *""'"); 
  }
  arg1 = (struct wally_psbt_output *)(argp1);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg3 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_output_find_unknown" "', argument " "2"" of type '" "(const unsigned char* key, size_t key_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg2 = (unsigned char *) buf;
      arg3 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_psbt_output_find_unknown((struct wally_psbt_output const *)arg1,(unsigned char const *)arg2,arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg4);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_output_set_amount(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_output *arg1 = (struct wally_psbt_output *) 0 ;
  uint64_t arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned long long val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_output_set_amount", 2, 2, swig_obj)) SWIG_fail;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_output, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_output_set_amount" "', argument " "1"" of type '" "struct wally_psbt_output *""'"); 
  }
  arg1 = (struct wally_psbt_output *)(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_long_SS_long(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_output_set_amount" "', argument " "2"" of type '" "uint64_t""'");
  } 
  arg2 = (uint64_t)(val2);
  {
    result = (int)wally_psbt_output_set_amount(arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_output_clear_amount(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_output *arg1 = (struct wally_psbt_output *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_output, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_output_clear_amount" "', argument " "1"" of type '" "struct wally_psbt_output *""'"); 
  }
  arg1 = (struct wally_psbt_output *)(argp1);
  {
    result = (int)wally_psbt_output_clear_amount(arg1);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_output_set_script(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_output *arg1 = (struct wally_psbt_output *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_output_set_script", 2, 2, swig_obj)) SWIG_fail;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_output, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_output_set_script" "', argument " "1"" of type '" "struct wally_psbt_output *""'"); 
  }
  arg1 = (struct wally_psbt_output *)(argp1);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg3 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_output_set_script" "', argument " "2"" of type '" "(const unsigned char* script, size_t script_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg2 = (unsigned char *) buf;
      arg3 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_psbt_output_set_script(arg1,(unsigned char const *)arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_output_set_taproot_internal_key(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_output *arg1 = (struct wally_psbt_output *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_output_set_taproot_internal_key", 2, 2, swig_obj)) SWIG_fail;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_output, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_output_set_taproot_internal_key" "', argument " "1"" of type '" "struct wally_psbt_output *""'"); 
  }
  arg1 = (struct wally_psbt_output *)(argp1);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg3 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_output_set_taproot_internal_key" "', argument " "2"" of type '" "(const unsigned char* pub_key, size_t pub_key_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg2 = (unsigned char *) buf;
      arg3 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_psbt_output_set_taproot_internal_key(arg1,(unsigned char const *)arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_output_set_blinder_index(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_output *arg1 = (struct wally_psbt_output *) 0 ;
  uint32_t arg2 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_output_set_blinder_index", 2, 2, swig_obj)) SWIG_fail;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_output, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_output_set_blinder_index" "', argument " "1"" of type '" "struct wally_psbt_output *""'"); 
  }
  arg1 = (struct wally_psbt_output *)(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_output_set_blinder_index" "', argument " "2"" of type '" "uint32_t""'");
  } 
  arg2 = (uint32_t)(val2);
  {
    result = (int)wally_psbt_output_set_blinder_index(arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_output_clear_blinder_index(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_output *arg1 = (struct wally_psbt_output *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_output, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_output_clear_blinder_index" "', argument " "1"" of type '" "struct wally_psbt_output *""'"); 
  }
  arg1 = (struct wally_psbt_output *)(argp1);
  {
    result = (int)wally_psbt_output_clear_blinder_index(arg1);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_output_get_value_commitment(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_output *arg1 = (struct wally_psbt_output *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  size_t *arg4 = (size_t *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg4 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_output_get_value_commitment", 2, 2, swig_obj)) SWIG_fail;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_output, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_output_get_value_commitment" "', argument " "1"" of type '" "struct wally_psbt_output const *""'"); 
  }
  arg1 = (struct wally_psbt_output *)(argp1);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_output_get_value_commitment" "', argument " "2"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg2 = (unsigned char *) buf;
    arg3 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_psbt_output_get_value_commitment((struct wally_psbt_output const *)arg1,arg2,arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg4);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_output_get_value_commitment_len(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_output *arg1 = (struct wally_psbt_output *) 0 ;
  size_t *arg2 = (size_t *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  size_t written = 0; arg2 = (size_t *)&written;
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_output, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_output_get_value_commitment_len" "', argument " "1"" of type '" "struct wally_psbt_output const *""'"); 
  }
  arg1 = (struct wally_psbt_output *)(argp1);
  {
    result = (int)wally_psbt_output_get_value_commitment_len((struct wally_psbt_output const *)arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg2);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_output_set_value_commitment(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_output *arg1 = (struct wally_psbt_output *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_output_set_value_commitment", 2, 2, swig_obj)) SWIG_fail;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_output, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_output_set_value_commitment" "', argument " "1"" of type '" "struct wally_psbt_output *""'"); 
  }
  arg1 = (struct wally_psbt_output *)(argp1);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg3 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_output_set_value_commitment" "', argument " "2"" of type '" "(const unsigned char* commitment, size_t commitment_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg2 = (unsigned char *) buf;
      arg3 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_psbt_output_set_value_commitment(arg1,(unsigned char const *)arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_output_clear_value_commitment(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_output *arg1 = (struct wally_psbt_output *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_output, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_output_clear_value_commitment" "', argument " "1"" of type '" "struct wally_psbt_output *""'"); 
  }
  arg1 = (struct wally_psbt_output *)(argp1);
  {
    result = (int)wally_psbt_output_clear_value_commitment(arg1);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_output_get_asset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_output *arg1 = (struct wally_psbt_output *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  size_t *arg4 = (size_t *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg4 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_output_get_asset", 2, 2, swig_obj)) SWIG_fail;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_output, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_output_get_asset" "', argument " "1"" of type '" "struct wally_psbt_output const *""'"); 
  }
  arg1 = (struct wally_psbt_output *)(argp1);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_output_get_asset" "', argument " "2"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg2 = (unsigned char *) buf;
    arg3 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_psbt_output_get_asset((struct wally_psbt_output const *)arg1,arg2,arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg4);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_output_get_asset_len(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_output *arg1 = (struct wally_psbt_output *) 0 ;
  size_t *arg2 = (size_t *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  size_t written = 0; arg2 = (size_t *)&written;
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_output, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_output_get_asset_len" "', argument " "1"" of type '" "struct wally_psbt_output const *""'"); 
  }
  arg1 = (struct wally_psbt_output *)(argp1);
  {
    result = (int)wally_psbt_output_get_asset_len((struct wally_psbt_output const *)arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg2);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_output_set_asset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_output *arg1 = (struct wally_psbt_output *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_output_set_asset", 2, 2, swig_obj)) SWIG_fail;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_output, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_output_set_asset" "', argument " "1"" of type '" "struct wally_psbt_output *""'"); 
  }
  arg1 = (struct wally_psbt_output *)(argp1);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg3 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_output_set_asset" "', argument " "2"" of type '" "(const unsigned char* asset, size_t asset_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg2 = (unsigned char *) buf;
      arg3 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_psbt_output_set_asset(arg1,(unsigned char const *)arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_output_clear_asset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_output *arg1 = (struct wally_psbt_output *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_output, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_output_clear_asset" "', argument " "1"" of type '" "struct wally_psbt_output *""'"); 
  }
  arg1 = (struct wally_psbt_output *)(argp1);
  {
    result = (int)wally_psbt_output_clear_asset(arg1);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_output_get_asset_commitment(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_output *arg1 = (struct wally_psbt_output *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  size_t *arg4 = (size_t *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg4 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_output_get_asset_commitment", 2, 2, swig_obj)) SWIG_fail;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_output, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_output_get_asset_commitment" "', argument " "1"" of type '" "struct wally_psbt_output const *""'"); 
  }
  arg1 = (struct wally_psbt_output *)(argp1);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_output_get_asset_commitment" "', argument " "2"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg2 = (unsigned char *) buf;
    arg3 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_psbt_output_get_asset_commitment((struct wally_psbt_output const *)arg1,arg2,arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg4);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_output_get_asset_commitment_len(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_output *arg1 = (struct wally_psbt_output *) 0 ;
  size_t *arg2 = (size_t *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  size_t written = 0; arg2 = (size_t *)&written;
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_output, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_output_get_asset_commitment_len" "', argument " "1"" of type '" "struct wally_psbt_output const *""'"); 
  }
  arg1 = (struct wally_psbt_output *)(argp1);
  {
    result = (int)wally_psbt_output_get_asset_commitment_len((struct wally_psbt_output const *)arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg2);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_output_set_asset_commitment(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_output *arg1 = (struct wally_psbt_output *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_output_set_asset_commitment", 2, 2, swig_obj)) SWIG_fail;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_output, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_output_set_asset_commitment" "', argument " "1"" of type '" "struct wally_psbt_output *""'"); 
  }
  arg1 = (struct wally_psbt_output *)(argp1);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg3 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_output_set_asset_commitment" "', argument " "2"" of type '" "(const unsigned char* commitment, size_t commitment_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg2 = (unsigned char *) buf;
      arg3 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_psbt_output_set_asset_commitment(arg1,(unsigned char const *)arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_output_clear_asset_commitment(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_output *arg1 = (struct wally_psbt_output *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_output, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_output_clear_asset_commitment" "', argument " "1"" of type '" "struct wally_psbt_output *""'"); 
  }
  arg1 = (struct wally_psbt_output *)(argp1);
  {
    result = (int)wally_psbt_output_clear_asset_commitment(arg1);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_output_get_value_rangeproof(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_output *arg1 = (struct wally_psbt_output *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  size_t *arg4 = (size_t *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg4 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_output_get_value_rangeproof", 2, 2, swig_obj)) SWIG_fail;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_output, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_output_get_value_rangeproof" "', argument " "1"" of type '" "struct wally_psbt_output const *""'"); 
  }
  arg1 = (struct wally_psbt_output *)(argp1);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_output_get_value_rangeproof" "', argument " "2"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg2 = (unsigned char *) buf;
    arg3 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_psbt_output_get_value_rangeproof((struct wally_psbt_output const *)arg1,arg2,arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg4);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_output_get_value_rangeproof_len(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_output *arg1 = (struct wally_psbt_output *) 0 ;
  size_t *arg2 = (size_t *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  size_t written = 0; arg2 = (size_t *)&written;
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_output, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_output_get_value_rangeproof_len" "', argument " "1"" of type '" "struct wally_psbt_output const *""'"); 
  }
  arg1 = (struct wally_psbt_output *)(argp1);
  {
    result = (int)wally_psbt_output_get_value_rangeproof_len((struct wally_psbt_output const *)arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg2);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_output_set_value_rangeproof(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_output *arg1 = (struct wally_psbt_output *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_output_set_value_rangeproof", 2, 2, swig_obj)) SWIG_fail;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_output, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_output_set_value_rangeproof" "', argument " "1"" of type '" "struct wally_psbt_output *""'"); 
  }
  arg1 = (struct wally_psbt_output *)(argp1);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg3 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_output_set_value_rangeproof" "', argument " "2"" of type '" "(const unsigned char* rangeproof, size_t rangeproof_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg2 = (unsigned char *) buf;
      arg3 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_psbt_output_set_value_rangeproof(arg1,(unsigned char const *)arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_output_clear_value_rangeproof(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_output *arg1 = (struct wally_psbt_output *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_output, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_output_clear_value_rangeproof" "', argument " "1"" of type '" "struct wally_psbt_output *""'"); 
  }
  arg1 = (struct wally_psbt_output *)(argp1);
  {
    result = (int)wally_psbt_output_clear_value_rangeproof(arg1);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_output_get_asset_surjectionproof(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_output *arg1 = (struct wally_psbt_output *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  size_t *arg4 = (size_t *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg4 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_output_get_asset_surjectionproof", 2, 2, swig_obj)) SWIG_fail;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_output, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_output_get_asset_surjectionproof" "', argument " "1"" of type '" "struct wally_psbt_output const *""'"); 
  }
  arg1 = (struct wally_psbt_output *)(argp1);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_output_get_asset_surjectionproof" "', argument " "2"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg2 = (unsigned char *) buf;
    arg3 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_psbt_output_get_asset_surjectionproof((struct wally_psbt_output const *)arg1,arg2,arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg4);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_output_get_asset_surjectionproof_len(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_output *arg1 = (struct wally_psbt_output *) 0 ;
  size_t *arg2 = (size_t *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  size_t written = 0; arg2 = (size_t *)&written;
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_output, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_output_get_asset_surjectionproof_len" "', argument " "1"" of type '" "struct wally_psbt_output const *""'"); 
  }
  arg1 = (struct wally_psbt_output *)(argp1);
  {
    result = (int)wally_psbt_output_get_asset_surjectionproof_len((struct wally_psbt_output const *)arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg2);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_output_set_asset_surjectionproof(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_output *arg1 = (struct wally_psbt_output *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_output_set_asset_surjectionproof", 2, 2, swig_obj)) SWIG_fail;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_output, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_output_set_asset_surjectionproof" "', argument " "1"" of type '" "struct wally_psbt_output *""'"); 
  }
  arg1 = (struct wally_psbt_output *)(argp1);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg3 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_output_set_asset_surjectionproof" "', argument " "2"" of type '" "(const unsigned char* surjectionproof, size_t surjectionproof_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg2 = (unsigned char *) buf;
      arg3 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_psbt_output_set_asset_surjectionproof(arg1,(unsigned char const *)arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_output_clear_asset_surjectionproof(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_output *arg1 = (struct wally_psbt_output *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_output, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_output_clear_asset_surjectionproof" "', argument " "1"" of type '" "struct wally_psbt_output *""'"); 
  }
  arg1 = (struct wally_psbt_output *)(argp1);
  {
    result = (int)wally_psbt_output_clear_asset_surjectionproof(arg1);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_output_get_blinding_public_key(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_output *arg1 = (struct wally_psbt_output *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  size_t *arg4 = (size_t *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg4 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_output_get_blinding_public_key", 2, 2, swig_obj)) SWIG_fail;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_output, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_output_get_blinding_public_key" "', argument " "1"" of type '" "struct wally_psbt_output const *""'"); 
  }
  arg1 = (struct wally_psbt_output *)(argp1);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_output_get_blinding_public_key" "', argument " "2"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg2 = (unsigned char *) buf;
    arg3 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_psbt_output_get_blinding_public_key((struct wally_psbt_output const *)arg1,arg2,arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg4);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_output_get_blinding_public_key_len(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_output *arg1 = (struct wally_psbt_output *) 0 ;
  size_t *arg2 = (size_t *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  size_t written = 0; arg2 = (size_t *)&written;
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_output, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_output_get_blinding_public_key_len" "', argument " "1"" of type '" "struct wally_psbt_output const *""'"); 
  }
  arg1 = (struct wally_psbt_output *)(argp1);
  {
    result = (int)wally_psbt_output_get_blinding_public_key_len((struct wally_psbt_output const *)arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg2);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_output_set_blinding_public_key(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_output *arg1 = (struct wally_psbt_output *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_output_set_blinding_public_key", 2, 2, swig_obj)) SWIG_fail;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_output, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_output_set_blinding_public_key" "', argument " "1"" of type '" "struct wally_psbt_output *""'"); 
  }
  arg1 = (struct wally_psbt_output *)(argp1);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg3 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_output_set_blinding_public_key" "', argument " "2"" of type '" "(const unsigned char* pub_key, size_t pub_key_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg2 = (unsigned char *) buf;
      arg3 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_psbt_output_set_blinding_public_key(arg1,(unsigned char const *)arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_output_clear_blinding_public_key(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_output *arg1 = (struct wally_psbt_output *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_output, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_output_clear_blinding_public_key" "', argument " "1"" of type '" "struct wally_psbt_output *""'"); 
  }
  arg1 = (struct wally_psbt_output *)(argp1);
  {
    result = (int)wally_psbt_output_clear_blinding_public_key(arg1);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_output_get_ecdh_public_key(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_output *arg1 = (struct wally_psbt_output *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  size_t *arg4 = (size_t *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg4 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_output_get_ecdh_public_key", 2, 2, swig_obj)) SWIG_fail;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_output, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_output_get_ecdh_public_key" "', argument " "1"" of type '" "struct wally_psbt_output const *""'"); 
  }
  arg1 = (struct wally_psbt_output *)(argp1);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_output_get_ecdh_public_key" "', argument " "2"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg2 = (unsigned char *) buf;
    arg3 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_psbt_output_get_ecdh_public_key((struct wally_psbt_output const *)arg1,arg2,arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg4);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_output_get_ecdh_public_key_len(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_output *arg1 = (struct wally_psbt_output *) 0 ;
  size_t *arg2 = (size_t *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  size_t written = 0; arg2 = (size_t *)&written;
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_output, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_output_get_ecdh_public_key_len" "', argument " "1"" of type '" "struct wally_psbt_output const *""'"); 
  }
  arg1 = (struct wally_psbt_output *)(argp1);
  {
    result = (int)wally_psbt_output_get_ecdh_public_key_len((struct wally_psbt_output const *)arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg2);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_output_set_ecdh_public_key(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_output *arg1 = (struct wally_psbt_output *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_output_set_ecdh_public_key", 2, 2, swig_obj)) SWIG_fail;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_output, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_output_set_ecdh_public_key" "', argument " "1"" of type '" "struct wally_psbt_output *""'"); 
  }
  arg1 = (struct wally_psbt_output *)(argp1);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg3 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_output_set_ecdh_public_key" "', argument " "2"" of type '" "(const unsigned char* pub_key, size_t pub_key_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg2 = (unsigned char *) buf;
      arg3 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_psbt_output_set_ecdh_public_key(arg1,(unsigned char const *)arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_output_clear_ecdh_public_key(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_output *arg1 = (struct wally_psbt_output *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_output, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_output_clear_ecdh_public_key" "', argument " "1"" of type '" "struct wally_psbt_output *""'"); 
  }
  arg1 = (struct wally_psbt_output *)(argp1);
  {
    result = (int)wally_psbt_output_clear_ecdh_public_key(arg1);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_output_get_value_blinding_rangeproof(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_output *arg1 = (struct wally_psbt_output *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  size_t *arg4 = (size_t *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg4 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_output_get_value_blinding_rangeproof", 2, 2, swig_obj)) SWIG_fail;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_output, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_output_get_value_blinding_rangeproof" "', argument " "1"" of type '" "struct wally_psbt_output const *""'"); 
  }
  arg1 = (struct wally_psbt_output *)(argp1);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_output_get_value_blinding_rangeproof" "', argument " "2"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg2 = (unsigned char *) buf;
    arg3 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_psbt_output_get_value_blinding_rangeproof((struct wally_psbt_output const *)arg1,arg2,arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg4);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_output_get_value_blinding_rangeproof_len(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_output *arg1 = (struct wally_psbt_output *) 0 ;
  size_t *arg2 = (size_t *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  size_t written = 0; arg2 = (size_t *)&written;
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_output, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_output_get_value_blinding_rangeproof_len" "', argument " "1"" of type '" "struct wally_psbt_output const *""'"); 
  }
  arg1 = (struct wally_psbt_output *)(argp1);
  {
    result = (int)wally_psbt_output_get_value_blinding_rangeproof_len((struct wally_psbt_output const *)arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg2);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_output_set_value_blinding_rangeproof(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_output *arg1 = (struct wally_psbt_output *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_output_set_value_blinding_rangeproof", 2, 2, swig_obj)) SWIG_fail;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_output, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_output_set_value_blinding_rangeproof" "', argument " "1"" of type '" "struct wally_psbt_output *""'"); 
  }
  arg1 = (struct wally_psbt_output *)(argp1);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg3 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_output_set_value_blinding_rangeproof" "', argument " "2"" of type '" "(const unsigned char* rangeproof, size_t rangeproof_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg2 = (unsigned char *) buf;
      arg3 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_psbt_output_set_value_blinding_rangeproof(arg1,(unsigned char const *)arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_output_clear_value_blinding_rangeproof(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_output *arg1 = (struct wally_psbt_output *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_output, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_output_clear_value_blinding_rangeproof" "', argument " "1"" of type '" "struct wally_psbt_output *""'"); 
  }
  arg1 = (struct wally_psbt_output *)(argp1);
  {
    result = (int)wally_psbt_output_clear_value_blinding_rangeproof(arg1);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_output_get_asset_blinding_surjectionproof(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_output *arg1 = (struct wally_psbt_output *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  size_t *arg4 = (size_t *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg4 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_output_get_asset_blinding_surjectionproof", 2, 2, swig_obj)) SWIG_fail;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_output, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_output_get_asset_blinding_surjectionproof" "', argument " "1"" of type '" "struct wally_psbt_output const *""'"); 
  }
  arg1 = (struct wally_psbt_output *)(argp1);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_output_get_asset_blinding_surjectionproof" "', argument " "2"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg2 = (unsigned char *) buf;
    arg3 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_psbt_output_get_asset_blinding_surjectionproof((struct wally_psbt_output const *)arg1,arg2,arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg4);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_output_get_asset_blinding_surjectionproof_len(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_output *arg1 = (struct wally_psbt_output *) 0 ;
  size_t *arg2 = (size_t *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  size_t written = 0; arg2 = (size_t *)&written;
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_output, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_output_get_asset_blinding_surjectionproof_len" "', argument " "1"" of type '" "struct wally_psbt_output const *""'"); 
  }
  arg1 = (struct wally_psbt_output *)(argp1);
  {
    result = (int)wally_psbt_output_get_asset_blinding_surjectionproof_len((struct wally_psbt_output const *)arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg2);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_output_set_asset_blinding_surjectionproof(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_output *arg1 = (struct wally_psbt_output *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_output_set_asset_blinding_surjectionproof", 2, 2, swig_obj)) SWIG_fail;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_output, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_output_set_asset_blinding_surjectionproof" "', argument " "1"" of type '" "struct wally_psbt_output *""'"); 
  }
  arg1 = (struct wally_psbt_output *)(argp1);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg3 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_output_set_asset_blinding_surjectionproof" "', argument " "2"" of type '" "(const unsigned char* surjectionproof, size_t surjectionproof_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg2 = (unsigned char *) buf;
      arg3 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_psbt_output_set_asset_blinding_surjectionproof(arg1,(unsigned char const *)arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_output_clear_asset_blinding_surjectionproof(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_output *arg1 = (struct wally_psbt_output *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_output, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_output_clear_asset_blinding_surjectionproof" "', argument " "1"" of type '" "struct wally_psbt_output *""'"); 
  }
  arg1 = (struct wally_psbt_output *)(argp1);
  {
    result = (int)wally_psbt_output_clear_asset_blinding_surjectionproof(arg1);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_output_get_blinding_status(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt_output *arg1 = (struct wally_psbt_output *) 0 ;
  uint32_t arg2 ;
  size_t *arg3 = (size_t *) 0 ;
  void *argp1 = 0 ;
  int res1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg3 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_output_get_blinding_status", 2, 2, swig_obj)) SWIG_fail;
  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wally_psbt_output, 0 |  0 );
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_output_get_blinding_status" "', argument " "1"" of type '" "struct wally_psbt_output const *""'"); 
  }
  arg1 = (struct wally_psbt_output *)(argp1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_output_get_blinding_status" "', argument " "2"" of type '" "uint32_t""'");
  } 
  arg2 = (uint32_t)(val2);
  {
    result = (int)wally_psbt_output_get_blinding_status((struct wally_psbt_output const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg3);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_init_alloc(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  uint32_t arg1 ;
  size_t arg2 ;
  size_t arg3 ;
  size_t arg4 ;
  uint32_t arg5 ;
  struct wally_psbt **arg6 = (struct wally_psbt **) 0 ;
  unsigned int val1 ;
  int ecode1 = 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  size_t val3 ;
  int ecode3 = 0 ;
  size_t val4 ;
  int ecode4 = 0 ;
  unsigned int val5 ;
  int ecode5 = 0 ;
  struct wally_psbt *w6 ;
  PyObject *swig_obj[5] ;
  int result;
  
  {
    w6 = 0; arg6 = (struct wally_psbt **)&w6;
  }
  if (!SWIG_Python_UnpackTuple(args, "psbt_init_alloc", 5, 5, swig_obj)) SWIG_fail;
  ecode1 = SWIG_AsVal_unsigned_SS_int(swig_obj[0], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "psbt_init_alloc" "', argument " "1"" of type '" "uint32_t""'");
  } 
  arg1 = (uint32_t)(val1);
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_init_alloc" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  ecode3 = SWIG_AsVal_size_t(swig_obj[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "psbt_init_alloc" "', argument " "3"" of type '" "size_t""'");
  } 
  arg3 = (size_t)(val3);
  ecode4 = SWIG_AsVal_size_t(swig_obj[3], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "psbt_init_alloc" "', argument " "4"" of type '" "size_t""'");
  } 
  arg4 = (size_t)(val4);
  ecode5 = SWIG_AsVal_unsigned_SS_int(swig_obj[4], &val5);
  if (!SWIG_IsOK(ecode5)) {
    SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "psbt_init_alloc" "', argument " "5"" of type '" "uint32_t""'");
  } 
  arg5 = (uint32_t)(val5);
  {
    result = (int)wally_psbt_init_alloc(arg1,arg2,arg3,arg4,arg5,arg6);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    if (*arg6 != NULL) {
      Py_DecRef(resultobj);
      resultobj = PyCapsule_New(*arg6, "struct wally_psbt *", destroy_wally_psbt);
    }
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_free(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_free" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  {
    result = (int)wally_psbt_free(arg1);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_set_version(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  uint32_t arg2 ;
  uint32_t arg3 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_set_version", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_set_version" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_set_version" "', argument " "2"" of type '" "uint32_t""'");
  } 
  arg2 = (uint32_t)(val2);
  ecode3 = SWIG_AsVal_unsigned_SS_int(swig_obj[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "psbt_set_version" "', argument " "3"" of type '" "uint32_t""'");
  } 
  arg3 = (uint32_t)(val3);
  {
    result = (int)wally_psbt_set_version(arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_id(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  uint32_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_get_id", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_id" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_get_id" "', argument " "2"" of type '" "uint32_t""'");
  } 
  arg2 = (uint32_t)(val2);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_get_id" "', argument " "3"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg3 = (unsigned char *) buf;
    arg4 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_psbt_get_id((struct wally_psbt const *)arg1,arg2,arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_locktime(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t *arg2 = (size_t *) 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  size_t written = 0; arg2 = (size_t *)&written;
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_locktime" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  {
    result = (int)wally_psbt_get_locktime((struct wally_psbt const *)arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg2);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_is_finalized(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t *arg2 = (size_t *) 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  size_t written = 0; arg2 = (size_t *)&written;
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_is_finalized" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  {
    result = (int)wally_psbt_is_finalized((struct wally_psbt const *)arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg2);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_is_input_finalized(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  size_t *arg3 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg3 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_is_input_finalized", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_is_input_finalized" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_is_input_finalized" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_psbt_is_input_finalized((struct wally_psbt const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg3);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_set_global_tx(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  struct wally_tx *arg2 = (struct wally_tx *) 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_set_global_tx", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_set_global_tx" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  {
    arg2 = swig_obj[1] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[1], "struct wally_tx *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_set_global_tx" "', argument " "2"" of type '" "(wally_tx)""'");
    }
  }
  {
    result = (int)wally_psbt_set_global_tx(arg1,(struct wally_tx const *)arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_set_tx_version(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  uint32_t arg2 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_set_tx_version", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_set_tx_version" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_set_tx_version" "', argument " "2"" of type '" "uint32_t""'");
  } 
  arg2 = (uint32_t)(val2);
  {
    result = (int)wally_psbt_set_tx_version(arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_tx_version(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t *arg2 = (size_t *) 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  size_t written = 0; arg2 = (size_t *)&written;
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_tx_version" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  {
    result = (int)wally_psbt_get_tx_version((struct wally_psbt const *)arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg2);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_set_fallback_locktime(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  uint32_t arg2 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_set_fallback_locktime", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_set_fallback_locktime" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_set_fallback_locktime" "', argument " "2"" of type '" "uint32_t""'");
  } 
  arg2 = (uint32_t)(val2);
  {
    result = (int)wally_psbt_set_fallback_locktime(arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_clear_fallback_locktime(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_clear_fallback_locktime" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  {
    result = (int)wally_psbt_clear_fallback_locktime(arg1);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_set_tx_modifiable_flags(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  uint32_t arg2 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_set_tx_modifiable_flags", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_set_tx_modifiable_flags" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_set_tx_modifiable_flags" "', argument " "2"" of type '" "uint32_t""'");
  } 
  arg2 = (uint32_t)(val2);
  {
    result = (int)wally_psbt_set_tx_modifiable_flags(arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_set_global_scalars(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  struct wally_map *arg2 = (struct wally_map *) 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_set_global_scalars", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_set_global_scalars" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  {
    arg2 = swig_obj[1] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[1], "struct wally_map *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_set_global_scalars" "', argument " "2"" of type '" "(wally_map)""'");
    }
  }
  {
    result = (int)wally_psbt_set_global_scalars(arg1,(struct wally_map const *)arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_add_global_scalar(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_add_global_scalar", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_add_global_scalar" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg3 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_add_global_scalar" "', argument " "2"" of type '" "(const unsigned char* scalar, size_t scalar_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg2 = (unsigned char *) buf;
      arg3 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_psbt_add_global_scalar(arg1,(unsigned char const *)arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_find_global_scalar(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  size_t *arg4 = (size_t *) 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg4 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_find_global_scalar", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_find_global_scalar" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg3 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_find_global_scalar" "', argument " "2"" of type '" "(const unsigned char* scalar, size_t scalar_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg2 = (unsigned char *) buf;
      arg3 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_psbt_find_global_scalar(arg1,(unsigned char const *)arg2,arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg4);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_set_pset_modifiable_flags(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  uint32_t arg2 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_set_pset_modifiable_flags", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_set_pset_modifiable_flags" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_set_pset_modifiable_flags" "', argument " "2"" of type '" "uint32_t""'");
  } 
  arg2 = (uint32_t)(val2);
  {
    result = (int)wally_psbt_set_pset_modifiable_flags(arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_set_global_genesis_blockhash(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_set_global_genesis_blockhash", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_set_global_genesis_blockhash" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg3 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_set_global_genesis_blockhash" "', argument " "2"" of type '" "(const unsigned char* genesis_blockhash, size_t genesis_blockhash_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg2 = (unsigned char *) buf;
      arg3 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_psbt_set_global_genesis_blockhash(arg1,(unsigned char const *)arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_has_global_genesis_blockhash(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t *arg2 = (size_t *) 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  size_t written = 0; arg2 = (size_t *)&written;
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_has_global_genesis_blockhash" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  {
    result = (int)wally_psbt_has_global_genesis_blockhash(arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg2);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_global_genesis_blockhash(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  size_t *arg4 = (size_t *) 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg4 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_get_global_genesis_blockhash", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_global_genesis_blockhash" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_get_global_genesis_blockhash" "', argument " "2"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg2 = (unsigned char *) buf;
    arg3 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_psbt_get_global_genesis_blockhash(arg1,arg2,arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg4);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_find_input_spending_utxo(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  uint32_t arg4 ;
  size_t *arg5 = (size_t *) 0 ;
  unsigned int val4 ;
  int ecode4 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  size_t written = 0; arg5 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_find_input_spending_utxo", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_find_input_spending_utxo" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg3 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_find_input_spending_utxo" "', argument " "2"" of type '" "(const unsigned char* txhash, size_t txhash_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg2 = (unsigned char *) buf;
      arg3 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  ecode4 = SWIG_AsVal_unsigned_SS_int(swig_obj[2], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "psbt_find_input_spending_utxo" "', argument " "4"" of type '" "uint32_t""'");
  } 
  arg4 = (uint32_t)(val4);
  {
    result = (int)wally_psbt_find_input_spending_utxo((struct wally_psbt const *)arg1,(unsigned char const *)arg2,arg3,arg4,arg5);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg5);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_add_input_keypath(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  uint32_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  unsigned char *arg5 = (unsigned char *) 0 ;
  size_t arg6 ;
  uint32_t *arg7 = (uint32_t *) 0 ;
  size_t arg8 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  uint32_t tmp_buf7[MAX_LOCAL_STACK/sizeof(uint32_t)] ;
  PyObject *swig_obj[5] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_add_input_keypath", 5, 5, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_add_input_keypath" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_add_input_keypath" "', argument " "2"" of type '" "uint32_t""'");
  } 
  arg2 = (uint32_t)(val2);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[2] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_add_input_keypath" "', argument " "3"" of type '" "(const unsigned char* pub_key, size_t pub_key_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[3] == Py_None)
    arg6 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[3], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_add_input_keypath" "', argument " "5"" of type '" "(const unsigned char* fingerprint, size_t fingerprint_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg5 = (unsigned char *) buf;
      arg6 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    size_t i;
    if (!PyList_Check(swig_obj[4])) {
      check_result(WALLY_EINVAL);
      SWIG_fail;
    }
    arg8 = PyList_Size(swig_obj[4]);
    arg7 = tmp_buf7;
    if (arg8 * sizeof(uint32_t) > sizeof(tmp_buf7))
    if (!(arg7 = (uint32_t *) wally_malloc((arg8) * sizeof(uint32_t)))) {
      check_result(WALLY_ENOMEM);
      SWIG_fail;
    }
    for (i = 0; i < arg8; ++i) {
      PyObject *item = PyList_GET_ITEM(swig_obj[4], i);
      unsigned long long v;
      if (!ulonglong_cast(item, &v) || v > 0xffffffffull) {
        PyErr_SetString(PyExc_OverflowError, "Invalid unsigned integer");
        SWIG_fail;
      }
      arg7[i] = (uint32_t)v;
    }
  }
  {
    result = (int)wally_psbt_add_input_keypath(arg1,arg2,(unsigned char const *)arg3,arg4,(unsigned char const *)arg5,arg6,(unsigned int const *)arg7,arg8);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    if (arg7 && arg7 != tmp_buf7)
    wally_free(arg7);
  }
  return resultobj;
fail:
  {
    if (arg7 && arg7 != tmp_buf7)
    wally_free(arg7);
  }
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_add_input_taproot_keypath(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  uint32_t arg2 ;
  uint32_t arg3 ;
  unsigned char *arg4 = (unsigned char *) 0 ;
  size_t arg5 ;
  unsigned char *arg6 = (unsigned char *) 0 ;
  size_t arg7 ;
  unsigned char *arg8 = (unsigned char *) 0 ;
  size_t arg9 ;
  uint32_t *arg10 = (uint32_t *) 0 ;
  size_t arg11 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  uint32_t tmp_buf10[MAX_LOCAL_STACK/sizeof(uint32_t)] ;
  PyObject *swig_obj[7] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_add_input_taproot_keypath", 7, 7, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_add_input_taproot_keypath" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_add_input_taproot_keypath" "', argument " "2"" of type '" "uint32_t""'");
  } 
  arg2 = (uint32_t)(val2);
  ecode3 = SWIG_AsVal_unsigned_SS_int(swig_obj[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "psbt_add_input_taproot_keypath" "', argument " "3"" of type '" "uint32_t""'");
  } 
  arg3 = (uint32_t)(val3);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[3] == Py_None)
    arg5 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[3], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_add_input_taproot_keypath" "', argument " "4"" of type '" "(const unsigned char* pub_key, size_t pub_key_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg4 = (unsigned char *) buf;
      arg5 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[4] == Py_None)
    arg7 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[4], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_add_input_taproot_keypath" "', argument " "6"" of type '" "(const unsigned char* tapleaf_hashes, size_t tapleaf_hashes_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg6 = (unsigned char *) buf;
      arg7 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[5] == Py_None)
    arg9 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[5], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_add_input_taproot_keypath" "', argument " "8"" of type '" "(const unsigned char* fingerprint, size_t fingerprint_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg8 = (unsigned char *) buf;
      arg9 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    size_t i;
    if (!PyList_Check(swig_obj[6])) {
      check_result(WALLY_EINVAL);
      SWIG_fail;
    }
    arg11 = PyList_Size(swig_obj[6]);
    arg10 = tmp_buf10;
    if (arg11 * sizeof(uint32_t) > sizeof(tmp_buf10))
    if (!(arg10 = (uint32_t *) wally_malloc((arg11) * sizeof(uint32_t)))) {
      check_result(WALLY_ENOMEM);
      SWIG_fail;
    }
    for (i = 0; i < arg11; ++i) {
      PyObject *item = PyList_GET_ITEM(swig_obj[6], i);
      unsigned long long v;
      if (!ulonglong_cast(item, &v) || v > 0xffffffffull) {
        PyErr_SetString(PyExc_OverflowError, "Invalid unsigned integer");
        SWIG_fail;
      }
      arg10[i] = (uint32_t)v;
    }
  }
  {
    result = (int)wally_psbt_add_input_taproot_keypath(arg1,arg2,arg3,(unsigned char const *)arg4,arg5,(unsigned char const *)arg6,arg7,(unsigned char const *)arg8,arg9,(unsigned int const *)arg10,arg11);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    if (arg10 && arg10 != tmp_buf10)
    wally_free(arg10);
  }
  return resultobj;
fail:
  {
    if (arg10 && arg10 != tmp_buf10)
    wally_free(arg10);
  }
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_add_tx_input_at(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  uint32_t arg2 ;
  uint32_t arg3 ;
  struct wally_tx_input *arg4 = (struct wally_tx_input *) 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  PyObject *swig_obj[4] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_add_tx_input_at", 4, 4, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_add_tx_input_at" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_add_tx_input_at" "', argument " "2"" of type '" "uint32_t""'");
  } 
  arg2 = (uint32_t)(val2);
  ecode3 = SWIG_AsVal_unsigned_SS_int(swig_obj[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "psbt_add_tx_input_at" "', argument " "3"" of type '" "uint32_t""'");
  } 
  arg3 = (uint32_t)(val3);
  {
    arg4 = swig_obj[3] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[3], "struct wally_tx_input *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_add_tx_input_at" "', argument " "4"" of type '" "(wally_tx_input)""'");
    }
  }
  {
    result = (int)wally_psbt_add_tx_input_at(arg1,arg2,arg3,(struct wally_tx_input const *)arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_remove_input(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  uint32_t arg2 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_remove_input", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_remove_input" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_remove_input" "', argument " "2"" of type '" "uint32_t""'");
  } 
  arg2 = (uint32_t)(val2);
  {
    result = (int)wally_psbt_remove_input(arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_input_bip32_key_from_alloc(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  size_t arg3 ;
  uint32_t arg4 ;
  struct ext_key *arg5 = (struct ext_key *) 0 ;
  struct ext_key **arg6 = (struct ext_key **) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  size_t val3 ;
  int ecode3 = 0 ;
  unsigned int val4 ;
  int ecode4 = 0 ;
  struct ext_key *w6 ;
  PyObject *swig_obj[5] ;
  int result;
  
  {
    w6 = 0; arg6 = (struct ext_key **)&w6;
  }
  if (!SWIG_Python_UnpackTuple(args, "psbt_get_input_bip32_key_from_alloc", 5, 5, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_input_bip32_key_from_alloc" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_get_input_bip32_key_from_alloc" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  ecode3 = SWIG_AsVal_size_t(swig_obj[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "psbt_get_input_bip32_key_from_alloc" "', argument " "3"" of type '" "size_t""'");
  } 
  arg3 = (size_t)(val3);
  ecode4 = SWIG_AsVal_unsigned_SS_int(swig_obj[3], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "psbt_get_input_bip32_key_from_alloc" "', argument " "4"" of type '" "uint32_t""'");
  } 
  arg4 = (uint32_t)(val4);
  {
    arg5 = swig_obj[4] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[4], "struct ext_key *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_input_bip32_key_from_alloc" "', argument " "5"" of type '" "(ext_key)""'");
    }
  }
  {
    result = (int)wally_psbt_get_input_bip32_key_from_alloc((struct wally_psbt const *)arg1,arg2,arg3,arg4,(struct ext_key const *)arg5,arg6);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    if (*arg6 != NULL) {
      Py_DecRef(resultobj);
      resultobj = PyCapsule_New(*arg6, "struct ext_key *", destroy_ext_key);
    }
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_input_signing_script_len(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  size_t *arg3 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg3 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_get_input_signing_script_len", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_input_signing_script_len" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_get_input_signing_script_len" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_psbt_get_input_signing_script_len((struct wally_psbt const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg3);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_input_signing_script(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t *arg5 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  size_t written = 0; arg5 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_get_input_signing_script", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_input_signing_script" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_get_input_signing_script" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_get_input_signing_script" "', argument " "3"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg3 = (unsigned char *) buf;
    arg4 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_psbt_get_input_signing_script((struct wally_psbt const *)arg1,arg2,arg3,arg4,arg5);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg5);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_input_scriptcode_len(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t *arg5 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  size_t written = 0; arg5 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_get_input_scriptcode_len", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_input_scriptcode_len" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_get_input_scriptcode_len" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[2] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_get_input_scriptcode_len" "', argument " "3"" of type '" "(const unsigned char* script, size_t script_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_psbt_get_input_scriptcode_len((struct wally_psbt const *)arg1,arg2,(unsigned char const *)arg3,arg4,arg5);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg5);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_input_scriptcode(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  unsigned char *arg5 = (unsigned char *) 0 ;
  size_t arg6 ;
  size_t *arg7 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[4] ;
  int result;
  
  size_t written = 0; arg7 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_get_input_scriptcode", 4, 4, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_input_scriptcode" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_get_input_scriptcode" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[2] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_get_input_scriptcode" "', argument " "3"" of type '" "(const unsigned char* script, size_t script_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[3], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_get_input_scriptcode" "', argument " "5"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg5 = (unsigned char *) buf;
    arg6 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_psbt_get_input_scriptcode((struct wally_psbt const *)arg1,arg2,(unsigned char const *)arg3,arg4,arg5,arg6,arg7);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg7);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_input_signature_hash(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  struct wally_tx *arg3 = (struct wally_tx *) 0 ;
  unsigned char *arg4 = (unsigned char *) 0 ;
  size_t arg5 ;
  uint32_t arg6 ;
  unsigned char *arg7 = (unsigned char *) 0 ;
  size_t arg8 ;
  size_t val2 ;
  int ecode2 = 0 ;
  unsigned int val6 ;
  int ecode6 = 0 ;
  PyObject *swig_obj[6] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_get_input_signature_hash", 6, 6, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_input_signature_hash" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_get_input_signature_hash" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    arg3 = swig_obj[2] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[2], "struct wally_tx *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_input_signature_hash" "', argument " "3"" of type '" "(wally_tx)""'");
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[3] == Py_None)
    arg5 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[3], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_get_input_signature_hash" "', argument " "4"" of type '" "(const unsigned char* script, size_t script_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg4 = (unsigned char *) buf;
      arg5 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  ecode6 = SWIG_AsVal_unsigned_SS_int(swig_obj[4], &val6);
  if (!SWIG_IsOK(ecode6)) {
    SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "psbt_get_input_signature_hash" "', argument " "6"" of type '" "uint32_t""'");
  } 
  arg6 = (uint32_t)(val6);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[5], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_get_input_signature_hash" "', argument " "7"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg7 = (unsigned char *) buf;
    arg8 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_psbt_get_input_signature_hash(arg1,arg2,(struct wally_tx const *)arg3,(unsigned char const *)arg4,arg5,arg6,arg7,arg8);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_add_output_keypath(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  uint32_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  unsigned char *arg5 = (unsigned char *) 0 ;
  size_t arg6 ;
  uint32_t *arg7 = (uint32_t *) 0 ;
  size_t arg8 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  uint32_t tmp_buf7[MAX_LOCAL_STACK/sizeof(uint32_t)] ;
  PyObject *swig_obj[5] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_add_output_keypath", 5, 5, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_add_output_keypath" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_add_output_keypath" "', argument " "2"" of type '" "uint32_t""'");
  } 
  arg2 = (uint32_t)(val2);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[2] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_add_output_keypath" "', argument " "3"" of type '" "(const unsigned char* pub_key, size_t pub_key_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[3] == Py_None)
    arg6 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[3], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_add_output_keypath" "', argument " "5"" of type '" "(const unsigned char* fingerprint, size_t fingerprint_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg5 = (unsigned char *) buf;
      arg6 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    size_t i;
    if (!PyList_Check(swig_obj[4])) {
      check_result(WALLY_EINVAL);
      SWIG_fail;
    }
    arg8 = PyList_Size(swig_obj[4]);
    arg7 = tmp_buf7;
    if (arg8 * sizeof(uint32_t) > sizeof(tmp_buf7))
    if (!(arg7 = (uint32_t *) wally_malloc((arg8) * sizeof(uint32_t)))) {
      check_result(WALLY_ENOMEM);
      SWIG_fail;
    }
    for (i = 0; i < arg8; ++i) {
      PyObject *item = PyList_GET_ITEM(swig_obj[4], i);
      unsigned long long v;
      if (!ulonglong_cast(item, &v) || v > 0xffffffffull) {
        PyErr_SetString(PyExc_OverflowError, "Invalid unsigned integer");
        SWIG_fail;
      }
      arg7[i] = (uint32_t)v;
    }
  }
  {
    result = (int)wally_psbt_add_output_keypath(arg1,arg2,(unsigned char const *)arg3,arg4,(unsigned char const *)arg5,arg6,(unsigned int const *)arg7,arg8);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    if (arg7 && arg7 != tmp_buf7)
    wally_free(arg7);
  }
  return resultobj;
fail:
  {
    if (arg7 && arg7 != tmp_buf7)
    wally_free(arg7);
  }
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_add_output_taproot_keypath(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  uint32_t arg2 ;
  uint32_t arg3 ;
  unsigned char *arg4 = (unsigned char *) 0 ;
  size_t arg5 ;
  unsigned char *arg6 = (unsigned char *) 0 ;
  size_t arg7 ;
  unsigned char *arg8 = (unsigned char *) 0 ;
  size_t arg9 ;
  uint32_t *arg10 = (uint32_t *) 0 ;
  size_t arg11 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  uint32_t tmp_buf10[MAX_LOCAL_STACK/sizeof(uint32_t)] ;
  PyObject *swig_obj[7] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_add_output_taproot_keypath", 7, 7, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_add_output_taproot_keypath" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_add_output_taproot_keypath" "', argument " "2"" of type '" "uint32_t""'");
  } 
  arg2 = (uint32_t)(val2);
  ecode3 = SWIG_AsVal_unsigned_SS_int(swig_obj[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "psbt_add_output_taproot_keypath" "', argument " "3"" of type '" "uint32_t""'");
  } 
  arg3 = (uint32_t)(val3);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[3] == Py_None)
    arg5 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[3], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_add_output_taproot_keypath" "', argument " "4"" of type '" "(const unsigned char* pub_key, size_t pub_key_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg4 = (unsigned char *) buf;
      arg5 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[4] == Py_None)
    arg7 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[4], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_add_output_taproot_keypath" "', argument " "6"" of type '" "(const unsigned char* tapleaf_hashes, size_t tapleaf_hashes_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg6 = (unsigned char *) buf;
      arg7 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[5] == Py_None)
    arg9 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[5], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_add_output_taproot_keypath" "', argument " "8"" of type '" "(const unsigned char* fingerprint, size_t fingerprint_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg8 = (unsigned char *) buf;
      arg9 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    size_t i;
    if (!PyList_Check(swig_obj[6])) {
      check_result(WALLY_EINVAL);
      SWIG_fail;
    }
    arg11 = PyList_Size(swig_obj[6]);
    arg10 = tmp_buf10;
    if (arg11 * sizeof(uint32_t) > sizeof(tmp_buf10))
    if (!(arg10 = (uint32_t *) wally_malloc((arg11) * sizeof(uint32_t)))) {
      check_result(WALLY_ENOMEM);
      SWIG_fail;
    }
    for (i = 0; i < arg11; ++i) {
      PyObject *item = PyList_GET_ITEM(swig_obj[6], i);
      unsigned long long v;
      if (!ulonglong_cast(item, &v) || v > 0xffffffffull) {
        PyErr_SetString(PyExc_OverflowError, "Invalid unsigned integer");
        SWIG_fail;
      }
      arg10[i] = (uint32_t)v;
    }
  }
  {
    result = (int)wally_psbt_add_output_taproot_keypath(arg1,arg2,arg3,(unsigned char const *)arg4,arg5,(unsigned char const *)arg6,arg7,(unsigned char const *)arg8,arg9,(unsigned int const *)arg10,arg11);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    if (arg10 && arg10 != tmp_buf10)
    wally_free(arg10);
  }
  return resultobj;
fail:
  {
    if (arg10 && arg10 != tmp_buf10)
    wally_free(arg10);
  }
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_add_tx_output_at(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  uint32_t arg2 ;
  uint32_t arg3 ;
  struct wally_tx_output *arg4 = (struct wally_tx_output *) 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  PyObject *swig_obj[4] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_add_tx_output_at", 4, 4, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_add_tx_output_at" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_add_tx_output_at" "', argument " "2"" of type '" "uint32_t""'");
  } 
  arg2 = (uint32_t)(val2);
  ecode3 = SWIG_AsVal_unsigned_SS_int(swig_obj[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "psbt_add_tx_output_at" "', argument " "3"" of type '" "uint32_t""'");
  } 
  arg3 = (uint32_t)(val3);
  {
    arg4 = swig_obj[3] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[3], "struct wally_tx_output *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_add_tx_output_at" "', argument " "4"" of type '" "(wally_tx_output)""'");
    }
  }
  {
    result = (int)wally_psbt_add_tx_output_at(arg1,arg2,arg3,(struct wally_tx_output const *)arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_remove_output(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  uint32_t arg2 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_remove_output", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_remove_output" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_remove_output" "', argument " "2"" of type '" "uint32_t""'");
  } 
  arg2 = (uint32_t)(val2);
  {
    result = (int)wally_psbt_remove_output(arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_from_bytes(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  uint32_t arg3 ;
  struct wally_psbt **arg4 = (struct wally_psbt **) 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  struct wally_psbt *w4 ;
  PyObject *swig_obj[2] ;
  int result;
  
  {
    w4 = 0; arg4 = (struct wally_psbt **)&w4;
  }
  if (!SWIG_Python_UnpackTuple(args, "psbt_from_bytes", 2, 2, swig_obj)) SWIG_fail;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_from_bytes" "', argument " "1"" of type '" "(const unsigned char* bytes, size_t bytes_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  ecode3 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "psbt_from_bytes" "', argument " "3"" of type '" "uint32_t""'");
  } 
  arg3 = (uint32_t)(val3);
  {
    result = (int)wally_psbt_from_bytes((unsigned char const *)arg1,arg2,arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    if (*arg4 != NULL) {
      Py_DecRef(resultobj);
      resultobj = PyCapsule_New(*arg4, "struct wally_psbt *", destroy_wally_psbt);
    }
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_length(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  uint32_t arg2 ;
  size_t *arg3 = (size_t *) 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg3 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_get_length", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_length" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_get_length" "', argument " "2"" of type '" "uint32_t""'");
  } 
  arg2 = (uint32_t)(val2);
  {
    result = (int)wally_psbt_get_length((struct wally_psbt const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg3);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_to_bytes(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  uint32_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t *arg5 = (size_t *) 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  size_t written = 0; arg5 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_to_bytes", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_to_bytes" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_to_bytes" "', argument " "2"" of type '" "uint32_t""'");
  } 
  arg2 = (uint32_t)(val2);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_to_bytes" "', argument " "3"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg3 = (unsigned char *) buf;
    arg4 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_psbt_to_bytes((struct wally_psbt const *)arg1,arg2,arg3,arg4,arg5);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg5);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_from_base64(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  char *arg1 = (char *) 0 ;
  uint32_t arg2 ;
  struct wally_psbt **arg3 = (struct wally_psbt **) 0 ;
  int res1 ;
  char *buf1 = 0 ;
  int alloc1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  struct wally_psbt *w3 ;
  PyObject *swig_obj[2] ;
  int result;
  
  {
    w3 = 0; arg3 = (struct wally_psbt **)&w3;
  }
  if (!SWIG_Python_UnpackTuple(args, "psbt_from_base64", 2, 2, swig_obj)) SWIG_fail;
  res1 = SWIG_AsCharPtrAndSize(swig_obj[0], &buf1, NULL, &alloc1);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_from_base64" "', argument " "1"" of type '" "char const *""'");
  }
  arg1 = (char *)(buf1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_from_base64" "', argument " "2"" of type '" "uint32_t""'");
  } 
  arg2 = (uint32_t)(val2);
  {
    result = (int)wally_psbt_from_base64((char const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    if (*arg3 != NULL) {
      Py_DecRef(resultobj);
      resultobj = PyCapsule_New(*arg3, "struct wally_psbt *", destroy_wally_psbt);
    }
  }
  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
  return resultobj;
fail:
  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_from_base64_n(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  char *arg1 = (char *) 0 ;
  size_t arg2 ;
  uint32_t arg3 ;
  struct wally_psbt **arg4 = (struct wally_psbt **) 0 ;
  int res1 ;
  char *buf1 = 0 ;
  int alloc1 = 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  struct wally_psbt *w4 ;
  PyObject *swig_obj[3] ;
  int result;
  
  {
    w4 = 0; arg4 = (struct wally_psbt **)&w4;
  }
  if (!SWIG_Python_UnpackTuple(args, "psbt_from_base64_n", 3, 3, swig_obj)) SWIG_fail;
  res1 = SWIG_AsCharPtrAndSize(swig_obj[0], &buf1, NULL, &alloc1);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "psbt_from_base64_n" "', argument " "1"" of type '" "char const *""'");
  }
  arg1 = (char *)(buf1);
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_from_base64_n" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  ecode3 = SWIG_AsVal_unsigned_SS_int(swig_obj[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "psbt_from_base64_n" "', argument " "3"" of type '" "uint32_t""'");
  } 
  arg3 = (uint32_t)(val3);
  {
    result = (int)wally_psbt_from_base64_n((char const *)arg1,arg2,arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    if (*arg4 != NULL) {
      Py_DecRef(resultobj);
      resultobj = PyCapsule_New(*arg4, "struct wally_psbt *", destroy_wally_psbt);
    }
  }
  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
  return resultobj;
fail:
  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_to_base64(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  uint32_t arg2 ;
  char **arg3 = (char **) 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  char *txt3 ;
  PyObject *swig_obj[2] ;
  int result;
  
  {
    txt3 = NULL;
    arg3 = (char **)&txt3;
  }
  if (!SWIG_Python_UnpackTuple(args, "psbt_to_base64", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_to_base64" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_to_base64" "', argument " "2"" of type '" "uint32_t""'");
  } 
  arg2 = (uint32_t)(val2);
  {
    result = (int)wally_psbt_to_base64((struct wally_psbt const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    if (*arg3 != NULL) {
      Py_DecRef(resultobj);
      resultobj = PyString_FromString(*arg3);
      wally_free_string(*arg3);
    }
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_from_tx(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx *arg1 = (struct wally_tx *) 0 ;
  uint32_t arg2 ;
  uint32_t arg3 ;
  struct wally_psbt **arg4 = (struct wally_psbt **) 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  struct wally_psbt *w4 ;
  PyObject *swig_obj[3] ;
  int result;
  
  {
    w4 = 0; arg4 = (struct wally_psbt **)&w4;
  }
  if (!SWIG_Python_UnpackTuple(args, "psbt_from_tx", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_from_tx" "', argument " "1"" of type '" "(wally_tx)""'");
    }
  }
  ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_from_tx" "', argument " "2"" of type '" "uint32_t""'");
  } 
  arg2 = (uint32_t)(val2);
  ecode3 = SWIG_AsVal_unsigned_SS_int(swig_obj[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "psbt_from_tx" "', argument " "3"" of type '" "uint32_t""'");
  } 
  arg3 = (uint32_t)(val3);
  {
    result = (int)wally_psbt_from_tx((struct wally_tx const *)arg1,arg2,arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    if (*arg4 != NULL) {
      Py_DecRef(resultobj);
      resultobj = PyCapsule_New(*arg4, "struct wally_psbt *", destroy_wally_psbt);
    }
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_combine(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  struct wally_psbt *arg2 = (struct wally_psbt *) 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_combine", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_combine" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  {
    arg2 = swig_obj[1] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[1], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_combine" "', argument " "2"" of type '" "(wally_psbt)""'");
    }
  }
  {
    result = (int)wally_psbt_combine(arg1,(struct wally_psbt const *)arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_combine_ex(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  uint32_t arg2 ;
  struct wally_psbt *arg3 = (struct wally_psbt *) 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_combine_ex", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_combine_ex" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_combine_ex" "', argument " "2"" of type '" "uint32_t""'");
  } 
  arg2 = (uint32_t)(val2);
  {
    arg3 = swig_obj[2] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[2], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_combine_ex" "', argument " "3"" of type '" "(wally_psbt)""'");
    }
  }
  {
    result = (int)wally_psbt_combine_ex(arg1,arg2,(struct wally_psbt const *)arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_clone_alloc(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  uint32_t arg2 ;
  struct wally_psbt **arg3 = (struct wally_psbt **) 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  struct wally_psbt *w3 ;
  PyObject *swig_obj[2] ;
  int result;
  
  {
    w3 = 0; arg3 = (struct wally_psbt **)&w3;
  }
  if (!SWIG_Python_UnpackTuple(args, "psbt_clone_alloc", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_clone_alloc" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_clone_alloc" "', argument " "2"" of type '" "uint32_t""'");
  } 
  arg2 = (uint32_t)(val2);
  {
    result = (int)wally_psbt_clone_alloc((struct wally_psbt const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    if (*arg3 != NULL) {
      Py_DecRef(resultobj);
      resultobj = PyCapsule_New(*arg3, "struct wally_psbt *", destroy_wally_psbt);
    }
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_blind_alloc(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  struct wally_map *arg2 = (struct wally_map *) 0 ;
  struct wally_map *arg3 = (struct wally_map *) 0 ;
  struct wally_map *arg4 = (struct wally_map *) 0 ;
  struct wally_map *arg5 = (struct wally_map *) 0 ;
  unsigned char *arg6 = (unsigned char *) 0 ;
  size_t arg7 ;
  uint32_t arg8 ;
  uint32_t arg9 ;
  struct wally_map **arg10 = (struct wally_map **) 0 ;
  unsigned int val8 ;
  int ecode8 = 0 ;
  unsigned int val9 ;
  int ecode9 = 0 ;
  struct wally_map *w10 ;
  PyObject *swig_obj[8] ;
  int result;
  
  {
    w10 = 0; arg10 = (struct wally_map **)&w10;
  }
  if (!SWIG_Python_UnpackTuple(args, "psbt_blind_alloc", 8, 8, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_blind_alloc" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  {
    arg2 = swig_obj[1] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[1], "struct wally_map *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_blind_alloc" "', argument " "2"" of type '" "(wally_map)""'");
    }
  }
  {
    arg3 = swig_obj[2] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[2], "struct wally_map *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_blind_alloc" "', argument " "3"" of type '" "(wally_map)""'");
    }
  }
  {
    arg4 = swig_obj[3] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[3], "struct wally_map *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_blind_alloc" "', argument " "4"" of type '" "(wally_map)""'");
    }
  }
  {
    arg5 = swig_obj[4] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[4], "struct wally_map *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_blind_alloc" "', argument " "5"" of type '" "(wally_map)""'");
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[5] == Py_None)
    arg7 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[5], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_blind_alloc" "', argument " "6"" of type '" "(const unsigned char* entropy, size_t entropy_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg6 = (unsigned char *) buf;
      arg7 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  ecode8 = SWIG_AsVal_unsigned_SS_int(swig_obj[6], &val8);
  if (!SWIG_IsOK(ecode8)) {
    SWIG_exception_fail(SWIG_ArgError(ecode8), "in method '" "psbt_blind_alloc" "', argument " "8"" of type '" "uint32_t""'");
  } 
  arg8 = (uint32_t)(val8);
  ecode9 = SWIG_AsVal_unsigned_SS_int(swig_obj[7], &val9);
  if (!SWIG_IsOK(ecode9)) {
    SWIG_exception_fail(SWIG_ArgError(ecode9), "in method '" "psbt_blind_alloc" "', argument " "9"" of type '" "uint32_t""'");
  } 
  arg9 = (uint32_t)(val9);
  {
    result = (int)wally_psbt_blind_alloc(arg1,(struct wally_map const *)arg2,(struct wally_map const *)arg3,(struct wally_map const *)arg4,(struct wally_map const *)arg5,(unsigned char const *)arg6,arg7,arg8,arg9,arg10);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    if (*arg10 != NULL) {
      Py_DecRef(resultobj);
      resultobj = PyCapsule_New(*arg10, "struct wally_map *", destroy_wally_map);
    }
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_signing_cache_enable(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  uint32_t arg2 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_signing_cache_enable", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_signing_cache_enable" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_signing_cache_enable" "', argument " "2"" of type '" "uint32_t""'");
  } 
  arg2 = (uint32_t)(val2);
  {
    result = (int)wally_psbt_signing_cache_enable(arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_signing_cache_disable(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_signing_cache_disable" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  {
    result = (int)wally_psbt_signing_cache_disable(arg1);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_sign(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  uint32_t arg4 ;
  unsigned int val4 ;
  int ecode4 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_sign", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_sign" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg3 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_sign" "', argument " "2"" of type '" "(const unsigned char* key, size_t key_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg2 = (unsigned char *) buf;
      arg3 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  ecode4 = SWIG_AsVal_unsigned_SS_int(swig_obj[2], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "psbt_sign" "', argument " "4"" of type '" "uint32_t""'");
  } 
  arg4 = (uint32_t)(val4);
  {
    result = (int)wally_psbt_sign(arg1,(unsigned char const *)arg2,arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_sign_bip32(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  struct ext_key *arg2 = (struct ext_key *) 0 ;
  uint32_t arg3 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_sign_bip32", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_sign_bip32" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  {
    arg2 = swig_obj[1] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[1], "struct ext_key *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_sign_bip32" "', argument " "2"" of type '" "(ext_key)""'");
    }
  }
  ecode3 = SWIG_AsVal_unsigned_SS_int(swig_obj[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "psbt_sign_bip32" "', argument " "3"" of type '" "uint32_t""'");
  } 
  arg3 = (uint32_t)(val3);
  {
    result = (int)wally_psbt_sign_bip32(arg1,(struct ext_key const *)arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_sign_input_bip32(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  size_t arg3 ;
  unsigned char *arg4 = (unsigned char *) 0 ;
  size_t arg5 ;
  struct ext_key *arg6 = (struct ext_key *) 0 ;
  uint32_t arg7 ;
  size_t val2 ;
  int ecode2 = 0 ;
  size_t val3 ;
  int ecode3 = 0 ;
  unsigned int val7 ;
  int ecode7 = 0 ;
  PyObject *swig_obj[6] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_sign_input_bip32", 6, 6, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_sign_input_bip32" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_sign_input_bip32" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  ecode3 = SWIG_AsVal_size_t(swig_obj[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "psbt_sign_input_bip32" "', argument " "3"" of type '" "size_t""'");
  } 
  arg3 = (size_t)(val3);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[3] == Py_None)
    arg5 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[3], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_sign_input_bip32" "', argument " "4"" of type '" "(const unsigned char* txhash, size_t txhash_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg4 = (unsigned char *) buf;
      arg5 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    arg6 = swig_obj[4] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[4], "struct ext_key *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_sign_input_bip32" "', argument " "6"" of type '" "(ext_key)""'");
    }
  }
  ecode7 = SWIG_AsVal_unsigned_SS_int(swig_obj[5], &val7);
  if (!SWIG_IsOK(ecode7)) {
    SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "psbt_sign_input_bip32" "', argument " "7"" of type '" "uint32_t""'");
  } 
  arg7 = (uint32_t)(val7);
  {
    result = (int)wally_psbt_sign_input_bip32(arg1,arg2,arg3,(unsigned char const *)arg4,arg5,(struct ext_key const *)arg6,arg7);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_finalize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  uint32_t arg2 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_finalize", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_finalize" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_finalize" "', argument " "2"" of type '" "uint32_t""'");
  } 
  arg2 = (uint32_t)(val2);
  {
    result = (int)wally_psbt_finalize(arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_finalize_input(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  uint32_t arg3 ;
  size_t val2 ;
  int ecode2 = 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_finalize_input", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_finalize_input" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_finalize_input" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  ecode3 = SWIG_AsVal_unsigned_SS_int(swig_obj[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "psbt_finalize_input" "', argument " "3"" of type '" "uint32_t""'");
  } 
  arg3 = (uint32_t)(val3);
  {
    result = (int)wally_psbt_finalize_input(arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_extract(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  uint32_t arg2 ;
  struct wally_tx **arg3 = (struct wally_tx **) 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  struct wally_tx *w3 ;
  PyObject *swig_obj[2] ;
  int result;
  
  {
    w3 = 0; arg3 = (struct wally_tx **)&w3;
  }
  if (!SWIG_Python_UnpackTuple(args, "psbt_extract", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_extract" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_extract" "', argument " "2"" of type '" "uint32_t""'");
  } 
  arg2 = (uint32_t)(val2);
  {
    result = (int)wally_psbt_extract((struct wally_psbt const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    if (*arg3 != NULL) {
      Py_DecRef(resultobj);
      resultobj = PyCapsule_New(*arg3, "struct wally_tx *", destroy_wally_tx);
    }
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_is_elements(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t *arg2 = (size_t *) 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  size_t written = 0; arg2 = (size_t *)&written;
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_is_elements" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  {
    result = (int)wally_psbt_is_elements((struct wally_psbt const *)arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg2);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_global_tx_alloc(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  struct wally_tx **arg2 = (struct wally_tx **) 0 ;
  struct wally_tx *w2 ;
  PyObject *swig_obj[1] ;
  int result;
  
  {
    w2 = 0; arg2 = (struct wally_tx **)&w2;
  }
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_global_tx_alloc" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  {
    result = (int)wally_psbt_get_global_tx_alloc((struct wally_psbt const *)arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    if (*arg2 != NULL) {
      Py_DecRef(resultobj);
      resultobj = PyCapsule_New(*arg2, "struct wally_tx *", destroy_wally_tx);
    }
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_version(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t *arg2 = (size_t *) 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  size_t written = 0; arg2 = (size_t *)&written;
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_version" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  {
    result = (int)wally_psbt_get_version((struct wally_psbt const *)arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg2);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_num_inputs(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t *arg2 = (size_t *) 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  size_t written = 0; arg2 = (size_t *)&written;
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_num_inputs" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  {
    result = (int)wally_psbt_get_num_inputs((struct wally_psbt const *)arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg2);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_num_outputs(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t *arg2 = (size_t *) 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  size_t written = 0; arg2 = (size_t *)&written;
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_num_outputs" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  {
    result = (int)wally_psbt_get_num_outputs((struct wally_psbt const *)arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg2);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_fallback_locktime(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t *arg2 = (size_t *) 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  size_t written = 0; arg2 = (size_t *)&written;
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_fallback_locktime" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  {
    result = (int)wally_psbt_get_fallback_locktime((struct wally_psbt const *)arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg2);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_has_fallback_locktime(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t *arg2 = (size_t *) 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  size_t written = 0; arg2 = (size_t *)&written;
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_has_fallback_locktime" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  {
    result = (int)wally_psbt_has_fallback_locktime((struct wally_psbt const *)arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg2);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_tx_modifiable_flags(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t *arg2 = (size_t *) 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  size_t written = 0; arg2 = (size_t *)&written;
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_tx_modifiable_flags" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  {
    result = (int)wally_psbt_get_tx_modifiable_flags((struct wally_psbt const *)arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg2);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_global_scalars_size(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t *arg2 = (size_t *) 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  size_t written = 0; arg2 = (size_t *)&written;
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_global_scalars_size" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  {
    result = (int)wally_psbt_get_global_scalars_size((struct wally_psbt const *)arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg2);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_global_scalar(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_get_global_scalar", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_global_scalar" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_get_global_scalar" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_get_global_scalar" "', argument " "3"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg3 = (unsigned char *) buf;
    arg4 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_psbt_get_global_scalar((struct wally_psbt const *)arg1,arg2,arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_pset_modifiable_flags(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t *arg2 = (size_t *) 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  size_t written = 0; arg2 = (size_t *)&written;
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_pset_modifiable_flags" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  {
    result = (int)wally_psbt_get_pset_modifiable_flags((struct wally_psbt const *)arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg2);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_input_utxo_alloc(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  struct wally_tx **arg3 = (struct wally_tx **) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  struct wally_tx *w3 ;
  PyObject *swig_obj[2] ;
  int result;
  
  {
    w3 = 0; arg3 = (struct wally_tx **)&w3;
  }
  if (!SWIG_Python_UnpackTuple(args, "psbt_get_input_utxo_alloc", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_input_utxo_alloc" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_get_input_utxo_alloc" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_psbt_get_input_utxo_alloc((struct wally_psbt const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    if (*arg3 != NULL) {
      Py_DecRef(resultobj);
      resultobj = PyCapsule_New(*arg3, "struct wally_tx *", destroy_wally_tx);
    }
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_input_witness_utxo_alloc(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  struct wally_tx_output **arg3 = (struct wally_tx_output **) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  struct wally_tx_output *w3 ;
  PyObject *swig_obj[2] ;
  int result;
  
  {
    w3 = 0; arg3 = (struct wally_tx_output **)&w3;
  }
  if (!SWIG_Python_UnpackTuple(args, "psbt_get_input_witness_utxo_alloc", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_input_witness_utxo_alloc" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_get_input_witness_utxo_alloc" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_psbt_get_input_witness_utxo_alloc((struct wally_psbt const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    if (*arg3 != NULL) {
      Py_DecRef(resultobj);
      resultobj = PyCapsule_New(*arg3, "struct wally_tx_output *", destroy_wally_tx_output);
    }
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_input_best_utxo_alloc(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  struct wally_tx_output **arg3 = (struct wally_tx_output **) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  struct wally_tx_output *w3 ;
  PyObject *swig_obj[2] ;
  int result;
  
  {
    w3 = 0; arg3 = (struct wally_tx_output **)&w3;
  }
  if (!SWIG_Python_UnpackTuple(args, "psbt_get_input_best_utxo_alloc", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_input_best_utxo_alloc" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_get_input_best_utxo_alloc" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_psbt_get_input_best_utxo_alloc((struct wally_psbt const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    if (*arg3 != NULL) {
      Py_DecRef(resultobj);
      resultobj = PyCapsule_New(*arg3, "struct wally_tx_output *", destroy_wally_tx_output);
    }
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_input_redeem_script(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t *arg5 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  size_t written = 0; arg5 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_get_input_redeem_script", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_input_redeem_script" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_get_input_redeem_script" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_get_input_redeem_script" "', argument " "3"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg3 = (unsigned char *) buf;
    arg4 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_psbt_get_input_redeem_script((struct wally_psbt const *)arg1,arg2,arg3,arg4,arg5);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg5);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_input_redeem_script_len(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  size_t *arg3 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg3 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_get_input_redeem_script_len", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_input_redeem_script_len" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_get_input_redeem_script_len" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_psbt_get_input_redeem_script_len((struct wally_psbt const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg3);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_input_witness_script(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t *arg5 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  size_t written = 0; arg5 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_get_input_witness_script", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_input_witness_script" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_get_input_witness_script" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_get_input_witness_script" "', argument " "3"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg3 = (unsigned char *) buf;
    arg4 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_psbt_get_input_witness_script((struct wally_psbt const *)arg1,arg2,arg3,arg4,arg5);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg5);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_input_witness_script_len(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  size_t *arg3 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg3 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_get_input_witness_script_len", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_input_witness_script_len" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_get_input_witness_script_len" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_psbt_get_input_witness_script_len((struct wally_psbt const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg3);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_input_final_scriptsig(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t *arg5 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  size_t written = 0; arg5 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_get_input_final_scriptsig", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_input_final_scriptsig" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_get_input_final_scriptsig" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_get_input_final_scriptsig" "', argument " "3"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg3 = (unsigned char *) buf;
    arg4 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_psbt_get_input_final_scriptsig((struct wally_psbt const *)arg1,arg2,arg3,arg4,arg5);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg5);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_input_final_scriptsig_len(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  size_t *arg3 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg3 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_get_input_final_scriptsig_len", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_input_final_scriptsig_len" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_get_input_final_scriptsig_len" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_psbt_get_input_final_scriptsig_len((struct wally_psbt const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg3);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_input_final_witness_alloc(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  struct wally_tx_witness_stack **arg3 = (struct wally_tx_witness_stack **) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  struct wally_tx_witness_stack *w3 ;
  PyObject *swig_obj[2] ;
  int result;
  
  {
    w3 = 0; arg3 = (struct wally_tx_witness_stack **)&w3;
  }
  if (!SWIG_Python_UnpackTuple(args, "psbt_get_input_final_witness_alloc", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_input_final_witness_alloc" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_get_input_final_witness_alloc" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_psbt_get_input_final_witness_alloc((struct wally_psbt const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    if (*arg3 != NULL) {
      Py_DecRef(resultobj);
      resultobj = PyCapsule_New(*arg3, "struct wally_tx_witness_stack *", destroy_wally_tx_witness_stack);
    }
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_input_keypaths_size(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  size_t *arg3 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg3 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_get_input_keypaths_size", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_input_keypaths_size" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_get_input_keypaths_size" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_psbt_get_input_keypaths_size((struct wally_psbt const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg3);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_find_input_keypath(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t *arg5 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  size_t written = 0; arg5 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_find_input_keypath", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_find_input_keypath" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_find_input_keypath" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[2] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_find_input_keypath" "', argument " "3"" of type '" "(const unsigned char* key, size_t key_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_psbt_find_input_keypath((struct wally_psbt const *)arg1,arg2,(unsigned char const *)arg3,arg4,arg5);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg5);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_input_keypath(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  size_t arg3 ;
  unsigned char *arg4 = (unsigned char *) 0 ;
  size_t arg5 ;
  size_t *arg6 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  size_t val3 ;
  int ecode3 = 0 ;
  PyObject *swig_obj[4] ;
  int result;
  
  size_t written = 0; arg6 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_get_input_keypath", 4, 4, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_input_keypath" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_get_input_keypath" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  ecode3 = SWIG_AsVal_size_t(swig_obj[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "psbt_get_input_keypath" "', argument " "3"" of type '" "size_t""'");
  } 
  arg3 = (size_t)(val3);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[3], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_get_input_keypath" "', argument " "4"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg4 = (unsigned char *) buf;
    arg5 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_psbt_get_input_keypath((struct wally_psbt const *)arg1,arg2,arg3,arg4,arg5,arg6);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg6);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_input_keypath_len(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  size_t arg3 ;
  size_t *arg4 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  size_t val3 ;
  int ecode3 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  size_t written = 0; arg4 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_get_input_keypath_len", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_input_keypath_len" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_get_input_keypath_len" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  ecode3 = SWIG_AsVal_size_t(swig_obj[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "psbt_get_input_keypath_len" "', argument " "3"" of type '" "size_t""'");
  } 
  arg3 = (size_t)(val3);
  {
    result = (int)wally_psbt_get_input_keypath_len((struct wally_psbt const *)arg1,arg2,arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg4);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_input_signatures_size(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  size_t *arg3 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg3 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_get_input_signatures_size", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_input_signatures_size" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_get_input_signatures_size" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_psbt_get_input_signatures_size((struct wally_psbt const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg3);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_find_input_signature(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t *arg5 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  size_t written = 0; arg5 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_find_input_signature", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_find_input_signature" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_find_input_signature" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[2] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_find_input_signature" "', argument " "3"" of type '" "(const unsigned char* pub_key, size_t pub_key_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_psbt_find_input_signature((struct wally_psbt const *)arg1,arg2,(unsigned char const *)arg3,arg4,arg5);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg5);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_input_signature(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  size_t arg3 ;
  unsigned char *arg4 = (unsigned char *) 0 ;
  size_t arg5 ;
  size_t *arg6 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  size_t val3 ;
  int ecode3 = 0 ;
  PyObject *swig_obj[4] ;
  int result;
  
  size_t written = 0; arg6 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_get_input_signature", 4, 4, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_input_signature" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_get_input_signature" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  ecode3 = SWIG_AsVal_size_t(swig_obj[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "psbt_get_input_signature" "', argument " "3"" of type '" "size_t""'");
  } 
  arg3 = (size_t)(val3);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[3], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_get_input_signature" "', argument " "4"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg4 = (unsigned char *) buf;
    arg5 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_psbt_get_input_signature((struct wally_psbt const *)arg1,arg2,arg3,arg4,arg5,arg6);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg6);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_input_signature_len(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  size_t arg3 ;
  size_t *arg4 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  size_t val3 ;
  int ecode3 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  size_t written = 0; arg4 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_get_input_signature_len", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_input_signature_len" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_get_input_signature_len" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  ecode3 = SWIG_AsVal_size_t(swig_obj[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "psbt_get_input_signature_len" "', argument " "3"" of type '" "size_t""'");
  } 
  arg3 = (size_t)(val3);
  {
    result = (int)wally_psbt_get_input_signature_len((struct wally_psbt const *)arg1,arg2,arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg4);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_input_taproot_signature(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t *arg5 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  size_t written = 0; arg5 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_get_input_taproot_signature", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_input_taproot_signature" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_get_input_taproot_signature" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_get_input_taproot_signature" "', argument " "3"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg3 = (unsigned char *) buf;
    arg4 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_psbt_get_input_taproot_signature((struct wally_psbt const *)arg1,arg2,arg3,arg4,arg5);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg5);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_input_taproot_signature_len(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  size_t *arg3 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg3 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_get_input_taproot_signature_len", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_input_taproot_signature_len" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_get_input_taproot_signature_len" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_psbt_get_input_taproot_signature_len((struct wally_psbt const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg3);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_input_taproot_internal_key(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t *arg5 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  size_t written = 0; arg5 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_get_input_taproot_internal_key", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_input_taproot_internal_key" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_get_input_taproot_internal_key" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_get_input_taproot_internal_key" "', argument " "3"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg3 = (unsigned char *) buf;
    arg4 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_psbt_get_input_taproot_internal_key((struct wally_psbt const *)arg1,arg2,arg3,arg4,arg5);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg5);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_input_taproot_internal_key_len(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  size_t *arg3 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg3 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_get_input_taproot_internal_key_len", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_input_taproot_internal_key_len" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_get_input_taproot_internal_key_len" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_psbt_get_input_taproot_internal_key_len((struct wally_psbt const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg3);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_input_unknowns_size(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  size_t *arg3 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg3 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_get_input_unknowns_size", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_input_unknowns_size" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_get_input_unknowns_size" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_psbt_get_input_unknowns_size((struct wally_psbt const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg3);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_find_input_unknown(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t *arg5 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  size_t written = 0; arg5 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_find_input_unknown", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_find_input_unknown" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_find_input_unknown" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[2] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_find_input_unknown" "', argument " "3"" of type '" "(const unsigned char* key, size_t key_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_psbt_find_input_unknown((struct wally_psbt const *)arg1,arg2,(unsigned char const *)arg3,arg4,arg5);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg5);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_input_unknown(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  size_t arg3 ;
  unsigned char *arg4 = (unsigned char *) 0 ;
  size_t arg5 ;
  size_t *arg6 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  size_t val3 ;
  int ecode3 = 0 ;
  PyObject *swig_obj[4] ;
  int result;
  
  size_t written = 0; arg6 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_get_input_unknown", 4, 4, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_input_unknown" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_get_input_unknown" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  ecode3 = SWIG_AsVal_size_t(swig_obj[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "psbt_get_input_unknown" "', argument " "3"" of type '" "size_t""'");
  } 
  arg3 = (size_t)(val3);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[3], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_get_input_unknown" "', argument " "4"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg4 = (unsigned char *) buf;
    arg5 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_psbt_get_input_unknown((struct wally_psbt const *)arg1,arg2,arg3,arg4,arg5,arg6);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg6);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_input_unknown_len(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  size_t arg3 ;
  size_t *arg4 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  size_t val3 ;
  int ecode3 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  size_t written = 0; arg4 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_get_input_unknown_len", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_input_unknown_len" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_get_input_unknown_len" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  ecode3 = SWIG_AsVal_size_t(swig_obj[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "psbt_get_input_unknown_len" "', argument " "3"" of type '" "size_t""'");
  } 
  arg3 = (size_t)(val3);
  {
    result = (int)wally_psbt_get_input_unknown_len((struct wally_psbt const *)arg1,arg2,arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg4);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_input_sighash(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  size_t *arg3 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg3 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_get_input_sighash", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_input_sighash" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_get_input_sighash" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_psbt_get_input_sighash((struct wally_psbt const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg3);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_input_signature_type(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  uint32_t *arg3 = (uint32_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  uint32_t val3 ;
  PyObject *swig_obj[2] ;
  int result;
  
  {
    val3 = 0; arg3 = (uint32_t *)&val3;
  }
  if (!SWIG_Python_UnpackTuple(args, "psbt_get_input_signature_type", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_input_signature_type" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_get_input_signature_type" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_psbt_get_input_signature_type((struct wally_psbt const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyLong_FromUnsignedLong(*arg3);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_input_previous_txid(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_get_input_previous_txid", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_input_previous_txid" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_get_input_previous_txid" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_get_input_previous_txid" "', argument " "3"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg3 = (unsigned char *) buf;
    arg4 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_psbt_get_input_previous_txid((struct wally_psbt const *)arg1,arg2,arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_input_output_index(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  uint32_t *arg3 = (uint32_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  uint32_t val3 ;
  PyObject *swig_obj[2] ;
  int result;
  
  {
    val3 = 0; arg3 = (uint32_t *)&val3;
  }
  if (!SWIG_Python_UnpackTuple(args, "psbt_get_input_output_index", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_input_output_index" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_get_input_output_index" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_psbt_get_input_output_index((struct wally_psbt const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyLong_FromUnsignedLong(*arg3);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_input_sequence(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  uint32_t *arg3 = (uint32_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  uint32_t val3 ;
  PyObject *swig_obj[2] ;
  int result;
  
  {
    val3 = 0; arg3 = (uint32_t *)&val3;
  }
  if (!SWIG_Python_UnpackTuple(args, "psbt_get_input_sequence", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_input_sequence" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_get_input_sequence" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_psbt_get_input_sequence((struct wally_psbt const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyLong_FromUnsignedLong(*arg3);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_input_required_locktime(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  uint32_t *arg3 = (uint32_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  uint32_t val3 ;
  PyObject *swig_obj[2] ;
  int result;
  
  {
    val3 = 0; arg3 = (uint32_t *)&val3;
  }
  if (!SWIG_Python_UnpackTuple(args, "psbt_get_input_required_locktime", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_input_required_locktime" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_get_input_required_locktime" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_psbt_get_input_required_locktime((struct wally_psbt const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyLong_FromUnsignedLong(*arg3);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_input_required_lockheight(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  uint32_t *arg3 = (uint32_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  uint32_t val3 ;
  PyObject *swig_obj[2] ;
  int result;
  
  {
    val3 = 0; arg3 = (uint32_t *)&val3;
  }
  if (!SWIG_Python_UnpackTuple(args, "psbt_get_input_required_lockheight", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_input_required_lockheight" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_get_input_required_lockheight" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_psbt_get_input_required_lockheight((struct wally_psbt const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyLong_FromUnsignedLong(*arg3);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_set_input_utxo(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  struct wally_tx *arg3 = (struct wally_tx *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_set_input_utxo", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_set_input_utxo" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_set_input_utxo" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    arg3 = swig_obj[2] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[2], "struct wally_tx *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_set_input_utxo" "', argument " "3"" of type '" "(wally_tx)""'");
    }
  }
  {
    result = (int)wally_psbt_set_input_utxo(arg1,arg2,(struct wally_tx const *)arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_set_input_witness_utxo(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  struct wally_tx_output *arg3 = (struct wally_tx_output *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_set_input_witness_utxo", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_set_input_witness_utxo" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_set_input_witness_utxo" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    arg3 = swig_obj[2] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[2], "struct wally_tx_output *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_set_input_witness_utxo" "', argument " "3"" of type '" "(wally_tx_output)""'");
    }
  }
  {
    result = (int)wally_psbt_set_input_witness_utxo(arg1,arg2,(struct wally_tx_output const *)arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_set_input_witness_utxo_from_tx(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  struct wally_tx *arg3 = (struct wally_tx *) 0 ;
  uint32_t arg4 ;
  size_t val2 ;
  int ecode2 = 0 ;
  unsigned int val4 ;
  int ecode4 = 0 ;
  PyObject *swig_obj[4] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_set_input_witness_utxo_from_tx", 4, 4, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_set_input_witness_utxo_from_tx" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_set_input_witness_utxo_from_tx" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    arg3 = swig_obj[2] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[2], "struct wally_tx *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_set_input_witness_utxo_from_tx" "', argument " "3"" of type '" "(wally_tx)""'");
    }
  }
  ecode4 = SWIG_AsVal_unsigned_SS_int(swig_obj[3], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "psbt_set_input_witness_utxo_from_tx" "', argument " "4"" of type '" "uint32_t""'");
  } 
  arg4 = (uint32_t)(val4);
  {
    result = (int)wally_psbt_set_input_witness_utxo_from_tx(arg1,arg2,(struct wally_tx const *)arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_set_input_redeem_script(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_set_input_redeem_script", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_set_input_redeem_script" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_set_input_redeem_script" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[2] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_set_input_redeem_script" "', argument " "3"" of type '" "(const unsigned char* script, size_t script_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_psbt_set_input_redeem_script(arg1,arg2,(unsigned char const *)arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_set_input_witness_script(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_set_input_witness_script", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_set_input_witness_script" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_set_input_witness_script" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[2] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_set_input_witness_script" "', argument " "3"" of type '" "(const unsigned char* script, size_t script_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_psbt_set_input_witness_script(arg1,arg2,(unsigned char const *)arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_set_input_final_scriptsig(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_set_input_final_scriptsig", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_set_input_final_scriptsig" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_set_input_final_scriptsig" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[2] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_set_input_final_scriptsig" "', argument " "3"" of type '" "(const unsigned char* script, size_t script_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_psbt_set_input_final_scriptsig(arg1,arg2,(unsigned char const *)arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_set_input_final_witness(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  struct wally_tx_witness_stack *arg3 = (struct wally_tx_witness_stack *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_set_input_final_witness", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_set_input_final_witness" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_set_input_final_witness" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    arg3 = swig_obj[2] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[2], "struct wally_tx_witness_stack *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_set_input_final_witness" "', argument " "3"" of type '" "(wally_tx_witness_stack)""'");
    }
  }
  {
    result = (int)wally_psbt_set_input_final_witness(arg1,arg2,(struct wally_tx_witness_stack const *)arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_set_input_keypaths(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  struct wally_map *arg3 = (struct wally_map *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_set_input_keypaths", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_set_input_keypaths" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_set_input_keypaths" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    arg3 = swig_obj[2] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[2], "struct wally_map *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_set_input_keypaths" "', argument " "3"" of type '" "(wally_map)""'");
    }
  }
  {
    result = (int)wally_psbt_set_input_keypaths(arg1,arg2,(struct wally_map const *)arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_set_input_signatures(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  struct wally_map *arg3 = (struct wally_map *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_set_input_signatures", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_set_input_signatures" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_set_input_signatures" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    arg3 = swig_obj[2] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[2], "struct wally_map *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_set_input_signatures" "', argument " "3"" of type '" "(wally_map)""'");
    }
  }
  {
    result = (int)wally_psbt_set_input_signatures(arg1,arg2,(struct wally_map const *)arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_set_input_taproot_signature(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_set_input_taproot_signature", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_set_input_taproot_signature" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_set_input_taproot_signature" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[2] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_set_input_taproot_signature" "', argument " "3"" of type '" "(const unsigned char* sig, size_t sig_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_psbt_set_input_taproot_signature(arg1,arg2,(unsigned char const *)arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_set_input_taproot_internal_key(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_set_input_taproot_internal_key", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_set_input_taproot_internal_key" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_set_input_taproot_internal_key" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[2] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_set_input_taproot_internal_key" "', argument " "3"" of type '" "(const unsigned char* pub_key, size_t pub_key_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_psbt_set_input_taproot_internal_key(arg1,arg2,(unsigned char const *)arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_add_input_signature(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  unsigned char *arg5 = (unsigned char *) 0 ;
  size_t arg6 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[4] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_add_input_signature", 4, 4, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_add_input_signature" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_add_input_signature" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[2] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_add_input_signature" "', argument " "3"" of type '" "(const unsigned char* pub_key, size_t pub_key_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[3] == Py_None)
    arg6 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[3], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_add_input_signature" "', argument " "5"" of type '" "(const unsigned char* sig, size_t sig_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg5 = (unsigned char *) buf;
      arg6 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_psbt_add_input_signature(arg1,arg2,(unsigned char const *)arg3,arg4,(unsigned char const *)arg5,arg6);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_set_input_unknowns(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  struct wally_map *arg3 = (struct wally_map *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_set_input_unknowns", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_set_input_unknowns" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_set_input_unknowns" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    arg3 = swig_obj[2] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[2], "struct wally_map *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_set_input_unknowns" "', argument " "3"" of type '" "(wally_map)""'");
    }
  }
  {
    result = (int)wally_psbt_set_input_unknowns(arg1,arg2,(struct wally_map const *)arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_set_input_sighash(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  uint32_t arg3 ;
  size_t val2 ;
  int ecode2 = 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_set_input_sighash", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_set_input_sighash" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_set_input_sighash" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  ecode3 = SWIG_AsVal_unsigned_SS_int(swig_obj[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "psbt_set_input_sighash" "', argument " "3"" of type '" "uint32_t""'");
  } 
  arg3 = (uint32_t)(val3);
  {
    result = (int)wally_psbt_set_input_sighash(arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_set_input_previous_txid(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_set_input_previous_txid", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_set_input_previous_txid" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_set_input_previous_txid" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[2] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_set_input_previous_txid" "', argument " "3"" of type '" "(const unsigned char* txhash, size_t txhash_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_psbt_set_input_previous_txid(arg1,arg2,(unsigned char const *)arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_set_input_output_index(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  uint32_t arg3 ;
  size_t val2 ;
  int ecode2 = 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_set_input_output_index", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_set_input_output_index" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_set_input_output_index" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  ecode3 = SWIG_AsVal_unsigned_SS_int(swig_obj[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "psbt_set_input_output_index" "', argument " "3"" of type '" "uint32_t""'");
  } 
  arg3 = (uint32_t)(val3);
  {
    result = (int)wally_psbt_set_input_output_index(arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_set_input_sequence(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  uint32_t arg3 ;
  size_t val2 ;
  int ecode2 = 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_set_input_sequence", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_set_input_sequence" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_set_input_sequence" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  ecode3 = SWIG_AsVal_unsigned_SS_int(swig_obj[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "psbt_set_input_sequence" "', argument " "3"" of type '" "uint32_t""'");
  } 
  arg3 = (uint32_t)(val3);
  {
    result = (int)wally_psbt_set_input_sequence(arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_clear_input_sequence(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_clear_input_sequence", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_clear_input_sequence" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_clear_input_sequence" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_psbt_clear_input_sequence(arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_set_input_required_locktime(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  uint32_t arg3 ;
  size_t val2 ;
  int ecode2 = 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_set_input_required_locktime", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_set_input_required_locktime" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_set_input_required_locktime" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  ecode3 = SWIG_AsVal_unsigned_SS_int(swig_obj[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "psbt_set_input_required_locktime" "', argument " "3"" of type '" "uint32_t""'");
  } 
  arg3 = (uint32_t)(val3);
  {
    result = (int)wally_psbt_set_input_required_locktime(arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_clear_input_required_locktime(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_clear_input_required_locktime", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_clear_input_required_locktime" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_clear_input_required_locktime" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_psbt_clear_input_required_locktime(arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_has_input_required_locktime(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  size_t *arg3 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg3 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_has_input_required_locktime", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_has_input_required_locktime" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_has_input_required_locktime" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_psbt_has_input_required_locktime((struct wally_psbt const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg3);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_set_input_required_lockheight(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  uint32_t arg3 ;
  size_t val2 ;
  int ecode2 = 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_set_input_required_lockheight", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_set_input_required_lockheight" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_set_input_required_lockheight" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  ecode3 = SWIG_AsVal_unsigned_SS_int(swig_obj[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "psbt_set_input_required_lockheight" "', argument " "3"" of type '" "uint32_t""'");
  } 
  arg3 = (uint32_t)(val3);
  {
    result = (int)wally_psbt_set_input_required_lockheight(arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_clear_input_required_lockheight(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_clear_input_required_lockheight", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_clear_input_required_lockheight" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_clear_input_required_lockheight" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_psbt_clear_input_required_lockheight(arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_has_input_required_lockheight(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  size_t *arg3 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg3 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_has_input_required_lockheight", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_has_input_required_lockheight" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_has_input_required_lockheight" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_psbt_has_input_required_lockheight((struct wally_psbt const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg3);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_input_amount(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  uint64_t *arg3 = (uint64_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  uint64_t val3 ;
  PyObject *swig_obj[2] ;
  int result;
  
  {
    val3 = 0; arg3 = (uint64_t *)&val3;
  }
  if (!SWIG_Python_UnpackTuple(args, "psbt_get_input_amount", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_input_amount" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_get_input_amount" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_psbt_get_input_amount((struct wally_psbt const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyLong_FromUnsignedLongLong(*arg3);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_input_amount_rangeproof(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t *arg5 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  size_t written = 0; arg5 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_get_input_amount_rangeproof", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_input_amount_rangeproof" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_get_input_amount_rangeproof" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_get_input_amount_rangeproof" "', argument " "3"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg3 = (unsigned char *) buf;
    arg4 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_psbt_get_input_amount_rangeproof((struct wally_psbt const *)arg1,arg2,arg3,arg4,arg5);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg5);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_input_amount_rangeproof_len(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  size_t *arg3 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg3 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_get_input_amount_rangeproof_len", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_input_amount_rangeproof_len" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_get_input_amount_rangeproof_len" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_psbt_get_input_amount_rangeproof_len((struct wally_psbt const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg3);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_input_asset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t *arg5 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  size_t written = 0; arg5 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_get_input_asset", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_input_asset" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_get_input_asset" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_get_input_asset" "', argument " "3"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg3 = (unsigned char *) buf;
    arg4 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_psbt_get_input_asset((struct wally_psbt const *)arg1,arg2,arg3,arg4,arg5);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg5);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_input_asset_len(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  size_t *arg3 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg3 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_get_input_asset_len", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_input_asset_len" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_get_input_asset_len" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_psbt_get_input_asset_len((struct wally_psbt const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg3);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_input_asset_surjectionproof(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t *arg5 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  size_t written = 0; arg5 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_get_input_asset_surjectionproof", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_input_asset_surjectionproof" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_get_input_asset_surjectionproof" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_get_input_asset_surjectionproof" "', argument " "3"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg3 = (unsigned char *) buf;
    arg4 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_psbt_get_input_asset_surjectionproof((struct wally_psbt const *)arg1,arg2,arg3,arg4,arg5);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg5);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_input_asset_surjectionproof_len(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  size_t *arg3 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg3 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_get_input_asset_surjectionproof_len", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_input_asset_surjectionproof_len" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_get_input_asset_surjectionproof_len" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_psbt_get_input_asset_surjectionproof_len((struct wally_psbt const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg3);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_input_issuance_amount(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  uint64_t *arg3 = (uint64_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  uint64_t val3 ;
  PyObject *swig_obj[2] ;
  int result;
  
  {
    val3 = 0; arg3 = (uint64_t *)&val3;
  }
  if (!SWIG_Python_UnpackTuple(args, "psbt_get_input_issuance_amount", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_input_issuance_amount" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_get_input_issuance_amount" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_psbt_get_input_issuance_amount((struct wally_psbt const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyLong_FromUnsignedLongLong(*arg3);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_input_inflation_keys(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  uint64_t *arg3 = (uint64_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  uint64_t val3 ;
  PyObject *swig_obj[2] ;
  int result;
  
  {
    val3 = 0; arg3 = (uint64_t *)&val3;
  }
  if (!SWIG_Python_UnpackTuple(args, "psbt_get_input_inflation_keys", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_input_inflation_keys" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_get_input_inflation_keys" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_psbt_get_input_inflation_keys((struct wally_psbt const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyLong_FromUnsignedLongLong(*arg3);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_input_pegin_amount(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  uint64_t *arg3 = (uint64_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  uint64_t val3 ;
  PyObject *swig_obj[2] ;
  int result;
  
  {
    val3 = 0; arg3 = (uint64_t *)&val3;
  }
  if (!SWIG_Python_UnpackTuple(args, "psbt_get_input_pegin_amount", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_input_pegin_amount" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_get_input_pegin_amount" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_psbt_get_input_pegin_amount((struct wally_psbt const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyLong_FromUnsignedLongLong(*arg3);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_input_pegin_txout_proof(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t *arg5 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  size_t written = 0; arg5 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_get_input_pegin_txout_proof", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_input_pegin_txout_proof" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_get_input_pegin_txout_proof" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_get_input_pegin_txout_proof" "', argument " "3"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg3 = (unsigned char *) buf;
    arg4 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_psbt_get_input_pegin_txout_proof((struct wally_psbt const *)arg1,arg2,arg3,arg4,arg5);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg5);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_input_pegin_txout_proof_len(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  size_t *arg3 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg3 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_get_input_pegin_txout_proof_len", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_input_pegin_txout_proof_len" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_get_input_pegin_txout_proof_len" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_psbt_get_input_pegin_txout_proof_len((struct wally_psbt const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg3);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_input_pegin_genesis_blockhash(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t *arg5 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  size_t written = 0; arg5 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_get_input_pegin_genesis_blockhash", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_input_pegin_genesis_blockhash" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_get_input_pegin_genesis_blockhash" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_get_input_pegin_genesis_blockhash" "', argument " "3"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg3 = (unsigned char *) buf;
    arg4 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_psbt_get_input_pegin_genesis_blockhash((struct wally_psbt const *)arg1,arg2,arg3,arg4,arg5);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg5);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_input_pegin_genesis_blockhash_len(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  size_t *arg3 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg3 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_get_input_pegin_genesis_blockhash_len", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_input_pegin_genesis_blockhash_len" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_get_input_pegin_genesis_blockhash_len" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_psbt_get_input_pegin_genesis_blockhash_len((struct wally_psbt const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg3);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_input_pegin_claim_script(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t *arg5 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  size_t written = 0; arg5 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_get_input_pegin_claim_script", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_input_pegin_claim_script" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_get_input_pegin_claim_script" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_get_input_pegin_claim_script" "', argument " "3"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg3 = (unsigned char *) buf;
    arg4 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_psbt_get_input_pegin_claim_script((struct wally_psbt const *)arg1,arg2,arg3,arg4,arg5);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg5);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_input_pegin_claim_script_len(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  size_t *arg3 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg3 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_get_input_pegin_claim_script_len", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_input_pegin_claim_script_len" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_get_input_pegin_claim_script_len" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_psbt_get_input_pegin_claim_script_len((struct wally_psbt const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg3);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_input_issuance_amount_commitment(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t *arg5 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  size_t written = 0; arg5 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_get_input_issuance_amount_commitment", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_input_issuance_amount_commitment" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_get_input_issuance_amount_commitment" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_get_input_issuance_amount_commitment" "', argument " "3"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg3 = (unsigned char *) buf;
    arg4 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_psbt_get_input_issuance_amount_commitment((struct wally_psbt const *)arg1,arg2,arg3,arg4,arg5);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg5);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_input_issuance_amount_commitment_len(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  size_t *arg3 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg3 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_get_input_issuance_amount_commitment_len", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_input_issuance_amount_commitment_len" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_get_input_issuance_amount_commitment_len" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_psbt_get_input_issuance_amount_commitment_len((struct wally_psbt const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg3);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_input_issuance_amount_rangeproof(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t *arg5 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  size_t written = 0; arg5 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_get_input_issuance_amount_rangeproof", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_input_issuance_amount_rangeproof" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_get_input_issuance_amount_rangeproof" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_get_input_issuance_amount_rangeproof" "', argument " "3"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg3 = (unsigned char *) buf;
    arg4 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_psbt_get_input_issuance_amount_rangeproof((struct wally_psbt const *)arg1,arg2,arg3,arg4,arg5);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg5);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_input_issuance_amount_rangeproof_len(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  size_t *arg3 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg3 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_get_input_issuance_amount_rangeproof_len", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_input_issuance_amount_rangeproof_len" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_get_input_issuance_amount_rangeproof_len" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_psbt_get_input_issuance_amount_rangeproof_len((struct wally_psbt const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg3);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_input_issuance_blinding_nonce(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t *arg5 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  size_t written = 0; arg5 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_get_input_issuance_blinding_nonce", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_input_issuance_blinding_nonce" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_get_input_issuance_blinding_nonce" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_get_input_issuance_blinding_nonce" "', argument " "3"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg3 = (unsigned char *) buf;
    arg4 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_psbt_get_input_issuance_blinding_nonce((struct wally_psbt const *)arg1,arg2,arg3,arg4,arg5);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg5);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_input_issuance_blinding_nonce_len(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  size_t *arg3 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg3 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_get_input_issuance_blinding_nonce_len", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_input_issuance_blinding_nonce_len" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_get_input_issuance_blinding_nonce_len" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_psbt_get_input_issuance_blinding_nonce_len((struct wally_psbt const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg3);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_input_issuance_asset_entropy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t *arg5 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  size_t written = 0; arg5 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_get_input_issuance_asset_entropy", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_input_issuance_asset_entropy" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_get_input_issuance_asset_entropy" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_get_input_issuance_asset_entropy" "', argument " "3"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg3 = (unsigned char *) buf;
    arg4 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_psbt_get_input_issuance_asset_entropy((struct wally_psbt const *)arg1,arg2,arg3,arg4,arg5);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg5);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_input_issuance_asset_entropy_len(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  size_t *arg3 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg3 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_get_input_issuance_asset_entropy_len", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_input_issuance_asset_entropy_len" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_get_input_issuance_asset_entropy_len" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_psbt_get_input_issuance_asset_entropy_len((struct wally_psbt const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg3);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_input_issuance_amount_blinding_rangeproof(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t *arg5 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  size_t written = 0; arg5 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_get_input_issuance_amount_blinding_rangeproof", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_input_issuance_amount_blinding_rangeproof" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_get_input_issuance_amount_blinding_rangeproof" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_get_input_issuance_amount_blinding_rangeproof" "', argument " "3"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg3 = (unsigned char *) buf;
    arg4 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_psbt_get_input_issuance_amount_blinding_rangeproof((struct wally_psbt const *)arg1,arg2,arg3,arg4,arg5);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg5);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_input_issuance_amount_blinding_rangeproof_len(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  size_t *arg3 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg3 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_get_input_issuance_amount_blinding_rangeproof_len", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_input_issuance_amount_blinding_rangeproof_len" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_get_input_issuance_amount_blinding_rangeproof_len" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_psbt_get_input_issuance_amount_blinding_rangeproof_len((struct wally_psbt const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg3);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_input_inflation_keys_commitment(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t *arg5 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  size_t written = 0; arg5 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_get_input_inflation_keys_commitment", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_input_inflation_keys_commitment" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_get_input_inflation_keys_commitment" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_get_input_inflation_keys_commitment" "', argument " "3"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg3 = (unsigned char *) buf;
    arg4 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_psbt_get_input_inflation_keys_commitment((struct wally_psbt const *)arg1,arg2,arg3,arg4,arg5);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg5);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_input_inflation_keys_commitment_len(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  size_t *arg3 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg3 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_get_input_inflation_keys_commitment_len", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_input_inflation_keys_commitment_len" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_get_input_inflation_keys_commitment_len" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_psbt_get_input_inflation_keys_commitment_len((struct wally_psbt const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg3);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_input_inflation_keys_rangeproof(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t *arg5 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  size_t written = 0; arg5 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_get_input_inflation_keys_rangeproof", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_input_inflation_keys_rangeproof" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_get_input_inflation_keys_rangeproof" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_get_input_inflation_keys_rangeproof" "', argument " "3"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg3 = (unsigned char *) buf;
    arg4 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_psbt_get_input_inflation_keys_rangeproof((struct wally_psbt const *)arg1,arg2,arg3,arg4,arg5);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg5);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_input_inflation_keys_rangeproof_len(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  size_t *arg3 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg3 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_get_input_inflation_keys_rangeproof_len", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_input_inflation_keys_rangeproof_len" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_get_input_inflation_keys_rangeproof_len" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_psbt_get_input_inflation_keys_rangeproof_len((struct wally_psbt const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg3);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_input_inflation_keys_blinding_rangeproof(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t *arg5 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  size_t written = 0; arg5 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_get_input_inflation_keys_blinding_rangeproof", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_input_inflation_keys_blinding_rangeproof" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_get_input_inflation_keys_blinding_rangeproof" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_get_input_inflation_keys_blinding_rangeproof" "', argument " "3"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg3 = (unsigned char *) buf;
    arg4 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_psbt_get_input_inflation_keys_blinding_rangeproof((struct wally_psbt const *)arg1,arg2,arg3,arg4,arg5);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg5);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_input_inflation_keys_blinding_rangeproof_len(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  size_t *arg3 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg3 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_get_input_inflation_keys_blinding_rangeproof_len", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_input_inflation_keys_blinding_rangeproof_len" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_get_input_inflation_keys_blinding_rangeproof_len" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_psbt_get_input_inflation_keys_blinding_rangeproof_len((struct wally_psbt const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg3);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_input_utxo_rangeproof(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t *arg5 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  size_t written = 0; arg5 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_get_input_utxo_rangeproof", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_input_utxo_rangeproof" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_get_input_utxo_rangeproof" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_get_input_utxo_rangeproof" "', argument " "3"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg3 = (unsigned char *) buf;
    arg4 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_psbt_get_input_utxo_rangeproof((struct wally_psbt const *)arg1,arg2,arg3,arg4,arg5);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg5);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_input_utxo_rangeproof_len(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  size_t *arg3 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg3 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_get_input_utxo_rangeproof_len", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_input_utxo_rangeproof_len" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_get_input_utxo_rangeproof_len" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_psbt_get_input_utxo_rangeproof_len((struct wally_psbt const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg3);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_set_input_amount(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  uint64_t arg3 ;
  size_t val2 ;
  int ecode2 = 0 ;
  unsigned long long val3 ;
  int ecode3 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_set_input_amount", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_set_input_amount" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_set_input_amount" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  ecode3 = SWIG_AsVal_unsigned_SS_long_SS_long(swig_obj[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "psbt_set_input_amount" "', argument " "3"" of type '" "uint64_t""'");
  } 
  arg3 = (uint64_t)(val3);
  {
    result = (int)wally_psbt_set_input_amount(arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_clear_input_amount(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_clear_input_amount", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_clear_input_amount" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_clear_input_amount" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_psbt_clear_input_amount(arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_set_input_amount_rangeproof(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_set_input_amount_rangeproof", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_set_input_amount_rangeproof" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_set_input_amount_rangeproof" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[2] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_set_input_amount_rangeproof" "', argument " "3"" of type '" "(const unsigned char* rangeproof, size_t rangeproof_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_psbt_set_input_amount_rangeproof(arg1,arg2,(unsigned char const *)arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_clear_input_amount_rangeproof(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_clear_input_amount_rangeproof", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_clear_input_amount_rangeproof" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_clear_input_amount_rangeproof" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_psbt_clear_input_amount_rangeproof(arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_set_input_asset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_set_input_asset", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_set_input_asset" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_set_input_asset" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[2] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_set_input_asset" "', argument " "3"" of type '" "(const unsigned char* asset, size_t asset_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_psbt_set_input_asset(arg1,arg2,(unsigned char const *)arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_clear_input_asset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_clear_input_asset", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_clear_input_asset" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_clear_input_asset" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_psbt_clear_input_asset(arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_set_input_asset_surjectionproof(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_set_input_asset_surjectionproof", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_set_input_asset_surjectionproof" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_set_input_asset_surjectionproof" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[2] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_set_input_asset_surjectionproof" "', argument " "3"" of type '" "(const unsigned char* surjectionproof, size_t surjectionproof_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_psbt_set_input_asset_surjectionproof(arg1,arg2,(unsigned char const *)arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_clear_input_asset_surjectionproof(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_clear_input_asset_surjectionproof", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_clear_input_asset_surjectionproof" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_clear_input_asset_surjectionproof" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_psbt_clear_input_asset_surjectionproof(arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_set_input_issuance_amount(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  uint64_t arg3 ;
  size_t val2 ;
  int ecode2 = 0 ;
  unsigned long long val3 ;
  int ecode3 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_set_input_issuance_amount", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_set_input_issuance_amount" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_set_input_issuance_amount" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  ecode3 = SWIG_AsVal_unsigned_SS_long_SS_long(swig_obj[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "psbt_set_input_issuance_amount" "', argument " "3"" of type '" "uint64_t""'");
  } 
  arg3 = (uint64_t)(val3);
  {
    result = (int)wally_psbt_set_input_issuance_amount(arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_set_input_inflation_keys(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  uint64_t arg3 ;
  size_t val2 ;
  int ecode2 = 0 ;
  unsigned long long val3 ;
  int ecode3 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_set_input_inflation_keys", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_set_input_inflation_keys" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_set_input_inflation_keys" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  ecode3 = SWIG_AsVal_unsigned_SS_long_SS_long(swig_obj[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "psbt_set_input_inflation_keys" "', argument " "3"" of type '" "uint64_t""'");
  } 
  arg3 = (uint64_t)(val3);
  {
    result = (int)wally_psbt_set_input_inflation_keys(arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_set_input_pegin_amount(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  uint64_t arg3 ;
  size_t val2 ;
  int ecode2 = 0 ;
  unsigned long long val3 ;
  int ecode3 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_set_input_pegin_amount", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_set_input_pegin_amount" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_set_input_pegin_amount" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  ecode3 = SWIG_AsVal_unsigned_SS_long_SS_long(swig_obj[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "psbt_set_input_pegin_amount" "', argument " "3"" of type '" "uint64_t""'");
  } 
  arg3 = (uint64_t)(val3);
  {
    result = (int)wally_psbt_set_input_pegin_amount(arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_set_input_pegin_txout_proof(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_set_input_pegin_txout_proof", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_set_input_pegin_txout_proof" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_set_input_pegin_txout_proof" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[2] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_set_input_pegin_txout_proof" "', argument " "3"" of type '" "(const unsigned char* txout_proof, size_t txout_proof_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_psbt_set_input_pegin_txout_proof(arg1,arg2,(unsigned char const *)arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_clear_input_pegin_txout_proof(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_clear_input_pegin_txout_proof", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_clear_input_pegin_txout_proof" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_clear_input_pegin_txout_proof" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_psbt_clear_input_pegin_txout_proof(arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_set_input_pegin_genesis_blockhash(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_set_input_pegin_genesis_blockhash", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_set_input_pegin_genesis_blockhash" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_set_input_pegin_genesis_blockhash" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[2] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_set_input_pegin_genesis_blockhash" "', argument " "3"" of type '" "(const unsigned char* genesis_blockhash, size_t genesis_blockhash_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_psbt_set_input_pegin_genesis_blockhash(arg1,arg2,(unsigned char const *)arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_clear_input_pegin_genesis_blockhash(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_clear_input_pegin_genesis_blockhash", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_clear_input_pegin_genesis_blockhash" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_clear_input_pegin_genesis_blockhash" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_psbt_clear_input_pegin_genesis_blockhash(arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_set_input_pegin_claim_script(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_set_input_pegin_claim_script", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_set_input_pegin_claim_script" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_set_input_pegin_claim_script" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[2] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_set_input_pegin_claim_script" "', argument " "3"" of type '" "(const unsigned char* script, size_t script_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_psbt_set_input_pegin_claim_script(arg1,arg2,(unsigned char const *)arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_clear_input_pegin_claim_script(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_clear_input_pegin_claim_script", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_clear_input_pegin_claim_script" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_clear_input_pegin_claim_script" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_psbt_clear_input_pegin_claim_script(arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_set_input_issuance_amount_commitment(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_set_input_issuance_amount_commitment", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_set_input_issuance_amount_commitment" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_set_input_issuance_amount_commitment" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[2] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_set_input_issuance_amount_commitment" "', argument " "3"" of type '" "(const unsigned char* commitment, size_t commitment_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_psbt_set_input_issuance_amount_commitment(arg1,arg2,(unsigned char const *)arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_clear_input_issuance_amount_commitment(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_clear_input_issuance_amount_commitment", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_clear_input_issuance_amount_commitment" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_clear_input_issuance_amount_commitment" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_psbt_clear_input_issuance_amount_commitment(arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_set_input_issuance_amount_rangeproof(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_set_input_issuance_amount_rangeproof", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_set_input_issuance_amount_rangeproof" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_set_input_issuance_amount_rangeproof" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[2] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_set_input_issuance_amount_rangeproof" "', argument " "3"" of type '" "(const unsigned char* rangeproof, size_t rangeproof_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_psbt_set_input_issuance_amount_rangeproof(arg1,arg2,(unsigned char const *)arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_clear_input_issuance_amount_rangeproof(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_clear_input_issuance_amount_rangeproof", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_clear_input_issuance_amount_rangeproof" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_clear_input_issuance_amount_rangeproof" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_psbt_clear_input_issuance_amount_rangeproof(arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_set_input_issuance_blinding_nonce(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_set_input_issuance_blinding_nonce", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_set_input_issuance_blinding_nonce" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_set_input_issuance_blinding_nonce" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[2] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_set_input_issuance_blinding_nonce" "', argument " "3"" of type '" "(const unsigned char* nonce, size_t nonce_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_psbt_set_input_issuance_blinding_nonce(arg1,arg2,(unsigned char const *)arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_clear_input_issuance_blinding_nonce(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_clear_input_issuance_blinding_nonce", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_clear_input_issuance_blinding_nonce" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_clear_input_issuance_blinding_nonce" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_psbt_clear_input_issuance_blinding_nonce(arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_set_input_issuance_asset_entropy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_set_input_issuance_asset_entropy", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_set_input_issuance_asset_entropy" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_set_input_issuance_asset_entropy" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[2] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_set_input_issuance_asset_entropy" "', argument " "3"" of type '" "(const unsigned char* entropy, size_t entropy_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_psbt_set_input_issuance_asset_entropy(arg1,arg2,(unsigned char const *)arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_clear_input_issuance_asset_entropy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_clear_input_issuance_asset_entropy", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_clear_input_issuance_asset_entropy" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_clear_input_issuance_asset_entropy" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_psbt_clear_input_issuance_asset_entropy(arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_set_input_issuance_amount_blinding_rangeproof(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_set_input_issuance_amount_blinding_rangeproof", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_set_input_issuance_amount_blinding_rangeproof" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_set_input_issuance_amount_blinding_rangeproof" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[2] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_set_input_issuance_amount_blinding_rangeproof" "', argument " "3"" of type '" "(const unsigned char* rangeproof, size_t rangeproof_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_psbt_set_input_issuance_amount_blinding_rangeproof(arg1,arg2,(unsigned char const *)arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_clear_input_issuance_amount_blinding_rangeproof(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_clear_input_issuance_amount_blinding_rangeproof", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_clear_input_issuance_amount_blinding_rangeproof" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_clear_input_issuance_amount_blinding_rangeproof" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_psbt_clear_input_issuance_amount_blinding_rangeproof(arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_set_input_inflation_keys_commitment(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_set_input_inflation_keys_commitment", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_set_input_inflation_keys_commitment" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_set_input_inflation_keys_commitment" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[2] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_set_input_inflation_keys_commitment" "', argument " "3"" of type '" "(const unsigned char* commitment, size_t commitment_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_psbt_set_input_inflation_keys_commitment(arg1,arg2,(unsigned char const *)arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_clear_input_inflation_keys_commitment(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_clear_input_inflation_keys_commitment", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_clear_input_inflation_keys_commitment" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_clear_input_inflation_keys_commitment" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_psbt_clear_input_inflation_keys_commitment(arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_set_input_inflation_keys_rangeproof(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_set_input_inflation_keys_rangeproof", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_set_input_inflation_keys_rangeproof" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_set_input_inflation_keys_rangeproof" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[2] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_set_input_inflation_keys_rangeproof" "', argument " "3"" of type '" "(const unsigned char* rangeproof, size_t rangeproof_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_psbt_set_input_inflation_keys_rangeproof(arg1,arg2,(unsigned char const *)arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_clear_input_inflation_keys_rangeproof(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_clear_input_inflation_keys_rangeproof", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_clear_input_inflation_keys_rangeproof" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_clear_input_inflation_keys_rangeproof" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_psbt_clear_input_inflation_keys_rangeproof(arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_set_input_inflation_keys_blinding_rangeproof(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_set_input_inflation_keys_blinding_rangeproof", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_set_input_inflation_keys_blinding_rangeproof" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_set_input_inflation_keys_blinding_rangeproof" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[2] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_set_input_inflation_keys_blinding_rangeproof" "', argument " "3"" of type '" "(const unsigned char* rangeproof, size_t rangeproof_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_psbt_set_input_inflation_keys_blinding_rangeproof(arg1,arg2,(unsigned char const *)arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_clear_input_inflation_keys_blinding_rangeproof(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_clear_input_inflation_keys_blinding_rangeproof", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_clear_input_inflation_keys_blinding_rangeproof" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_clear_input_inflation_keys_blinding_rangeproof" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_psbt_clear_input_inflation_keys_blinding_rangeproof(arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_set_input_utxo_rangeproof(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_set_input_utxo_rangeproof", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_set_input_utxo_rangeproof" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_set_input_utxo_rangeproof" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[2] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_set_input_utxo_rangeproof" "', argument " "3"" of type '" "(const unsigned char* rangeproof, size_t rangeproof_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_psbt_set_input_utxo_rangeproof(arg1,arg2,(unsigned char const *)arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_clear_input_utxo_rangeproof(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_clear_input_utxo_rangeproof", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_clear_input_utxo_rangeproof" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_clear_input_utxo_rangeproof" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_psbt_clear_input_utxo_rangeproof(arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_generate_input_explicit_proofs(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  uint64_t arg3 ;
  unsigned char *arg4 = (unsigned char *) 0 ;
  size_t arg5 ;
  unsigned char *arg6 = (unsigned char *) 0 ;
  size_t arg7 ;
  unsigned char *arg8 = (unsigned char *) 0 ;
  size_t arg9 ;
  unsigned char *arg10 = (unsigned char *) 0 ;
  size_t arg11 ;
  size_t val2 ;
  int ecode2 = 0 ;
  unsigned long long val3 ;
  int ecode3 = 0 ;
  PyObject *swig_obj[7] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_generate_input_explicit_proofs", 7, 7, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_generate_input_explicit_proofs" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_generate_input_explicit_proofs" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  ecode3 = SWIG_AsVal_unsigned_SS_long_SS_long(swig_obj[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "psbt_generate_input_explicit_proofs" "', argument " "3"" of type '" "uint64_t""'");
  } 
  arg3 = (uint64_t)(val3);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[3] == Py_None)
    arg5 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[3], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_generate_input_explicit_proofs" "', argument " "4"" of type '" "(const unsigned char* asset, size_t asset_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg4 = (unsigned char *) buf;
      arg5 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[4] == Py_None)
    arg7 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[4], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_generate_input_explicit_proofs" "', argument " "6"" of type '" "(const unsigned char* abf, size_t abf_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg6 = (unsigned char *) buf;
      arg7 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[5] == Py_None)
    arg9 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[5], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_generate_input_explicit_proofs" "', argument " "8"" of type '" "(const unsigned char* vbf, size_t vbf_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg8 = (unsigned char *) buf;
      arg9 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[6] == Py_None)
    arg11 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[6], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_generate_input_explicit_proofs" "', argument " "10"" of type '" "(const unsigned char* entropy, size_t entropy_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg10 = (unsigned char *) buf;
      arg11 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_psbt_generate_input_explicit_proofs(arg1,arg2,arg3,(unsigned char const *)arg4,arg5,(unsigned char const *)arg6,arg7,(unsigned char const *)arg8,arg9,(unsigned char const *)arg10,arg11);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_output_redeem_script(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t *arg5 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  size_t written = 0; arg5 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_get_output_redeem_script", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_output_redeem_script" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_get_output_redeem_script" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_get_output_redeem_script" "', argument " "3"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg3 = (unsigned char *) buf;
    arg4 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_psbt_get_output_redeem_script((struct wally_psbt const *)arg1,arg2,arg3,arg4,arg5);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg5);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_output_redeem_script_len(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  size_t *arg3 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg3 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_get_output_redeem_script_len", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_output_redeem_script_len" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_get_output_redeem_script_len" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_psbt_get_output_redeem_script_len((struct wally_psbt const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg3);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_output_witness_script(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t *arg5 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  size_t written = 0; arg5 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_get_output_witness_script", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_output_witness_script" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_get_output_witness_script" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_get_output_witness_script" "', argument " "3"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg3 = (unsigned char *) buf;
    arg4 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_psbt_get_output_witness_script((struct wally_psbt const *)arg1,arg2,arg3,arg4,arg5);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg5);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_output_witness_script_len(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  size_t *arg3 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg3 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_get_output_witness_script_len", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_output_witness_script_len" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_get_output_witness_script_len" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_psbt_get_output_witness_script_len((struct wally_psbt const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg3);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_output_keypaths_size(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  size_t *arg3 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg3 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_get_output_keypaths_size", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_output_keypaths_size" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_get_output_keypaths_size" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_psbt_get_output_keypaths_size((struct wally_psbt const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg3);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_find_output_keypath(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t *arg5 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  size_t written = 0; arg5 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_find_output_keypath", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_find_output_keypath" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_find_output_keypath" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[2] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_find_output_keypath" "', argument " "3"" of type '" "(const unsigned char* key, size_t key_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_psbt_find_output_keypath((struct wally_psbt const *)arg1,arg2,(unsigned char const *)arg3,arg4,arg5);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg5);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_output_keypath(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  size_t arg3 ;
  unsigned char *arg4 = (unsigned char *) 0 ;
  size_t arg5 ;
  size_t *arg6 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  size_t val3 ;
  int ecode3 = 0 ;
  PyObject *swig_obj[4] ;
  int result;
  
  size_t written = 0; arg6 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_get_output_keypath", 4, 4, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_output_keypath" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_get_output_keypath" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  ecode3 = SWIG_AsVal_size_t(swig_obj[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "psbt_get_output_keypath" "', argument " "3"" of type '" "size_t""'");
  } 
  arg3 = (size_t)(val3);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[3], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_get_output_keypath" "', argument " "4"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg4 = (unsigned char *) buf;
    arg5 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_psbt_get_output_keypath((struct wally_psbt const *)arg1,arg2,arg3,arg4,arg5,arg6);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg6);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_output_keypath_len(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  size_t arg3 ;
  size_t *arg4 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  size_t val3 ;
  int ecode3 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  size_t written = 0; arg4 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_get_output_keypath_len", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_output_keypath_len" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_get_output_keypath_len" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  ecode3 = SWIG_AsVal_size_t(swig_obj[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "psbt_get_output_keypath_len" "', argument " "3"" of type '" "size_t""'");
  } 
  arg3 = (size_t)(val3);
  {
    result = (int)wally_psbt_get_output_keypath_len((struct wally_psbt const *)arg1,arg2,arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg4);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_output_unknowns_size(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  size_t *arg3 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg3 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_get_output_unknowns_size", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_output_unknowns_size" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_get_output_unknowns_size" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_psbt_get_output_unknowns_size((struct wally_psbt const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg3);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_find_output_unknown(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t *arg5 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  size_t written = 0; arg5 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_find_output_unknown", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_find_output_unknown" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_find_output_unknown" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[2] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_find_output_unknown" "', argument " "3"" of type '" "(const unsigned char* key, size_t key_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_psbt_find_output_unknown((struct wally_psbt const *)arg1,arg2,(unsigned char const *)arg3,arg4,arg5);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg5);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_output_unknown(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  size_t arg3 ;
  unsigned char *arg4 = (unsigned char *) 0 ;
  size_t arg5 ;
  size_t *arg6 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  size_t val3 ;
  int ecode3 = 0 ;
  PyObject *swig_obj[4] ;
  int result;
  
  size_t written = 0; arg6 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_get_output_unknown", 4, 4, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_output_unknown" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_get_output_unknown" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  ecode3 = SWIG_AsVal_size_t(swig_obj[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "psbt_get_output_unknown" "', argument " "3"" of type '" "size_t""'");
  } 
  arg3 = (size_t)(val3);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[3], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_get_output_unknown" "', argument " "4"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg4 = (unsigned char *) buf;
    arg5 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_psbt_get_output_unknown((struct wally_psbt const *)arg1,arg2,arg3,arg4,arg5,arg6);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg6);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_output_unknown_len(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  size_t arg3 ;
  size_t *arg4 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  size_t val3 ;
  int ecode3 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  size_t written = 0; arg4 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_get_output_unknown_len", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_output_unknown_len" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_get_output_unknown_len" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  ecode3 = SWIG_AsVal_size_t(swig_obj[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "psbt_get_output_unknown_len" "', argument " "3"" of type '" "size_t""'");
  } 
  arg3 = (size_t)(val3);
  {
    result = (int)wally_psbt_get_output_unknown_len((struct wally_psbt const *)arg1,arg2,arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg4);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_output_script(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t *arg5 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  size_t written = 0; arg5 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_get_output_script", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_output_script" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_get_output_script" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_get_output_script" "', argument " "3"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg3 = (unsigned char *) buf;
    arg4 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_psbt_get_output_script((struct wally_psbt const *)arg1,arg2,arg3,arg4,arg5);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg5);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_output_script_len(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  size_t *arg3 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg3 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_get_output_script_len", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_output_script_len" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_get_output_script_len" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_psbt_get_output_script_len((struct wally_psbt const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg3);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_output_amount(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  uint64_t *arg3 = (uint64_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  uint64_t val3 ;
  PyObject *swig_obj[2] ;
  int result;
  
  {
    val3 = 0; arg3 = (uint64_t *)&val3;
  }
  if (!SWIG_Python_UnpackTuple(args, "psbt_get_output_amount", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_output_amount" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_get_output_amount" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_psbt_get_output_amount((struct wally_psbt const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyLong_FromUnsignedLongLong(*arg3);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_has_output_amount(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  size_t *arg3 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg3 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_has_output_amount", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_has_output_amount" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_has_output_amount" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_psbt_has_output_amount((struct wally_psbt const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg3);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_output_taproot_internal_key(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t *arg5 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  size_t written = 0; arg5 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_get_output_taproot_internal_key", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_output_taproot_internal_key" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_get_output_taproot_internal_key" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_get_output_taproot_internal_key" "', argument " "3"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg3 = (unsigned char *) buf;
    arg4 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_psbt_get_output_taproot_internal_key((struct wally_psbt const *)arg1,arg2,arg3,arg4,arg5);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg5);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_output_taproot_internal_key_len(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  size_t *arg3 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg3 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_get_output_taproot_internal_key_len", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_output_taproot_internal_key_len" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_get_output_taproot_internal_key_len" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_psbt_get_output_taproot_internal_key_len((struct wally_psbt const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg3);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_set_output_redeem_script(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_set_output_redeem_script", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_set_output_redeem_script" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_set_output_redeem_script" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[2] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_set_output_redeem_script" "', argument " "3"" of type '" "(const unsigned char* script, size_t script_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_psbt_set_output_redeem_script(arg1,arg2,(unsigned char const *)arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_set_output_witness_script(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_set_output_witness_script", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_set_output_witness_script" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_set_output_witness_script" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[2] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_set_output_witness_script" "', argument " "3"" of type '" "(const unsigned char* script, size_t script_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_psbt_set_output_witness_script(arg1,arg2,(unsigned char const *)arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_set_output_keypaths(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  struct wally_map *arg3 = (struct wally_map *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_set_output_keypaths", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_set_output_keypaths" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_set_output_keypaths" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    arg3 = swig_obj[2] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[2], "struct wally_map *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_set_output_keypaths" "', argument " "3"" of type '" "(wally_map)""'");
    }
  }
  {
    result = (int)wally_psbt_set_output_keypaths(arg1,arg2,(struct wally_map const *)arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_set_output_unknowns(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  struct wally_map *arg3 = (struct wally_map *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_set_output_unknowns", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_set_output_unknowns" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_set_output_unknowns" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    arg3 = swig_obj[2] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[2], "struct wally_map *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_set_output_unknowns" "', argument " "3"" of type '" "(wally_map)""'");
    }
  }
  {
    result = (int)wally_psbt_set_output_unknowns(arg1,arg2,(struct wally_map const *)arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_set_output_script(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_set_output_script", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_set_output_script" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_set_output_script" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[2] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_set_output_script" "', argument " "3"" of type '" "(const unsigned char* script, size_t script_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_psbt_set_output_script(arg1,arg2,(unsigned char const *)arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_set_output_amount(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  uint64_t arg3 ;
  size_t val2 ;
  int ecode2 = 0 ;
  unsigned long long val3 ;
  int ecode3 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_set_output_amount", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_set_output_amount" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_set_output_amount" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  ecode3 = SWIG_AsVal_unsigned_SS_long_SS_long(swig_obj[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "psbt_set_output_amount" "', argument " "3"" of type '" "uint64_t""'");
  } 
  arg3 = (uint64_t)(val3);
  {
    result = (int)wally_psbt_set_output_amount(arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_clear_output_amount(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_clear_output_amount", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_clear_output_amount" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_clear_output_amount" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_psbt_clear_output_amount(arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_set_output_taproot_internal_key(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_set_output_taproot_internal_key", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_set_output_taproot_internal_key" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_set_output_taproot_internal_key" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[2] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_set_output_taproot_internal_key" "', argument " "3"" of type '" "(const unsigned char* pub_key, size_t pub_key_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_psbt_set_output_taproot_internal_key(arg1,arg2,(unsigned char const *)arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_output_blinder_index(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  uint32_t *arg3 = (uint32_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  uint32_t val3 ;
  PyObject *swig_obj[2] ;
  int result;
  
  {
    val3 = 0; arg3 = (uint32_t *)&val3;
  }
  if (!SWIG_Python_UnpackTuple(args, "psbt_get_output_blinder_index", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_output_blinder_index" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_get_output_blinder_index" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_psbt_get_output_blinder_index((struct wally_psbt const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyLong_FromUnsignedLong(*arg3);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_has_output_blinder_index(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  size_t *arg3 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg3 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_has_output_blinder_index", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_has_output_blinder_index" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_has_output_blinder_index" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_psbt_has_output_blinder_index((struct wally_psbt const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg3);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_output_value_commitment(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t *arg5 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  size_t written = 0; arg5 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_get_output_value_commitment", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_output_value_commitment" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_get_output_value_commitment" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_get_output_value_commitment" "', argument " "3"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg3 = (unsigned char *) buf;
    arg4 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_psbt_get_output_value_commitment((struct wally_psbt const *)arg1,arg2,arg3,arg4,arg5);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg5);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_output_value_commitment_len(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  size_t *arg3 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg3 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_get_output_value_commitment_len", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_output_value_commitment_len" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_get_output_value_commitment_len" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_psbt_get_output_value_commitment_len((struct wally_psbt const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg3);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_output_asset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t *arg5 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  size_t written = 0; arg5 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_get_output_asset", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_output_asset" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_get_output_asset" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_get_output_asset" "', argument " "3"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg3 = (unsigned char *) buf;
    arg4 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_psbt_get_output_asset((struct wally_psbt const *)arg1,arg2,arg3,arg4,arg5);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg5);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_output_asset_len(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  size_t *arg3 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg3 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_get_output_asset_len", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_output_asset_len" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_get_output_asset_len" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_psbt_get_output_asset_len((struct wally_psbt const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg3);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_output_asset_commitment(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t *arg5 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  size_t written = 0; arg5 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_get_output_asset_commitment", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_output_asset_commitment" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_get_output_asset_commitment" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_get_output_asset_commitment" "', argument " "3"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg3 = (unsigned char *) buf;
    arg4 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_psbt_get_output_asset_commitment((struct wally_psbt const *)arg1,arg2,arg3,arg4,arg5);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg5);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_output_asset_commitment_len(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  size_t *arg3 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg3 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_get_output_asset_commitment_len", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_output_asset_commitment_len" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_get_output_asset_commitment_len" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_psbt_get_output_asset_commitment_len((struct wally_psbt const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg3);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_output_value_rangeproof(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t *arg5 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  size_t written = 0; arg5 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_get_output_value_rangeproof", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_output_value_rangeproof" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_get_output_value_rangeproof" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_get_output_value_rangeproof" "', argument " "3"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg3 = (unsigned char *) buf;
    arg4 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_psbt_get_output_value_rangeproof((struct wally_psbt const *)arg1,arg2,arg3,arg4,arg5);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg5);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_output_value_rangeproof_len(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  size_t *arg3 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg3 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_get_output_value_rangeproof_len", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_output_value_rangeproof_len" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_get_output_value_rangeproof_len" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_psbt_get_output_value_rangeproof_len((struct wally_psbt const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg3);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_output_asset_surjectionproof(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t *arg5 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  size_t written = 0; arg5 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_get_output_asset_surjectionproof", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_output_asset_surjectionproof" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_get_output_asset_surjectionproof" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_get_output_asset_surjectionproof" "', argument " "3"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg3 = (unsigned char *) buf;
    arg4 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_psbt_get_output_asset_surjectionproof((struct wally_psbt const *)arg1,arg2,arg3,arg4,arg5);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg5);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_output_asset_surjectionproof_len(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  size_t *arg3 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg3 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_get_output_asset_surjectionproof_len", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_output_asset_surjectionproof_len" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_get_output_asset_surjectionproof_len" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_psbt_get_output_asset_surjectionproof_len((struct wally_psbt const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg3);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_output_blinding_public_key(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t *arg5 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  size_t written = 0; arg5 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_get_output_blinding_public_key", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_output_blinding_public_key" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_get_output_blinding_public_key" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_get_output_blinding_public_key" "', argument " "3"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg3 = (unsigned char *) buf;
    arg4 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_psbt_get_output_blinding_public_key((struct wally_psbt const *)arg1,arg2,arg3,arg4,arg5);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg5);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_output_blinding_public_key_len(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  size_t *arg3 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg3 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_get_output_blinding_public_key_len", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_output_blinding_public_key_len" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_get_output_blinding_public_key_len" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_psbt_get_output_blinding_public_key_len((struct wally_psbt const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg3);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_output_ecdh_public_key(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t *arg5 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  size_t written = 0; arg5 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_get_output_ecdh_public_key", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_output_ecdh_public_key" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_get_output_ecdh_public_key" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_get_output_ecdh_public_key" "', argument " "3"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg3 = (unsigned char *) buf;
    arg4 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_psbt_get_output_ecdh_public_key((struct wally_psbt const *)arg1,arg2,arg3,arg4,arg5);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg5);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_output_ecdh_public_key_len(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  size_t *arg3 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg3 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_get_output_ecdh_public_key_len", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_output_ecdh_public_key_len" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_get_output_ecdh_public_key_len" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_psbt_get_output_ecdh_public_key_len((struct wally_psbt const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg3);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_output_value_blinding_rangeproof(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t *arg5 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  size_t written = 0; arg5 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_get_output_value_blinding_rangeproof", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_output_value_blinding_rangeproof" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_get_output_value_blinding_rangeproof" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_get_output_value_blinding_rangeproof" "', argument " "3"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg3 = (unsigned char *) buf;
    arg4 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_psbt_get_output_value_blinding_rangeproof((struct wally_psbt const *)arg1,arg2,arg3,arg4,arg5);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg5);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_output_value_blinding_rangeproof_len(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  size_t *arg3 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg3 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_get_output_value_blinding_rangeproof_len", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_output_value_blinding_rangeproof_len" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_get_output_value_blinding_rangeproof_len" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_psbt_get_output_value_blinding_rangeproof_len((struct wally_psbt const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg3);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_output_asset_blinding_surjectionproof(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t *arg5 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  size_t written = 0; arg5 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_get_output_asset_blinding_surjectionproof", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_output_asset_blinding_surjectionproof" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_get_output_asset_blinding_surjectionproof" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_get_output_asset_blinding_surjectionproof" "', argument " "3"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg3 = (unsigned char *) buf;
    arg4 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_psbt_get_output_asset_blinding_surjectionproof((struct wally_psbt const *)arg1,arg2,arg3,arg4,arg5);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg5);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_output_asset_blinding_surjectionproof_len(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  size_t *arg3 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg3 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_get_output_asset_blinding_surjectionproof_len", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_output_asset_blinding_surjectionproof_len" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_get_output_asset_blinding_surjectionproof_len" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_psbt_get_output_asset_blinding_surjectionproof_len((struct wally_psbt const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg3);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_set_output_blinder_index(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  uint32_t arg3 ;
  size_t val2 ;
  int ecode2 = 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_set_output_blinder_index", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_set_output_blinder_index" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_set_output_blinder_index" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  ecode3 = SWIG_AsVal_unsigned_SS_int(swig_obj[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "psbt_set_output_blinder_index" "', argument " "3"" of type '" "uint32_t""'");
  } 
  arg3 = (uint32_t)(val3);
  {
    result = (int)wally_psbt_set_output_blinder_index(arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_clear_output_blinder_index(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_clear_output_blinder_index", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_clear_output_blinder_index" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_clear_output_blinder_index" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_psbt_clear_output_blinder_index(arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_set_output_value_commitment(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_set_output_value_commitment", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_set_output_value_commitment" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_set_output_value_commitment" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[2] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_set_output_value_commitment" "', argument " "3"" of type '" "(const unsigned char* commitment, size_t commitment_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_psbt_set_output_value_commitment(arg1,arg2,(unsigned char const *)arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_clear_output_value_commitment(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_clear_output_value_commitment", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_clear_output_value_commitment" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_clear_output_value_commitment" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_psbt_clear_output_value_commitment(arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_set_output_asset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_set_output_asset", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_set_output_asset" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_set_output_asset" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[2] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_set_output_asset" "', argument " "3"" of type '" "(const unsigned char* asset, size_t asset_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_psbt_set_output_asset(arg1,arg2,(unsigned char const *)arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_clear_output_asset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_clear_output_asset", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_clear_output_asset" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_clear_output_asset" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_psbt_clear_output_asset(arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_set_output_asset_commitment(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_set_output_asset_commitment", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_set_output_asset_commitment" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_set_output_asset_commitment" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[2] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_set_output_asset_commitment" "', argument " "3"" of type '" "(const unsigned char* commitment, size_t commitment_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_psbt_set_output_asset_commitment(arg1,arg2,(unsigned char const *)arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_clear_output_asset_commitment(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_clear_output_asset_commitment", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_clear_output_asset_commitment" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_clear_output_asset_commitment" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_psbt_clear_output_asset_commitment(arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_set_output_value_rangeproof(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_set_output_value_rangeproof", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_set_output_value_rangeproof" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_set_output_value_rangeproof" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[2] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_set_output_value_rangeproof" "', argument " "3"" of type '" "(const unsigned char* rangeproof, size_t rangeproof_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_psbt_set_output_value_rangeproof(arg1,arg2,(unsigned char const *)arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_clear_output_value_rangeproof(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_clear_output_value_rangeproof", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_clear_output_value_rangeproof" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_clear_output_value_rangeproof" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_psbt_clear_output_value_rangeproof(arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_set_output_asset_surjectionproof(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_set_output_asset_surjectionproof", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_set_output_asset_surjectionproof" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_set_output_asset_surjectionproof" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[2] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_set_output_asset_surjectionproof" "', argument " "3"" of type '" "(const unsigned char* surjectionproof, size_t surjectionproof_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_psbt_set_output_asset_surjectionproof(arg1,arg2,(unsigned char const *)arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_clear_output_asset_surjectionproof(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_clear_output_asset_surjectionproof", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_clear_output_asset_surjectionproof" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_clear_output_asset_surjectionproof" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_psbt_clear_output_asset_surjectionproof(arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_set_output_blinding_public_key(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_set_output_blinding_public_key", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_set_output_blinding_public_key" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_set_output_blinding_public_key" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[2] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_set_output_blinding_public_key" "', argument " "3"" of type '" "(const unsigned char* pub_key, size_t pub_key_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_psbt_set_output_blinding_public_key(arg1,arg2,(unsigned char const *)arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_clear_output_blinding_public_key(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_clear_output_blinding_public_key", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_clear_output_blinding_public_key" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_clear_output_blinding_public_key" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_psbt_clear_output_blinding_public_key(arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_set_output_ecdh_public_key(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_set_output_ecdh_public_key", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_set_output_ecdh_public_key" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_set_output_ecdh_public_key" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[2] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_set_output_ecdh_public_key" "', argument " "3"" of type '" "(const unsigned char* pub_key, size_t pub_key_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_psbt_set_output_ecdh_public_key(arg1,arg2,(unsigned char const *)arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_clear_output_ecdh_public_key(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_clear_output_ecdh_public_key", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_clear_output_ecdh_public_key" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_clear_output_ecdh_public_key" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_psbt_clear_output_ecdh_public_key(arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_set_output_value_blinding_rangeproof(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_set_output_value_blinding_rangeproof", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_set_output_value_blinding_rangeproof" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_set_output_value_blinding_rangeproof" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[2] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_set_output_value_blinding_rangeproof" "', argument " "3"" of type '" "(const unsigned char* rangeproof, size_t rangeproof_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_psbt_set_output_value_blinding_rangeproof(arg1,arg2,(unsigned char const *)arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_clear_output_value_blinding_rangeproof(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_clear_output_value_blinding_rangeproof", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_clear_output_value_blinding_rangeproof" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_clear_output_value_blinding_rangeproof" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_psbt_clear_output_value_blinding_rangeproof(arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_set_output_asset_blinding_surjectionproof(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_set_output_asset_blinding_surjectionproof", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_set_output_asset_blinding_surjectionproof" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_set_output_asset_blinding_surjectionproof" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[2] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "psbt_set_output_asset_blinding_surjectionproof" "', argument " "3"" of type '" "(const unsigned char* surjectionproof, size_t surjectionproof_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_psbt_set_output_asset_blinding_surjectionproof(arg1,arg2,(unsigned char const *)arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_clear_output_asset_blinding_surjectionproof(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "psbt_clear_output_asset_blinding_surjectionproof", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_clear_output_asset_blinding_surjectionproof" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_clear_output_asset_blinding_surjectionproof" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_psbt_clear_output_asset_blinding_surjectionproof(arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_psbt_get_output_blinding_status(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_psbt *arg1 = (struct wally_psbt *) 0 ;
  size_t arg2 ;
  uint32_t arg3 ;
  size_t *arg4 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  size_t written = 0; arg4 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "psbt_get_output_blinding_status", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_psbt *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "psbt_get_output_blinding_status" "', argument " "1"" of type '" "(wally_psbt)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "psbt_get_output_blinding_status" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  ecode3 = SWIG_AsVal_unsigned_SS_int(swig_obj[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "psbt_get_output_blinding_status" "', argument " "3"" of type '" "uint32_t""'");
  } 
  arg3 = (uint32_t)(val3);
  {
    result = (int)wally_psbt_get_output_blinding_status((struct wally_psbt const *)arg1,arg2,arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg4);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_scriptpubkey_get_type(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  size_t *arg3 = (size_t *) 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  size_t written = 0; arg3 = (size_t *)&written;
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "scriptpubkey_get_type" "', argument " "1"" of type '" "(const unsigned char* bytes, size_t bytes_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_scriptpubkey_get_type((unsigned char const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg3);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_scriptpubkey_p2pkh_from_bytes(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  uint32_t arg3 ;
  unsigned char *arg4 = (unsigned char *) 0 ;
  size_t arg5 ;
  size_t *arg6 = (size_t *) 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  size_t written = 0; arg6 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "scriptpubkey_p2pkh_from_bytes", 3, 3, swig_obj)) SWIG_fail;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "scriptpubkey_p2pkh_from_bytes" "', argument " "1"" of type '" "(const unsigned char* bytes, size_t bytes_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  ecode3 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "scriptpubkey_p2pkh_from_bytes" "', argument " "3"" of type '" "uint32_t""'");
  } 
  arg3 = (uint32_t)(val3);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "scriptpubkey_p2pkh_from_bytes" "', argument " "4"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg4 = (unsigned char *) buf;
    arg5 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_scriptpubkey_p2pkh_from_bytes((unsigned char const *)arg1,arg2,arg3,arg4,arg5,arg6);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg6);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_scriptsig_p2pkh_from_sig(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  uint32_t arg5 ;
  unsigned char *arg6 = (unsigned char *) 0 ;
  size_t arg7 ;
  size_t *arg8 = (size_t *) 0 ;
  unsigned int val5 ;
  int ecode5 = 0 ;
  PyObject *swig_obj[4] ;
  int result;
  
  size_t written = 0; arg8 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "scriptsig_p2pkh_from_sig", 4, 4, swig_obj)) SWIG_fail;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "scriptsig_p2pkh_from_sig" "', argument " "1"" of type '" "(const unsigned char* pub_key, size_t pub_key_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "scriptsig_p2pkh_from_sig" "', argument " "3"" of type '" "(const unsigned char* sig, size_t sig_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  ecode5 = SWIG_AsVal_unsigned_SS_int(swig_obj[2], &val5);
  if (!SWIG_IsOK(ecode5)) {
    SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "scriptsig_p2pkh_from_sig" "', argument " "5"" of type '" "uint32_t""'");
  } 
  arg5 = (uint32_t)(val5);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[3], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "scriptsig_p2pkh_from_sig" "', argument " "6"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg6 = (unsigned char *) buf;
    arg7 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_scriptsig_p2pkh_from_sig((unsigned char const *)arg1,arg2,(unsigned char const *)arg3,arg4,arg5,arg6,arg7,arg8);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg8);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_witness_p2wpkh_from_sig(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  uint32_t arg5 ;
  struct wally_tx_witness_stack **arg6 = (struct wally_tx_witness_stack **) 0 ;
  unsigned int val5 ;
  int ecode5 = 0 ;
  void *argp6 = 0 ;
  int res6 = 0 ;
  PyObject *swig_obj[4] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "witness_p2wpkh_from_sig", 4, 4, swig_obj)) SWIG_fail;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "witness_p2wpkh_from_sig" "', argument " "1"" of type '" "(const unsigned char* pub_key, size_t pub_key_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "witness_p2wpkh_from_sig" "', argument " "3"" of type '" "(const unsigned char* sig, size_t sig_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  ecode5 = SWIG_AsVal_unsigned_SS_int(swig_obj[2], &val5);
  if (!SWIG_IsOK(ecode5)) {
    SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "witness_p2wpkh_from_sig" "', argument " "5"" of type '" "uint32_t""'");
  } 
  arg5 = (uint32_t)(val5);
  res6 = SWIG_ConvertPtr(swig_obj[3], &argp6,SWIGTYPE_p_p_wally_tx_witness_stack, 0 |  0 );
  if (!SWIG_IsOK(res6)) {
    SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "witness_p2wpkh_from_sig" "', argument " "6"" of type '" "struct wally_tx_witness_stack **""'"); 
  }
  arg6 = (struct wally_tx_witness_stack **)(argp6);
  {
    result = (int)wally_witness_p2wpkh_from_sig((unsigned char const *)arg1,arg2,(unsigned char const *)arg3,arg4,arg5,arg6);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    if (*arg6 != NULL) {
      Py_DecRef(resultobj);
      resultobj = PyCapsule_New(*arg6, "struct wally_tx_witness_stack *", destroy_wally_tx_witness_stack);
    }
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_scriptsig_p2pkh_from_der(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  unsigned char *arg5 = (unsigned char *) 0 ;
  size_t arg6 ;
  size_t *arg7 = (size_t *) 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  size_t written = 0; arg7 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "scriptsig_p2pkh_from_der", 3, 3, swig_obj)) SWIG_fail;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "scriptsig_p2pkh_from_der" "', argument " "1"" of type '" "(const unsigned char* pub_key, size_t pub_key_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "scriptsig_p2pkh_from_der" "', argument " "3"" of type '" "(const unsigned char* sig, size_t sig_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "scriptsig_p2pkh_from_der" "', argument " "5"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg5 = (unsigned char *) buf;
    arg6 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_scriptsig_p2pkh_from_der((unsigned char const *)arg1,arg2,(unsigned char const *)arg3,arg4,arg5,arg6,arg7);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg7);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_witness_p2wpkh_from_der(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  struct wally_tx_witness_stack **arg5 = (struct wally_tx_witness_stack **) 0 ;
  void *argp5 = 0 ;
  int res5 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "witness_p2wpkh_from_der", 3, 3, swig_obj)) SWIG_fail;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "witness_p2wpkh_from_der" "', argument " "1"" of type '" "(const unsigned char* pub_key, size_t pub_key_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "witness_p2wpkh_from_der" "', argument " "3"" of type '" "(const unsigned char* sig, size_t sig_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  res5 = SWIG_ConvertPtr(swig_obj[2], &argp5,SWIGTYPE_p_p_wally_tx_witness_stack, 0 |  0 );
  if (!SWIG_IsOK(res5)) {
    SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "witness_p2wpkh_from_der" "', argument " "5"" of type '" "struct wally_tx_witness_stack **""'"); 
  }
  arg5 = (struct wally_tx_witness_stack **)(argp5);
  {
    result = (int)wally_witness_p2wpkh_from_der((unsigned char const *)arg1,arg2,(unsigned char const *)arg3,arg4,arg5);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    if (*arg5 != NULL) {
      Py_DecRef(resultobj);
      resultobj = PyCapsule_New(*arg5, "struct wally_tx_witness_stack *", destroy_wally_tx_witness_stack);
    }
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_scriptpubkey_p2tr_from_bytes(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  uint32_t arg3 ;
  unsigned char *arg4 = (unsigned char *) 0 ;
  size_t arg5 ;
  size_t *arg6 = (size_t *) 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  size_t written = 0; arg6 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "scriptpubkey_p2tr_from_bytes", 3, 3, swig_obj)) SWIG_fail;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "scriptpubkey_p2tr_from_bytes" "', argument " "1"" of type '" "(const unsigned char* bytes, size_t bytes_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  ecode3 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "scriptpubkey_p2tr_from_bytes" "', argument " "3"" of type '" "uint32_t""'");
  } 
  arg3 = (uint32_t)(val3);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "scriptpubkey_p2tr_from_bytes" "', argument " "4"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg4 = (unsigned char *) buf;
    arg5 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_scriptpubkey_p2tr_from_bytes((unsigned char const *)arg1,arg2,arg3,arg4,arg5,arg6);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg6);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_witness_p2tr_from_sig(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  struct wally_tx_witness_stack **arg3 = (struct wally_tx_witness_stack **) 0 ;
  void *argp3 = 0 ;
  int res3 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "witness_p2tr_from_sig", 2, 2, swig_obj)) SWIG_fail;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "witness_p2tr_from_sig" "', argument " "1"" of type '" "(const unsigned char* sig, size_t sig_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  res3 = SWIG_ConvertPtr(swig_obj[1], &argp3,SWIGTYPE_p_p_wally_tx_witness_stack, 0 |  0 );
  if (!SWIG_IsOK(res3)) {
    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "witness_p2tr_from_sig" "', argument " "3"" of type '" "struct wally_tx_witness_stack **""'"); 
  }
  arg3 = (struct wally_tx_witness_stack **)(argp3);
  {
    result = (int)wally_witness_p2tr_from_sig((unsigned char const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    if (*arg3 != NULL) {
      Py_DecRef(resultobj);
      resultobj = PyCapsule_New(*arg3, "struct wally_tx_witness_stack *", destroy_wally_tx_witness_stack);
    }
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_scriptpubkey_op_return_from_bytes(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  uint32_t arg3 ;
  unsigned char *arg4 = (unsigned char *) 0 ;
  size_t arg5 ;
  size_t *arg6 = (size_t *) 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  size_t written = 0; arg6 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "scriptpubkey_op_return_from_bytes", 3, 3, swig_obj)) SWIG_fail;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "scriptpubkey_op_return_from_bytes" "', argument " "1"" of type '" "(const unsigned char* bytes, size_t bytes_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  ecode3 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "scriptpubkey_op_return_from_bytes" "', argument " "3"" of type '" "uint32_t""'");
  } 
  arg3 = (uint32_t)(val3);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "scriptpubkey_op_return_from_bytes" "', argument " "4"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg4 = (unsigned char *) buf;
    arg5 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_scriptpubkey_op_return_from_bytes((unsigned char const *)arg1,arg2,arg3,arg4,arg5,arg6);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg6);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_scriptpubkey_p2sh_from_bytes(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  uint32_t arg3 ;
  unsigned char *arg4 = (unsigned char *) 0 ;
  size_t arg5 ;
  size_t *arg6 = (size_t *) 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  size_t written = 0; arg6 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "scriptpubkey_p2sh_from_bytes", 3, 3, swig_obj)) SWIG_fail;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "scriptpubkey_p2sh_from_bytes" "', argument " "1"" of type '" "(const unsigned char* bytes, size_t bytes_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  ecode3 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "scriptpubkey_p2sh_from_bytes" "', argument " "3"" of type '" "uint32_t""'");
  } 
  arg3 = (uint32_t)(val3);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "scriptpubkey_p2sh_from_bytes" "', argument " "4"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg4 = (unsigned char *) buf;
    arg5 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_scriptpubkey_p2sh_from_bytes((unsigned char const *)arg1,arg2,arg3,arg4,arg5,arg6);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg6);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_scriptpubkey_multisig_from_bytes(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  uint32_t arg3 ;
  uint32_t arg4 ;
  unsigned char *arg5 = (unsigned char *) 0 ;
  size_t arg6 ;
  size_t *arg7 = (size_t *) 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  unsigned int val4 ;
  int ecode4 = 0 ;
  PyObject *swig_obj[4] ;
  int result;
  
  size_t written = 0; arg7 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "scriptpubkey_multisig_from_bytes", 4, 4, swig_obj)) SWIG_fail;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "scriptpubkey_multisig_from_bytes" "', argument " "1"" of type '" "(const unsigned char* bytes, size_t bytes_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  ecode3 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "scriptpubkey_multisig_from_bytes" "', argument " "3"" of type '" "uint32_t""'");
  } 
  arg3 = (uint32_t)(val3);
  ecode4 = SWIG_AsVal_unsigned_SS_int(swig_obj[2], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "scriptpubkey_multisig_from_bytes" "', argument " "4"" of type '" "uint32_t""'");
  } 
  arg4 = (uint32_t)(val4);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[3], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "scriptpubkey_multisig_from_bytes" "', argument " "5"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg5 = (unsigned char *) buf;
    arg6 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_scriptpubkey_multisig_from_bytes((unsigned char const *)arg1,arg2,arg3,arg4,arg5,arg6,arg7);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg7);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_scriptsig_multisig_from_bytes(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  uint32_t *arg5 = (uint32_t *) 0 ;
  size_t arg6 ;
  uint32_t arg7 ;
  unsigned char *arg8 = (unsigned char *) 0 ;
  size_t arg9 ;
  size_t *arg10 = (size_t *) 0 ;
  uint32_t tmp_buf5[MAX_LOCAL_STACK/sizeof(uint32_t)] ;
  unsigned int val7 ;
  int ecode7 = 0 ;
  PyObject *swig_obj[5] ;
  int result;
  
  size_t written = 0; arg10 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "scriptsig_multisig_from_bytes", 5, 5, swig_obj)) SWIG_fail;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "scriptsig_multisig_from_bytes" "', argument " "1"" of type '" "(const unsigned char* script, size_t script_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "scriptsig_multisig_from_bytes" "', argument " "3"" of type '" "(const unsigned char* bytes, size_t bytes_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    size_t i;
    if (!PyList_Check(swig_obj[2])) {
      check_result(WALLY_EINVAL);
      SWIG_fail;
    }
    arg6 = PyList_Size(swig_obj[2]);
    arg5 = tmp_buf5;
    if (arg6 * sizeof(uint32_t) > sizeof(tmp_buf5))
    if (!(arg5 = (uint32_t *) wally_malloc((arg6) * sizeof(uint32_t)))) {
      check_result(WALLY_ENOMEM);
      SWIG_fail;
    }
    for (i = 0; i < arg6; ++i) {
      PyObject *item = PyList_GET_ITEM(swig_obj[2], i);
      unsigned long long v;
      if (!ulonglong_cast(item, &v) || v > 0xffull) {
        PyErr_SetString(PyExc_OverflowError, "Invalid unsigned integer");
        SWIG_fail;
      }
      arg5[i] = (uint32_t)v;
    }
  }
  ecode7 = SWIG_AsVal_unsigned_SS_int(swig_obj[3], &val7);
  if (!SWIG_IsOK(ecode7)) {
    SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "scriptsig_multisig_from_bytes" "', argument " "7"" of type '" "uint32_t""'");
  } 
  arg7 = (uint32_t)(val7);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[4], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "scriptsig_multisig_from_bytes" "', argument " "8"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg8 = (unsigned char *) buf;
    arg9 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_scriptsig_multisig_from_bytes((unsigned char const *)arg1,arg2,(unsigned char const *)arg3,arg4,(unsigned int const *)arg5,arg6,arg7,arg8,arg9,arg10);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg10);
  }
  {
    if (arg5 && arg5 != tmp_buf5)
    wally_free(arg5);
  }
  return resultobj;
fail:
  {
    if (arg5 && arg5 != tmp_buf5)
    wally_free(arg5);
  }
  return NULL;
}


SWIGINTERN PyObject *_wrap_witness_multisig_from_bytes(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  uint32_t *arg5 = (uint32_t *) 0 ;
  size_t arg6 ;
  uint32_t arg7 ;
  struct wally_tx_witness_stack **arg8 = (struct wally_tx_witness_stack **) 0 ;
  uint32_t tmp_buf5[MAX_LOCAL_STACK/sizeof(uint32_t)] ;
  unsigned int val7 ;
  int ecode7 = 0 ;
  void *argp8 = 0 ;
  int res8 = 0 ;
  PyObject *swig_obj[5] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "witness_multisig_from_bytes", 5, 5, swig_obj)) SWIG_fail;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "witness_multisig_from_bytes" "', argument " "1"" of type '" "(const unsigned char* script, size_t script_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "witness_multisig_from_bytes" "', argument " "3"" of type '" "(const unsigned char* bytes, size_t bytes_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    size_t i;
    if (!PyList_Check(swig_obj[2])) {
      check_result(WALLY_EINVAL);
      SWIG_fail;
    }
    arg6 = PyList_Size(swig_obj[2]);
    arg5 = tmp_buf5;
    if (arg6 * sizeof(uint32_t) > sizeof(tmp_buf5))
    if (!(arg5 = (uint32_t *) wally_malloc((arg6) * sizeof(uint32_t)))) {
      check_result(WALLY_ENOMEM);
      SWIG_fail;
    }
    for (i = 0; i < arg6; ++i) {
      PyObject *item = PyList_GET_ITEM(swig_obj[2], i);
      unsigned long long v;
      if (!ulonglong_cast(item, &v) || v > 0xffull) {
        PyErr_SetString(PyExc_OverflowError, "Invalid unsigned integer");
        SWIG_fail;
      }
      arg5[i] = (uint32_t)v;
    }
  }
  ecode7 = SWIG_AsVal_unsigned_SS_int(swig_obj[3], &val7);
  if (!SWIG_IsOK(ecode7)) {
    SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "witness_multisig_from_bytes" "', argument " "7"" of type '" "uint32_t""'");
  } 
  arg7 = (uint32_t)(val7);
  res8 = SWIG_ConvertPtr(swig_obj[4], &argp8,SWIGTYPE_p_p_wally_tx_witness_stack, 0 |  0 );
  if (!SWIG_IsOK(res8)) {
    SWIG_exception_fail(SWIG_ArgError(res8), "in method '" "witness_multisig_from_bytes" "', argument " "8"" of type '" "struct wally_tx_witness_stack **""'"); 
  }
  arg8 = (struct wally_tx_witness_stack **)(argp8);
  {
    result = (int)wally_witness_multisig_from_bytes((unsigned char const *)arg1,arg2,(unsigned char const *)arg3,arg4,(unsigned int const *)arg5,arg6,arg7,arg8);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    if (*arg8 != NULL) {
      Py_DecRef(resultobj);
      resultobj = PyCapsule_New(*arg8, "struct wally_tx_witness_stack *", destroy_wally_tx_witness_stack);
    }
  }
  {
    if (arg5 && arg5 != tmp_buf5)
    wally_free(arg5);
  }
  return resultobj;
fail:
  {
    if (arg5 && arg5 != tmp_buf5)
    wally_free(arg5);
  }
  return NULL;
}


SWIGINTERN PyObject *_wrap_scriptpubkey_csv_2of2_then_1_from_bytes(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  uint32_t arg3 ;
  uint32_t arg4 ;
  unsigned char *arg5 = (unsigned char *) 0 ;
  size_t arg6 ;
  size_t *arg7 = (size_t *) 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  unsigned int val4 ;
  int ecode4 = 0 ;
  PyObject *swig_obj[4] ;
  int result;
  
  size_t written = 0; arg7 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "scriptpubkey_csv_2of2_then_1_from_bytes", 4, 4, swig_obj)) SWIG_fail;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "scriptpubkey_csv_2of2_then_1_from_bytes" "', argument " "1"" of type '" "(const unsigned char* bytes, size_t bytes_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  ecode3 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "scriptpubkey_csv_2of2_then_1_from_bytes" "', argument " "3"" of type '" "uint32_t""'");
  } 
  arg3 = (uint32_t)(val3);
  ecode4 = SWIG_AsVal_unsigned_SS_int(swig_obj[2], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "scriptpubkey_csv_2of2_then_1_from_bytes" "', argument " "4"" of type '" "uint32_t""'");
  } 
  arg4 = (uint32_t)(val4);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[3], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "scriptpubkey_csv_2of2_then_1_from_bytes" "', argument " "5"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg5 = (unsigned char *) buf;
    arg6 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_scriptpubkey_csv_2of2_then_1_from_bytes((unsigned char const *)arg1,arg2,arg3,arg4,arg5,arg6,arg7);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg7);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_scriptpubkey_csv_2of2_then_1_from_bytes_opt(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  uint32_t arg3 ;
  uint32_t arg4 ;
  unsigned char *arg5 = (unsigned char *) 0 ;
  size_t arg6 ;
  size_t *arg7 = (size_t *) 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  unsigned int val4 ;
  int ecode4 = 0 ;
  PyObject *swig_obj[4] ;
  int result;
  
  size_t written = 0; arg7 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "scriptpubkey_csv_2of2_then_1_from_bytes_opt", 4, 4, swig_obj)) SWIG_fail;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "scriptpubkey_csv_2of2_then_1_from_bytes_opt" "', argument " "1"" of type '" "(const unsigned char* bytes, size_t bytes_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  ecode3 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "scriptpubkey_csv_2of2_then_1_from_bytes_opt" "', argument " "3"" of type '" "uint32_t""'");
  } 
  arg3 = (uint32_t)(val3);
  ecode4 = SWIG_AsVal_unsigned_SS_int(swig_obj[2], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "scriptpubkey_csv_2of2_then_1_from_bytes_opt" "', argument " "4"" of type '" "uint32_t""'");
  } 
  arg4 = (uint32_t)(val4);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[3], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "scriptpubkey_csv_2of2_then_1_from_bytes_opt" "', argument " "5"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg5 = (unsigned char *) buf;
    arg6 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_scriptpubkey_csv_2of2_then_1_from_bytes_opt((unsigned char const *)arg1,arg2,arg3,arg4,arg5,arg6,arg7);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg7);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_scriptpubkey_csv_blocks_from_csv_2of2_then_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  uint32_t *arg3 = (uint32_t *) 0 ;
  uint32_t val3 ;
  PyObject *swig_obj[1] ;
  int result;
  
  {
    val3 = 0; arg3 = (uint32_t *)&val3;
  }
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "scriptpubkey_csv_blocks_from_csv_2of2_then_1" "', argument " "1"" of type '" "(const unsigned char* bytes, size_t bytes_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_scriptpubkey_csv_blocks_from_csv_2of2_then_1((unsigned char const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyLong_FromUnsignedLong(*arg3);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_script_push_from_bytes(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  uint32_t arg3 ;
  unsigned char *arg4 = (unsigned char *) 0 ;
  size_t arg5 ;
  size_t *arg6 = (size_t *) 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  size_t written = 0; arg6 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "script_push_from_bytes", 3, 3, swig_obj)) SWIG_fail;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "script_push_from_bytes" "', argument " "1"" of type '" "(const unsigned char* bytes, size_t bytes_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  ecode3 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "script_push_from_bytes" "', argument " "3"" of type '" "uint32_t""'");
  } 
  arg3 = (uint32_t)(val3);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "script_push_from_bytes" "', argument " "4"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg4 = (unsigned char *) buf;
    arg5 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_script_push_from_bytes((unsigned char const *)arg1,arg2,arg3,arg4,arg5,arg6);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg6);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_varint_get_length(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  uint64_t arg1 ;
  size_t *arg2 = (size_t *) 0 ;
  unsigned long long val1 ;
  int ecode1 = 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  size_t written = 0; arg2 = (size_t *)&written;
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  ecode1 = SWIG_AsVal_unsigned_SS_long_SS_long(swig_obj[0], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "varint_get_length" "', argument " "1"" of type '" "uint64_t""'");
  } 
  arg1 = (uint64_t)(val1);
  {
    result = (int)wally_varint_get_length(arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg2);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_varint_to_bytes(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  uint64_t arg1 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  size_t *arg4 = (size_t *) 0 ;
  unsigned long long val1 ;
  int ecode1 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg4 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "varint_to_bytes", 2, 2, swig_obj)) SWIG_fail;
  ecode1 = SWIG_AsVal_unsigned_SS_long_SS_long(swig_obj[0], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "varint_to_bytes" "', argument " "1"" of type '" "uint64_t""'");
  } 
  arg1 = (uint64_t)(val1);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "varint_to_bytes" "', argument " "2"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg2 = (unsigned char *) buf;
    arg3 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_varint_to_bytes(arg1,arg2,arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg4);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_varbuff_get_length(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  size_t *arg3 = (size_t *) 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  size_t written = 0; arg3 = (size_t *)&written;
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "varbuff_get_length" "', argument " "1"" of type '" "(const unsigned char* bytes, size_t bytes_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_varbuff_get_length((unsigned char const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg3);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_varbuff_to_bytes(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t *arg5 = (size_t *) 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg5 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "varbuff_to_bytes", 2, 2, swig_obj)) SWIG_fail;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "varbuff_to_bytes" "', argument " "1"" of type '" "(const unsigned char* bytes, size_t bytes_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "varbuff_to_bytes" "', argument " "3"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg3 = (unsigned char *) buf;
    arg4 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_varbuff_to_bytes((unsigned char const *)arg1,arg2,arg3,arg4,arg5);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg5);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_witness_program_from_bytes(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  uint32_t arg3 ;
  unsigned char *arg4 = (unsigned char *) 0 ;
  size_t arg5 ;
  size_t *arg6 = (size_t *) 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  size_t written = 0; arg6 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "witness_program_from_bytes", 3, 3, swig_obj)) SWIG_fail;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "witness_program_from_bytes" "', argument " "1"" of type '" "(const unsigned char* bytes, size_t bytes_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  ecode3 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "witness_program_from_bytes" "', argument " "3"" of type '" "uint32_t""'");
  } 
  arg3 = (uint32_t)(val3);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "witness_program_from_bytes" "', argument " "4"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg4 = (unsigned char *) buf;
    arg5 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_witness_program_from_bytes((unsigned char const *)arg1,arg2,arg3,arg4,arg5,arg6);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg6);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_witness_program_from_bytes_and_version(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  uint32_t arg3 ;
  uint32_t arg4 ;
  unsigned char *arg5 = (unsigned char *) 0 ;
  size_t arg6 ;
  size_t *arg7 = (size_t *) 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  unsigned int val4 ;
  int ecode4 = 0 ;
  PyObject *swig_obj[4] ;
  int result;
  
  size_t written = 0; arg7 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "witness_program_from_bytes_and_version", 4, 4, swig_obj)) SWIG_fail;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "witness_program_from_bytes_and_version" "', argument " "1"" of type '" "(const unsigned char* bytes, size_t bytes_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  ecode3 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "witness_program_from_bytes_and_version" "', argument " "3"" of type '" "uint32_t""'");
  } 
  arg3 = (uint32_t)(val3);
  ecode4 = SWIG_AsVal_unsigned_SS_int(swig_obj[2], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "witness_program_from_bytes_and_version" "', argument " "4"" of type '" "uint32_t""'");
  } 
  arg4 = (uint32_t)(val4);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[3], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "witness_program_from_bytes_and_version" "', argument " "5"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg5 = (unsigned char *) buf;
    arg6 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_witness_program_from_bytes_and_version((unsigned char const *)arg1,arg2,arg3,arg4,arg5,arg6,arg7);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg7);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_elements_pegout_script_size(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  size_t arg1 ;
  size_t arg2 ;
  size_t arg3 ;
  size_t arg4 ;
  size_t *arg5 = (size_t *) 0 ;
  size_t val1 ;
  int ecode1 = 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  size_t val3 ;
  int ecode3 = 0 ;
  size_t val4 ;
  int ecode4 = 0 ;
  PyObject *swig_obj[4] ;
  int result;
  
  size_t written = 0; arg5 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "elements_pegout_script_size", 4, 4, swig_obj)) SWIG_fail;
  ecode1 = SWIG_AsVal_size_t(swig_obj[0], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "elements_pegout_script_size" "', argument " "1"" of type '" "size_t""'");
  } 
  arg1 = (size_t)(val1);
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "elements_pegout_script_size" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  ecode3 = SWIG_AsVal_size_t(swig_obj[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "elements_pegout_script_size" "', argument " "3"" of type '" "size_t""'");
  } 
  arg3 = (size_t)(val3);
  ecode4 = SWIG_AsVal_size_t(swig_obj[3], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "elements_pegout_script_size" "', argument " "4"" of type '" "size_t""'");
  } 
  arg4 = (size_t)(val4);
  {
    result = (int)wally_elements_pegout_script_size(arg1,arg2,arg3,arg4,arg5);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg5);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_elements_pegout_script_from_bytes(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  unsigned char *arg5 = (unsigned char *) 0 ;
  size_t arg6 ;
  unsigned char *arg7 = (unsigned char *) 0 ;
  size_t arg8 ;
  uint32_t arg9 ;
  unsigned char *arg10 = (unsigned char *) 0 ;
  size_t arg11 ;
  size_t *arg12 = (size_t *) 0 ;
  unsigned int val9 ;
  int ecode9 = 0 ;
  PyObject *swig_obj[6] ;
  int result;
  
  size_t written = 0; arg12 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "elements_pegout_script_from_bytes", 6, 6, swig_obj)) SWIG_fail;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "elements_pegout_script_from_bytes" "', argument " "1"" of type '" "(const unsigned char* genesis_blockhash, size_t genesis_blockhash_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "elements_pegout_script_from_bytes" "', argument " "3"" of type '" "(const unsigned char* mainchain_script, size_t mainchain_script_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[2] == Py_None)
    arg6 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "elements_pegout_script_from_bytes" "', argument " "5"" of type '" "(const unsigned char* sub_pubkey, size_t sub_pubkey_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg5 = (unsigned char *) buf;
      arg6 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[3] == Py_None)
    arg8 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[3], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "elements_pegout_script_from_bytes" "', argument " "7"" of type '" "(const unsigned char* whitelistproof, size_t whitelistproof_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg7 = (unsigned char *) buf;
      arg8 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  ecode9 = SWIG_AsVal_unsigned_SS_int(swig_obj[4], &val9);
  if (!SWIG_IsOK(ecode9)) {
    SWIG_exception_fail(SWIG_ArgError(ecode9), "in method '" "elements_pegout_script_from_bytes" "', argument " "9"" of type '" "uint32_t""'");
  } 
  arg9 = (uint32_t)(val9);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[5], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "elements_pegout_script_from_bytes" "', argument " "10"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg10 = (unsigned char *) buf;
    arg11 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_elements_pegout_script_from_bytes((unsigned char const *)arg1,arg2,(unsigned char const *)arg3,arg4,(unsigned char const *)arg5,arg6,(unsigned char const *)arg7,arg8,arg9,arg10,arg11,arg12);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg12);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_elements_pegin_contract_script_from_bytes(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  uint32_t arg5 ;
  unsigned char *arg6 = (unsigned char *) 0 ;
  size_t arg7 ;
  size_t *arg8 = (size_t *) 0 ;
  unsigned int val5 ;
  int ecode5 = 0 ;
  PyObject *swig_obj[4] ;
  int result;
  
  size_t written = 0; arg8 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "elements_pegin_contract_script_from_bytes", 4, 4, swig_obj)) SWIG_fail;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "elements_pegin_contract_script_from_bytes" "', argument " "1"" of type '" "(const unsigned char* redeem_script, size_t redeem_script_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "elements_pegin_contract_script_from_bytes" "', argument " "3"" of type '" "(const unsigned char* script, size_t script_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  ecode5 = SWIG_AsVal_unsigned_SS_int(swig_obj[2], &val5);
  if (!SWIG_IsOK(ecode5)) {
    SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "elements_pegin_contract_script_from_bytes" "', argument " "5"" of type '" "uint32_t""'");
  } 
  arg5 = (uint32_t)(val5);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[3], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "elements_pegin_contract_script_from_bytes" "', argument " "6"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg6 = (unsigned char *) buf;
    arg7 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_elements_pegin_contract_script_from_bytes((unsigned char const *)arg1,arg2,(unsigned char const *)arg3,arg4,arg5,arg6,arg7,arg8);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg8);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_symmetric_key_from_seed(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "symmetric_key_from_seed", 2, 2, swig_obj)) SWIG_fail;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "symmetric_key_from_seed" "', argument " "1"" of type '" "(const unsigned char* bytes, size_t bytes_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "symmetric_key_from_seed" "', argument " "3"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg3 = (unsigned char *) buf;
    arg4 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_symmetric_key_from_seed((unsigned char const *)arg1,arg2,arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_symmetric_key_from_parent(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  uint32_t arg3 ;
  unsigned char *arg4 = (unsigned char *) 0 ;
  size_t arg5 ;
  unsigned char *arg6 = (unsigned char *) 0 ;
  size_t arg7 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  PyObject *swig_obj[4] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "symmetric_key_from_parent", 4, 4, swig_obj)) SWIG_fail;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "symmetric_key_from_parent" "', argument " "1"" of type '" "(const unsigned char* bytes, size_t bytes_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  ecode3 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "symmetric_key_from_parent" "', argument " "3"" of type '" "uint32_t""'");
  } 
  arg3 = (uint32_t)(val3);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[2] == Py_None)
    arg5 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "symmetric_key_from_parent" "', argument " "4"" of type '" "(const unsigned char* label, size_t label_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg4 = (unsigned char *) buf;
      arg5 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[3], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "symmetric_key_from_parent" "', argument " "6"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg6 = (unsigned char *) buf;
    arg7 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_symmetric_key_from_parent((unsigned char const *)arg1,arg2,arg3,(unsigned char const *)arg4,arg5,arg6,arg7);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_witness_stack_init_alloc(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  size_t arg1 ;
  struct wally_tx_witness_stack **arg2 = (struct wally_tx_witness_stack **) 0 ;
  size_t val1 ;
  int ecode1 = 0 ;
  struct wally_tx_witness_stack *w2 ;
  PyObject *swig_obj[1] ;
  int result;
  
  {
    w2 = 0; arg2 = (struct wally_tx_witness_stack **)&w2;
  }
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  ecode1 = SWIG_AsVal_size_t(swig_obj[0], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "tx_witness_stack_init_alloc" "', argument " "1"" of type '" "size_t""'");
  } 
  arg1 = (size_t)(val1);
  {
    result = (int)wally_tx_witness_stack_init_alloc(arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    if (*arg2 != NULL) {
      Py_DecRef(resultobj);
      resultobj = PyCapsule_New(*arg2, "struct wally_tx_witness_stack *", destroy_wally_tx_witness_stack);
    }
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_witness_stack_clone_alloc(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx_witness_stack *arg1 = (struct wally_tx_witness_stack *) 0 ;
  struct wally_tx_witness_stack **arg2 = (struct wally_tx_witness_stack **) 0 ;
  struct wally_tx_witness_stack *w2 ;
  PyObject *swig_obj[1] ;
  int result;
  
  {
    w2 = 0; arg2 = (struct wally_tx_witness_stack **)&w2;
  }
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx_witness_stack *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_witness_stack_clone_alloc" "', argument " "1"" of type '" "(wally_tx_witness_stack)""'");
    }
  }
  {
    result = (int)wally_tx_witness_stack_clone_alloc((struct wally_tx_witness_stack const *)arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    if (*arg2 != NULL) {
      Py_DecRef(resultobj);
      resultobj = PyCapsule_New(*arg2, "struct wally_tx_witness_stack *", destroy_wally_tx_witness_stack);
    }
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_witness_stack_get_num_items(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx_witness_stack *arg1 = (struct wally_tx_witness_stack *) 0 ;
  size_t *arg2 = (size_t *) 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  size_t written = 0; arg2 = (size_t *)&written;
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx_witness_stack *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_witness_stack_get_num_items" "', argument " "1"" of type '" "(wally_tx_witness_stack)""'");
    }
  }
  {
    result = (int)wally_tx_witness_stack_get_num_items((struct wally_tx_witness_stack const *)arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg2);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_witness_stack_add(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx_witness_stack *arg1 = (struct wally_tx_witness_stack *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "tx_witness_stack_add", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx_witness_stack *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_witness_stack_add" "', argument " "1"" of type '" "(wally_tx_witness_stack)""'");
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg3 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_witness_stack_add" "', argument " "2"" of type '" "(const unsigned char* witness, size_t witness_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg2 = (unsigned char *) buf;
      arg3 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_tx_witness_stack_add(arg1,(unsigned char const *)arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_witness_stack_add_dummy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx_witness_stack *arg1 = (struct wally_tx_witness_stack *) 0 ;
  uint32_t arg2 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "tx_witness_stack_add_dummy", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx_witness_stack *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_witness_stack_add_dummy" "', argument " "1"" of type '" "(wally_tx_witness_stack)""'");
    }
  }
  ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "tx_witness_stack_add_dummy" "', argument " "2"" of type '" "uint32_t""'");
  } 
  arg2 = (uint32_t)(val2);
  {
    result = (int)wally_tx_witness_stack_add_dummy(arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_witness_stack_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx_witness_stack *arg1 = (struct wally_tx_witness_stack *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "tx_witness_stack_set", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx_witness_stack *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_witness_stack_set" "', argument " "1"" of type '" "(wally_tx_witness_stack)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "tx_witness_stack_set" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[2] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_witness_stack_set" "', argument " "3"" of type '" "(const unsigned char* witness, size_t witness_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_tx_witness_stack_set(arg1,arg2,(unsigned char const *)arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_witness_stack_set_dummy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx_witness_stack *arg1 = (struct wally_tx_witness_stack *) 0 ;
  size_t arg2 ;
  uint32_t arg3 ;
  size_t val2 ;
  int ecode2 = 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "tx_witness_stack_set_dummy", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx_witness_stack *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_witness_stack_set_dummy" "', argument " "1"" of type '" "(wally_tx_witness_stack)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "tx_witness_stack_set_dummy" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  ecode3 = SWIG_AsVal_unsigned_SS_int(swig_obj[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "tx_witness_stack_set_dummy" "', argument " "3"" of type '" "uint32_t""'");
  } 
  arg3 = (uint32_t)(val3);
  {
    result = (int)wally_tx_witness_stack_set_dummy(arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_witness_stack_from_bytes(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  struct wally_tx_witness_stack **arg3 = (struct wally_tx_witness_stack **) 0 ;
  struct wally_tx_witness_stack *w3 ;
  PyObject *swig_obj[1] ;
  int result;
  
  {
    w3 = 0; arg3 = (struct wally_tx_witness_stack **)&w3;
  }
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_witness_stack_from_bytes" "', argument " "1"" of type '" "(const unsigned char* bytes, size_t bytes_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_tx_witness_stack_from_bytes((unsigned char const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    if (*arg3 != NULL) {
      Py_DecRef(resultobj);
      resultobj = PyCapsule_New(*arg3, "struct wally_tx_witness_stack *", destroy_wally_tx_witness_stack);
    }
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_witness_stack_get_length(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx_witness_stack *arg1 = (struct wally_tx_witness_stack *) 0 ;
  size_t *arg2 = (size_t *) 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  size_t written = 0; arg2 = (size_t *)&written;
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx_witness_stack *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_witness_stack_get_length" "', argument " "1"" of type '" "(wally_tx_witness_stack)""'");
    }
  }
  {
    result = (int)wally_tx_witness_stack_get_length((struct wally_tx_witness_stack const *)arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg2);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_witness_stack_to_bytes(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx_witness_stack *arg1 = (struct wally_tx_witness_stack *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  size_t *arg4 = (size_t *) 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg4 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "tx_witness_stack_to_bytes", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx_witness_stack *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_witness_stack_to_bytes" "', argument " "1"" of type '" "(wally_tx_witness_stack)""'");
    }
  }
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_witness_stack_to_bytes" "', argument " "2"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg2 = (unsigned char *) buf;
    arg3 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_tx_witness_stack_to_bytes((struct wally_tx_witness_stack const *)arg1,arg2,arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg4);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_witness_stack_free(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx_witness_stack *arg1 = (struct wally_tx_witness_stack *) 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx_witness_stack *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_witness_stack_free" "', argument " "1"" of type '" "(wally_tx_witness_stack)""'");
    }
  }
  {
    result = (int)wally_tx_witness_stack_free(arg1);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_input_init_alloc(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  uint32_t arg3 ;
  uint32_t arg4 ;
  unsigned char *arg5 = (unsigned char *) 0 ;
  size_t arg6 ;
  struct wally_tx_witness_stack *arg7 = (struct wally_tx_witness_stack *) 0 ;
  struct wally_tx_input **arg8 = (struct wally_tx_input **) 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  unsigned int val4 ;
  int ecode4 = 0 ;
  struct wally_tx_input *w8 ;
  PyObject *swig_obj[5] ;
  int result;
  
  {
    w8 = 0; arg8 = (struct wally_tx_input **)&w8;
  }
  if (!SWIG_Python_UnpackTuple(args, "tx_input_init_alloc", 5, 5, swig_obj)) SWIG_fail;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_input_init_alloc" "', argument " "1"" of type '" "(const unsigned char* txhash, size_t txhash_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  ecode3 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "tx_input_init_alloc" "', argument " "3"" of type '" "uint32_t""'");
  } 
  arg3 = (uint32_t)(val3);
  ecode4 = SWIG_AsVal_unsigned_SS_int(swig_obj[2], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "tx_input_init_alloc" "', argument " "4"" of type '" "uint32_t""'");
  } 
  arg4 = (uint32_t)(val4);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[3] == Py_None)
    arg6 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[3], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_input_init_alloc" "', argument " "5"" of type '" "(const unsigned char* script, size_t script_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg5 = (unsigned char *) buf;
      arg6 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    arg7 = swig_obj[4] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[4], "struct wally_tx_witness_stack *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_input_init_alloc" "', argument " "7"" of type '" "(wally_tx_witness_stack)""'");
    }
  }
  {
    result = (int)wally_tx_input_init_alloc((unsigned char const *)arg1,arg2,arg3,arg4,(unsigned char const *)arg5,arg6,(struct wally_tx_witness_stack const *)arg7,arg8);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    if (*arg8 != NULL) {
      Py_DecRef(resultobj);
      resultobj = PyCapsule_New(*arg8, "struct wally_tx_input *", destroy_wally_tx_input);
    }
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_input_clone_alloc(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx_input *arg1 = (struct wally_tx_input *) 0 ;
  struct wally_tx_input **arg2 = (struct wally_tx_input **) 0 ;
  void *argp2 = 0 ;
  int res2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "tx_input_clone_alloc", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx_input *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_input_clone_alloc" "', argument " "1"" of type '" "(wally_tx_input)""'");
    }
  }
  res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_p_wally_tx_input, 0 |  0 );
  if (!SWIG_IsOK(res2)) {
    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "tx_input_clone_alloc" "', argument " "2"" of type '" "struct wally_tx_input **""'"); 
  }
  arg2 = (struct wally_tx_input **)(argp2);
  {
    result = (int)wally_tx_input_clone_alloc((struct wally_tx_input const *)arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    if (*arg2 != NULL) {
      Py_DecRef(resultobj);
      resultobj = PyCapsule_New(*arg2, "struct wally_tx_input *", destroy_wally_tx_input);
    }
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_input_free(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx_input *arg1 = (struct wally_tx_input *) 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx_input *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_input_free" "', argument " "1"" of type '" "(wally_tx_input)""'");
    }
  }
  {
    result = (int)wally_tx_input_free(arg1);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_output_init_alloc(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  uint64_t arg1 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  struct wally_tx_output **arg4 = (struct wally_tx_output **) 0 ;
  unsigned long long val1 ;
  int ecode1 = 0 ;
  struct wally_tx_output *w4 ;
  PyObject *swig_obj[2] ;
  int result;
  
  {
    w4 = 0; arg4 = (struct wally_tx_output **)&w4;
  }
  if (!SWIG_Python_UnpackTuple(args, "tx_output_init_alloc", 2, 2, swig_obj)) SWIG_fail;
  ecode1 = SWIG_AsVal_unsigned_SS_long_SS_long(swig_obj[0], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "tx_output_init_alloc" "', argument " "1"" of type '" "uint64_t""'");
  } 
  arg1 = (uint64_t)(val1);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg3 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_output_init_alloc" "', argument " "2"" of type '" "(const unsigned char* script, size_t script_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg2 = (unsigned char *) buf;
      arg3 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_tx_output_init_alloc(arg1,(unsigned char const *)arg2,arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    if (*arg4 != NULL) {
      Py_DecRef(resultobj);
      resultobj = PyCapsule_New(*arg4, "struct wally_tx_output *", destroy_wally_tx_output);
    }
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_output_clone_alloc(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx_output *arg1 = (struct wally_tx_output *) 0 ;
  struct wally_tx_output **arg2 = (struct wally_tx_output **) 0 ;
  struct wally_tx_output *w2 ;
  PyObject *swig_obj[1] ;
  int result;
  
  {
    w2 = 0; arg2 = (struct wally_tx_output **)&w2;
  }
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx_output *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_output_clone_alloc" "', argument " "1"" of type '" "(wally_tx_output)""'");
    }
  }
  {
    result = (int)wally_tx_output_clone_alloc((struct wally_tx_output const *)arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    if (*arg2 != NULL) {
      Py_DecRef(resultobj);
      resultobj = PyCapsule_New(*arg2, "struct wally_tx_output *", destroy_wally_tx_output);
    }
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_output_free(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx_output *arg1 = (struct wally_tx_output *) 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx_output *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_output_free" "', argument " "1"" of type '" "(wally_tx_output)""'");
    }
  }
  {
    result = (int)wally_tx_output_free(arg1);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_init_alloc(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  uint32_t arg1 ;
  uint32_t arg2 ;
  size_t arg3 ;
  size_t arg4 ;
  struct wally_tx **arg5 = (struct wally_tx **) 0 ;
  unsigned int val1 ;
  int ecode1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  size_t val3 ;
  int ecode3 = 0 ;
  size_t val4 ;
  int ecode4 = 0 ;
  struct wally_tx *w5 ;
  PyObject *swig_obj[4] ;
  int result;
  
  {
    w5 = 0; arg5 = (struct wally_tx **)&w5;
  }
  if (!SWIG_Python_UnpackTuple(args, "tx_init_alloc", 4, 4, swig_obj)) SWIG_fail;
  ecode1 = SWIG_AsVal_unsigned_SS_int(swig_obj[0], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "tx_init_alloc" "', argument " "1"" of type '" "uint32_t""'");
  } 
  arg1 = (uint32_t)(val1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "tx_init_alloc" "', argument " "2"" of type '" "uint32_t""'");
  } 
  arg2 = (uint32_t)(val2);
  ecode3 = SWIG_AsVal_size_t(swig_obj[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "tx_init_alloc" "', argument " "3"" of type '" "size_t""'");
  } 
  arg3 = (size_t)(val3);
  ecode4 = SWIG_AsVal_size_t(swig_obj[3], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "tx_init_alloc" "', argument " "4"" of type '" "size_t""'");
  } 
  arg4 = (size_t)(val4);
  {
    result = (int)wally_tx_init_alloc(arg1,arg2,arg3,arg4,arg5);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    if (*arg5 != NULL) {
      Py_DecRef(resultobj);
      resultobj = PyCapsule_New(*arg5, "struct wally_tx *", destroy_wally_tx);
    }
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_clone_alloc(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx *arg1 = (struct wally_tx *) 0 ;
  uint32_t arg2 ;
  struct wally_tx **arg3 = (struct wally_tx **) 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  struct wally_tx *w3 ;
  PyObject *swig_obj[2] ;
  int result;
  
  {
    w3 = 0; arg3 = (struct wally_tx **)&w3;
  }
  if (!SWIG_Python_UnpackTuple(args, "tx_clone_alloc", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_clone_alloc" "', argument " "1"" of type '" "(wally_tx)""'");
    }
  }
  ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "tx_clone_alloc" "', argument " "2"" of type '" "uint32_t""'");
  } 
  arg2 = (uint32_t)(val2);
  {
    result = (int)wally_tx_clone_alloc((struct wally_tx const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    if (*arg3 != NULL) {
      Py_DecRef(resultobj);
      resultobj = PyCapsule_New(*arg3, "struct wally_tx *", destroy_wally_tx);
    }
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_add_input(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx *arg1 = (struct wally_tx *) 0 ;
  struct wally_tx_input *arg2 = (struct wally_tx_input *) 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "tx_add_input", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_add_input" "', argument " "1"" of type '" "(wally_tx)""'");
    }
  }
  {
    arg2 = swig_obj[1] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[1], "struct wally_tx_input *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_add_input" "', argument " "2"" of type '" "(wally_tx_input)""'");
    }
  }
  {
    result = (int)wally_tx_add_input(arg1,(struct wally_tx_input const *)arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_add_input_at(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx *arg1 = (struct wally_tx *) 0 ;
  uint32_t arg2 ;
  struct wally_tx_input *arg3 = (struct wally_tx_input *) 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "tx_add_input_at", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_add_input_at" "', argument " "1"" of type '" "(wally_tx)""'");
    }
  }
  ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "tx_add_input_at" "', argument " "2"" of type '" "uint32_t""'");
  } 
  arg2 = (uint32_t)(val2);
  {
    arg3 = swig_obj[2] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[2], "struct wally_tx_input *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_add_input_at" "', argument " "3"" of type '" "(wally_tx_input)""'");
    }
  }
  {
    result = (int)wally_tx_add_input_at(arg1,arg2,(struct wally_tx_input const *)arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_add_raw_input(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx *arg1 = (struct wally_tx *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  uint32_t arg4 ;
  uint32_t arg5 ;
  unsigned char *arg6 = (unsigned char *) 0 ;
  size_t arg7 ;
  struct wally_tx_witness_stack *arg8 = (struct wally_tx_witness_stack *) 0 ;
  uint32_t arg9 ;
  unsigned int val4 ;
  int ecode4 = 0 ;
  unsigned int val5 ;
  int ecode5 = 0 ;
  unsigned int val9 ;
  int ecode9 = 0 ;
  PyObject *swig_obj[7] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "tx_add_raw_input", 7, 7, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_add_raw_input" "', argument " "1"" of type '" "(wally_tx)""'");
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg3 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_add_raw_input" "', argument " "2"" of type '" "(const unsigned char* txhash, size_t txhash_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg2 = (unsigned char *) buf;
      arg3 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  ecode4 = SWIG_AsVal_unsigned_SS_int(swig_obj[2], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "tx_add_raw_input" "', argument " "4"" of type '" "uint32_t""'");
  } 
  arg4 = (uint32_t)(val4);
  ecode5 = SWIG_AsVal_unsigned_SS_int(swig_obj[3], &val5);
  if (!SWIG_IsOK(ecode5)) {
    SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "tx_add_raw_input" "', argument " "5"" of type '" "uint32_t""'");
  } 
  arg5 = (uint32_t)(val5);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[4] == Py_None)
    arg7 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[4], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_add_raw_input" "', argument " "6"" of type '" "(const unsigned char* script, size_t script_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg6 = (unsigned char *) buf;
      arg7 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    arg8 = swig_obj[5] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[5], "struct wally_tx_witness_stack *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_add_raw_input" "', argument " "8"" of type '" "(wally_tx_witness_stack)""'");
    }
  }
  ecode9 = SWIG_AsVal_unsigned_SS_int(swig_obj[6], &val9);
  if (!SWIG_IsOK(ecode9)) {
    SWIG_exception_fail(SWIG_ArgError(ecode9), "in method '" "tx_add_raw_input" "', argument " "9"" of type '" "uint32_t""'");
  } 
  arg9 = (uint32_t)(val9);
  {
    result = (int)wally_tx_add_raw_input(arg1,(unsigned char const *)arg2,arg3,arg4,arg5,(unsigned char const *)arg6,arg7,(struct wally_tx_witness_stack const *)arg8,arg9);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_add_raw_input_at(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx *arg1 = (struct wally_tx *) 0 ;
  uint32_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  uint32_t arg5 ;
  uint32_t arg6 ;
  unsigned char *arg7 = (unsigned char *) 0 ;
  size_t arg8 ;
  struct wally_tx_witness_stack *arg9 = (struct wally_tx_witness_stack *) 0 ;
  uint32_t arg10 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  unsigned int val5 ;
  int ecode5 = 0 ;
  unsigned int val6 ;
  int ecode6 = 0 ;
  unsigned int val10 ;
  int ecode10 = 0 ;
  PyObject *swig_obj[8] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "tx_add_raw_input_at", 8, 8, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_add_raw_input_at" "', argument " "1"" of type '" "(wally_tx)""'");
    }
  }
  ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "tx_add_raw_input_at" "', argument " "2"" of type '" "uint32_t""'");
  } 
  arg2 = (uint32_t)(val2);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[2] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_add_raw_input_at" "', argument " "3"" of type '" "(const unsigned char* txhash, size_t txhash_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  ecode5 = SWIG_AsVal_unsigned_SS_int(swig_obj[3], &val5);
  if (!SWIG_IsOK(ecode5)) {
    SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "tx_add_raw_input_at" "', argument " "5"" of type '" "uint32_t""'");
  } 
  arg5 = (uint32_t)(val5);
  ecode6 = SWIG_AsVal_unsigned_SS_int(swig_obj[4], &val6);
  if (!SWIG_IsOK(ecode6)) {
    SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "tx_add_raw_input_at" "', argument " "6"" of type '" "uint32_t""'");
  } 
  arg6 = (uint32_t)(val6);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[5] == Py_None)
    arg8 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[5], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_add_raw_input_at" "', argument " "7"" of type '" "(const unsigned char* script, size_t script_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg7 = (unsigned char *) buf;
      arg8 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    arg9 = swig_obj[6] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[6], "struct wally_tx_witness_stack *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_add_raw_input_at" "', argument " "9"" of type '" "(wally_tx_witness_stack)""'");
    }
  }
  ecode10 = SWIG_AsVal_unsigned_SS_int(swig_obj[7], &val10);
  if (!SWIG_IsOK(ecode10)) {
    SWIG_exception_fail(SWIG_ArgError(ecode10), "in method '" "tx_add_raw_input_at" "', argument " "10"" of type '" "uint32_t""'");
  } 
  arg10 = (uint32_t)(val10);
  {
    result = (int)wally_tx_add_raw_input_at(arg1,arg2,(unsigned char const *)arg3,arg4,arg5,arg6,(unsigned char const *)arg7,arg8,(struct wally_tx_witness_stack const *)arg9,arg10);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_remove_input(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx *arg1 = (struct wally_tx *) 0 ;
  size_t arg2 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "tx_remove_input", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_remove_input" "', argument " "1"" of type '" "(wally_tx)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "tx_remove_input" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_tx_remove_input(arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_set_input_script(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx *arg1 = (struct wally_tx *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "tx_set_input_script", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_set_input_script" "', argument " "1"" of type '" "(wally_tx)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "tx_set_input_script" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[2] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_set_input_script" "', argument " "3"" of type '" "(const unsigned char* script, size_t script_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_tx_set_input_script((struct wally_tx const *)arg1,arg2,(unsigned char const *)arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_set_input_witness(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx *arg1 = (struct wally_tx *) 0 ;
  size_t arg2 ;
  struct wally_tx_witness_stack *arg3 = (struct wally_tx_witness_stack *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "tx_set_input_witness", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_set_input_witness" "', argument " "1"" of type '" "(wally_tx)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "tx_set_input_witness" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    arg3 = swig_obj[2] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[2], "struct wally_tx_witness_stack *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_set_input_witness" "', argument " "3"" of type '" "(wally_tx_witness_stack)""'");
    }
  }
  {
    result = (int)wally_tx_set_input_witness((struct wally_tx const *)arg1,arg2,(struct wally_tx_witness_stack const *)arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_add_output(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx *arg1 = (struct wally_tx *) 0 ;
  struct wally_tx_output *arg2 = (struct wally_tx_output *) 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "tx_add_output", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_add_output" "', argument " "1"" of type '" "(wally_tx)""'");
    }
  }
  {
    arg2 = swig_obj[1] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[1], "struct wally_tx_output *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_add_output" "', argument " "2"" of type '" "(wally_tx_output)""'");
    }
  }
  {
    result = (int)wally_tx_add_output(arg1,(struct wally_tx_output const *)arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_add_output_at(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx *arg1 = (struct wally_tx *) 0 ;
  uint32_t arg2 ;
  struct wally_tx_output *arg3 = (struct wally_tx_output *) 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "tx_add_output_at", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_add_output_at" "', argument " "1"" of type '" "(wally_tx)""'");
    }
  }
  ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "tx_add_output_at" "', argument " "2"" of type '" "uint32_t""'");
  } 
  arg2 = (uint32_t)(val2);
  {
    arg3 = swig_obj[2] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[2], "struct wally_tx_output *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_add_output_at" "', argument " "3"" of type '" "(wally_tx_output)""'");
    }
  }
  {
    result = (int)wally_tx_add_output_at(arg1,arg2,(struct wally_tx_output const *)arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_add_raw_output(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx *arg1 = (struct wally_tx *) 0 ;
  uint64_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  uint32_t arg5 ;
  unsigned long long val2 ;
  int ecode2 = 0 ;
  unsigned int val5 ;
  int ecode5 = 0 ;
  PyObject *swig_obj[4] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "tx_add_raw_output", 4, 4, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_add_raw_output" "', argument " "1"" of type '" "(wally_tx)""'");
    }
  }
  ecode2 = SWIG_AsVal_unsigned_SS_long_SS_long(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "tx_add_raw_output" "', argument " "2"" of type '" "uint64_t""'");
  } 
  arg2 = (uint64_t)(val2);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[2] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_add_raw_output" "', argument " "3"" of type '" "(const unsigned char* script, size_t script_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  ecode5 = SWIG_AsVal_unsigned_SS_int(swig_obj[3], &val5);
  if (!SWIG_IsOK(ecode5)) {
    SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "tx_add_raw_output" "', argument " "5"" of type '" "uint32_t""'");
  } 
  arg5 = (uint32_t)(val5);
  {
    result = (int)wally_tx_add_raw_output(arg1,arg2,(unsigned char const *)arg3,arg4,arg5);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_add_raw_output_at(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx *arg1 = (struct wally_tx *) 0 ;
  uint32_t arg2 ;
  uint64_t arg3 ;
  unsigned char *arg4 = (unsigned char *) 0 ;
  size_t arg5 ;
  uint32_t arg6 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  unsigned long long val3 ;
  int ecode3 = 0 ;
  unsigned int val6 ;
  int ecode6 = 0 ;
  PyObject *swig_obj[5] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "tx_add_raw_output_at", 5, 5, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_add_raw_output_at" "', argument " "1"" of type '" "(wally_tx)""'");
    }
  }
  ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "tx_add_raw_output_at" "', argument " "2"" of type '" "uint32_t""'");
  } 
  arg2 = (uint32_t)(val2);
  ecode3 = SWIG_AsVal_unsigned_SS_long_SS_long(swig_obj[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "tx_add_raw_output_at" "', argument " "3"" of type '" "uint64_t""'");
  } 
  arg3 = (uint64_t)(val3);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[3] == Py_None)
    arg5 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[3], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_add_raw_output_at" "', argument " "4"" of type '" "(const unsigned char* script, size_t script_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg4 = (unsigned char *) buf;
      arg5 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  ecode6 = SWIG_AsVal_unsigned_SS_int(swig_obj[4], &val6);
  if (!SWIG_IsOK(ecode6)) {
    SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "tx_add_raw_output_at" "', argument " "6"" of type '" "uint32_t""'");
  } 
  arg6 = (uint32_t)(val6);
  {
    result = (int)wally_tx_add_raw_output_at(arg1,arg2,arg3,(unsigned char const *)arg4,arg5,arg6);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_remove_output(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx *arg1 = (struct wally_tx *) 0 ;
  size_t arg2 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "tx_remove_output", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_remove_output" "', argument " "1"" of type '" "(wally_tx)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "tx_remove_output" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_tx_remove_output(arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_get_witness_count(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx *arg1 = (struct wally_tx *) 0 ;
  size_t *arg2 = (size_t *) 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  size_t written = 0; arg2 = (size_t *)&written;
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_get_witness_count" "', argument " "1"" of type '" "(wally_tx)""'");
    }
  }
  {
    result = (int)wally_tx_get_witness_count((struct wally_tx const *)arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg2);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_free(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx *arg1 = (struct wally_tx *) 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_free" "', argument " "1"" of type '" "(wally_tx)""'");
    }
  }
  {
    result = (int)wally_tx_free(arg1);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_get_txid(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx *arg1 = (struct wally_tx *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "tx_get_txid", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_get_txid" "', argument " "1"" of type '" "(wally_tx)""'");
    }
  }
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_get_txid" "', argument " "2"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg2 = (unsigned char *) buf;
    arg3 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_tx_get_txid((struct wally_tx const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_get_hash_prevouts(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  uint32_t *arg3 = (uint32_t *) 0 ;
  size_t arg4 ;
  unsigned char *arg5 = (unsigned char *) 0 ;
  size_t arg6 ;
  uint32_t tmp_buf3[MAX_LOCAL_STACK/sizeof(uint32_t)] ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "get_hash_prevouts", 3, 3, swig_obj)) SWIG_fail;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "get_hash_prevouts" "', argument " "1"" of type '" "(const unsigned char* txhashes, size_t txhashes_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    size_t i;
    if (!PyList_Check(swig_obj[1])) {
      check_result(WALLY_EINVAL);
      SWIG_fail;
    }
    arg4 = PyList_Size(swig_obj[1]);
    arg3 = tmp_buf3;
    if (arg4 * sizeof(uint32_t) > sizeof(tmp_buf3))
    if (!(arg3 = (uint32_t *) wally_malloc((arg4) * sizeof(uint32_t)))) {
      check_result(WALLY_ENOMEM);
      SWIG_fail;
    }
    for (i = 0; i < arg4; ++i) {
      PyObject *item = PyList_GET_ITEM(swig_obj[1], i);
      unsigned long long v;
      if (!ulonglong_cast(item, &v) || v > 0xffffffffull) {
        PyErr_SetString(PyExc_OverflowError, "Invalid unsigned integer");
        SWIG_fail;
      }
      arg3[i] = (uint32_t)v;
    }
  }
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "get_hash_prevouts" "', argument " "5"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg5 = (unsigned char *) buf;
    arg6 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_get_hash_prevouts((unsigned char const *)arg1,arg2,(unsigned int const *)arg3,arg4,arg5,arg6);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    if (arg3 && arg3 != tmp_buf3)
    wally_free(arg3);
  }
  return resultobj;
fail:
  {
    if (arg3 && arg3 != tmp_buf3)
    wally_free(arg3);
  }
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_get_hash_prevouts(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx *arg1 = (struct wally_tx *) 0 ;
  size_t arg2 ;
  size_t arg3 ;
  unsigned char *arg4 = (unsigned char *) 0 ;
  size_t arg5 ;
  size_t val2 ;
  int ecode2 = 0 ;
  size_t val3 ;
  int ecode3 = 0 ;
  PyObject *swig_obj[4] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "tx_get_hash_prevouts", 4, 4, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_get_hash_prevouts" "', argument " "1"" of type '" "(wally_tx)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "tx_get_hash_prevouts" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  ecode3 = SWIG_AsVal_size_t(swig_obj[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "tx_get_hash_prevouts" "', argument " "3"" of type '" "size_t""'");
  } 
  arg3 = (size_t)(val3);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[3], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_get_hash_prevouts" "', argument " "4"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg4 = (unsigned char *) buf;
    arg5 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_tx_get_hash_prevouts((struct wally_tx const *)arg1,arg2,arg3,arg4,arg5);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_get_length(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx *arg1 = (struct wally_tx *) 0 ;
  uint32_t arg2 ;
  size_t *arg3 = (size_t *) 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg3 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "tx_get_length", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_get_length" "', argument " "1"" of type '" "(wally_tx)""'");
    }
  }
  ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "tx_get_length" "', argument " "2"" of type '" "uint32_t""'");
  } 
  arg2 = (uint32_t)(val2);
  {
    result = (int)wally_tx_get_length((struct wally_tx const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg3);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_from_bytes(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  uint32_t arg3 ;
  struct wally_tx **arg4 = (struct wally_tx **) 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  struct wally_tx *w4 ;
  PyObject *swig_obj[2] ;
  int result;
  
  {
    w4 = 0; arg4 = (struct wally_tx **)&w4;
  }
  if (!SWIG_Python_UnpackTuple(args, "tx_from_bytes", 2, 2, swig_obj)) SWIG_fail;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_from_bytes" "', argument " "1"" of type '" "(const unsigned char* bytes, size_t bytes_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  ecode3 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "tx_from_bytes" "', argument " "3"" of type '" "uint32_t""'");
  } 
  arg3 = (uint32_t)(val3);
  {
    result = (int)wally_tx_from_bytes((unsigned char const *)arg1,arg2,arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    if (*arg4 != NULL) {
      Py_DecRef(resultobj);
      resultobj = PyCapsule_New(*arg4, "struct wally_tx *", destroy_wally_tx);
    }
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_from_hex(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  char *arg1 = (char *) 0 ;
  uint32_t arg2 ;
  struct wally_tx **arg3 = (struct wally_tx **) 0 ;
  int res1 ;
  char *buf1 = 0 ;
  int alloc1 = 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  struct wally_tx *w3 ;
  PyObject *swig_obj[2] ;
  int result;
  
  {
    w3 = 0; arg3 = (struct wally_tx **)&w3;
  }
  if (!SWIG_Python_UnpackTuple(args, "tx_from_hex", 2, 2, swig_obj)) SWIG_fail;
  res1 = SWIG_AsCharPtrAndSize(swig_obj[0], &buf1, NULL, &alloc1);
  if (!SWIG_IsOK(res1)) {
    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "tx_from_hex" "', argument " "1"" of type '" "char const *""'");
  }
  arg1 = (char *)(buf1);
  ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "tx_from_hex" "', argument " "2"" of type '" "uint32_t""'");
  } 
  arg2 = (uint32_t)(val2);
  {
    result = (int)wally_tx_from_hex((char const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    if (*arg3 != NULL) {
      Py_DecRef(resultobj);
      resultobj = PyCapsule_New(*arg3, "struct wally_tx *", destroy_wally_tx);
    }
  }
  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
  return resultobj;
fail:
  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_to_bytes(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx *arg1 = (struct wally_tx *) 0 ;
  uint32_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t *arg5 = (size_t *) 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  size_t written = 0; arg5 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "tx_to_bytes", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_to_bytes" "', argument " "1"" of type '" "(wally_tx)""'");
    }
  }
  ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "tx_to_bytes" "', argument " "2"" of type '" "uint32_t""'");
  } 
  arg2 = (uint32_t)(val2);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_to_bytes" "', argument " "3"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg3 = (unsigned char *) buf;
    arg4 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_tx_to_bytes((struct wally_tx const *)arg1,arg2,arg3,arg4,arg5);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg5);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_to_hex(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx *arg1 = (struct wally_tx *) 0 ;
  uint32_t arg2 ;
  char **arg3 = (char **) 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  char *txt3 ;
  PyObject *swig_obj[2] ;
  int result;
  
  {
    txt3 = NULL;
    arg3 = (char **)&txt3;
  }
  if (!SWIG_Python_UnpackTuple(args, "tx_to_hex", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_to_hex" "', argument " "1"" of type '" "(wally_tx)""'");
    }
  }
  ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "tx_to_hex" "', argument " "2"" of type '" "uint32_t""'");
  } 
  arg2 = (uint32_t)(val2);
  {
    result = (int)wally_tx_to_hex((struct wally_tx const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    if (*arg3 != NULL) {
      Py_DecRef(resultobj);
      resultobj = PyString_FromString(*arg3);
      wally_free_string(*arg3);
    }
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_get_weight(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx *arg1 = (struct wally_tx *) 0 ;
  size_t *arg2 = (size_t *) 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  size_t written = 0; arg2 = (size_t *)&written;
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_get_weight" "', argument " "1"" of type '" "(wally_tx)""'");
    }
  }
  {
    result = (int)wally_tx_get_weight((struct wally_tx const *)arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg2);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_get_vsize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx *arg1 = (struct wally_tx *) 0 ;
  size_t *arg2 = (size_t *) 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  size_t written = 0; arg2 = (size_t *)&written;
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_get_vsize" "', argument " "1"" of type '" "(wally_tx)""'");
    }
  }
  {
    result = (int)wally_tx_get_vsize((struct wally_tx const *)arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg2);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_vsize_from_weight(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  size_t arg1 ;
  size_t *arg2 = (size_t *) 0 ;
  size_t val1 ;
  int ecode1 = 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  size_t written = 0; arg2 = (size_t *)&written;
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  ecode1 = SWIG_AsVal_size_t(swig_obj[0], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "tx_vsize_from_weight" "', argument " "1"" of type '" "size_t""'");
  } 
  arg1 = (size_t)(val1);
  {
    result = (int)wally_tx_vsize_from_weight(arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg2);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_get_total_output_satoshi(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx *arg1 = (struct wally_tx *) 0 ;
  uint64_t *arg2 = (uint64_t *) 0 ;
  uint64_t val2 ;
  PyObject *swig_obj[1] ;
  int result;
  
  {
    val2 = 0; arg2 = (uint64_t *)&val2;
  }
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_get_total_output_satoshi" "', argument " "1"" of type '" "(wally_tx)""'");
    }
  }
  {
    result = (int)wally_tx_get_total_output_satoshi((struct wally_tx const *)arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyLong_FromUnsignedLongLong(*arg2);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_get_btc_signature_hash(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx *arg1 = (struct wally_tx *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  uint64_t arg5 ;
  uint32_t arg6 ;
  uint32_t arg7 ;
  unsigned char *arg8 = (unsigned char *) 0 ;
  size_t arg9 ;
  size_t val2 ;
  int ecode2 = 0 ;
  unsigned long long val5 ;
  int ecode5 = 0 ;
  unsigned int val6 ;
  int ecode6 = 0 ;
  unsigned int val7 ;
  int ecode7 = 0 ;
  PyObject *swig_obj[7] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "tx_get_btc_signature_hash", 7, 7, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_get_btc_signature_hash" "', argument " "1"" of type '" "(wally_tx)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "tx_get_btc_signature_hash" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[2] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_get_btc_signature_hash" "', argument " "3"" of type '" "(const unsigned char* script, size_t script_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  ecode5 = SWIG_AsVal_unsigned_SS_long_SS_long(swig_obj[3], &val5);
  if (!SWIG_IsOK(ecode5)) {
    SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "tx_get_btc_signature_hash" "', argument " "5"" of type '" "uint64_t""'");
  } 
  arg5 = (uint64_t)(val5);
  ecode6 = SWIG_AsVal_unsigned_SS_int(swig_obj[4], &val6);
  if (!SWIG_IsOK(ecode6)) {
    SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "tx_get_btc_signature_hash" "', argument " "6"" of type '" "uint32_t""'");
  } 
  arg6 = (uint32_t)(val6);
  ecode7 = SWIG_AsVal_unsigned_SS_int(swig_obj[5], &val7);
  if (!SWIG_IsOK(ecode7)) {
    SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "tx_get_btc_signature_hash" "', argument " "7"" of type '" "uint32_t""'");
  } 
  arg7 = (uint32_t)(val7);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[6], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_get_btc_signature_hash" "', argument " "8"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg8 = (unsigned char *) buf;
    arg9 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_tx_get_btc_signature_hash((struct wally_tx const *)arg1,arg2,(unsigned char const *)arg3,arg4,arg5,arg6,arg7,arg8,arg9);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_get_btc_taproot_signature_hash(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx *arg1 = (struct wally_tx *) 0 ;
  size_t arg2 ;
  struct wally_map *arg3 = (struct wally_map *) 0 ;
  uint64_t *arg4 = (uint64_t *) 0 ;
  size_t arg5 ;
  unsigned char *arg6 = (unsigned char *) 0 ;
  size_t arg7 ;
  uint32_t arg8 ;
  uint32_t arg9 ;
  unsigned char *arg10 = (unsigned char *) 0 ;
  size_t arg11 ;
  uint32_t arg12 ;
  uint32_t arg13 ;
  unsigned char *arg14 = (unsigned char *) 0 ;
  size_t arg15 ;
  size_t val2 ;
  int ecode2 = 0 ;
  uint64_t tmp_buf4[MAX_LOCAL_STACK/sizeof(uint64_t)] ;
  unsigned int val8 ;
  int ecode8 = 0 ;
  unsigned int val9 ;
  int ecode9 = 0 ;
  unsigned int val12 ;
  int ecode12 = 0 ;
  unsigned int val13 ;
  int ecode13 = 0 ;
  PyObject *swig_obj[11] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "tx_get_btc_taproot_signature_hash", 11, 11, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_get_btc_taproot_signature_hash" "', argument " "1"" of type '" "(wally_tx)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "tx_get_btc_taproot_signature_hash" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    arg3 = swig_obj[2] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[2], "struct wally_map *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_get_btc_taproot_signature_hash" "', argument " "3"" of type '" "(wally_map)""'");
    }
  }
  {
    size_t i;
    if (!PyList_Check(swig_obj[3])) {
      check_result(WALLY_EINVAL);
      SWIG_fail;
    }
    arg5 = PyList_Size(swig_obj[3]);
    arg4 = tmp_buf4;
    if (arg5 * sizeof(uint64_t) > sizeof(tmp_buf4))
    if (!(arg4 = (uint64_t *) wally_malloc((arg5) * sizeof(uint64_t)))) {
      check_result(WALLY_ENOMEM);
      SWIG_fail;
    }
    for (i = 0; i < arg5; ++i) {
      PyObject *item = PyList_GET_ITEM(swig_obj[3], i);
      unsigned long long v;
      if (!ulonglong_cast(item, &v) || v > 0xffffffffffffffffull) {
        PyErr_SetString(PyExc_OverflowError, "Invalid unsigned integer");
        SWIG_fail;
      }
      arg4[i] = (uint64_t)v;
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[4] == Py_None)
    arg7 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[4], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_get_btc_taproot_signature_hash" "', argument " "6"" of type '" "(const unsigned char* tapleaf_script, size_t tapleaf_script_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg6 = (unsigned char *) buf;
      arg7 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  ecode8 = SWIG_AsVal_unsigned_SS_int(swig_obj[5], &val8);
  if (!SWIG_IsOK(ecode8)) {
    SWIG_exception_fail(SWIG_ArgError(ecode8), "in method '" "tx_get_btc_taproot_signature_hash" "', argument " "8"" of type '" "uint32_t""'");
  } 
  arg8 = (uint32_t)(val8);
  ecode9 = SWIG_AsVal_unsigned_SS_int(swig_obj[6], &val9);
  if (!SWIG_IsOK(ecode9)) {
    SWIG_exception_fail(SWIG_ArgError(ecode9), "in method '" "tx_get_btc_taproot_signature_hash" "', argument " "9"" of type '" "uint32_t""'");
  } 
  arg9 = (uint32_t)(val9);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[7] == Py_None)
    arg11 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[7], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_get_btc_taproot_signature_hash" "', argument " "10"" of type '" "(const unsigned char* annex, size_t annex_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg10 = (unsigned char *) buf;
      arg11 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  ecode12 = SWIG_AsVal_unsigned_SS_int(swig_obj[8], &val12);
  if (!SWIG_IsOK(ecode12)) {
    SWIG_exception_fail(SWIG_ArgError(ecode12), "in method '" "tx_get_btc_taproot_signature_hash" "', argument " "12"" of type '" "uint32_t""'");
  } 
  arg12 = (uint32_t)(val12);
  ecode13 = SWIG_AsVal_unsigned_SS_int(swig_obj[9], &val13);
  if (!SWIG_IsOK(ecode13)) {
    SWIG_exception_fail(SWIG_ArgError(ecode13), "in method '" "tx_get_btc_taproot_signature_hash" "', argument " "13"" of type '" "uint32_t""'");
  } 
  arg13 = (uint32_t)(val13);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[10], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_get_btc_taproot_signature_hash" "', argument " "14"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg14 = (unsigned char *) buf;
    arg15 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_tx_get_btc_taproot_signature_hash((struct wally_tx const *)arg1,arg2,(struct wally_map const *)arg3,(uint64_t const *)arg4,arg5,(unsigned char const *)arg6,arg7,arg8,arg9,(unsigned char const *)arg10,arg11,arg12,arg13,arg14,arg15);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    if (arg4 && arg4 != tmp_buf4)
    wally_free(arg4);
  }
  return resultobj;
fail:
  {
    if (arg4 && arg4 != tmp_buf4)
    wally_free(arg4);
  }
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_get_signature_hash(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx *arg1 = (struct wally_tx *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  unsigned char *arg5 = (unsigned char *) 0 ;
  size_t arg6 ;
  uint32_t arg7 ;
  uint64_t arg8 ;
  uint32_t arg9 ;
  uint32_t arg10 ;
  uint32_t arg11 ;
  unsigned char *arg12 = (unsigned char *) 0 ;
  size_t arg13 ;
  size_t val2 ;
  int ecode2 = 0 ;
  unsigned int val7 ;
  int ecode7 = 0 ;
  unsigned long long val8 ;
  int ecode8 = 0 ;
  unsigned int val9 ;
  int ecode9 = 0 ;
  unsigned int val10 ;
  int ecode10 = 0 ;
  unsigned int val11 ;
  int ecode11 = 0 ;
  PyObject *swig_obj[10] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "tx_get_signature_hash", 10, 10, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_get_signature_hash" "', argument " "1"" of type '" "(wally_tx)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "tx_get_signature_hash" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[2] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_get_signature_hash" "', argument " "3"" of type '" "(const unsigned char* script, size_t script_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[3] == Py_None)
    arg6 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[3], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_get_signature_hash" "', argument " "5"" of type '" "(const unsigned char* extra, size_t extra_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg5 = (unsigned char *) buf;
      arg6 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  ecode7 = SWIG_AsVal_unsigned_SS_int(swig_obj[4], &val7);
  if (!SWIG_IsOK(ecode7)) {
    SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "tx_get_signature_hash" "', argument " "7"" of type '" "uint32_t""'");
  } 
  arg7 = (uint32_t)(val7);
  ecode8 = SWIG_AsVal_unsigned_SS_long_SS_long(swig_obj[5], &val8);
  if (!SWIG_IsOK(ecode8)) {
    SWIG_exception_fail(SWIG_ArgError(ecode8), "in method '" "tx_get_signature_hash" "', argument " "8"" of type '" "uint64_t""'");
  } 
  arg8 = (uint64_t)(val8);
  ecode9 = SWIG_AsVal_unsigned_SS_int(swig_obj[6], &val9);
  if (!SWIG_IsOK(ecode9)) {
    SWIG_exception_fail(SWIG_ArgError(ecode9), "in method '" "tx_get_signature_hash" "', argument " "9"" of type '" "uint32_t""'");
  } 
  arg9 = (uint32_t)(val9);
  ecode10 = SWIG_AsVal_unsigned_SS_int(swig_obj[7], &val10);
  if (!SWIG_IsOK(ecode10)) {
    SWIG_exception_fail(SWIG_ArgError(ecode10), "in method '" "tx_get_signature_hash" "', argument " "10"" of type '" "uint32_t""'");
  } 
  arg10 = (uint32_t)(val10);
  ecode11 = SWIG_AsVal_unsigned_SS_int(swig_obj[8], &val11);
  if (!SWIG_IsOK(ecode11)) {
    SWIG_exception_fail(SWIG_ArgError(ecode11), "in method '" "tx_get_signature_hash" "', argument " "11"" of type '" "uint32_t""'");
  } 
  arg11 = (uint32_t)(val11);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[9], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_get_signature_hash" "', argument " "12"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg12 = (unsigned char *) buf;
    arg13 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_tx_get_signature_hash((struct wally_tx const *)arg1,arg2,(unsigned char const *)arg3,arg4,(unsigned char const *)arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12,arg13);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_get_input_signature_hash(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx *arg1 = (struct wally_tx *) 0 ;
  size_t arg2 ;
  struct wally_map *arg3 = (struct wally_map *) 0 ;
  struct wally_map *arg4 = (struct wally_map *) 0 ;
  struct wally_map *arg5 = (struct wally_map *) 0 ;
  unsigned char *arg6 = (unsigned char *) 0 ;
  size_t arg7 ;
  uint32_t arg8 ;
  uint32_t arg9 ;
  unsigned char *arg10 = (unsigned char *) 0 ;
  size_t arg11 ;
  unsigned char *arg12 = (unsigned char *) 0 ;
  size_t arg13 ;
  uint32_t arg14 ;
  uint32_t arg15 ;
  struct wally_map *arg16 = (struct wally_map *) 0 ;
  unsigned char *arg17 = (unsigned char *) 0 ;
  size_t arg18 ;
  size_t val2 ;
  int ecode2 = 0 ;
  unsigned int val8 ;
  int ecode8 = 0 ;
  unsigned int val9 ;
  int ecode9 = 0 ;
  unsigned int val14 ;
  int ecode14 = 0 ;
  unsigned int val15 ;
  int ecode15 = 0 ;
  PyObject *swig_obj[14] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "tx_get_input_signature_hash", 14, 14, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_get_input_signature_hash" "', argument " "1"" of type '" "(wally_tx)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "tx_get_input_signature_hash" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    arg3 = swig_obj[2] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[2], "struct wally_map *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_get_input_signature_hash" "', argument " "3"" of type '" "(wally_map)""'");
    }
  }
  {
    arg4 = swig_obj[3] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[3], "struct wally_map *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_get_input_signature_hash" "', argument " "4"" of type '" "(wally_map)""'");
    }
  }
  {
    arg5 = swig_obj[4] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[4], "struct wally_map *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_get_input_signature_hash" "', argument " "5"" of type '" "(wally_map)""'");
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[5] == Py_None)
    arg7 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[5], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_get_input_signature_hash" "', argument " "6"" of type '" "(const unsigned char* script, size_t script_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg6 = (unsigned char *) buf;
      arg7 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  ecode8 = SWIG_AsVal_unsigned_SS_int(swig_obj[6], &val8);
  if (!SWIG_IsOK(ecode8)) {
    SWIG_exception_fail(SWIG_ArgError(ecode8), "in method '" "tx_get_input_signature_hash" "', argument " "8"" of type '" "uint32_t""'");
  } 
  arg8 = (uint32_t)(val8);
  ecode9 = SWIG_AsVal_unsigned_SS_int(swig_obj[7], &val9);
  if (!SWIG_IsOK(ecode9)) {
    SWIG_exception_fail(SWIG_ArgError(ecode9), "in method '" "tx_get_input_signature_hash" "', argument " "9"" of type '" "uint32_t""'");
  } 
  arg9 = (uint32_t)(val9);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[8] == Py_None)
    arg11 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[8], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_get_input_signature_hash" "', argument " "10"" of type '" "(const unsigned char* annex, size_t annex_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg10 = (unsigned char *) buf;
      arg11 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[9] == Py_None)
    arg13 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[9], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_get_input_signature_hash" "', argument " "12"" of type '" "(const unsigned char* genesis_blockhash, size_t genesis_blockhash_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg12 = (unsigned char *) buf;
      arg13 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  ecode14 = SWIG_AsVal_unsigned_SS_int(swig_obj[10], &val14);
  if (!SWIG_IsOK(ecode14)) {
    SWIG_exception_fail(SWIG_ArgError(ecode14), "in method '" "tx_get_input_signature_hash" "', argument " "14"" of type '" "uint32_t""'");
  } 
  arg14 = (uint32_t)(val14);
  ecode15 = SWIG_AsVal_unsigned_SS_int(swig_obj[11], &val15);
  if (!SWIG_IsOK(ecode15)) {
    SWIG_exception_fail(SWIG_ArgError(ecode15), "in method '" "tx_get_input_signature_hash" "', argument " "15"" of type '" "uint32_t""'");
  } 
  arg15 = (uint32_t)(val15);
  {
    arg16 = swig_obj[12] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[12], "struct wally_map *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_get_input_signature_hash" "', argument " "16"" of type '" "(wally_map)""'");
    }
  }
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[13], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_get_input_signature_hash" "', argument " "17"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg17 = (unsigned char *) buf;
    arg18 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_tx_get_input_signature_hash((struct wally_tx const *)arg1,arg2,(struct wally_map const *)arg3,(struct wally_map const *)arg4,(struct wally_map const *)arg5,(unsigned char const *)arg6,arg7,arg8,arg9,(unsigned char const *)arg10,arg11,(unsigned char const *)arg12,arg13,arg14,arg15,arg16,arg17,arg18);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_is_coinbase(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx *arg1 = (struct wally_tx *) 0 ;
  size_t *arg2 = (size_t *) 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  size_t written = 0; arg2 = (size_t *)&written;
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_is_coinbase" "', argument " "1"" of type '" "(wally_tx)""'");
    }
  }
  {
    result = (int)wally_tx_is_coinbase((struct wally_tx const *)arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg2);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_get_elements_weight_discount(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx *arg1 = (struct wally_tx *) 0 ;
  uint32_t arg2 ;
  size_t *arg3 = (size_t *) 0 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg3 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "tx_get_elements_weight_discount", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_get_elements_weight_discount" "', argument " "1"" of type '" "(wally_tx)""'");
    }
  }
  ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "tx_get_elements_weight_discount" "', argument " "2"" of type '" "uint32_t""'");
  } 
  arg2 = (uint32_t)(val2);
  {
    result = (int)wally_tx_get_elements_weight_discount((struct wally_tx const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg3);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_elements_input_issuance_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx_input *arg1 = (struct wally_tx_input *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  unsigned char *arg4 = (unsigned char *) 0 ;
  size_t arg5 ;
  unsigned char *arg6 = (unsigned char *) 0 ;
  size_t arg7 ;
  unsigned char *arg8 = (unsigned char *) 0 ;
  size_t arg9 ;
  unsigned char *arg10 = (unsigned char *) 0 ;
  size_t arg11 ;
  unsigned char *arg12 = (unsigned char *) 0 ;
  size_t arg13 ;
  PyObject *swig_obj[7] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "tx_elements_input_issuance_set", 7, 7, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx_input *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_elements_input_issuance_set" "', argument " "1"" of type '" "(wally_tx_input)""'");
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg3 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_elements_input_issuance_set" "', argument " "2"" of type '" "(const unsigned char* nonce, size_t nonce_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg2 = (unsigned char *) buf;
      arg3 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[2] == Py_None)
    arg5 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_elements_input_issuance_set" "', argument " "4"" of type '" "(const unsigned char* entropy, size_t entropy_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg4 = (unsigned char *) buf;
      arg5 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[3] == Py_None)
    arg7 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[3], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_elements_input_issuance_set" "', argument " "6"" of type '" "(const unsigned char* issuance_amount, size_t issuance_amount_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg6 = (unsigned char *) buf;
      arg7 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[4] == Py_None)
    arg9 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[4], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_elements_input_issuance_set" "', argument " "8"" of type '" "(const unsigned char* inflation_keys, size_t inflation_keys_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg8 = (unsigned char *) buf;
      arg9 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[5] == Py_None)
    arg11 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[5], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_elements_input_issuance_set" "', argument " "10"" of type '" "(const unsigned char* issuance_amount_rangeproof, size_t issuance_amount_rangeproof_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg10 = (unsigned char *) buf;
      arg11 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[6] == Py_None)
    arg13 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[6], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_elements_input_issuance_set" "', argument " "12"" of type '" "(const unsigned char* inflation_keys_rangeproof, size_t inflation_keys_rangeproof_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg12 = (unsigned char *) buf;
      arg13 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_tx_elements_input_issuance_set(arg1,(unsigned char const *)arg2,arg3,(unsigned char const *)arg4,arg5,(unsigned char const *)arg6,arg7,(unsigned char const *)arg8,arg9,(unsigned char const *)arg10,arg11,(unsigned char const *)arg12,arg13);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_elements_input_issuance_free(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx_input *arg1 = (struct wally_tx_input *) 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx_input *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_elements_input_issuance_free" "', argument " "1"" of type '" "(wally_tx_input)""'");
    }
  }
  {
    result = (int)wally_tx_elements_input_issuance_free(arg1);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_elements_input_init_alloc(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  uint32_t arg3 ;
  uint32_t arg4 ;
  unsigned char *arg5 = (unsigned char *) 0 ;
  size_t arg6 ;
  struct wally_tx_witness_stack *arg7 = (struct wally_tx_witness_stack *) 0 ;
  unsigned char *arg8 = (unsigned char *) 0 ;
  size_t arg9 ;
  unsigned char *arg10 = (unsigned char *) 0 ;
  size_t arg11 ;
  unsigned char *arg12 = (unsigned char *) 0 ;
  size_t arg13 ;
  unsigned char *arg14 = (unsigned char *) 0 ;
  size_t arg15 ;
  unsigned char *arg16 = (unsigned char *) 0 ;
  size_t arg17 ;
  unsigned char *arg18 = (unsigned char *) 0 ;
  size_t arg19 ;
  struct wally_tx_witness_stack *arg20 = (struct wally_tx_witness_stack *) 0 ;
  struct wally_tx_input **arg21 = (struct wally_tx_input **) 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  unsigned int val4 ;
  int ecode4 = 0 ;
  struct wally_tx_input *w21 ;
  PyObject *swig_obj[12] ;
  int result;
  
  {
    w21 = 0; arg21 = (struct wally_tx_input **)&w21;
  }
  if (!SWIG_Python_UnpackTuple(args, "tx_elements_input_init_alloc", 12, 12, swig_obj)) SWIG_fail;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_elements_input_init_alloc" "', argument " "1"" of type '" "(const unsigned char* txhash, size_t txhash_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  ecode3 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "tx_elements_input_init_alloc" "', argument " "3"" of type '" "uint32_t""'");
  } 
  arg3 = (uint32_t)(val3);
  ecode4 = SWIG_AsVal_unsigned_SS_int(swig_obj[2], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "tx_elements_input_init_alloc" "', argument " "4"" of type '" "uint32_t""'");
  } 
  arg4 = (uint32_t)(val4);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[3] == Py_None)
    arg6 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[3], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_elements_input_init_alloc" "', argument " "5"" of type '" "(const unsigned char* script, size_t script_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg5 = (unsigned char *) buf;
      arg6 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    arg7 = swig_obj[4] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[4], "struct wally_tx_witness_stack *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_elements_input_init_alloc" "', argument " "7"" of type '" "(wally_tx_witness_stack)""'");
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[5] == Py_None)
    arg9 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[5], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_elements_input_init_alloc" "', argument " "8"" of type '" "(const unsigned char* nonce, size_t nonce_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg8 = (unsigned char *) buf;
      arg9 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[6] == Py_None)
    arg11 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[6], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_elements_input_init_alloc" "', argument " "10"" of type '" "(const unsigned char* entropy, size_t entropy_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg10 = (unsigned char *) buf;
      arg11 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[7] == Py_None)
    arg13 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[7], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_elements_input_init_alloc" "', argument " "12"" of type '" "(const unsigned char* issuance_amount, size_t issuance_amount_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg12 = (unsigned char *) buf;
      arg13 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[8] == Py_None)
    arg15 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[8], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_elements_input_init_alloc" "', argument " "14"" of type '" "(const unsigned char* inflation_keys, size_t inflation_keys_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg14 = (unsigned char *) buf;
      arg15 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[9] == Py_None)
    arg17 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[9], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_elements_input_init_alloc" "', argument " "16"" of type '" "(const unsigned char* issuance_amount_rangeproof, size_t issuance_amount_rangeproof_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg16 = (unsigned char *) buf;
      arg17 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[10] == Py_None)
    arg19 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[10], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_elements_input_init_alloc" "', argument " "18"" of type '" "(const unsigned char* inflation_keys_rangeproof, size_t inflation_keys_rangeproof_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg18 = (unsigned char *) buf;
      arg19 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    arg20 = swig_obj[11] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[11], "struct wally_tx_witness_stack *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_elements_input_init_alloc" "', argument " "20"" of type '" "(wally_tx_witness_stack)""'");
    }
  }
  {
    result = (int)wally_tx_elements_input_init_alloc((unsigned char const *)arg1,arg2,arg3,arg4,(unsigned char const *)arg5,arg6,(struct wally_tx_witness_stack const *)arg7,(unsigned char const *)arg8,arg9,(unsigned char const *)arg10,arg11,(unsigned char const *)arg12,arg13,(unsigned char const *)arg14,arg15,(unsigned char const *)arg16,arg17,(unsigned char const *)arg18,arg19,(struct wally_tx_witness_stack const *)arg20,arg21);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    if (*arg21 != NULL) {
      Py_DecRef(resultobj);
      resultobj = PyCapsule_New(*arg21, "struct wally_tx_input *", destroy_wally_tx_input);
    }
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_elements_input_is_pegin(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx_input *arg1 = (struct wally_tx_input *) 0 ;
  size_t *arg2 = (size_t *) 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  size_t written = 0; arg2 = (size_t *)&written;
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx_input *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_elements_input_is_pegin" "', argument " "1"" of type '" "(wally_tx_input)""'");
    }
  }
  {
    result = (int)wally_tx_elements_input_is_pegin((struct wally_tx_input const *)arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg2);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_elements_output_commitment_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx_output *arg1 = (struct wally_tx_output *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  unsigned char *arg4 = (unsigned char *) 0 ;
  size_t arg5 ;
  unsigned char *arg6 = (unsigned char *) 0 ;
  size_t arg7 ;
  unsigned char *arg8 = (unsigned char *) 0 ;
  size_t arg9 ;
  unsigned char *arg10 = (unsigned char *) 0 ;
  size_t arg11 ;
  PyObject *swig_obj[6] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "tx_elements_output_commitment_set", 6, 6, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx_output *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_elements_output_commitment_set" "', argument " "1"" of type '" "(wally_tx_output)""'");
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg3 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_elements_output_commitment_set" "', argument " "2"" of type '" "(const unsigned char* asset, size_t asset_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg2 = (unsigned char *) buf;
      arg3 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[2] == Py_None)
    arg5 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_elements_output_commitment_set" "', argument " "4"" of type '" "(const unsigned char* value, size_t value_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg4 = (unsigned char *) buf;
      arg5 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[3] == Py_None)
    arg7 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[3], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_elements_output_commitment_set" "', argument " "6"" of type '" "(const unsigned char* nonce, size_t nonce_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg6 = (unsigned char *) buf;
      arg7 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[4] == Py_None)
    arg9 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[4], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_elements_output_commitment_set" "', argument " "8"" of type '" "(const unsigned char* surjectionproof, size_t surjectionproof_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg8 = (unsigned char *) buf;
      arg9 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[5] == Py_None)
    arg11 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[5], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_elements_output_commitment_set" "', argument " "10"" of type '" "(const unsigned char* rangeproof, size_t rangeproof_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg10 = (unsigned char *) buf;
      arg11 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_tx_elements_output_commitment_set(arg1,(unsigned char const *)arg2,arg3,(unsigned char const *)arg4,arg5,(unsigned char const *)arg6,arg7,(unsigned char const *)arg8,arg9,(unsigned char const *)arg10,arg11);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_elements_output_commitment_free(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx_output *arg1 = (struct wally_tx_output *) 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx_output *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_elements_output_commitment_free" "', argument " "1"" of type '" "(wally_tx_output)""'");
    }
  }
  {
    result = (int)wally_tx_elements_output_commitment_free(arg1);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_elements_output_init_alloc(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  unsigned char *arg5 = (unsigned char *) 0 ;
  size_t arg6 ;
  unsigned char *arg7 = (unsigned char *) 0 ;
  size_t arg8 ;
  unsigned char *arg9 = (unsigned char *) 0 ;
  size_t arg10 ;
  unsigned char *arg11 = (unsigned char *) 0 ;
  size_t arg12 ;
  struct wally_tx_output **arg13 = (struct wally_tx_output **) 0 ;
  struct wally_tx_output *w13 ;
  PyObject *swig_obj[6] ;
  int result;
  
  {
    w13 = 0; arg13 = (struct wally_tx_output **)&w13;
  }
  if (!SWIG_Python_UnpackTuple(args, "tx_elements_output_init_alloc", 6, 6, swig_obj)) SWIG_fail;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_elements_output_init_alloc" "', argument " "1"" of type '" "(const unsigned char* script, size_t script_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_elements_output_init_alloc" "', argument " "3"" of type '" "(const unsigned char* asset, size_t asset_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[2] == Py_None)
    arg6 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_elements_output_init_alloc" "', argument " "5"" of type '" "(const unsigned char* value, size_t value_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg5 = (unsigned char *) buf;
      arg6 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[3] == Py_None)
    arg8 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[3], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_elements_output_init_alloc" "', argument " "7"" of type '" "(const unsigned char* nonce, size_t nonce_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg7 = (unsigned char *) buf;
      arg8 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[4] == Py_None)
    arg10 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[4], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_elements_output_init_alloc" "', argument " "9"" of type '" "(const unsigned char* surjectionproof, size_t surjectionproof_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg9 = (unsigned char *) buf;
      arg10 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[5] == Py_None)
    arg12 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[5], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_elements_output_init_alloc" "', argument " "11"" of type '" "(const unsigned char* rangeproof, size_t rangeproof_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg11 = (unsigned char *) buf;
      arg12 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_tx_elements_output_init_alloc((unsigned char const *)arg1,arg2,(unsigned char const *)arg3,arg4,(unsigned char const *)arg5,arg6,(unsigned char const *)arg7,arg8,(unsigned char const *)arg9,arg10,(unsigned char const *)arg11,arg12,arg13);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    if (*arg13 != NULL) {
      Py_DecRef(resultobj);
      resultobj = PyCapsule_New(*arg13, "struct wally_tx_output *", destroy_wally_tx_output);
    }
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_add_elements_raw_input(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx *arg1 = (struct wally_tx *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  uint32_t arg4 ;
  uint32_t arg5 ;
  unsigned char *arg6 = (unsigned char *) 0 ;
  size_t arg7 ;
  struct wally_tx_witness_stack *arg8 = (struct wally_tx_witness_stack *) 0 ;
  unsigned char *arg9 = (unsigned char *) 0 ;
  size_t arg10 ;
  unsigned char *arg11 = (unsigned char *) 0 ;
  size_t arg12 ;
  unsigned char *arg13 = (unsigned char *) 0 ;
  size_t arg14 ;
  unsigned char *arg15 = (unsigned char *) 0 ;
  size_t arg16 ;
  unsigned char *arg17 = (unsigned char *) 0 ;
  size_t arg18 ;
  unsigned char *arg19 = (unsigned char *) 0 ;
  size_t arg20 ;
  struct wally_tx_witness_stack *arg21 = (struct wally_tx_witness_stack *) 0 ;
  uint32_t arg22 ;
  unsigned int val4 ;
  int ecode4 = 0 ;
  unsigned int val5 ;
  int ecode5 = 0 ;
  unsigned int val22 ;
  int ecode22 = 0 ;
  PyObject *swig_obj[14] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "tx_add_elements_raw_input", 14, 14, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_add_elements_raw_input" "', argument " "1"" of type '" "(wally_tx)""'");
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg3 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_add_elements_raw_input" "', argument " "2"" of type '" "(const unsigned char* txhash, size_t txhash_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg2 = (unsigned char *) buf;
      arg3 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  ecode4 = SWIG_AsVal_unsigned_SS_int(swig_obj[2], &val4);
  if (!SWIG_IsOK(ecode4)) {
    SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "tx_add_elements_raw_input" "', argument " "4"" of type '" "uint32_t""'");
  } 
  arg4 = (uint32_t)(val4);
  ecode5 = SWIG_AsVal_unsigned_SS_int(swig_obj[3], &val5);
  if (!SWIG_IsOK(ecode5)) {
    SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "tx_add_elements_raw_input" "', argument " "5"" of type '" "uint32_t""'");
  } 
  arg5 = (uint32_t)(val5);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[4] == Py_None)
    arg7 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[4], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_add_elements_raw_input" "', argument " "6"" of type '" "(const unsigned char* script, size_t script_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg6 = (unsigned char *) buf;
      arg7 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    arg8 = swig_obj[5] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[5], "struct wally_tx_witness_stack *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_add_elements_raw_input" "', argument " "8"" of type '" "(wally_tx_witness_stack)""'");
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[6] == Py_None)
    arg10 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[6], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_add_elements_raw_input" "', argument " "9"" of type '" "(const unsigned char* nonce, size_t nonce_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg9 = (unsigned char *) buf;
      arg10 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[7] == Py_None)
    arg12 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[7], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_add_elements_raw_input" "', argument " "11"" of type '" "(const unsigned char* entropy, size_t entropy_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg11 = (unsigned char *) buf;
      arg12 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[8] == Py_None)
    arg14 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[8], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_add_elements_raw_input" "', argument " "13"" of type '" "(const unsigned char* issuance_amount, size_t issuance_amount_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg13 = (unsigned char *) buf;
      arg14 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[9] == Py_None)
    arg16 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[9], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_add_elements_raw_input" "', argument " "15"" of type '" "(const unsigned char* inflation_keys, size_t inflation_keys_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg15 = (unsigned char *) buf;
      arg16 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[10] == Py_None)
    arg18 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[10], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_add_elements_raw_input" "', argument " "17"" of type '" "(const unsigned char* issuance_amount_rangeproof, size_t issuance_amount_rangeproof_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg17 = (unsigned char *) buf;
      arg18 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[11] == Py_None)
    arg20 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[11], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_add_elements_raw_input" "', argument " "19"" of type '" "(const unsigned char* inflation_keys_rangeproof, size_t inflation_keys_rangeproof_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg19 = (unsigned char *) buf;
      arg20 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    arg21 = swig_obj[12] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[12], "struct wally_tx_witness_stack *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_add_elements_raw_input" "', argument " "21"" of type '" "(wally_tx_witness_stack)""'");
    }
  }
  ecode22 = SWIG_AsVal_unsigned_SS_int(swig_obj[13], &val22);
  if (!SWIG_IsOK(ecode22)) {
    SWIG_exception_fail(SWIG_ArgError(ecode22), "in method '" "tx_add_elements_raw_input" "', argument " "22"" of type '" "uint32_t""'");
  } 
  arg22 = (uint32_t)(val22);
  {
    result = (int)wally_tx_add_elements_raw_input(arg1,(unsigned char const *)arg2,arg3,arg4,arg5,(unsigned char const *)arg6,arg7,(struct wally_tx_witness_stack const *)arg8,(unsigned char const *)arg9,arg10,(unsigned char const *)arg11,arg12,(unsigned char const *)arg13,arg14,(unsigned char const *)arg15,arg16,(unsigned char const *)arg17,arg18,(unsigned char const *)arg19,arg20,(struct wally_tx_witness_stack const *)arg21,arg22);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_add_elements_raw_input_at(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx *arg1 = (struct wally_tx *) 0 ;
  uint32_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  uint32_t arg5 ;
  uint32_t arg6 ;
  unsigned char *arg7 = (unsigned char *) 0 ;
  size_t arg8 ;
  struct wally_tx_witness_stack *arg9 = (struct wally_tx_witness_stack *) 0 ;
  unsigned char *arg10 = (unsigned char *) 0 ;
  size_t arg11 ;
  unsigned char *arg12 = (unsigned char *) 0 ;
  size_t arg13 ;
  unsigned char *arg14 = (unsigned char *) 0 ;
  size_t arg15 ;
  unsigned char *arg16 = (unsigned char *) 0 ;
  size_t arg17 ;
  unsigned char *arg18 = (unsigned char *) 0 ;
  size_t arg19 ;
  unsigned char *arg20 = (unsigned char *) 0 ;
  size_t arg21 ;
  struct wally_tx_witness_stack *arg22 = (struct wally_tx_witness_stack *) 0 ;
  uint32_t arg23 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  unsigned int val5 ;
  int ecode5 = 0 ;
  unsigned int val6 ;
  int ecode6 = 0 ;
  unsigned int val23 ;
  int ecode23 = 0 ;
  PyObject *swig_obj[15] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "tx_add_elements_raw_input_at", 15, 15, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_add_elements_raw_input_at" "', argument " "1"" of type '" "(wally_tx)""'");
    }
  }
  ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "tx_add_elements_raw_input_at" "', argument " "2"" of type '" "uint32_t""'");
  } 
  arg2 = (uint32_t)(val2);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[2] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_add_elements_raw_input_at" "', argument " "3"" of type '" "(const unsigned char* txhash, size_t txhash_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  ecode5 = SWIG_AsVal_unsigned_SS_int(swig_obj[3], &val5);
  if (!SWIG_IsOK(ecode5)) {
    SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "tx_add_elements_raw_input_at" "', argument " "5"" of type '" "uint32_t""'");
  } 
  arg5 = (uint32_t)(val5);
  ecode6 = SWIG_AsVal_unsigned_SS_int(swig_obj[4], &val6);
  if (!SWIG_IsOK(ecode6)) {
    SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "tx_add_elements_raw_input_at" "', argument " "6"" of type '" "uint32_t""'");
  } 
  arg6 = (uint32_t)(val6);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[5] == Py_None)
    arg8 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[5], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_add_elements_raw_input_at" "', argument " "7"" of type '" "(const unsigned char* script, size_t script_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg7 = (unsigned char *) buf;
      arg8 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    arg9 = swig_obj[6] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[6], "struct wally_tx_witness_stack *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_add_elements_raw_input_at" "', argument " "9"" of type '" "(wally_tx_witness_stack)""'");
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[7] == Py_None)
    arg11 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[7], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_add_elements_raw_input_at" "', argument " "10"" of type '" "(const unsigned char* nonce, size_t nonce_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg10 = (unsigned char *) buf;
      arg11 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[8] == Py_None)
    arg13 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[8], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_add_elements_raw_input_at" "', argument " "12"" of type '" "(const unsigned char* entropy, size_t entropy_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg12 = (unsigned char *) buf;
      arg13 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[9] == Py_None)
    arg15 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[9], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_add_elements_raw_input_at" "', argument " "14"" of type '" "(const unsigned char* issuance_amount, size_t issuance_amount_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg14 = (unsigned char *) buf;
      arg15 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[10] == Py_None)
    arg17 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[10], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_add_elements_raw_input_at" "', argument " "16"" of type '" "(const unsigned char* inflation_keys, size_t inflation_keys_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg16 = (unsigned char *) buf;
      arg17 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[11] == Py_None)
    arg19 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[11], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_add_elements_raw_input_at" "', argument " "18"" of type '" "(const unsigned char* issuance_amount_rangeproof, size_t issuance_amount_rangeproof_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg18 = (unsigned char *) buf;
      arg19 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[12] == Py_None)
    arg21 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[12], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_add_elements_raw_input_at" "', argument " "20"" of type '" "(const unsigned char* inflation_keys_rangeproof, size_t inflation_keys_rangeproof_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg20 = (unsigned char *) buf;
      arg21 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    arg22 = swig_obj[13] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[13], "struct wally_tx_witness_stack *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_add_elements_raw_input_at" "', argument " "22"" of type '" "(wally_tx_witness_stack)""'");
    }
  }
  ecode23 = SWIG_AsVal_unsigned_SS_int(swig_obj[14], &val23);
  if (!SWIG_IsOK(ecode23)) {
    SWIG_exception_fail(SWIG_ArgError(ecode23), "in method '" "tx_add_elements_raw_input_at" "', argument " "23"" of type '" "uint32_t""'");
  } 
  arg23 = (uint32_t)(val23);
  {
    result = (int)wally_tx_add_elements_raw_input_at(arg1,arg2,(unsigned char const *)arg3,arg4,arg5,arg6,(unsigned char const *)arg7,arg8,(struct wally_tx_witness_stack const *)arg9,(unsigned char const *)arg10,arg11,(unsigned char const *)arg12,arg13,(unsigned char const *)arg14,arg15,(unsigned char const *)arg16,arg17,(unsigned char const *)arg18,arg19,(unsigned char const *)arg20,arg21,(struct wally_tx_witness_stack const *)arg22,arg23);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_add_elements_raw_output(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx *arg1 = (struct wally_tx *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  unsigned char *arg4 = (unsigned char *) 0 ;
  size_t arg5 ;
  unsigned char *arg6 = (unsigned char *) 0 ;
  size_t arg7 ;
  unsigned char *arg8 = (unsigned char *) 0 ;
  size_t arg9 ;
  unsigned char *arg10 = (unsigned char *) 0 ;
  size_t arg11 ;
  unsigned char *arg12 = (unsigned char *) 0 ;
  size_t arg13 ;
  uint32_t arg14 ;
  unsigned int val14 ;
  int ecode14 = 0 ;
  PyObject *swig_obj[8] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "tx_add_elements_raw_output", 8, 8, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_add_elements_raw_output" "', argument " "1"" of type '" "(wally_tx)""'");
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg3 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_add_elements_raw_output" "', argument " "2"" of type '" "(const unsigned char* script, size_t script_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg2 = (unsigned char *) buf;
      arg3 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[2] == Py_None)
    arg5 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_add_elements_raw_output" "', argument " "4"" of type '" "(const unsigned char* asset, size_t asset_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg4 = (unsigned char *) buf;
      arg5 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[3] == Py_None)
    arg7 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[3], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_add_elements_raw_output" "', argument " "6"" of type '" "(const unsigned char* value, size_t value_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg6 = (unsigned char *) buf;
      arg7 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[4] == Py_None)
    arg9 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[4], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_add_elements_raw_output" "', argument " "8"" of type '" "(const unsigned char* nonce, size_t nonce_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg8 = (unsigned char *) buf;
      arg9 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[5] == Py_None)
    arg11 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[5], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_add_elements_raw_output" "', argument " "10"" of type '" "(const unsigned char* surjectionproof, size_t surjectionproof_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg10 = (unsigned char *) buf;
      arg11 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[6] == Py_None)
    arg13 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[6], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_add_elements_raw_output" "', argument " "12"" of type '" "(const unsigned char* rangeproof, size_t rangeproof_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg12 = (unsigned char *) buf;
      arg13 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  ecode14 = SWIG_AsVal_unsigned_SS_int(swig_obj[7], &val14);
  if (!SWIG_IsOK(ecode14)) {
    SWIG_exception_fail(SWIG_ArgError(ecode14), "in method '" "tx_add_elements_raw_output" "', argument " "14"" of type '" "uint32_t""'");
  } 
  arg14 = (uint32_t)(val14);
  {
    result = (int)wally_tx_add_elements_raw_output(arg1,(unsigned char const *)arg2,arg3,(unsigned char const *)arg4,arg5,(unsigned char const *)arg6,arg7,(unsigned char const *)arg8,arg9,(unsigned char const *)arg10,arg11,(unsigned char const *)arg12,arg13,arg14);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_add_elements_raw_output_at(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx *arg1 = (struct wally_tx *) 0 ;
  uint32_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  unsigned char *arg5 = (unsigned char *) 0 ;
  size_t arg6 ;
  unsigned char *arg7 = (unsigned char *) 0 ;
  size_t arg8 ;
  unsigned char *arg9 = (unsigned char *) 0 ;
  size_t arg10 ;
  unsigned char *arg11 = (unsigned char *) 0 ;
  size_t arg12 ;
  unsigned char *arg13 = (unsigned char *) 0 ;
  size_t arg14 ;
  uint32_t arg15 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  unsigned int val15 ;
  int ecode15 = 0 ;
  PyObject *swig_obj[9] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "tx_add_elements_raw_output_at", 9, 9, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_add_elements_raw_output_at" "', argument " "1"" of type '" "(wally_tx)""'");
    }
  }
  ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "tx_add_elements_raw_output_at" "', argument " "2"" of type '" "uint32_t""'");
  } 
  arg2 = (uint32_t)(val2);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[2] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_add_elements_raw_output_at" "', argument " "3"" of type '" "(const unsigned char* script, size_t script_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[3] == Py_None)
    arg6 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[3], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_add_elements_raw_output_at" "', argument " "5"" of type '" "(const unsigned char* asset, size_t asset_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg5 = (unsigned char *) buf;
      arg6 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[4] == Py_None)
    arg8 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[4], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_add_elements_raw_output_at" "', argument " "7"" of type '" "(const unsigned char* value, size_t value_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg7 = (unsigned char *) buf;
      arg8 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[5] == Py_None)
    arg10 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[5], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_add_elements_raw_output_at" "', argument " "9"" of type '" "(const unsigned char* nonce, size_t nonce_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg9 = (unsigned char *) buf;
      arg10 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[6] == Py_None)
    arg12 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[6], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_add_elements_raw_output_at" "', argument " "11"" of type '" "(const unsigned char* surjectionproof, size_t surjectionproof_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg11 = (unsigned char *) buf;
      arg12 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[7] == Py_None)
    arg14 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[7], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_add_elements_raw_output_at" "', argument " "13"" of type '" "(const unsigned char* rangeproof, size_t rangeproof_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg13 = (unsigned char *) buf;
      arg14 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  ecode15 = SWIG_AsVal_unsigned_SS_int(swig_obj[8], &val15);
  if (!SWIG_IsOK(ecode15)) {
    SWIG_exception_fail(SWIG_ArgError(ecode15), "in method '" "tx_add_elements_raw_output_at" "', argument " "15"" of type '" "uint32_t""'");
  } 
  arg15 = (uint32_t)(val15);
  {
    result = (int)wally_tx_add_elements_raw_output_at(arg1,arg2,(unsigned char const *)arg3,arg4,(unsigned char const *)arg5,arg6,(unsigned char const *)arg7,arg8,(unsigned char const *)arg9,arg10,(unsigned char const *)arg11,arg12,(unsigned char const *)arg13,arg14,arg15);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_is_elements(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx *arg1 = (struct wally_tx *) 0 ;
  size_t *arg2 = (size_t *) 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  size_t written = 0; arg2 = (size_t *)&written;
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_is_elements" "', argument " "1"" of type '" "(wally_tx)""'");
    }
  }
  {
    result = (int)wally_tx_is_elements((struct wally_tx const *)arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg2);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_confidential_value_from_satoshi(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  uint64_t arg1 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  unsigned long long val1 ;
  int ecode1 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "tx_confidential_value_from_satoshi", 2, 2, swig_obj)) SWIG_fail;
  ecode1 = SWIG_AsVal_unsigned_SS_long_SS_long(swig_obj[0], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "tx_confidential_value_from_satoshi" "', argument " "1"" of type '" "uint64_t""'");
  } 
  arg1 = (uint64_t)(val1);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_confidential_value_from_satoshi" "', argument " "2"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg2 = (unsigned char *) buf;
    arg3 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_tx_confidential_value_from_satoshi(arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_confidential_value_to_satoshi(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  uint64_t *arg3 = (uint64_t *) 0 ;
  uint64_t val3 ;
  PyObject *swig_obj[1] ;
  int result;
  
  {
    val3 = 0; arg3 = (uint64_t *)&val3;
  }
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_confidential_value_to_satoshi" "', argument " "1"" of type '" "(const unsigned char* value, size_t value_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_tx_confidential_value_to_satoshi((unsigned char const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyLong_FromUnsignedLongLong(*arg3);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_get_elements_signature_hash(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx *arg1 = (struct wally_tx *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  unsigned char *arg5 = (unsigned char *) 0 ;
  size_t arg6 ;
  uint32_t arg7 ;
  uint32_t arg8 ;
  unsigned char *arg9 = (unsigned char *) 0 ;
  size_t arg10 ;
  size_t val2 ;
  int ecode2 = 0 ;
  unsigned int val7 ;
  int ecode7 = 0 ;
  unsigned int val8 ;
  int ecode8 = 0 ;
  PyObject *swig_obj[7] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "tx_get_elements_signature_hash", 7, 7, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_get_elements_signature_hash" "', argument " "1"" of type '" "(wally_tx)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "tx_get_elements_signature_hash" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[2] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_get_elements_signature_hash" "', argument " "3"" of type '" "(const unsigned char* script, size_t script_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[3] == Py_None)
    arg6 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[3], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_get_elements_signature_hash" "', argument " "5"" of type '" "(const unsigned char* value, size_t value_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg5 = (unsigned char *) buf;
      arg6 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  ecode7 = SWIG_AsVal_unsigned_SS_int(swig_obj[4], &val7);
  if (!SWIG_IsOK(ecode7)) {
    SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "tx_get_elements_signature_hash" "', argument " "7"" of type '" "uint32_t""'");
  } 
  arg7 = (uint32_t)(val7);
  ecode8 = SWIG_AsVal_unsigned_SS_int(swig_obj[5], &val8);
  if (!SWIG_IsOK(ecode8)) {
    SWIG_exception_fail(SWIG_ArgError(ecode8), "in method '" "tx_get_elements_signature_hash" "', argument " "8"" of type '" "uint32_t""'");
  } 
  arg8 = (uint32_t)(val8);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[6], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_get_elements_signature_hash" "', argument " "9"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg9 = (unsigned char *) buf;
    arg10 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_tx_get_elements_signature_hash((struct wally_tx const *)arg1,arg2,(unsigned char const *)arg3,arg4,(unsigned char const *)arg5,arg6,arg7,arg8,arg9,arg10);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_elements_issuance_generate_entropy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  uint32_t arg3 ;
  unsigned char *arg4 = (unsigned char *) 0 ;
  size_t arg5 ;
  unsigned char *arg6 = (unsigned char *) 0 ;
  size_t arg7 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  PyObject *swig_obj[4] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "tx_elements_issuance_generate_entropy", 4, 4, swig_obj)) SWIG_fail;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_elements_issuance_generate_entropy" "', argument " "1"" of type '" "(const unsigned char* txhash, size_t txhash_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  ecode3 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "tx_elements_issuance_generate_entropy" "', argument " "3"" of type '" "uint32_t""'");
  } 
  arg3 = (uint32_t)(val3);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[2] == Py_None)
    arg5 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_elements_issuance_generate_entropy" "', argument " "4"" of type '" "(const unsigned char* contract_hash, size_t contract_hash_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg4 = (unsigned char *) buf;
      arg5 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[3], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_elements_issuance_generate_entropy" "', argument " "6"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg6 = (unsigned char *) buf;
    arg7 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_tx_elements_issuance_generate_entropy((unsigned char const *)arg1,arg2,arg3,(unsigned char const *)arg4,arg5,arg6,arg7);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_elements_issuance_calculate_asset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "tx_elements_issuance_calculate_asset", 2, 2, swig_obj)) SWIG_fail;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_elements_issuance_calculate_asset" "', argument " "1"" of type '" "(const unsigned char* entropy, size_t entropy_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_elements_issuance_calculate_asset" "', argument " "3"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg3 = (unsigned char *) buf;
    arg4 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_tx_elements_issuance_calculate_asset((unsigned char const *)arg1,arg2,arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_elements_issuance_calculate_reissuance_token(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  uint32_t arg3 ;
  unsigned char *arg4 = (unsigned char *) 0 ;
  size_t arg5 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "tx_elements_issuance_calculate_reissuance_token", 3, 3, swig_obj)) SWIG_fail;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_elements_issuance_calculate_reissuance_token" "', argument " "1"" of type '" "(const unsigned char* entropy, size_t entropy_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  ecode3 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "tx_elements_issuance_calculate_reissuance_token" "', argument " "3"" of type '" "uint32_t""'");
  } 
  arg3 = (uint32_t)(val3);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_elements_issuance_calculate_reissuance_token" "', argument " "4"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg4 = (unsigned char *) buf;
    arg5 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_tx_elements_issuance_calculate_reissuance_token((unsigned char const *)arg1,arg2,arg3,arg4,arg5);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_input_get_txhash(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx_input *arg1 = (struct wally_tx_input *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "tx_input_get_txhash", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx_input *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_input_get_txhash" "', argument " "1"" of type '" "(wally_tx_input)""'");
    }
  }
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_input_get_txhash" "', argument " "2"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg2 = (unsigned char *) buf;
    arg3 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_tx_input_get_txhash((struct wally_tx_input const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_input_get_script(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx_input *arg1 = (struct wally_tx_input *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  size_t *arg4 = (size_t *) 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg4 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "tx_input_get_script", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx_input *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_input_get_script" "', argument " "1"" of type '" "(wally_tx_input)""'");
    }
  }
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_input_get_script" "', argument " "2"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg2 = (unsigned char *) buf;
    arg3 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_tx_input_get_script((struct wally_tx_input const *)arg1,arg2,arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg4);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_input_get_script_len(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx_input *arg1 = (struct wally_tx_input *) 0 ;
  size_t *arg2 = (size_t *) 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  size_t written = 0; arg2 = (size_t *)&written;
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx_input *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_input_get_script_len" "', argument " "1"" of type '" "(wally_tx_input)""'");
    }
  }
  {
    result = (int)wally_tx_input_get_script_len((struct wally_tx_input const *)arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg2);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_input_get_witness_num_items(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx_input *arg1 = (struct wally_tx_input *) 0 ;
  size_t *arg2 = (size_t *) 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  size_t written = 0; arg2 = (size_t *)&written;
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx_input *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_input_get_witness_num_items" "', argument " "1"" of type '" "(wally_tx_input)""'");
    }
  }
  {
    result = (int)wally_tx_input_get_witness_num_items((struct wally_tx_input const *)arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg2);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_input_get_witness(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx_input *arg1 = (struct wally_tx_input *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t *arg5 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  size_t written = 0; arg5 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "tx_input_get_witness", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx_input *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_input_get_witness" "', argument " "1"" of type '" "(wally_tx_input)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "tx_input_get_witness" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_input_get_witness" "', argument " "3"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg3 = (unsigned char *) buf;
    arg4 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_tx_input_get_witness((struct wally_tx_input const *)arg1,arg2,arg3,arg4,arg5);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg5);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_input_get_witness_len(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx_input *arg1 = (struct wally_tx_input *) 0 ;
  size_t arg2 ;
  size_t *arg3 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg3 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "tx_input_get_witness_len", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx_input *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_input_get_witness_len" "', argument " "1"" of type '" "(wally_tx_input)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "tx_input_get_witness_len" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_tx_input_get_witness_len((struct wally_tx_input const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg3);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_input_get_index(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx_input *arg1 = (struct wally_tx_input *) 0 ;
  size_t *arg2 = (size_t *) 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  size_t written = 0; arg2 = (size_t *)&written;
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx_input *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_input_get_index" "', argument " "1"" of type '" "(wally_tx_input)""'");
    }
  }
  {
    result = (int)wally_tx_input_get_index((struct wally_tx_input const *)arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg2);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_input_get_sequence(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx_input *arg1 = (struct wally_tx_input *) 0 ;
  size_t *arg2 = (size_t *) 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  size_t written = 0; arg2 = (size_t *)&written;
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx_input *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_input_get_sequence" "', argument " "1"" of type '" "(wally_tx_input)""'");
    }
  }
  {
    result = (int)wally_tx_input_get_sequence((struct wally_tx_input const *)arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg2);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_input_set_txhash(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx_input *arg1 = (struct wally_tx_input *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "tx_input_set_txhash", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx_input *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_input_set_txhash" "', argument " "1"" of type '" "(wally_tx_input)""'");
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg3 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_input_set_txhash" "', argument " "2"" of type '" "(const unsigned char* txhash, size_t txhash_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg2 = (unsigned char *) buf;
      arg3 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_tx_input_set_txhash(arg1,(unsigned char const *)arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_input_set_script(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx_input *arg1 = (struct wally_tx_input *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "tx_input_set_script", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx_input *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_input_set_script" "', argument " "1"" of type '" "(wally_tx_input)""'");
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg3 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_input_set_script" "', argument " "2"" of type '" "(const unsigned char* script, size_t script_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg2 = (unsigned char *) buf;
      arg3 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_tx_input_set_script(arg1,(unsigned char const *)arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_input_set_witness(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx_input *arg1 = (struct wally_tx_input *) 0 ;
  struct wally_tx_witness_stack *arg2 = (struct wally_tx_witness_stack *) 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "tx_input_set_witness", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx_input *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_input_set_witness" "', argument " "1"" of type '" "(wally_tx_input)""'");
    }
  }
  {
    arg2 = swig_obj[1] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[1], "struct wally_tx_witness_stack *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_input_set_witness" "', argument " "2"" of type '" "(wally_tx_witness_stack)""'");
    }
  }
  {
    result = (int)wally_tx_input_set_witness(arg1,(struct wally_tx_witness_stack const *)arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_input_set_index(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx_input *arg1 = (struct wally_tx_input *) 0 ;
  uint32_t arg2 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "tx_input_set_index", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx_input *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_input_set_index" "', argument " "1"" of type '" "(wally_tx_input)""'");
    }
  }
  ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "tx_input_set_index" "', argument " "2"" of type '" "uint32_t""'");
  } 
  arg2 = (uint32_t)(val2);
  {
    result = (int)wally_tx_input_set_index(arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_input_set_sequence(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx_input *arg1 = (struct wally_tx_input *) 0 ;
  uint32_t arg2 ;
  unsigned int val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "tx_input_set_sequence", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx_input *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_input_set_sequence" "', argument " "1"" of type '" "(wally_tx_input)""'");
    }
  }
  ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "tx_input_set_sequence" "', argument " "2"" of type '" "uint32_t""'");
  } 
  arg2 = (uint32_t)(val2);
  {
    result = (int)wally_tx_input_set_sequence(arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_input_get_blinding_nonce(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx_input *arg1 = (struct wally_tx_input *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "tx_input_get_blinding_nonce", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx_input *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_input_get_blinding_nonce" "', argument " "1"" of type '" "(wally_tx_input)""'");
    }
  }
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_input_get_blinding_nonce" "', argument " "2"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg2 = (unsigned char *) buf;
    arg3 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_tx_input_get_blinding_nonce((struct wally_tx_input const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_input_get_entropy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx_input *arg1 = (struct wally_tx_input *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "tx_input_get_entropy", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx_input *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_input_get_entropy" "', argument " "1"" of type '" "(wally_tx_input)""'");
    }
  }
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_input_get_entropy" "', argument " "2"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg2 = (unsigned char *) buf;
    arg3 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_tx_input_get_entropy((struct wally_tx_input const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_input_get_issuance_amount(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx_input *arg1 = (struct wally_tx_input *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  size_t *arg4 = (size_t *) 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg4 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "tx_input_get_issuance_amount", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx_input *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_input_get_issuance_amount" "', argument " "1"" of type '" "(wally_tx_input)""'");
    }
  }
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_input_get_issuance_amount" "', argument " "2"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg2 = (unsigned char *) buf;
    arg3 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_tx_input_get_issuance_amount((struct wally_tx_input const *)arg1,arg2,arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg4);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_input_get_issuance_amount_len(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx_input *arg1 = (struct wally_tx_input *) 0 ;
  size_t *arg2 = (size_t *) 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  size_t written = 0; arg2 = (size_t *)&written;
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx_input *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_input_get_issuance_amount_len" "', argument " "1"" of type '" "(wally_tx_input)""'");
    }
  }
  {
    result = (int)wally_tx_input_get_issuance_amount_len((struct wally_tx_input const *)arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg2);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_input_get_inflation_keys(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx_input *arg1 = (struct wally_tx_input *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  size_t *arg4 = (size_t *) 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg4 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "tx_input_get_inflation_keys", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx_input *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_input_get_inflation_keys" "', argument " "1"" of type '" "(wally_tx_input)""'");
    }
  }
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_input_get_inflation_keys" "', argument " "2"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg2 = (unsigned char *) buf;
    arg3 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_tx_input_get_inflation_keys((struct wally_tx_input const *)arg1,arg2,arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg4);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_input_get_inflation_keys_len(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx_input *arg1 = (struct wally_tx_input *) 0 ;
  size_t *arg2 = (size_t *) 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  size_t written = 0; arg2 = (size_t *)&written;
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx_input *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_input_get_inflation_keys_len" "', argument " "1"" of type '" "(wally_tx_input)""'");
    }
  }
  {
    result = (int)wally_tx_input_get_inflation_keys_len((struct wally_tx_input const *)arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg2);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_input_get_issuance_amount_rangeproof(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx_input *arg1 = (struct wally_tx_input *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  size_t *arg4 = (size_t *) 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg4 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "tx_input_get_issuance_amount_rangeproof", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx_input *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_input_get_issuance_amount_rangeproof" "', argument " "1"" of type '" "(wally_tx_input)""'");
    }
  }
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_input_get_issuance_amount_rangeproof" "', argument " "2"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg2 = (unsigned char *) buf;
    arg3 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_tx_input_get_issuance_amount_rangeproof((struct wally_tx_input const *)arg1,arg2,arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg4);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_input_get_issuance_amount_rangeproof_len(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx_input *arg1 = (struct wally_tx_input *) 0 ;
  size_t *arg2 = (size_t *) 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  size_t written = 0; arg2 = (size_t *)&written;
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx_input *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_input_get_issuance_amount_rangeproof_len" "', argument " "1"" of type '" "(wally_tx_input)""'");
    }
  }
  {
    result = (int)wally_tx_input_get_issuance_amount_rangeproof_len((struct wally_tx_input const *)arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg2);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_input_get_inflation_keys_rangeproof(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx_input *arg1 = (struct wally_tx_input *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  size_t *arg4 = (size_t *) 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg4 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "tx_input_get_inflation_keys_rangeproof", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx_input *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_input_get_inflation_keys_rangeproof" "', argument " "1"" of type '" "(wally_tx_input)""'");
    }
  }
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_input_get_inflation_keys_rangeproof" "', argument " "2"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg2 = (unsigned char *) buf;
    arg3 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_tx_input_get_inflation_keys_rangeproof((struct wally_tx_input const *)arg1,arg2,arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg4);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_input_get_inflation_keys_rangeproof_len(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx_input *arg1 = (struct wally_tx_input *) 0 ;
  size_t *arg2 = (size_t *) 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  size_t written = 0; arg2 = (size_t *)&written;
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx_input *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_input_get_inflation_keys_rangeproof_len" "', argument " "1"" of type '" "(wally_tx_input)""'");
    }
  }
  {
    result = (int)wally_tx_input_get_inflation_keys_rangeproof_len((struct wally_tx_input const *)arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg2);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_input_set_blinding_nonce(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx_input *arg1 = (struct wally_tx_input *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "tx_input_set_blinding_nonce", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx_input *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_input_set_blinding_nonce" "', argument " "1"" of type '" "(wally_tx_input)""'");
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg3 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_input_set_blinding_nonce" "', argument " "2"" of type '" "(const unsigned char* blinding_nonce, size_t blinding_nonce_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg2 = (unsigned char *) buf;
      arg3 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_tx_input_set_blinding_nonce(arg1,(unsigned char const *)arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_input_set_entropy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx_input *arg1 = (struct wally_tx_input *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "tx_input_set_entropy", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx_input *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_input_set_entropy" "', argument " "1"" of type '" "(wally_tx_input)""'");
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg3 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_input_set_entropy" "', argument " "2"" of type '" "(const unsigned char* entropy, size_t entropy_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg2 = (unsigned char *) buf;
      arg3 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_tx_input_set_entropy(arg1,(unsigned char const *)arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_input_set_inflation_keys(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx_input *arg1 = (struct wally_tx_input *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "tx_input_set_inflation_keys", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx_input *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_input_set_inflation_keys" "', argument " "1"" of type '" "(wally_tx_input)""'");
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg3 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_input_set_inflation_keys" "', argument " "2"" of type '" "(const unsigned char* inflation_keys, size_t inflation_keys_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg2 = (unsigned char *) buf;
      arg3 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_tx_input_set_inflation_keys(arg1,(unsigned char const *)arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_input_set_inflation_keys_rangeproof(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx_input *arg1 = (struct wally_tx_input *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "tx_input_set_inflation_keys_rangeproof", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx_input *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_input_set_inflation_keys_rangeproof" "', argument " "1"" of type '" "(wally_tx_input)""'");
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg3 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_input_set_inflation_keys_rangeproof" "', argument " "2"" of type '" "(const unsigned char* inflation_keys_rangeproof, size_t inflation_keys_rangeproof_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg2 = (unsigned char *) buf;
      arg3 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_tx_input_set_inflation_keys_rangeproof(arg1,(unsigned char const *)arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_input_set_issuance_amount(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx_input *arg1 = (struct wally_tx_input *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "tx_input_set_issuance_amount", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx_input *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_input_set_issuance_amount" "', argument " "1"" of type '" "(wally_tx_input)""'");
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg3 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_input_set_issuance_amount" "', argument " "2"" of type '" "(const unsigned char* issuance_amount, size_t issuance_amount_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg2 = (unsigned char *) buf;
      arg3 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_tx_input_set_issuance_amount(arg1,(unsigned char const *)arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_input_set_issuance_amount_rangeproof(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx_input *arg1 = (struct wally_tx_input *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "tx_input_set_issuance_amount_rangeproof", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx_input *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_input_set_issuance_amount_rangeproof" "', argument " "1"" of type '" "(wally_tx_input)""'");
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg3 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_input_set_issuance_amount_rangeproof" "', argument " "2"" of type '" "(const unsigned char* issuance_amount_rangeproof, size_t issuance_amount_rangeproof_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg2 = (unsigned char *) buf;
      arg3 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_tx_input_set_issuance_amount_rangeproof(arg1,(unsigned char const *)arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_output_get_script(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx_output *arg1 = (struct wally_tx_output *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  size_t *arg4 = (size_t *) 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg4 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "tx_output_get_script", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx_output *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_output_get_script" "', argument " "1"" of type '" "(wally_tx_output)""'");
    }
  }
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_output_get_script" "', argument " "2"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg2 = (unsigned char *) buf;
    arg3 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_tx_output_get_script((struct wally_tx_output const *)arg1,arg2,arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg4);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_output_get_script_len(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx_output *arg1 = (struct wally_tx_output *) 0 ;
  size_t *arg2 = (size_t *) 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  size_t written = 0; arg2 = (size_t *)&written;
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx_output *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_output_get_script_len" "', argument " "1"" of type '" "(wally_tx_output)""'");
    }
  }
  {
    result = (int)wally_tx_output_get_script_len((struct wally_tx_output const *)arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg2);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_output_get_satoshi(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx_output *arg1 = (struct wally_tx_output *) 0 ;
  uint64_t *arg2 = (uint64_t *) 0 ;
  uint64_t val2 ;
  PyObject *swig_obj[1] ;
  int result;
  
  {
    val2 = 0; arg2 = (uint64_t *)&val2;
  }
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx_output *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_output_get_satoshi" "', argument " "1"" of type '" "(wally_tx_output)""'");
    }
  }
  {
    result = (int)wally_tx_output_get_satoshi((struct wally_tx_output const *)arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyLong_FromUnsignedLongLong(*arg2);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_output_set_script(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx_output *arg1 = (struct wally_tx_output *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "tx_output_set_script", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx_output *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_output_set_script" "', argument " "1"" of type '" "(wally_tx_output)""'");
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg3 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_output_set_script" "', argument " "2"" of type '" "(const unsigned char* script, size_t script_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg2 = (unsigned char *) buf;
      arg3 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_tx_output_set_script(arg1,(unsigned char const *)arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_output_set_satoshi(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx_output *arg1 = (struct wally_tx_output *) 0 ;
  uint64_t arg2 ;
  unsigned long long val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "tx_output_set_satoshi", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx_output *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_output_set_satoshi" "', argument " "1"" of type '" "(wally_tx_output)""'");
    }
  }
  ecode2 = SWIG_AsVal_unsigned_SS_long_SS_long(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "tx_output_set_satoshi" "', argument " "2"" of type '" "uint64_t""'");
  } 
  arg2 = (uint64_t)(val2);
  {
    result = (int)wally_tx_output_set_satoshi(arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_output_get_asset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx_output *arg1 = (struct wally_tx_output *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "tx_output_get_asset", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx_output *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_output_get_asset" "', argument " "1"" of type '" "(wally_tx_output)""'");
    }
  }
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_output_get_asset" "', argument " "2"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg2 = (unsigned char *) buf;
    arg3 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_tx_output_get_asset((struct wally_tx_output const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_output_get_asset_len(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx_output *arg1 = (struct wally_tx_output *) 0 ;
  size_t *arg2 = (size_t *) 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  size_t written = 0; arg2 = (size_t *)&written;
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx_output *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_output_get_asset_len" "', argument " "1"" of type '" "(wally_tx_output)""'");
    }
  }
  {
    result = (int)wally_tx_output_get_asset_len((struct wally_tx_output const *)arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg2);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_output_get_value(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx_output *arg1 = (struct wally_tx_output *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  size_t *arg4 = (size_t *) 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg4 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "tx_output_get_value", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx_output *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_output_get_value" "', argument " "1"" of type '" "(wally_tx_output)""'");
    }
  }
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_output_get_value" "', argument " "2"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg2 = (unsigned char *) buf;
    arg3 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_tx_output_get_value((struct wally_tx_output const *)arg1,arg2,arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg4);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_output_get_value_len(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx_output *arg1 = (struct wally_tx_output *) 0 ;
  size_t *arg2 = (size_t *) 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  size_t written = 0; arg2 = (size_t *)&written;
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx_output *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_output_get_value_len" "', argument " "1"" of type '" "(wally_tx_output)""'");
    }
  }
  {
    result = (int)wally_tx_output_get_value_len((struct wally_tx_output const *)arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg2);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_output_get_nonce(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx_output *arg1 = (struct wally_tx_output *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "tx_output_get_nonce", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx_output *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_output_get_nonce" "', argument " "1"" of type '" "(wally_tx_output)""'");
    }
  }
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_output_get_nonce" "', argument " "2"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg2 = (unsigned char *) buf;
    arg3 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_tx_output_get_nonce((struct wally_tx_output const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_output_get_nonce_len(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx_output *arg1 = (struct wally_tx_output *) 0 ;
  size_t *arg2 = (size_t *) 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  size_t written = 0; arg2 = (size_t *)&written;
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx_output *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_output_get_nonce_len" "', argument " "1"" of type '" "(wally_tx_output)""'");
    }
  }
  {
    result = (int)wally_tx_output_get_nonce_len((struct wally_tx_output const *)arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg2);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_output_get_surjectionproof(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx_output *arg1 = (struct wally_tx_output *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  size_t *arg4 = (size_t *) 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg4 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "tx_output_get_surjectionproof", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx_output *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_output_get_surjectionproof" "', argument " "1"" of type '" "(wally_tx_output)""'");
    }
  }
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_output_get_surjectionproof" "', argument " "2"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg2 = (unsigned char *) buf;
    arg3 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_tx_output_get_surjectionproof((struct wally_tx_output const *)arg1,arg2,arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg4);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_output_get_surjectionproof_len(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx_output *arg1 = (struct wally_tx_output *) 0 ;
  size_t *arg2 = (size_t *) 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  size_t written = 0; arg2 = (size_t *)&written;
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx_output *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_output_get_surjectionproof_len" "', argument " "1"" of type '" "(wally_tx_output)""'");
    }
  }
  {
    result = (int)wally_tx_output_get_surjectionproof_len((struct wally_tx_output const *)arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg2);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_output_get_rangeproof(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx_output *arg1 = (struct wally_tx_output *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  size_t *arg4 = (size_t *) 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg4 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "tx_output_get_rangeproof", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx_output *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_output_get_rangeproof" "', argument " "1"" of type '" "(wally_tx_output)""'");
    }
  }
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_output_get_rangeproof" "', argument " "2"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg2 = (unsigned char *) buf;
    arg3 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_tx_output_get_rangeproof((struct wally_tx_output const *)arg1,arg2,arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg4);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_output_get_rangeproof_len(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx_output *arg1 = (struct wally_tx_output *) 0 ;
  size_t *arg2 = (size_t *) 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  size_t written = 0; arg2 = (size_t *)&written;
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx_output *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_output_get_rangeproof_len" "', argument " "1"" of type '" "(wally_tx_output)""'");
    }
  }
  {
    result = (int)wally_tx_output_get_rangeproof_len((struct wally_tx_output const *)arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg2);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_output_set_asset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx_output *arg1 = (struct wally_tx_output *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "tx_output_set_asset", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx_output *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_output_set_asset" "', argument " "1"" of type '" "(wally_tx_output)""'");
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg3 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_output_set_asset" "', argument " "2"" of type '" "(const unsigned char* asset, size_t asset_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg2 = (unsigned char *) buf;
      arg3 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_tx_output_set_asset(arg1,(unsigned char const *)arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_output_set_value(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx_output *arg1 = (struct wally_tx_output *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "tx_output_set_value", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx_output *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_output_set_value" "', argument " "1"" of type '" "(wally_tx_output)""'");
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg3 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_output_set_value" "', argument " "2"" of type '" "(const unsigned char* value, size_t value_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg2 = (unsigned char *) buf;
      arg3 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_tx_output_set_value(arg1,(unsigned char const *)arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_output_set_nonce(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx_output *arg1 = (struct wally_tx_output *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "tx_output_set_nonce", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx_output *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_output_set_nonce" "', argument " "1"" of type '" "(wally_tx_output)""'");
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg3 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_output_set_nonce" "', argument " "2"" of type '" "(const unsigned char* nonce, size_t nonce_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg2 = (unsigned char *) buf;
      arg3 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_tx_output_set_nonce(arg1,(unsigned char const *)arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_output_set_surjectionproof(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx_output *arg1 = (struct wally_tx_output *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "tx_output_set_surjectionproof", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx_output *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_output_set_surjectionproof" "', argument " "1"" of type '" "(wally_tx_output)""'");
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg3 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_output_set_surjectionproof" "', argument " "2"" of type '" "(const unsigned char* surjectionproof, size_t surjectionproof_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg2 = (unsigned char *) buf;
      arg3 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_tx_output_set_surjectionproof(arg1,(unsigned char const *)arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_output_set_rangeproof(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx_output *arg1 = (struct wally_tx_output *) 0 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "tx_output_set_rangeproof", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx_output *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_output_set_rangeproof" "', argument " "1"" of type '" "(wally_tx_output)""'");
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg3 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_output_set_rangeproof" "', argument " "2"" of type '" "(const unsigned char* rangeproof, size_t rangeproof_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg2 = (unsigned char *) buf;
      arg3 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_tx_output_set_rangeproof(arg1,(unsigned char const *)arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_get_version(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx *arg1 = (struct wally_tx *) 0 ;
  size_t *arg2 = (size_t *) 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  size_t written = 0; arg2 = (size_t *)&written;
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_get_version" "', argument " "1"" of type '" "(wally_tx)""'");
    }
  }
  {
    result = (int)wally_tx_get_version((struct wally_tx const *)arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg2);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_get_locktime(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx *arg1 = (struct wally_tx *) 0 ;
  size_t *arg2 = (size_t *) 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  size_t written = 0; arg2 = (size_t *)&written;
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_get_locktime" "', argument " "1"" of type '" "(wally_tx)""'");
    }
  }
  {
    result = (int)wally_tx_get_locktime((struct wally_tx const *)arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg2);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_get_num_inputs(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx *arg1 = (struct wally_tx *) 0 ;
  size_t *arg2 = (size_t *) 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  size_t written = 0; arg2 = (size_t *)&written;
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_get_num_inputs" "', argument " "1"" of type '" "(wally_tx)""'");
    }
  }
  {
    result = (int)wally_tx_get_num_inputs((struct wally_tx const *)arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg2);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_get_num_outputs(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx *arg1 = (struct wally_tx *) 0 ;
  size_t *arg2 = (size_t *) 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  size_t written = 0; arg2 = (size_t *)&written;
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_get_num_outputs" "', argument " "1"" of type '" "(wally_tx)""'");
    }
  }
  {
    result = (int)wally_tx_get_num_outputs((struct wally_tx const *)arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg2);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_get_input_txhash(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx *arg1 = (struct wally_tx *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "tx_get_input_txhash", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_get_input_txhash" "', argument " "1"" of type '" "(wally_tx)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "tx_get_input_txhash" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_get_input_txhash" "', argument " "3"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg3 = (unsigned char *) buf;
    arg4 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_tx_get_input_txhash((struct wally_tx const *)arg1,arg2,arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_get_input_script(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx *arg1 = (struct wally_tx *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t *arg5 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  size_t written = 0; arg5 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "tx_get_input_script", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_get_input_script" "', argument " "1"" of type '" "(wally_tx)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "tx_get_input_script" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_get_input_script" "', argument " "3"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg3 = (unsigned char *) buf;
    arg4 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_tx_get_input_script((struct wally_tx const *)arg1,arg2,arg3,arg4,arg5);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg5);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_get_input_script_len(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx *arg1 = (struct wally_tx *) 0 ;
  size_t arg2 ;
  size_t *arg3 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg3 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "tx_get_input_script_len", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_get_input_script_len" "', argument " "1"" of type '" "(wally_tx)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "tx_get_input_script_len" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_tx_get_input_script_len((struct wally_tx const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg3);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_get_input_witness_num_items(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx *arg1 = (struct wally_tx *) 0 ;
  size_t arg2 ;
  size_t *arg3 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg3 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "tx_get_input_witness_num_items", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_get_input_witness_num_items" "', argument " "1"" of type '" "(wally_tx)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "tx_get_input_witness_num_items" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_tx_get_input_witness_num_items((struct wally_tx const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg3);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_get_input_witness(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx *arg1 = (struct wally_tx *) 0 ;
  size_t arg2 ;
  size_t arg3 ;
  unsigned char *arg4 = (unsigned char *) 0 ;
  size_t arg5 ;
  size_t *arg6 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  size_t val3 ;
  int ecode3 = 0 ;
  PyObject *swig_obj[4] ;
  int result;
  
  size_t written = 0; arg6 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "tx_get_input_witness", 4, 4, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_get_input_witness" "', argument " "1"" of type '" "(wally_tx)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "tx_get_input_witness" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  ecode3 = SWIG_AsVal_size_t(swig_obj[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "tx_get_input_witness" "', argument " "3"" of type '" "size_t""'");
  } 
  arg3 = (size_t)(val3);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[3], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_get_input_witness" "', argument " "4"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg4 = (unsigned char *) buf;
    arg5 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_tx_get_input_witness((struct wally_tx const *)arg1,arg2,arg3,arg4,arg5,arg6);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg6);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_get_input_witness_len(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx *arg1 = (struct wally_tx *) 0 ;
  size_t arg2 ;
  size_t arg3 ;
  size_t *arg4 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  size_t val3 ;
  int ecode3 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  size_t written = 0; arg4 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "tx_get_input_witness_len", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_get_input_witness_len" "', argument " "1"" of type '" "(wally_tx)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "tx_get_input_witness_len" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  ecode3 = SWIG_AsVal_size_t(swig_obj[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "tx_get_input_witness_len" "', argument " "3"" of type '" "size_t""'");
  } 
  arg3 = (size_t)(val3);
  {
    result = (int)wally_tx_get_input_witness_len((struct wally_tx const *)arg1,arg2,arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg4);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_get_input_index(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx *arg1 = (struct wally_tx *) 0 ;
  size_t arg2 ;
  size_t *arg3 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg3 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "tx_get_input_index", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_get_input_index" "', argument " "1"" of type '" "(wally_tx)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "tx_get_input_index" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_tx_get_input_index((struct wally_tx const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg3);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_get_input_sequence(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx *arg1 = (struct wally_tx *) 0 ;
  size_t arg2 ;
  size_t *arg3 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg3 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "tx_get_input_sequence", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_get_input_sequence" "', argument " "1"" of type '" "(wally_tx)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "tx_get_input_sequence" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_tx_get_input_sequence((struct wally_tx const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg3);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_set_input_index(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx *arg1 = (struct wally_tx *) 0 ;
  size_t arg2 ;
  uint32_t arg3 ;
  size_t val2 ;
  int ecode2 = 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "tx_set_input_index", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_set_input_index" "', argument " "1"" of type '" "(wally_tx)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "tx_set_input_index" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  ecode3 = SWIG_AsVal_unsigned_SS_int(swig_obj[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "tx_set_input_index" "', argument " "3"" of type '" "uint32_t""'");
  } 
  arg3 = (uint32_t)(val3);
  {
    result = (int)wally_tx_set_input_index((struct wally_tx const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_set_input_sequence(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx *arg1 = (struct wally_tx *) 0 ;
  size_t arg2 ;
  uint32_t arg3 ;
  size_t val2 ;
  int ecode2 = 0 ;
  unsigned int val3 ;
  int ecode3 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "tx_set_input_sequence", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_set_input_sequence" "', argument " "1"" of type '" "(wally_tx)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "tx_set_input_sequence" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  ecode3 = SWIG_AsVal_unsigned_SS_int(swig_obj[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "tx_set_input_sequence" "', argument " "3"" of type '" "uint32_t""'");
  } 
  arg3 = (uint32_t)(val3);
  {
    result = (int)wally_tx_set_input_sequence((struct wally_tx const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_set_input_txhash(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx *arg1 = (struct wally_tx *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "tx_set_input_txhash", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_set_input_txhash" "', argument " "1"" of type '" "(wally_tx)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "tx_set_input_txhash" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[2] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_set_input_txhash" "', argument " "3"" of type '" "(const unsigned char* txhash, size_t txhash_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_tx_set_input_txhash((struct wally_tx const *)arg1,arg2,(unsigned char const *)arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_get_input_blinding_nonce(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx *arg1 = (struct wally_tx *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "tx_get_input_blinding_nonce", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_get_input_blinding_nonce" "', argument " "1"" of type '" "(wally_tx)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "tx_get_input_blinding_nonce" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_get_input_blinding_nonce" "', argument " "3"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg3 = (unsigned char *) buf;
    arg4 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_tx_get_input_blinding_nonce((struct wally_tx const *)arg1,arg2,arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_get_input_entropy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx *arg1 = (struct wally_tx *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "tx_get_input_entropy", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_get_input_entropy" "', argument " "1"" of type '" "(wally_tx)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "tx_get_input_entropy" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_get_input_entropy" "', argument " "3"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg3 = (unsigned char *) buf;
    arg4 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_tx_get_input_entropy((struct wally_tx const *)arg1,arg2,arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_get_input_issuance_amount(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx *arg1 = (struct wally_tx *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t *arg5 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  size_t written = 0; arg5 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "tx_get_input_issuance_amount", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_get_input_issuance_amount" "', argument " "1"" of type '" "(wally_tx)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "tx_get_input_issuance_amount" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_get_input_issuance_amount" "', argument " "3"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg3 = (unsigned char *) buf;
    arg4 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_tx_get_input_issuance_amount((struct wally_tx const *)arg1,arg2,arg3,arg4,arg5);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg5);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_get_input_issuance_amount_len(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx *arg1 = (struct wally_tx *) 0 ;
  size_t arg2 ;
  size_t *arg3 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg3 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "tx_get_input_issuance_amount_len", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_get_input_issuance_amount_len" "', argument " "1"" of type '" "(wally_tx)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "tx_get_input_issuance_amount_len" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_tx_get_input_issuance_amount_len((struct wally_tx const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg3);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_get_input_inflation_keys(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx *arg1 = (struct wally_tx *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t *arg5 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  size_t written = 0; arg5 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "tx_get_input_inflation_keys", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_get_input_inflation_keys" "', argument " "1"" of type '" "(wally_tx)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "tx_get_input_inflation_keys" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_get_input_inflation_keys" "', argument " "3"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg3 = (unsigned char *) buf;
    arg4 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_tx_get_input_inflation_keys((struct wally_tx const *)arg1,arg2,arg3,arg4,arg5);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg5);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_get_input_inflation_keys_len(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx *arg1 = (struct wally_tx *) 0 ;
  size_t arg2 ;
  size_t *arg3 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg3 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "tx_get_input_inflation_keys_len", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_get_input_inflation_keys_len" "', argument " "1"" of type '" "(wally_tx)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "tx_get_input_inflation_keys_len" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_tx_get_input_inflation_keys_len((struct wally_tx const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg3);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_get_input_issuance_amount_rangeproof(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx *arg1 = (struct wally_tx *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t *arg5 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  size_t written = 0; arg5 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "tx_get_input_issuance_amount_rangeproof", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_get_input_issuance_amount_rangeproof" "', argument " "1"" of type '" "(wally_tx)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "tx_get_input_issuance_amount_rangeproof" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_get_input_issuance_amount_rangeproof" "', argument " "3"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg3 = (unsigned char *) buf;
    arg4 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_tx_get_input_issuance_amount_rangeproof((struct wally_tx const *)arg1,arg2,arg3,arg4,arg5);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg5);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_get_input_issuance_amount_rangeproof_len(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx *arg1 = (struct wally_tx *) 0 ;
  size_t arg2 ;
  size_t *arg3 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg3 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "tx_get_input_issuance_amount_rangeproof_len", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_get_input_issuance_amount_rangeproof_len" "', argument " "1"" of type '" "(wally_tx)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "tx_get_input_issuance_amount_rangeproof_len" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_tx_get_input_issuance_amount_rangeproof_len((struct wally_tx const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg3);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_get_input_inflation_keys_rangeproof(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx *arg1 = (struct wally_tx *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t *arg5 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  size_t written = 0; arg5 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "tx_get_input_inflation_keys_rangeproof", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_get_input_inflation_keys_rangeproof" "', argument " "1"" of type '" "(wally_tx)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "tx_get_input_inflation_keys_rangeproof" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_get_input_inflation_keys_rangeproof" "', argument " "3"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg3 = (unsigned char *) buf;
    arg4 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_tx_get_input_inflation_keys_rangeproof((struct wally_tx const *)arg1,arg2,arg3,arg4,arg5);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg5);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_get_input_inflation_keys_rangeproof_len(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx *arg1 = (struct wally_tx *) 0 ;
  size_t arg2 ;
  size_t *arg3 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg3 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "tx_get_input_inflation_keys_rangeproof_len", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_get_input_inflation_keys_rangeproof_len" "', argument " "1"" of type '" "(wally_tx)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "tx_get_input_inflation_keys_rangeproof_len" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_tx_get_input_inflation_keys_rangeproof_len((struct wally_tx const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg3);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_set_input_blinding_nonce(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx *arg1 = (struct wally_tx *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "tx_set_input_blinding_nonce", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_set_input_blinding_nonce" "', argument " "1"" of type '" "(wally_tx)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "tx_set_input_blinding_nonce" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[2] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_set_input_blinding_nonce" "', argument " "3"" of type '" "(const unsigned char* blinding_nonce, size_t blinding_nonce_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_tx_set_input_blinding_nonce((struct wally_tx const *)arg1,arg2,(unsigned char const *)arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_set_input_entropy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx *arg1 = (struct wally_tx *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "tx_set_input_entropy", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_set_input_entropy" "', argument " "1"" of type '" "(wally_tx)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "tx_set_input_entropy" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[2] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_set_input_entropy" "', argument " "3"" of type '" "(const unsigned char* entropy, size_t entropy_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_tx_set_input_entropy((struct wally_tx const *)arg1,arg2,(unsigned char const *)arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_set_input_inflation_keys(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx *arg1 = (struct wally_tx *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "tx_set_input_inflation_keys", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_set_input_inflation_keys" "', argument " "1"" of type '" "(wally_tx)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "tx_set_input_inflation_keys" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[2] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_set_input_inflation_keys" "', argument " "3"" of type '" "(const unsigned char* inflation_keys, size_t inflation_keys_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_tx_set_input_inflation_keys((struct wally_tx const *)arg1,arg2,(unsigned char const *)arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_set_input_inflation_keys_rangeproof(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx *arg1 = (struct wally_tx *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "tx_set_input_inflation_keys_rangeproof", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_set_input_inflation_keys_rangeproof" "', argument " "1"" of type '" "(wally_tx)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "tx_set_input_inflation_keys_rangeproof" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[2] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_set_input_inflation_keys_rangeproof" "', argument " "3"" of type '" "(const unsigned char* inflation_keys_rangeproof, size_t inflation_keys_rangeproof_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_tx_set_input_inflation_keys_rangeproof((struct wally_tx const *)arg1,arg2,(unsigned char const *)arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_set_input_issuance_amount(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx *arg1 = (struct wally_tx *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "tx_set_input_issuance_amount", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_set_input_issuance_amount" "', argument " "1"" of type '" "(wally_tx)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "tx_set_input_issuance_amount" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[2] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_set_input_issuance_amount" "', argument " "3"" of type '" "(const unsigned char* issuance_amount, size_t issuance_amount_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_tx_set_input_issuance_amount((struct wally_tx const *)arg1,arg2,(unsigned char const *)arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_set_input_issuance_amount_rangeproof(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx *arg1 = (struct wally_tx *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "tx_set_input_issuance_amount_rangeproof", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_set_input_issuance_amount_rangeproof" "', argument " "1"" of type '" "(wally_tx)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "tx_set_input_issuance_amount_rangeproof" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[2] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_set_input_issuance_amount_rangeproof" "', argument " "3"" of type '" "(const unsigned char* issuance_amount_rangeproof, size_t issuance_amount_rangeproof_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_tx_set_input_issuance_amount_rangeproof((struct wally_tx const *)arg1,arg2,(unsigned char const *)arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_get_output_script(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx *arg1 = (struct wally_tx *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t *arg5 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  size_t written = 0; arg5 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "tx_get_output_script", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_get_output_script" "', argument " "1"" of type '" "(wally_tx)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "tx_get_output_script" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_get_output_script" "', argument " "3"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg3 = (unsigned char *) buf;
    arg4 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_tx_get_output_script((struct wally_tx const *)arg1,arg2,arg3,arg4,arg5);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg5);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_get_output_script_len(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx *arg1 = (struct wally_tx *) 0 ;
  size_t arg2 ;
  size_t *arg3 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg3 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "tx_get_output_script_len", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_get_output_script_len" "', argument " "1"" of type '" "(wally_tx)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "tx_get_output_script_len" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_tx_get_output_script_len((struct wally_tx const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg3);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_get_output_satoshi(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx *arg1 = (struct wally_tx *) 0 ;
  size_t arg2 ;
  uint64_t *arg3 = (uint64_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  uint64_t val3 ;
  PyObject *swig_obj[2] ;
  int result;
  
  {
    val3 = 0; arg3 = (uint64_t *)&val3;
  }
  if (!SWIG_Python_UnpackTuple(args, "tx_get_output_satoshi", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_get_output_satoshi" "', argument " "1"" of type '" "(wally_tx)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "tx_get_output_satoshi" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_tx_get_output_satoshi((struct wally_tx const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyLong_FromUnsignedLongLong(*arg3);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_set_output_script(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx *arg1 = (struct wally_tx *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "tx_set_output_script", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_set_output_script" "', argument " "1"" of type '" "(wally_tx)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "tx_set_output_script" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[2] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_set_output_script" "', argument " "3"" of type '" "(const unsigned char* script, size_t script_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_tx_set_output_script((struct wally_tx const *)arg1,arg2,(unsigned char const *)arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_set_output_satoshi(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx *arg1 = (struct wally_tx *) 0 ;
  size_t arg2 ;
  uint64_t arg3 ;
  size_t val2 ;
  int ecode2 = 0 ;
  unsigned long long val3 ;
  int ecode3 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "tx_set_output_satoshi", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_set_output_satoshi" "', argument " "1"" of type '" "(wally_tx)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "tx_set_output_satoshi" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  ecode3 = SWIG_AsVal_unsigned_SS_long_SS_long(swig_obj[2], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "tx_set_output_satoshi" "', argument " "3"" of type '" "uint64_t""'");
  } 
  arg3 = (uint64_t)(val3);
  {
    result = (int)wally_tx_set_output_satoshi((struct wally_tx const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_get_output_asset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx *arg1 = (struct wally_tx *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "tx_get_output_asset", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_get_output_asset" "', argument " "1"" of type '" "(wally_tx)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "tx_get_output_asset" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_get_output_asset" "', argument " "3"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg3 = (unsigned char *) buf;
    arg4 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_tx_get_output_asset((struct wally_tx const *)arg1,arg2,arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_get_output_value(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx *arg1 = (struct wally_tx *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t *arg5 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  size_t written = 0; arg5 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "tx_get_output_value", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_get_output_value" "', argument " "1"" of type '" "(wally_tx)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "tx_get_output_value" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_get_output_value" "', argument " "3"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg3 = (unsigned char *) buf;
    arg4 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_tx_get_output_value((struct wally_tx const *)arg1,arg2,arg3,arg4,arg5);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg5);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_get_output_value_len(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx *arg1 = (struct wally_tx *) 0 ;
  size_t arg2 ;
  size_t *arg3 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg3 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "tx_get_output_value_len", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_get_output_value_len" "', argument " "1"" of type '" "(wally_tx)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "tx_get_output_value_len" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_tx_get_output_value_len((struct wally_tx const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg3);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_get_output_nonce(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx *arg1 = (struct wally_tx *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "tx_get_output_nonce", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_get_output_nonce" "', argument " "1"" of type '" "(wally_tx)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "tx_get_output_nonce" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_get_output_nonce" "', argument " "3"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg3 = (unsigned char *) buf;
    arg4 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_tx_get_output_nonce((struct wally_tx const *)arg1,arg2,arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_get_output_surjectionproof(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx *arg1 = (struct wally_tx *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t *arg5 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  size_t written = 0; arg5 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "tx_get_output_surjectionproof", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_get_output_surjectionproof" "', argument " "1"" of type '" "(wally_tx)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "tx_get_output_surjectionproof" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_get_output_surjectionproof" "', argument " "3"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg3 = (unsigned char *) buf;
    arg4 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_tx_get_output_surjectionproof((struct wally_tx const *)arg1,arg2,arg3,arg4,arg5);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg5);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_get_output_surjectionproof_len(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx *arg1 = (struct wally_tx *) 0 ;
  size_t arg2 ;
  size_t *arg3 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg3 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "tx_get_output_surjectionproof_len", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_get_output_surjectionproof_len" "', argument " "1"" of type '" "(wally_tx)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "tx_get_output_surjectionproof_len" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_tx_get_output_surjectionproof_len((struct wally_tx const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg3);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_get_output_rangeproof(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx *arg1 = (struct wally_tx *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t *arg5 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  size_t written = 0; arg5 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "tx_get_output_rangeproof", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_get_output_rangeproof" "', argument " "1"" of type '" "(wally_tx)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "tx_get_output_rangeproof" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_get_output_rangeproof" "', argument " "3"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg3 = (unsigned char *) buf;
    arg4 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_tx_get_output_rangeproof((struct wally_tx const *)arg1,arg2,arg3,arg4,arg5);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg5);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_get_output_rangeproof_len(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx *arg1 = (struct wally_tx *) 0 ;
  size_t arg2 ;
  size_t *arg3 = (size_t *) 0 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg3 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "tx_get_output_rangeproof_len", 2, 2, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_get_output_rangeproof_len" "', argument " "1"" of type '" "(wally_tx)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "tx_get_output_rangeproof_len" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    result = (int)wally_tx_get_output_rangeproof_len((struct wally_tx const *)arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg3);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_set_output_asset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx *arg1 = (struct wally_tx *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "tx_set_output_asset", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_set_output_asset" "', argument " "1"" of type '" "(wally_tx)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "tx_set_output_asset" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[2] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_set_output_asset" "', argument " "3"" of type '" "(const unsigned char* asset, size_t asset_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_tx_set_output_asset((struct wally_tx const *)arg1,arg2,(unsigned char const *)arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_set_output_value(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx *arg1 = (struct wally_tx *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "tx_set_output_value", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_set_output_value" "', argument " "1"" of type '" "(wally_tx)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "tx_set_output_value" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[2] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_set_output_value" "', argument " "3"" of type '" "(const unsigned char* value, size_t value_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_tx_set_output_value((struct wally_tx const *)arg1,arg2,(unsigned char const *)arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_set_output_nonce(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx *arg1 = (struct wally_tx *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "tx_set_output_nonce", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_set_output_nonce" "', argument " "1"" of type '" "(wally_tx)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "tx_set_output_nonce" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[2] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_set_output_nonce" "', argument " "3"" of type '" "(const unsigned char* nonce, size_t nonce_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_tx_set_output_nonce((struct wally_tx const *)arg1,arg2,(unsigned char const *)arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_set_output_surjectionproof(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx *arg1 = (struct wally_tx *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "tx_set_output_surjectionproof", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_set_output_surjectionproof" "', argument " "1"" of type '" "(wally_tx)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "tx_set_output_surjectionproof" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[2] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_set_output_surjectionproof" "', argument " "3"" of type '" "(const unsigned char* surjectionproof, size_t surjectionproof_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_tx_set_output_surjectionproof((struct wally_tx const *)arg1,arg2,(unsigned char const *)arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_tx_set_output_rangeproof(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  struct wally_tx *arg1 = (struct wally_tx *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "tx_set_output_rangeproof", 3, 3, swig_obj)) SWIG_fail;
  {
    arg1 = swig_obj[0] == Py_None ? NULL : PyCapsule_GetPointer(swig_obj[0], "struct wally_tx *");
    if (PyErr_Occurred()) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(-1), "in method '" "tx_set_output_rangeproof" "', argument " "1"" of type '" "(wally_tx)""'");
    }
  }
  ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "tx_set_output_rangeproof" "', argument " "2"" of type '" "size_t""'");
  } 
  arg2 = (size_t)(val2);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[2] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "tx_set_output_rangeproof" "', argument " "3"" of type '" "(const unsigned char* rangeproof, size_t rangeproof_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_tx_set_output_rangeproof((struct wally_tx const *)arg1,arg2,(unsigned char const *)arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_asset_generator_from_bytes(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  unsigned char *arg5 = (unsigned char *) 0 ;
  size_t arg6 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "asset_generator_from_bytes", 3, 3, swig_obj)) SWIG_fail;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "asset_generator_from_bytes" "', argument " "1"" of type '" "(const unsigned char* asset, size_t asset_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "asset_generator_from_bytes" "', argument " "3"" of type '" "(const unsigned char* abf, size_t abf_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "asset_generator_from_bytes" "', argument " "5"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg5 = (unsigned char *) buf;
    arg6 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_asset_generator_from_bytes((unsigned char const *)arg1,arg2,(unsigned char const *)arg3,arg4,arg5,arg6);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_ecdh_nonce_hash(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  unsigned char *arg5 = (unsigned char *) 0 ;
  size_t arg6 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "ecdh_nonce_hash", 3, 3, swig_obj)) SWIG_fail;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "ecdh_nonce_hash" "', argument " "1"" of type '" "(const unsigned char* pub_key, size_t pub_key_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "ecdh_nonce_hash" "', argument " "3"" of type '" "(const unsigned char* priv_key, size_t priv_key_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "ecdh_nonce_hash" "', argument " "5"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg5 = (unsigned char *) buf;
    arg6 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_ecdh_nonce_hash((unsigned char const *)arg1,arg2,(unsigned char const *)arg3,arg4,arg5,arg6);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_asset_final_vbf(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  uint64_t *arg1 = (uint64_t *) 0 ;
  size_t arg2 ;
  size_t arg3 ;
  unsigned char *arg4 = (unsigned char *) 0 ;
  size_t arg5 ;
  unsigned char *arg6 = (unsigned char *) 0 ;
  size_t arg7 ;
  unsigned char *arg8 = (unsigned char *) 0 ;
  size_t arg9 ;
  uint64_t tmp_buf1[MAX_LOCAL_STACK/sizeof(uint64_t)] ;
  size_t val3 ;
  int ecode3 = 0 ;
  PyObject *swig_obj[5] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "asset_final_vbf", 5, 5, swig_obj)) SWIG_fail;
  {
    size_t i;
    if (!PyList_Check(swig_obj[0])) {
      check_result(WALLY_EINVAL);
      SWIG_fail;
    }
    arg2 = PyList_Size(swig_obj[0]);
    arg1 = tmp_buf1;
    if (arg2 * sizeof(uint64_t) > sizeof(tmp_buf1))
    if (!(arg1 = (uint64_t *) wally_malloc((arg2) * sizeof(uint64_t)))) {
      check_result(WALLY_ENOMEM);
      SWIG_fail;
    }
    for (i = 0; i < arg2; ++i) {
      PyObject *item = PyList_GET_ITEM(swig_obj[0], i);
      unsigned long long v;
      if (!ulonglong_cast(item, &v) || v > 0xffffffffffffffffull) {
        PyErr_SetString(PyExc_OverflowError, "Invalid unsigned integer");
        SWIG_fail;
      }
      arg1[i] = (uint64_t)v;
    }
  }
  ecode3 = SWIG_AsVal_size_t(swig_obj[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "asset_final_vbf" "', argument " "3"" of type '" "size_t""'");
  } 
  arg3 = (size_t)(val3);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[2] == Py_None)
    arg5 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "asset_final_vbf" "', argument " "4"" of type '" "(const unsigned char* abf, size_t abf_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg4 = (unsigned char *) buf;
      arg5 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[3] == Py_None)
    arg7 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[3], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "asset_final_vbf" "', argument " "6"" of type '" "(const unsigned char* vbf, size_t vbf_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg6 = (unsigned char *) buf;
      arg7 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[4], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "asset_final_vbf" "', argument " "8"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg8 = (unsigned char *) buf;
    arg9 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_asset_final_vbf((uint64_t const *)arg1,arg2,arg3,(unsigned char const *)arg4,arg5,(unsigned char const *)arg6,arg7,arg8,arg9);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    if (arg1 && arg1 != tmp_buf1)
    wally_free(arg1);
  }
  return resultobj;
fail:
  {
    if (arg1 && arg1 != tmp_buf1)
    wally_free(arg1);
  }
  return NULL;
}


SWIGINTERN PyObject *_wrap_asset_scalar_offset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  uint64_t arg1 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  unsigned char *arg4 = (unsigned char *) 0 ;
  size_t arg5 ;
  unsigned char *arg6 = (unsigned char *) 0 ;
  size_t arg7 ;
  unsigned long long val1 ;
  int ecode1 = 0 ;
  PyObject *swig_obj[4] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "asset_scalar_offset", 4, 4, swig_obj)) SWIG_fail;
  ecode1 = SWIG_AsVal_unsigned_SS_long_SS_long(swig_obj[0], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "asset_scalar_offset" "', argument " "1"" of type '" "uint64_t""'");
  } 
  arg1 = (uint64_t)(val1);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg3 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "asset_scalar_offset" "', argument " "2"" of type '" "(const unsigned char* abf, size_t abf_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg2 = (unsigned char *) buf;
      arg3 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[2] == Py_None)
    arg5 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "asset_scalar_offset" "', argument " "4"" of type '" "(const unsigned char* vbf, size_t vbf_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg4 = (unsigned char *) buf;
      arg5 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[3], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "asset_scalar_offset" "', argument " "6"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg6 = (unsigned char *) buf;
    arg7 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_asset_scalar_offset(arg1,(unsigned char const *)arg2,arg3,(unsigned char const *)arg4,arg5,arg6,arg7);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_asset_value_commitment(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  uint64_t arg1 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  unsigned char *arg4 = (unsigned char *) 0 ;
  size_t arg5 ;
  unsigned char *arg6 = (unsigned char *) 0 ;
  size_t arg7 ;
  unsigned long long val1 ;
  int ecode1 = 0 ;
  PyObject *swig_obj[4] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "asset_value_commitment", 4, 4, swig_obj)) SWIG_fail;
  ecode1 = SWIG_AsVal_unsigned_SS_long_SS_long(swig_obj[0], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "asset_value_commitment" "', argument " "1"" of type '" "uint64_t""'");
  } 
  arg1 = (uint64_t)(val1);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg3 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "asset_value_commitment" "', argument " "2"" of type '" "(const unsigned char* vbf, size_t vbf_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg2 = (unsigned char *) buf;
      arg3 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[2] == Py_None)
    arg5 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "asset_value_commitment" "', argument " "4"" of type '" "(const unsigned char* generator, size_t generator_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg4 = (unsigned char *) buf;
      arg5 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[3], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "asset_value_commitment" "', argument " "6"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg6 = (unsigned char *) buf;
    arg7 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_asset_value_commitment(arg1,(unsigned char const *)arg2,arg3,(unsigned char const *)arg4,arg5,arg6,arg7);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_asset_rangeproof_get_maximum_len(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  uint64_t arg1 ;
  int arg2 ;
  size_t *arg3 = (size_t *) 0 ;
  unsigned long long val1 ;
  int ecode1 = 0 ;
  int val2 ;
  int ecode2 = 0 ;
  PyObject *swig_obj[2] ;
  int result;
  
  size_t written = 0; arg3 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "asset_rangeproof_get_maximum_len", 2, 2, swig_obj)) SWIG_fail;
  ecode1 = SWIG_AsVal_unsigned_SS_long_SS_long(swig_obj[0], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "asset_rangeproof_get_maximum_len" "', argument " "1"" of type '" "uint64_t""'");
  } 
  arg1 = (uint64_t)(val1);
  ecode2 = SWIG_AsVal_int(swig_obj[1], &val2);
  if (!SWIG_IsOK(ecode2)) {
    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "asset_rangeproof_get_maximum_len" "', argument " "2"" of type '" "int""'");
  } 
  arg2 = (int)(val2);
  {
    result = (int)wally_asset_rangeproof_get_maximum_len(arg1,arg2,arg3);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg3);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_asset_rangeproof_with_nonce(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  uint64_t arg1 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  unsigned char *arg4 = (unsigned char *) 0 ;
  size_t arg5 ;
  unsigned char *arg6 = (unsigned char *) 0 ;
  size_t arg7 ;
  unsigned char *arg8 = (unsigned char *) 0 ;
  size_t arg9 ;
  unsigned char *arg10 = (unsigned char *) 0 ;
  size_t arg11 ;
  unsigned char *arg12 = (unsigned char *) 0 ;
  size_t arg13 ;
  unsigned char *arg14 = (unsigned char *) 0 ;
  size_t arg15 ;
  uint64_t arg16 ;
  int arg17 ;
  int arg18 ;
  unsigned char *arg19 = (unsigned char *) 0 ;
  size_t arg20 ;
  size_t *arg21 = (size_t *) 0 ;
  unsigned long long val1 ;
  int ecode1 = 0 ;
  unsigned long long val16 ;
  int ecode16 = 0 ;
  int val17 ;
  int ecode17 = 0 ;
  int val18 ;
  int ecode18 = 0 ;
  PyObject *swig_obj[12] ;
  int result;
  
  size_t written = 0; arg21 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "asset_rangeproof_with_nonce", 12, 12, swig_obj)) SWIG_fail;
  ecode1 = SWIG_AsVal_unsigned_SS_long_SS_long(swig_obj[0], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "asset_rangeproof_with_nonce" "', argument " "1"" of type '" "uint64_t""'");
  } 
  arg1 = (uint64_t)(val1);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg3 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "asset_rangeproof_with_nonce" "', argument " "2"" of type '" "(const unsigned char* nonce_hash, size_t nonce_hash_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg2 = (unsigned char *) buf;
      arg3 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[2] == Py_None)
    arg5 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "asset_rangeproof_with_nonce" "', argument " "4"" of type '" "(const unsigned char* asset, size_t asset_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg4 = (unsigned char *) buf;
      arg5 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[3] == Py_None)
    arg7 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[3], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "asset_rangeproof_with_nonce" "', argument " "6"" of type '" "(const unsigned char* abf, size_t abf_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg6 = (unsigned char *) buf;
      arg7 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[4] == Py_None)
    arg9 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[4], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "asset_rangeproof_with_nonce" "', argument " "8"" of type '" "(const unsigned char* vbf, size_t vbf_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg8 = (unsigned char *) buf;
      arg9 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[5] == Py_None)
    arg11 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[5], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "asset_rangeproof_with_nonce" "', argument " "10"" of type '" "(const unsigned char* commitment, size_t commitment_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg10 = (unsigned char *) buf;
      arg11 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[6] == Py_None)
    arg13 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[6], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "asset_rangeproof_with_nonce" "', argument " "12"" of type '" "(const unsigned char* extra, size_t extra_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg12 = (unsigned char *) buf;
      arg13 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[7] == Py_None)
    arg15 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[7], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "asset_rangeproof_with_nonce" "', argument " "14"" of type '" "(const unsigned char* generator, size_t generator_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg14 = (unsigned char *) buf;
      arg15 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  ecode16 = SWIG_AsVal_unsigned_SS_long_SS_long(swig_obj[8], &val16);
  if (!SWIG_IsOK(ecode16)) {
    SWIG_exception_fail(SWIG_ArgError(ecode16), "in method '" "asset_rangeproof_with_nonce" "', argument " "16"" of type '" "uint64_t""'");
  } 
  arg16 = (uint64_t)(val16);
  ecode17 = SWIG_AsVal_int(swig_obj[9], &val17);
  if (!SWIG_IsOK(ecode17)) {
    SWIG_exception_fail(SWIG_ArgError(ecode17), "in method '" "asset_rangeproof_with_nonce" "', argument " "17"" of type '" "int""'");
  } 
  arg17 = (int)(val17);
  ecode18 = SWIG_AsVal_int(swig_obj[10], &val18);
  if (!SWIG_IsOK(ecode18)) {
    SWIG_exception_fail(SWIG_ArgError(ecode18), "in method '" "asset_rangeproof_with_nonce" "', argument " "18"" of type '" "int""'");
  } 
  arg18 = (int)(val18);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[11], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "asset_rangeproof_with_nonce" "', argument " "19"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg19 = (unsigned char *) buf;
    arg20 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_asset_rangeproof_with_nonce(arg1,(unsigned char const *)arg2,arg3,(unsigned char const *)arg4,arg5,(unsigned char const *)arg6,arg7,(unsigned char const *)arg8,arg9,(unsigned char const *)arg10,arg11,(unsigned char const *)arg12,arg13,(unsigned char const *)arg14,arg15,arg16,arg17,arg18,arg19,arg20,arg21);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg21);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_asset_rangeproof(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  uint64_t arg1 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  unsigned char *arg4 = (unsigned char *) 0 ;
  size_t arg5 ;
  unsigned char *arg6 = (unsigned char *) 0 ;
  size_t arg7 ;
  unsigned char *arg8 = (unsigned char *) 0 ;
  size_t arg9 ;
  unsigned char *arg10 = (unsigned char *) 0 ;
  size_t arg11 ;
  unsigned char *arg12 = (unsigned char *) 0 ;
  size_t arg13 ;
  unsigned char *arg14 = (unsigned char *) 0 ;
  size_t arg15 ;
  unsigned char *arg16 = (unsigned char *) 0 ;
  size_t arg17 ;
  uint64_t arg18 ;
  int arg19 ;
  int arg20 ;
  unsigned char *arg21 = (unsigned char *) 0 ;
  size_t arg22 ;
  size_t *arg23 = (size_t *) 0 ;
  unsigned long long val1 ;
  int ecode1 = 0 ;
  unsigned long long val18 ;
  int ecode18 = 0 ;
  int val19 ;
  int ecode19 = 0 ;
  int val20 ;
  int ecode20 = 0 ;
  PyObject *swig_obj[13] ;
  int result;
  
  size_t written = 0; arg23 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "asset_rangeproof", 13, 13, swig_obj)) SWIG_fail;
  ecode1 = SWIG_AsVal_unsigned_SS_long_SS_long(swig_obj[0], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "asset_rangeproof" "', argument " "1"" of type '" "uint64_t""'");
  } 
  arg1 = (uint64_t)(val1);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg3 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "asset_rangeproof" "', argument " "2"" of type '" "(const unsigned char* pub_key, size_t pub_key_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg2 = (unsigned char *) buf;
      arg3 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[2] == Py_None)
    arg5 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "asset_rangeproof" "', argument " "4"" of type '" "(const unsigned char* priv_key, size_t priv_key_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg4 = (unsigned char *) buf;
      arg5 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[3] == Py_None)
    arg7 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[3], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "asset_rangeproof" "', argument " "6"" of type '" "(const unsigned char* asset, size_t asset_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg6 = (unsigned char *) buf;
      arg7 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[4] == Py_None)
    arg9 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[4], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "asset_rangeproof" "', argument " "8"" of type '" "(const unsigned char* abf, size_t abf_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg8 = (unsigned char *) buf;
      arg9 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[5] == Py_None)
    arg11 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[5], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "asset_rangeproof" "', argument " "10"" of type '" "(const unsigned char* vbf, size_t vbf_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg10 = (unsigned char *) buf;
      arg11 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[6] == Py_None)
    arg13 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[6], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "asset_rangeproof" "', argument " "12"" of type '" "(const unsigned char* commitment, size_t commitment_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg12 = (unsigned char *) buf;
      arg13 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[7] == Py_None)
    arg15 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[7], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "asset_rangeproof" "', argument " "14"" of type '" "(const unsigned char* extra, size_t extra_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg14 = (unsigned char *) buf;
      arg15 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[8] == Py_None)
    arg17 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[8], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "asset_rangeproof" "', argument " "16"" of type '" "(const unsigned char* generator, size_t generator_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg16 = (unsigned char *) buf;
      arg17 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  ecode18 = SWIG_AsVal_unsigned_SS_long_SS_long(swig_obj[9], &val18);
  if (!SWIG_IsOK(ecode18)) {
    SWIG_exception_fail(SWIG_ArgError(ecode18), "in method '" "asset_rangeproof" "', argument " "18"" of type '" "uint64_t""'");
  } 
  arg18 = (uint64_t)(val18);
  ecode19 = SWIG_AsVal_int(swig_obj[10], &val19);
  if (!SWIG_IsOK(ecode19)) {
    SWIG_exception_fail(SWIG_ArgError(ecode19), "in method '" "asset_rangeproof" "', argument " "19"" of type '" "int""'");
  } 
  arg19 = (int)(val19);
  ecode20 = SWIG_AsVal_int(swig_obj[11], &val20);
  if (!SWIG_IsOK(ecode20)) {
    SWIG_exception_fail(SWIG_ArgError(ecode20), "in method '" "asset_rangeproof" "', argument " "20"" of type '" "int""'");
  } 
  arg20 = (int)(val20);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[12], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "asset_rangeproof" "', argument " "21"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg21 = (unsigned char *) buf;
    arg22 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_asset_rangeproof(arg1,(unsigned char const *)arg2,arg3,(unsigned char const *)arg4,arg5,(unsigned char const *)arg6,arg7,(unsigned char const *)arg8,arg9,(unsigned char const *)arg10,arg11,(unsigned char const *)arg12,arg13,(unsigned char const *)arg14,arg15,(unsigned char const *)arg16,arg17,arg18,arg19,arg20,arg21,arg22,arg23);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg23);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_explicit_rangeproof(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  uint64_t arg1 ;
  unsigned char *arg2 = (unsigned char *) 0 ;
  size_t arg3 ;
  unsigned char *arg4 = (unsigned char *) 0 ;
  size_t arg5 ;
  unsigned char *arg6 = (unsigned char *) 0 ;
  size_t arg7 ;
  unsigned char *arg8 = (unsigned char *) 0 ;
  size_t arg9 ;
  unsigned char *arg10 = (unsigned char *) 0 ;
  size_t arg11 ;
  size_t *arg12 = (size_t *) 0 ;
  unsigned long long val1 ;
  int ecode1 = 0 ;
  PyObject *swig_obj[6] ;
  int result;
  
  size_t written = 0; arg12 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "explicit_rangeproof", 6, 6, swig_obj)) SWIG_fail;
  ecode1 = SWIG_AsVal_unsigned_SS_long_SS_long(swig_obj[0], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "explicit_rangeproof" "', argument " "1"" of type '" "uint64_t""'");
  } 
  arg1 = (uint64_t)(val1);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg3 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "explicit_rangeproof" "', argument " "2"" of type '" "(const unsigned char* nonce, size_t nonce_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg2 = (unsigned char *) buf;
      arg3 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[2] == Py_None)
    arg5 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "explicit_rangeproof" "', argument " "4"" of type '" "(const unsigned char* vbf, size_t vbf_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg4 = (unsigned char *) buf;
      arg5 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[3] == Py_None)
    arg7 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[3], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "explicit_rangeproof" "', argument " "6"" of type '" "(const unsigned char* commitment, size_t commitment_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg6 = (unsigned char *) buf;
      arg7 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[4] == Py_None)
    arg9 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[4], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "explicit_rangeproof" "', argument " "8"" of type '" "(const unsigned char* generator, size_t generator_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg8 = (unsigned char *) buf;
      arg9 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[5], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "explicit_rangeproof" "', argument " "10"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg10 = (unsigned char *) buf;
    arg11 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_explicit_rangeproof(arg1,(unsigned char const *)arg2,arg3,(unsigned char const *)arg4,arg5,(unsigned char const *)arg6,arg7,(unsigned char const *)arg8,arg9,arg10,arg11,arg12);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg12);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_explicit_rangeproof_verify(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  uint64_t arg3 ;
  unsigned char *arg4 = (unsigned char *) 0 ;
  size_t arg5 ;
  unsigned char *arg6 = (unsigned char *) 0 ;
  size_t arg7 ;
  unsigned long long val3 ;
  int ecode3 = 0 ;
  PyObject *swig_obj[4] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "explicit_rangeproof_verify", 4, 4, swig_obj)) SWIG_fail;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "explicit_rangeproof_verify" "', argument " "1"" of type '" "(const unsigned char* rangeproof, size_t rangeproof_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  ecode3 = SWIG_AsVal_unsigned_SS_long_SS_long(swig_obj[1], &val3);
  if (!SWIG_IsOK(ecode3)) {
    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "explicit_rangeproof_verify" "', argument " "3"" of type '" "uint64_t""'");
  } 
  arg3 = (uint64_t)(val3);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[2] == Py_None)
    arg5 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "explicit_rangeproof_verify" "', argument " "4"" of type '" "(const unsigned char* commitment, size_t commitment_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg4 = (unsigned char *) buf;
      arg5 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[3] == Py_None)
    arg7 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[3], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "explicit_rangeproof_verify" "', argument " "6"" of type '" "(const unsigned char* generator, size_t generator_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg6 = (unsigned char *) buf;
      arg7 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_explicit_rangeproof_verify((unsigned char const *)arg1,arg2,arg3,(unsigned char const *)arg4,arg5,(unsigned char const *)arg6,arg7);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_asset_surjectionproof_size(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  size_t arg1 ;
  size_t *arg2 = (size_t *) 0 ;
  size_t val1 ;
  int ecode1 = 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  size_t written = 0; arg2 = (size_t *)&written;
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  ecode1 = SWIG_AsVal_size_t(swig_obj[0], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "asset_surjectionproof_size" "', argument " "1"" of type '" "size_t""'");
  } 
  arg1 = (size_t)(val1);
  {
    result = (int)wally_asset_surjectionproof_size(arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg2);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_asset_surjectionproof_len(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  unsigned char *arg5 = (unsigned char *) 0 ;
  size_t arg6 ;
  unsigned char *arg7 = (unsigned char *) 0 ;
  size_t arg8 ;
  unsigned char *arg9 = (unsigned char *) 0 ;
  size_t arg10 ;
  unsigned char *arg11 = (unsigned char *) 0 ;
  size_t arg12 ;
  unsigned char *arg13 = (unsigned char *) 0 ;
  size_t arg14 ;
  size_t *arg15 = (size_t *) 0 ;
  PyObject *swig_obj[7] ;
  int result;
  
  size_t written = 0; arg15 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "asset_surjectionproof_len", 7, 7, swig_obj)) SWIG_fail;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "asset_surjectionproof_len" "', argument " "1"" of type '" "(const unsigned char* output_asset, size_t output_asset_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "asset_surjectionproof_len" "', argument " "3"" of type '" "(const unsigned char* output_abf, size_t output_abf_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[2] == Py_None)
    arg6 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "asset_surjectionproof_len" "', argument " "5"" of type '" "(const unsigned char* output_generator, size_t output_generator_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg5 = (unsigned char *) buf;
      arg6 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[3] == Py_None)
    arg8 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[3], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "asset_surjectionproof_len" "', argument " "7"" of type '" "(const unsigned char* bytes, size_t bytes_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg7 = (unsigned char *) buf;
      arg8 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[4] == Py_None)
    arg10 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[4], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "asset_surjectionproof_len" "', argument " "9"" of type '" "(const unsigned char* asset, size_t asset_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg9 = (unsigned char *) buf;
      arg10 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[5] == Py_None)
    arg12 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[5], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "asset_surjectionproof_len" "', argument " "11"" of type '" "(const unsigned char* abf, size_t abf_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg11 = (unsigned char *) buf;
      arg12 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[6] == Py_None)
    arg14 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[6], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "asset_surjectionproof_len" "', argument " "13"" of type '" "(const unsigned char* generator, size_t generator_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg13 = (unsigned char *) buf;
      arg14 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_asset_surjectionproof_len((unsigned char const *)arg1,arg2,(unsigned char const *)arg3,arg4,(unsigned char const *)arg5,arg6,(unsigned char const *)arg7,arg8,(unsigned char const *)arg9,arg10,(unsigned char const *)arg11,arg12,(unsigned char const *)arg13,arg14,arg15);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg15);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_asset_surjectionproof(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  unsigned char *arg5 = (unsigned char *) 0 ;
  size_t arg6 ;
  unsigned char *arg7 = (unsigned char *) 0 ;
  size_t arg8 ;
  unsigned char *arg9 = (unsigned char *) 0 ;
  size_t arg10 ;
  unsigned char *arg11 = (unsigned char *) 0 ;
  size_t arg12 ;
  unsigned char *arg13 = (unsigned char *) 0 ;
  size_t arg14 ;
  unsigned char *arg15 = (unsigned char *) 0 ;
  size_t arg16 ;
  size_t *arg17 = (size_t *) 0 ;
  PyObject *swig_obj[8] ;
  int result;
  
  size_t written = 0; arg17 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "asset_surjectionproof", 8, 8, swig_obj)) SWIG_fail;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "asset_surjectionproof" "', argument " "1"" of type '" "(const unsigned char* output_asset, size_t output_asset_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "asset_surjectionproof" "', argument " "3"" of type '" "(const unsigned char* output_abf, size_t output_abf_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[2] == Py_None)
    arg6 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "asset_surjectionproof" "', argument " "5"" of type '" "(const unsigned char* output_generator, size_t output_generator_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg5 = (unsigned char *) buf;
      arg6 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[3] == Py_None)
    arg8 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[3], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "asset_surjectionproof" "', argument " "7"" of type '" "(const unsigned char* bytes, size_t bytes_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg7 = (unsigned char *) buf;
      arg8 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[4] == Py_None)
    arg10 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[4], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "asset_surjectionproof" "', argument " "9"" of type '" "(const unsigned char* asset, size_t asset_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg9 = (unsigned char *) buf;
      arg10 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[5] == Py_None)
    arg12 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[5], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "asset_surjectionproof" "', argument " "11"" of type '" "(const unsigned char* abf, size_t abf_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg11 = (unsigned char *) buf;
      arg12 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[6] == Py_None)
    arg14 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[6], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "asset_surjectionproof" "', argument " "13"" of type '" "(const unsigned char* generator, size_t generator_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg13 = (unsigned char *) buf;
      arg14 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[7], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "asset_surjectionproof" "', argument " "15"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg15 = (unsigned char *) buf;
    arg16 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_asset_surjectionproof((unsigned char const *)arg1,arg2,(unsigned char const *)arg3,arg4,(unsigned char const *)arg5,arg6,(unsigned char const *)arg7,arg8,(unsigned char const *)arg9,arg10,(unsigned char const *)arg11,arg12,(unsigned char const *)arg13,arg14,arg15,arg16,arg17);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg17);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_explicit_surjectionproof(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  unsigned char *arg5 = (unsigned char *) 0 ;
  size_t arg6 ;
  unsigned char *arg7 = (unsigned char *) 0 ;
  size_t arg8 ;
  PyObject *swig_obj[4] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "explicit_surjectionproof", 4, 4, swig_obj)) SWIG_fail;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "explicit_surjectionproof" "', argument " "1"" of type '" "(const unsigned char* output_asset, size_t output_asset_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "explicit_surjectionproof" "', argument " "3"" of type '" "(const unsigned char* output_abf, size_t output_abf_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[2] == Py_None)
    arg6 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "explicit_surjectionproof" "', argument " "5"" of type '" "(const unsigned char* output_generator, size_t output_generator_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg5 = (unsigned char *) buf;
      arg6 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[3], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "explicit_surjectionproof" "', argument " "7"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg7 = (unsigned char *) buf;
    arg8 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_explicit_surjectionproof((unsigned char const *)arg1,arg2,(unsigned char const *)arg3,arg4,(unsigned char const *)arg5,arg6,arg7,arg8);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_explicit_surjectionproof_verify(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  unsigned char *arg5 = (unsigned char *) 0 ;
  size_t arg6 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "explicit_surjectionproof_verify", 3, 3, swig_obj)) SWIG_fail;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "explicit_surjectionproof_verify" "', argument " "1"" of type '" "(const unsigned char* surjectionproof, size_t surjectionproof_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "explicit_surjectionproof_verify" "', argument " "3"" of type '" "(const unsigned char* output_asset, size_t output_asset_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[2] == Py_None)
    arg6 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "explicit_surjectionproof_verify" "', argument " "5"" of type '" "(const unsigned char* output_generator, size_t output_generator_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg5 = (unsigned char *) buf;
      arg6 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_explicit_surjectionproof_verify((unsigned char const *)arg1,arg2,(unsigned char const *)arg3,arg4,(unsigned char const *)arg5,arg6);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_asset_unblind_with_nonce(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  unsigned char *arg5 = (unsigned char *) 0 ;
  size_t arg6 ;
  unsigned char *arg7 = (unsigned char *) 0 ;
  size_t arg8 ;
  unsigned char *arg9 = (unsigned char *) 0 ;
  size_t arg10 ;
  unsigned char *arg11 = (unsigned char *) 0 ;
  size_t arg12 ;
  unsigned char *arg13 = (unsigned char *) 0 ;
  size_t arg14 ;
  unsigned char *arg15 = (unsigned char *) 0 ;
  size_t arg16 ;
  uint64_t *arg17 = (uint64_t *) 0 ;
  uint64_t val17 ;
  PyObject *swig_obj[8] ;
  int result;
  
  {
    val17 = 0; arg17 = (uint64_t *)&val17;
  }
  if (!SWIG_Python_UnpackTuple(args, "asset_unblind_with_nonce", 8, 8, swig_obj)) SWIG_fail;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "asset_unblind_with_nonce" "', argument " "1"" of type '" "(const unsigned char* nonce_hash, size_t nonce_hash_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "asset_unblind_with_nonce" "', argument " "3"" of type '" "(const unsigned char* proof, size_t proof_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[2] == Py_None)
    arg6 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "asset_unblind_with_nonce" "', argument " "5"" of type '" "(const unsigned char* commitment, size_t commitment_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg5 = (unsigned char *) buf;
      arg6 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[3] == Py_None)
    arg8 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[3], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "asset_unblind_with_nonce" "', argument " "7"" of type '" "(const unsigned char* extra, size_t extra_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg7 = (unsigned char *) buf;
      arg8 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[4] == Py_None)
    arg10 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[4], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "asset_unblind_with_nonce" "', argument " "9"" of type '" "(const unsigned char* generator, size_t generator_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg9 = (unsigned char *) buf;
      arg10 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[5], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "asset_unblind_with_nonce" "', argument " "11"" of type '" "(unsigned char* asset_out, size_t asset_out_len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg11 = (unsigned char *) buf;
    arg12 = (size_t) (size/sizeof(unsigned char));
  }
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[6], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "asset_unblind_with_nonce" "', argument " "13"" of type '" "(unsigned char* abf_out, size_t abf_out_len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg13 = (unsigned char *) buf;
    arg14 = (size_t) (size/sizeof(unsigned char));
  }
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[7], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "asset_unblind_with_nonce" "', argument " "15"" of type '" "(unsigned char* vbf_out, size_t vbf_out_len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg15 = (unsigned char *) buf;
    arg16 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_asset_unblind_with_nonce((unsigned char const *)arg1,arg2,(unsigned char const *)arg3,arg4,(unsigned char const *)arg5,arg6,(unsigned char const *)arg7,arg8,(unsigned char const *)arg9,arg10,arg11,arg12,arg13,arg14,arg15,arg16,arg17);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyLong_FromUnsignedLongLong(*arg17);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_asset_unblind(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  unsigned char *arg5 = (unsigned char *) 0 ;
  size_t arg6 ;
  unsigned char *arg7 = (unsigned char *) 0 ;
  size_t arg8 ;
  unsigned char *arg9 = (unsigned char *) 0 ;
  size_t arg10 ;
  unsigned char *arg11 = (unsigned char *) 0 ;
  size_t arg12 ;
  unsigned char *arg13 = (unsigned char *) 0 ;
  size_t arg14 ;
  unsigned char *arg15 = (unsigned char *) 0 ;
  size_t arg16 ;
  unsigned char *arg17 = (unsigned char *) 0 ;
  size_t arg18 ;
  uint64_t *arg19 = (uint64_t *) 0 ;
  uint64_t val19 ;
  PyObject *swig_obj[9] ;
  int result;
  
  {
    val19 = 0; arg19 = (uint64_t *)&val19;
  }
  if (!SWIG_Python_UnpackTuple(args, "asset_unblind", 9, 9, swig_obj)) SWIG_fail;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "asset_unblind" "', argument " "1"" of type '" "(const unsigned char* pub_key, size_t pub_key_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "asset_unblind" "', argument " "3"" of type '" "(const unsigned char* priv_key, size_t priv_key_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[2] == Py_None)
    arg6 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "asset_unblind" "', argument " "5"" of type '" "(const unsigned char* proof, size_t proof_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg5 = (unsigned char *) buf;
      arg6 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[3] == Py_None)
    arg8 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[3], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "asset_unblind" "', argument " "7"" of type '" "(const unsigned char* commitment, size_t commitment_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg7 = (unsigned char *) buf;
      arg8 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[4] == Py_None)
    arg10 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[4], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "asset_unblind" "', argument " "9"" of type '" "(const unsigned char* extra, size_t extra_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg9 = (unsigned char *) buf;
      arg10 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[5] == Py_None)
    arg12 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[5], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "asset_unblind" "', argument " "11"" of type '" "(const unsigned char* generator, size_t generator_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg11 = (unsigned char *) buf;
      arg12 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[6], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "asset_unblind" "', argument " "13"" of type '" "(unsigned char* asset_out, size_t asset_out_len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg13 = (unsigned char *) buf;
    arg14 = (size_t) (size/sizeof(unsigned char));
  }
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[7], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "asset_unblind" "', argument " "15"" of type '" "(unsigned char* abf_out, size_t abf_out_len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg15 = (unsigned char *) buf;
    arg16 = (size_t) (size/sizeof(unsigned char));
  }
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[8], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "asset_unblind" "', argument " "17"" of type '" "(unsigned char* vbf_out, size_t vbf_out_len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg17 = (unsigned char *) buf;
    arg18 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_asset_unblind((unsigned char const *)arg1,arg2,(unsigned char const *)arg3,arg4,(unsigned char const *)arg5,arg6,(unsigned char const *)arg7,arg8,(unsigned char const *)arg9,arg10,(unsigned char const *)arg11,arg12,arg13,arg14,arg15,arg16,arg17,arg18,arg19);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyLong_FromUnsignedLongLong(*arg19);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_asset_blinding_key_from_seed(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  PyObject *swig_obj[2] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "asset_blinding_key_from_seed", 2, 2, swig_obj)) SWIG_fail;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "asset_blinding_key_from_seed" "', argument " "1"" of type '" "(const unsigned char* bytes, size_t bytes_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "asset_blinding_key_from_seed" "', argument " "3"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg3 = (unsigned char *) buf;
    arg4 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_asset_blinding_key_from_seed((unsigned char const *)arg1,arg2,arg3,arg4);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_asset_blinding_key_to_ec_private_key(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  unsigned char *arg5 = (unsigned char *) 0 ;
  size_t arg6 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "asset_blinding_key_to_ec_private_key", 3, 3, swig_obj)) SWIG_fail;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "asset_blinding_key_to_ec_private_key" "', argument " "1"" of type '" "(const unsigned char* bytes, size_t bytes_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "asset_blinding_key_to_ec_private_key" "', argument " "3"" of type '" "(const unsigned char* script, size_t script_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "asset_blinding_key_to_ec_private_key" "', argument " "5"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg5 = (unsigned char *) buf;
    arg6 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_asset_blinding_key_to_ec_private_key((unsigned char const *)arg1,arg2,(unsigned char const *)arg3,arg4,arg5,arg6);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_asset_blinding_key_to_ec_public_key(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  unsigned char *arg5 = (unsigned char *) 0 ;
  size_t arg6 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "asset_blinding_key_to_ec_public_key", 3, 3, swig_obj)) SWIG_fail;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "asset_blinding_key_to_ec_public_key" "', argument " "1"" of type '" "(const unsigned char* bytes, size_t bytes_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "asset_blinding_key_to_ec_public_key" "', argument " "3"" of type '" "(const unsigned char* script, size_t script_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "asset_blinding_key_to_ec_public_key" "', argument " "5"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg5 = (unsigned char *) buf;
    arg6 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_asset_blinding_key_to_ec_public_key((unsigned char const *)arg1,arg2,(unsigned char const *)arg3,arg4,arg5,arg6);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_elip150_private_key_to_ec_private_key(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  unsigned char *arg5 = (unsigned char *) 0 ;
  size_t arg6 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "elip150_private_key_to_ec_private_key", 3, 3, swig_obj)) SWIG_fail;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "elip150_private_key_to_ec_private_key" "', argument " "1"" of type '" "(const unsigned char* bytes, size_t bytes_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "elip150_private_key_to_ec_private_key" "', argument " "3"" of type '" "(const unsigned char* script, size_t script_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "elip150_private_key_to_ec_private_key" "', argument " "5"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg5 = (unsigned char *) buf;
    arg6 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_elip150_private_key_to_ec_private_key((unsigned char const *)arg1,arg2,(unsigned char const *)arg3,arg4,arg5,arg6);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_elip150_private_key_to_ec_public_key(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  unsigned char *arg5 = (unsigned char *) 0 ;
  size_t arg6 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "elip150_private_key_to_ec_public_key", 3, 3, swig_obj)) SWIG_fail;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "elip150_private_key_to_ec_public_key" "', argument " "1"" of type '" "(const unsigned char* bytes, size_t bytes_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "elip150_private_key_to_ec_public_key" "', argument " "3"" of type '" "(const unsigned char* script, size_t script_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "elip150_private_key_to_ec_public_key" "', argument " "5"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg5 = (unsigned char *) buf;
    arg6 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_elip150_private_key_to_ec_public_key((unsigned char const *)arg1,arg2,(unsigned char const *)arg3,arg4,arg5,arg6);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_elip150_public_key_to_ec_public_key(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  unsigned char *arg5 = (unsigned char *) 0 ;
  size_t arg6 ;
  PyObject *swig_obj[3] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "elip150_public_key_to_ec_public_key", 3, 3, swig_obj)) SWIG_fail;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "elip150_public_key_to_ec_public_key" "', argument " "1"" of type '" "(const unsigned char* bytes, size_t bytes_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "elip150_public_key_to_ec_public_key" "', argument " "3"" of type '" "(const unsigned char* script, size_t script_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[2], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "elip150_public_key_to_ec_public_key" "', argument " "5"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg5 = (unsigned char *) buf;
    arg6 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_elip150_public_key_to_ec_public_key((unsigned char const *)arg1,arg2,(unsigned char const *)arg3,arg4,arg5,arg6);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_asset_blinding_key_to_abf_vbf(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  uint32_t arg5 ;
  unsigned char *arg6 = (unsigned char *) 0 ;
  size_t arg7 ;
  unsigned int val5 ;
  int ecode5 = 0 ;
  PyObject *swig_obj[4] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "asset_blinding_key_to_abf_vbf", 4, 4, swig_obj)) SWIG_fail;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "asset_blinding_key_to_abf_vbf" "', argument " "1"" of type '" "(const unsigned char* bytes, size_t bytes_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "asset_blinding_key_to_abf_vbf" "', argument " "3"" of type '" "(const unsigned char* hash_prevouts, size_t hash_prevouts_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  ecode5 = SWIG_AsVal_unsigned_SS_int(swig_obj[2], &val5);
  if (!SWIG_IsOK(ecode5)) {
    SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "asset_blinding_key_to_abf_vbf" "', argument " "5"" of type '" "uint32_t""'");
  } 
  arg5 = (uint32_t)(val5);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[3], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "asset_blinding_key_to_abf_vbf" "', argument " "6"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg6 = (unsigned char *) buf;
    arg7 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_asset_blinding_key_to_abf_vbf((unsigned char const *)arg1,arg2,(unsigned char const *)arg3,arg4,arg5,arg6,arg7);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_asset_blinding_key_to_abf(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  uint32_t arg5 ;
  unsigned char *arg6 = (unsigned char *) 0 ;
  size_t arg7 ;
  unsigned int val5 ;
  int ecode5 = 0 ;
  PyObject *swig_obj[4] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "asset_blinding_key_to_abf", 4, 4, swig_obj)) SWIG_fail;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "asset_blinding_key_to_abf" "', argument " "1"" of type '" "(const unsigned char* bytes, size_t bytes_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "asset_blinding_key_to_abf" "', argument " "3"" of type '" "(const unsigned char* hash_prevouts, size_t hash_prevouts_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  ecode5 = SWIG_AsVal_unsigned_SS_int(swig_obj[2], &val5);
  if (!SWIG_IsOK(ecode5)) {
    SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "asset_blinding_key_to_abf" "', argument " "5"" of type '" "uint32_t""'");
  } 
  arg5 = (uint32_t)(val5);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[3], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "asset_blinding_key_to_abf" "', argument " "6"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg6 = (unsigned char *) buf;
    arg7 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_asset_blinding_key_to_abf((unsigned char const *)arg1,arg2,(unsigned char const *)arg3,arg4,arg5,arg6,arg7);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_asset_blinding_key_to_vbf(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  uint32_t arg5 ;
  unsigned char *arg6 = (unsigned char *) 0 ;
  size_t arg7 ;
  unsigned int val5 ;
  int ecode5 = 0 ;
  PyObject *swig_obj[4] ;
  int result;
  
  if (!SWIG_Python_UnpackTuple(args, "asset_blinding_key_to_vbf", 4, 4, swig_obj)) SWIG_fail;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "asset_blinding_key_to_vbf" "', argument " "1"" of type '" "(const unsigned char* bytes, size_t bytes_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "asset_blinding_key_to_vbf" "', argument " "3"" of type '" "(const unsigned char* hash_prevouts, size_t hash_prevouts_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  ecode5 = SWIG_AsVal_unsigned_SS_int(swig_obj[2], &val5);
  if (!SWIG_IsOK(ecode5)) {
    SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "asset_blinding_key_to_vbf" "', argument " "5"" of type '" "uint32_t""'");
  } 
  arg5 = (uint32_t)(val5);
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[3], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "asset_blinding_key_to_vbf" "', argument " "6"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg6 = (unsigned char *) buf;
    arg7 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_asset_blinding_key_to_vbf((unsigned char const *)arg1,arg2,(unsigned char const *)arg3,arg4,arg5,arg6,arg7);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_asset_pak_whitelistproof_size(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  size_t arg1 ;
  size_t *arg2 = (size_t *) 0 ;
  size_t val1 ;
  int ecode1 = 0 ;
  PyObject *swig_obj[1] ;
  int result;
  
  size_t written = 0; arg2 = (size_t *)&written;
  if (!args) SWIG_fail;
  swig_obj[0] = args;
  ecode1 = SWIG_AsVal_size_t(swig_obj[0], &val1);
  if (!SWIG_IsOK(ecode1)) {
    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "asset_pak_whitelistproof_size" "', argument " "1"" of type '" "size_t""'");
  } 
  arg1 = (size_t)(val1);
  {
    result = (int)wally_asset_pak_whitelistproof_size(arg1,arg2);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg2);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_asset_pak_whitelistproof(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t arg5 ;
  unsigned char *arg6 = (unsigned char *) 0 ;
  size_t arg7 ;
  unsigned char *arg8 = (unsigned char *) 0 ;
  size_t arg9 ;
  unsigned char *arg10 = (unsigned char *) 0 ;
  size_t arg11 ;
  unsigned char *arg12 = (unsigned char *) 0 ;
  size_t arg13 ;
  size_t *arg14 = (size_t *) 0 ;
  size_t val5 ;
  int ecode5 = 0 ;
  PyObject *swig_obj[7] ;
  int result;
  
  size_t written = 0; arg14 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "asset_pak_whitelistproof", 7, 7, swig_obj)) SWIG_fail;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "asset_pak_whitelistproof" "', argument " "1"" of type '" "(const unsigned char* online_keys, size_t online_keys_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "asset_pak_whitelistproof" "', argument " "3"" of type '" "(const unsigned char* offline_keys, size_t offline_keys_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  ecode5 = SWIG_AsVal_size_t(swig_obj[2], &val5);
  if (!SWIG_IsOK(ecode5)) {
    SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "asset_pak_whitelistproof" "', argument " "5"" of type '" "size_t""'");
  } 
  arg5 = (size_t)(val5);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[3] == Py_None)
    arg7 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[3], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "asset_pak_whitelistproof" "', argument " "6"" of type '" "(const unsigned char* sub_pubkey, size_t sub_pubkey_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg6 = (unsigned char *) buf;
      arg7 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[4] == Py_None)
    arg9 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[4], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "asset_pak_whitelistproof" "', argument " "8"" of type '" "(const unsigned char* online_priv_key, size_t online_priv_key_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg8 = (unsigned char *) buf;
      arg9 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[5] == Py_None)
    arg11 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[5], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "asset_pak_whitelistproof" "', argument " "10"" of type '" "(const unsigned char* summed_key, size_t summed_key_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg10 = (unsigned char *) buf;
      arg11 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; void *buf = 0;
    Py_buffer view;
    res = PyObject_GetBuffer(swig_obj[6], &view, PyBUF_WRITABLE);
    if (res < 0) {
      PyErr_Clear();
      SWIG_exception_fail(SWIG_ArgError(res), "in method '" "asset_pak_whitelistproof" "', argument " "12"" of type '" "(unsigned char* bytes_out, size_t len)""'");
    }
    size = view.len;
    buf = view.buf;
    PyBuffer_Release(&view);
    arg12 = (unsigned char *) buf;
    arg13 = (size_t) (size/sizeof(unsigned char));
  }
  {
    result = (int)wally_asset_pak_whitelistproof((unsigned char const *)arg1,arg2,(unsigned char const *)arg3,arg4,arg5,(unsigned char const *)arg6,arg7,(unsigned char const *)arg8,arg9,(unsigned char const *)arg10,arg11,arg12,arg13,arg14);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg14);
  }
  return resultobj;
fail:
  return NULL;
}


SWIGINTERN PyObject *_wrap_asset_pak_whitelistproof_len(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
  PyObject *resultobj = 0;
  unsigned char *arg1 = (unsigned char *) 0 ;
  size_t arg2 ;
  unsigned char *arg3 = (unsigned char *) 0 ;
  size_t arg4 ;
  size_t arg5 ;
  unsigned char *arg6 = (unsigned char *) 0 ;
  size_t arg7 ;
  unsigned char *arg8 = (unsigned char *) 0 ;
  size_t arg9 ;
  unsigned char *arg10 = (unsigned char *) 0 ;
  size_t arg11 ;
  size_t *arg12 = (size_t *) 0 ;
  size_t val5 ;
  int ecode5 = 0 ;
  PyObject *swig_obj[6] ;
  int result;
  
  size_t written = 0; arg12 = (size_t *)&written;
  if (!SWIG_Python_UnpackTuple(args, "asset_pak_whitelistproof_len", 6, 6, swig_obj)) SWIG_fail;
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[0] == Py_None)
    arg2 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[0], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "asset_pak_whitelistproof_len" "', argument " "1"" of type '" "(const unsigned char* online_keys, size_t online_keys_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg1 = (unsigned char *) buf;
      arg2 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[1] == Py_None)
    arg4 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[1], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "asset_pak_whitelistproof_len" "', argument " "3"" of type '" "(const unsigned char* offline_keys, size_t offline_keys_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg3 = (unsigned char *) buf;
      arg4 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  ecode5 = SWIG_AsVal_size_t(swig_obj[2], &val5);
  if (!SWIG_IsOK(ecode5)) {
    SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "asset_pak_whitelistproof_len" "', argument " "5"" of type '" "size_t""'");
  } 
  arg5 = (size_t)(val5);
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[3] == Py_None)
    arg7 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[3], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "asset_pak_whitelistproof_len" "', argument " "6"" of type '" "(const unsigned char* sub_pubkey, size_t sub_pubkey_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg6 = (unsigned char *) buf;
      arg7 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[4] == Py_None)
    arg9 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[4], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "asset_pak_whitelistproof_len" "', argument " "8"" of type '" "(const unsigned char* online_priv_key, size_t online_priv_key_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg8 = (unsigned char *) buf;
      arg9 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    int res; Py_ssize_t size = 0; const void *buf = 0;
    Py_buffer view;
    if (swig_obj[5] == Py_None)
    arg11 = 0;
    else {
      res = PyObject_GetBuffer(swig_obj[5], &view, PyBUF_CONTIG_RO);
      if (res < 0) {
        PyErr_Clear();
        SWIG_exception_fail(SWIG_ArgError(res), "in method '" "asset_pak_whitelistproof_len" "', argument " "10"" of type '" "(const unsigned char* summed_key, size_t summed_key_len)""'");
      }
      size = view.len;
      buf = view.buf;
      PyBuffer_Release(&view);
      arg10 = (unsigned char *) buf;
      arg11 = (size_t) (size / sizeof(unsigned char const));
    }
  }
  {
    result = (int)wally_asset_pak_whitelistproof_len((unsigned char const *)arg1,arg2,(unsigned char const *)arg3,arg4,arg5,(unsigned char const *)arg6,arg7,(unsigned char const *)arg8,arg9,(unsigned char const *)arg10,arg11,arg12);
    if (check_result(result))
    SWIG_fail;
  }
  
  Py_IncRef(Py_None);
  resultobj = Py_None;
  
  {
    Py_DecRef(resultobj);
    resultobj = PyInt_FromSize_t(*arg12);
  }
  return resultobj;
fail:
  return NULL;
}


static PyMethodDef SwigMethods[] = {
	 { "SWIG_PyInstanceMethod_New", SWIG_PyInstanceMethod_New, METH_O, NULL},
	 { "init", _wrap_init, METH_O, NULL},
	 { "cleanup", _wrap_cleanup, METH_O, NULL},
	 { "get_build_version", _wrap_get_build_version, METH_NOARGS, NULL},
	 { "bzero", _wrap_bzero, METH_O, NULL},
	 { "free_string", _wrap_free_string, METH_O, NULL},
	 { "secp_randomize", _wrap_secp_randomize, METH_O, NULL},
	 { "hex_verify", _wrap_hex_verify, METH_O, NULL},
	 { "hex_n_verify", _wrap_hex_n_verify, METH_VARARGS, NULL},
	 { "hex_from_bytes", _wrap_hex_from_bytes, METH_O, NULL},
	 { "hex_to_bytes", _wrap_hex_to_bytes, METH_VARARGS, NULL},
	 { "hex_n_to_bytes", _wrap_hex_n_to_bytes, METH_VARARGS, NULL},
	 { "base58_from_bytes", _wrap_base58_from_bytes, METH_VARARGS, NULL},
	 { "base58_to_bytes", _wrap_base58_to_bytes, METH_VARARGS, NULL},
	 { "base58_n_to_bytes", _wrap_base58_n_to_bytes, METH_VARARGS, NULL},
	 { "base58_get_length", _wrap_base58_get_length, METH_O, NULL},
	 { "base58_n_get_length", _wrap_base58_n_get_length, METH_VARARGS, NULL},
	 { "base64_from_bytes", _wrap_base64_from_bytes, METH_VARARGS, NULL},
	 { "base64_to_bytes", _wrap_base64_to_bytes, METH_VARARGS, NULL},
	 { "base64_n_to_bytes", _wrap_base64_n_to_bytes, METH_VARARGS, NULL},
	 { "base64_get_maximum_length", _wrap_base64_get_maximum_length, METH_VARARGS, NULL},
	 { "base64_n_get_maximum_length", _wrap_base64_n_get_maximum_length, METH_VARARGS, NULL},
	 { "is_elements_build", _wrap_is_elements_build, METH_NOARGS, NULL},
	 { "addr_segwit_from_bytes", _wrap_addr_segwit_from_bytes, METH_VARARGS, NULL},
	 { "addr_segwit_to_bytes", _wrap_addr_segwit_to_bytes, METH_VARARGS, NULL},
	 { "addr_segwit_n_to_bytes", _wrap_addr_segwit_n_to_bytes, METH_VARARGS, NULL},
	 { "addr_segwit_get_version", _wrap_addr_segwit_get_version, METH_VARARGS, NULL},
	 { "addr_segwit_n_get_version", _wrap_addr_segwit_n_get_version, METH_VARARGS, NULL},
	 { "address_to_scriptpubkey", _wrap_address_to_scriptpubkey, METH_VARARGS, NULL},
	 { "scriptpubkey_to_address", _wrap_scriptpubkey_to_address, METH_VARARGS, NULL},
	 { "wif_from_bytes", _wrap_wif_from_bytes, METH_VARARGS, NULL},
	 { "wif_to_bytes", _wrap_wif_to_bytes, METH_VARARGS, NULL},
	 { "wif_is_uncompressed", _wrap_wif_is_uncompressed, METH_O, NULL},
	 { "wif_to_public_key", _wrap_wif_to_public_key, METH_VARARGS, NULL},
	 { "bip32_key_to_address", _wrap_bip32_key_to_address, METH_VARARGS, NULL},
	 { "bip32_key_to_addr_segwit", _wrap_bip32_key_to_addr_segwit, METH_VARARGS, NULL},
	 { "wif_to_address", _wrap_wif_to_address, METH_VARARGS, NULL},
	 { "confidential_addr_to_addr", _wrap_confidential_addr_to_addr, METH_VARARGS, NULL},
	 { "confidential_addr_to_ec_public_key", _wrap_confidential_addr_to_ec_public_key, METH_VARARGS, NULL},
	 { "confidential_addr_from_addr", _wrap_confidential_addr_from_addr, METH_VARARGS, NULL},
	 { "confidential_addr_to_addr_segwit", _wrap_confidential_addr_to_addr_segwit, METH_VARARGS, NULL},
	 { "confidential_addr_segwit_to_ec_public_key", _wrap_confidential_addr_segwit_to_ec_public_key, METH_VARARGS, NULL},
	 { "confidential_addr_from_addr_segwit", _wrap_confidential_addr_from_addr_segwit, METH_VARARGS, NULL},
	 { "ae_host_commit_from_bytes", _wrap_ae_host_commit_from_bytes, METH_VARARGS, NULL},
	 { "ae_signer_commit_from_bytes", _wrap_ae_signer_commit_from_bytes, METH_VARARGS, NULL},
	 { "ae_sig_from_bytes", _wrap_ae_sig_from_bytes, METH_VARARGS, NULL},
	 { "ae_verify", _wrap_ae_verify, METH_VARARGS, NULL},
	 { "bip32_key_free", _wrap_bip32_key_free, METH_O, NULL},
	 { "bip32_key_init_alloc", _wrap_bip32_key_init_alloc, METH_VARARGS, NULL},
	 { "bip32_key_from_seed_custom_alloc", _wrap_bip32_key_from_seed_custom_alloc, METH_VARARGS, NULL},
	 { "bip32_key_from_seed_alloc", _wrap_bip32_key_from_seed_alloc, METH_VARARGS, NULL},
	 { "bip32_key_serialize", _wrap_bip32_key_serialize, METH_VARARGS, NULL},
	 { "bip32_key_unserialize_alloc", _wrap_bip32_key_unserialize_alloc, METH_O, NULL},
	 { "bip32_key_from_parent_alloc", _wrap_bip32_key_from_parent_alloc, METH_VARARGS, NULL},
	 { "bip32_key_from_parent_path_alloc", _wrap_bip32_key_from_parent_path_alloc, METH_VARARGS, NULL},
	 { "bip32_key_from_parent_path_str_alloc", _wrap_bip32_key_from_parent_path_str_alloc, METH_VARARGS, NULL},
	 { "bip32_key_from_parent_path_str_n_alloc", _wrap_bip32_key_from_parent_path_str_n_alloc, METH_VARARGS, NULL},
	 { "bip32_key_with_tweak_from_parent_path_alloc", _wrap_bip32_key_with_tweak_from_parent_path_alloc, METH_VARARGS, NULL},
	 { "bip32_key_to_base58", _wrap_bip32_key_to_base58, METH_VARARGS, NULL},
	 { "bip32_key_from_base58_alloc", _wrap_bip32_key_from_base58_alloc, METH_O, NULL},
	 { "bip32_key_from_base58_n_alloc", _wrap_bip32_key_from_base58_n_alloc, METH_VARARGS, NULL},
	 { "bip32_key_strip_private_key", _wrap_bip32_key_strip_private_key, METH_O, NULL},
	 { "bip32_key_get_fingerprint", _wrap_bip32_key_get_fingerprint, METH_VARARGS, NULL},
	 { "bip32_path_from_str_len", _wrap_bip32_path_from_str_len, METH_VARARGS, NULL},
	 { "bip32_path_from_str", _wrap_bip32_path_from_str, METH_VARARGS, NULL},
	 { "bip32_path_from_str_n_len", _wrap_bip32_path_from_str_n_len, METH_VARARGS, NULL},
	 { "bip32_path_from_str_n", _wrap_bip32_path_from_str_n, METH_VARARGS, NULL},
	 { "bip32_path_str_get_features", _wrap_bip32_path_str_get_features, METH_O, NULL},
	 { "bip32_path_str_n_get_features", _wrap_bip32_path_str_n_get_features, METH_VARARGS, NULL},
	 { "bip32_key_get_chain_code", _wrap_bip32_key_get_chain_code, METH_VARARGS, NULL},
	 { "bip32_key_get_parent160", _wrap_bip32_key_get_parent160, METH_VARARGS, NULL},
	 { "bip32_key_get_priv_key", _wrap_bip32_key_get_priv_key, METH_VARARGS, NULL},
	 { "bip32_key_get_hash160", _wrap_bip32_key_get_hash160, METH_VARARGS, NULL},
	 { "bip32_key_get_pub_key", _wrap_bip32_key_get_pub_key, METH_VARARGS, NULL},
	 { "bip32_key_get_pub_key_tweak_sum", _wrap_bip32_key_get_pub_key_tweak_sum, METH_VARARGS, NULL},
	 { "bip32_key_get_depth", _wrap_bip32_key_get_depth, METH_O, NULL},
	 { "bip32_key_get_child_num", _wrap_bip32_key_get_child_num, METH_O, NULL},
	 { "bip32_key_get_version", _wrap_bip32_key_get_version, METH_O, NULL},
	 { "bip38_raw_from_private_key", _wrap_bip38_raw_from_private_key, METH_VARARGS, NULL},
	 { "bip38_from_private_key", _wrap_bip38_from_private_key, METH_VARARGS, NULL},
	 { "bip38_raw_to_private_key", _wrap_bip38_raw_to_private_key, METH_VARARGS, NULL},
	 { "bip38_to_private_key", _wrap_bip38_to_private_key, METH_VARARGS, NULL},
	 { "bip38_raw_get_flags", _wrap_bip38_raw_get_flags, METH_O, NULL},
	 { "bip38_get_flags", _wrap_bip38_get_flags, METH_O, NULL},
	 { "bip39_get_languages", _wrap_bip39_get_languages, METH_NOARGS, NULL},
	 { "bip39_get_wordlist", _wrap_bip39_get_wordlist, METH_O, NULL},
	 { "bip39_get_word", _wrap_bip39_get_word, METH_VARARGS, NULL},
	 { "bip39_mnemonic_from_bytes", _wrap_bip39_mnemonic_from_bytes, METH_VARARGS, NULL},
	 { "bip39_mnemonic_to_bytes", _wrap_bip39_mnemonic_to_bytes, METH_VARARGS, NULL},
	 { "bip39_mnemonic_validate", _wrap_bip39_mnemonic_validate, METH_VARARGS, NULL},
	 { "bip39_mnemonic_to_seed", _wrap_bip39_mnemonic_to_seed, METH_VARARGS, NULL},
	 { "bip39_mnemonic_to_seed512", _wrap_bip39_mnemonic_to_seed512, METH_VARARGS, NULL},
	 { "bip85_get_languages", _wrap_bip85_get_languages, METH_NOARGS, NULL},
	 { "bip85_get_bip39_entropy", _wrap_bip85_get_bip39_entropy, METH_VARARGS, NULL},
	 { "bip85_get_rsa_entropy", _wrap_bip85_get_rsa_entropy, METH_VARARGS, NULL},
	 { "coinselect_assets", _wrap_coinselect_assets, METH_VARARGS, NULL},
	 { "scrypt", _wrap_scrypt, METH_VARARGS, NULL},
	 { "aes_len", _wrap_aes_len, METH_VARARGS, NULL},
	 { "aes", _wrap_aes, METH_VARARGS, NULL},
	 { "aes_cbc_get_maximum_length", _wrap_aes_cbc_get_maximum_length, METH_VARARGS, NULL},
	 { "aes_cbc", _wrap_aes_cbc, METH_VARARGS, NULL},
	 { "sha256", _wrap_sha256, METH_VARARGS, NULL},
	 { "sha256_midstate", _wrap_sha256_midstate, METH_VARARGS, NULL},
	 { "sha256d", _wrap_sha256d, METH_VARARGS, NULL},
	 { "sha512", _wrap_sha512, METH_VARARGS, NULL},
	 { "bip340_tagged_hash", _wrap_bip340_tagged_hash, METH_VARARGS, NULL},
	 { "ripemd160", _wrap_ripemd160, METH_VARARGS, NULL},
	 { "hash160", _wrap_hash160, METH_VARARGS, NULL},
	 { "hmac_sha256", _wrap_hmac_sha256, METH_VARARGS, NULL},
	 { "hmac_sha512", _wrap_hmac_sha512, METH_VARARGS, NULL},
	 { "pbkdf2_hmac_sha256", _wrap_pbkdf2_hmac_sha256, METH_VARARGS, NULL},
	 { "pbkdf2_hmac_sha512", _wrap_pbkdf2_hmac_sha512, METH_VARARGS, NULL},
	 { "ec_private_key_verify", _wrap_ec_private_key_verify, METH_O, NULL},
	 { "ec_public_key_verify", _wrap_ec_public_key_verify, METH_O, NULL},
	 { "ec_xonly_public_key_verify", _wrap_ec_xonly_public_key_verify, METH_O, NULL},
	 { "ec_public_key_from_private_key", _wrap_ec_public_key_from_private_key, METH_VARARGS, NULL},
	 { "ec_public_key_decompress", _wrap_ec_public_key_decompress, METH_VARARGS, NULL},
	 { "ec_public_key_negate", _wrap_ec_public_key_negate, METH_VARARGS, NULL},
	 { "ec_public_key_tweak", _wrap_ec_public_key_tweak, METH_VARARGS, NULL},
	 { "ec_public_key_bip341_tweak", _wrap_ec_public_key_bip341_tweak, METH_VARARGS, NULL},
	 { "ec_private_key_bip341_tweak", _wrap_ec_private_key_bip341_tweak, METH_VARARGS, NULL},
	 { "ec_sig_from_bytes_len", _wrap_ec_sig_from_bytes_len, METH_VARARGS, NULL},
	 { "ec_sig_from_bytes", _wrap_ec_sig_from_bytes, METH_VARARGS, NULL},
	 { "ec_sig_from_bytes_aux_len", _wrap_ec_sig_from_bytes_aux_len, METH_VARARGS, NULL},
	 { "ec_sig_from_bytes_aux", _wrap_ec_sig_from_bytes_aux, METH_VARARGS, NULL},
	 { "ec_sig_normalize", _wrap_ec_sig_normalize, METH_VARARGS, NULL},
	 { "ec_sig_to_der", _wrap_ec_sig_to_der, METH_VARARGS, NULL},
	 { "ec_sig_from_der", _wrap_ec_sig_from_der, METH_VARARGS, NULL},
	 { "ec_sig_verify", _wrap_ec_sig_verify, METH_VARARGS, NULL},
	 { "ec_sig_to_public_key", _wrap_ec_sig_to_public_key, METH_VARARGS, NULL},
	 { "ec_scalar_verify", _wrap_ec_scalar_verify, METH_O, NULL},
	 { "ec_scalar_add", _wrap_ec_scalar_add, METH_VARARGS, NULL},
	 { "ec_scalar_subtract", _wrap_ec_scalar_subtract, METH_VARARGS, NULL},
	 { "ec_scalar_multiply", _wrap_ec_scalar_multiply, METH_VARARGS, NULL},
	 { "format_bitcoin_message", _wrap_format_bitcoin_message, METH_VARARGS, NULL},
	 { "ecdh", _wrap_ecdh, METH_VARARGS, NULL},
	 { "s2c_sig_from_bytes", _wrap_s2c_sig_from_bytes, METH_VARARGS, NULL},
	 { "s2c_commitment_verify", _wrap_s2c_commitment_verify, METH_VARARGS, NULL},
	 { "aes_cbc_with_ecdh_key_get_maximum_length", _wrap_aes_cbc_with_ecdh_key_get_maximum_length, METH_VARARGS, NULL},
	 { "aes_cbc_with_ecdh_key", _wrap_aes_cbc_with_ecdh_key, METH_VARARGS, NULL},
	 { "descriptor_parse", _wrap_descriptor_parse, METH_VARARGS, NULL},
	 { "descriptor_free", _wrap_descriptor_free, METH_O, NULL},
	 { "descriptor_canonicalize", _wrap_descriptor_canonicalize, METH_VARARGS, NULL},
	 { "descriptor_get_checksum", _wrap_descriptor_get_checksum, METH_VARARGS, NULL},
	 { "descriptor_get_network", _wrap_descriptor_get_network, METH_O, NULL},
	 { "descriptor_set_network", _wrap_descriptor_set_network, METH_VARARGS, NULL},
	 { "descriptor_get_features", _wrap_descriptor_get_features, METH_O, NULL},
	 { "descriptor_get_num_variants", _wrap_descriptor_get_num_variants, METH_O, NULL},
	 { "descriptor_get_num_paths", _wrap_descriptor_get_num_paths, METH_O, NULL},
	 { "descriptor_get_depth", _wrap_descriptor_get_depth, METH_O, NULL},
	 { "descriptor_get_num_keys", _wrap_descriptor_get_num_keys, METH_O, NULL},
	 { "descriptor_get_key", _wrap_descriptor_get_key, METH_VARARGS, NULL},
	 { "descriptor_get_key_features", _wrap_descriptor_get_key_features, METH_VARARGS, NULL},
	 { "descriptor_get_key_child_path_str_len", _wrap_descriptor_get_key_child_path_str_len, METH_VARARGS, NULL},
	 { "descriptor_get_key_child_path_str", _wrap_descriptor_get_key_child_path_str, METH_VARARGS, NULL},
	 { "descriptor_get_key_origin_fingerprint", _wrap_descriptor_get_key_origin_fingerprint, METH_VARARGS, NULL},
	 { "descriptor_get_key_origin_path_str_len", _wrap_descriptor_get_key_origin_path_str_len, METH_VARARGS, NULL},
	 { "descriptor_get_key_origin_path_str", _wrap_descriptor_get_key_origin_path_str, METH_VARARGS, NULL},
	 { "descriptor_to_script_get_maximum_length", _wrap_descriptor_to_script_get_maximum_length, METH_VARARGS, NULL},
	 { "descriptor_to_script", _wrap_descriptor_to_script, METH_VARARGS, NULL},
	 { "descriptor_to_address", _wrap_descriptor_to_address, METH_VARARGS, NULL},
	 { "descriptor_to_addresses", _wrap_descriptor_to_addresses, METH_VARARGS, NULL},
	 { "map_init_alloc", _wrap_map_init_alloc, METH_VARARGS, NULL},
	 { "map_free", _wrap_map_free, METH_O, NULL},
	 { "map_clear", _wrap_map_clear, METH_O, NULL},
	 { "map_add", _wrap_map_add, METH_VARARGS, NULL},
	 { "map_add_integer", _wrap_map_add_integer, METH_VARARGS, NULL},
	 { "map_replace", _wrap_map_replace, METH_VARARGS, NULL},
	 { "map_replace_integer", _wrap_map_replace_integer, METH_VARARGS, NULL},
	 { "map_remove", _wrap_map_remove, METH_VARARGS, NULL},
	 { "map_remove_integer", _wrap_map_remove_integer, METH_VARARGS, NULL},
	 { "map_find_from", _wrap_map_find_from, METH_VARARGS, NULL},
	 { "map_find", _wrap_map_find, METH_VARARGS, NULL},
	 { "map_find_integer", _wrap_map_find_integer, METH_VARARGS, NULL},
	 { "map_get_num_items", _wrap_map_get_num_items, METH_O, NULL},
	 { "map_get_item_key_length", _wrap_map_get_item_key_length, METH_VARARGS, NULL},
	 { "map_get_item_key", _wrap_map_get_item_key, METH_VARARGS, NULL},
	 { "map_get_item_integer_key", _wrap_map_get_item_integer_key, METH_VARARGS, NULL},
	 { "map_get_item_length", _wrap_map_get_item_length, METH_VARARGS, NULL},
	 { "map_get_item", _wrap_map_get_item, METH_VARARGS, NULL},
	 { "map_sort", _wrap_map_sort, METH_VARARGS, NULL},
	 { "map_combine", _wrap_map_combine, METH_VARARGS, NULL},
	 { "map_assign", _wrap_map_assign, METH_VARARGS, NULL},
	 { "map_find_bip32_public_key_from", _wrap_map_find_bip32_public_key_from, METH_VARARGS, NULL},
	 { "map_keypath_get_bip32_key_from_alloc", _wrap_map_keypath_get_bip32_key_from_alloc, METH_VARARGS, NULL},
	 { "keypath_bip32_verify", _wrap_keypath_bip32_verify, METH_VARARGS, NULL},
	 { "keypath_public_key_verify", _wrap_keypath_public_key_verify, METH_VARARGS, NULL},
	 { "keypath_xonly_public_key_verify", _wrap_keypath_xonly_public_key_verify, METH_VARARGS, NULL},
	 { "merkle_path_xonly_public_key_verify", _wrap_merkle_path_xonly_public_key_verify, METH_VARARGS, NULL},
	 { "bip341_control_block_verify", _wrap_bip341_control_block_verify, METH_O, NULL},
	 { "map_keypath_bip32_init_alloc", _wrap_map_keypath_bip32_init_alloc, METH_O, NULL},
	 { "map_keypath_public_key_init_alloc", _wrap_map_keypath_public_key_init_alloc, METH_O, NULL},
	 { "map_keypath_add", _wrap_map_keypath_add, METH_VARARGS, NULL},
	 { "map_merkle_path_add", _wrap_map_merkle_path_add, METH_VARARGS, NULL},
	 { "keypath_get_fingerprint", _wrap_keypath_get_fingerprint, METH_VARARGS, NULL},
	 { "map_keypath_get_item_fingerprint", _wrap_map_keypath_get_item_fingerprint, METH_VARARGS, NULL},
	 { "keypath_get_path_len", _wrap_keypath_get_path_len, METH_O, NULL},
	 { "map_keypath_get_item_path_len", _wrap_map_keypath_get_item_path_len, METH_VARARGS, NULL},
	 { "keypath_get_path", _wrap_keypath_get_path, METH_VARARGS, NULL},
	 { "map_keypath_get_item_path", _wrap_map_keypath_get_item_path, METH_VARARGS, NULL},
	 { "map_hash_preimage_verify", _wrap_map_hash_preimage_verify, METH_VARARGS, NULL},
	 { "map_preimage_init_alloc", _wrap_map_preimage_init_alloc, METH_O, NULL},
	 { "map_preimage_ripemd160_add", _wrap_map_preimage_ripemd160_add, METH_VARARGS, NULL},
	 { "map_preimage_sha256_add", _wrap_map_preimage_sha256_add, METH_VARARGS, NULL},
	 { "map_preimage_hash160_add", _wrap_map_preimage_hash160_add, METH_VARARGS, NULL},
	 { "map_preimage_sha256d_add", _wrap_map_preimage_sha256d_add, METH_VARARGS, NULL},
	 { "psbt_input_set_previous_txid", _wrap_psbt_input_set_previous_txid, METH_VARARGS, NULL},
	 { "psbt_input_set_output_index", _wrap_psbt_input_set_output_index, METH_VARARGS, NULL},
	 { "psbt_input_set_sequence", _wrap_psbt_input_set_sequence, METH_VARARGS, NULL},
	 { "psbt_input_clear_sequence", _wrap_psbt_input_clear_sequence, METH_O, NULL},
	 { "psbt_input_set_utxo", _wrap_psbt_input_set_utxo, METH_VARARGS, NULL},
	 { "psbt_input_set_witness_utxo", _wrap_psbt_input_set_witness_utxo, METH_VARARGS, NULL},
	 { "psbt_input_set_witness_utxo_from_tx", _wrap_psbt_input_set_witness_utxo_from_tx, METH_VARARGS, NULL},
	 { "psbt_input_set_redeem_script", _wrap_psbt_input_set_redeem_script, METH_VARARGS, NULL},
	 { "psbt_input_set_witness_script", _wrap_psbt_input_set_witness_script, METH_VARARGS, NULL},
	 { "psbt_input_set_final_scriptsig", _wrap_psbt_input_set_final_scriptsig, METH_VARARGS, NULL},
	 { "psbt_input_set_final_witness", _wrap_psbt_input_set_final_witness, METH_VARARGS, NULL},
	 { "psbt_input_set_keypaths", _wrap_psbt_input_set_keypaths, METH_VARARGS, NULL},
	 { "psbt_input_find_keypath", _wrap_psbt_input_find_keypath, METH_VARARGS, NULL},
	 { "psbt_input_keypath_add", _wrap_psbt_input_keypath_add, METH_VARARGS, NULL},
	 { "psbt_input_taproot_keypath_add", _wrap_psbt_input_taproot_keypath_add, METH_VARARGS, NULL},
	 { "psbt_input_set_signatures", _wrap_psbt_input_set_signatures, METH_VARARGS, NULL},
	 { "psbt_input_set_taproot_signature", _wrap_psbt_input_set_taproot_signature, METH_VARARGS, NULL},
	 { "psbt_input_set_taproot_internal_key", _wrap_psbt_input_set_taproot_internal_key, METH_VARARGS, NULL},
	 { "psbt_input_find_signature", _wrap_psbt_input_find_signature, METH_VARARGS, NULL},
	 { "psbt_input_add_signature", _wrap_psbt_input_add_signature, METH_VARARGS, NULL},
	 { "psbt_input_set_unknowns", _wrap_psbt_input_set_unknowns, METH_VARARGS, NULL},
	 { "psbt_input_find_unknown", _wrap_psbt_input_find_unknown, METH_VARARGS, NULL},
	 { "psbt_input_set_sighash", _wrap_psbt_input_set_sighash, METH_VARARGS, NULL},
	 { "psbt_input_set_required_locktime", _wrap_psbt_input_set_required_locktime, METH_VARARGS, NULL},
	 { "psbt_input_clear_required_locktime", _wrap_psbt_input_clear_required_locktime, METH_O, NULL},
	 { "psbt_input_set_required_lockheight", _wrap_psbt_input_set_required_lockheight, METH_VARARGS, NULL},
	 { "psbt_input_clear_required_lockheight", _wrap_psbt_input_clear_required_lockheight, METH_O, NULL},
	 { "psbt_input_set_amount", _wrap_psbt_input_set_amount, METH_VARARGS, NULL},
	 { "psbt_input_get_amount_rangeproof", _wrap_psbt_input_get_amount_rangeproof, METH_VARARGS, NULL},
	 { "psbt_input_get_amount_rangeproof_len", _wrap_psbt_input_get_amount_rangeproof_len, METH_O, NULL},
	 { "psbt_input_set_amount_rangeproof", _wrap_psbt_input_set_amount_rangeproof, METH_VARARGS, NULL},
	 { "psbt_input_clear_amount_rangeproof", _wrap_psbt_input_clear_amount_rangeproof, METH_O, NULL},
	 { "psbt_input_get_asset", _wrap_psbt_input_get_asset, METH_VARARGS, NULL},
	 { "psbt_input_get_asset_len", _wrap_psbt_input_get_asset_len, METH_O, NULL},
	 { "psbt_input_set_asset", _wrap_psbt_input_set_asset, METH_VARARGS, NULL},
	 { "psbt_input_clear_asset", _wrap_psbt_input_clear_asset, METH_O, NULL},
	 { "psbt_input_get_asset_surjectionproof", _wrap_psbt_input_get_asset_surjectionproof, METH_VARARGS, NULL},
	 { "psbt_input_get_asset_surjectionproof_len", _wrap_psbt_input_get_asset_surjectionproof_len, METH_O, NULL},
	 { "psbt_input_set_asset_surjectionproof", _wrap_psbt_input_set_asset_surjectionproof, METH_VARARGS, NULL},
	 { "psbt_input_clear_asset_surjectionproof", _wrap_psbt_input_clear_asset_surjectionproof, METH_O, NULL},
	 { "psbt_input_set_issuance_amount", _wrap_psbt_input_set_issuance_amount, METH_VARARGS, NULL},
	 { "psbt_input_set_inflation_keys", _wrap_psbt_input_set_inflation_keys, METH_VARARGS, NULL},
	 { "psbt_input_set_pegin_amount", _wrap_psbt_input_set_pegin_amount, METH_VARARGS, NULL},
	 { "psbt_input_set_pegin_tx", _wrap_psbt_input_set_pegin_tx, METH_VARARGS, NULL},
	 { "psbt_input_set_pegin_witness", _wrap_psbt_input_set_pegin_witness, METH_VARARGS, NULL},
	 { "psbt_input_get_pegin_txout_proof", _wrap_psbt_input_get_pegin_txout_proof, METH_VARARGS, NULL},
	 { "psbt_input_get_pegin_txout_proof_len", _wrap_psbt_input_get_pegin_txout_proof_len, METH_O, NULL},
	 { "psbt_input_set_pegin_txout_proof", _wrap_psbt_input_set_pegin_txout_proof, METH_VARARGS, NULL},
	 { "psbt_input_clear_pegin_txout_proof", _wrap_psbt_input_clear_pegin_txout_proof, METH_O, NULL},
	 { "psbt_input_get_pegin_genesis_blockhash", _wrap_psbt_input_get_pegin_genesis_blockhash, METH_VARARGS, NULL},
	 { "psbt_input_get_pegin_genesis_blockhash_len", _wrap_psbt_input_get_pegin_genesis_blockhash_len, METH_O, NULL},
	 { "psbt_input_set_pegin_genesis_blockhash", _wrap_psbt_input_set_pegin_genesis_blockhash, METH_VARARGS, NULL},
	 { "psbt_input_clear_pegin_genesis_blockhash", _wrap_psbt_input_clear_pegin_genesis_blockhash, METH_O, NULL},
	 { "psbt_input_get_pegin_claim_script", _wrap_psbt_input_get_pegin_claim_script, METH_VARARGS, NULL},
	 { "psbt_input_get_pegin_claim_script_len", _wrap_psbt_input_get_pegin_claim_script_len, METH_O, NULL},
	 { "psbt_input_set_pegin_claim_script", _wrap_psbt_input_set_pegin_claim_script, METH_VARARGS, NULL},
	 { "psbt_input_clear_pegin_claim_script", _wrap_psbt_input_clear_pegin_claim_script, METH_O, NULL},
	 { "psbt_input_get_issuance_amount_commitment", _wrap_psbt_input_get_issuance_amount_commitment, METH_VARARGS, NULL},
	 { "psbt_input_get_issuance_amount_commitment_len", _wrap_psbt_input_get_issuance_amount_commitment_len, METH_O, NULL},
	 { "psbt_input_set_issuance_amount_commitment", _wrap_psbt_input_set_issuance_amount_commitment, METH_VARARGS, NULL},
	 { "psbt_input_clear_issuance_amount_commitment", _wrap_psbt_input_clear_issuance_amount_commitment, METH_O, NULL},
	 { "psbt_input_get_issuance_amount_rangeproof", _wrap_psbt_input_get_issuance_amount_rangeproof, METH_VARARGS, NULL},
	 { "psbt_input_get_issuance_amount_rangeproof_len", _wrap_psbt_input_get_issuance_amount_rangeproof_len, METH_O, NULL},
	 { "psbt_input_set_issuance_amount_rangeproof", _wrap_psbt_input_set_issuance_amount_rangeproof, METH_VARARGS, NULL},
	 { "psbt_input_clear_issuance_amount_rangeproof", _wrap_psbt_input_clear_issuance_amount_rangeproof, METH_O, NULL},
	 { "psbt_input_get_issuance_blinding_nonce", _wrap_psbt_input_get_issuance_blinding_nonce, METH_VARARGS, NULL},
	 { "psbt_input_get_issuance_blinding_nonce_len", _wrap_psbt_input_get_issuance_blinding_nonce_len, METH_O, NULL},
	 { "psbt_input_set_issuance_blinding_nonce", _wrap_psbt_input_set_issuance_blinding_nonce, METH_VARARGS, NULL},
	 { "psbt_input_clear_issuance_blinding_nonce", _wrap_psbt_input_clear_issuance_blinding_nonce, METH_O, NULL},
	 { "psbt_input_get_issuance_asset_entropy", _wrap_psbt_input_get_issuance_asset_entropy, METH_VARARGS, NULL},
	 { "psbt_input_get_issuance_asset_entropy_len", _wrap_psbt_input_get_issuance_asset_entropy_len, METH_O, NULL},
	 { "psbt_input_set_issuance_asset_entropy", _wrap_psbt_input_set_issuance_asset_entropy, METH_VARARGS, NULL},
	 { "psbt_input_clear_issuance_asset_entropy", _wrap_psbt_input_clear_issuance_asset_entropy, METH_O, NULL},
	 { "psbt_input_get_issuance_amount_blinding_rangeproof", _wrap_psbt_input_get_issuance_amount_blinding_rangeproof, METH_VARARGS, NULL},
	 { "psbt_input_get_issuance_amount_blinding_rangeproof_len", _wrap_psbt_input_get_issuance_amount_blinding_rangeproof_len, METH_O, NULL},
	 { "psbt_input_set_issuance_amount_blinding_rangeproof", _wrap_psbt_input_set_issuance_amount_blinding_rangeproof, METH_VARARGS, NULL},
	 { "psbt_input_clear_issuance_amount_blinding_rangeproof", _wrap_psbt_input_clear_issuance_amount_blinding_rangeproof, METH_O, NULL},
	 { "psbt_input_get_inflation_keys_commitment", _wrap_psbt_input_get_inflation_keys_commitment, METH_VARARGS, NULL},
	 { "psbt_input_get_inflation_keys_commitment_len", _wrap_psbt_input_get_inflation_keys_commitment_len, METH_O, NULL},
	 { "psbt_input_set_inflation_keys_commitment", _wrap_psbt_input_set_inflation_keys_commitment, METH_VARARGS, NULL},
	 { "psbt_input_clear_inflation_keys_commitment", _wrap_psbt_input_clear_inflation_keys_commitment, METH_O, NULL},
	 { "psbt_input_get_inflation_keys_rangeproof", _wrap_psbt_input_get_inflation_keys_rangeproof, METH_VARARGS, NULL},
	 { "psbt_input_get_inflation_keys_rangeproof_len", _wrap_psbt_input_get_inflation_keys_rangeproof_len, METH_O, NULL},
	 { "psbt_input_set_inflation_keys_rangeproof", _wrap_psbt_input_set_inflation_keys_rangeproof, METH_VARARGS, NULL},
	 { "psbt_input_clear_inflation_keys_rangeproof", _wrap_psbt_input_clear_inflation_keys_rangeproof, METH_O, NULL},
	 { "psbt_input_get_inflation_keys_blinding_rangeproof", _wrap_psbt_input_get_inflation_keys_blinding_rangeproof, METH_VARARGS, NULL},
	 { "psbt_input_get_inflation_keys_blinding_rangeproof_len", _wrap_psbt_input_get_inflation_keys_blinding_rangeproof_len, METH_O, NULL},
	 { "psbt_input_set_inflation_keys_blinding_rangeproof", _wrap_psbt_input_set_inflation_keys_blinding_rangeproof, METH_VARARGS, NULL},
	 { "psbt_input_clear_inflation_keys_blinding_rangeproof", _wrap_psbt_input_clear_inflation_keys_blinding_rangeproof, METH_O, NULL},
	 { "psbt_input_get_utxo_rangeproof", _wrap_psbt_input_get_utxo_rangeproof, METH_VARARGS, NULL},
	 { "psbt_input_get_utxo_rangeproof_len", _wrap_psbt_input_get_utxo_rangeproof_len, METH_O, NULL},
	 { "psbt_input_set_utxo_rangeproof", _wrap_psbt_input_set_utxo_rangeproof, METH_VARARGS, NULL},
	 { "psbt_input_clear_utxo_rangeproof", _wrap_psbt_input_clear_utxo_rangeproof, METH_O, NULL},
	 { "psbt_input_generate_explicit_proofs", _wrap_psbt_input_generate_explicit_proofs, METH_VARARGS, NULL},
	 { "psbt_input_is_finalized", _wrap_psbt_input_is_finalized, METH_O, NULL},
	 { "psbt_output_set_redeem_script", _wrap_psbt_output_set_redeem_script, METH_VARARGS, NULL},
	 { "psbt_output_set_witness_script", _wrap_psbt_output_set_witness_script, METH_VARARGS, NULL},
	 { "psbt_output_set_keypaths", _wrap_psbt_output_set_keypaths, METH_VARARGS, NULL},
	 { "psbt_output_find_keypath", _wrap_psbt_output_find_keypath, METH_VARARGS, NULL},
	 { "psbt_output_keypath_add", _wrap_psbt_output_keypath_add, METH_VARARGS, NULL},
	 { "psbt_output_taproot_keypath_add", _wrap_psbt_output_taproot_keypath_add, METH_VARARGS, NULL},
	 { "psbt_output_set_unknowns", _wrap_psbt_output_set_unknowns, METH_VARARGS, NULL},
	 { "psbt_output_find_unknown", _wrap_psbt_output_find_unknown, METH_VARARGS, NULL},
	 { "psbt_output_set_amount", _wrap_psbt_output_set_amount, METH_VARARGS, NULL},
	 { "psbt_output_clear_amount", _wrap_psbt_output_clear_amount, METH_O, NULL},
	 { "psbt_output_set_script", _wrap_psbt_output_set_script, METH_VARARGS, NULL},
	 { "psbt_output_set_taproot_internal_key", _wrap_psbt_output_set_taproot_internal_key, METH_VARARGS, NULL},
	 { "psbt_output_set_blinder_index", _wrap_psbt_output_set_blinder_index, METH_VARARGS, NULL},
	 { "psbt_output_clear_blinder_index", _wrap_psbt_output_clear_blinder_index, METH_O, NULL},
	 { "psbt_output_get_value_commitment", _wrap_psbt_output_get_value_commitment, METH_VARARGS, NULL},
	 { "psbt_output_get_value_commitment_len", _wrap_psbt_output_get_value_commitment_len, METH_O, NULL},
	 { "psbt_output_set_value_commitment", _wrap_psbt_output_set_value_commitment, METH_VARARGS, NULL},
	 { "psbt_output_clear_value_commitment", _wrap_psbt_output_clear_value_commitment, METH_O, NULL},
	 { "psbt_output_get_asset", _wrap_psbt_output_get_asset, METH_VARARGS, NULL},
	 { "psbt_output_get_asset_len", _wrap_psbt_output_get_asset_len, METH_O, NULL},
	 { "psbt_output_set_asset", _wrap_psbt_output_set_asset, METH_VARARGS, NULL},
	 { "psbt_output_clear_asset", _wrap_psbt_output_clear_asset, METH_O, NULL},
	 { "psbt_output_get_asset_commitment", _wrap_psbt_output_get_asset_commitment, METH_VARARGS, NULL},
	 { "psbt_output_get_asset_commitment_len", _wrap_psbt_output_get_asset_commitment_len, METH_O, NULL},
	 { "psbt_output_set_asset_commitment", _wrap_psbt_output_set_asset_commitment, METH_VARARGS, NULL},
	 { "psbt_output_clear_asset_commitment", _wrap_psbt_output_clear_asset_commitment, METH_O, NULL},
	 { "psbt_output_get_value_rangeproof", _wrap_psbt_output_get_value_rangeproof, METH_VARARGS, NULL},
	 { "psbt_output_get_value_rangeproof_len", _wrap_psbt_output_get_value_rangeproof_len, METH_O, NULL},
	 { "psbt_output_set_value_rangeproof", _wrap_psbt_output_set_value_rangeproof, METH_VARARGS, NULL},
	 { "psbt_output_clear_value_rangeproof", _wrap_psbt_output_clear_value_rangeproof, METH_O, NULL},
	 { "psbt_output_get_asset_surjectionproof", _wrap_psbt_output_get_asset_surjectionproof, METH_VARARGS, NULL},
	 { "psbt_output_get_asset_surjectionproof_len", _wrap_psbt_output_get_asset_surjectionproof_len, METH_O, NULL},
	 { "psbt_output_set_asset_surjectionproof", _wrap_psbt_output_set_asset_surjectionproof, METH_VARARGS, NULL},
	 { "psbt_output_clear_asset_surjectionproof", _wrap_psbt_output_clear_asset_surjectionproof, METH_O, NULL},
	 { "psbt_output_get_blinding_public_key", _wrap_psbt_output_get_blinding_public_key, METH_VARARGS, NULL},
	 { "psbt_output_get_blinding_public_key_len", _wrap_psbt_output_get_blinding_public_key_len, METH_O, NULL},
	 { "psbt_output_set_blinding_public_key", _wrap_psbt_output_set_blinding_public_key, METH_VARARGS, NULL},
	 { "psbt_output_clear_blinding_public_key", _wrap_psbt_output_clear_blinding_public_key, METH_O, NULL},
	 { "psbt_output_get_ecdh_public_key", _wrap_psbt_output_get_ecdh_public_key, METH_VARARGS, NULL},
	 { "psbt_output_get_ecdh_public_key_len", _wrap_psbt_output_get_ecdh_public_key_len, METH_O, NULL},
	 { "psbt_output_set_ecdh_public_key", _wrap_psbt_output_set_ecdh_public_key, METH_VARARGS, NULL},
	 { "psbt_output_clear_ecdh_public_key", _wrap_psbt_output_clear_ecdh_public_key, METH_O, NULL},
	 { "psbt_output_get_value_blinding_rangeproof", _wrap_psbt_output_get_value_blinding_rangeproof, METH_VARARGS, NULL},
	 { "psbt_output_get_value_blinding_rangeproof_len", _wrap_psbt_output_get_value_blinding_rangeproof_len, METH_O, NULL},
	 { "psbt_output_set_value_blinding_rangeproof", _wrap_psbt_output_set_value_blinding_rangeproof, METH_VARARGS, NULL},
	 { "psbt_output_clear_value_blinding_rangeproof", _wrap_psbt_output_clear_value_blinding_rangeproof, METH_O, NULL},
	 { "psbt_output_get_asset_blinding_surjectionproof", _wrap_psbt_output_get_asset_blinding_surjectionproof, METH_VARARGS, NULL},
	 { "psbt_output_get_asset_blinding_surjectionproof_len", _wrap_psbt_output_get_asset_blinding_surjectionproof_len, METH_O, NULL},
	 { "psbt_output_set_asset_blinding_surjectionproof", _wrap_psbt_output_set_asset_blinding_surjectionproof, METH_VARARGS, NULL},
	 { "psbt_output_clear_asset_blinding_surjectionproof", _wrap_psbt_output_clear_asset_blinding_surjectionproof, METH_O, NULL},
	 { "psbt_output_get_blinding_status", _wrap_psbt_output_get_blinding_status, METH_VARARGS, NULL},
	 { "psbt_init_alloc", _wrap_psbt_init_alloc, METH_VARARGS, NULL},
	 { "psbt_free", _wrap_psbt_free, METH_O, NULL},
	 { "psbt_set_version", _wrap_psbt_set_version, METH_VARARGS, NULL},
	 { "psbt_get_id", _wrap_psbt_get_id, METH_VARARGS, NULL},
	 { "psbt_get_locktime", _wrap_psbt_get_locktime, METH_O, NULL},
	 { "psbt_is_finalized", _wrap_psbt_is_finalized, METH_O, NULL},
	 { "psbt_is_input_finalized", _wrap_psbt_is_input_finalized, METH_VARARGS, NULL},
	 { "psbt_set_global_tx", _wrap_psbt_set_global_tx, METH_VARARGS, NULL},
	 { "psbt_set_tx_version", _wrap_psbt_set_tx_version, METH_VARARGS, NULL},
	 { "psbt_get_tx_version", _wrap_psbt_get_tx_version, METH_O, NULL},
	 { "psbt_set_fallback_locktime", _wrap_psbt_set_fallback_locktime, METH_VARARGS, NULL},
	 { "psbt_clear_fallback_locktime", _wrap_psbt_clear_fallback_locktime, METH_O, NULL},
	 { "psbt_set_tx_modifiable_flags", _wrap_psbt_set_tx_modifiable_flags, METH_VARARGS, NULL},
	 { "psbt_set_global_scalars", _wrap_psbt_set_global_scalars, METH_VARARGS, NULL},
	 { "psbt_add_global_scalar", _wrap_psbt_add_global_scalar, METH_VARARGS, NULL},
	 { "psbt_find_global_scalar", _wrap_psbt_find_global_scalar, METH_VARARGS, NULL},
	 { "psbt_set_pset_modifiable_flags", _wrap_psbt_set_pset_modifiable_flags, METH_VARARGS, NULL},
	 { "psbt_set_global_genesis_blockhash", _wrap_psbt_set_global_genesis_blockhash, METH_VARARGS, NULL},
	 { "psbt_has_global_genesis_blockhash", _wrap_psbt_has_global_genesis_blockhash, METH_O, NULL},
	 { "psbt_get_global_genesis_blockhash", _wrap_psbt_get_global_genesis_blockhash, METH_VARARGS, NULL},
	 { "psbt_find_input_spending_utxo", _wrap_psbt_find_input_spending_utxo, METH_VARARGS, NULL},
	 { "psbt_add_input_keypath", _wrap_psbt_add_input_keypath, METH_VARARGS, NULL},
	 { "psbt_add_input_taproot_keypath", _wrap_psbt_add_input_taproot_keypath, METH_VARARGS, NULL},
	 { "psbt_add_tx_input_at", _wrap_psbt_add_tx_input_at, METH_VARARGS, NULL},
	 { "psbt_remove_input", _wrap_psbt_remove_input, METH_VARARGS, NULL},
	 { "psbt_get_input_bip32_key_from_alloc", _wrap_psbt_get_input_bip32_key_from_alloc, METH_VARARGS, NULL},
	 { "psbt_get_input_signing_script_len", _wrap_psbt_get_input_signing_script_len, METH_VARARGS, NULL},
	 { "psbt_get_input_signing_script", _wrap_psbt_get_input_signing_script, METH_VARARGS, NULL},
	 { "psbt_get_input_scriptcode_len", _wrap_psbt_get_input_scriptcode_len, METH_VARARGS, NULL},
	 { "psbt_get_input_scriptcode", _wrap_psbt_get_input_scriptcode, METH_VARARGS, NULL},
	 { "psbt_get_input_signature_hash", _wrap_psbt_get_input_signature_hash, METH_VARARGS, NULL},
	 { "psbt_add_output_keypath", _wrap_psbt_add_output_keypath, METH_VARARGS, NULL},
	 { "psbt_add_output_taproot_keypath", _wrap_psbt_add_output_taproot_keypath, METH_VARARGS, NULL},
	 { "psbt_add_tx_output_at", _wrap_psbt_add_tx_output_at, METH_VARARGS, NULL},
	 { "psbt_remove_output", _wrap_psbt_remove_output, METH_VARARGS, NULL},
	 { "psbt_from_bytes", _wrap_psbt_from_bytes, METH_VARARGS, NULL},
	 { "psbt_get_length", _wrap_psbt_get_length, METH_VARARGS, NULL},
	 { "psbt_to_bytes", _wrap_psbt_to_bytes, METH_VARARGS, NULL},
	 { "psbt_from_base64", _wrap_psbt_from_base64, METH_VARARGS, NULL},
	 { "psbt_from_base64_n", _wrap_psbt_from_base64_n, METH_VARARGS, NULL},
	 { "psbt_to_base64", _wrap_psbt_to_base64, METH_VARARGS, NULL},
	 { "psbt_from_tx", _wrap_psbt_from_tx, METH_VARARGS, NULL},
	 { "psbt_combine", _wrap_psbt_combine, METH_VARARGS, NULL},
	 { "psbt_combine_ex", _wrap_psbt_combine_ex, METH_VARARGS, NULL},
	 { "psbt_clone_alloc", _wrap_psbt_clone_alloc, METH_VARARGS, NULL},
	 { "psbt_blind_alloc", _wrap_psbt_blind_alloc, METH_VARARGS, NULL},
	 { "psbt_signing_cache_enable", _wrap_psbt_signing_cache_enable, METH_VARARGS, NULL},
	 { "psbt_signing_cache_disable", _wrap_psbt_signing_cache_disable, METH_O, NULL},
	 { "psbt_sign", _wrap_psbt_sign, METH_VARARGS, NULL},
	 { "psbt_sign_bip32", _wrap_psbt_sign_bip32, METH_VARARGS, NULL},
	 { "psbt_sign_input_bip32", _wrap_psbt_sign_input_bip32, METH_VARARGS, NULL},
	 { "psbt_finalize", _wrap_psbt_finalize, METH_VARARGS, NULL},
	 { "psbt_finalize_input", _wrap_psbt_finalize_input, METH_VARARGS, NULL},
	 { "psbt_extract", _wrap_psbt_extract, METH_VARARGS, NULL},
	 { "psbt_is_elements", _wrap_psbt_is_elements, METH_O, NULL},
	 { "psbt_get_global_tx_alloc", _wrap_psbt_get_global_tx_alloc, METH_O, NULL},
	 { "psbt_get_version", _wrap_psbt_get_version, METH_O, NULL},
	 { "psbt_get_num_inputs", _wrap_psbt_get_num_inputs, METH_O, NULL},
	 { "psbt_get_num_outputs", _wrap_psbt_get_num_outputs, METH_O, NULL},
	 { "psbt_get_fallback_locktime", _wrap_psbt_get_fallback_locktime, METH_O, NULL},
	 { "psbt_has_fallback_locktime", _wrap_psbt_has_fallback_locktime, METH_O, NULL},
	 { "psbt_get_tx_modifiable_flags", _wrap_psbt_get_tx_modifiable_flags, METH_O, NULL},
	 { "psbt_get_global_scalars_size", _wrap_psbt_get_global_scalars_size, METH_O, NULL},
	 { "psbt_get_global_scalar", _wrap_psbt_get_global_scalar, METH_VARARGS, NULL},
	 { "psbt_get_pset_modifiable_flags", _wrap_psbt_get_pset_modifiable_flags, METH_O, NULL},
	 { "psbt_get_input_utxo_alloc", _wrap_psbt_get_input_utxo_alloc, METH_VARARGS, NULL},
	 { "psbt_get_input_witness_utxo_alloc", _wrap_psbt_get_input_witness_utxo_alloc, METH_VARARGS, NULL},
	 { "psbt_get_input_best_utxo_alloc", _wrap_psbt_get_input_best_utxo_alloc, METH_VARARGS, NULL},
	 { "psbt_get_input_redeem_script", _wrap_psbt_get_input_redeem_script, METH_VARARGS, NULL},
	 { "psbt_get_input_redeem_script_len", _wrap_psbt_get_input_redeem_script_len, METH_VARARGS, NULL},
	 { "psbt_get_input_witness_script", _wrap_psbt_get_input_witness_script, METH_VARARGS, NULL},
	 { "psbt_get_input_witness_script_len", _wrap_psbt_get_input_witness_script_len, METH_VARARGS, NULL},
	 { "psbt_get_input_final_scriptsig", _wrap_psbt_get_input_final_scriptsig, METH_VARARGS, NULL},
	 { "psbt_get_input_final_scriptsig_len", _wrap_psbt_get_input_final_scriptsig_len, METH_VARARGS, NULL},
	 { "psbt_get_input_final_witness_alloc", _wrap_psbt_get_input_final_witness_alloc, METH_VARARGS, NULL},
	 { "psbt_get_input_keypaths_size", _wrap_psbt_get_input_keypaths_size, METH_VARARGS, NULL},
	 { "psbt_find_input_keypath", _wrap_psbt_find_input_keypath, METH_VARARGS, NULL},
	 { "psbt_get_input_keypath", _wrap_psbt_get_input_keypath, METH_VARARGS, NULL},
	 { "psbt_get_input_keypath_len", _wrap_psbt_get_input_keypath_len, METH_VARARGS, NULL},
	 { "psbt_get_input_signatures_size", _wrap_psbt_get_input_signatures_size, METH_VARARGS, NULL},
	 { "psbt_find_input_signature", _wrap_psbt_find_input_signature, METH_VARARGS, NULL},
	 { "psbt_get_input_signature", _wrap_psbt_get_input_signature, METH_VARARGS, NULL},
	 { "psbt_get_input_signature_len", _wrap_psbt_get_input_signature_len, METH_VARARGS, NULL},
	 { "psbt_get_input_taproot_signature", _wrap_psbt_get_input_taproot_signature, METH_VARARGS, NULL},
	 { "psbt_get_input_taproot_signature_len", _wrap_psbt_get_input_taproot_signature_len, METH_VARARGS, NULL},
	 { "psbt_get_input_taproot_internal_key", _wrap_psbt_get_input_taproot_internal_key, METH_VARARGS, NULL},
	 { "psbt_get_input_taproot_internal_key_len", _wrap_psbt_get_input_taproot_internal_key_len, METH_VARARGS, NULL},
	 { "psbt_get_input_unknowns_size", _wrap_psbt_get_input_unknowns_size, METH_VARARGS, NULL},
	 { "psbt_find_input_unknown", _wrap_psbt_find_input_unknown, METH_VARARGS, NULL},
	 { "psbt_get_input_unknown", _wrap_psbt_get_input_unknown, METH_VARARGS, NULL},
	 { "psbt_get_input_unknown_len", _wrap_psbt_get_input_unknown_len, METH_VARARGS, NULL},
	 { "psbt_get_input_sighash", _wrap_psbt_get_input_sighash, METH_VARARGS, NULL},
	 { "psbt_get_input_signature_type", _wrap_psbt_get_input_signature_type, METH_VARARGS, NULL},
	 { "psbt_get_input_previous_txid", _wrap_psbt_get_input_previous_txid, METH_VARARGS, NULL},
	 { "psbt_get_input_output_index", _wrap_psbt_get_input_output_index, METH_VARARGS, NULL},
	 { "psbt_get_input_sequence", _wrap_psbt_get_input_sequence, METH_VARARGS, NULL},
	 { "psbt_get_input_required_locktime", _wrap_psbt_get_input_required_locktime, METH_VARARGS, NULL},
	 { "psbt_get_input_required_lockheight", _wrap_psbt_get_input_required_lockheight, METH_VARARGS, NULL},
	 { "psbt_set_input_utxo", _wrap_psbt_set_input_utxo, METH_VARARGS, NULL},
	 { "psbt_set_input_witness_utxo", _wrap_psbt_set_input_witness_utxo, METH_VARARGS, NULL},
	 { "psbt_set_input_witness_utxo_from_tx", _wrap_psbt_set_input_witness_utxo_from_tx, METH_VARARGS, NULL},
	 { "psbt_set_input_redeem_script", _wrap_psbt_set_input_redeem_script, METH_VARARGS, NULL},
	 { "psbt_set_input_witness_script", _wrap_psbt_set_input_witness_script, METH_VARARGS, NULL},
	 { "psbt_set_input_final_scriptsig", _wrap_psbt_set_input_final_scriptsig, METH_VARARGS, NULL},
	 { "psbt_set_input_final_witness", _wrap_psbt_set_input_final_witness, METH_VARARGS, NULL},
	 { "psbt_set_input_keypaths", _wrap_psbt_set_input_keypaths, METH_VARARGS, NULL},
	 { "psbt_set_input_signatures", _wrap_psbt_set_input_signatures, METH_VARARGS, NULL},
	 { "psbt_set_input_taproot_signature", _wrap_psbt_set_input_taproot_signature, METH_VARARGS, NULL},
	 { "psbt_set_input_taproot_internal_key", _wrap_psbt_set_input_taproot_internal_key, METH_VARARGS, NULL},
	 { "psbt_add_input_signature", _wrap_psbt_add_input_signature, METH_VARARGS, NULL},
	 { "psbt_set_input_unknowns", _wrap_psbt_set_input_unknowns, METH_VARARGS, NULL},
	 { "psbt_set_input_sighash", _wrap_psbt_set_input_sighash, METH_VARARGS, NULL},
	 { "psbt_set_input_previous_txid", _wrap_psbt_set_input_previous_txid, METH_VARARGS, NULL},
	 { "psbt_set_input_output_index", _wrap_psbt_set_input_output_index, METH_VARARGS, NULL},
	 { "psbt_set_input_sequence", _wrap_psbt_set_input_sequence, METH_VARARGS, NULL},
	 { "psbt_clear_input_sequence", _wrap_psbt_clear_input_sequence, METH_VARARGS, NULL},
	 { "psbt_set_input_required_locktime", _wrap_psbt_set_input_required_locktime, METH_VARARGS, NULL},
	 { "psbt_clear_input_required_locktime", _wrap_psbt_clear_input_required_locktime, METH_VARARGS, NULL},
	 { "psbt_has_input_required_locktime", _wrap_psbt_has_input_required_locktime, METH_VARARGS, NULL},
	 { "psbt_set_input_required_lockheight", _wrap_psbt_set_input_required_lockheight, METH_VARARGS, NULL},
	 { "psbt_clear_input_required_lockheight", _wrap_psbt_clear_input_required_lockheight, METH_VARARGS, NULL},
	 { "psbt_has_input_required_lockheight", _wrap_psbt_has_input_required_lockheight, METH_VARARGS, NULL},
	 { "psbt_get_input_amount", _wrap_psbt_get_input_amount, METH_VARARGS, NULL},
	 { "psbt_get_input_amount_rangeproof", _wrap_psbt_get_input_amount_rangeproof, METH_VARARGS, NULL},
	 { "psbt_get_input_amount_rangeproof_len", _wrap_psbt_get_input_amount_rangeproof_len, METH_VARARGS, NULL},
	 { "psbt_get_input_asset", _wrap_psbt_get_input_asset, METH_VARARGS, NULL},
	 { "psbt_get_input_asset_len", _wrap_psbt_get_input_asset_len, METH_VARARGS, NULL},
	 { "psbt_get_input_asset_surjectionproof", _wrap_psbt_get_input_asset_surjectionproof, METH_VARARGS, NULL},
	 { "psbt_get_input_asset_surjectionproof_len", _wrap_psbt_get_input_asset_surjectionproof_len, METH_VARARGS, NULL},
	 { "psbt_get_input_issuance_amount", _wrap_psbt_get_input_issuance_amount, METH_VARARGS, NULL},
	 { "psbt_get_input_inflation_keys", _wrap_psbt_get_input_inflation_keys, METH_VARARGS, NULL},
	 { "psbt_get_input_pegin_amount", _wrap_psbt_get_input_pegin_amount, METH_VARARGS, NULL},
	 { "psbt_get_input_pegin_txout_proof", _wrap_psbt_get_input_pegin_txout_proof, METH_VARARGS, NULL},
	 { "psbt_get_input_pegin_txout_proof_len", _wrap_psbt_get_input_pegin_txout_proof_len, METH_VARARGS, NULL},
	 { "psbt_get_input_pegin_genesis_blockhash", _wrap_psbt_get_input_pegin_genesis_blockhash, METH_VARARGS, NULL},
	 { "psbt_get_input_pegin_genesis_blockhash_len", _wrap_psbt_get_input_pegin_genesis_blockhash_len, METH_VARARGS, NULL},
	 { "psbt_get_input_pegin_claim_script", _wrap_psbt_get_input_pegin_claim_script, METH_VARARGS, NULL},
	 { "psbt_get_input_pegin_claim_script_len", _wrap_psbt_get_input_pegin_claim_script_len, METH_VARARGS, NULL},
	 { "psbt_get_input_issuance_amount_commitment", _wrap_psbt_get_input_issuance_amount_commitment, METH_VARARGS, NULL},
	 { "psbt_get_input_issuance_amount_commitment_len", _wrap_psbt_get_input_issuance_amount_commitment_len, METH_VARARGS, NULL},
	 { "psbt_get_input_issuance_amount_rangeproof", _wrap_psbt_get_input_issuance_amount_rangeproof, METH_VARARGS, NULL},
	 { "psbt_get_input_issuance_amount_rangeproof_len", _wrap_psbt_get_input_issuance_amount_rangeproof_len, METH_VARARGS, NULL},
	 { "psbt_get_input_issuance_blinding_nonce", _wrap_psbt_get_input_issuance_blinding_nonce, METH_VARARGS, NULL},
	 { "psbt_get_input_issuance_blinding_nonce_len", _wrap_psbt_get_input_issuance_blinding_nonce_len, METH_VARARGS, NULL},
	 { "psbt_get_input_issuance_asset_entropy", _wrap_psbt_get_input_issuance_asset_entropy, METH_VARARGS, NULL},
	 { "psbt_get_input_issuance_asset_entropy_len", _wrap_psbt_get_input_issuance_asset_entropy_len, METH_VARARGS, NULL},
	 { "psbt_get_input_issuance_amount_blinding_rangeproof", _wrap_psbt_get_input_issuance_amount_blinding_rangeproof, METH_VARARGS, NULL},
	 { "psbt_get_input_issuance_amount_blinding_rangeproof_len", _wrap_psbt_get_input_issuance_amount_blinding_rangeproof_len, METH_VARARGS, NULL},
	 { "psbt_get_input_inflation_keys_commitment", _wrap_psbt_get_input_inflation_keys_commitment, METH_VARARGS, NULL},
	 { "psbt_get_input_inflation_keys_commitment_len", _wrap_psbt_get_input_inflation_keys_commitment_len, METH_VARARGS, NULL},
	 { "psbt_get_input_inflation_keys_rangeproof", _wrap_psbt_get_input_inflation_keys_rangeproof, METH_VARARGS, NULL},
	 { "psbt_get_input_inflation_keys_rangeproof_len", _wrap_psbt_get_input_inflation_keys_rangeproof_len, METH_VARARGS, NULL},
	 { "psbt_get_input_inflation_keys_blinding_rangeproof", _wrap_psbt_get_input_inflation_keys_blinding_rangeproof, METH_VARARGS, NULL},
	 { "psbt_get_input_inflation_keys_blinding_rangeproof_len", _wrap_psbt_get_input_inflation_keys_blinding_rangeproof_len, METH_VARARGS, NULL},
	 { "psbt_get_input_utxo_rangeproof", _wrap_psbt_get_input_utxo_rangeproof, METH_VARARGS, NULL},
	 { "psbt_get_input_utxo_rangeproof_len", _wrap_psbt_get_input_utxo_rangeproof_len, METH_VARARGS, NULL},
	 { "psbt_set_input_amount", _wrap_psbt_set_input_amount, METH_VARARGS, NULL},
	 { "psbt_clear_input_amount", _wrap_psbt_clear_input_amount, METH_VARARGS, NULL},
	 { "psbt_set_input_amount_rangeproof", _wrap_psbt_set_input_amount_rangeproof, METH_VARARGS, NULL},
	 { "psbt_clear_input_amount_rangeproof", _wrap_psbt_clear_input_amount_rangeproof, METH_VARARGS, NULL},
	 { "psbt_set_input_asset", _wrap_psbt_set_input_asset, METH_VARARGS, NULL},
	 { "psbt_clear_input_asset", _wrap_psbt_clear_input_asset, METH_VARARGS, NULL},
	 { "psbt_set_input_asset_surjectionproof", _wrap_psbt_set_input_asset_surjectionproof, METH_VARARGS, NULL},
	 { "psbt_clear_input_asset_surjectionproof", _wrap_psbt_clear_input_asset_surjectionproof, METH_VARARGS, NULL},
	 { "psbt_set_input_issuance_amount", _wrap_psbt_set_input_issuance_amount, METH_VARARGS, NULL},
	 { "psbt_set_input_inflation_keys", _wrap_psbt_set_input_inflation_keys, METH_VARARGS, NULL},
	 { "psbt_set_input_pegin_amount", _wrap_psbt_set_input_pegin_amount, METH_VARARGS, NULL},
	 { "psbt_set_input_pegin_txout_proof", _wrap_psbt_set_input_pegin_txout_proof, METH_VARARGS, NULL},
	 { "psbt_clear_input_pegin_txout_proof", _wrap_psbt_clear_input_pegin_txout_proof, METH_VARARGS, NULL},
	 { "psbt_set_input_pegin_genesis_blockhash", _wrap_psbt_set_input_pegin_genesis_blockhash, METH_VARARGS, NULL},
	 { "psbt_clear_input_pegin_genesis_blockhash", _wrap_psbt_clear_input_pegin_genesis_blockhash, METH_VARARGS, NULL},
	 { "psbt_set_input_pegin_claim_script", _wrap_psbt_set_input_pegin_claim_script, METH_VARARGS, NULL},
	 { "psbt_clear_input_pegin_claim_script", _wrap_psbt_clear_input_pegin_claim_script, METH_VARARGS, NULL},
	 { "psbt_set_input_issuance_amount_commitment", _wrap_psbt_set_input_issuance_amount_commitment, METH_VARARGS, NULL},
	 { "psbt_clear_input_issuance_amount_commitment", _wrap_psbt_clear_input_issuance_amount_commitment, METH_VARARGS, NULL},
	 { "psbt_set_input_issuance_amount_rangeproof", _wrap_psbt_set_input_issuance_amount_rangeproof, METH_VARARGS, NULL},
	 { "psbt_clear_input_issuance_amount_rangeproof", _wrap_psbt_clear_input_issuance_amount_rangeproof, METH_VARARGS, NULL},
	 { "psbt_set_input_issuance_blinding_nonce", _wrap_psbt_set_input_issuance_blinding_nonce, METH_VARARGS, NULL},
	 { "psbt_clear_input_issuance_blinding_nonce", _wrap_psbt_clear_input_issuance_blinding_nonce, METH_VARARGS, NULL},
	 { "psbt_set_input_issuance_asset_entropy", _wrap_psbt_set_input_issuance_asset_entropy, METH_VARARGS, NULL},
	 { "psbt_clear_input_issuance_asset_entropy", _wrap_psbt_clear_input_issuance_asset_entropy, METH_VARARGS, NULL},
	 { "psbt_set_input_issuance_amount_blinding_rangeproof", _wrap_psbt_set_input_issuance_amount_blinding_rangeproof, METH_VARARGS, NULL},
	 { "psbt_clear_input_issuance_amount_blinding_rangeproof", _wrap_psbt_clear_input_issuance_amount_blinding_rangeproof, METH_VARARGS, NULL},
	 { "psbt_set_input_inflation_keys_commitment", _wrap_psbt_set_input_inflation_keys_commitment, METH_VARARGS, NULL},
	 { "psbt_clear_input_inflation_keys_commitment", _wrap_psbt_clear_input_inflation_keys_commitment, METH_VARARGS, NULL},
	 { "psbt_set_input_inflation_keys_rangeproof", _wrap_psbt_set_input_inflation_keys_rangeproof, METH_VARARGS, NULL},
	 { "psbt_clear_input_inflation_keys_rangeproof", _wrap_psbt_clear_input_inflation_keys_rangeproof, METH_VARARGS, NULL},
	 { "psbt_set_input_inflation_keys_blinding_rangeproof", _wrap_psbt_set_input_inflation_keys_blinding_rangeproof, METH_VARARGS, NULL},
	 { "psbt_clear_input_inflation_keys_blinding_rangeproof", _wrap_psbt_clear_input_inflation_keys_blinding_rangeproof, METH_VARARGS, NULL},
	 { "psbt_set_input_utxo_rangeproof", _wrap_psbt_set_input_utxo_rangeproof, METH_VARARGS, NULL},
	 { "psbt_clear_input_utxo_rangeproof", _wrap_psbt_clear_input_utxo_rangeproof, METH_VARARGS, NULL},
	 { "psbt_generate_input_explicit_proofs", _wrap_psbt_generate_input_explicit_proofs, METH_VARARGS, NULL},
	 { "psbt_get_output_redeem_script", _wrap_psbt_get_output_redeem_script, METH_VARARGS, NULL},
	 { "psbt_get_output_redeem_script_len", _wrap_psbt_get_output_redeem_script_len, METH_VARARGS, NULL},
	 { "psbt_get_output_witness_script", _wrap_psbt_get_output_witness_script, METH_VARARGS, NULL},
	 { "psbt_get_output_witness_script_len", _wrap_psbt_get_output_witness_script_len, METH_VARARGS, NULL},
	 { "psbt_get_output_keypaths_size", _wrap_psbt_get_output_keypaths_size, METH_VARARGS, NULL},
	 { "psbt_find_output_keypath", _wrap_psbt_find_output_keypath, METH_VARARGS, NULL},
	 { "psbt_get_output_keypath", _wrap_psbt_get_output_keypath, METH_VARARGS, NULL},
	 { "psbt_get_output_keypath_len", _wrap_psbt_get_output_keypath_len, METH_VARARGS, NULL},
	 { "psbt_get_output_unknowns_size", _wrap_psbt_get_output_unknowns_size, METH_VARARGS, NULL},
	 { "psbt_find_output_unknown", _wrap_psbt_find_output_unknown, METH_VARARGS, NULL},
	 { "psbt_get_output_unknown", _wrap_psbt_get_output_unknown, METH_VARARGS, NULL},
	 { "psbt_get_output_unknown_len", _wrap_psbt_get_output_unknown_len, METH_VARARGS, NULL},
	 { "psbt_get_output_script", _wrap_psbt_get_output_script, METH_VARARGS, NULL},
	 { "psbt_get_output_script_len", _wrap_psbt_get_output_script_len, METH_VARARGS, NULL},
	 { "psbt_get_output_amount", _wrap_psbt_get_output_amount, METH_VARARGS, NULL},
	 { "psbt_has_output_amount", _wrap_psbt_has_output_amount, METH_VARARGS, NULL},
	 { "psbt_get_output_taproot_internal_key", _wrap_psbt_get_output_taproot_internal_key, METH_VARARGS, NULL},
	 { "psbt_get_output_taproot_internal_key_len", _wrap_psbt_get_output_taproot_internal_key_len, METH_VARARGS, NULL},
	 { "psbt_set_output_redeem_script", _wrap_psbt_set_output_redeem_script, METH_VARARGS, NULL},
	 { "psbt_set_output_witness_script", _wrap_psbt_set_output_witness_script, METH_VARARGS, NULL},
	 { "psbt_set_output_keypaths", _wrap_psbt_set_output_keypaths, METH_VARARGS, NULL},
	 { "psbt_set_output_unknowns", _wrap_psbt_set_output_unknowns, METH_VARARGS, NULL},
	 { "psbt_set_output_script", _wrap_psbt_set_output_script, METH_VARARGS, NULL},
	 { "psbt_set_output_amount", _wrap_psbt_set_output_amount, METH_VARARGS, NULL},
	 { "psbt_clear_output_amount", _wrap_psbt_clear_output_amount, METH_VARARGS, NULL},
	 { "psbt_set_output_taproot_internal_key", _wrap_psbt_set_output_taproot_internal_key, METH_VARARGS, NULL},
	 { "psbt_get_output_blinder_index", _wrap_psbt_get_output_blinder_index, METH_VARARGS, NULL},
	 { "psbt_has_output_blinder_index", _wrap_psbt_has_output_blinder_index, METH_VARARGS, NULL},
	 { "psbt_get_output_value_commitment", _wrap_psbt_get_output_value_commitment, METH_VARARGS, NULL},
	 { "psbt_get_output_value_commitment_len", _wrap_psbt_get_output_value_commitment_len, METH_VARARGS, NULL},
	 { "psbt_get_output_asset", _wrap_psbt_get_output_asset, METH_VARARGS, NULL},
	 { "psbt_get_output_asset_len", _wrap_psbt_get_output_asset_len, METH_VARARGS, NULL},
	 { "psbt_get_output_asset_commitment", _wrap_psbt_get_output_asset_commitment, METH_VARARGS, NULL},
	 { "psbt_get_output_asset_commitment_len", _wrap_psbt_get_output_asset_commitment_len, METH_VARARGS, NULL},
	 { "psbt_get_output_value_rangeproof", _wrap_psbt_get_output_value_rangeproof, METH_VARARGS, NULL},
	 { "psbt_get_output_value_rangeproof_len", _wrap_psbt_get_output_value_rangeproof_len, METH_VARARGS, NULL},
	 { "psbt_get_output_asset_surjectionproof", _wrap_psbt_get_output_asset_surjectionproof, METH_VARARGS, NULL},
	 { "psbt_get_output_asset_surjectionproof_len", _wrap_psbt_get_output_asset_surjectionproof_len, METH_VARARGS, NULL},
	 { "psbt_get_output_blinding_public_key", _wrap_psbt_get_output_blinding_public_key, METH_VARARGS, NULL},
	 { "psbt_get_output_blinding_public_key_len", _wrap_psbt_get_output_blinding_public_key_len, METH_VARARGS, NULL},
	 { "psbt_get_output_ecdh_public_key", _wrap_psbt_get_output_ecdh_public_key, METH_VARARGS, NULL},
	 { "psbt_get_output_ecdh_public_key_len", _wrap_psbt_get_output_ecdh_public_key_len, METH_VARARGS, NULL},
	 { "psbt_get_output_value_blinding_rangeproof", _wrap_psbt_get_output_value_blinding_rangeproof, METH_VARARGS, NULL},
	 { "psbt_get_output_value_blinding_rangeproof_len", _wrap_psbt_get_output_value_blinding_rangeproof_len, METH_VARARGS, NULL},
	 { "psbt_get_output_asset_blinding_surjectionproof", _wrap_psbt_get_output_asset_blinding_surjectionproof, METH_VARARGS, NULL},
	 { "psbt_get_output_asset_blinding_surjectionproof_len", _wrap_psbt_get_output_asset_blinding_surjectionproof_len, METH_VARARGS, NULL},
	 { "psbt_set_output_blinder_index", _wrap_psbt_set_output_blinder_index, METH_VARARGS, NULL},
	 { "psbt_clear_output_blinder_index", _wrap_psbt_clear_output_blinder_index, METH_VARARGS, NULL},
	 { "psbt_set_output_value_commitment", _wrap_psbt_set_output_value_commitment, METH_VARARGS, NULL},
	 { "psbt_clear_output_value_commitment", _wrap_psbt_clear_output_value_commitment, METH_VARARGS, NULL},
	 { "psbt_set_output_asset", _wrap_psbt_set_output_asset, METH_VARARGS, NULL},
	 { "psbt_clear_output_asset", _wrap_psbt_clear_output_asset, METH_VARARGS, NULL},
	 { "psbt_set_output_asset_commitment", _wrap_psbt_set_output_asset_commitment, METH_VARARGS, NULL},
	 { "psbt_clear_output_asset_commitment", _wrap_psbt_clear_output_asset_commitment, METH_VARARGS, NULL},
	 { "psbt_set_output_value_rangeproof", _wrap_psbt_set_output_value_rangeproof, METH_VARARGS, NULL},
	 { "psbt_clear_output_value_rangeproof", _wrap_psbt_clear_output_value_rangeproof, METH_VARARGS, NULL},
	 { "psbt_set_output_asset_surjectionproof", _wrap_psbt_set_output_asset_surjectionproof, METH_VARARGS, NULL},
	 { "psbt_clear_output_asset_surjectionproof", _wrap_psbt_clear_output_asset_surjectionproof, METH_VARARGS, NULL},
	 { "psbt_set_output_blinding_public_key", _wrap_psbt_set_output_blinding_public_key, METH_VARARGS, NULL},
	 { "psbt_clear_output_blinding_public_key", _wrap_psbt_clear_output_blinding_public_key, METH_VARARGS, NULL},
	 { "psbt_set_output_ecdh_public_key", _wrap_psbt_set_output_ecdh_public_key, METH_VARARGS, NULL},
	 { "psbt_clear_output_ecdh_public_key", _wrap_psbt_clear_output_ecdh_public_key, METH_VARARGS, NULL},
	 { "psbt_set_output_value_blinding_rangeproof", _wrap_psbt_set_output_value_blinding_rangeproof, METH_VARARGS, NULL},
	 { "psbt_clear_output_value_blinding_rangeproof", _wrap_psbt_clear_output_value_blinding_rangeproof, METH_VARARGS, NULL},
	 { "psbt_set_output_asset_blinding_surjectionproof", _wrap_psbt_set_output_asset_blinding_surjectionproof, METH_VARARGS, NULL},
	 { "psbt_clear_output_asset_blinding_surjectionproof", _wrap_psbt_clear_output_asset_blinding_surjectionproof, METH_VARARGS, NULL},
	 { "psbt_get_output_blinding_status", _wrap_psbt_get_output_blinding_status, METH_VARARGS, NULL},
	 { "scriptpubkey_get_type", _wrap_scriptpubkey_get_type, METH_O, NULL},
	 { "scriptpubkey_p2pkh_from_bytes", _wrap_scriptpubkey_p2pkh_from_bytes, METH_VARARGS, NULL},
	 { "scriptsig_p2pkh_from_sig", _wrap_scriptsig_p2pkh_from_sig, METH_VARARGS, NULL},
	 { "witness_p2wpkh_from_sig", _wrap_witness_p2wpkh_from_sig, METH_VARARGS, NULL},
	 { "scriptsig_p2pkh_from_der", _wrap_scriptsig_p2pkh_from_der, METH_VARARGS, NULL},
	 { "witness_p2wpkh_from_der", _wrap_witness_p2wpkh_from_der, METH_VARARGS, NULL},
	 { "scriptpubkey_p2tr_from_bytes", _wrap_scriptpubkey_p2tr_from_bytes, METH_VARARGS, NULL},
	 { "witness_p2tr_from_sig", _wrap_witness_p2tr_from_sig, METH_VARARGS, NULL},
	 { "scriptpubkey_op_return_from_bytes", _wrap_scriptpubkey_op_return_from_bytes, METH_VARARGS, NULL},
	 { "scriptpubkey_p2sh_from_bytes", _wrap_scriptpubkey_p2sh_from_bytes, METH_VARARGS, NULL},
	 { "scriptpubkey_multisig_from_bytes", _wrap_scriptpubkey_multisig_from_bytes, METH_VARARGS, NULL},
	 { "scriptsig_multisig_from_bytes", _wrap_scriptsig_multisig_from_bytes, METH_VARARGS, NULL},
	 { "witness_multisig_from_bytes", _wrap_witness_multisig_from_bytes, METH_VARARGS, NULL},
	 { "scriptpubkey_csv_2of2_then_1_from_bytes", _wrap_scriptpubkey_csv_2of2_then_1_from_bytes, METH_VARARGS, NULL},
	 { "scriptpubkey_csv_2of2_then_1_from_bytes_opt", _wrap_scriptpubkey_csv_2of2_then_1_from_bytes_opt, METH_VARARGS, NULL},
	 { "scriptpubkey_csv_blocks_from_csv_2of2_then_1", _wrap_scriptpubkey_csv_blocks_from_csv_2of2_then_1, METH_O, NULL},
	 { "script_push_from_bytes", _wrap_script_push_from_bytes, METH_VARARGS, NULL},
	 { "varint_get_length", _wrap_varint_get_length, METH_O, NULL},
	 { "varint_to_bytes", _wrap_varint_to_bytes, METH_VARARGS, NULL},
	 { "varbuff_get_length", _wrap_varbuff_get_length, METH_O, NULL},
	 { "varbuff_to_bytes", _wrap_varbuff_to_bytes, METH_VARARGS, NULL},
	 { "witness_program_from_bytes", _wrap_witness_program_from_bytes, METH_VARARGS, NULL},
	 { "witness_program_from_bytes_and_version", _wrap_witness_program_from_bytes_and_version, METH_VARARGS, NULL},
	 { "elements_pegout_script_size", _wrap_elements_pegout_script_size, METH_VARARGS, NULL},
	 { "elements_pegout_script_from_bytes", _wrap_elements_pegout_script_from_bytes, METH_VARARGS, NULL},
	 { "elements_pegin_contract_script_from_bytes", _wrap_elements_pegin_contract_script_from_bytes, METH_VARARGS, NULL},
	 { "symmetric_key_from_seed", _wrap_symmetric_key_from_seed, METH_VARARGS, NULL},
	 { "symmetric_key_from_parent", _wrap_symmetric_key_from_parent, METH_VARARGS, NULL},
	 { "tx_witness_stack_init_alloc", _wrap_tx_witness_stack_init_alloc, METH_O, NULL},
	 { "tx_witness_stack_clone_alloc", _wrap_tx_witness_stack_clone_alloc, METH_O, NULL},
	 { "tx_witness_stack_get_num_items", _wrap_tx_witness_stack_get_num_items, METH_O, NULL},
	 { "tx_witness_stack_add", _wrap_tx_witness_stack_add, METH_VARARGS, NULL},
	 { "tx_witness_stack_add_dummy", _wrap_tx_witness_stack_add_dummy, METH_VARARGS, NULL},
	 { "tx_witness_stack_set", _wrap_tx_witness_stack_set, METH_VARARGS, NULL},
	 { "tx_witness_stack_set_dummy", _wrap_tx_witness_stack_set_dummy, METH_VARARGS, NULL},
	 { "tx_witness_stack_from_bytes", _wrap_tx_witness_stack_from_bytes, METH_O, NULL},
	 { "tx_witness_stack_get_length", _wrap_tx_witness_stack_get_length, METH_O, NULL},
	 { "tx_witness_stack_to_bytes", _wrap_tx_witness_stack_to_bytes, METH_VARARGS, NULL},
	 { "tx_witness_stack_free", _wrap_tx_witness_stack_free, METH_O, NULL},
	 { "tx_input_init_alloc", _wrap_tx_input_init_alloc, METH_VARARGS, NULL},
	 { "tx_input_clone_alloc", _wrap_tx_input_clone_alloc, METH_VARARGS, NULL},
	 { "tx_input_free", _wrap_tx_input_free, METH_O, NULL},
	 { "tx_output_init_alloc", _wrap_tx_output_init_alloc, METH_VARARGS, NULL},
	 { "tx_output_clone_alloc", _wrap_tx_output_clone_alloc, METH_O, NULL},
	 { "tx_output_free", _wrap_tx_output_free, METH_O, NULL},
	 { "tx_init_alloc", _wrap_tx_init_alloc, METH_VARARGS, NULL},
	 { "tx_clone_alloc", _wrap_tx_clone_alloc, METH_VARARGS, NULL},
	 { "tx_add_input", _wrap_tx_add_input, METH_VARARGS, NULL},
	 { "tx_add_input_at", _wrap_tx_add_input_at, METH_VARARGS, NULL},
	 { "tx_add_raw_input", _wrap_tx_add_raw_input, METH_VARARGS, NULL},
	 { "tx_add_raw_input_at", _wrap_tx_add_raw_input_at, METH_VARARGS, NULL},
	 { "tx_remove_input", _wrap_tx_remove_input, METH_VARARGS, NULL},
	 { "tx_set_input_script", _wrap_tx_set_input_script, METH_VARARGS, NULL},
	 { "tx_set_input_witness", _wrap_tx_set_input_witness, METH_VARARGS, NULL},
	 { "tx_add_output", _wrap_tx_add_output, METH_VARARGS, NULL},
	 { "tx_add_output_at", _wrap_tx_add_output_at, METH_VARARGS, NULL},
	 { "tx_add_raw_output", _wrap_tx_add_raw_output, METH_VARARGS, NULL},
	 { "tx_add_raw_output_at", _wrap_tx_add_raw_output_at, METH_VARARGS, NULL},
	 { "tx_remove_output", _wrap_tx_remove_output, METH_VARARGS, NULL},
	 { "tx_get_witness_count", _wrap_tx_get_witness_count, METH_O, NULL},
	 { "tx_free", _wrap_tx_free, METH_O, NULL},
	 { "tx_get_txid", _wrap_tx_get_txid, METH_VARARGS, NULL},
	 { "get_hash_prevouts", _wrap_get_hash_prevouts, METH_VARARGS, NULL},
	 { "tx_get_hash_prevouts", _wrap_tx_get_hash_prevouts, METH_VARARGS, NULL},
	 { "tx_get_length", _wrap_tx_get_length, METH_VARARGS, NULL},
	 { "tx_from_bytes", _wrap_tx_from_bytes, METH_VARARGS, NULL},
	 { "tx_from_hex", _wrap_tx_from_hex, METH_VARARGS, NULL},
	 { "tx_to_bytes", _wrap_tx_to_bytes, METH_VARARGS, NULL},
	 { "tx_to_hex", _wrap_tx_to_hex, METH_VARARGS, NULL},
	 { "tx_get_weight", _wrap_tx_get_weight, METH_O, NULL},
	 { "tx_get_vsize", _wrap_tx_get_vsize, METH_O, NULL},
	 { "tx_vsize_from_weight", _wrap_tx_vsize_from_weight, METH_O, NULL},
	 { "tx_get_total_output_satoshi", _wrap_tx_get_total_output_satoshi, METH_O, NULL},
	 { "tx_get_btc_signature_hash", _wrap_tx_get_btc_signature_hash, METH_VARARGS, NULL},
	 { "tx_get_btc_taproot_signature_hash", _wrap_tx_get_btc_taproot_signature_hash, METH_VARARGS, NULL},
	 { "tx_get_signature_hash", _wrap_tx_get_signature_hash, METH_VARARGS, NULL},
	 { "tx_get_input_signature_hash", _wrap_tx_get_input_signature_hash, METH_VARARGS, NULL},
	 { "tx_is_coinbase", _wrap_tx_is_coinbase, METH_O, NULL},
	 { "tx_get_elements_weight_discount", _wrap_tx_get_elements_weight_discount, METH_VARARGS, NULL},
	 { "tx_elements_input_issuance_set", _wrap_tx_elements_input_issuance_set, METH_VARARGS, NULL},
	 { "tx_elements_input_issuance_free", _wrap_tx_elements_input_issuance_free, METH_O, NULL},
	 { "tx_elements_input_init_alloc", _wrap_tx_elements_input_init_alloc, METH_VARARGS, NULL},
	 { "tx_elements_input_is_pegin", _wrap_tx_elements_input_is_pegin, METH_O, NULL},
	 { "tx_elements_output_commitment_set", _wrap_tx_elements_output_commitment_set, METH_VARARGS, NULL},
	 { "tx_elements_output_commitment_free", _wrap_tx_elements_output_commitment_free, METH_O, NULL},
	 { "tx_elements_output_init_alloc", _wrap_tx_elements_output_init_alloc, METH_VARARGS, NULL},
	 { "tx_add_elements_raw_input", _wrap_tx_add_elements_raw_input, METH_VARARGS, NULL},
	 { "tx_add_elements_raw_input_at", _wrap_tx_add_elements_raw_input_at, METH_VARARGS, NULL},
	 { "tx_add_elements_raw_output", _wrap_tx_add_elements_raw_output, METH_VARARGS, NULL},
	 { "tx_add_elements_raw_output_at", _wrap_tx_add_elements_raw_output_at, METH_VARARGS, NULL},
	 { "tx_is_elements", _wrap_tx_is_elements, METH_O, NULL},
	 { "tx_confidential_value_from_satoshi", _wrap_tx_confidential_value_from_satoshi, METH_VARARGS, NULL},
	 { "tx_confidential_value_to_satoshi", _wrap_tx_confidential_value_to_satoshi, METH_O, NULL},
	 { "tx_get_elements_signature_hash", _wrap_tx_get_elements_signature_hash, METH_VARARGS, NULL},
	 { "tx_elements_issuance_generate_entropy", _wrap_tx_elements_issuance_generate_entropy, METH_VARARGS, NULL},
	 { "tx_elements_issuance_calculate_asset", _wrap_tx_elements_issuance_calculate_asset, METH_VARARGS, NULL},
	 { "tx_elements_issuance_calculate_reissuance_token", _wrap_tx_elements_issuance_calculate_reissuance_token, METH_VARARGS, NULL},
	 { "tx_input_get_txhash", _wrap_tx_input_get_txhash, METH_VARARGS, NULL},
	 { "tx_input_get_script", _wrap_tx_input_get_script, METH_VARARGS, NULL},
	 { "tx_input_get_script_len", _wrap_tx_input_get_script_len, METH_O, NULL},
	 { "tx_input_get_witness_num_items", _wrap_tx_input_get_witness_num_items, METH_O, NULL},
	 { "tx_input_get_witness", _wrap_tx_input_get_witness, METH_VARARGS, NULL},
	 { "tx_input_get_witness_len", _wrap_tx_input_get_witness_len, METH_VARARGS, NULL},
	 { "tx_input_get_index", _wrap_tx_input_get_index, METH_O, NULL},
	 { "tx_input_get_sequence", _wrap_tx_input_get_sequence, METH_O, NULL},
	 { "tx_input_set_txhash", _wrap_tx_input_set_txhash, METH_VARARGS, NULL},
	 { "tx_input_set_script", _wrap_tx_input_set_script, METH_VARARGS, NULL},
	 { "tx_input_set_witness", _wrap_tx_input_set_witness, METH_VARARGS, NULL},
	 { "tx_input_set_index", _wrap_tx_input_set_index, METH_VARARGS, NULL},
	 { "tx_input_set_sequence", _wrap_tx_input_set_sequence, METH_VARARGS, NULL},
	 { "tx_input_get_blinding_nonce", _wrap_tx_input_get_blinding_nonce, METH_VARARGS, NULL},
	 { "tx_input_get_entropy", _wrap_tx_input_get_entropy, METH_VARARGS, NULL},
	 { "tx_input_get_issuance_amount", _wrap_tx_input_get_issuance_amount, METH_VARARGS, NULL},
	 { "tx_input_get_issuance_amount_len", _wrap_tx_input_get_issuance_amount_len, METH_O, NULL},
	 { "tx_input_get_inflation_keys", _wrap_tx_input_get_inflation_keys, METH_VARARGS, NULL},
	 { "tx_input_get_inflation_keys_len", _wrap_tx_input_get_inflation_keys_len, METH_O, NULL},
	 { "tx_input_get_issuance_amount_rangeproof", _wrap_tx_input_get_issuance_amount_rangeproof, METH_VARARGS, NULL},
	 { "tx_input_get_issuance_amount_rangeproof_len", _wrap_tx_input_get_issuance_amount_rangeproof_len, METH_O, NULL},
	 { "tx_input_get_inflation_keys_rangeproof", _wrap_tx_input_get_inflation_keys_rangeproof, METH_VARARGS, NULL},
	 { "tx_input_get_inflation_keys_rangeproof_len", _wrap_tx_input_get_inflation_keys_rangeproof_len, METH_O, NULL},
	 { "tx_input_set_blinding_nonce", _wrap_tx_input_set_blinding_nonce, METH_VARARGS, NULL},
	 { "tx_input_set_entropy", _wrap_tx_input_set_entropy, METH_VARARGS, NULL},
	 { "tx_input_set_inflation_keys", _wrap_tx_input_set_inflation_keys, METH_VARARGS, NULL},
	 { "tx_input_set_inflation_keys_rangeproof", _wrap_tx_input_set_inflation_keys_rangeproof, METH_VARARGS, NULL},
	 { "tx_input_set_issuance_amount", _wrap_tx_input_set_issuance_amount, METH_VARARGS, NULL},
	 { "tx_input_set_issuance_amount_rangeproof", _wrap_tx_input_set_issuance_amount_rangeproof, METH_VARARGS, NULL},
	 { "tx_output_get_script", _wrap_tx_output_get_script, METH_VARARGS, NULL},
	 { "tx_output_get_script_len", _wrap_tx_output_get_script_len, METH_O, NULL},
	 { "tx_output_get_satoshi", _wrap_tx_output_get_satoshi, METH_O, NULL},
	 { "tx_output_set_script", _wrap_tx_output_set_script, METH_VARARGS, NULL},
	 { "tx_output_set_satoshi", _wrap_tx_output_set_satoshi, METH_VARARGS, NULL},
	 { "tx_output_get_asset", _wrap_tx_output_get_asset, METH_VARARGS, NULL},
	 { "tx_output_get_asset_len", _wrap_tx_output_get_asset_len, METH_O, NULL},
	 { "tx_output_get_value", _wrap_tx_output_get_value, METH_VARARGS, NULL},
	 { "tx_output_get_value_len", _wrap_tx_output_get_value_len, METH_O, NULL},
	 { "tx_output_get_nonce", _wrap_tx_output_get_nonce, METH_VARARGS, NULL},
	 { "tx_output_get_nonce_len", _wrap_tx_output_get_nonce_len, METH_O, NULL},
	 { "tx_output_get_surjectionproof", _wrap_tx_output_get_surjectionproof, METH_VARARGS, NULL},
	 { "tx_output_get_surjectionproof_len", _wrap_tx_output_get_surjectionproof_len, METH_O, NULL},
	 { "tx_output_get_rangeproof", _wrap_tx_output_get_rangeproof, METH_VARARGS, NULL},
	 { "tx_output_get_rangeproof_len", _wrap_tx_output_get_rangeproof_len, METH_O, NULL},
	 { "tx_output_set_asset", _wrap_tx_output_set_asset, METH_VARARGS, NULL},
	 { "tx_output_set_value", _wrap_tx_output_set_value, METH_VARARGS, NULL},
	 { "tx_output_set_nonce", _wrap_tx_output_set_nonce, METH_VARARGS, NULL},
	 { "tx_output_set_surjectionproof", _wrap_tx_output_set_surjectionproof, METH_VARARGS, NULL},
	 { "tx_output_set_rangeproof", _wrap_tx_output_set_rangeproof, METH_VARARGS, NULL},
	 { "tx_get_version", _wrap_tx_get_version, METH_O, NULL},
	 { "tx_get_locktime", _wrap_tx_get_locktime, METH_O, NULL},
	 { "tx_get_num_inputs", _wrap_tx_get_num_inputs, METH_O, NULL},
	 { "tx_get_num_outputs", _wrap_tx_get_num_outputs, METH_O, NULL},
	 { "tx_get_input_txhash", _wrap_tx_get_input_txhash, METH_VARARGS, NULL},
	 { "tx_get_input_script", _wrap_tx_get_input_script, METH_VARARGS, NULL},
	 { "tx_get_input_script_len", _wrap_tx_get_input_script_len, METH_VARARGS, NULL},
	 { "tx_get_input_witness_num_items", _wrap_tx_get_input_witness_num_items, METH_VARARGS, NULL},
	 { "tx_get_input_witness", _wrap_tx_get_input_witness, METH_VARARGS, NULL},
	 { "tx_get_input_witness_len", _wrap_tx_get_input_witness_len, METH_VARARGS, NULL},
	 { "tx_get_input_index", _wrap_tx_get_input_index, METH_VARARGS, NULL},
	 { "tx_get_input_sequence", _wrap_tx_get_input_sequence, METH_VARARGS, NULL},
	 { "tx_set_input_index", _wrap_tx_set_input_index, METH_VARARGS, NULL},
	 { "tx_set_input_sequence", _wrap_tx_set_input_sequence, METH_VARARGS, NULL},
	 { "tx_set_input_txhash", _wrap_tx_set_input_txhash, METH_VARARGS, NULL},
	 { "tx_get_input_blinding_nonce", _wrap_tx_get_input_blinding_nonce, METH_VARARGS, NULL},
	 { "tx_get_input_entropy", _wrap_tx_get_input_entropy, METH_VARARGS, NULL},
	 { "tx_get_input_issuance_amount", _wrap_tx_get_input_issuance_amount, METH_VARARGS, NULL},
	 { "tx_get_input_issuance_amount_len", _wrap_tx_get_input_issuance_amount_len, METH_VARARGS, NULL},
	 { "tx_get_input_inflation_keys", _wrap_tx_get_input_inflation_keys, METH_VARARGS, NULL},
	 { "tx_get_input_inflation_keys_len", _wrap_tx_get_input_inflation_keys_len, METH_VARARGS, NULL},
	 { "tx_get_input_issuance_amount_rangeproof", _wrap_tx_get_input_issuance_amount_rangeproof, METH_VARARGS, NULL},
	 { "tx_get_input_issuance_amount_rangeproof_len", _wrap_tx_get_input_issuance_amount_rangeproof_len, METH_VARARGS, NULL},
	 { "tx_get_input_inflation_keys_rangeproof", _wrap_tx_get_input_inflation_keys_rangeproof, METH_VARARGS, NULL},
	 { "tx_get_input_inflation_keys_rangeproof_len", _wrap_tx_get_input_inflation_keys_rangeproof_len, METH_VARARGS, NULL},
	 { "tx_set_input_blinding_nonce", _wrap_tx_set_input_blinding_nonce, METH_VARARGS, NULL},
	 { "tx_set_input_entropy", _wrap_tx_set_input_entropy, METH_VARARGS, NULL},
	 { "tx_set_input_inflation_keys", _wrap_tx_set_input_inflation_keys, METH_VARARGS, NULL},
	 { "tx_set_input_inflation_keys_rangeproof", _wrap_tx_set_input_inflation_keys_rangeproof, METH_VARARGS, NULL},
	 { "tx_set_input_issuance_amount", _wrap_tx_set_input_issuance_amount, METH_VARARGS, NULL},
	 { "tx_set_input_issuance_amount_rangeproof", _wrap_tx_set_input_issuance_amount_rangeproof, METH_VARARGS, NULL},
	 { "tx_get_output_script", _wrap_tx_get_output_script, METH_VARARGS, NULL},
	 { "tx_get_output_script_len", _wrap_tx_get_output_script_len, METH_VARARGS, NULL},
	 { "tx_get_output_satoshi", _wrap_tx_get_output_satoshi, METH_VARARGS, NULL},
	 { "tx_set_output_script", _wrap_tx_set_output_script, METH_VARARGS, NULL},
	 { "tx_set_output_satoshi", _wrap_tx_set_output_satoshi, METH_VARARGS, NULL},
	 { "tx_get_output_asset", _wrap_tx_get_output_asset, METH_VARARGS, NULL},
	 { "tx_get_output_value", _wrap_tx_get_output_value, METH_VARARGS, NULL},
	 { "tx_get_output_value_len", _wrap_tx_get_output_value_len, METH_VARARGS, NULL},
	 { "tx_get_output_nonce", _wrap_tx_get_output_nonce, METH_VARARGS, NULL},
	 { "tx_get_output_surjectionproof", _wrap_tx_get_output_surjectionproof, METH_VARARGS, NULL},
	 { "tx_get_output_surjectionproof_len", _wrap_tx_get_output_surjectionproof_len, METH_VARARGS, NULL},
	 { "tx_get_output_rangeproof", _wrap_tx_get_output_rangeproof, METH_VARARGS, NULL},
	 { "tx_get_output_rangeproof_len", _wrap_tx_get_output_rangeproof_len, METH_VARARGS, NULL},
	 { "tx_set_output_asset", _wrap_tx_set_output_asset, METH_VARARGS, NULL},
	 { "tx_set_output_value", _wrap_tx_set_output_value, METH_VARARGS, NULL},
	 { "tx_set_output_nonce", _wrap_tx_set_output_nonce, METH_VARARGS, NULL},
	 { "tx_set_output_surjectionproof", _wrap_tx_set_output_surjectionproof, METH_VARARGS, NULL},
	 { "tx_set_output_rangeproof", _wrap_tx_set_output_rangeproof, METH_VARARGS, NULL},
	 { "asset_generator_from_bytes", _wrap_asset_generator_from_bytes, METH_VARARGS, NULL},
	 { "ecdh_nonce_hash", _wrap_ecdh_nonce_hash, METH_VARARGS, NULL},
	 { "asset_final_vbf", _wrap_asset_final_vbf, METH_VARARGS, NULL},
	 { "asset_scalar_offset", _wrap_asset_scalar_offset, METH_VARARGS, NULL},
	 { "asset_value_commitment", _wrap_asset_value_commitment, METH_VARARGS, NULL},
	 { "asset_rangeproof_get_maximum_len", _wrap_asset_rangeproof_get_maximum_len, METH_VARARGS, NULL},
	 { "asset_rangeproof_with_nonce", _wrap_asset_rangeproof_with_nonce, METH_VARARGS, NULL},
	 { "asset_rangeproof", _wrap_asset_rangeproof, METH_VARARGS, NULL},
	 { "explicit_rangeproof", _wrap_explicit_rangeproof, METH_VARARGS, NULL},
	 { "explicit_rangeproof_verify", _wrap_explicit_rangeproof_verify, METH_VARARGS, NULL},
	 { "asset_surjectionproof_size", _wrap_asset_surjectionproof_size, METH_O, NULL},
	 { "asset_surjectionproof_len", _wrap_asset_surjectionproof_len, METH_VARARGS, NULL},
	 { "asset_surjectionproof", _wrap_asset_surjectionproof, METH_VARARGS, NULL},
	 { "explicit_surjectionproof", _wrap_explicit_surjectionproof, METH_VARARGS, NULL},
	 { "explicit_surjectionproof_verify", _wrap_explicit_surjectionproof_verify, METH_VARARGS, NULL},
	 { "asset_unblind_with_nonce", _wrap_asset_unblind_with_nonce, METH_VARARGS, NULL},
	 { "asset_unblind", _wrap_asset_unblind, METH_VARARGS, NULL},
	 { "asset_blinding_key_from_seed", _wrap_asset_blinding_key_from_seed, METH_VARARGS, NULL},
	 { "asset_blinding_key_to_ec_private_key", _wrap_asset_blinding_key_to_ec_private_key, METH_VARARGS, NULL},
	 { "asset_blinding_key_to_ec_public_key", _wrap_asset_blinding_key_to_ec_public_key, METH_VARARGS, NULL},
	 { "elip150_private_key_to_ec_private_key", _wrap_elip150_private_key_to_ec_private_key, METH_VARARGS, NULL},
	 { "elip150_private_key_to_ec_public_key", _wrap_elip150_private_key_to_ec_public_key, METH_VARARGS, NULL},
	 { "elip150_public_key_to_ec_public_key", _wrap_elip150_public_key_to_ec_public_key, METH_VARARGS, NULL},
	 { "asset_blinding_key_to_abf_vbf", _wrap_asset_blinding_key_to_abf_vbf, METH_VARARGS, NULL},
	 { "asset_blinding_key_to_abf", _wrap_asset_blinding_key_to_abf, METH_VARARGS, NULL},
	 { "asset_blinding_key_to_vbf", _wrap_asset_blinding_key_to_vbf, METH_VARARGS, NULL},
	 { "asset_pak_whitelistproof_size", _wrap_asset_pak_whitelistproof_size, METH_O, NULL},
	 { "asset_pak_whitelistproof", _wrap_asset_pak_whitelistproof, METH_VARARGS, NULL},
	 { "asset_pak_whitelistproof_len", _wrap_asset_pak_whitelistproof_len, METH_VARARGS, NULL},
	 { NULL, NULL, 0, NULL }
};

static PyMethodDef SwigMethods_proxydocs[] = {
	 { NULL, NULL, 0, NULL }
};


/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */

static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_ext_key = {"_p_ext_key", "struct ext_key *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_int = {"_p_int", "intptr_t *|int *|int_least32_t *|int_fast32_t *|int32_t *|int_fast16_t *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_long_long = {"_p_long_long", "int_least64_t *|int_fast64_t *|int64_t *|long long *|intmax_t *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_p_char = {"_p_p_char", "char **", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_p_ext_key = {"_p_p_ext_key", "struct ext_key **", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_p_wally_descriptor = {"_p_p_wally_descriptor", "struct wally_descriptor **", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_p_wally_map = {"_p_p_wally_map", "struct wally_map **", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_p_wally_psbt = {"_p_p_wally_psbt", "struct wally_psbt **", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_p_wally_tx = {"_p_p_wally_tx", "struct wally_tx **", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_p_wally_tx_input = {"_p_p_wally_tx_input", "struct wally_tx_input **", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_p_wally_tx_output = {"_p_p_wally_tx_output", "struct wally_tx_output **", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_p_wally_tx_witness_stack = {"_p_p_wally_tx_witness_stack", "struct wally_tx_witness_stack **", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_p_words = {"_p_p_words", "struct words **", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_short = {"_p_short", "short *|int_least16_t *|int16_t *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_signed_char = {"_p_signed_char", "signed char *|int_least8_t *|int_fast8_t *|int8_t *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_size_t = {"_p_size_t", "size_t *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_unsigned_char = {"_p_unsigned_char", "unsigned char *|uint_least8_t *|uint_fast8_t *|uint8_t *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_unsigned_int = {"_p_unsigned_int", "uintptr_t *|uint_least32_t *|uint_fast32_t *|uint32_t *|unsigned int *|uint_fast16_t *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_unsigned_long_long = {"_p_unsigned_long_long", "uint_least64_t *|uint_fast64_t *|uint64_t *|unsigned long long *|uintmax_t *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_unsigned_short = {"_p_unsigned_short", "unsigned short *|uint_least16_t *|uint16_t *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_wally_descriptor = {"_p_wally_descriptor", "struct wally_descriptor *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_wally_map = {"_p_wally_map", "struct wally_map *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_wally_psbt = {"_p_wally_psbt", "struct wally_psbt *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_wally_psbt_input = {"_p_wally_psbt_input", "struct wally_psbt_input *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_wally_psbt_output = {"_p_wally_psbt_output", "struct wally_psbt_output *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_wally_tx = {"_p_wally_tx", "struct wally_tx *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_wally_tx_input = {"_p_wally_tx_input", "struct wally_tx_input *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_wally_tx_output = {"_p_wally_tx_output", "struct wally_tx_output *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_wally_tx_witness_stack = {"_p_wally_tx_witness_stack", "struct wally_tx_witness_stack *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_words = {"_p_words", "struct words *", 0, 0, (void*)0, 0};

static swig_type_info *swig_type_initial[] = {
  &_swigt__p_char,
  &_swigt__p_ext_key,
  &_swigt__p_int,
  &_swigt__p_long_long,
  &_swigt__p_p_char,
  &_swigt__p_p_ext_key,
  &_swigt__p_p_wally_descriptor,
  &_swigt__p_p_wally_map,
  &_swigt__p_p_wally_psbt,
  &_swigt__p_p_wally_tx,
  &_swigt__p_p_wally_tx_input,
  &_swigt__p_p_wally_tx_output,
  &_swigt__p_p_wally_tx_witness_stack,
  &_swigt__p_p_words,
  &_swigt__p_short,
  &_swigt__p_signed_char,
  &_swigt__p_size_t,
  &_swigt__p_unsigned_char,
  &_swigt__p_unsigned_int,
  &_swigt__p_unsigned_long_long,
  &_swigt__p_unsigned_short,
  &_swigt__p_wally_descriptor,
  &_swigt__p_wally_map,
  &_swigt__p_wally_psbt,
  &_swigt__p_wally_psbt_input,
  &_swigt__p_wally_psbt_output,
  &_swigt__p_wally_tx,
  &_swigt__p_wally_tx_input,
  &_swigt__p_wally_tx_output,
  &_swigt__p_wally_tx_witness_stack,
  &_swigt__p_words,
};

static swig_cast_info _swigc__p_char[] = {  {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_ext_key[] = {  {&_swigt__p_ext_key, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_int[] = {  {&_swigt__p_int, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_long_long[] = {  {&_swigt__p_long_long, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_p_char[] = {  {&_swigt__p_p_char, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_p_ext_key[] = {  {&_swigt__p_p_ext_key, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_p_wally_descriptor[] = {  {&_swigt__p_p_wally_descriptor, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_p_wally_map[] = {  {&_swigt__p_p_wally_map, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_p_wally_psbt[] = {  {&_swigt__p_p_wally_psbt, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_p_wally_tx[] = {  {&_swigt__p_p_wally_tx, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_p_wally_tx_input[] = {  {&_swigt__p_p_wally_tx_input, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_p_wally_tx_output[] = {  {&_swigt__p_p_wally_tx_output, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_p_wally_tx_witness_stack[] = {  {&_swigt__p_p_wally_tx_witness_stack, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_p_words[] = {  {&_swigt__p_p_words, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_short[] = {  {&_swigt__p_short, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_signed_char[] = {  {&_swigt__p_signed_char, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_size_t[] = {  {&_swigt__p_size_t, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_unsigned_char[] = {  {&_swigt__p_unsigned_char, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_unsigned_int[] = {  {&_swigt__p_unsigned_int, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_unsigned_long_long[] = {  {&_swigt__p_unsigned_long_long, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_unsigned_short[] = {  {&_swigt__p_unsigned_short, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_wally_descriptor[] = {  {&_swigt__p_wally_descriptor, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_wally_map[] = {  {&_swigt__p_wally_map, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_wally_psbt[] = {  {&_swigt__p_wally_psbt, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_wally_psbt_input[] = {  {&_swigt__p_wally_psbt_input, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_wally_psbt_output[] = {  {&_swigt__p_wally_psbt_output, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_wally_tx[] = {  {&_swigt__p_wally_tx, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_wally_tx_input[] = {  {&_swigt__p_wally_tx_input, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_wally_tx_output[] = {  {&_swigt__p_wally_tx_output, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_wally_tx_witness_stack[] = {  {&_swigt__p_wally_tx_witness_stack, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_words[] = {  {&_swigt__p_words, 0, 0, 0},{0, 0, 0, 0}};

static swig_cast_info *swig_cast_initial[] = {
  _swigc__p_char,
  _swigc__p_ext_key,
  _swigc__p_int,
  _swigc__p_long_long,
  _swigc__p_p_char,
  _swigc__p_p_ext_key,
  _swigc__p_p_wally_descriptor,
  _swigc__p_p_wally_map,
  _swigc__p_p_wally_psbt,
  _swigc__p_p_wally_tx,
  _swigc__p_p_wally_tx_input,
  _swigc__p_p_wally_tx_output,
  _swigc__p_p_wally_tx_witness_stack,
  _swigc__p_p_words,
  _swigc__p_short,
  _swigc__p_signed_char,
  _swigc__p_size_t,
  _swigc__p_unsigned_char,
  _swigc__p_unsigned_int,
  _swigc__p_unsigned_long_long,
  _swigc__p_unsigned_short,
  _swigc__p_wally_descriptor,
  _swigc__p_wally_map,
  _swigc__p_wally_psbt,
  _swigc__p_wally_psbt_input,
  _swigc__p_wally_psbt_output,
  _swigc__p_wally_tx,
  _swigc__p_wally_tx_input,
  _swigc__p_wally_tx_output,
  _swigc__p_wally_tx_witness_stack,
  _swigc__p_words,
};


/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */

static swig_const_info swig_const_table[] = {
{0, 0, 0, 0.0, 0, 0}};

#ifdef __cplusplus
}
#endif
/* -----------------------------------------------------------------------------
 * Type initialization:
 * This problem is tough by the requirement that no dynamic
 * memory is used. Also, since swig_type_info structures store pointers to
 * swig_cast_info structures and swig_cast_info structures store pointers back
 * to swig_type_info structures, we need some lookup code at initialization.
 * The idea is that swig generates all the structures that are needed.
 * The runtime then collects these partially filled structures.
 * The SWIG_InitializeModule function takes these initial arrays out of
 * swig_module, and does all the lookup, filling in the swig_module.types
 * array with the correct data and linking the correct swig_cast_info
 * structures together.
 *
 * The generated swig_type_info structures are assigned statically to an initial
 * array. We just loop through that array, and handle each type individually.
 * First we lookup if this type has been already loaded, and if so, use the
 * loaded structure instead of the generated one. Then we have to fill in the
 * cast linked list. The cast data is initially stored in something like a
 * two-dimensional array. Each row corresponds to a type (there are the same
 * number of rows as there are in the swig_type_initial array). Each entry in
 * a column is one of the swig_cast_info structures for that type.
 * The cast_initial array is actually an array of arrays, because each row has
 * a variable number of columns. So to actually build the cast linked list,
 * we find the array of casts associated with the type, and loop through it
 * adding the casts to the list. The one last trick we need to do is making
 * sure the type pointer in the swig_cast_info struct is correct.
 *
 * First off, we lookup the cast->type name to see if it is already loaded.
 * There are three cases to handle:
 *  1) If the cast->type has already been loaded AND the type we are adding
 *     casting info to has not been loaded (it is in this module), THEN we
 *     replace the cast->type pointer with the type pointer that has already
 *     been loaded.
 *  2) If BOTH types (the one we are adding casting info to, and the
 *     cast->type) are loaded, THEN the cast info has already been loaded by
 *     the previous module so we just ignore it.
 *  3) Finally, if cast->type has not already been loaded, then we add that
 *     swig_cast_info to the linked list (because the cast->type) pointer will
 *     be correct.
 * ----------------------------------------------------------------------------- */

#ifdef __cplusplus
extern "C" {
#if 0
} /* c-mode */
#endif
#endif

#if 0
#define SWIGRUNTIME_DEBUG
#endif


SWIGRUNTIME void
SWIG_InitializeModule(void *clientdata) {
  size_t i;
  swig_module_info *module_head, *iter;
  int init;
  
  /* check to see if the circular list has been setup, if not, set it up */
  if (swig_module.next==0) {
    /* Initialize the swig_module */
    swig_module.type_initial = swig_type_initial;
    swig_module.cast_initial = swig_cast_initial;
    swig_module.next = &swig_module;
    init = 1;
  } else {
    init = 0;
  }
  
  /* Try and load any already created modules */
  module_head = SWIG_GetModule(clientdata);
  if (!module_head) {
    /* This is the first module loaded for this interpreter */
    /* so set the swig module into the interpreter */
    SWIG_SetModule(clientdata, &swig_module);
  } else {
    /* the interpreter has loaded a SWIG module, but has it loaded this one? */
    iter=module_head;
    do {
      if (iter==&swig_module) {
        /* Our module is already in the list, so there's nothing more to do. */
        return;
      }
      iter=iter->next;
    } while (iter!= module_head);
    
    /* otherwise we must add our module into the list */
    swig_module.next = module_head->next;
    module_head->next = &swig_module;
  }
  
  /* When multiple interpreters are used, a module could have already been initialized in
       a different interpreter, but not yet have a pointer in this interpreter.
       In this case, we do not want to continue adding types... everything should be
       set up already */
  if (init == 0) return;
  
  /* Now work on filling in swig_module.types */
#ifdef SWIGRUNTIME_DEBUG
  printf("SWIG_InitializeModule: size %lu\n", (unsigned long)swig_module.size);
#endif
  for (i = 0; i < swig_module.size; ++i) {
    swig_type_info *type = 0;
    swig_type_info *ret;
    swig_cast_info *cast;
    
#ifdef SWIGRUNTIME_DEBUG
    printf("SWIG_InitializeModule: type %lu %s\n", (unsigned long)i, swig_module.type_initial[i]->name);
#endif
    
    /* if there is another module already loaded */
    if (swig_module.next != &swig_module) {
      type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name);
    }
    if (type) {
      /* Overwrite clientdata field */
#ifdef SWIGRUNTIME_DEBUG
      printf("SWIG_InitializeModule: found type %s\n", type->name);
#endif
      if (swig_module.type_initial[i]->clientdata) {
        type->clientdata = swig_module.type_initial[i]->clientdata;
#ifdef SWIGRUNTIME_DEBUG
        printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name);
#endif
      }
    } else {
      type = swig_module.type_initial[i];
    }
    
    /* Insert casting types */
    cast = swig_module.cast_initial[i];
    while (cast->type) {
      /* Don't need to add information already in the list */
      ret = 0;
#ifdef SWIGRUNTIME_DEBUG
      printf("SWIG_InitializeModule: look cast %s\n", cast->type->name);
#endif
      if (swig_module.next != &swig_module) {
        ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name);
#ifdef SWIGRUNTIME_DEBUG
        if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name);
#endif
      }
      if (ret) {
        if (type == swig_module.type_initial[i]) {
#ifdef SWIGRUNTIME_DEBUG
          printf("SWIG_InitializeModule: skip old type %s\n", ret->name);
#endif
          cast->type = ret;
          ret = 0;
        } else {
          /* Check for casting already in the list */
          swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type);
#ifdef SWIGRUNTIME_DEBUG
          if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name);
#endif
          if (!ocast) ret = 0;
        }
      }
      
      if (!ret) {
#ifdef SWIGRUNTIME_DEBUG
        printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name);
#endif
        if (type->cast) {
          type->cast->prev = cast;
          cast->next = type->cast;
        }
        type->cast = cast;
      }
      cast++;
    }
    /* Set entry in modules->types array equal to the type */
    swig_module.types[i] = type;
  }
  swig_module.types[i] = 0;
  
#ifdef SWIGRUNTIME_DEBUG
  printf("**** SWIG_InitializeModule: Cast List ******\n");
  for (i = 0; i < swig_module.size; ++i) {
    int j = 0;
    swig_cast_info *cast = swig_module.cast_initial[i];
    printf("SWIG_InitializeModule: type %lu %s\n", (unsigned long)i, swig_module.type_initial[i]->name);
    while (cast->type) {
      printf("SWIG_InitializeModule: cast type %s\n", cast->type->name);
      cast++;
      ++j;
    }
    printf("---- Total casts: %d\n",j);
  }
  printf("**** SWIG_InitializeModule: Cast List ******\n");
#endif
}

/* This function will propagate the clientdata field of type to
* any new swig_type_info structures that have been added into the list
* of equivalent types.  It is like calling
* SWIG_TypeClientData(type, clientdata) a second time.
*/
SWIGRUNTIME void
SWIG_PropagateClientData(void) {
  size_t i;
  swig_cast_info *equiv;
  static int init_run = 0;
  
  if (init_run) return;
  init_run = 1;
  
  for (i = 0; i < swig_module.size; i++) {
    if (swig_module.types[i]->clientdata) {
      equiv = swig_module.types[i]->cast;
      while (equiv) {
        if (!equiv->converter) {
          if (equiv->type && !equiv->type->clientdata)
          SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata);
        }
        equiv = equiv->next;
      }
    }
  }
}

#ifdef __cplusplus
#if 0
{
  /* c-mode */
#endif
}
#endif



#ifdef __cplusplus
extern "C" {
#endif
  
  /* Python-specific SWIG API */
#define SWIG_newvarlink()                             SWIG_Python_newvarlink()
#define SWIG_addvarlink(p, name, get_attr, set_attr)  SWIG_Python_addvarlink(p, name, get_attr, set_attr)
#define SWIG_InstallConstants(d, constants)           SWIG_Python_InstallConstants(d, constants)
  
  /* -----------------------------------------------------------------------------
   * global variable support code.
   * ----------------------------------------------------------------------------- */
  
  typedef struct swig_globalvar {
    char       *name;                  /* Name of global variable */
    PyObject *(*get_attr)(void);       /* Return the current value */
    int       (*set_attr)(PyObject *); /* Set the value */
    struct swig_globalvar *next;
  } swig_globalvar;
  
  typedef struct swig_varlinkobject {
    PyObject_HEAD
    swig_globalvar *vars;
  } swig_varlinkobject;
  
  SWIGINTERN PyObject *
  swig_varlink_repr(swig_varlinkobject *SWIGUNUSEDPARM(v)) {
#if PY_VERSION_HEX >= 0x03000000
    return PyUnicode_InternFromString("<Swig global variables>");
#else
    return PyString_FromString("<Swig global variables>");
#endif
  }
  
  SWIGINTERN PyObject *
  swig_varlink_str(swig_varlinkobject *v) {
#if PY_VERSION_HEX >= 0x03000000
    PyObject *str = PyUnicode_InternFromString("(");
    PyObject *tail;
    PyObject *joined;
    swig_globalvar *var;
    for (var = v->vars; var; var=var->next) {
      tail = PyUnicode_FromString(var->name);
      joined = PyUnicode_Concat(str, tail);
      Py_DecRef(str);
      Py_DecRef(tail);
      str = joined;
      if (var->next) {
        tail = PyUnicode_InternFromString(", ");
        joined = PyUnicode_Concat(str, tail);
        Py_DecRef(str);
        Py_DecRef(tail);
        str = joined;
      }
    }
    tail = PyUnicode_InternFromString(")");
    joined = PyUnicode_Concat(str, tail);
    Py_DecRef(str);
    Py_DecRef(tail);
    str = joined;
#else
    PyObject *str = PyString_FromString("(");
    swig_globalvar *var;
    for (var = v->vars; var; var=var->next) {
      PyString_ConcatAndDel(&str,PyString_FromString(var->name));
      if (var->next) PyString_ConcatAndDel(&str,PyString_FromString(", "));
    }
    PyString_ConcatAndDel(&str,PyString_FromString(")"));
#endif
    return str;
  }
  
  SWIGINTERN void
  swig_varlink_dealloc(swig_varlinkobject *v) {
    swig_globalvar *var = v->vars;
    while (var) {
      swig_globalvar *n = var->next;
      free(var->name);
      free(var);
      var = n;
    }
  }
  
  SWIGINTERN PyObject *
  swig_varlink_getattr(swig_varlinkobject *v, char *n) {
    PyObject *res = NULL;
    swig_globalvar *var = v->vars;
    while (var) {
      if (strcmp(var->name,n) == 0) {
        res = (*var->get_attr)();
        break;
      }
      var = var->next;
    }
    if (res == NULL && !PyErr_Occurred()) {
      PyErr_Format(PyExc_AttributeError, "Unknown C global variable '%s'", n);
    }
    return res;
  }
  
  SWIGINTERN int
  swig_varlink_setattr(swig_varlinkobject *v, char *n, PyObject *p) {
    int res = 1;
    swig_globalvar *var = v->vars;
    while (var) {
      if (strcmp(var->name,n) == 0) {
        res = (*var->set_attr)(p);
        break;
      }
      var = var->next;
    }
    if (res == 1 && !PyErr_Occurred()) {
      PyErr_Format(PyExc_AttributeError, "Unknown C global variable '%s'", n);
    }
    return res;
  }
  
  SWIGINTERN PyTypeObject*
  swig_varlink_type(void) {
    static char varlink__doc__[] = "Swig var link object";
    static PyTypeObject varlink_type;
    static int type_init = 0;
    if (!type_init) {
      const PyTypeObject tmp = {
#if PY_VERSION_HEX >= 0x03000000
        PyVarObject_HEAD_INIT(NULL, 0)
#else
        PyObject_HEAD_INIT(NULL)
        0,                                  /* ob_size */
#endif
        "swigvarlink",                      /* tp_name */
        sizeof(swig_varlinkobject),         /* tp_basicsize */
        0,                                  /* tp_itemsize */
        (destructor) swig_varlink_dealloc,  /* tp_dealloc */
        0,                                  /* tp_print */
        (getattrfunc) swig_varlink_getattr, /* tp_getattr */
        (setattrfunc) swig_varlink_setattr, /* tp_setattr */
        0,                                  /* tp_compare */
        (reprfunc) swig_varlink_repr,       /* tp_repr */
        0,                                  /* tp_as_number */
        0,                                  /* tp_as_sequence */
        0,                                  /* tp_as_mapping */
        0,                                  /* tp_hash */
        0,                                  /* tp_call */
        (reprfunc) swig_varlink_str,        /* tp_str */
        0,                                  /* tp_getattro */
        0,                                  /* tp_setattro */
        0,                                  /* tp_as_buffer */
        0,                                  /* tp_flags */
        varlink__doc__,                     /* tp_doc */
        0,                                  /* tp_traverse */
        0,                                  /* tp_clear */
        0,                                  /* tp_richcompare */
        0,                                  /* tp_weaklistoffset */
        0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* tp_iter -> tp_weaklist */
        0,                                  /* tp_del */
        0,                                  /* tp_version_tag */
#if PY_VERSION_HEX >= 0x03040000
        0,                                  /* tp_finalize */
#endif
#if PY_VERSION_HEX >= 0x03080000
        0,                                  /* tp_vectorcall */
#endif
#if (PY_VERSION_HEX >= 0x03080000) && (PY_VERSION_HEX < 0x03090000)
        0,                                  /* tp_print */
#endif
#ifdef COUNT_ALLOCS
        0,                                  /* tp_allocs */
        0,                                  /* tp_frees */
        0,                                  /* tp_maxalloc */
        0,                                  /* tp_prev */
        0                                   /* tp_next */
#endif
      };
      varlink_type = tmp;
      type_init = 1;
      if (PyType_Ready(&varlink_type) < 0)
      return NULL;
    }
    return &varlink_type;
  }
  
  /* Create a variable linking object for use later */
  SWIGINTERN PyObject *
  SWIG_Python_newvarlink(void) {
    swig_varlinkobject *result = PyObject_NEW(swig_varlinkobject, swig_varlink_type());
    if (result) {
      result->vars = 0;
    }
    return ((PyObject*) result);
  }
  
  SWIGINTERN void 
  SWIG_Python_addvarlink(PyObject *p, const char *name, PyObject *(*get_attr)(void), int (*set_attr)(PyObject *p)) {
    swig_varlinkobject *v = (swig_varlinkobject *) p;
    swig_globalvar *gv = (swig_globalvar *) malloc(sizeof(swig_globalvar));
    if (gv) {
      size_t size = strlen(name)+1;
      gv->name = (char *)malloc(size);
      if (gv->name) {
        memcpy(gv->name, name, size);
        gv->get_attr = get_attr;
        gv->set_attr = set_attr;
        gv->next = v->vars;
      }
    }
    v->vars = gv;
  }
  
  SWIGINTERN PyObject *
  SWIG_globals(void) {
    static PyObject *globals = 0;
    if (!globals) {
      globals = SWIG_newvarlink();
    }
    return globals;
  }
  
  /* -----------------------------------------------------------------------------
   * constants/methods manipulation
   * ----------------------------------------------------------------------------- */
  
  /* Install Constants */
  SWIGINTERN void
  SWIG_Python_InstallConstants(PyObject *d, swig_const_info constants[]) {
    PyObject *obj = 0;
    size_t i;
    for (i = 0; constants[i].type; ++i) {
      switch(constants[i].type) {
      case SWIG_PY_POINTER:
        obj = SWIG_InternalNewPointerObj(constants[i].pvalue, *(constants[i]).ptype,0);
        break;
      case SWIG_PY_BINARY:
        obj = SWIG_NewPackedObj(constants[i].pvalue, constants[i].lvalue, *(constants[i].ptype));
        break;
      default:
        obj = 0;
        break;
      }
      if (obj) {
        PyDict_SetItemString(d, constants[i].name, obj);
        Py_DECREF(obj);
      }
    }
  }
  
  /* -----------------------------------------------------------------------------*/
  /* Fix SwigMethods to carry the callback ptrs when needed */
  /* -----------------------------------------------------------------------------*/
  
  SWIGINTERN void
  SWIG_Python_FixMethods(PyMethodDef *methods,
    swig_const_info *const_table,
    swig_type_info **types,
    swig_type_info **types_initial) {
    size_t i;
    for (i = 0; methods[i].ml_name; ++i) {
      const char *c = methods[i].ml_doc;
      if (!c) continue;
      c = strstr(c, "swig_ptr: ");
      if (c) {
        int j;
        swig_const_info *ci = 0;
        const char *name = c + 10;
        for (j = 0; const_table[j].type; ++j) {
          if (strncmp(const_table[j].name, name, 
              strlen(const_table[j].name)) == 0) {
            ci = &(const_table[j]);
            break;
          }
        }
        if (ci) {
          void *ptr = (ci->type == SWIG_PY_POINTER) ? ci->pvalue : 0;
          if (ptr) {
            size_t shift = (ci->ptype) - types;
            swig_type_info *ty = types_initial[shift];
            size_t ldoc = (c - methods[i].ml_doc);
            size_t lptr = strlen(ty->name)+2*sizeof(void*)+2;
            char *ndoc = (char*)malloc(ldoc + lptr + 10);
            if (ndoc) {
              char *buff = ndoc;
              memcpy(buff, methods[i].ml_doc, ldoc);
              buff += ldoc;
              memcpy(buff, "swig_ptr: ", 10);
              buff += 10;
              SWIG_PackVoidPtr(buff, ptr, ty->name, lptr);
              methods[i].ml_doc = ndoc;
            }
          }
        }
      }
    }
  } 
  
  /* -----------------------------------------------------------------------------
   * Method creation and docstring support functions
   * ----------------------------------------------------------------------------- */
  
  /* -----------------------------------------------------------------------------
   * Function to find the method definition with the correct docstring for the
   * proxy module as opposed to the low-level API
   * ----------------------------------------------------------------------------- */
  
  SWIGINTERN PyMethodDef *SWIG_PythonGetProxyDoc(const char *name) {
    /* Find the function in the modified method table */
    size_t offset = 0;
    int found = 0;
    while (SwigMethods_proxydocs[offset].ml_meth != NULL) {
      if (strcmp(SwigMethods_proxydocs[offset].ml_name, name) == 0) {
        found = 1;
        break;
      }
      offset++;
    }
    /* Use the copy with the modified docstring if available */
    return found ? &SwigMethods_proxydocs[offset] : NULL;
  }
  
  /* -----------------------------------------------------------------------------
   * Wrapper of PyInstanceMethod_New() used in Python 3
   * It is exported to the generated module, used for -fastproxy
   * ----------------------------------------------------------------------------- */
  
  SWIGINTERN PyObject *SWIG_PyInstanceMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func) {
    if (PyCFunction_Check(func)) {
      PyCFunctionObject *funcobj = (PyCFunctionObject *)func;
      PyMethodDef *ml = SWIG_PythonGetProxyDoc(funcobj->m_ml->ml_name);
      if (ml)
      func = PyCFunction_NewEx(ml, funcobj->m_self, funcobj->m_module);
    }
#if PY_VERSION_HEX >= 0x03000000
    return PyInstanceMethod_New(func);
#else
    return PyMethod_New(func, NULL, NULL);
#endif
  }
  
  /* -----------------------------------------------------------------------------
   * Wrapper of PyStaticMethod_New()
   * It is exported to the generated module, used for -fastproxy
   * ----------------------------------------------------------------------------- */
  
  SWIGINTERN PyObject *SWIG_PyStaticMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func) {
    if (PyCFunction_Check(func)) {
      PyCFunctionObject *funcobj = (PyCFunctionObject *)func;
      PyMethodDef *ml = SWIG_PythonGetProxyDoc(funcobj->m_ml->ml_name);
      if (ml)
      func = PyCFunction_NewEx(ml, funcobj->m_self, funcobj->m_module);
    }
    return PyStaticMethod_New(func);
  }
  
#ifdef __cplusplus
}
#endif

/* -----------------------------------------------------------------------------*
 *  Partial Init method
 * -----------------------------------------------------------------------------*/

#ifdef __cplusplus
extern "C"
#endif

SWIGEXPORT 
#if PY_VERSION_HEX >= 0x03000000
PyObject*
#else
void
#endif
SWIG_init(void) {
  PyObject *m, *d, *md, *globals;
  
#if PY_VERSION_HEX >= 0x03000000
  static struct PyModuleDef SWIG_module = {
    PyModuleDef_HEAD_INIT,
    SWIG_name,
    NULL,
    -1,
    SwigMethods,
    NULL,
    NULL,
    NULL,
    NULL
  };
#endif
  
#if defined(SWIGPYTHON_BUILTIN)
  static SwigPyClientData SwigPyObject_clientdata = {
    0, 0, 0, 0, 0, 0, 0
  };
  static PyGetSetDef this_getset_def = {
    (char *)"this", &SwigPyBuiltin_ThisClosure, NULL, NULL, NULL
  };
  static SwigPyGetSet thisown_getset_closure = {
    SwigPyObject_own,
    SwigPyObject_own
  };
  static PyGetSetDef thisown_getset_def = {
    (char *)"thisown", SwigPyBuiltin_GetterClosure, SwigPyBuiltin_SetterClosure, NULL, &thisown_getset_closure
  };
  PyTypeObject *builtin_pytype;
  int builtin_base_count;
  swig_type_info *builtin_basetype;
  PyObject *tuple;
  PyGetSetDescrObject *static_getset;
  PyTypeObject *metatype;
  PyTypeObject *swigpyobject;
  SwigPyClientData *cd;
  PyObject *public_interface, *public_symbol;
  PyObject *this_descr;
  PyObject *thisown_descr;
  PyObject *self = 0;
  int i;
  
  (void)builtin_pytype;
  (void)builtin_base_count;
  (void)builtin_basetype;
  (void)tuple;
  (void)static_getset;
  (void)self;
  
  /* Metaclass is used to implement static member variables */
  metatype = SwigPyObjectType();
  assert(metatype);
#endif
  
  (void)globals;
  
  /* Create singletons now to avoid potential deadlocks with multi-threaded usage after module initialization */
  SWIG_This();
  SWIG_Python_TypeCache();
  SwigPyPacked_type();
#ifndef SWIGPYTHON_BUILTIN
  SwigPyObject_type();
#endif
  
  /* Fix SwigMethods to carry the callback ptrs when needed */
  SWIG_Python_FixMethods(SwigMethods, swig_const_table, swig_types, swig_type_initial);
  
#if PY_VERSION_HEX >= 0x03000000
  m = PyModule_Create(&SWIG_module);
#else
  m = Py_InitModule(SWIG_name, SwigMethods);
#endif
  
  md = d = PyModule_GetDict(m);
  (void)md;
  
  SWIG_InitializeModule(0);
  
#ifdef SWIGPYTHON_BUILTIN
  swigpyobject = SwigPyObject_TypeOnce();
  
  SwigPyObject_stype = SWIG_MangledTypeQuery("_p_SwigPyObject");
  assert(SwigPyObject_stype);
  cd = (SwigPyClientData*) SwigPyObject_stype->clientdata;
  if (!cd) {
    SwigPyObject_stype->clientdata = &SwigPyObject_clientdata;
    SwigPyObject_clientdata.pytype = swigpyobject;
  } else if (swigpyobject->tp_basicsize != cd->pytype->tp_basicsize) {
    PyErr_SetString(PyExc_RuntimeError, "Import error: attempted to load two incompatible swig-generated modules.");
# if PY_VERSION_HEX >= 0x03000000
    return NULL;
# else
    return;
# endif
  }
  
  /* All objects have a 'this' attribute */
  this_descr = PyDescr_NewGetSet(SwigPyObject_type(), &this_getset_def);
  (void)this_descr;
  
  /* All objects have a 'thisown' attribute */
  thisown_descr = PyDescr_NewGetSet(SwigPyObject_type(), &thisown_getset_def);
  (void)thisown_descr;
  
  public_interface = PyList_New(0);
  public_symbol = 0;
  (void)public_symbol;
  
  PyDict_SetItemString(md, "__all__", public_interface);
  Py_DECREF(public_interface);
  for (i = 0; SwigMethods[i].ml_name != NULL; ++i)
  SwigPyBuiltin_AddPublicSymbol(public_interface, SwigMethods[i].ml_name);
  for (i = 0; swig_const_table[i].name != 0; ++i)
  SwigPyBuiltin_AddPublicSymbol(public_interface, swig_const_table[i].name);
#endif
  
  SWIG_InstallConstants(d,swig_const_table);
  
  SWIG_Python_SetConstant(d, "WALLY_OK",SWIG_From_int((int)(0)));
  SWIG_Python_SetConstant(d, "WALLY_ERROR",SWIG_From_int((int)(-1)));
  SWIG_Python_SetConstant(d, "WALLY_EINVAL",SWIG_From_int((int)(-2)));
  SWIG_Python_SetConstant(d, "WALLY_ENOMEM",SWIG_From_int((int)(-3)));
  SWIG_Python_SetConstant(d, "WALLY_MAJOR_VER",SWIG_From_int((int)(1)));
  SWIG_Python_SetConstant(d, "WALLY_MINOR_VER",SWIG_From_int((int)(5)));
  SWIG_Python_SetConstant(d, "WALLY_PATCH_VER",SWIG_From_int((int)(2)));
  SWIG_Python_SetConstant(d, "WALLY_BUILD_VER",SWIG_From_int((int)(0x10502)));
  SWIG_Python_SetConstant(d, "WALLY_SECP_RANDOMIZE_LEN",SWIG_From_int((int)(32)));
  SWIG_Python_SetConstant(d, "BASE58_FLAG_CHECKSUM",SWIG_From_int((int)(0x1)));
  SWIG_Python_SetConstant(d, "BASE58_CHECKSUM_LEN",SWIG_From_int((int)(4)));
  SWIG_Python_SetConstant(d, "WALLY_WIF_FLAG_COMPRESSED",SWIG_From_int((int)(0x0)));
  SWIG_Python_SetConstant(d, "WALLY_WIF_FLAG_UNCOMPRESSED",SWIG_From_int((int)(0x1)));
  SWIG_Python_SetConstant(d, "WALLY_CA_PREFIX_LIQUID",SWIG_From_int((int)(0x0c)));
  SWIG_Python_SetConstant(d, "WALLY_CA_PREFIX_LIQUID_REGTEST",SWIG_From_int((int)(0x04)));
  SWIG_Python_SetConstant(d, "WALLY_CA_PREFIX_LIQUID_TESTNET",SWIG_From_int((int)(0x17)));
  SWIG_Python_SetConstant(d, "WALLY_NETWORK_NONE",SWIG_From_int((int)(0x00)));
  SWIG_Python_SetConstant(d, "WALLY_NETWORK_BITCOIN_MAINNET",SWIG_From_int((int)(0x01)));
  SWIG_Python_SetConstant(d, "WALLY_NETWORK_BITCOIN_REGTEST",SWIG_From_int((int)(0xff)));
  SWIG_Python_SetConstant(d, "WALLY_NETWORK_BITCOIN_TESTNET",SWIG_From_int((int)(0x02)));
  SWIG_Python_SetConstant(d, "WALLY_NETWORK_LIQUID",SWIG_From_int((int)(0x03)));
  SWIG_Python_SetConstant(d, "WALLY_NETWORK_LIQUID_REGTEST",SWIG_From_int((int)(0x04)));
  SWIG_Python_SetConstant(d, "WALLY_NETWORK_LIQUID_TESTNET",SWIG_From_int((int)(0x05)));
  SWIG_Python_SetConstant(d, "WALLY_ADDRESS_TYPE_P2PKH",SWIG_From_int((int)(0x01)));
  SWIG_Python_SetConstant(d, "WALLY_ADDRESS_TYPE_P2SH_P2WPKH",SWIG_From_int((int)(0x02)));
  SWIG_Python_SetConstant(d, "WALLY_ADDRESS_TYPE_P2WPKH",SWIG_From_int((int)(0x04)));
  SWIG_Python_SetConstant(d, "WALLY_ADDRESS_VERSION_P2PKH_MAINNET",SWIG_From_int((int)(0x00)));
  SWIG_Python_SetConstant(d, "WALLY_ADDRESS_VERSION_P2PKH_TESTNET",SWIG_From_int((int)(0x6F)));
  SWIG_Python_SetConstant(d, "WALLY_ADDRESS_VERSION_P2PKH_LIQUID",SWIG_From_int((int)(0x39)));
  SWIG_Python_SetConstant(d, "WALLY_ADDRESS_VERSION_P2PKH_LIQUID_REGTEST",SWIG_From_int((int)(0xEB)));
  SWIG_Python_SetConstant(d, "WALLY_ADDRESS_VERSION_P2PKH_LIQUID_TESTNET",SWIG_From_int((int)(0x24)));
  SWIG_Python_SetConstant(d, "WALLY_ADDRESS_VERSION_P2SH_MAINNET",SWIG_From_int((int)(0x05)));
  SWIG_Python_SetConstant(d, "WALLY_ADDRESS_VERSION_P2SH_TESTNET",SWIG_From_int((int)(0xC4)));
  SWIG_Python_SetConstant(d, "WALLY_ADDRESS_VERSION_P2SH_LIQUID",SWIG_From_int((int)(0x27)));
  SWIG_Python_SetConstant(d, "WALLY_ADDRESS_VERSION_P2SH_LIQUID_REGTEST",SWIG_From_int((int)(0x4B)));
  SWIG_Python_SetConstant(d, "WALLY_ADDRESS_VERSION_P2SH_LIQUID_TESTNET",SWIG_From_int((int)(0x13)));
  SWIG_Python_SetConstant(d, "WALLY_ADDRESS_VERSION_WIF_MAINNET",SWIG_From_int((int)(0x80)));
  SWIG_Python_SetConstant(d, "WALLY_ADDRESS_VERSION_WIF_TESTNET",SWIG_From_int((int)(0xEF)));
  SWIG_Python_SetConstant(d, "WALLY_SEGWIT_ADDRESS_PUBKEY_MAX_LEN",SWIG_From_int((int)(42)));
  SWIG_Python_SetConstant(d, "WALLY_ADDRESS_PUBKEY_MAX_LEN",SWIG_From_int((int)(25)));
  SWIG_Python_SetConstant(d, "WALLY_SEGWIT_V0_ADDRESS_PUBKEY_MAX_LEN",SWIG_From_int((int)(34)));
  SWIG_Python_SetConstant(d, "WALLY_SEGWIT_V1_ADDRESS_PUBKEY_LEN",SWIG_From_int((int)(34)));
  SWIG_Python_SetConstant(d, "WALLY_HOST_COMMITMENT_LEN",SWIG_From_int((int)(32)));
  SWIG_Python_SetConstant(d, "BIP32_ENTROPY_LEN_128",SWIG_From_int((int)(16)));
  SWIG_Python_SetConstant(d, "BIP32_ENTROPY_LEN_256",SWIG_From_int((int)(32)));
  SWIG_Python_SetConstant(d, "BIP32_ENTROPY_LEN_512",SWIG_From_int((int)(64)));
  SWIG_Python_SetConstant(d, "BIP32_KEY_FINGERPRINT_LEN",SWIG_From_int((int)(4)));
  SWIG_Python_SetConstant(d, "BIP32_SERIALIZED_LEN",SWIG_From_int((int)(78)));
  SWIG_Python_SetConstant(d, "BIP32_INITIAL_HARDENED_CHILD",SWIG_From_int((int)(0x80000000)));
  SWIG_Python_SetConstant(d, "BIP32_PATH_MAX_LEN",SWIG_From_int((int)(255)));
  SWIG_Python_SetConstant(d, "WALLY_BIP32_CHAIN_CODE_LEN",SWIG_From_int((int)(32)));
  SWIG_Python_SetConstant(d, "WALLY_BIP32_TWEAK_SUM_LEN",SWIG_From_int((int)(32)));
  SWIG_Python_SetConstant(d, "BIP32_FLAG_KEY_PRIVATE",SWIG_From_int((int)(0x0)));
  SWIG_Python_SetConstant(d, "BIP32_FLAG_KEY_PUBLIC",SWIG_From_int((int)(0x1)));
  SWIG_Python_SetConstant(d, "BIP32_FLAG_SKIP_HASH",SWIG_From_int((int)(0x2)));
  SWIG_Python_SetConstant(d, "BIP32_FLAG_KEY_TWEAK_SUM",SWIG_From_int((int)(0x4)));
  SWIG_Python_SetConstant(d, "BIP32_FLAG_STR_WILDCARD",SWIG_From_int((int)(0x8)));
  SWIG_Python_SetConstant(d, "BIP32_FLAG_STR_BARE",SWIG_From_int((int)(0x10)));
  SWIG_Python_SetConstant(d, "BIP32_FLAG_ALLOW_UPPER",SWIG_From_int((int)(0x20)));
  SWIG_Python_SetConstant(d, "BIP32_FLAG_STR_MULTIPATH",SWIG_From_int((int)(0x40)));
  SWIG_Python_SetConstant(d, "BIP32_VER_MAIN_PUBLIC",SWIG_From_int((int)(0x0488B21E)));
  SWIG_Python_SetConstant(d, "BIP32_VER_MAIN_PRIVATE",SWIG_From_int((int)(0x0488ADE4)));
  SWIG_Python_SetConstant(d, "BIP32_VER_TEST_PUBLIC",SWIG_From_int((int)(0x043587CF)));
  SWIG_Python_SetConstant(d, "BIP32_VER_TEST_PRIVATE",SWIG_From_int((int)(0x04358394)));
  SWIG_Python_SetConstant(d, "BIP32_PATH_LEN_MASK",SWIG_From_int((int)(0x000000ff)));
  SWIG_Python_SetConstant(d, "BIP32_PATH_LEN_SHIFT",SWIG_From_int((int)(0x00000000)));
  SWIG_Python_SetConstant(d, "BIP32_PATH_MULTI_MASK",SWIG_From_int((int)(0x0000ff00)));
  SWIG_Python_SetConstant(d, "BIP32_PATH_MULTI_SHIFT",SWIG_From_int((int)(0x00000008)));
  SWIG_Python_SetConstant(d, "BIP32_PATH_WILDCARD_MASK",SWIG_From_int((int)(0x00ff0000)));
  SWIG_Python_SetConstant(d, "BIP32_PATH_WILDCARD_SHIFT",SWIG_From_int((int)(0x00000010)));
  SWIG_Python_SetConstant(d, "BIP32_PATH_IS_BARE",SWIG_From_int((int)(0x01000000)));
  SWIG_Python_SetConstant(d, "BIP32_PATH_IS_HARDENED",SWIG_From_int((int)(0x02000000)));
  SWIG_Python_SetConstant(d, "BIP32_PATH_IS_WILDCARD",SWIG_From_int((int)(0x04000000)));
  SWIG_Python_SetConstant(d, "BIP32_PATH_IS_MULTIPATH",SWIG_From_int((int)(0x08000000)));
  SWIG_Python_SetConstant(d, "LIBWALLY_CORE_BIP32_INT_H",SWIG_From_int((int)(1)));
  SWIG_Python_SetConstant(d, "BIP38_KEY_NETWORK_MASK",SWIG_From_int((int)(0xff)));
  SWIG_Python_SetConstant(d, "BIP38_KEY_MAINNET",SWIG_From_int((int)(0)));
  SWIG_Python_SetConstant(d, "BIP38_KEY_TESTNET",SWIG_From_int((int)(111)));
  SWIG_Python_SetConstant(d, "BIP38_KEY_COMPRESSED",SWIG_From_int((int)(256)));
  SWIG_Python_SetConstant(d, "BIP38_KEY_EC_MULT",SWIG_From_int((int)(512)));
  SWIG_Python_SetConstant(d, "BIP38_KEY_QUICK_CHECK",SWIG_From_int((int)(1024)));
  SWIG_Python_SetConstant(d, "BIP38_KEY_RAW_MODE",SWIG_From_int((int)(2048)));
  SWIG_Python_SetConstant(d, "BIP38_KEY_SWAP_ORDER",SWIG_From_int((int)(4096)));
  SWIG_Python_SetConstant(d, "BIP38_SERIALIZED_LEN",SWIG_From_int((int)(39)));
  SWIG_Python_SetConstant(d, "BIP39_ENTROPY_LEN_128",SWIG_From_int((int)(16)));
  SWIG_Python_SetConstant(d, "BIP39_ENTROPY_LEN_160",SWIG_From_int((int)(20)));
  SWIG_Python_SetConstant(d, "BIP39_ENTROPY_LEN_192",SWIG_From_int((int)(24)));
  SWIG_Python_SetConstant(d, "BIP39_ENTROPY_LEN_224",SWIG_From_int((int)(28)));
  SWIG_Python_SetConstant(d, "BIP39_ENTROPY_LEN_256",SWIG_From_int((int)(32)));
  SWIG_Python_SetConstant(d, "BIP39_ENTROPY_LEN_288",SWIG_From_int((int)(36)));
  SWIG_Python_SetConstant(d, "BIP39_ENTROPY_LEN_320",SWIG_From_int((int)(40)));
  SWIG_Python_SetConstant(d, "BIP39_SEED_LEN_512",SWIG_From_int((int)(64)));
  SWIG_Python_SetConstant(d, "BIP39_ENTROPY_MAX_LEN",SWIG_From_int((int)(42)));
  SWIG_Python_SetConstant(d, "BIP39_WORDLIST_LEN",SWIG_From_int((int)(2048)));
  SWIG_Python_SetConstant(d, "WALLY_CS_MAX_ASSETS",SWIG_From_int((int)(256)));
  SWIG_Python_SetConstant(d, "AES_BLOCK_LEN",SWIG_From_int((int)(16)));
  SWIG_Python_SetConstant(d, "AES_KEY_LEN_128",SWIG_From_int((int)(16)));
  SWIG_Python_SetConstant(d, "AES_KEY_LEN_192",SWIG_From_int((int)(24)));
  SWIG_Python_SetConstant(d, "AES_KEY_LEN_256",SWIG_From_int((int)(32)));
  SWIG_Python_SetConstant(d, "AES_FLAG_ENCRYPT",SWIG_From_int((int)(1)));
  SWIG_Python_SetConstant(d, "AES_FLAG_DECRYPT",SWIG_From_int((int)(2)));
  SWIG_Python_SetConstant(d, "SHA256_LEN",SWIG_From_int((int)(32)));
  SWIG_Python_SetConstant(d, "SHA512_LEN",SWIG_From_int((int)(64)));
  SWIG_Python_SetConstant(d, "RIPEMD160_LEN",SWIG_From_int((int)(20)));
  SWIG_Python_SetConstant(d, "HASH160_LEN",SWIG_From_int((int)(20)));
  SWIG_Python_SetConstant(d, "HMAC_SHA256_LEN",SWIG_From_int((int)(32)));
  SWIG_Python_SetConstant(d, "HMAC_SHA512_LEN",SWIG_From_int((int)(64)));
  SWIG_Python_SetConstant(d, "PBKDF2_HMAC_SHA256_LEN",SWIG_From_int((int)(32)));
  SWIG_Python_SetConstant(d, "PBKDF2_HMAC_SHA512_LEN",SWIG_From_int((int)(64)));
  SWIG_Python_SetConstant(d, "EC_PRIVATE_KEY_LEN",SWIG_From_int((int)(32)));
  SWIG_Python_SetConstant(d, "EC_PUBLIC_KEY_LEN",SWIG_From_int((int)(33)));
  SWIG_Python_SetConstant(d, "EC_XONLY_PUBLIC_KEY_LEN",SWIG_From_int((int)(32)));
  SWIG_Python_SetConstant(d, "EC_PUBLIC_KEY_UNCOMPRESSED_LEN",SWIG_From_int((int)(65)));
  SWIG_Python_SetConstant(d, "EC_MESSAGE_HASH_LEN",SWIG_From_int((int)(32)));
  SWIG_Python_SetConstant(d, "EC_SIGNATURE_LEN",SWIG_From_int((int)(64)));
  SWIG_Python_SetConstant(d, "EC_SIGNATURE_RECOVERABLE_LEN",SWIG_From_int((int)(65)));
  SWIG_Python_SetConstant(d, "EC_SIGNATURE_DER_MAX_LEN",SWIG_From_int((int)(72)));
  SWIG_Python_SetConstant(d, "EC_SIGNATURE_DER_MAX_LOW_R_LEN",SWIG_From_int((int)(70)));
  SWIG_Python_SetConstant(d, "EC_SCALAR_LEN",SWIG_From_int((int)(32)));
  SWIG_Python_SetConstant(d, "EC_FLAG_ECDSA",SWIG_From_int((int)(0x1)));
  SWIG_Python_SetConstant(d, "EC_FLAG_SCHNORR",SWIG_From_int((int)(0x2)));
  SWIG_Python_SetConstant(d, "EC_FLAG_GRIND_R",SWIG_From_int((int)(0x4)));
  SWIG_Python_SetConstant(d, "EC_FLAG_RECOVERABLE",SWIG_From_int((int)(0x8)));
  SWIG_Python_SetConstant(d, "EC_FLAG_ELEMENTS",SWIG_From_int((int)(0x10)));
  SWIG_Python_SetConstant(d, "EC_FLAGS_ALL",SWIG_From_int((int)((0x1|0x2|0x4|0x8|0x10))));
  SWIG_Python_SetConstant(d, "BITCOIN_MESSAGE_MAX_LEN",SWIG_From_int((int)((64*1024-64))));
  SWIG_Python_SetConstant(d, "BITCOIN_MESSAGE_FLAG_HASH",SWIG_From_int((int)(1)));
  SWIG_Python_SetConstant(d, "WALLY_S2C_DATA_LEN",SWIG_From_int((int)(32)));
  SWIG_Python_SetConstant(d, "WALLY_S2C_OPENING_LEN",SWIG_From_int((int)(33)));
  SWIG_Python_SetConstant(d, "WALLY_MINISCRIPT_TAPSCRIPT",SWIG_From_int((int)(0x01)));
  SWIG_Python_SetConstant(d, "WALLY_MINISCRIPT_ONLY",SWIG_From_int((int)(0x02)));
  SWIG_Python_SetConstant(d, "WALLY_MINISCRIPT_REQUIRE_CHECKSUM",SWIG_From_int((int)(0x04)));
  SWIG_Python_SetConstant(d, "WALLY_MINISCRIPT_POLICY_TEMPLATE",SWIG_From_int((int)(0x08)));
  SWIG_Python_SetConstant(d, "WALLY_MINISCRIPT_UNIQUE_KEYPATHS",SWIG_From_int((int)(0x10)));
  SWIG_Python_SetConstant(d, "WALLY_MINISCRIPT_AS_ELEMENTS",SWIG_From_int((int)(0x20)));
  SWIG_Python_SetConstant(d, "WALLY_MINISCRIPT_DEPTH_MASK",SWIG_From_int((int)(0xffff0000)));
  SWIG_Python_SetConstant(d, "WALLY_MINISCRIPT_DEPTH_SHIFT",SWIG_From_int((int)(16)));
  SWIG_Python_SetConstant(d, "WALLY_MS_IS_RANGED",SWIG_From_int((int)(0x001)));
  SWIG_Python_SetConstant(d, "WALLY_MS_IS_MULTIPATH",SWIG_From_int((int)(0x002)));
  SWIG_Python_SetConstant(d, "WALLY_MS_IS_PRIVATE",SWIG_From_int((int)(0x004)));
  SWIG_Python_SetConstant(d, "WALLY_MS_IS_UNCOMPRESSED",SWIG_From_int((int)(0x008)));
  SWIG_Python_SetConstant(d, "WALLY_MS_IS_RAW",SWIG_From_int((int)(0x010)));
  SWIG_Python_SetConstant(d, "WALLY_MS_IS_DESCRIPTOR",SWIG_From_int((int)(0x020)));
  SWIG_Python_SetConstant(d, "WALLY_MS_IS_X_ONLY",SWIG_From_int((int)(0x040)));
  SWIG_Python_SetConstant(d, "WALLY_MS_IS_PARENTED",SWIG_From_int((int)(0x080)));
  SWIG_Python_SetConstant(d, "WALLY_MS_IS_ELEMENTS",SWIG_From_int((int)(0x100)));
  SWIG_Python_SetConstant(d, "WALLY_MS_IS_SLIP77",SWIG_From_int((int)(0x200)));
  SWIG_Python_SetConstant(d, "WALLY_MS_IS_ELIP150",SWIG_From_int((int)(0x400)));
  SWIG_Python_SetConstant(d, "WALLY_MS_IS_ELIP151",SWIG_From_int((int)(0x800)));
  SWIG_Python_SetConstant(d, "WALLY_MS_ANY_BLINDING_KEY",SWIG_From_int((int)(0xE00)));
  SWIG_Python_SetConstant(d, "WALLY_MS_CANONICAL_NO_CHECKSUM",SWIG_From_int((int)(0x01)));
  SWIG_Python_SetConstant(d, "WALLY_MS_BLINDING_KEY_INDEX",SWIG_From_int((int)(0xffffffff)));
  SWIG_Python_SetConstant(d, "WALLY_PSBT_VERSION_0",SWIG_From_int((int)(0x0)));
  SWIG_Python_SetConstant(d, "WALLY_PSBT_VERSION_2",SWIG_From_int((int)(0x2)));
  SWIG_Python_SetConstant(d, "WALLY_PSBT_HIGHEST_VERSION",SWIG_From_int((int)(0x2)));
  SWIG_Python_SetConstant(d, "WALLY_PSBT_INIT_PSET",SWIG_From_int((int)(0x1)));
  SWIG_Python_SetConstant(d, "WALLY_PSBT_FLAG_NON_FINAL",SWIG_From_int((int)(0x1)));
  SWIG_Python_SetConstant(d, "WALLY_PSBT_PROPRIETARY_TYPE",SWIG_From_int((int)(0xFC)));
  SWIG_Python_SetConstant(d, "WALLY_PSBT_TXMOD_INPUTS",SWIG_From_int((int)(0x1)));
  SWIG_Python_SetConstant(d, "WALLY_PSBT_TXMOD_OUTPUTS",SWIG_From_int((int)(0x2)));
  SWIG_Python_SetConstant(d, "WALLY_PSBT_TXMOD_SINGLE",SWIG_From_int((int)(0x4)));
  SWIG_Python_SetConstant(d, "WALLY_PSET_TXMOD_RESERVED",SWIG_From_int((int)(0x1)));
  SWIG_Python_SetConstant(d, "WALLY_PSBT_PARSE_FLAG_STRICT",SWIG_From_int((int)(0x1)));
  SWIG_Python_SetConstant(d, "WALLY_PSBT_PARSE_FLAG_LOOSE",SWIG_From_int((int)(0x2)));
  SWIG_Python_SetConstant(d, "WALLY_PSBT_SERIALIZE_FLAG_REDUNDANT",SWIG_From_int((int)(0x1)));
  SWIG_Python_SetConstant(d, "WALLY_PSBT_SERIALIZE_SIGS_ONLY",SWIG_From_int((int)(0x2)));
  SWIG_Python_SetConstant(d, "WALLY_PSBT_EXTRACT_FINAL",SWIG_From_int((int)(0x0)));
  SWIG_Python_SetConstant(d, "WALLY_PSBT_EXTRACT_NON_FINAL",SWIG_From_int((int)(0x1)));
  SWIG_Python_SetConstant(d, "WALLY_PSBT_EXTRACT_OPT_FINAL",SWIG_From_int((int)(0x2)));
  SWIG_Python_SetConstant(d, "WALLY_PSBT_FINALIZE_NO_CLEAR",SWIG_From_int((int)(0x1)));
  SWIG_Python_SetConstant(d, "WALLY_PSBT_COMBINE_SIGS",SWIG_From_int((int)(0x1)));
  SWIG_Python_SetConstant(d, "WALLY_PSBT_ID_BIP370",SWIG_From_int((int)(0x0)));
  SWIG_Python_SetConstant(d, "WALLY_PSBT_ID_AS_V2",SWIG_From_int((int)(0x1)));
  SWIG_Python_SetConstant(d, "WALLY_PSBT_ID_USE_LOCKTIME",SWIG_From_int((int)(0x2)));
  SWIG_Python_SetConstant(d, "WALLY_PSET_BLINDED_NONE",SWIG_From_int((int)(0x0)));
  SWIG_Python_SetConstant(d, "WALLY_PSET_BLINDED_REQUIRED",SWIG_From_int((int)(0x1)));
  SWIG_Python_SetConstant(d, "WALLY_PSET_BLINDED_PARTIAL",SWIG_From_int((int)(0x2)));
  SWIG_Python_SetConstant(d, "WALLY_PSET_BLINDED_FULL",SWIG_From_int((int)(0x4)));
  SWIG_Python_SetConstant(d, "WALLY_PSET_BLIND_ALL",SWIG_From_int((int)(0xffffffff)));
  SWIG_Python_SetConstant(d, "WALLY_SCALAR_OFFSET_LEN",SWIG_From_int((int)(32)));
  SWIG_Python_SetConstant(d, "LIBWALLY_CORE_PSBT_MEMBERS_H",SWIG_From_int((int)(1)));
  SWIG_Python_SetConstant(d, "WALLY_SCRIPT_TYPE_UNKNOWN",SWIG_From_int((int)(0x0)));
  SWIG_Python_SetConstant(d, "WALLY_SCRIPT_TYPE_OP_RETURN",SWIG_From_int((int)(0x1)));
  SWIG_Python_SetConstant(d, "WALLY_SCRIPT_TYPE_P2PKH",SWIG_From_int((int)(0x2)));
  SWIG_Python_SetConstant(d, "WALLY_SCRIPT_TYPE_P2SH",SWIG_From_int((int)(0x4)));
  SWIG_Python_SetConstant(d, "WALLY_SCRIPT_TYPE_P2WPKH",SWIG_From_int((int)(0x8)));
  SWIG_Python_SetConstant(d, "WALLY_SCRIPT_TYPE_P2WSH",SWIG_From_int((int)(0x10)));
  SWIG_Python_SetConstant(d, "WALLY_SCRIPT_TYPE_MULTISIG",SWIG_From_int((int)(0x20)));
  SWIG_Python_SetConstant(d, "WALLY_SCRIPT_TYPE_P2TR",SWIG_From_int((int)(0x40)));
  SWIG_Python_SetConstant(d, "WALLY_SCRIPT_TYPE_CSV2OF2_1",SWIG_From_int((int)(0x80)));
  SWIG_Python_SetConstant(d, "WALLY_SCRIPT_TYPE_CSV2OF2_1_OPT",SWIG_From_int((int)(0x81)));
  SWIG_Python_SetConstant(d, "WALLY_SCRIPTPUBKEY_P2PKH_LEN",SWIG_From_int((int)(25)));
  SWIG_Python_SetConstant(d, "WALLY_SCRIPTPUBKEY_P2SH_LEN",SWIG_From_int((int)(23)));
  SWIG_Python_SetConstant(d, "WALLY_SCRIPTPUBKEY_P2WPKH_LEN",SWIG_From_int((int)(22)));
  SWIG_Python_SetConstant(d, "WALLY_SCRIPTPUBKEY_P2WSH_LEN",SWIG_From_int((int)(34)));
  SWIG_Python_SetConstant(d, "WALLY_SCRIPTPUBKEY_P2TR_LEN",SWIG_From_int((int)(34)));
  SWIG_Python_SetConstant(d, "WALLY_SCRIPTPUBKEY_OP_RETURN_MAX_LEN",SWIG_From_int((int)(83)));
  SWIG_Python_SetConstant(d, "WALLY_MAX_OP_RETURN_LEN",SWIG_From_int((int)(80)));
  SWIG_Python_SetConstant(d, "WALLY_SCRIPTSIG_P2PKH_MAX_LEN",SWIG_From_int((int)(140)));
  SWIG_Python_SetConstant(d, "WALLY_SCRIPTSIG_MAX_LEN",SWIG_From_int((int)(520)));
  SWIG_Python_SetConstant(d, "WALLY_WITNESSSCRIPT_MAX_LEN",SWIG_From_int((int)(42)));
  SWIG_Python_SetConstant(d, "WALLY_SCRIPT_VARINT_MAX_SIZE",SWIG_From_int((int)(9)));
  SWIG_Python_SetConstant(d, "WALLY_SCRIPT_HASH160",SWIG_From_int((int)(0x1)));
  SWIG_Python_SetConstant(d, "WALLY_SCRIPT_SHA256",SWIG_From_int((int)(0x2)));
  SWIG_Python_SetConstant(d, "WALLY_SCRIPT_AS_PUSH",SWIG_From_int((int)(0x4)));
  SWIG_Python_SetConstant(d, "WALLY_SCRIPT_MULTISIG_SORTED",SWIG_From_int((int)(0x8)));
  SWIG_Python_SetConstant(d, "OP_0",SWIG_From_int((int)(0x00)));
  SWIG_Python_SetConstant(d, "OP_FALSE",SWIG_From_int((int)(0x00)));
  SWIG_Python_SetConstant(d, "OP_PUSHDATA1",SWIG_From_int((int)(0x4c)));
  SWIG_Python_SetConstant(d, "OP_PUSHDATA2",SWIG_From_int((int)(0x4d)));
  SWIG_Python_SetConstant(d, "OP_PUSHDATA4",SWIG_From_int((int)(0x4e)));
  SWIG_Python_SetConstant(d, "OP_1NEGATE",SWIG_From_int((int)(0x4f)));
  SWIG_Python_SetConstant(d, "OP_RESERVED",SWIG_From_int((int)(0x50)));
  SWIG_Python_SetConstant(d, "OP_1",SWIG_From_int((int)(0x51)));
  SWIG_Python_SetConstant(d, "OP_TRUE",SWIG_From_int((int)(0x51)));
  SWIG_Python_SetConstant(d, "OP_2",SWIG_From_int((int)(0x52)));
  SWIG_Python_SetConstant(d, "OP_3",SWIG_From_int((int)(0x53)));
  SWIG_Python_SetConstant(d, "OP_4",SWIG_From_int((int)(0x54)));
  SWIG_Python_SetConstant(d, "OP_5",SWIG_From_int((int)(0x55)));
  SWIG_Python_SetConstant(d, "OP_6",SWIG_From_int((int)(0x56)));
  SWIG_Python_SetConstant(d, "OP_7",SWIG_From_int((int)(0x57)));
  SWIG_Python_SetConstant(d, "OP_8",SWIG_From_int((int)(0x58)));
  SWIG_Python_SetConstant(d, "OP_9",SWIG_From_int((int)(0x59)));
  SWIG_Python_SetConstant(d, "OP_10",SWIG_From_int((int)(0x5a)));
  SWIG_Python_SetConstant(d, "OP_11",SWIG_From_int((int)(0x5b)));
  SWIG_Python_SetConstant(d, "OP_12",SWIG_From_int((int)(0x5c)));
  SWIG_Python_SetConstant(d, "OP_13",SWIG_From_int((int)(0x5d)));
  SWIG_Python_SetConstant(d, "OP_14",SWIG_From_int((int)(0x5e)));
  SWIG_Python_SetConstant(d, "OP_15",SWIG_From_int((int)(0x5f)));
  SWIG_Python_SetConstant(d, "OP_16",SWIG_From_int((int)(0x60)));
  SWIG_Python_SetConstant(d, "OP_NOP",SWIG_From_int((int)(0x61)));
  SWIG_Python_SetConstant(d, "OP_VER",SWIG_From_int((int)(0x62)));
  SWIG_Python_SetConstant(d, "OP_IF",SWIG_From_int((int)(0x63)));
  SWIG_Python_SetConstant(d, "OP_NOTIF",SWIG_From_int((int)(0x64)));
  SWIG_Python_SetConstant(d, "OP_VERIF",SWIG_From_int((int)(0x65)));
  SWIG_Python_SetConstant(d, "OP_VERNOTIF",SWIG_From_int((int)(0x66)));
  SWIG_Python_SetConstant(d, "OP_ELSE",SWIG_From_int((int)(0x67)));
  SWIG_Python_SetConstant(d, "OP_ENDIF",SWIG_From_int((int)(0x68)));
  SWIG_Python_SetConstant(d, "OP_VERIFY",SWIG_From_int((int)(0x69)));
  SWIG_Python_SetConstant(d, "OP_RETURN",SWIG_From_int((int)(0x6a)));
  SWIG_Python_SetConstant(d, "OP_TOALTSTACK",SWIG_From_int((int)(0x6b)));
  SWIG_Python_SetConstant(d, "OP_FROMALTSTACK",SWIG_From_int((int)(0x6c)));
  SWIG_Python_SetConstant(d, "OP_2DROP",SWIG_From_int((int)(0x6d)));
  SWIG_Python_SetConstant(d, "OP_2DUP",SWIG_From_int((int)(0x6e)));
  SWIG_Python_SetConstant(d, "OP_3DUP",SWIG_From_int((int)(0x6f)));
  SWIG_Python_SetConstant(d, "OP_2OVER",SWIG_From_int((int)(0x70)));
  SWIG_Python_SetConstant(d, "OP_2ROT",SWIG_From_int((int)(0x71)));
  SWIG_Python_SetConstant(d, "OP_2SWAP",SWIG_From_int((int)(0x72)));
  SWIG_Python_SetConstant(d, "OP_IFDUP",SWIG_From_int((int)(0x73)));
  SWIG_Python_SetConstant(d, "OP_DEPTH",SWIG_From_int((int)(0x74)));
  SWIG_Python_SetConstant(d, "OP_DROP",SWIG_From_int((int)(0x75)));
  SWIG_Python_SetConstant(d, "OP_DUP",SWIG_From_int((int)(0x76)));
  SWIG_Python_SetConstant(d, "OP_NIP",SWIG_From_int((int)(0x77)));
  SWIG_Python_SetConstant(d, "OP_OVER",SWIG_From_int((int)(0x78)));
  SWIG_Python_SetConstant(d, "OP_PICK",SWIG_From_int((int)(0x79)));
  SWIG_Python_SetConstant(d, "OP_ROLL",SWIG_From_int((int)(0x7a)));
  SWIG_Python_SetConstant(d, "OP_ROT",SWIG_From_int((int)(0x7b)));
  SWIG_Python_SetConstant(d, "OP_SWAP",SWIG_From_int((int)(0x7c)));
  SWIG_Python_SetConstant(d, "OP_TUCK",SWIG_From_int((int)(0x7d)));
  SWIG_Python_SetConstant(d, "OP_CAT",SWIG_From_int((int)(0x7e)));
  SWIG_Python_SetConstant(d, "OP_SUBSTR",SWIG_From_int((int)(0x7f)));
  SWIG_Python_SetConstant(d, "OP_LEFT",SWIG_From_int((int)(0x80)));
  SWIG_Python_SetConstant(d, "OP_RIGHT",SWIG_From_int((int)(0x81)));
  SWIG_Python_SetConstant(d, "OP_SIZE",SWIG_From_int((int)(0x82)));
  SWIG_Python_SetConstant(d, "OP_INVERT",SWIG_From_int((int)(0x83)));
  SWIG_Python_SetConstant(d, "OP_AND",SWIG_From_int((int)(0x84)));
  SWIG_Python_SetConstant(d, "OP_OR",SWIG_From_int((int)(0x85)));
  SWIG_Python_SetConstant(d, "OP_XOR",SWIG_From_int((int)(0x86)));
  SWIG_Python_SetConstant(d, "OP_EQUAL",SWIG_From_int((int)(0x87)));
  SWIG_Python_SetConstant(d, "OP_EQUALVERIFY",SWIG_From_int((int)(0x88)));
  SWIG_Python_SetConstant(d, "OP_RESERVED1",SWIG_From_int((int)(0x89)));
  SWIG_Python_SetConstant(d, "OP_RESERVED2",SWIG_From_int((int)(0x8a)));
  SWIG_Python_SetConstant(d, "OP_1ADD",SWIG_From_int((int)(0x8b)));
  SWIG_Python_SetConstant(d, "OP_1SUB",SWIG_From_int((int)(0x8c)));
  SWIG_Python_SetConstant(d, "OP_2MUL",SWIG_From_int((int)(0x8d)));
  SWIG_Python_SetConstant(d, "OP_2DIV",SWIG_From_int((int)(0x8e)));
  SWIG_Python_SetConstant(d, "OP_NEGATE",SWIG_From_int((int)(0x8f)));
  SWIG_Python_SetConstant(d, "OP_ABS",SWIG_From_int((int)(0x90)));
  SWIG_Python_SetConstant(d, "OP_NOT",SWIG_From_int((int)(0x91)));
  SWIG_Python_SetConstant(d, "OP_0NOTEQUAL",SWIG_From_int((int)(0x92)));
  SWIG_Python_SetConstant(d, "OP_ADD",SWIG_From_int((int)(0x93)));
  SWIG_Python_SetConstant(d, "OP_SUB",SWIG_From_int((int)(0x94)));
  SWIG_Python_SetConstant(d, "OP_MUL",SWIG_From_int((int)(0x95)));
  SWIG_Python_SetConstant(d, "OP_DIV",SWIG_From_int((int)(0x96)));
  SWIG_Python_SetConstant(d, "OP_MOD",SWIG_From_int((int)(0x97)));
  SWIG_Python_SetConstant(d, "OP_LSHIFT",SWIG_From_int((int)(0x98)));
  SWIG_Python_SetConstant(d, "OP_RSHIFT",SWIG_From_int((int)(0x99)));
  SWIG_Python_SetConstant(d, "OP_BOOLAND",SWIG_From_int((int)(0x9a)));
  SWIG_Python_SetConstant(d, "OP_BOOLOR",SWIG_From_int((int)(0x9b)));
  SWIG_Python_SetConstant(d, "OP_NUMEQUAL",SWIG_From_int((int)(0x9c)));
  SWIG_Python_SetConstant(d, "OP_NUMEQUALVERIFY",SWIG_From_int((int)(0x9d)));
  SWIG_Python_SetConstant(d, "OP_NUMNOTEQUAL",SWIG_From_int((int)(0x9e)));
  SWIG_Python_SetConstant(d, "OP_LESSTHAN",SWIG_From_int((int)(0x9f)));
  SWIG_Python_SetConstant(d, "OP_GREATERTHAN",SWIG_From_int((int)(0xa0)));
  SWIG_Python_SetConstant(d, "OP_LESSTHANOREQUAL",SWIG_From_int((int)(0xa1)));
  SWIG_Python_SetConstant(d, "OP_GREATERTHANOREQUAL",SWIG_From_int((int)(0xa2)));
  SWIG_Python_SetConstant(d, "OP_MIN",SWIG_From_int((int)(0xa3)));
  SWIG_Python_SetConstant(d, "OP_MAX",SWIG_From_int((int)(0xa4)));
  SWIG_Python_SetConstant(d, "OP_WITHIN",SWIG_From_int((int)(0xa5)));
  SWIG_Python_SetConstant(d, "OP_RIPEMD160",SWIG_From_int((int)(0xa6)));
  SWIG_Python_SetConstant(d, "OP_SHA1",SWIG_From_int((int)(0xa7)));
  SWIG_Python_SetConstant(d, "OP_SHA256",SWIG_From_int((int)(0xa8)));
  SWIG_Python_SetConstant(d, "OP_HASH160",SWIG_From_int((int)(0xa9)));
  SWIG_Python_SetConstant(d, "OP_HASH256",SWIG_From_int((int)(0xaa)));
  SWIG_Python_SetConstant(d, "OP_CODESEPARATOR",SWIG_From_int((int)(0xab)));
  SWIG_Python_SetConstant(d, "OP_CHECKSIG",SWIG_From_int((int)(0xac)));
  SWIG_Python_SetConstant(d, "OP_CHECKSIGVERIFY",SWIG_From_int((int)(0xad)));
  SWIG_Python_SetConstant(d, "OP_CHECKMULTISIG",SWIG_From_int((int)(0xae)));
  SWIG_Python_SetConstant(d, "OP_CHECKMULTISIGVERIFY",SWIG_From_int((int)(0xaf)));
  SWIG_Python_SetConstant(d, "OP_NOP1",SWIG_From_int((int)(0xb0)));
  SWIG_Python_SetConstant(d, "OP_CHECKLOCKTIMEVERIFY",SWIG_From_int((int)(0xb1)));
  SWIG_Python_SetConstant(d, "OP_NOP2",SWIG_From_int((int)(0xb1)));
  SWIG_Python_SetConstant(d, "OP_CHECKSEQUENCEVERIFY",SWIG_From_int((int)(0xb2)));
  SWIG_Python_SetConstant(d, "OP_NOP3",SWIG_From_int((int)(0xb2)));
  SWIG_Python_SetConstant(d, "OP_NOP4",SWIG_From_int((int)(0xb3)));
  SWIG_Python_SetConstant(d, "OP_NOP5",SWIG_From_int((int)(0xb4)));
  SWIG_Python_SetConstant(d, "OP_NOP6",SWIG_From_int((int)(0xb5)));
  SWIG_Python_SetConstant(d, "OP_NOP7",SWIG_From_int((int)(0xb6)));
  SWIG_Python_SetConstant(d, "OP_NOP8",SWIG_From_int((int)(0xb7)));
  SWIG_Python_SetConstant(d, "OP_NOP9",SWIG_From_int((int)(0xb8)));
  SWIG_Python_SetConstant(d, "OP_NOP10",SWIG_From_int((int)(0xb9)));
  SWIG_Python_SetConstant(d, "OP_INVALIDOPCODE",SWIG_From_int((int)(0xff)));
  SWIG_Python_SetConstant(d, "WALLY_TX_SEQUENCE_FINAL",SWIG_From_int((int)(0xffffffff)));
  SWIG_Python_SetConstant(d, "WALLY_TX_VERSION_1",SWIG_From_int((int)(1)));
  SWIG_Python_SetConstant(d, "WALLY_TX_VERSION_2",SWIG_From_int((int)(2)));
  SWIG_Python_SetConstant(d, "WALLY_TX_IS_ELEMENTS",SWIG_From_int((int)(1)));
  SWIG_Python_SetConstant(d, "WALLY_TX_IS_ISSUANCE",SWIG_From_int((int)(2)));
  SWIG_Python_SetConstant(d, "WALLY_TX_IS_PEGIN",SWIG_From_int((int)(4)));
  SWIG_Python_SetConstant(d, "WALLY_TX_IS_COINBASE",SWIG_From_int((int)(8)));
  SWIG_Python_SetConstant(d, "WALLY_SATOSHI_PER_BTC",SWIG_From_int((int)(100000000)));
  SWIG_Python_SetConstant(d, "WALLY_BTC_MAX",SWIG_From_int((int)(21000000)));
  SWIG_Python_SetConstant(d, "WALLY_TXHASH_LEN",SWIG_From_int((int)(32)));
  SWIG_Python_SetConstant(d, "WALLY_TX_FLAG_USE_WITNESS",SWIG_From_int((int)(0x1)));
  SWIG_Python_SetConstant(d, "WALLY_TX_FLAG_USE_ELEMENTS",SWIG_From_int((int)(0x2)));
  SWIG_Python_SetConstant(d, "WALLY_TX_FLAG_ALLOW_PARTIAL",SWIG_From_int((int)(0x4)));
  SWIG_Python_SetConstant(d, "WALLY_TX_FLAG_PRE_BIP144",SWIG_From_int((int)(0x8)));
  SWIG_Python_SetConstant(d, "WALLY_TX_FLAG_BLINDED_INITIAL_ISSUANCE",SWIG_From_int((int)(0x1)));
  SWIG_Python_SetConstant(d, "WALLY_TX_CLONE_FLAG_NON_FINAL",SWIG_From_int((int)(0x1)));
  SWIG_Python_SetConstant(d, "WALLY_TX_DUMMY_NULL",SWIG_From_int((int)(0x1)));
  SWIG_Python_SetConstant(d, "WALLY_TX_DUMMY_SIG",SWIG_From_int((int)(0x2)));
  SWIG_Python_SetConstant(d, "WALLY_TX_DUMMY_SIG_LOW_R",SWIG_From_int((int)(0x4)));
  SWIG_Python_SetConstant(d, "WALLY_SIGHASH_DEFAULT",SWIG_From_int((int)(0x00)));
  SWIG_Python_SetConstant(d, "WALLY_SIGHASH_ALL",SWIG_From_int((int)(0x01)));
  SWIG_Python_SetConstant(d, "WALLY_SIGHASH_NONE",SWIG_From_int((int)(0x02)));
  SWIG_Python_SetConstant(d, "WALLY_SIGHASH_SINGLE",SWIG_From_int((int)(0x03)));
  SWIG_Python_SetConstant(d, "WALLY_SIGHASH_FORKID",SWIG_From_int((int)(0x40)));
  SWIG_Python_SetConstant(d, "WALLY_SIGHASH_RANGEPROOF",SWIG_From_int((int)(0x40)));
  SWIG_Python_SetConstant(d, "WALLY_SIGHASH_ANYPREVOUT",SWIG_From_int((int)(0x40)));
  SWIG_Python_SetConstant(d, "WALLY_SIGHASH_ANYPREVOUTANYSCRIPT",SWIG_From_int((int)(0xc0)));
  SWIG_Python_SetConstant(d, "WALLY_SIGHASH_ANYONECANPAY",SWIG_From_int((int)(0x80)));
  SWIG_Python_SetConstant(d, "WALLY_SIGHASH_MASK",SWIG_From_int((int)(0x1f)));
  SWIG_Python_SetConstant(d, "WALLY_SIGHASH_TR_IN_MASK",SWIG_From_int((int)(0xc0)));
  SWIG_Python_SetConstant(d, "WALLY_SIGTYPE_PRE_SW",SWIG_From_int((int)(0x1)));
  SWIG_Python_SetConstant(d, "WALLY_SIGTYPE_SW_V0",SWIG_From_int((int)(0x2)));
  SWIG_Python_SetConstant(d, "WALLY_SIGTYPE_SW_V1",SWIG_From_int((int)(0x3)));
  SWIG_Python_SetConstant(d, "WALLY_SIGTYPE_MASK",SWIG_From_int((int)(0xf)));
  SWIG_Python_SetConstant(d, "WALLY_TX_ASSET_CT_EMPTY_PREFIX",SWIG_From_int((int)(0x00)));
  SWIG_Python_SetConstant(d, "WALLY_TX_ASSET_CT_EXPLICIT_PREFIX",SWIG_From_int((int)(0x01)));
  SWIG_Python_SetConstant(d, "WALLY_TX_ASSET_CT_VALUE_PREFIX_A",SWIG_From_int((int)(0x08)));
  SWIG_Python_SetConstant(d, "WALLY_TX_ASSET_CT_VALUE_PREFIX_B",SWIG_From_int((int)(0x09)));
  SWIG_Python_SetConstant(d, "WALLY_TX_ASSET_CT_ASSET_PREFIX_A",SWIG_From_int((int)(0x0a)));
  SWIG_Python_SetConstant(d, "WALLY_TX_ASSET_CT_ASSET_PREFIX_B",SWIG_From_int((int)(0x0b)));
  SWIG_Python_SetConstant(d, "WALLY_TX_ASSET_CT_NONCE_PREFIX_A",SWIG_From_int((int)(0x02)));
  SWIG_Python_SetConstant(d, "WALLY_TX_ASSET_CT_NONCE_PREFIX_B",SWIG_From_int((int)(0x03)));
  SWIG_Python_SetConstant(d, "WALLY_TX_ASSET_TAG_LEN",SWIG_From_int((int)(32)));
  SWIG_Python_SetConstant(d, "WALLY_TX_ASSET_CT_VALUE_LEN",SWIG_From_int((int)(33)));
  SWIG_Python_SetConstant(d, "WALLY_TX_ASSET_CT_VALUE_UNBLIND_LEN",SWIG_From_int((int)(9)));
  SWIG_Python_SetConstant(d, "WALLY_TX_ASSET_CT_ASSET_LEN",SWIG_From_int((int)(33)));
  SWIG_Python_SetConstant(d, "WALLY_TX_ASSET_CT_NONCE_LEN",SWIG_From_int((int)(33)));
  SWIG_Python_SetConstant(d, "WALLY_TX_ASSET_CT_LEN",SWIG_From_int((int)(33)));
  SWIG_Python_SetConstant(d, "WALLY_TX_ISSUANCE_FLAG",SWIG_From_int((int)(0x80000000)));
  SWIG_Python_SetConstant(d, "WALLY_TX_PEGIN_FLAG",SWIG_From_int((int)(0x40000000)));
  SWIG_Python_SetConstant(d, "WALLY_TX_INDEX_MASK",SWIG_From_int((int)(0x3fffffff)));
  SWIG_Python_SetConstant(d, "WALLY_NO_CODESEPARATOR",SWIG_From_int((int)(0xffffffff)));
  SWIG_Python_SetConstant(d, "LIBWALLY_CORE_TRANSACTION_MEMBERS_H",SWIG_From_int((int)(1)));
  SWIG_Python_SetConstant(d, "ASSET_TAG_LEN",SWIG_From_int((int)(32)));
  SWIG_Python_SetConstant(d, "BLINDING_FACTOR_LEN",SWIG_From_int((int)(32)));
  SWIG_Python_SetConstant(d, "ASSET_GENERATOR_LEN",SWIG_From_int((int)(33)));
  SWIG_Python_SetConstant(d, "ASSET_COMMITMENT_LEN",SWIG_From_int((int)(33)));
  SWIG_Python_SetConstant(d, "ASSET_RANGEPROOF_MAX_LEN",SWIG_From_int((int)(5134)));
  SWIG_Python_SetConstant(d, "ASSET_EXPLICIT_RANGEPROOF_MAX_LEN",SWIG_From_int((int)(73)));
  SWIG_Python_SetConstant(d, "ASSET_SURJECTIONPROOF_MAX_LEN",SWIG_From_int((int)(162)));
  SWIG_Python_SetConstant(d, "ASSET_EXPLICIT_SURJECTIONPROOF_LEN",SWIG_From_int((int)(67)));
  SWIG_Python_SetConstant(d, "WALLY_ABF_VBF_LEN",SWIG_From_int((int)(64)));
#if PY_VERSION_HEX >= 0x03000000
  return m;
#else
  return;
#endif
}

