Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 2 additions & 2 deletions bindings/go/examples/dev_inspect/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ import (
func main() {
client := sdk.GraphQlClientNewDevnet()

sender, _ := sdk.AddressFromHex("0x0")
sender := sdk.AddressZero()

iotaNamesPackageAddress, _ := sdk.AddressFromHex("0xb9d617f24c84826bf660a2f4031951678cc80c264aebc4413459fb2a95ada9ba")

iotaNamesObjectId, _ := sdk.ObjectIdFromHex("0x07c59b37bd7d036bf78fa30561a2ab9f7a970837487656ec29466e817f879342")

stdlibAddress, _ := sdk.AddressFromHex("0x1")
stdlibAddress := sdk.AddressStdLib()

name := "name.iota"
fmt.Printf("Looking up name: %s\n", name)
Expand Down
2 changes: 1 addition & 1 deletion bindings/go/examples/gas_sponsor/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ func main() {

builder := sdk.TransactionBuilderInit(sender, client)

packageAddr, _ := sdk.AddressFromHex("0x1")
packageAddr := sdk.AddressStdLib()
moduleName, _ := sdk.NewIdentifier("u8")
functionName, _ := sdk.NewIdentifier("max")

Expand Down
2 changes: 1 addition & 1 deletion bindings/go/examples/gas_station/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func main() {

builder := sdk.TransactionBuilderInit(sender, client)

package_id, _ := sdk.AddressFromHex("0x1")
package_id := sdk.AddressStdLib()
module_name, _ := sdk.NewIdentifier("u64")
function_name, _ := sdk.NewIdentifier("sqrt")

Expand Down
2 changes: 1 addition & 1 deletion bindings/go/examples/generic_move_function/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func main() {
addr1, _ := sdk.AddressFromHex("0xde49ea53fbadee67d3e35a097cdbea210b659676fc680a0b0c5f11d0763d375e")
addr2, _ := sdk.AddressFromHex("0xe512234aa4ef6184c52663f09612b68f040dd0c45de037d96190a071ca5525b3")

package_id, _ := sdk.AddressFromHex("0x2")
package_id := sdk.AddressFramework()
module_name, _ := sdk.NewIdentifier("vec_map")
function_name, _ := sdk.NewIdentifier("from_keys_values")

Expand Down
5 changes: 1 addition & 4 deletions bindings/go/examples/owned_objects/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@ import (
func main() {
client := sdk.GraphQlClientNewDevnet()

address, err := sdk.AddressFromHex("0x0")
if err != nil {
log.Fatalf("Failed to parse address: %v", err)
}
address := sdk.AddressZero()

objectFilter := sdk.ObjectFilter{
Owner: &address,
Expand Down
4 changes: 2 additions & 2 deletions bindings/go/examples/stake/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ func main() {

coinObjId, _ := sdk.ObjectIdFromHex("0xd04077fe3b6fad13b3d4ed0d535b7ca92afcac8f0f2a0e0925fb9f4f0b30c699")

iotaSystemAddress, _ := sdk.AddressFromHex("0x3")
iotaSystemAddress := sdk.AddressSystem()

iotaSystemId, _ := sdk.ObjectIdFromHex("0x5")
iotaSystemId := sdk.ObjectIdSystem()

iotaSystemModule, _ := sdk.NewIdentifier("iota_system")

Expand Down
4 changes: 2 additions & 2 deletions bindings/go/examples/unstake/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ func main() {
}
stakedIota := stakedIotas.Data[0]

iotaSystemAddress, _ := sdk.AddressFromHex("0x3")
iotaSystemAddress := sdk.AddressSystem()

iotaSystemId, _ := sdk.ObjectIdFromHex("0x5")
iotaSystemId := sdk.ObjectIdSystem()

iotaSystemModule, _ := sdk.NewIdentifier("iota_system")

Expand Down
111 changes: 108 additions & 3 deletions bindings/go/iota_sdk_ffi/iota_sdk_ffi.go
Original file line number Diff line number Diff line change
Expand Up @@ -1352,7 +1352,7 @@ func uniffiCheckChecksums() {
checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t {
return C.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_dynamic_field()
})
if checksum != 29988 {
if checksum != 17199 {
// If this happens try cleaning and rebuilding your project
panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_graphqlclient_dynamic_field: UniFFI API checksum mismatch")
}
Expand Down Expand Up @@ -4508,6 +4508,15 @@ func uniffiCheckChecksums() {
}
}
{
checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t {
return C.uniffi_iota_sdk_ffi_checksum_constructor_address_framework()
})
if checksum != 52951 {
// If this happens try cleaning and rebuilding your project
panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_address_framework: UniFFI API checksum mismatch")
}
}
{
checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t {
return C.uniffi_iota_sdk_ffi_checksum_constructor_address_from_bytes()
})
Expand Down Expand Up @@ -4535,6 +4544,33 @@ func uniffiCheckChecksums() {
}
}
{
checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t {
return C.uniffi_iota_sdk_ffi_checksum_constructor_address_std_lib()
})
if checksum != 35825 {
// If this happens try cleaning and rebuilding your project
panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_address_std_lib: UniFFI API checksum mismatch")
}
}
{
checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t {
return C.uniffi_iota_sdk_ffi_checksum_constructor_address_system()
})
if checksum != 4297 {
// If this happens try cleaning and rebuilding your project
panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_address_system: UniFFI API checksum mismatch")
}
}
{
checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t {
return C.uniffi_iota_sdk_ffi_checksum_constructor_address_zero()
})
if checksum != 46553 {
// If this happens try cleaning and rebuilding your project
panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_address_zero: UniFFI API checksum mismatch")
}
}
{
checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t {
return C.uniffi_iota_sdk_ffi_checksum_constructor_argument_new_gas()
})
Expand Down Expand Up @@ -5615,6 +5651,15 @@ func uniffiCheckChecksums() {
}
}
{
checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t {
return C.uniffi_iota_sdk_ffi_checksum_constructor_objectid_clock()
})
if checksum != 14732 {
// If this happens try cleaning and rebuilding your project
panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_objectid_clock: UniFFI API checksum mismatch")
}
}
{
checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t {
return C.uniffi_iota_sdk_ffi_checksum_constructor_objectid_derive_id()
})
Expand Down Expand Up @@ -5642,6 +5687,24 @@ func uniffiCheckChecksums() {
}
}
{
checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t {
return C.uniffi_iota_sdk_ffi_checksum_constructor_objectid_system()
})
if checksum != 9600 {
// If this happens try cleaning and rebuilding your project
panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_objectid_system: UniFFI API checksum mismatch")
}
}
{
checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t {
return C.uniffi_iota_sdk_ffi_checksum_constructor_objectid_zero()
})
if checksum != 40526 {
// If this happens try cleaning and rebuilding your project
panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_objectid_zero: UniFFI API checksum mismatch")
}
}
{
checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t {
return C.uniffi_iota_sdk_ffi_checksum_constructor_objecttype_new_package()
})
Expand Down Expand Up @@ -7363,6 +7426,12 @@ type Address struct {
}


func AddressFramework() *Address {
return FfiConverterAddressINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer {
return C.uniffi_iota_sdk_ffi_fn_constructor_address_framework(_uniffiStatus)
}))
}

func AddressFromBytes(bytes []byte) (*Address, error) {
_uniffiRV, _uniffiErr := rustCallWithError[SdkFfiError](FfiConverterSdkFfiError{},func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer {
return C.uniffi_iota_sdk_ffi_fn_constructor_address_from_bytes(FfiConverterBytesINSTANCE.Lower(bytes),_uniffiStatus)
Expand Down Expand Up @@ -7393,6 +7462,24 @@ func AddressGenerate() *Address {
}))
}

func AddressStdLib() *Address {
return FfiConverterAddressINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer {
return C.uniffi_iota_sdk_ffi_fn_constructor_address_std_lib(_uniffiStatus)
}))
}

func AddressSystem() *Address {
return FfiConverterAddressINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer {
return C.uniffi_iota_sdk_ffi_fn_constructor_address_system(_uniffiStatus)
}))
}

func AddressZero() *Address {
return FfiConverterAddressINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer {
return C.uniffi_iota_sdk_ffi_fn_constructor_address_zero(_uniffiStatus)
}))
}



func (_self *Address) ToBytes() []byte {
Expand Down Expand Up @@ -11997,7 +12084,7 @@ type GraphQlClientInterface interface {
// ```rust,ignore
//
// let client = iota_graphql_client::Client::new_devnet();
// let address = Address::from_str("0x5").unwrap();
// let address = ObjectId::SYSTEM.into();
// let df = client.dynamic_field_with_name(address, "u64", 2u64).await.unwrap();
//
// # alternatively, pass in the bcs bytes
Expand Down Expand Up @@ -12535,7 +12622,7 @@ func (_self *GraphQlClient) DryRunTxKind(txKind *TransactionKind, txMeta Transac
// ```rust,ignore
//
// let client = iota_graphql_client::Client::new_devnet();
// let address = Address::from_str("0x5").unwrap();
// let address = ObjectId::SYSTEM.into();
// let df = client.dynamic_field_with_name(address, "u64", 2u64).await.unwrap();
//
// # alternatively, pass in the bcs bytes
Expand Down Expand Up @@ -17016,6 +17103,12 @@ type ObjectId struct {
}


func ObjectIdClock() *ObjectId {
return FfiConverterObjectIdINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer {
return C.uniffi_iota_sdk_ffi_fn_constructor_objectid_clock(_uniffiStatus)
}))
}

// Create an ObjectId from a transaction digest and the number of objects
// that have been created during a transactions.
func ObjectIdDeriveId(digest *Digest, count uint64) *ObjectId {
Expand Down Expand Up @@ -17048,6 +17141,18 @@ func ObjectIdFromHex(hex string) (*ObjectId, error) {
}
}

func ObjectIdSystem() *ObjectId {
return FfiConverterObjectIdINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer {
return C.uniffi_iota_sdk_ffi_fn_constructor_objectid_system(_uniffiStatus)
}))
}

func ObjectIdZero() *ObjectId {
return FfiConverterObjectIdINSTANCE.Lift(rustCall(func(_uniffiStatus *C.RustCallStatus) unsafe.Pointer {
return C.uniffi_iota_sdk_ffi_fn_constructor_objectid_zero(_uniffiStatus)
}))
}



// Derive an ObjectId for a Dynamic Child Object.
Expand Down
Loading