|
| 1 | +package abi |
| 2 | + |
| 3 | +import ( |
| 4 | + "math/big" |
| 5 | + |
| 6 | + "github.com/algorand/go-algorand/data/abi" |
| 7 | +) |
| 8 | + |
| 9 | +type Value = abi.Value |
| 10 | +type Type = abi.Type |
| 11 | + |
| 12 | +func Decode(encoded []byte, abiType Type) (Value, error) { |
| 13 | + return abi.Decode(encoded, abiType) |
| 14 | +} |
| 15 | + |
| 16 | +func TypeFromString(str string) (Type, error) { |
| 17 | + return abi.TypeFromString(str) |
| 18 | +} |
| 19 | + |
| 20 | +func MakeUint8(val uint8) Value { |
| 21 | + return abi.MakeUint8(val) |
| 22 | +} |
| 23 | + |
| 24 | +func MakeUint16(val uint16) Value { |
| 25 | + return abi.MakeUint16(val) |
| 26 | +} |
| 27 | + |
| 28 | +func MakeUint32(val uint32) Value { |
| 29 | + return abi.MakeUint32(val) |
| 30 | +} |
| 31 | + |
| 32 | +func MakeUint64(val uint64) Value { |
| 33 | + return abi.MakeUint64(val) |
| 34 | +} |
| 35 | + |
| 36 | +func MakeUint(val *big.Int, size uint16) (Value, error) { |
| 37 | + return abi.MakeUint(val, size) |
| 38 | +} |
| 39 | + |
| 40 | +func MakeUfixed(val *big.Int, size uint16, precision uint16) (Value, error) { |
| 41 | + return abi.MakeUfixed(val, size, precision) |
| 42 | +} |
| 43 | + |
| 44 | +func MakeString(val string) Value { |
| 45 | + return abi.MakeString(val) |
| 46 | +} |
| 47 | + |
| 48 | +func MakeByte(val byte) Value { |
| 49 | + return abi.MakeByte(val) |
| 50 | +} |
| 51 | + |
| 52 | +func MakeAddress(val [32]byte) Value { |
| 53 | + return abi.MakeAddress(val) |
| 54 | +} |
| 55 | + |
| 56 | +func MakeBool(val bool) Value { |
| 57 | + return abi.MakeBool(val) |
| 58 | +} |
| 59 | + |
| 60 | +func MakeDynamicArray(values []Value, elemType Type) (Value, error) { |
| 61 | + return abi.MakeDynamicArray(values, elemType) |
| 62 | +} |
| 63 | + |
| 64 | +func MakeStaticArray(values []Value) (Value, error) { |
| 65 | + return abi.MakeStaticArray(values) |
| 66 | +} |
| 67 | + |
| 68 | +func MakeTuple(values []Value) (Value, error) { |
| 69 | + return abi.MakeTuple(values) |
| 70 | +} |
| 71 | + |
| 72 | +func MakeUintType(size uint16) (Type, error) { |
| 73 | + return abi.MakeUintType(size) |
| 74 | +} |
| 75 | + |
| 76 | +func MakeUfixedType(size uint16, precision uint16) (Type, error) { |
| 77 | + return abi.MakeUfixedType(size, precision) |
| 78 | +} |
| 79 | + |
| 80 | +func MakeByteType() Type { |
| 81 | + return abi.MakeByteType() |
| 82 | +} |
| 83 | + |
| 84 | +func MakeAddressType() Type { |
| 85 | + return abi.MakeAddressType() |
| 86 | +} |
| 87 | + |
| 88 | +func MakeStringType() Type { |
| 89 | + return abi.MakeStringType() |
| 90 | +} |
| 91 | + |
| 92 | +func MakeBoolType() Type { |
| 93 | + return abi.MakeBoolType() |
| 94 | +} |
| 95 | + |
| 96 | +func MakeDynamicArrayType(elemType Type) Type { |
| 97 | + return abi.MakeDynamicArrayType(elemType) |
| 98 | +} |
| 99 | + |
| 100 | +func MakeStaticArrayType(elemType Type, length uint16) Type { |
| 101 | + return abi.MakeStaticArrayType(elemType, length) |
| 102 | +} |
| 103 | + |
| 104 | +func MakeTupleType(elemTypes []Type) (Type, error) { |
| 105 | + return abi.MakeTupleType(elemTypes) |
| 106 | +} |
0 commit comments