Skip to content
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions bindings/go/examples/gas_sponsor/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,7 @@ func main() {
nil,
)

gasObjId := objIdFromHex("0x0b0270ee9d27da0db09651e5f7338dfa32c7ee6441ccefa1f6e305735bcfc7ab")
builder.Gas(gasObjId).Sponsor(sponsor)
builder.Sponsor(sponsor)

txn, err := builder.Finish()
if err.(*sdk.SdkFfiError) != nil {
Expand Down
1 change: 0 additions & 1 deletion bindings/go/examples/prepare_split_coins/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ func main() {
sender,
[]*sdk.PtbArgument{sdk.PtbArgumentRes("coin1"), sdk.PtbArgumentRes("coin2"), sdk.PtbArgumentRes("coin3")},
)
builder.Gas(coinObjId).GasBudget(1000000000)

txn, err := builder.Finish()
if err.(*sdk.SdkFfiError) != nil {
Expand Down
33 changes: 6 additions & 27 deletions bindings/go/iota_sdk_ffi/iota_sdk_ffi.go
Original file line number Diff line number Diff line change
Expand Up @@ -5780,7 +5780,7 @@ func uniffiCheckChecksums() {
checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t {
return C.uniffi_iota_sdk_ffi_checksum_method_transactionbuilder_gas()
})
if checksum != 43178 {
if checksum != 37932 {
// If this happens try cleaning and rebuilding your project
panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_transactionbuilder_gas: UniFFI API checksum mismatch")
}
Expand All @@ -5795,15 +5795,6 @@ func uniffiCheckChecksums() {
}
}
{
checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t {
return C.uniffi_iota_sdk_ffi_checksum_method_transactionbuilder_gas_coins()
})
if checksum != 13036 {
// If this happens try cleaning and rebuilding your project
panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_transactionbuilder_gas_coins: UniFFI API checksum mismatch")
}
}
{
checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t {
return C.uniffi_iota_sdk_ffi_checksum_method_transactionbuilder_gas_price()
})
Expand Down Expand Up @@ -24904,12 +24895,10 @@ type TransactionBuilderInterface interface {
Expiration(epoch uint64) *TransactionBuilder
// Convert this builder into a transaction.
Finish() (*Transaction, error)
// Add a gas object to use to pay for the transaction.
Gas(objectId *ObjectId) *TransactionBuilder
// Add gas objects to pay for the transaction.
Gas(objectIds []*ObjectId) *TransactionBuilder
// Set the gas budget for the transaction.
GasBudget(budget uint64) *TransactionBuilder
// Add gas objects to pay for the transaction.
GasCoins(objectIds []*ObjectId) *TransactionBuilder
// Set the gas price for the transaction.
GasPrice(price uint64) *TransactionBuilder
// Set the gas station sponsor.
Expand Down Expand Up @@ -25157,13 +25146,13 @@ func (_self *TransactionBuilder) Finish() (*Transaction, error) {
return res, err
}

// Add a gas object to use to pay for the transaction.
func (_self *TransactionBuilder) Gas(objectId *ObjectId) *TransactionBuilder {
// Add gas objects to pay for the transaction.
func (_self *TransactionBuilder) Gas(objectIds []*ObjectId) *TransactionBuilder {
_pointer := _self.ffiObject.incrementPointer("*TransactionBuilder")
defer _self.ffiObject.decrementPointer()
return FfiConverterTransactionBuilderINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer {
return C.uniffi_iota_sdk_ffi_fn_method_transactionbuilder_gas(
_pointer,FfiConverterObjectIdINSTANCE.Lower(objectId),_uniffiStatus)
_pointer,FfiConverterSequenceObjectIdINSTANCE.Lower(objectIds),_uniffiStatus)
}))
}

Expand All @@ -25177,16 +25166,6 @@ func (_self *TransactionBuilder) GasBudget(budget uint64) *TransactionBuilder {
}))
}

// Add gas objects to pay for the transaction.
func (_self *TransactionBuilder) GasCoins(objectIds []*ObjectId) *TransactionBuilder {
_pointer := _self.ffiObject.incrementPointer("*TransactionBuilder")
defer _self.ffiObject.decrementPointer()
return FfiConverterTransactionBuilderINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer {
return C.uniffi_iota_sdk_ffi_fn_method_transactionbuilder_gas_coins(
_pointer,FfiConverterSequenceObjectIdINSTANCE.Lower(objectIds),_uniffiStatus)
}))
}

// Set the gas price for the transaction.
func (_self *TransactionBuilder) GasPrice(price uint64) *TransactionBuilder {
_pointer := _self.ffiObject.incrementPointer("*TransactionBuilder")
Expand Down
13 changes: 1 addition & 12 deletions bindings/go/iota_sdk_ffi/iota_sdk_ffi.h
Original file line number Diff line number Diff line change
Expand Up @@ -4535,19 +4535,14 @@ uint64_t uniffi_iota_sdk_ffi_fn_method_transactionbuilder_finish(void* ptr
#endif
#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_TRANSACTIONBUILDER_GAS
#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_TRANSACTIONBUILDER_GAS
void* uniffi_iota_sdk_ffi_fn_method_transactionbuilder_gas(void* ptr, void* object_id, RustCallStatus *out_status
void* uniffi_iota_sdk_ffi_fn_method_transactionbuilder_gas(void* ptr, RustBuffer object_ids, RustCallStatus *out_status
);
#endif
#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_TRANSACTIONBUILDER_GAS_BUDGET
#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_TRANSACTIONBUILDER_GAS_BUDGET
void* uniffi_iota_sdk_ffi_fn_method_transactionbuilder_gas_budget(void* ptr, uint64_t budget, RustCallStatus *out_status
);
#endif
#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_TRANSACTIONBUILDER_GAS_COINS
#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_TRANSACTIONBUILDER_GAS_COINS
void* uniffi_iota_sdk_ffi_fn_method_transactionbuilder_gas_coins(void* ptr, RustBuffer object_ids, RustCallStatus *out_status
);
#endif
#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_TRANSACTIONBUILDER_GAS_PRICE
#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_FN_METHOD_TRANSACTIONBUILDER_GAS_PRICE
void* uniffi_iota_sdk_ffi_fn_method_transactionbuilder_gas_price(void* ptr, uint64_t price, RustCallStatus *out_status
Expand Down Expand Up @@ -10555,12 +10550,6 @@ uint16_t uniffi_iota_sdk_ffi_checksum_method_transactionbuilder_gas(void
#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_TRANSACTIONBUILDER_GAS_BUDGET
uint16_t uniffi_iota_sdk_ffi_checksum_method_transactionbuilder_gas_budget(void

);
#endif
#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_TRANSACTIONBUILDER_GAS_COINS
#define UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_TRANSACTIONBUILDER_GAS_COINS
uint16_t uniffi_iota_sdk_ffi_checksum_method_transactionbuilder_gas_coins(void

);
#endif
#ifndef UNIFFI_FFIDEF_UNIFFI_IOTA_SDK_FFI_CHECKSUM_METHOD_TRANSACTIONBUILDER_GAS_PRICE
Expand Down
6 changes: 1 addition & 5 deletions bindings/kotlin/examples/GasSponsor.kt
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,7 @@ fun main() = runBlocking {
listOf(PtbArgument.u8(0u), PtbArgument.u8(1u)),
)

val gasObjId =
ObjectId.fromHex(
"0x0b0270ee9d27da0db09651e5f7338dfa32c7ee6441ccefa1f6e305735bcfc7ab"
)
builder.gas(gasObjId).sponsor(sponsor)
builder.sponsor(sponsor)

val txn = builder.finish()

Expand Down
2 changes: 0 additions & 2 deletions bindings/kotlin/examples/PrepareSplitCoins.kt
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ fun main() = runBlocking {
PtbArgument.res("coin3")
)
)
.gas(coinId)
.gasBudget(1000000000uL)

val txn = builder.finish()

Expand Down
43 changes: 7 additions & 36 deletions bindings/kotlin/lib/iota_sdk/iota_sdk_ffi.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2972,8 +2972,6 @@ internal interface UniffiForeignFutureCompleteVoid : com.sun.jna.Callback {








Expand Down Expand Up @@ -4200,8 +4198,6 @@ fun uniffi_iota_sdk_ffi_checksum_method_transactionbuilder_gas(
): Short
fun uniffi_iota_sdk_ffi_checksum_method_transactionbuilder_gas_budget(
): Short
fun uniffi_iota_sdk_ffi_checksum_method_transactionbuilder_gas_coins(
): Short
fun uniffi_iota_sdk_ffi_checksum_method_transactionbuilder_gas_price(
): Short
fun uniffi_iota_sdk_ffi_checksum_method_transactionbuilder_gas_station_sponsor(
Expand Down Expand Up @@ -6715,12 +6711,10 @@ fun uniffi_iota_sdk_ffi_fn_method_transactionbuilder_expiration(`ptr`: Pointer,`
): Pointer
fun uniffi_iota_sdk_ffi_fn_method_transactionbuilder_finish(`ptr`: Pointer,
): Long
fun uniffi_iota_sdk_ffi_fn_method_transactionbuilder_gas(`ptr`: Pointer,`objectId`: Pointer,uniffi_out_err: UniffiRustCallStatus,
fun uniffi_iota_sdk_ffi_fn_method_transactionbuilder_gas(`ptr`: Pointer,`objectIds`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus,
): Pointer
fun uniffi_iota_sdk_ffi_fn_method_transactionbuilder_gas_budget(`ptr`: Pointer,`budget`: Long,uniffi_out_err: UniffiRustCallStatus,
): Pointer
fun uniffi_iota_sdk_ffi_fn_method_transactionbuilder_gas_coins(`ptr`: Pointer,`objectIds`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus,
): Pointer
fun uniffi_iota_sdk_ffi_fn_method_transactionbuilder_gas_price(`ptr`: Pointer,`price`: Long,uniffi_out_err: UniffiRustCallStatus,
): Pointer
fun uniffi_iota_sdk_ffi_fn_method_transactionbuilder_gas_station_sponsor(`ptr`: Pointer,`url`: RustBuffer.ByValue,`duration`: RustBuffer.ByValue,`headers`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus,
Expand Down Expand Up @@ -9489,15 +9483,12 @@ private fun uniffiCheckApiChecksums(lib: IntegrityCheckingUniffiLib) {
if (lib.uniffi_iota_sdk_ffi_checksum_method_transactionbuilder_finish() != 32200.toShort()) {
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
}
if (lib.uniffi_iota_sdk_ffi_checksum_method_transactionbuilder_gas() != 43178.toShort()) {
if (lib.uniffi_iota_sdk_ffi_checksum_method_transactionbuilder_gas() != 37932.toShort()) {
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
}
if (lib.uniffi_iota_sdk_ffi_checksum_method_transactionbuilder_gas_budget() != 48686.toShort()) {
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
}
if (lib.uniffi_iota_sdk_ffi_checksum_method_transactionbuilder_gas_coins() != 13036.toShort()) {
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
}
if (lib.uniffi_iota_sdk_ffi_checksum_method_transactionbuilder_gas_price() != 7437.toShort()) {
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
}
Expand Down Expand Up @@ -41583,20 +41574,15 @@ public interface TransactionBuilderInterface {
suspend fun `finish`(): Transaction

/**
* Add a gas object to use to pay for the transaction.
* Add gas objects to pay for the transaction.
*/
fun `gas`(`objectId`: ObjectId): TransactionBuilder
fun `gas`(`objectIds`: List<ObjectId>): TransactionBuilder

/**
* Set the gas budget for the transaction.
*/
fun `gasBudget`(`budget`: kotlin.ULong): TransactionBuilder

/**
* Add gas objects to pay for the transaction.
*/
fun `gasCoins`(`objectIds`: List<ObjectId>): TransactionBuilder

/**
* Set the gas price for the transaction.
*/
Expand Down Expand Up @@ -41919,13 +41905,13 @@ open class TransactionBuilder: Disposable, AutoCloseable, TransactionBuilderInte


/**
* Add a gas object to use to pay for the transaction.
*/override fun `gas`(`objectId`: ObjectId): TransactionBuilder {
* Add gas objects to pay for the transaction.
*/override fun `gas`(`objectIds`: List<ObjectId>): TransactionBuilder {
return FfiConverterTypeTransactionBuilder.lift(
callWithPointer {
uniffiRustCall() { _status ->
UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_transactionbuilder_gas(
it, FfiConverterTypeObjectId.lower(`objectId`),_status)
it, FfiConverterSequenceTypeObjectId.lower(`objectIds`),_status)
}
}
)
Expand All @@ -41948,21 +41934,6 @@ open class TransactionBuilder: Disposable, AutoCloseable, TransactionBuilderInte



/**
* Add gas objects to pay for the transaction.
*/override fun `gasCoins`(`objectIds`: List<ObjectId>): TransactionBuilder {
return FfiConverterTypeTransactionBuilder.lift(
callWithPointer {
uniffiRustCall() { _status ->
UniffiLib.INSTANCE.uniffi_iota_sdk_ffi_fn_method_transactionbuilder_gas_coins(
it, FfiConverterSequenceTypeObjectId.lower(`objectIds`),_status)
}
}
)
}



/**
* Set the gas price for the transaction.
*/override fun `gasPrice`(`price`: kotlin.ULong): TransactionBuilder {
Expand Down
5 changes: 1 addition & 4 deletions bindings/python/examples/gas_sponsor.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,7 @@ async def main():
[PtbArgument.u8(0), PtbArgument.u8(1)],
)

gas_obj_id = ObjectId.from_hex(
"0x0b0270ee9d27da0db09651e5f7338dfa32c7ee6441ccefa1f6e305735bcfc7ab"
)
builder.gas(gas_obj_id).sponsor(sponsor)
builder.sponsor(sponsor)

txn = await builder.finish()

Expand Down
4 changes: 0 additions & 4 deletions bindings/python/examples/prepare_split_coins.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@ async def main():
PtbArgument.res("coin2"),
PtbArgument.res("coin3"),
],
).gas(
coin_id
).gas_budget(
1000000000
)

txn = await builder.finish()
Expand Down
49 changes: 8 additions & 41 deletions bindings/python/lib/iota_sdk_ffi.py
Original file line number Diff line number Diff line change
Expand Up @@ -1665,12 +1665,10 @@ def _uniffi_check_api_checksums(lib):
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
if lib.uniffi_iota_sdk_ffi_checksum_method_transactionbuilder_finish() != 32200:
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
if lib.uniffi_iota_sdk_ffi_checksum_method_transactionbuilder_gas() != 43178:
if lib.uniffi_iota_sdk_ffi_checksum_method_transactionbuilder_gas() != 37932:
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
if lib.uniffi_iota_sdk_ffi_checksum_method_transactionbuilder_gas_budget() != 48686:
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
if lib.uniffi_iota_sdk_ffi_checksum_method_transactionbuilder_gas_coins() != 13036:
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
if lib.uniffi_iota_sdk_ffi_checksum_method_transactionbuilder_gas_price() != 7437:
raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
if lib.uniffi_iota_sdk_ffi_checksum_method_transactionbuilder_gas_station_sponsor() != 41106:
Expand Down Expand Up @@ -6815,7 +6813,7 @@ class _UniffiForeignFutureStructVoid(ctypes.Structure):
_UniffiLib.uniffi_iota_sdk_ffi_fn_method_transactionbuilder_finish.restype = ctypes.c_uint64
_UniffiLib.uniffi_iota_sdk_ffi_fn_method_transactionbuilder_gas.argtypes = (
ctypes.c_void_p,
ctypes.c_void_p,
_UniffiRustBuffer,
ctypes.POINTER(_UniffiRustCallStatus),
)
_UniffiLib.uniffi_iota_sdk_ffi_fn_method_transactionbuilder_gas.restype = ctypes.c_void_p
Expand All @@ -6825,12 +6823,6 @@ class _UniffiForeignFutureStructVoid(ctypes.Structure):
ctypes.POINTER(_UniffiRustCallStatus),
)
_UniffiLib.uniffi_iota_sdk_ffi_fn_method_transactionbuilder_gas_budget.restype = ctypes.c_void_p
_UniffiLib.uniffi_iota_sdk_ffi_fn_method_transactionbuilder_gas_coins.argtypes = (
ctypes.c_void_p,
_UniffiRustBuffer,
ctypes.POINTER(_UniffiRustCallStatus),
)
_UniffiLib.uniffi_iota_sdk_ffi_fn_method_transactionbuilder_gas_coins.restype = ctypes.c_void_p
_UniffiLib.uniffi_iota_sdk_ffi_fn_method_transactionbuilder_gas_price.argtypes = (
ctypes.c_void_p,
ctypes.c_uint64,
Expand Down Expand Up @@ -11058,9 +11050,6 @@ class _UniffiForeignFutureStructVoid(ctypes.Structure):
_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_transactionbuilder_gas_budget.argtypes = (
)
_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_transactionbuilder_gas_budget.restype = ctypes.c_uint16
_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_transactionbuilder_gas_coins.argtypes = (
)
_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_transactionbuilder_gas_coins.restype = ctypes.c_uint16
_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_transactionbuilder_gas_price.argtypes = (
)
_UniffiLib.uniffi_iota_sdk_ffi_checksum_method_transactionbuilder_gas_price.restype = ctypes.c_uint16
Expand Down Expand Up @@ -41591,9 +41580,9 @@ def finish(self, ):
"""

raise NotImplementedError
def gas(self, object_id: "ObjectId"):
def gas(self, object_ids: "typing.List[ObjectId]"):
"""
Add a gas object to use to pay for the transaction.
Add gas objects to pay for the transaction.
"""

raise NotImplementedError
Expand All @@ -41602,12 +41591,6 @@ def gas_budget(self, budget: "int"):
Set the gas budget for the transaction.
"""

raise NotImplementedError
def gas_coins(self, object_ids: "typing.List[ObjectId]"):
"""
Add gas objects to pay for the transaction.
"""

raise NotImplementedError
def gas_price(self, price: "int"):
"""
Expand Down Expand Up @@ -41928,16 +41911,16 @@ async def finish(self, ) -> "Transaction":



def gas(self, object_id: "ObjectId") -> "TransactionBuilder":
def gas(self, object_ids: "typing.List[ObjectId]") -> "TransactionBuilder":
"""
Add a gas object to use to pay for the transaction.
Add gas objects to pay for the transaction.
"""

_UniffiConverterTypeObjectId.check_lower(object_id)
_UniffiConverterSequenceTypeObjectId.check_lower(object_ids)

return _UniffiConverterTypeTransactionBuilder.lift(
_uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_transactionbuilder_gas,self._uniffi_clone_pointer(),
_UniffiConverterTypeObjectId.lower(object_id))
_UniffiConverterSequenceTypeObjectId.lower(object_ids))
)


Expand All @@ -41960,22 +41943,6 @@ def gas_budget(self, budget: "int") -> "TransactionBuilder":



def gas_coins(self, object_ids: "typing.List[ObjectId]") -> "TransactionBuilder":
"""
Add gas objects to pay for the transaction.
"""

_UniffiConverterSequenceTypeObjectId.check_lower(object_ids)

return _UniffiConverterTypeTransactionBuilder.lift(
_uniffi_rust_call(_UniffiLib.uniffi_iota_sdk_ffi_fn_method_transactionbuilder_gas_coins,self._uniffi_clone_pointer(),
_UniffiConverterSequenceTypeObjectId.lower(object_ids))
)





def gas_price(self, price: "int") -> "TransactionBuilder":
"""
Set the gas price for the transaction.
Expand Down
Loading