diff --git a/bindings/go/iota_sdk_ffi/iota_sdk_ffi.go b/bindings/go/iota_sdk_ffi/iota_sdk_ffi.go index d9025dcb1..f4a17f430 100644 --- a/bindings/go/iota_sdk_ffi/iota_sdk_ffi.go +++ b/bindings/go/iota_sdk_ffi/iota_sdk_ffi.go @@ -1208,7 +1208,7 @@ func uniffiCheckChecksums() { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { return C.uniffi_iota_sdk_ffi_checksum_method_faucetclient_request_status() }) - if checksum != 31173 { + if checksum != 48258 { // If this happens try cleaning and rebuilding your project panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_faucetclient_request_status: UniFFI API checksum mismatch") } @@ -1307,7 +1307,7 @@ func uniffiCheckChecksums() { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { return C.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_checkpoint() }) - if checksum != 11584 { + if checksum != 9094 { // If this happens try cleaning and rebuilding your project panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_graphqlclient_checkpoint: UniFFI API checksum mismatch") } @@ -1316,7 +1316,7 @@ func uniffiCheckChecksums() { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { return C.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_checkpoints() }) - if checksum != 44363 { + if checksum != 36867 { // If this happens try cleaning and rebuilding your project panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_graphqlclient_checkpoints: UniFFI API checksum mismatch") } @@ -1343,7 +1343,7 @@ func uniffiCheckChecksums() { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { return C.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_dry_run_tx() }) - if checksum != 63702 { + if checksum != 7552 { // If this happens try cleaning and rebuilding your project panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_graphqlclient_dry_run_tx: UniFFI API checksum mismatch") } @@ -1352,7 +1352,7 @@ func uniffiCheckChecksums() { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { return C.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_dry_run_tx_kind() }) - if checksum != 1733 { + if checksum != 37663 { // If this happens try cleaning and rebuilding your project panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_graphqlclient_dry_run_tx_kind: UniFFI API checksum mismatch") } @@ -1361,7 +1361,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 != 17199 { + if checksum != 28380 { // 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") } @@ -1370,7 +1370,7 @@ func uniffiCheckChecksums() { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { return C.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_dynamic_fields() }) - if checksum != 6963 { + if checksum != 14745 { // If this happens try cleaning and rebuilding your project panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_graphqlclient_dynamic_fields: UniFFI API checksum mismatch") } @@ -1379,7 +1379,7 @@ func uniffiCheckChecksums() { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { return C.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_dynamic_object_field() }) - if checksum != 47284 { + if checksum != 28336 { // If this happens try cleaning and rebuilding your project panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_graphqlclient_dynamic_object_field: UniFFI API checksum mismatch") } @@ -1523,7 +1523,7 @@ func uniffiCheckChecksums() { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { return C.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_object() }) - if checksum != 51508 { + if checksum != 27424 { // If this happens try cleaning and rebuilding your project panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_graphqlclient_object: UniFFI API checksum mismatch") } @@ -1532,7 +1532,7 @@ func uniffiCheckChecksums() { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { return C.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_object_bcs() }) - if checksum != 1970 { + if checksum != 29653 { // If this happens try cleaning and rebuilding your project panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_graphqlclient_object_bcs: UniFFI API checksum mismatch") } @@ -1541,7 +1541,7 @@ func uniffiCheckChecksums() { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { return C.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_objects() }) - if checksum != 14004 { + if checksum != 64679 { // If this happens try cleaning and rebuilding your project panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_graphqlclient_objects: UniFFI API checksum mismatch") } @@ -1991,7 +1991,7 @@ func uniffiCheckChecksums() { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { return C.uniffi_iota_sdk_ffi_checksum_method_multisigcommittee_derive_address() }) - if checksum != 12725 { + if checksum != 26282 { // If this happens try cleaning and rebuilding your project panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_multisigcommittee_derive_address: UniFFI API checksum mismatch") } @@ -2702,7 +2702,7 @@ func uniffiCheckChecksums() { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { return C.uniffi_iota_sdk_ffi_checksum_method_passkeyauthenticator_authenticator_data() }) - if checksum != 55474 { + if checksum != 36642 { // If this happens try cleaning and rebuilding your project panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_passkeyauthenticator_authenticator_data: UniFFI API checksum mismatch") } @@ -2720,7 +2720,7 @@ func uniffiCheckChecksums() { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { return C.uniffi_iota_sdk_ffi_checksum_method_passkeyauthenticator_client_data_json() }) - if checksum != 20272 { + if checksum != 26196 { // If this happens try cleaning and rebuilding your project panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_method_passkeyauthenticator_client_data_json: UniFFI API checksum mismatch") } @@ -3734,6 +3734,15 @@ 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() }) @@ -5312,7 +5321,7 @@ func uniffiCheckChecksums() { checksum := rustCall(func(_uniffiStatus *C.RustCallStatus) C.uint16_t { return C.uniffi_iota_sdk_ffi_checksum_constructor_faucetclient_new() }) - if checksum != 13557 { + if checksum != 4619 { // If this happens try cleaning and rebuilding your project panic("iota_sdk_ffi: uniffi_iota_sdk_ffi_checksum_constructor_faucetclient_new: UniFFI API checksum mismatch") } @@ -7580,44 +7589,31 @@ func (ffiObject *FfiObject)freeRustArcPtr() { // is a valid IOTA address: // `0x02a212de6a9dfa3a69e22387acfbafbb1a9e591bd9d636e7895dcfc8de05f331`. // -// ``` -// use iota_types::Address; -// -// let hex = "0x02a212de6a9dfa3a69e22387acfbafbb1a9e591bd9d636e7895dcfc8de05f331"; -// let address = Address::from_hex(hex).unwrap(); -// println!("Address: {}", address); -// assert_eq!(hex, address.to_string()); -// ``` -// // # Deriving an Address // // Addresses are cryptographically derived from a number of user account // authenticators, the simplest of which is an -// [`Ed25519PublicKey`](iota_types::Ed25519PublicKey). +// `Ed25519PublicKey`. // // Deriving an address consists of the Blake2b256 hash of the sequence of bytes // of its corresponding authenticator, prefixed with a domain-separator (except // ed25519, for compatibility reasons). For each other authenticator, this // domain-separator is the single byte-value of its -// [`SignatureScheme`](iota_types::SignatureScheme) flag. E.g. `hash(signature -// schema flag || authenticator bytes)`. +// `SignatureScheme` flag. E.g. `hash(signature schema flag || authenticator +// bytes)`. // // Each authenticator has a method for deriving its `Address` as well as // documentation for the specifics of how the derivation is done. See -// [`Ed25519PublicKey::derive_address`] for an example. -// -// [`Ed25519PublicKey::derive_address`]: iota_types::Ed25519PublicKey::derive_address +// `Ed25519PublicKey::derive_address` for an example. // // ## Relationship to ObjectIds // -// [`ObjectId`]s and [`Address`]es share the same 32-byte addressable space but +// `ObjectId`s and `Address`es share the same 32-byte addressable space but // are derived leveraging different domain-separator values to ensure that, // cryptographically, there won't be any overlap, e.g. there can't be a // valid `Object` who's `ObjectId` is equal to that of the `Address` of a user // account. // -// [`ObjectId`]: iota_types::ObjectId -// // # BCS // // An `Address`'s BCS serialized form is defined by the following: @@ -7637,44 +7633,31 @@ type AddressInterface interface { // is a valid IOTA address: // `0x02a212de6a9dfa3a69e22387acfbafbb1a9e591bd9d636e7895dcfc8de05f331`. // -// ``` -// use iota_types::Address; -// -// let hex = "0x02a212de6a9dfa3a69e22387acfbafbb1a9e591bd9d636e7895dcfc8de05f331"; -// let address = Address::from_hex(hex).unwrap(); -// println!("Address: {}", address); -// assert_eq!(hex, address.to_string()); -// ``` -// // # Deriving an Address // // Addresses are cryptographically derived from a number of user account // authenticators, the simplest of which is an -// [`Ed25519PublicKey`](iota_types::Ed25519PublicKey). +// `Ed25519PublicKey`. // // Deriving an address consists of the Blake2b256 hash of the sequence of bytes // of its corresponding authenticator, prefixed with a domain-separator (except // ed25519, for compatibility reasons). For each other authenticator, this // domain-separator is the single byte-value of its -// [`SignatureScheme`](iota_types::SignatureScheme) flag. E.g. `hash(signature -// schema flag || authenticator bytes)`. +// `SignatureScheme` flag. E.g. `hash(signature schema flag || authenticator +// bytes)`. // // Each authenticator has a method for deriving its `Address` as well as // documentation for the specifics of how the derivation is done. See -// [`Ed25519PublicKey::derive_address`] for an example. -// -// [`Ed25519PublicKey::derive_address`]: iota_types::Ed25519PublicKey::derive_address +// `Ed25519PublicKey::derive_address` for an example. // // ## Relationship to ObjectIds // -// [`ObjectId`]s and [`Address`]es share the same 32-byte addressable space but +// `ObjectId`s and `Address`es share the same 32-byte addressable space but // are derived leveraging different domain-separator values to ensure that, // cryptographically, there won't be any overlap, e.g. there can't be a // valid `Object` who's `ObjectId` is equal to that of the `Address` of a user // account. // -// [`ObjectId`]: iota_types::ObjectId -// // # BCS // // An `Address`'s BCS serialized form is defined by the following: @@ -11854,14 +11837,14 @@ type FaucetClientInterface interface { RequestAndWait(address *Address) (*FaucetReceipt, error) // Check the faucet request status. // - // Possible statuses are defined in: [`BatchSendStatusType`] + // Possible statuses are defined in: `BatchSendStatusType` RequestStatus(id string) (*BatchSendStatus, error) } type FaucetClient struct { ffiObject FfiObject } // Construct a new `FaucetClient` with the given faucet service URL. This -// [`FaucetClient`] expects that the service provides two endpoints: +// `FaucetClient` expects that the service provides two endpoints: // /v1/gas and /v1/status. As such, do not provide the request // endpoint, just the top level service endpoint. // @@ -11971,7 +11954,7 @@ func (_self *FaucetClient) RequestAndWait(address *Address) (*FaucetReceipt, err // Check the faucet request status. // -// Possible statuses are defined in: [`BatchSendStatusType`] +// Possible statuses are defined in: `BatchSendStatusType` func (_self *FaucetClient) RequestStatus(id string) (*BatchSendStatus, error) { _pointer := _self.ffiObject.incrementPointer("*FaucetClient") defer _self.ffiObject.decrementPointer() @@ -12312,11 +12295,11 @@ type GraphQlClientInterface interface { Balance(address *Address, coinType *string) (*uint64, error) // Get the chain identifier. ChainId() (string, error) - // Get the [`CheckpointSummary`] for a given checkpoint digest or + // Get the `CheckpointSummary` for a given checkpoint digest or // checkpoint id. If none is provided, it will use the last known // checkpoint id. Checkpoint(digest **Digest, seqNum *uint64) (**CheckpointSummary, error) - // Get a page of [`CheckpointSummary`] for the provided parameters. + // Get a page of `CheckpointSummary` for the provided parameters. Checkpoints(paginationFilter *PaginationFilter) (CheckpointSummaryPage, error) // Get the coin metadata for the coin type. CoinMetadata(coinType string) (*CoinMetadata, error) @@ -12325,7 +12308,7 @@ type GraphQlClientInterface interface { // If `coin_type` is not provided, all coins will be returned. For IOTA // coins, pass in the coin type: `0x2::iota::IOTA`. Coins(owner *Address, paginationFilter *PaginationFilter, coinType **StructTag) (CoinPage, error) - // Dry run a [`Transaction`] and return the transaction effects and dry run + // Dry run a `Transaction` and return the transaction effects and dry run // error (if any). // // `skipChecks` optional flag disables the usual verification checks that @@ -12333,7 +12316,7 @@ type GraphQlClientInterface interface { // sender, and calling non-public, non-entry functions, and some other // checks. Defaults to false. DryRunTx(tx *Transaction, skipChecks bool) (DryRunResult, error) - // Dry run a [`TransactionKind`] and return the transaction effects and dry + // Dry run a `TransactionKind` and return the transaction effects and dry // run error (if any). // // `skipChecks` optional flag disables the usual verification checks that @@ -12349,7 +12332,7 @@ type GraphQlClientInterface interface { // // The `name` argument is a json serialized type. // - // This returns [`DynamicFieldOutput`] which contains the name, the value + // This returns `DynamicFieldOutput` which contains the name, the value // as json, and object. // // # Example @@ -12367,7 +12350,7 @@ type GraphQlClientInterface interface { // Get a page of dynamic fields for the provided address. Note that this // will also fetch dynamic fields on wrapped objects. // - // This returns [`Page`] of [`DynamicFieldOutput`]s. + // This returns a page of `DynamicFieldOutput`s. DynamicFields(address *Address, paginationFilter *PaginationFilter) (DynamicFieldOutputPage, error) // Access a dynamic object field on an object using its name. Names are // arbitrary Move values whose type have copy, drop, and store, and are @@ -12375,7 +12358,7 @@ type GraphQlClientInterface interface { // // The `name` argument is a json serialized type. // - // This returns [`DynamicFieldOutput`] which contains the name, the value + // This returns `DynamicFieldOutput` which contains the name, the value // as json, and object. DynamicObjectField(address *Address, typeTag *TypeTag, name Value) (*DynamicFieldOutput, error) // Return the epoch information for the provided epoch. If no epoch is @@ -12424,18 +12407,18 @@ type GraphQlClientInterface interface { NormalizedMoveFunction(varPackage *Address, module string, function string, version *uint64) (**MoveFunction, error) // Return the normalized Move module data for the provided module. NormalizedMoveModule(varPackage *Address, module string, version *uint64, paginationFilterEnums *PaginationFilter, paginationFilterFriends *PaginationFilter, paginationFilterFunctions *PaginationFilter, paginationFilterStructs *PaginationFilter) (*MoveModule, error) - // Return an object based on the provided [`Address`]. + // Return an object based on the provided `Address`. // // If the object does not exist (e.g., due to pruning), this will return // `Ok(None)`. Similarly, if this is not an object but an address, it // will return `Ok(None)`. Object(objectId *ObjectId, version *uint64) (**Object, error) - // Return the object's bcs content [`Vec`] based on the provided - // [`Address`]. + // Return the object's bcs content `Vec` based on the provided + // `Address`. ObjectBcs(objectId *ObjectId) (*[]byte, error) // Return a page of objects based on the provided parameters. // - // Use this function together with the [`ObjectFilter::owner`] to get the + // Use this function together with the `ObjectFilter::owner` to get the // objects owned by an address. // // # Example @@ -12671,7 +12654,7 @@ func (_self *GraphQlClient) ChainId() (string, error) { return res, err } -// Get the [`CheckpointSummary`] for a given checkpoint digest or +// Get the `CheckpointSummary` for a given checkpoint digest or // checkpoint id. If none is provided, it will use the last known // checkpoint id. func (_self *GraphQlClient) Checkpoint(digest **Digest, seqNum *uint64) (**CheckpointSummary, error) { @@ -12705,7 +12688,7 @@ func (_self *GraphQlClient) Checkpoint(digest **Digest, seqNum *uint64) (**Check return res, err } -// Get a page of [`CheckpointSummary`] for the provided parameters. +// Get a page of `CheckpointSummary` for the provided parameters. func (_self *GraphQlClient) Checkpoints(paginationFilter *PaginationFilter) (CheckpointSummaryPage, error) { _pointer := _self.ffiObject.incrementPointer("*GraphQlClient") defer _self.ffiObject.decrementPointer() @@ -12804,7 +12787,7 @@ func (_self *GraphQlClient) Coins(owner *Address, paginationFilter *PaginationFi return res, err } -// Dry run a [`Transaction`] and return the transaction effects and dry run +// Dry run a `Transaction` and return the transaction effects and dry run // error (if any). // // `skipChecks` optional flag disables the usual verification checks that @@ -12842,7 +12825,7 @@ func (_self *GraphQlClient) DryRunTx(tx *Transaction, skipChecks bool) (DryRunRe return res, err } -// Dry run a [`TransactionKind`] and return the transaction effects and dry +// Dry run a `TransactionKind` and return the transaction effects and dry // run error (if any). // // `skipChecks` optional flag disables the usual verification checks that @@ -12888,7 +12871,7 @@ func (_self *GraphQlClient) DryRunTxKind(txKind *TransactionKind, txMeta Transac // // The `name` argument is a json serialized type. // -// This returns [`DynamicFieldOutput`] which contains the name, the value +// This returns `DynamicFieldOutput` which contains the name, the value // as json, and object. // // # Example @@ -12936,7 +12919,7 @@ func (_self *GraphQlClient) DynamicField(address *Address, typeTag *TypeTag, nam // Get a page of dynamic fields for the provided address. Note that this // will also fetch dynamic fields on wrapped objects. // -// This returns [`Page`] of [`DynamicFieldOutput`]s. +// This returns a page of `DynamicFieldOutput`s. func (_self *GraphQlClient) DynamicFields(address *Address, paginationFilter *PaginationFilter) (DynamicFieldOutputPage, error) { _pointer := _self.ffiObject.incrementPointer("*GraphQlClient") defer _self.ffiObject.decrementPointer() @@ -12974,7 +12957,7 @@ func (_self *GraphQlClient) DynamicFields(address *Address, paginationFilter *Pa // // The `name` argument is a json serialized type. // -// This returns [`DynamicFieldOutput`] which contains the name, the value +// This returns `DynamicFieldOutput` which contains the name, the value // as json, and object. func (_self *GraphQlClient) DynamicObjectField(address *Address, typeTag *TypeTag, name Value) (*DynamicFieldOutput, error) { _pointer := _self.ffiObject.incrementPointer("*GraphQlClient") @@ -13501,7 +13484,7 @@ func (_self *GraphQlClient) NormalizedMoveModule(varPackage *Address, module str return res, err } -// Return an object based on the provided [`Address`]. +// Return an object based on the provided `Address`. // // If the object does not exist (e.g., due to pruning), this will return // `Ok(None)`. Similarly, if this is not an object but an address, it @@ -13537,8 +13520,8 @@ func (_self *GraphQlClient) Object(objectId *ObjectId, version *uint64) (**Objec return res, err } -// Return the object's bcs content [`Vec`] based on the provided -// [`Address`]. +// Return the object's bcs content `Vec` based on the provided +// `Address`. func (_self *GraphQlClient) ObjectBcs(objectId *ObjectId) (*[]byte, error) { _pointer := _self.ffiObject.incrementPointer("*GraphQlClient") defer _self.ffiObject.decrementPointer() @@ -13572,7 +13555,7 @@ func (_self *GraphQlClient) ObjectBcs(objectId *ObjectId) (*[]byte, error) { // Return a page of objects based on the provided parameters. // -// Use this function together with the [`ObjectFilter::owner`] to get the +// Use this function together with the `ObjectFilter::owner` to get the // objects owned by an address. // // # Example @@ -15625,7 +15608,7 @@ func (_ FfiDestroyerMovePackageData) Destroy(value *MovePackageData) { // ; roaring bitmaps // ``` // -// See [here](https://github.com/RoaringBitmap/RoaringFormatSpec) for the specification for the +// See for the specification for the // serialized format of RoaringBitmaps. type MultisigAggregatedSignatureInterface interface { // The bitmap that indicates which committee members provided their @@ -15658,7 +15641,7 @@ type MultisigAggregatedSignatureInterface interface { // ; roaring bitmaps // ``` // -// See [here](https://github.com/RoaringBitmap/RoaringFormatSpec) for the specification for the +// See for the specification for the // serialized format of RoaringBitmaps. type MultisigAggregatedSignature struct { ffiObject FfiObject @@ -15919,13 +15902,10 @@ type MultisigCommitteeInterface interface { // `hash(0x03 || threshold || flag_1 || pk_1 || weight_1 // || ... || flag_n || pk_n || weight_n)`. // - // When flag_i is ZkLogin, the pk_i for the [`ZkLoginPublicIdentifier`] + // When flag_i is ZkLogin, the pk_i for the `ZkLoginPublicIdentifier` // refers to the same input used when deriving the address using the - // [`ZkLoginPublicIdentifier::derive_address_padded`] method (using the + // `ZkLoginPublicIdentifier::derive_address_padded` method (using the // full 32-byte `address_seed` value). - // - // [`ZkLoginPublicIdentifier`]: crate::types::crypto::zklogin::ZkLoginPublicIdentifier - // [`ZkLoginPublicIdentifier::derive_address_padded`]: crate::types::crypto::zklogin::ZkLoginPublicIdentifier::derive_address_padded DeriveAddress() *Address // Checks if the Committee is valid. // @@ -15995,13 +15975,10 @@ func NewMultisigCommittee(members []*MultisigMember, threshold uint16) *Multisig // `hash(0x03 || threshold || flag_1 || pk_1 || weight_1 // || ... || flag_n || pk_n || weight_n)`. // -// When flag_i is ZkLogin, the pk_i for the [`ZkLoginPublicIdentifier`] +// When flag_i is ZkLogin, the pk_i for the `ZkLoginPublicIdentifier` // refers to the same input used when deriving the address using the -// [`ZkLoginPublicIdentifier::derive_address_padded`] method (using the +// `ZkLoginPublicIdentifier::derive_address_padded` method (using the // full 32-byte `address_seed` value). -// -// [`ZkLoginPublicIdentifier`]: crate::types::crypto::zklogin::ZkLoginPublicIdentifier -// [`ZkLoginPublicIdentifier::derive_address_padded`]: crate::types::crypto::zklogin::ZkLoginPublicIdentifier::derive_address_padded func (_self *MultisigCommittee) DeriveAddress() *Address { _pointer := _self.ffiObject.incrementPointer("*MultisigCommittee") defer _self.ffiObject.decrementPointer() @@ -17480,7 +17457,7 @@ func (_ FfiDestroyerObjectData) Destroy(value *ObjectData) { // // ## Relationship to Address // -// [`Address`]es and [`ObjectId`]s share the same 32-byte addressable space but +// `Address`es and `ObjectId`s share the same 32-byte addressable space but // are derived leveraging different domain-separator values to ensure, // cryptographically, that there won't be any overlap, e.g. there can't be a // valid `Object` whose `ObjectId` is equal to that of the `Address` of a user @@ -17507,7 +17484,7 @@ type ObjectIdInterface interface { // // ## Relationship to Address // -// [`Address`]es and [`ObjectId`]s share the same 32-byte addressable space but +// `Address`es and `ObjectId`s share the same 32-byte addressable space but // are derived leveraging different domain-separator values to ensure, // cryptographically, that there won't be any overlap, e.g. there can't be a // valid `Object` whose `ObjectId` is equal to that of the `Address` of a user @@ -18401,7 +18378,7 @@ func (_ FfiDestroyerPtbArgument) Destroy(value *PtbArgument) { // client-data-json = string ; valid json // ``` // -// See [CollectedClientData](https://www.w3.org/TR/webauthn-2/#dictdef-collectedclientdata) for +// See for // the required json-schema for the `client-data-json` rule. In addition, IOTA // currently requires that the `CollectedClientData.type` field is required to // be `webauthn.get`. @@ -18414,8 +18391,8 @@ func (_ FfiDestroyerPtbArgument) Destroy(value *PtbArgument) { type PasskeyAuthenticatorInterface interface { // Opaque authenticator data for this passkey signature. // - // See [Authenticator Data](https://www.w3.org/TR/webauthn-2/#sctn-authenticator-data) for - // more information on this field. + // See + // for more information on this field. AuthenticatorData() []byte // The parsed challenge message for this passkey signature. // @@ -18424,7 +18401,7 @@ type PasskeyAuthenticatorInterface interface { Challenge() []byte // Structured, unparsed, JSON for this passkey signature. // - // See [CollectedClientData](https://www.w3.org/TR/webauthn-2/#dictdef-collectedclientdata) + // See // for more information on this field. ClientDataJson() string // The passkey public key @@ -18449,7 +18426,7 @@ type PasskeyAuthenticatorInterface interface { // client-data-json = string ; valid json // ``` // -// See [CollectedClientData](https://www.w3.org/TR/webauthn-2/#dictdef-collectedclientdata) for +// See for // the required json-schema for the `client-data-json` rule. In addition, IOTA // currently requires that the `CollectedClientData.type` field is required to // be `webauthn.get`. @@ -18468,8 +18445,8 @@ type PasskeyAuthenticator struct { // Opaque authenticator data for this passkey signature. // -// See [Authenticator Data](https://www.w3.org/TR/webauthn-2/#sctn-authenticator-data) for -// more information on this field. +// See +// for more information on this field. func (_self *PasskeyAuthenticator) AuthenticatorData() []byte { _pointer := _self.ffiObject.incrementPointer("*PasskeyAuthenticator") defer _self.ffiObject.decrementPointer() @@ -18498,7 +18475,7 @@ func (_self *PasskeyAuthenticator) Challenge() []byte { // Structured, unparsed, JSON for this passkey signature. // -// See [CollectedClientData](https://www.w3.org/TR/webauthn-2/#dictdef-collectedclientdata) +// See // for more information on this field. func (_self *PasskeyAuthenticator) ClientDataJson() string { _pointer := _self.ffiObject.incrementPointer("*PasskeyAuthenticator") @@ -22193,8 +22170,8 @@ func (_ FfiDestroyerTransaction) Destroy(value *Transaction) { -// A builder for creating transactions. Use [`finish`](Self::finish) to -// finalize the transaction data. +// A builder for creating transactions. Use `finish` to finalize the +// transaction data. type TransactionBuilderInterface interface { // Dry run the transaction. DryRun(skipChecks bool) (DryRunResult, error) @@ -22210,6 +22187,8 @@ type TransactionBuilderInterface interface { Gas(objectId *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. @@ -22260,8 +22239,8 @@ type TransactionBuilderInterface interface { // ID, the upgrade policy, and package digest. Upgrade(packageData *MovePackageData, varPackage *ObjectId, ticket *PtbArgument, name *string) *TransactionBuilder } -// A builder for creating transactions. Use [`finish`](Self::finish) to -// finalize the transaction data. +// A builder for creating transactions. Use `finish` to finalize the +// transaction data. type TransactionBuilder struct { ffiObject FfiObject } @@ -22452,6 +22431,16 @@ 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") @@ -24347,7 +24336,7 @@ func (_ FfiDestroyerUserSignatureVerifier) Destroy(value *UserSignatureVerifier) // ; roaring bitmaps // ``` // -// See [here](https://github.com/RoaringBitmap/RoaringFormatSpec) for the specification for the +// See for the specification for the // serialized format of RoaringBitmaps. type ValidatorAggregatedSignatureInterface interface { BitmapBytes() ([]byte, error) @@ -24369,7 +24358,7 @@ type ValidatorAggregatedSignatureInterface interface { // ; roaring bitmaps // ``` // -// See [here](https://github.com/RoaringBitmap/RoaringFormatSpec) for the specification for the +// See for the specification for the // serialized format of RoaringBitmaps. type ValidatorAggregatedSignature struct { ffiObject FfiObject @@ -25460,7 +25449,7 @@ func (_ FfiDestroyerZkLoginProof) Destroy(value *ZkLoginProof) { // // A `ZkLoginPublicIdentifier` is the equivalent of a public key for other // account authenticators, and contains the information required to derive the -// onchain account [`Address`] for a Zklogin authenticator. +// onchain account `Address` for a Zklogin authenticator. // // ## Note // @@ -25506,8 +25495,6 @@ func (_ FfiDestroyerZkLoginProof) Destroy(value *ZkLoginProof) { // ; with any leading zero bytes stripped // address-seed-unpadded = %x00 / %x01-ff *31(OCTET) // ``` -// -// [`Address`]: crate::Address type ZkLoginPublicIdentifierInterface interface { AddressSeed() *Bn254FieldElement // Provides an iterator over the addresses that correspond to this zklogin @@ -25539,7 +25526,7 @@ type ZkLoginPublicIdentifierInterface interface { // // A `ZkLoginPublicIdentifier` is the equivalent of a public key for other // account authenticators, and contains the information required to derive the -// onchain account [`Address`] for a Zklogin authenticator. +// onchain account `Address` for a Zklogin authenticator. // // ## Note // @@ -25585,8 +25572,6 @@ type ZkLoginPublicIdentifierInterface interface { // ; with any leading zero bytes stripped // address-seed-unpadded = %x00 / %x01-ff *31(OCTET) // ``` -// -// [`Address`]: crate::Address type ZkLoginPublicIdentifier struct { ffiObject FfiObject } diff --git a/bindings/go/iota_sdk_ffi/iota_sdk_ffi.h b/bindings/go/iota_sdk_ffi/iota_sdk_ffi.h index 987b34bd6..48e72114e 100644 --- a/bindings/go/iota_sdk_ffi/iota_sdk_ffi.h +++ b/bindings/go/iota_sdk_ffi/iota_sdk_ffi.h @@ -4314,6 +4314,11 @@ void* uniffi_iota_sdk_ffi_fn_method_transactionbuilder_gas(void* ptr, void* obje 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 @@ -7842,6 +7847,12 @@ 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 diff --git a/bindings/kotlin/lib/iota_sdk/iota_sdk_ffi.kt b/bindings/kotlin/lib/iota_sdk/iota_sdk_ffi.kt index 3385393dd..3008c85b4 100644 --- a/bindings/kotlin/lib/iota_sdk/iota_sdk_ffi.kt +++ b/bindings/kotlin/lib/iota_sdk/iota_sdk_ffi.kt @@ -2451,6 +2451,8 @@ internal interface UniffiForeignFutureCompleteVoid : com.sun.jna.Callback { + + @@ -3219,6 +3221,8 @@ 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( @@ -5594,6 +5598,8 @@ fun uniffi_iota_sdk_ffi_fn_method_transactionbuilder_gas(`ptr`: Pointer,`objectI ): 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, @@ -6396,7 +6402,7 @@ private fun uniffiCheckApiChecksums(lib: IntegrityCheckingUniffiLib) { if (lib.uniffi_iota_sdk_ffi_checksum_method_faucetclient_request_and_wait() != 22484.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_iota_sdk_ffi_checksum_method_faucetclient_request_status() != 31173.toShort()) { + if (lib.uniffi_iota_sdk_ffi_checksum_method_faucetclient_request_status() != 48258.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } if (lib.uniffi_iota_sdk_ffi_checksum_method_genesisobject_data() != 26598.toShort()) { @@ -6429,10 +6435,10 @@ private fun uniffiCheckApiChecksums(lib: IntegrityCheckingUniffiLib) { if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_chain_id() != 45619.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_checkpoint() != 11584.toShort()) { + if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_checkpoint() != 9094.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_checkpoints() != 44363.toShort()) { + if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_checkpoints() != 36867.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_coin_metadata() != 10872.toShort()) { @@ -6441,19 +6447,19 @@ private fun uniffiCheckApiChecksums(lib: IntegrityCheckingUniffiLib) { if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_coins() != 47450.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_dry_run_tx() != 63702.toShort()) { + if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_dry_run_tx() != 7552.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_dry_run_tx_kind() != 1733.toShort()) { + if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_dry_run_tx_kind() != 37663.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_dynamic_field() != 17199.toShort()) { + if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_dynamic_field() != 28380.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_dynamic_fields() != 6963.toShort()) { + if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_dynamic_fields() != 14745.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_dynamic_object_field() != 47284.toShort()) { + if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_dynamic_object_field() != 28336.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_epoch() != 62805.toShort()) { @@ -6501,13 +6507,13 @@ private fun uniffiCheckApiChecksums(lib: IntegrityCheckingUniffiLib) { if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_normalized_move_module() != 51355.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_object() != 51508.toShort()) { + if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_object() != 27424.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_object_bcs() != 1970.toShort()) { + if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_object_bcs() != 29653.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_objects() != 14004.toShort()) { + if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_objects() != 64679.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } if (lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_package() != 7913.toShort()) { @@ -6657,7 +6663,7 @@ private fun uniffiCheckApiChecksums(lib: IntegrityCheckingUniffiLib) { if (lib.uniffi_iota_sdk_ffi_checksum_method_multisigaggregator_with_verifier() != 10820.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_iota_sdk_ffi_checksum_method_multisigcommittee_derive_address() != 12725.toShort()) { + if (lib.uniffi_iota_sdk_ffi_checksum_method_multisigcommittee_derive_address() != 26282.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } if (lib.uniffi_iota_sdk_ffi_checksum_method_multisigcommittee_is_valid() != 45468.toShort()) { @@ -6894,13 +6900,13 @@ private fun uniffiCheckApiChecksums(lib: IntegrityCheckingUniffiLib) { if (lib.uniffi_iota_sdk_ffi_checksum_method_owner_is_shared() != 6506.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_iota_sdk_ffi_checksum_method_passkeyauthenticator_authenticator_data() != 55474.toShort()) { + if (lib.uniffi_iota_sdk_ffi_checksum_method_passkeyauthenticator_authenticator_data() != 36642.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } if (lib.uniffi_iota_sdk_ffi_checksum_method_passkeyauthenticator_challenge() != 28147.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_iota_sdk_ffi_checksum_method_passkeyauthenticator_client_data_json() != 20272.toShort()) { + if (lib.uniffi_iota_sdk_ffi_checksum_method_passkeyauthenticator_client_data_json() != 26196.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } if (lib.uniffi_iota_sdk_ffi_checksum_method_passkeyauthenticator_public_key() != 18555.toShort()) { @@ -7239,6 +7245,9 @@ private fun uniffiCheckApiChecksums(lib: IntegrityCheckingUniffiLib) { 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") } @@ -7764,7 +7773,7 @@ private fun uniffiCheckApiChecksums(lib: IntegrityCheckingUniffiLib) { if (lib.uniffi_iota_sdk_ffi_checksum_constructor_executiontimeobservations_new_v1() != 19098.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_iota_sdk_ffi_checksum_constructor_faucetclient_new() != 13557.toShort()) { + if (lib.uniffi_iota_sdk_ffi_checksum_constructor_faucetclient_new() != 4619.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } if (lib.uniffi_iota_sdk_ffi_checksum_constructor_faucetclient_new_devnet() != 41429.toShort()) { @@ -8963,44 +8972,31 @@ public object FfiConverterDuration: FfiConverterRustBuffer { * is a valid IOTA address: * `0x02a212de6a9dfa3a69e22387acfbafbb1a9e591bd9d636e7895dcfc8de05f331`. * - * ``` - * use iota_types::Address; - * - * let hex = "0x02a212de6a9dfa3a69e22387acfbafbb1a9e591bd9d636e7895dcfc8de05f331"; - * let address = Address::from_hex(hex).unwrap(); - * println!("Address: {}", address); - * assert_eq!(hex, address.to_string()); - * ``` - * * # Deriving an Address * * Addresses are cryptographically derived from a number of user account * authenticators, the simplest of which is an - * [`Ed25519PublicKey`](iota_types::Ed25519PublicKey). + * `Ed25519PublicKey`. * * Deriving an address consists of the Blake2b256 hash of the sequence of bytes * of its corresponding authenticator, prefixed with a domain-separator (except * ed25519, for compatibility reasons). For each other authenticator, this * domain-separator is the single byte-value of its - * [`SignatureScheme`](iota_types::SignatureScheme) flag. E.g. `hash(signature - * schema flag || authenticator bytes)`. + * `SignatureScheme` flag. E.g. `hash(signature schema flag || authenticator + * bytes)`. * * Each authenticator has a method for deriving its `Address` as well as * documentation for the specifics of how the derivation is done. See - * [`Ed25519PublicKey::derive_address`] for an example. - * - * [`Ed25519PublicKey::derive_address`]: iota_types::Ed25519PublicKey::derive_address + * `Ed25519PublicKey::derive_address` for an example. * * ## Relationship to ObjectIds * - * [`ObjectId`]s and [`Address`]es share the same 32-byte addressable space but + * `ObjectId`s and `Address`es share the same 32-byte addressable space but * are derived leveraging different domain-separator values to ensure that, * cryptographically, there won't be any overlap, e.g. there can't be a * valid `Object` who's `ObjectId` is equal to that of the `Address` of a user * account. * - * [`ObjectId`]: iota_types::ObjectId - * * # BCS * * An `Address`'s BCS serialized form is defined by the following: @@ -9027,44 +9023,31 @@ public interface AddressInterface { * is a valid IOTA address: * `0x02a212de6a9dfa3a69e22387acfbafbb1a9e591bd9d636e7895dcfc8de05f331`. * - * ``` - * use iota_types::Address; - * - * let hex = "0x02a212de6a9dfa3a69e22387acfbafbb1a9e591bd9d636e7895dcfc8de05f331"; - * let address = Address::from_hex(hex).unwrap(); - * println!("Address: {}", address); - * assert_eq!(hex, address.to_string()); - * ``` - * * # Deriving an Address * * Addresses are cryptographically derived from a number of user account * authenticators, the simplest of which is an - * [`Ed25519PublicKey`](iota_types::Ed25519PublicKey). + * `Ed25519PublicKey`. * * Deriving an address consists of the Blake2b256 hash of the sequence of bytes * of its corresponding authenticator, prefixed with a domain-separator (except * ed25519, for compatibility reasons). For each other authenticator, this * domain-separator is the single byte-value of its - * [`SignatureScheme`](iota_types::SignatureScheme) flag. E.g. `hash(signature - * schema flag || authenticator bytes)`. + * `SignatureScheme` flag. E.g. `hash(signature schema flag || authenticator + * bytes)`. * * Each authenticator has a method for deriving its `Address` as well as * documentation for the specifics of how the derivation is done. See - * [`Ed25519PublicKey::derive_address`] for an example. - * - * [`Ed25519PublicKey::derive_address`]: iota_types::Ed25519PublicKey::derive_address + * `Ed25519PublicKey::derive_address` for an example. * * ## Relationship to ObjectIds * - * [`ObjectId`]s and [`Address`]es share the same 32-byte addressable space but + * `ObjectId`s and `Address`es share the same 32-byte addressable space but * are derived leveraging different domain-separator values to ensure that, * cryptographically, there won't be any overlap, e.g. there can't be a * valid `Object` who's `ObjectId` is equal to that of the `Address` of a user * account. * - * [`ObjectId`]: iota_types::ObjectId - * * # BCS * * An `Address`'s BCS serialized form is defined by the following: @@ -18765,7 +18748,7 @@ public interface FaucetClientInterface { /** * Check the faucet request status. * - * Possible statuses are defined in: [`BatchSendStatusType`] + * Possible statuses are defined in: `BatchSendStatusType` */ suspend fun `requestStatus`(`id`: kotlin.String): BatchSendStatus? @@ -18792,7 +18775,7 @@ open class FaucetClient: Disposable, AutoCloseable, FaucetClientInterface } /** * Construct a new `FaucetClient` with the given faucet service URL. This - * [`FaucetClient`] expects that the service provides two endpoints: + * `FaucetClient` expects that the service provides two endpoints: * /v1/gas and /v1/status. As such, do not provide the request * endpoint, just the top level service endpoint. * @@ -18930,7 +18913,7 @@ open class FaucetClient: Disposable, AutoCloseable, FaucetClientInterface /** * Check the faucet request status. * - * Possible statuses are defined in: [`BatchSendStatusType`] + * Possible statuses are defined in: `BatchSendStatusType` */ @Throws(SdkFfiException::class) @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") @@ -19758,14 +19741,14 @@ public interface GraphQlClientInterface { suspend fun `chainId`(): kotlin.String /** - * Get the [`CheckpointSummary`] for a given checkpoint digest or + * Get the `CheckpointSummary` for a given checkpoint digest or * checkpoint id. If none is provided, it will use the last known * checkpoint id. */ suspend fun `checkpoint`(`digest`: Digest? = null, `seqNum`: kotlin.ULong? = null): CheckpointSummary? /** - * Get a page of [`CheckpointSummary`] for the provided parameters. + * Get a page of `CheckpointSummary` for the provided parameters. */ suspend fun `checkpoints`(`paginationFilter`: PaginationFilter? = null): CheckpointSummaryPage @@ -19783,7 +19766,7 @@ public interface GraphQlClientInterface { suspend fun `coins`(`owner`: Address, `paginationFilter`: PaginationFilter? = null, `coinType`: StructTag? = null): CoinPage /** - * Dry run a [`Transaction`] and return the transaction effects and dry run + * Dry run a `Transaction` and return the transaction effects and dry run * error (if any). * * `skipChecks` optional flag disables the usual verification checks that @@ -19794,7 +19777,7 @@ public interface GraphQlClientInterface { suspend fun `dryRunTx`(`tx`: Transaction, `skipChecks`: kotlin.Boolean = false): DryRunResult /** - * Dry run a [`TransactionKind`] and return the transaction effects and dry + * Dry run a `TransactionKind` and return the transaction effects and dry * run error (if any). * * `skipChecks` optional flag disables the usual verification checks that @@ -19813,7 +19796,7 @@ public interface GraphQlClientInterface { * * The `name` argument is a json serialized type. * - * This returns [`DynamicFieldOutput`] which contains the name, the value + * This returns `DynamicFieldOutput` which contains the name, the value * as json, and object. * * # Example @@ -19834,7 +19817,7 @@ public interface GraphQlClientInterface { * Get a page of dynamic fields for the provided address. Note that this * will also fetch dynamic fields on wrapped objects. * - * This returns [`Page`] of [`DynamicFieldOutput`]s. + * This returns a page of `DynamicFieldOutput`s. */ suspend fun `dynamicFields`(`address`: Address, `paginationFilter`: PaginationFilter? = null): DynamicFieldOutputPage @@ -19845,7 +19828,7 @@ public interface GraphQlClientInterface { * * The `name` argument is a json serialized type. * - * This returns [`DynamicFieldOutput`] which contains the name, the value + * This returns `DynamicFieldOutput` which contains the name, the value * as json, and object. */ suspend fun `dynamicObjectField`(`address`: Address, `typeTag`: TypeTag, `name`: Value): DynamicFieldOutput? @@ -19942,7 +19925,7 @@ public interface GraphQlClientInterface { suspend fun `normalizedMoveModule`(`package`: Address, `module`: kotlin.String, `version`: kotlin.ULong? = null, `paginationFilterEnums`: PaginationFilter? = null, `paginationFilterFriends`: PaginationFilter? = null, `paginationFilterFunctions`: PaginationFilter? = null, `paginationFilterStructs`: PaginationFilter? = null): MoveModule? /** - * Return an object based on the provided [`Address`]. + * Return an object based on the provided `Address`. * * If the object does not exist (e.g., due to pruning), this will return * `Ok(None)`. Similarly, if this is not an object but an address, it @@ -19951,15 +19934,15 @@ public interface GraphQlClientInterface { suspend fun `object`(`objectId`: ObjectId, `version`: kotlin.ULong? = null): Object? /** - * Return the object's bcs content [`Vec`] based on the provided - * [`Address`]. + * Return the object's bcs content `Vec` based on the provided + * `Address`. */ suspend fun `objectBcs`(`objectId`: ObjectId): kotlin.ByteArray? /** * Return a page of objects based on the provided parameters. * - * Use this function together with the [`ObjectFilter::owner`] to get the + * Use this function together with the `ObjectFilter::owner` to get the * objects owned by an address. * * # Example @@ -20277,7 +20260,7 @@ open class GraphQlClient: Disposable, AutoCloseable, GraphQlClientInterface /** - * Get the [`CheckpointSummary`] for a given checkpoint digest or + * Get the `CheckpointSummary` for a given checkpoint digest or * checkpoint id. If none is provided, it will use the last known * checkpoint id. */ @@ -20303,7 +20286,7 @@ open class GraphQlClient: Disposable, AutoCloseable, GraphQlClientInterface /** - * Get a page of [`CheckpointSummary`] for the provided parameters. + * Get a page of `CheckpointSummary` for the provided parameters. */ @Throws(SdkFfiException::class) @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") @@ -20378,7 +20361,7 @@ open class GraphQlClient: Disposable, AutoCloseable, GraphQlClientInterface /** - * Dry run a [`Transaction`] and return the transaction effects and dry run + * Dry run a `Transaction` and return the transaction effects and dry run * error (if any). * * `skipChecks` optional flag disables the usual verification checks that @@ -20408,7 +20391,7 @@ open class GraphQlClient: Disposable, AutoCloseable, GraphQlClientInterface /** - * Dry run a [`TransactionKind`] and return the transaction effects and dry + * Dry run a `TransactionKind` and return the transaction effects and dry * run error (if any). * * `skipChecks` optional flag disables the usual verification checks that @@ -20446,7 +20429,7 @@ open class GraphQlClient: Disposable, AutoCloseable, GraphQlClientInterface * * The `name` argument is a json serialized type. * - * This returns [`DynamicFieldOutput`] which contains the name, the value + * This returns `DynamicFieldOutput` which contains the name, the value * as json, and object. * * # Example @@ -20486,7 +20469,7 @@ open class GraphQlClient: Disposable, AutoCloseable, GraphQlClientInterface * Get a page of dynamic fields for the provided address. Note that this * will also fetch dynamic fields on wrapped objects. * - * This returns [`Page`] of [`DynamicFieldOutput`]s. + * This returns a page of `DynamicFieldOutput`s. */ @Throws(SdkFfiException::class) @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") @@ -20516,7 +20499,7 @@ open class GraphQlClient: Disposable, AutoCloseable, GraphQlClientInterface * * The `name` argument is a json serialized type. * - * This returns [`DynamicFieldOutput`] which contains the name, the value + * This returns `DynamicFieldOutput` which contains the name, the value * as json, and object. */ @Throws(SdkFfiException::class) @@ -20917,7 +20900,7 @@ open class GraphQlClient: Disposable, AutoCloseable, GraphQlClientInterface /** - * Return an object based on the provided [`Address`]. + * Return an object based on the provided `Address`. * * If the object does not exist (e.g., due to pruning), this will return * `Ok(None)`. Similarly, if this is not an object but an address, it @@ -20945,8 +20928,8 @@ open class GraphQlClient: Disposable, AutoCloseable, GraphQlClientInterface /** - * Return the object's bcs content [`Vec`] based on the provided - * [`Address`]. + * Return the object's bcs content `Vec` based on the provided + * `Address`. */ @Throws(SdkFfiException::class) @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") @@ -20972,7 +20955,7 @@ open class GraphQlClient: Disposable, AutoCloseable, GraphQlClientInterface /** * Return a page of objects based on the provided parameters. * - * Use this function together with the [`ObjectFilter::owner`] to get the + * Use this function together with the `ObjectFilter::owner` to get the * objects owned by an address. * * # Example @@ -24672,7 +24655,7 @@ public object FfiConverterTypeMovePackageData: FfiConverter for the specification for the * serialized format of RoaringBitmaps. */ public interface MultisigAggregatedSignatureInterface { @@ -24717,7 +24700,7 @@ public interface MultisigAggregatedSignatureInterface { * ; roaring bitmaps * ``` * - * See [here](https://github.com/RoaringBitmap/RoaringFormatSpec) for the specification for the + * See for the specification for the * serialized format of RoaringBitmaps. */ open class MultisigAggregatedSignature: Disposable, AutoCloseable, MultisigAggregatedSignatureInterface @@ -25334,13 +25317,10 @@ public interface MultisigCommitteeInterface { * `hash(0x03 || threshold || flag_1 || pk_1 || weight_1 * || ... || flag_n || pk_n || weight_n)`. * - * When flag_i is ZkLogin, the pk_i for the [`ZkLoginPublicIdentifier`] + * When flag_i is ZkLogin, the pk_i for the `ZkLoginPublicIdentifier` * refers to the same input used when deriving the address using the - * [`ZkLoginPublicIdentifier::derive_address_padded`] method (using the + * `ZkLoginPublicIdentifier::derive_address_padded` method (using the * full 32-byte `address_seed` value). - * - * [`ZkLoginPublicIdentifier`]: crate::types::crypto::zklogin::ZkLoginPublicIdentifier - * [`ZkLoginPublicIdentifier::derive_address_padded`]: crate::types::crypto::zklogin::ZkLoginPublicIdentifier::derive_address_padded */ fun `deriveAddress`(): Address @@ -25509,13 +25489,10 @@ open class MultisigCommittee: Disposable, AutoCloseable, MultisigCommitteeInterf * `hash(0x03 || threshold || flag_1 || pk_1 || weight_1 * || ... || flag_n || pk_n || weight_n)`. * - * When flag_i is ZkLogin, the pk_i for the [`ZkLoginPublicIdentifier`] + * When flag_i is ZkLogin, the pk_i for the `ZkLoginPublicIdentifier` * refers to the same input used when deriving the address using the - * [`ZkLoginPublicIdentifier::derive_address_padded`] method (using the + * `ZkLoginPublicIdentifier::derive_address_padded` method (using the * full 32-byte `address_seed` value). - * - * [`ZkLoginPublicIdentifier`]: crate::types::crypto::zklogin::ZkLoginPublicIdentifier - * [`ZkLoginPublicIdentifier::derive_address_padded`]: crate::types::crypto::zklogin::ZkLoginPublicIdentifier::derive_address_padded */override fun `deriveAddress`(): Address { return FfiConverterTypeAddress.lift( callWithPointer { @@ -28725,7 +28702,7 @@ public object FfiConverterTypeObjectData: FfiConverter { * * ## Relationship to Address * - * [`Address`]es and [`ObjectId`]s share the same 32-byte addressable space but + * `Address`es and `ObjectId`s share the same 32-byte addressable space but * are derived leveraging different domain-separator values to ensure, * cryptographically, that there won't be any overlap, e.g. there can't be a * valid `Object` whose `ObjectId` is equal to that of the `Address` of a user @@ -28763,7 +28740,7 @@ public interface ObjectIdInterface { * * ## Relationship to Address * - * [`Address`]es and [`ObjectId`]s share the same 32-byte addressable space but + * `Address`es and `ObjectId`s share the same 32-byte addressable space but * are derived leveraging different domain-separator values to ensure, * cryptographically, that there won't be any overlap, e.g. there can't be a * valid `Object` whose `ObjectId` is equal to that of the `Address` of a user @@ -30489,7 +30466,7 @@ public object FfiConverterTypePTBArgument: FfiConverter { * client-data-json = string ; valid json * ``` * - * See [CollectedClientData](https://www.w3.org/TR/webauthn-2/#dictdef-collectedclientdata) for + * See for * the required json-schema for the `client-data-json` rule. In addition, IOTA * currently requires that the `CollectedClientData.type` field is required to * be `webauthn.get`. @@ -30505,8 +30482,8 @@ public interface PasskeyAuthenticatorInterface { /** * Opaque authenticator data for this passkey signature. * - * See [Authenticator Data](https://www.w3.org/TR/webauthn-2/#sctn-authenticator-data) for - * more information on this field. + * See + * for more information on this field. */ fun `authenticatorData`(): kotlin.ByteArray @@ -30521,7 +30498,7 @@ public interface PasskeyAuthenticatorInterface { /** * Structured, unparsed, JSON for this passkey signature. * - * See [CollectedClientData](https://www.w3.org/TR/webauthn-2/#dictdef-collectedclientdata) + * See * for more information on this field. */ fun `clientDataJson`(): kotlin.String @@ -30557,7 +30534,7 @@ public interface PasskeyAuthenticatorInterface { * client-data-json = string ; valid json * ``` * - * See [CollectedClientData](https://www.w3.org/TR/webauthn-2/#dictdef-collectedclientdata) for + * See for * the required json-schema for the `client-data-json` rule. In addition, IOTA * currently requires that the `CollectedClientData.type` field is required to * be `webauthn.get`. @@ -30654,8 +30631,8 @@ open class PasskeyAuthenticator: Disposable, AutoCloseable, PasskeyAuthenticator /** * Opaque authenticator data for this passkey signature. * - * See [Authenticator Data](https://www.w3.org/TR/webauthn-2/#sctn-authenticator-data) for - * more information on this field. + * See + * for more information on this field. */override fun `authenticatorData`(): kotlin.ByteArray { return FfiConverterByteArray.lift( callWithPointer { @@ -30690,7 +30667,7 @@ open class PasskeyAuthenticator: Disposable, AutoCloseable, PasskeyAuthenticator /** * Structured, unparsed, JSON for this passkey signature. * - * See [CollectedClientData](https://www.w3.org/TR/webauthn-2/#dictdef-collectedclientdata) + * See * for more information on this field. */override fun `clientDataJson`(): kotlin.String { return FfiConverterString.lift( @@ -38674,8 +38651,8 @@ public object FfiConverterTypeTransaction: FfiConverter { /** - * A builder for creating transactions. Use [`finish`](Self::finish) to - * finalize the transaction data. + * A builder for creating transactions. Use `finish` to finalize the + * transaction data. */ public interface TransactionBuilderInterface { @@ -38714,6 +38691,11 @@ public interface TransactionBuilderInterface { */ fun `gasBudget`(`budget`: kotlin.ULong): TransactionBuilder + /** + * Add gas objects to pay for the transaction. + */ + fun `gasCoins`(`objectIds`: List): TransactionBuilder + /** * Set the gas price for the transaction. */ @@ -38803,8 +38785,8 @@ public interface TransactionBuilderInterface { } /** - * A builder for creating transactions. Use [`finish`](Self::finish) to - * finalize the transaction data. + * A builder for creating transactions. Use `finish` to finalize the + * transaction data. */ open class TransactionBuilder: Disposable, AutoCloseable, TransactionBuilderInterface { @@ -39030,6 +39012,21 @@ open class TransactionBuilder: Disposable, AutoCloseable, TransactionBuilderInte + /** + * Add gas objects to pay for the transaction. + */override fun `gasCoins`(`objectIds`: List): 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 { @@ -43078,7 +43075,7 @@ public object FfiConverterTypeUserSignatureVerifier: FfiConverter for the specification for the * serialized format of RoaringBitmaps. */ public interface ValidatorAggregatedSignatureInterface { @@ -43108,7 +43105,7 @@ public interface ValidatorAggregatedSignatureInterface { * ; roaring bitmaps * ``` * - * See [here](https://github.com/RoaringBitmap/RoaringFormatSpec) for the specification for the + * See for the specification for the * serialized format of RoaringBitmaps. */ open class ValidatorAggregatedSignature: Disposable, AutoCloseable, ValidatorAggregatedSignatureInterface @@ -45761,7 +45758,7 @@ public object FfiConverterTypeZkLoginProof: FfiConverter * * A `ZkLoginPublicIdentifier` is the equivalent of a public key for other * account authenticators, and contains the information required to derive the - * onchain account [`Address`] for a Zklogin authenticator. + * onchain account `Address` for a Zklogin authenticator. * * ## Note * @@ -45807,8 +45804,6 @@ public object FfiConverterTypeZkLoginProof: FfiConverter * ; with any leading zero bytes stripped * address-seed-unpadded = %x00 / %x01-ff *31(OCTET) * ``` - * - * [`Address`]: crate::Address */ public interface ZkLoginPublicIdentifierInterface { @@ -45856,7 +45851,7 @@ public interface ZkLoginPublicIdentifierInterface { * * A `ZkLoginPublicIdentifier` is the equivalent of a public key for other * account authenticators, and contains the information required to derive the - * onchain account [`Address`] for a Zklogin authenticator. + * onchain account `Address` for a Zklogin authenticator. * * ## Note * @@ -45902,8 +45897,6 @@ public interface ZkLoginPublicIdentifierInterface { * ; with any leading zero bytes stripped * address-seed-unpadded = %x00 / %x01-ff *31(OCTET) * ``` - * - * [`Address`]: crate::Address */ open class ZkLoginPublicIdentifier: Disposable, AutoCloseable, ZkLoginPublicIdentifierInterface { diff --git a/bindings/python/lib/iota_sdk_ffi.py b/bindings/python/lib/iota_sdk_ffi.py index f3387dbc5..4e4dec822 100644 --- a/bindings/python/lib/iota_sdk_ffi.py +++ b/bindings/python/lib/iota_sdk_ffi.py @@ -649,7 +649,7 @@ 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_faucetclient_request_and_wait() != 22484: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - if lib.uniffi_iota_sdk_ffi_checksum_method_faucetclient_request_status() != 31173: + if lib.uniffi_iota_sdk_ffi_checksum_method_faucetclient_request_status() != 48258: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_iota_sdk_ffi_checksum_method_genesisobject_data() != 26598: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") @@ -671,23 +671,23 @@ 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_graphqlclient_chain_id() != 45619: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - if lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_checkpoint() != 11584: + if lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_checkpoint() != 9094: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - if lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_checkpoints() != 44363: + if lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_checkpoints() != 36867: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_coin_metadata() != 10872: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_coins() != 47450: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - if lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_dry_run_tx() != 63702: + if lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_dry_run_tx() != 7552: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - if lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_dry_run_tx_kind() != 1733: + if lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_dry_run_tx_kind() != 37663: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - if lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_dynamic_field() != 17199: + if lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_dynamic_field() != 28380: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - if lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_dynamic_fields() != 6963: + if lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_dynamic_fields() != 14745: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - if lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_dynamic_object_field() != 47284: + if lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_dynamic_object_field() != 28336: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_epoch() != 62805: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") @@ -719,11 +719,11 @@ 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_graphqlclient_normalized_move_module() != 51355: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - if lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_object() != 51508: + if lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_object() != 27424: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - if lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_object_bcs() != 1970: + if lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_object_bcs() != 29653: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - if lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_objects() != 14004: + if lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_objects() != 64679: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_iota_sdk_ffi_checksum_method_graphqlclient_package() != 7913: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") @@ -823,7 +823,7 @@ 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_multisigaggregator_with_verifier() != 10820: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - if lib.uniffi_iota_sdk_ffi_checksum_method_multisigcommittee_derive_address() != 12725: + if lib.uniffi_iota_sdk_ffi_checksum_method_multisigcommittee_derive_address() != 26282: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_iota_sdk_ffi_checksum_method_multisigcommittee_is_valid() != 45468: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") @@ -981,11 +981,11 @@ 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_owner_is_shared() != 6506: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - if lib.uniffi_iota_sdk_ffi_checksum_method_passkeyauthenticator_authenticator_data() != 55474: + if lib.uniffi_iota_sdk_ffi_checksum_method_passkeyauthenticator_authenticator_data() != 36642: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_iota_sdk_ffi_checksum_method_passkeyauthenticator_challenge() != 28147: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - if lib.uniffi_iota_sdk_ffi_checksum_method_passkeyauthenticator_client_data_json() != 20272: + if lib.uniffi_iota_sdk_ffi_checksum_method_passkeyauthenticator_client_data_json() != 26196: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_iota_sdk_ffi_checksum_method_passkeyauthenticator_public_key() != 18555: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") @@ -1211,6 +1211,8 @@ 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_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: @@ -1561,7 +1563,7 @@ 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_constructor_executiontimeobservations_new_v1() != 19098: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - if lib.uniffi_iota_sdk_ffi_checksum_constructor_faucetclient_new() != 13557: + if lib.uniffi_iota_sdk_ffi_checksum_constructor_faucetclient_new() != 4619: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_iota_sdk_ffi_checksum_constructor_faucetclient_new_devnet() != 41429: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") @@ -6110,6 +6112,12 @@ 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, @@ -8540,6 +8548,9 @@ 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 @@ -22913,44 +22924,31 @@ class AddressProtocol(typing.Protocol): is a valid IOTA address: `0x02a212de6a9dfa3a69e22387acfbafbb1a9e591bd9d636e7895dcfc8de05f331`. - ``` - use iota_types::Address; - - let hex = "0x02a212de6a9dfa3a69e22387acfbafbb1a9e591bd9d636e7895dcfc8de05f331"; - let address = Address::from_hex(hex).unwrap(); - println!("Address: {}", address); - assert_eq!(hex, address.to_string()); - ``` - # Deriving an Address Addresses are cryptographically derived from a number of user account authenticators, the simplest of which is an - [`Ed25519PublicKey`](iota_types::Ed25519PublicKey). + `Ed25519PublicKey`. Deriving an address consists of the Blake2b256 hash of the sequence of bytes of its corresponding authenticator, prefixed with a domain-separator (except ed25519, for compatibility reasons). For each other authenticator, this domain-separator is the single byte-value of its - [`SignatureScheme`](iota_types::SignatureScheme) flag. E.g. `hash(signature - schema flag || authenticator bytes)`. + `SignatureScheme` flag. E.g. `hash(signature schema flag || authenticator + bytes)`. Each authenticator has a method for deriving its `Address` as well as documentation for the specifics of how the derivation is done. See - [`Ed25519PublicKey::derive_address`] for an example. - - [`Ed25519PublicKey::derive_address`]: iota_types::Ed25519PublicKey::derive_address + `Ed25519PublicKey::derive_address` for an example. ## Relationship to ObjectIds - [`ObjectId`]s and [`Address`]es share the same 32-byte addressable space but + `ObjectId`s and `Address`es share the same 32-byte addressable space but are derived leveraging different domain-separator values to ensure that, cryptographically, there won't be any overlap, e.g. there can't be a valid `Object` who's `ObjectId` is equal to that of the `Address` of a user account. - [`ObjectId`]: iota_types::ObjectId - # BCS An `Address`'s BCS serialized form is defined by the following: @@ -22975,44 +22973,31 @@ class Address(): is a valid IOTA address: `0x02a212de6a9dfa3a69e22387acfbafbb1a9e591bd9d636e7895dcfc8de05f331`. - ``` - use iota_types::Address; - - let hex = "0x02a212de6a9dfa3a69e22387acfbafbb1a9e591bd9d636e7895dcfc8de05f331"; - let address = Address::from_hex(hex).unwrap(); - println!("Address: {}", address); - assert_eq!(hex, address.to_string()); - ``` - # Deriving an Address Addresses are cryptographically derived from a number of user account authenticators, the simplest of which is an - [`Ed25519PublicKey`](iota_types::Ed25519PublicKey). + `Ed25519PublicKey`. Deriving an address consists of the Blake2b256 hash of the sequence of bytes of its corresponding authenticator, prefixed with a domain-separator (except ed25519, for compatibility reasons). For each other authenticator, this domain-separator is the single byte-value of its - [`SignatureScheme`](iota_types::SignatureScheme) flag. E.g. `hash(signature - schema flag || authenticator bytes)`. + `SignatureScheme` flag. E.g. `hash(signature schema flag || authenticator + bytes)`. Each authenticator has a method for deriving its `Address` as well as documentation for the specifics of how the derivation is done. See - [`Ed25519PublicKey::derive_address`] for an example. - - [`Ed25519PublicKey::derive_address`]: iota_types::Ed25519PublicKey::derive_address + `Ed25519PublicKey::derive_address` for an example. ## Relationship to ObjectIds - [`ObjectId`]s and [`Address`]es share the same 32-byte addressable space but + `ObjectId`s and `Address`es share the same 32-byte addressable space but are derived leveraging different domain-separator values to ensure that, cryptographically, there won't be any overlap, e.g. there can't be a valid `Object` who's `ObjectId` is equal to that of the `Address` of a user account. - [`ObjectId`]: iota_types::ObjectId - # BCS An `Address`'s BCS serialized form is defined by the following: @@ -27529,7 +27514,7 @@ def request_status(self, id: "str"): """ Check the faucet request status. - Possible statuses are defined in: [`BatchSendStatusType`] + Possible statuses are defined in: `BatchSendStatusType` """ raise NotImplementedError @@ -27539,7 +27524,7 @@ class FaucetClient(): def __init__(self, faucet_url: "str"): """ Construct a new `FaucetClient` with the given faucet service URL. This - [`FaucetClient`] expects that the service provides two endpoints: + `FaucetClient` expects that the service provides two endpoints: /v1/gas and /v1/status. As such, do not provide the request endpoint, just the top level service endpoint. @@ -27662,7 +27647,7 @@ async def request_status(self, id: "str") -> "typing.Optional[BatchSendStatus]": """ Check the faucet request status. - Possible statuses are defined in: [`BatchSendStatusType`] + Possible statuses are defined in: `BatchSendStatusType` """ _UniffiConverterString.check_lower(id) @@ -27994,7 +27979,7 @@ def chain_id(self, ): raise NotImplementedError def checkpoint(self, digest: "typing.Union[object, typing.Optional[Digest]]" = _DEFAULT,seq_num: "typing.Union[object, typing.Optional[int]]" = _DEFAULT): """ - Get the [`CheckpointSummary`] for a given checkpoint digest or + Get the `CheckpointSummary` for a given checkpoint digest or checkpoint id. If none is provided, it will use the last known checkpoint id. """ @@ -28002,7 +27987,7 @@ def checkpoint(self, digest: "typing.Union[object, typing.Optional[Digest]]" = _ raise NotImplementedError def checkpoints(self, pagination_filter: "typing.Union[object, typing.Optional[PaginationFilter]]" = _DEFAULT): """ - Get a page of [`CheckpointSummary`] for the provided parameters. + Get a page of `CheckpointSummary` for the provided parameters. """ raise NotImplementedError @@ -28023,7 +28008,7 @@ def coins(self, owner: "Address",pagination_filter: "typing.Union[object, typing raise NotImplementedError def dry_run_tx(self, tx: "Transaction",skip_checks: "typing.Union[object, bool]" = _DEFAULT): """ - Dry run a [`Transaction`] and return the transaction effects and dry run + Dry run a `Transaction` and return the transaction effects and dry run error (if any). `skipChecks` optional flag disables the usual verification checks that @@ -28035,7 +28020,7 @@ def dry_run_tx(self, tx: "Transaction",skip_checks: "typing.Union[object, bool]" raise NotImplementedError def dry_run_tx_kind(self, tx_kind: "TransactionKind",tx_meta: "TransactionMetadata",skip_checks: "typing.Union[object, bool]" = _DEFAULT): """ - Dry run a [`TransactionKind`] and return the transaction effects and dry + Dry run a `TransactionKind` and return the transaction effects and dry run error (if any). `skipChecks` optional flag disables the usual verification checks that @@ -28055,7 +28040,7 @@ def dynamic_field(self, address: "Address",type_tag: "TypeTag",name: "Value"): The `name` argument is a json serialized type. - This returns [`DynamicFieldOutput`] which contains the name, the value + This returns `DynamicFieldOutput` which contains the name, the value as json, and object. # Example @@ -28077,7 +28062,7 @@ def dynamic_fields(self, address: "Address",pagination_filter: "typing.Union[obj Get a page of dynamic fields for the provided address. Note that this will also fetch dynamic fields on wrapped objects. - This returns [`Page`] of [`DynamicFieldOutput`]s. + This returns a page of `DynamicFieldOutput`s. """ raise NotImplementedError @@ -28089,7 +28074,7 @@ def dynamic_object_field(self, address: "Address",type_tag: "TypeTag",name: "Val The `name` argument is a json serialized type. - This returns [`DynamicFieldOutput`] which contains the name, the value + This returns `DynamicFieldOutput` which contains the name, the value as json, and object. """ @@ -28202,7 +28187,7 @@ def normalized_move_module(self, package: "Address",module: "str",version: "typi raise NotImplementedError def object(self, object_id: "ObjectId",version: "typing.Union[object, typing.Optional[int]]" = _DEFAULT): """ - Return an object based on the provided [`Address`]. + Return an object based on the provided `Address`. If the object does not exist (e.g., due to pruning), this will return `Ok(None)`. Similarly, if this is not an object but an address, it @@ -28212,8 +28197,8 @@ def object(self, object_id: "ObjectId",version: "typing.Union[object, typing.Opt raise NotImplementedError def object_bcs(self, object_id: "ObjectId"): """ - Return the object's bcs content [`Vec`] based on the provided - [`Address`]. + Return the object's bcs content `Vec` based on the provided + `Address`. """ raise NotImplementedError @@ -28221,7 +28206,7 @@ def objects(self, filter: "typing.Union[object, typing.Optional[ObjectFilter]]" """ Return a page of objects based on the provided parameters. - Use this function together with the [`ObjectFilter::owner`] to get the + Use this function together with the `ObjectFilter::owner` to get the objects owned by an address. # Example @@ -28551,7 +28536,7 @@ async def chain_id(self, ) -> "str": async def checkpoint(self, digest: "typing.Union[object, typing.Optional[Digest]]" = _DEFAULT,seq_num: "typing.Union[object, typing.Optional[int]]" = _DEFAULT) -> "typing.Optional[CheckpointSummary]": """ - Get the [`CheckpointSummary`] for a given checkpoint digest or + Get the `CheckpointSummary` for a given checkpoint digest or checkpoint id. If none is provided, it will use the last known checkpoint id. """ @@ -28585,7 +28570,7 @@ async def checkpoint(self, digest: "typing.Union[object, typing.Optional[Digest] async def checkpoints(self, pagination_filter: "typing.Union[object, typing.Optional[PaginationFilter]]" = _DEFAULT) -> "CheckpointSummaryPage": """ - Get a page of [`CheckpointSummary`] for the provided parameters. + Get a page of `CheckpointSummary` for the provided parameters. """ if pagination_filter is _DEFAULT: @@ -28675,7 +28660,7 @@ async def coins(self, owner: "Address",pagination_filter: "typing.Union[object, async def dry_run_tx(self, tx: "Transaction",skip_checks: "typing.Union[object, bool]" = _DEFAULT) -> "DryRunResult": """ - Dry run a [`Transaction`] and return the transaction effects and dry run + Dry run a `Transaction` and return the transaction effects and dry run error (if any). `skipChecks` optional flag disables the usual verification checks that @@ -28711,7 +28696,7 @@ async def dry_run_tx(self, tx: "Transaction",skip_checks: "typing.Union[object, async def dry_run_tx_kind(self, tx_kind: "TransactionKind",tx_meta: "TransactionMetadata",skip_checks: "typing.Union[object, bool]" = _DEFAULT) -> "DryRunResult": """ - Dry run a [`TransactionKind`] and return the transaction effects and dry + Dry run a `TransactionKind` and return the transaction effects and dry run error (if any). `skipChecks` optional flag disables the usual verification checks that @@ -28758,7 +28743,7 @@ async def dynamic_field(self, address: "Address",type_tag: "TypeTag",name: "Valu The `name` argument is a json serialized type. - This returns [`DynamicFieldOutput`] which contains the name, the value + This returns `DynamicFieldOutput` which contains the name, the value as json, and object. # Example @@ -28805,7 +28790,7 @@ async def dynamic_fields(self, address: "Address",pagination_filter: "typing.Uni Get a page of dynamic fields for the provided address. Note that this will also fetch dynamic fields on wrapped objects. - This returns [`Page`] of [`DynamicFieldOutput`]s. + This returns a page of `DynamicFieldOutput`s. """ _UniffiConverterTypeAddress.check_lower(address) @@ -28841,7 +28826,7 @@ async def dynamic_object_field(self, address: "Address",type_tag: "TypeTag",name The `name` argument is a json serialized type. - This returns [`DynamicFieldOutput`] which contains the name, the value + This returns `DynamicFieldOutput` which contains the name, the value as json, and object. """ @@ -29334,7 +29319,7 @@ async def normalized_move_module(self, package: "Address",module: "str",version: async def object(self, object_id: "ObjectId",version: "typing.Union[object, typing.Optional[int]]" = _DEFAULT) -> "typing.Optional[Object]": """ - Return an object based on the provided [`Address`]. + Return an object based on the provided `Address`. If the object does not exist (e.g., due to pruning), this will return `Ok(None)`. Similarly, if this is not an object but an address, it @@ -29368,8 +29353,8 @@ async def object(self, object_id: "ObjectId",version: "typing.Union[object, typi async def object_bcs(self, object_id: "ObjectId") -> "typing.Optional[bytes]": """ - Return the object's bcs content [`Vec`] based on the provided - [`Address`]. + Return the object's bcs content `Vec` based on the provided + `Address`. """ _UniffiConverterTypeObjectId.check_lower(object_id) @@ -29396,7 +29381,7 @@ async def objects(self, filter: "typing.Union[object, typing.Optional[ObjectFilt """ Return a page of objects based on the provided parameters. - Use this function together with the [`ObjectFilter::owner`] to get the + Use this function together with the `ObjectFilter::owner` to get the objects owned by an address. # Example @@ -31440,7 +31425,7 @@ class MultisigAggregatedSignatureProtocol(typing.Protocol): ; roaring bitmaps ``` - See [here](https://github.com/RoaringBitmap/RoaringFormatSpec) for the specification for the + See for the specification for the serialized format of RoaringBitmaps. """ @@ -31485,7 +31470,7 @@ class MultisigAggregatedSignature(): ; roaring bitmaps ``` - See [here](https://github.com/RoaringBitmap/RoaringFormatSpec) for the specification for the + See for the specification for the serialized format of RoaringBitmaps. """ @@ -31762,13 +31747,10 @@ def derive_address(self, ): `hash(0x03 || threshold || flag_1 || pk_1 || weight_1 || ... || flag_n || pk_n || weight_n)`. - When flag_i is ZkLogin, the pk_i for the [`ZkLoginPublicIdentifier`] + When flag_i is ZkLogin, the pk_i for the `ZkLoginPublicIdentifier` refers to the same input used when deriving the address using the - [`ZkLoginPublicIdentifier::derive_address_padded`] method (using the + `ZkLoginPublicIdentifier::derive_address_padded` method (using the full 32-byte `address_seed` value). - - [`ZkLoginPublicIdentifier`]: crate::types::crypto::zklogin::ZkLoginPublicIdentifier - [`ZkLoginPublicIdentifier::derive_address_padded`]: crate::types::crypto::zklogin::ZkLoginPublicIdentifier::derive_address_padded """ raise NotImplementedError @@ -31882,13 +31864,10 @@ def derive_address(self, ) -> "Address": `hash(0x03 || threshold || flag_1 || pk_1 || weight_1 || ... || flag_n || pk_n || weight_n)`. - When flag_i is ZkLogin, the pk_i for the [`ZkLoginPublicIdentifier`] + When flag_i is ZkLogin, the pk_i for the `ZkLoginPublicIdentifier` refers to the same input used when deriving the address using the - [`ZkLoginPublicIdentifier::derive_address_padded`] method (using the + `ZkLoginPublicIdentifier::derive_address_padded` method (using the full 32-byte `address_seed` value). - - [`ZkLoginPublicIdentifier`]: crate::types::crypto::zklogin::ZkLoginPublicIdentifier - [`ZkLoginPublicIdentifier::derive_address_padded`]: crate::types::crypto::zklogin::ZkLoginPublicIdentifier::derive_address_padded """ return _UniffiConverterTypeAddress.lift( @@ -33549,7 +33528,7 @@ class ObjectIdProtocol(typing.Protocol): ## Relationship to Address - [`Address`]es and [`ObjectId`]s share the same 32-byte addressable space but + `Address`es and `ObjectId`s share the same 32-byte addressable space but are derived leveraging different domain-separator values to ensure, cryptographically, that there won't be any overlap, e.g. there can't be a valid `Object` whose `ObjectId` is equal to that of the `Address` of a user @@ -33586,7 +33565,7 @@ class ObjectId(): ## Relationship to Address - [`Address`]es and [`ObjectId`]s share the same 32-byte addressable space but + `Address`es and `ObjectId`s share the same 32-byte addressable space but are derived leveraging different domain-separator values to ensure, cryptographically, that there won't be any overlap, e.g. there can't be a valid `Object` whose `ObjectId` is equal to that of the `Address` of a user @@ -34154,7 +34133,7 @@ class PasskeyAuthenticatorProtocol(typing.Protocol): client-data-json = string ; valid json ``` - See [CollectedClientData](https://www.w3.org/TR/webauthn-2/#dictdef-collectedclientdata) for + See for the required json-schema for the `client-data-json` rule. In addition, IOTA currently requires that the `CollectedClientData.type` field is required to be `webauthn.get`. @@ -34170,8 +34149,8 @@ def authenticator_data(self, ): """ Opaque authenticator data for this passkey signature. - See [Authenticator Data](https://www.w3.org/TR/webauthn-2/#sctn-authenticator-data) for - more information on this field. + See + for more information on this field. """ raise NotImplementedError @@ -34188,7 +34167,7 @@ def client_data_json(self, ): """ Structured, unparsed, JSON for this passkey signature. - See [CollectedClientData](https://www.w3.org/TR/webauthn-2/#dictdef-collectedclientdata) + See for more information on this field. """ @@ -34225,7 +34204,7 @@ class PasskeyAuthenticator(): client-data-json = string ; valid json ``` - See [CollectedClientData](https://www.w3.org/TR/webauthn-2/#dictdef-collectedclientdata) for + See for the required json-schema for the `client-data-json` rule. In addition, IOTA currently requires that the `CollectedClientData.type` field is required to be `webauthn.get`. @@ -34265,8 +34244,8 @@ def authenticator_data(self, ) -> "bytes": """ Opaque authenticator data for this passkey signature. - See [Authenticator Data](https://www.w3.org/TR/webauthn-2/#sctn-authenticator-data) for - more information on this field. + See + for more information on this field. """ return _UniffiConverterBytes.lift( @@ -34297,7 +34276,7 @@ def client_data_json(self, ) -> "str": """ Structured, unparsed, JSON for this passkey signature. - See [CollectedClientData](https://www.w3.org/TR/webauthn-2/#dictdef-collectedclientdata) + See for more information on this field. """ @@ -38413,8 +38392,8 @@ def write(cls, value: TransactionProtocol, buf: _UniffiRustBuffer): buf.write_u64(cls.lower(value)) class TransactionBuilderProtocol(typing.Protocol): """ - A builder for creating transactions. Use [`finish`](Self::finish) to - finalize the transaction data. + A builder for creating transactions. Use `finish` to finalize the + transaction data. """ def dry_run(self, skip_checks: "typing.Union[object, bool]" = _DEFAULT): @@ -38458,6 +38437,12 @@ 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"): """ @@ -38559,8 +38544,8 @@ def upgrade(self, package_data: "MovePackageData",package: "ObjectId",ticket: "P # TransactionBuilder is a Rust-only trait - it's a wrapper around a Rust implementation. class TransactionBuilder(): """ - A builder for creating transactions. Use [`finish`](Self::finish) to - finalize the transaction data. + A builder for creating transactions. Use `finish` to finalize the + transaction data. """ _pointer: ctypes.c_void_p @@ -38773,6 +38758,22 @@ 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. @@ -40924,7 +40925,7 @@ class ValidatorAggregatedSignatureProtocol(typing.Protocol): ; roaring bitmaps ``` - See [here](https://github.com/RoaringBitmap/RoaringFormatSpec) for the specification for the + See for the specification for the serialized format of RoaringBitmaps. """ @@ -40952,7 +40953,7 @@ class ValidatorAggregatedSignature(): ; roaring bitmaps ``` - See [here](https://github.com/RoaringBitmap/RoaringFormatSpec) for the specification for the + See for the specification for the serialized format of RoaringBitmaps. """ @@ -42042,7 +42043,7 @@ class ZkLoginPublicIdentifierProtocol(typing.Protocol): A `ZkLoginPublicIdentifier` is the equivalent of a public key for other account authenticators, and contains the information required to derive the - onchain account [`Address`] for a Zklogin authenticator. + onchain account `Address` for a Zklogin authenticator. ## Note @@ -42088,8 +42089,6 @@ class ZkLoginPublicIdentifierProtocol(typing.Protocol): ; with any leading zero bytes stripped address-seed-unpadded = %x00 / %x01-ff *31(OCTET) ``` - - [`Address`]: crate::Address """ def address_seed(self, ): @@ -42138,7 +42137,7 @@ class ZkLoginPublicIdentifier(): A `ZkLoginPublicIdentifier` is the equivalent of a public key for other account authenticators, and contains the information required to derive the - onchain account [`Address`] for a Zklogin authenticator. + onchain account `Address` for a Zklogin authenticator. ## Note @@ -42184,8 +42183,6 @@ class ZkLoginPublicIdentifier(): ; with any leading zero bytes stripped address-seed-unpadded = %x00 / %x01-ff *31(OCTET) ``` - - [`Address`]: crate::Address """ _pointer: ctypes.c_void_p diff --git a/crates/iota-sdk-ffi/README.md b/crates/iota-sdk-ffi/README.md index c3b0e1a13..a32010604 100644 --- a/crates/iota-sdk-ffi/README.md +++ b/crates/iota-sdk-ffi/README.md @@ -1,7 +1,116 @@ # IOTA SDK FFI +Core type definitions for the IOTA blockchain. + This crate can generate bindings for various languages using [UniFFI](https://github.com/mozilla/uniffi-rs). +[IOTA](https://iota.org) is a next-generation smart contract platform with high throughput, low latency, and an asset-oriented programming model powered by the Move programming language. This crate provides type definitions for working with the data that makes up the IOTA blockchain. + +## BCS + +[BCS](https://docs.rs/bcs) is the serialization format used to represent the state of the blockchain and is used extensively throughout the IOTA ecosystem. In particular the BCS format is leveraged because it _"guarantees canonical serialization, meaning that for any given data type, there is a one-to-one correspondence between in-memory values and valid byte representations."_ + +One benefit of this property of having a canonical serialized representation is to allow different entities in the ecosystem to all agree on how a particular type should be interpreted and more importantly define a deterministic representation for hashing and signing. + +This library strives to guarantee that the types defined are fully BCS-compatible with the data that the network produces. The one caveat to this would be that as the IOTA protocol evolves, new type variants are added and older versions of this library may not support those newly added variants. The expectation is that the most recent release of this library will support new variants and types as they are released to IOTA's `testnet` network. + +See the documentation for the various types defined by this crate for a specification of their BCS serialized representation which will be defined using ABNF notation as described by [RFC-5234](https://datatracker.ietf.org/doc/html/rfc5234). In addition to the format itself, some types have an extra layer of verification and may impose additional restrictions on valid byte representations above and beyond those already provided by BCS. In these instances the documentation for those types will clearly specify these additional restrictions. + +Here are some common rules: + +```text +; --- BCS Value --- +bcs-value = bcs-struct / bcs-enum / bcs-length-prefixed / bcs-fixed-length +bcs-length-prefixed = bytes / string / vector / option +bcs-fixed-length = u8 / u16 / u32 / u64 / u128 / + i8 / i16 / i32 / i64 / i128 / + boolean +bcs-struct = *bcs-value ; Sequence of serialized fields +bcs-enum = uleb128-index bcs-value ; Enum index and associated value +; --- Length-prefixed types --- +bytes = uleb128 *OCTET ; Raw bytes of the specified length +string = uleb128 *OCTET ; valid utf8 string of the specified length +vector = uleb128 *bcs-value ; Length-prefixed list of values +option = %x00 / (%x01 bcs-value) ; optional value +; --- Fixed-length types --- +u8 = OCTET ; 1-byte unsigned integer +u16 = 2OCTET ; 2-byte unsigned integer, little-endian +u32 = 4OCTET ; 4-byte unsigned integer, little-endian +u64 = 8OCTET ; 8-byte unsigned integer, little-endian +u128 = 16OCTET ; 16-byte unsigned integer, little-endian +i8 = OCTET ; 1-byte signed integer +i16 = 2OCTET ; 2-byte signed integer, little-endian +i32 = 4OCTET ; 4-byte signed integer, little-endian +i64 = 8OCTET ; 8-byte signed integer, little-endian +i128 = 16OCTET ; 16-byte signed integer, little-endian +boolean = %x00 / %x01 ; Boolean: 0 = false, 1 = true +array = *(bcs-value) ; Fixed-length array +; --- ULEB128 definition --- +uleb128 = 1*5uleb128-byte ; Variable-length ULEB128 encoding +uleb128-byte = %x00-7F / %x80-FF ; ULEB128 continuation rules +uleb128-index = uleb128 ; ULEB128-encoded variant index +``` + +## Transaction Builder + +This crate contains the +[TransactionBuilder](./src/transaction_builder/mod.rs), which allows +for construction of Programmable Transactions which can be executed on the +IOTA network. + +### Methods + +The following methods are available: + +#### Commands + +Each command method adds one or more commands to the final transaction. Some commands have optional follow-up methods. Most command results can be named, which allows them to be used later in the transaction via the `PTBArgument::Res` variant. When a single name is provided, the result will be named, and when a list of names is provided, the names will be used for the individual nested results. + +- `move_call`: Call a move function. +- `send_iota`: Send IOTA coins to a recipient address. +- `send_coins`: Send coins of any type to a recipient address. +- `merge_coins`: Merge a list of coins into a single primary coin. +- `split_coins`: Split a coin into coins of various amounts. +- `transfer_objects`: Send objects to a recipient address. +- `publish`: Publish a move package. +- `upgrade`: Upgrade a move package. +- `make_move_vec`: Create a move `vector`. + +#### Metadata + +These methods set various metadata which may be needed for the execution. + +- `gas`: Add a gas coin to pay for the execution. +- `gas_coins`: Add gas coins to pay for the execution. +- `gas_budget`: Set the maximum gas budget to spend. +- `gas_price`: Set the gas price. +- `sponsor`: Set the gas sponsor address. +- `gas_station_sponsor`: Set the gas station URL. See [Gas Station](#gas-station) for more info. +- `expiration`: Set the transaction expiration epoch. + +### Finalization and Execution + +There are several ways to finish the builder. First, the [finish](transaction_builder::TransactionBuilder::finish) method can be used to return the resulting [Transaction](iota_types::Transaction), which can be manually serialized, executed, etc. + +Additionally, the builder can directly [dry_run](transaction_builder::TransactionBuilder::dry_run) or [execute](transaction_builder::TransactionBuilder::execute) the transaction. + +When the transaction is resolved, the builder will try to ensure a valid state by de-duplicating and converting appropriate inputs into references to the gas coin. This means that the same input can be passed multiple times and the final transaction will only contain one instance. However, in some cases an invalid state can still be reached. For instance, if a coin is used both for gas and as part of a group of coins, i.e. when transferring objects, the transaction can not possibly be valid. + +#### Defaults + +The builder can set some values by default. The +following are the default behaviors for each metadata value. + +- Gas: One page of coins owned by the sender. +- Gas Budget: A dry run will be used to estimate. +- Gas Price: The current reference gas price. + +### Gas Station + +The Transaction Builder supports executing via a [Gas Station](https://github.com/iotaledger/gas-station). To do so, the URL, duration, and headers must be provided via [gas_station_sponsor](transaction_builder::TransactionBuilder::gas_station_sponsor). + +By default the request will contain the header `Content-Type: application/json` When this data has been set, calling [execute](transaction_builder::TransactionBuilder::execute) will request gas from and send the resulting transaction to this endpoint instead of using the GraphQL client. + ## Supported languages - [Go](../../bindings/go) diff --git a/crates/iota-sdk-ffi/src/faucet.rs b/crates/iota-sdk-ffi/src/faucet.rs index 890b681f8..96c806c83 100644 --- a/crates/iota-sdk-ffi/src/faucet.rs +++ b/crates/iota-sdk-ffi/src/faucet.rs @@ -14,7 +14,7 @@ pub struct FaucetClient(iota_graphql_client::faucet::FaucetClient); #[uniffi::export(async_runtime = "tokio")] impl FaucetClient { /// Construct a new `FaucetClient` with the given faucet service URL. This - /// [`FaucetClient`] expects that the service provides two endpoints: + /// `FaucetClient` expects that the service provides two endpoints: /// /v1/gas and /v1/status. As such, do not provide the request /// endpoint, just the top level service endpoint. /// @@ -68,7 +68,7 @@ impl FaucetClient { /// Check the faucet request status. /// - /// Possible statuses are defined in: [`BatchSendStatusType`] + /// Possible statuses are defined in: `BatchSendStatusType` pub async fn request_status(&self, id: String) -> Result> { Ok(self .0 diff --git a/crates/iota-sdk-ffi/src/graphql.rs b/crates/iota-sdk-ffi/src/graphql.rs index 9b4efe18b..8544521e9 100644 --- a/crates/iota-sdk-ffi/src/graphql.rs +++ b/crates/iota-sdk-ffi/src/graphql.rs @@ -230,7 +230,7 @@ impl GraphQLClient { // Checkpoints API // =========================================================================== - /// Get the [`CheckpointSummary`] for a given checkpoint digest or + /// Get the `CheckpointSummary` for a given checkpoint digest or /// checkpoint id. If none is provided, it will use the last known /// checkpoint id. #[uniffi::method(default(digest = None, seq_num = None))] @@ -249,7 +249,7 @@ impl GraphQLClient { .map(Arc::new)) } - /// Get a page of [`CheckpointSummary`] for the provided parameters. + /// Get a page of `CheckpointSummary` for the provided parameters. #[uniffi::method(default(pagination_filter = None))] pub async fn checkpoints( &self, @@ -339,7 +339,7 @@ impl GraphQLClient { // Objects API // =========================================================================== - /// Return an object based on the provided [`Address`]. + /// Return an object based on the provided `Address`. /// /// If the object does not exist (e.g., due to pruning), this will return /// `Ok(None)`. Similarly, if this is not an object but an address, it @@ -362,7 +362,7 @@ impl GraphQLClient { /// Return a page of objects based on the provided parameters. /// - /// Use this function together with the [`ObjectFilter::owner`] to get the + /// Use this function together with the `ObjectFilter::owner` to get the /// objects owned by an address. /// /// # Example @@ -395,8 +395,8 @@ impl GraphQLClient { .into()) } - /// Return the object's bcs content [`Vec`] based on the provided - /// [`Address`]. + /// Return the object's bcs content `Vec` based on the provided + /// `Address`. pub async fn object_bcs(&self, object_id: &ObjectId) -> Result>> { Ok(self.0.read().await.object_bcs(**object_id).await?) } @@ -736,7 +736,7 @@ impl GraphQLClient { /// /// The `name` argument is a json serialized type. /// - /// This returns [`DynamicFieldOutput`] which contains the name, the value + /// This returns `DynamicFieldOutput` which contains the name, the value /// as json, and object. /// /// # Example @@ -771,7 +771,7 @@ impl GraphQLClient { /// /// The `name` argument is a json serialized type. /// - /// This returns [`DynamicFieldOutput`] which contains the name, the value + /// This returns `DynamicFieldOutput` which contains the name, the value /// as json, and object. pub async fn dynamic_object_field( &self, @@ -791,7 +791,7 @@ impl GraphQLClient { /// Get a page of dynamic fields for the provided address. Note that this /// will also fetch dynamic fields on wrapped objects. /// - /// This returns [`Page`] of [`DynamicFieldOutput`]s. + /// This returns a page of `DynamicFieldOutput`s. #[uniffi::method(default(pagination_filter = None))] pub async fn dynamic_fields( &self, @@ -824,7 +824,7 @@ impl GraphQLClient { // Dry Run API // =========================================================================== - /// Dry run a [`Transaction`] and return the transaction effects and dry run + /// Dry run a `Transaction` and return the transaction effects and dry run /// error (if any). /// /// `skipChecks` optional flag disables the usual verification checks that @@ -842,7 +842,7 @@ impl GraphQLClient { .into()) } - /// Dry run a [`TransactionKind`] and return the transaction effects and dry + /// Dry run a `TransactionKind` and return the transaction effects and dry /// run error (if any). /// /// `skipChecks` optional flag disables the usual verification checks that diff --git a/crates/iota-sdk-ffi/src/lib.rs b/crates/iota-sdk-ffi/src/lib.rs index 0ce881f56..c4bd25a53 100644 --- a/crates/iota-sdk-ffi/src/lib.rs +++ b/crates/iota-sdk-ffi/src/lib.rs @@ -1,120 +1,22 @@ // Copyright (c) 2025 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 -//! Core type definitions for the IOTA blockchain. -//! -//! [IOTA] is a next-generation smart contract platform with high throughput, -//! low latency, and an asset-oriented programming model powered by the Move -//! programming language. This crate provides type definitions for working with -//! the data that makes up the IOTA blockchain. -//! -//! [IOTA]: https://iota.org -//! -//! # Feature flags -//! -//! This library uses a set of [feature flags] to reduce the number of -//! dependencies and amount of compiled code. By default, no features are -//! enabled which allows one to enable a subset specifically for their use case. -//! Below is a list of the available feature flags. -//! -//! - `schemars`: Enables JSON schema generation using the [schemars] library. -//! - `serde`: Enables support for serializing and deserializing types to/from -//! BCS utilizing [serde] library. -//! - `rand`: Enables support for generating random instances of a number of -//! types via the [rand] library. -//! - `hash`: Enables support for hashing, which is required for deriving -//! addresses and calculating digests for various types. -//! - `proptest`: Enables support for the [proptest] library by providing -//! implementations of [proptest::arbitrary::Arbitrary] for many types. -//! -//! [feature flags]: https://doc.rust-lang.org/cargo/reference/manifest.html#the-features-section -//! [serde]: https://docs.rs/serde -//! [rand]: https://docs.rs/rand -//! [proptest]: https://docs.rs/proptest -//! [schemars]: https://docs.rs/schemars -//! [proptest::arbitrary::Arbitrary]: https://docs.rs/proptest/latest/proptest/arbitrary/trait.Arbitrary.html -//! -//! # BCS -//! -//! [BCS] is the serialization format used to represent the state of the -//! blockchain and is used extensively throughout the IOTA ecosystem. In -//! particular the BCS format is leveraged because it _"guarantees canonical -//! serialization, meaning that for any given data type, there is a one-to-one -//! correspondence between in-memory values and valid byte representations."_ -//! One benefit of this property of having a canonical serialized representation -//! is to allow different entities in the ecosystem to all agree on how a -//! particular type should be interpreted and more importantly define a -//! deterministic representation for hashing and signing. -//! -//! This library strives to guarantee that the types defined are fully -//! BCS-compatible with the data that the network produces. The one caveat to -//! this would be that as the IOTA protocol evolves, new type variants are added -//! and older versions of this library may not support those newly -//! added variants. The expectation is that the most recent release of this -//! library will support new variants and types as they are released to IOTA's -//! `testnet` network. -//! -//! See the documentation for the various types defined by this crate for a -//! specification of their BCS serialized representation which will be defined -//! using ABNF notation as described by [RFC-5234]. In addition to the format -//! itself, some types have an extra layer of verification and may impose -//! additional restrictions on valid byte representations above and beyond those -//! already provided by BCS. In these instances the documentation for those -//! types will clearly specify these additional restrictions. -//! -//! Here are some common rules: -//! -//! ```text -//! ; --- BCS Value --- -//! bcs-value = bcs-struct / bcs-enum / bcs-length-prefixed / bcs-fixed-length -//! bcs-length-prefixed = bytes / string / vector / option -//! bcs-fixed-length = u8 / u16 / u32 / u64 / u128 / -//! i8 / i16 / i32 / i64 / i128 / -//! boolean -//! bcs-struct = *bcs-value ; Sequence of serialized fields -//! bcs-enum = uleb128-index bcs-value ; Enum index and associated value -//! -//! ; --- Length-prefixed types --- -//! bytes = uleb128 *OCTET ; Raw bytes of the specified length -//! string = uleb128 *OCTET ; valid utf8 string of the specified length -//! vector = uleb128 *bcs-value ; Length-prefixed list of values -//! option = %x00 / (%x01 bcs-value) ; optional value -//! -//! ; --- Fixed-length types --- -//! u8 = OCTET ; 1-byte unsigned integer -//! u16 = 2OCTET ; 2-byte unsigned integer, little-endian -//! u32 = 4OCTET ; 4-byte unsigned integer, little-endian -//! u64 = 8OCTET ; 8-byte unsigned integer, little-endian -//! u128 = 16OCTET ; 16-byte unsigned integer, little-endian -//! i8 = OCTET ; 1-byte signed integer -//! i16 = 2OCTET ; 2-byte signed integer, little-endian -//! i32 = 4OCTET ; 4-byte signed integer, little-endian -//! i64 = 8OCTET ; 8-byte signed integer, little-endian -//! i128 = 16OCTET ; 16-byte signed integer, little-endian -//! boolean = %x00 / %x01 ; Boolean: 0 = false, 1 = true -//! array = *(bcs-value) ; Fixed-length array -//! -//! ; --- ULEB128 definition --- -//! uleb128 = 1*5uleb128-byte ; Variable-length ULEB128 encoding -//! uleb128-byte = %x00-7F / %x80-FF ; ULEB128 continuation rules -//! uleb128-index = uleb128 ; ULEB128-encoded variant index -//! ``` -//! -//! [BCS]: https://docs.rs/bcs -//! [RFC-5234]: https://datatracker.ietf.org/doc/html/rfc5234 - #![expect(unused)] -#![allow(clippy::wrong_self_convention)] +#![allow( + clippy::wrong_self_convention, + clippy::should_implement_trait, + clippy::new_without_default +)] use base64ct::Encoding; -mod crypto; -mod error; -mod faucet; -mod graphql; -mod transaction_builder; -mod types; -mod uniffi_helpers; +pub mod crypto; +pub mod error; +pub mod faucet; +pub mod graphql; +pub mod transaction_builder; +pub mod types; +pub mod uniffi_helpers; uniffi::setup_scaffolding!(); diff --git a/crates/iota-sdk-ffi/src/transaction_builder/mod.rs b/crates/iota-sdk-ffi/src/transaction_builder/mod.rs index c8dbfa406..24b21cb81 100644 --- a/crates/iota-sdk-ffi/src/transaction_builder/mod.rs +++ b/crates/iota-sdk-ffi/src/transaction_builder/mod.rs @@ -25,10 +25,10 @@ use crate::{ }, }; -mod ptb_arg; +pub mod ptb_arg; -/// A builder for creating transactions. Use [`finish`](Self::finish) to -/// finalize the transaction data. +/// A builder for creating transactions. Use `finish` to finalize the +/// transaction data. #[derive(derive_more::From, uniffi::Object)] pub struct TransactionBuilder( RwLock>, @@ -74,6 +74,14 @@ impl TransactionBuilder { self } + /// Add gas objects to pay for the transaction. + pub fn gas_coins(self: Arc, object_ids: Vec>) -> Arc { + self.write(|builder| { + builder.gas_coins(object_ids.iter().map(|id| ***id)); + }); + self + } + /// Set the gas budget for the transaction. pub fn gas_budget(self: Arc, budget: u64) -> Arc { self.write(|builder| { diff --git a/crates/iota-sdk-ffi/src/types/address.rs b/crates/iota-sdk-ffi/src/types/address.rs index 6b4e11bae..4a763aa16 100644 --- a/crates/iota-sdk-ffi/src/types/address.rs +++ b/crates/iota-sdk-ffi/src/types/address.rs @@ -11,44 +11,31 @@ use crate::error::Result; /// is a valid IOTA address: /// `0x02a212de6a9dfa3a69e22387acfbafbb1a9e591bd9d636e7895dcfc8de05f331`. /// -/// ``` -/// use iota_types::Address; -/// -/// let hex = "0x02a212de6a9dfa3a69e22387acfbafbb1a9e591bd9d636e7895dcfc8de05f331"; -/// let address = Address::from_hex(hex).unwrap(); -/// println!("Address: {}", address); -/// assert_eq!(hex, address.to_string()); -/// ``` -/// /// # Deriving an Address /// /// Addresses are cryptographically derived from a number of user account /// authenticators, the simplest of which is an -/// [`Ed25519PublicKey`](iota_types::Ed25519PublicKey). +/// `Ed25519PublicKey`. /// /// Deriving an address consists of the Blake2b256 hash of the sequence of bytes /// of its corresponding authenticator, prefixed with a domain-separator (except /// ed25519, for compatibility reasons). For each other authenticator, this /// domain-separator is the single byte-value of its -/// [`SignatureScheme`](iota_types::SignatureScheme) flag. E.g. `hash(signature -/// schema flag || authenticator bytes)`. +/// `SignatureScheme` flag. E.g. `hash(signature schema flag || authenticator +/// bytes)`. /// /// Each authenticator has a method for deriving its `Address` as well as /// documentation for the specifics of how the derivation is done. See -/// [`Ed25519PublicKey::derive_address`] for an example. -/// -/// [`Ed25519PublicKey::derive_address`]: iota_types::Ed25519PublicKey::derive_address +/// `Ed25519PublicKey::derive_address` for an example. /// /// ## Relationship to ObjectIds /// -/// [`ObjectId`]s and [`Address`]es share the same 32-byte addressable space but +/// `ObjectId`s and `Address`es share the same 32-byte addressable space but /// are derived leveraging different domain-separator values to ensure that, /// cryptographically, there won't be any overlap, e.g. there can't be a /// valid `Object` who's `ObjectId` is equal to that of the `Address` of a user /// account. /// -/// [`ObjectId`]: iota_types::ObjectId -/// /// # BCS /// /// An `Address`'s BCS serialized form is defined by the following: diff --git a/crates/iota-sdk-ffi/src/types/crypto/multisig.rs b/crates/iota-sdk-ffi/src/types/crypto/multisig.rs index 98d42e159..6343aed95 100644 --- a/crates/iota-sdk-ffi/src/types/crypto/multisig.rs +++ b/crates/iota-sdk-ffi/src/types/crypto/multisig.rs @@ -222,7 +222,7 @@ impl MultisigMemberPublicKey { /// ; roaring bitmaps /// ``` /// -/// See [here](https://github.com/RoaringBitmap/RoaringFormatSpec) for the specification for the +/// See for the specification for the /// serialized format of RoaringBitmaps. #[derive(derive_more::From, uniffi::Object)] pub struct MultisigAggregatedSignature(pub iota_types::MultisigAggregatedSignature); @@ -357,13 +357,10 @@ impl MultisigCommittee { /// `hash(0x03 || threshold || flag_1 || pk_1 || weight_1 /// || ... || flag_n || pk_n || weight_n)`. /// - /// When flag_i is ZkLogin, the pk_i for the [`ZkLoginPublicIdentifier`] + /// When flag_i is ZkLogin, the pk_i for the `ZkLoginPublicIdentifier` /// refers to the same input used when deriving the address using the - /// [`ZkLoginPublicIdentifier::derive_address_padded`] method (using the + /// `ZkLoginPublicIdentifier::derive_address_padded` method (using the /// full 32-byte `address_seed` value). - /// - /// [`ZkLoginPublicIdentifier`]: crate::types::crypto::zklogin::ZkLoginPublicIdentifier - /// [`ZkLoginPublicIdentifier::derive_address_padded`]: crate::types::crypto::zklogin::ZkLoginPublicIdentifier::derive_address_padded pub fn derive_address(&self) -> Address { self.0.derive_address().into() } diff --git a/crates/iota-sdk-ffi/src/types/crypto/passkey.rs b/crates/iota-sdk-ffi/src/types/crypto/passkey.rs index fa4935796..92afc04cc 100644 --- a/crates/iota-sdk-ffi/src/types/crypto/passkey.rs +++ b/crates/iota-sdk-ffi/src/types/crypto/passkey.rs @@ -27,7 +27,7 @@ use crate::{ /// client-data-json = string ; valid json /// ``` /// -/// See [CollectedClientData](https://www.w3.org/TR/webauthn-2/#dictdef-collectedclientdata) for +/// See for /// the required json-schema for the `client-data-json` rule. In addition, IOTA /// currently requires that the `CollectedClientData.type` field is required to /// be `webauthn.get`. @@ -44,15 +44,15 @@ pub struct PasskeyAuthenticator(pub iota_types::PasskeyAuthenticator); impl PasskeyAuthenticator { /// Opaque authenticator data for this passkey signature. /// - /// See [Authenticator Data](https://www.w3.org/TR/webauthn-2/#sctn-authenticator-data) for - /// more information on this field. + /// See + /// for more information on this field. pub fn authenticator_data(&self) -> Vec { self.0.authenticator_data().to_vec() } /// Structured, unparsed, JSON for this passkey signature. /// - /// See [CollectedClientData](https://www.w3.org/TR/webauthn-2/#dictdef-collectedclientdata) + /// See /// for more information on this field. pub fn client_data_json(&self) -> String { self.0.client_data_json().to_owned() diff --git a/crates/iota-sdk-ffi/src/types/crypto/zklogin.rs b/crates/iota-sdk-ffi/src/types/crypto/zklogin.rs index d5796ca66..528413888 100644 --- a/crates/iota-sdk-ffi/src/types/crypto/zklogin.rs +++ b/crates/iota-sdk-ffi/src/types/crypto/zklogin.rs @@ -60,7 +60,7 @@ impl ZkLoginAuthenticator { /// /// A `ZkLoginPublicIdentifier` is the equivalent of a public key for other /// account authenticators, and contains the information required to derive the -/// onchain account [`Address`] for a Zklogin authenticator. +/// onchain account `Address` for a Zklogin authenticator. /// /// ## Note /// @@ -106,8 +106,6 @@ impl ZkLoginAuthenticator { /// ; with any leading zero bytes stripped /// address-seed-unpadded = %x00 / %x01-ff *31(OCTET) /// ``` -/// -/// [`Address`]: crate::Address #[derive(derive_more::From, uniffi::Object)] pub struct ZkLoginPublicIdentifier(pub iota_types::ZkLoginPublicIdentifier); diff --git a/crates/iota-sdk-ffi/src/types/object.rs b/crates/iota-sdk-ffi/src/types/object.rs index 3683586c5..38a6fe42f 100644 --- a/crates/iota-sdk-ffi/src/types/object.rs +++ b/crates/iota-sdk-ffi/src/types/object.rs @@ -23,7 +23,7 @@ use crate::{ /// /// ## Relationship to Address /// -/// [`Address`]es and [`ObjectId`]s share the same 32-byte addressable space but +/// `Address`es and `ObjectId`s share the same 32-byte addressable space but /// are derived leveraging different domain-separator values to ensure, /// cryptographically, that there won't be any overlap, e.g. there can't be a /// valid `Object` whose `ObjectId` is equal to that of the `Address` of a user diff --git a/crates/iota-sdk-ffi/src/types/validator.rs b/crates/iota-sdk-ffi/src/types/validator.rs index 14909c487..494e80141 100644 --- a/crates/iota-sdk-ffi/src/types/validator.rs +++ b/crates/iota-sdk-ffi/src/types/validator.rs @@ -137,7 +137,7 @@ impl ValidatorSignature { /// ; roaring bitmaps /// ``` /// -/// See [here](https://github.com/RoaringBitmap/RoaringFormatSpec) for the specification for the +/// See for the specification for the /// serialized format of RoaringBitmaps. #[derive(derive_more::From, uniffi::Object)] pub struct ValidatorAggregatedSignature(pub iota_types::ValidatorAggregatedSignature); diff --git a/crates/iota-transaction-builder/src/builder/mod.rs b/crates/iota-transaction-builder/src/builder/mod.rs index ae1e2b226..7f14851a7 100644 --- a/crates/iota-transaction-builder/src/builder/mod.rs +++ b/crates/iota-transaction-builder/src/builder/mod.rs @@ -328,6 +328,56 @@ impl TransactionBuilder { } /// Transfer objects to a recipient address. + /// + /// # Example + /// + /// ``` + /// # use std::str::FromStr; + /// # use iota_types::{Address, Digest, Transaction, ObjectId, ObjectReference}; + /// # use iota_transaction_builder::{TransactionBuilder, res}; + /// + /// # #[tokio::main(flavor = "current_thread")] + /// # async fn main() -> eyre::Result<()> { + /// + /// let client = iota_graphql_client::Client::new_devnet(); + /// let sender = + /// Address::from_str("0x611830d3641a68f94a690dcc25d1f4b0dac948325ac18f6dd32564371735f32c")?; + /// + /// let mut builder = TransactionBuilder::new(sender).with_client(client); + /// + /// # builder + /// # .split_coins( + /// # ObjectId::from_str( + /// # "0x0b0270ee9d27da0db09651e5f7338dfa32c7ee6441ccefa1f6e305735bcfc7ab", + /// # )?, + /// # [1000u64], + /// # ) + /// # .name(("coin")); + /// + /// builder.transfer_objects( + /// Address::from_str("0x0000a4984bd495d4346fa208ddff4f5d5e5ad48c21dec631ddebc99809f16900")?, + /// ( + /// // ObjectIds can be passed when a client is provided + /// ObjectId::from_str( + /// "0xd04077fe3b6fad13b3d4ed0d535b7ca92afcac8f0f2a0e0925fb9f4f0b30c699", + /// )?, + /// // ObjectReferences are always allowed, though they must be correct + /// ObjectReference { + /// object_id: ObjectId::from_str( + /// "0x8ef4259fa2a3499826fa4b8aebeb1d8e478cf5397d05361c96438940b43d28c9", + /// )?, + /// digest: Digest::from_str("4jJMQScR4z5kK3vchvDEFYTiCkZPEYdvttpi3iTj1gEW")?, + /// version: 435090179, + /// }, + /// // The result of a previous command can also be used + /// res("coin"), + /// ), + /// ); + /// + /// let txn: Transaction = builder.finish().await?; + /// # Ok(()) + /// # } + /// ``` pub fn transfer_objects( &mut self, recipient: Address, @@ -481,6 +531,36 @@ impl TransactionBuilder { impl TransactionBuilder<(), L> { /// Add a gas coin that will be consumed. Optional. + /// + /// # Example + /// + /// ``` + /// # use std::str::FromStr; + /// # use iota_types::{Address, Digest, Transaction, ObjectId, ObjectReference}; + /// # use iota_transaction_builder::{TransactionBuilder, res, unresolved}; + /// + /// let sender = + /// Address::from_str("0x611830d3641a68f94a690dcc25d1f4b0dac948325ac18f6dd32564371735f32c")?; + /// + /// let mut builder = TransactionBuilder::new(sender); + /// + /// let gas_coin = ObjectReference { + /// object_id: ObjectId::from_str( + /// "0x8ef4259fa2a3499826fa4b8aebeb1d8e478cf5397d05361c96438940b43d28c9", + /// )?, + /// digest: Digest::from_str("4jJMQScR4z5kK3vchvDEFYTiCkZPEYdvttpi3iTj1gEW")?, + /// version: 435090179, + /// }; + /// + /// builder + /// .split_coins(unresolved::Argument::Gas, [1000u64]) + /// .gas(gas_coin) + /// .gas_budget(1000000000) + /// .gas_price(100); + /// + /// let txn: Transaction = builder.finish()?; + /// # Result::<_, eyre::Error>::Ok(()) + /// ``` pub fn gas(&mut self, obj_ref: ObjectReference) -> &mut Self { self.set_input( InputKind::Input(iota_types::Input::ImmutableOrOwned(obj_ref)), @@ -559,7 +639,35 @@ impl TransactionBuilder { &self.client } - /// Add a gas coin that will be consumed. Optional. + /// Add a gas coin that will be consumed. If no gas coins are provided, the + /// client will set a default list owned by the sender. + /// + /// # Example + /// + /// ``` + /// # use std::str::FromStr; + /// # use iota_types::{Address, Digest, Transaction, ObjectId, ObjectReference}; + /// # use iota_transaction_builder::{TransactionBuilder, res, unresolved}; + /// + /// # #[tokio::main(flavor = "current_thread")] + /// # async fn main() -> eyre::Result<()> { + /// let client = iota_graphql_client::Client::new_devnet(); + /// let sender = + /// Address::from_str("0x611830d3641a68f94a690dcc25d1f4b0dac948325ac18f6dd32564371735f32c")?; + /// + /// let mut builder = TransactionBuilder::new(sender).with_client(client); + /// + /// let gas_coin = + /// ObjectId::from_str("0xd04077fe3b6fad13b3d4ed0d535b7ca92afcac8f0f2a0e0925fb9f4f0b30c699")?; + /// + /// builder + /// .split_coins(unresolved::Argument::Gas, [1000u64]) + /// .gas(gas_coin); + /// + /// let txn: Transaction = builder.finish().await?; + /// # Ok(()) + /// # } + /// ``` pub fn gas(&mut self, object_id: ObjectId) -> &mut Self { self.set_input(InputKind::ImmutableOrOwned(object_id), true); self diff --git a/crates/iota-transaction-builder/src/builder/ptb_arguments.rs b/crates/iota-transaction-builder/src/builder/ptb_arguments.rs index 1f7cf00bc..787a5f2c4 100644 --- a/crates/iota-transaction-builder/src/builder/ptb_arguments.rs +++ b/crates/iota-transaction-builder/src/builder/ptb_arguments.rs @@ -277,7 +277,7 @@ impl PTBArgument for &Res { if let Some(arg) = ptb.named_results.get(&self.0) { *arg } else { - panic!("no command named `{}` exists", self.0) + panic!("no command result named `{}` exists", self.0) } } } diff --git a/crates/iota-transaction-builder/src/lib.rs b/crates/iota-transaction-builder/src/lib.rs index ef9538569..ae92ee6e3 100644 --- a/crates/iota-transaction-builder/src/lib.rs +++ b/crates/iota-transaction-builder/src/lib.rs @@ -1,7 +1,278 @@ // Copyright 2025 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 -//! Provides tools to simplify usage of the IOTA SDK. +//! # IOTA Transaction Builder +//! +//! This crate contains the [TransactionBuilder], which allows for simple +//! construction of Programmable Transactions which can be executed on the IOTA +//! network. +//! +//! The builder is designed to allow for a lot of flexibility while also +//! reducing the necessary boilerplate code. It uses a type-state pattern to +//! ensure the proper flow through the various functions. It is chainable via +//! mutable references. +//! +//! ## Online vs. Offline Builder +//! +//! The Transaction Builder can be used with or without a +//! [GraphQLClient](iota_graphql_client::Client). When one is provided via the +//! [with_client](TransactionBuilder::with_client) method, the resulting builder +//! will use it to find and validate provided IDs. +//! +//! ### Example with Client Resolution +//! +//! ``` +//! # use std::str::FromStr; +//! use iota_graphql_client::Client; +//! use iota_transaction_builder::TransactionBuilder; +//! use iota_types::{Address, ObjectId, Transaction}; +//! +//! # #[tokio::main(flavor = "current_thread")] +//! # async fn main() -> eyre::Result<()> { +//! +//! let sender = +//! Address::from_str("0x611830d3641a68f94a690dcc25d1f4b0dac948325ac18f6dd32564371735f32c")?; +//! let to_address = +//! Address::from_str("0x0000a4984bd495d4346fa208ddff4f5d5e5ad48c21dec631ddebc99809f16900")?; +//! +//! let mut builder = TransactionBuilder::new(sender).with_client(Client::new_devnet()); +//! +//! let coin = +//! ObjectId::from_str("0x8ef4259fa2a3499826fa4b8aebeb1d8e478cf5397d05361c96438940b43d28c9")?; +//! +//! builder.send_coins([coin], to_address, 50000000000u64); +//! +//! let txn: Transaction = builder.finish().await?; +//! # Ok(()) +//! # } +//! ``` +//! +//! ### Example without Client Resolution +//! +//! ``` +//! # use std::str::FromStr; +//! use iota_transaction_builder::TransactionBuilder; +//! use iota_types::{Address, Digest, ObjectId, ObjectReference, Transaction}; +//! +//! let sender = +//! Address::from_str("0x611830d3641a68f94a690dcc25d1f4b0dac948325ac18f6dd32564371735f32c")?; +//! let to_address = +//! Address::from_str("0x0000a4984bd495d4346fa208ddff4f5d5e5ad48c21dec631ddebc99809f16900")?; +//! +//! let mut builder = TransactionBuilder::new(sender); +//! +//! let coin = ObjectReference { +//! object_id: ObjectId::from_str( +//! "0x8ef4259fa2a3499826fa4b8aebeb1d8e478cf5397d05361c96438940b43d28c9", +//! )?, +//! digest: Digest::from_str("4jJMQScR4z5kK3vchvDEFYTiCkZPEYdvttpi3iTj1gEW")?, +//! version: 435090179, +//! }; +//! let gas_coin = ObjectReference { +//! object_id: ObjectId::from_str( +//! "0xd04077fe3b6fad13b3d4ed0d535b7ca92afcac8f0f2a0e0925fb9f4f0b30c699", +//! )?, +//! digest: Digest::from_str("8ahH5RXFnK1jttQEWTypYX7MRzLuQDEXk7fhMHCyZekX")?, +//! version: 473053810, +//! }; +//! +//! builder +//! .send_coins([coin], to_address, 50000000000u64) +//! .gas(gas_coin) +//! .gas_budget(1000000000) +//! .gas_price(100); +//! +//! let txn: Transaction = builder.finish()?; +//! # Result::<_, eyre::Error>::Ok(()) +//! ``` +//! +//! NOTE: It is possible to provide an [ObjectId](iota_types::ObjectId) to an +//! offline client builder, but this will cause the builder to fail when calling +//! `finish`. +//! +//! ## Methods +//! +//! There are three kinds of methods available: +//! +//! ### Commands +//! +//! Each command method adds one or more commands to the final transaction. Some +//! commands have optional follow-up methods. All command results can be named +//! via [name](TransactionBuilder::name). Naming a command allows them to be +//! used later in the transaction via the [res] method. +//! +//! - [move_call](TransactionBuilder::move_call): Call a move function. +//! - `arguments`: Add arguments to the move call. +//! - `generics`: Add generic types to the move call using types that +//! implement [MoveType](types::MoveType). +//! - `type_tags`: Add generic types directly using the +//! [TypeTag](iota_types::TypeTag). +//! - [send_iota](TransactionBuilder::send_iota): Send IOTA coins to a recipient +//! address. +//! - [send_coins](TransactionBuilder::send_coins): Send coins of any type to a +//! recipient address. +//! - [merge_coins](TransactionBuilder::merge_coins): Merge a list of coins into +//! a single primary coin. +//! - [split_coins](TransactionBuilder::split_coins): Split a coin into coins of +//! various amounts. +//! - [transfer_objects](TransactionBuilder::transfer_objects): Send objects to +//! a recipient address. +//! - [publish](TransactionBuilder::publish): Publish a move package. +//! - `package_id`: Name the package ID returned by the publish call. +//! - [upgrade](TransactionBuilder::upgrade): Upgrade a move package. +//! - [make_move_vec](TransactionBuilder::make_move_vec): Create a move +//! `vector`. +//! +//! ### Metadata +//! +//! These methods set various metadata which may be needed for the execution. +//! +//! - [gas](TransactionBuilder::gas): Add a gas coin to pay for the execution. +//! - [gas_coins](TransactionBuilder::gas_coins): Add gas coins to pay for the +//! execution. +//! - [gas_budget](TransactionBuilder::gas_budget): Set the maximum gas budget +//! to spend. +//! - [gas_price](TransactionBuilder::gas_price): Set the gas price. +//! - [sponsor](TransactionBuilder::sponsor): Set the gas sponsor address. +//! - [gas_station_sponsor](TransactionBuilder::gas_station_sponsor): Set the +//! gas station URL. See [Gas Station](crate#gas-station) for more info. +//! - [expiration](TransactionBuilder::expiration): Set the transaction +//! expiration epoch. +//! +//! ### Other +//! +//! Many other methods exist, either to get data or allow for development on top +//! of the builder. Typically, these methods should not be needed, but they are +//! made available for special circumstances. +//! +//! - [apply_argument](TransactionBuilder::apply_argument) +//! - [apply_arguments](TransactionBuilder::apply_arguments) +//! - [input](TransactionBuilder::input) +//! - [pure_bytes](TransactionBuilder::pure_bytes) +//! - [pure](TransactionBuilder::pure) +//! - [command](TransactionBuilder::command) +//! - [named_command](TransactionBuilder::named_command) +//! +//! ## Finalization and Execution +//! +//! There are several ways to finish the builder. First, the +//! [finish](TransactionBuilder::finish) method can be used to return the +//! resulting [Transaction](iota_types::Transaction), which can be manually +//! serialized, executed, etc. +//! +//! Additionally, when a client is provided, the builder can directly +//! [dry_run](TransactionBuilder::dry_run) or +//! [execute](TransactionBuilder::execute) the transaction. +//! +//! When the transaction is resolved, the builder will try to ensure a valid +//! state by de-duplicating and converting appropriate inputs into references to +//! the gas coin. This means that the same input can be passed multiple times +//! and the final transaction will only contain one instance. However, in some +//! cases an invalid state can still be reached. For instance, if a coin is used +//! both for gas and as part of a group of coins, i.e. when transferring +//! objects, the transaction can not possibly be valid. +//! +//! ### Defaults +//! +//! When a client is provided, the builder can set some values by default. The +//! following are the default behaviors for each metadata value. +//! +//! - Gas: One page of coins owned by the sender. +//! - Gas Budget: A dry run will be used to estimate. +//! - Gas Price: The current reference gas price. +//! +//! ## Gas Station +//! +//! The Transaction Builder supports executing via a +//! [Gas Station](https://github.com/iotaledger/gas-station). To do so, the URL +//! must be provided via +//! [gas_station_sponsor](TransactionBuilder::gas_station_sponsor). Additional +//! configuration can then be provided via +//! [gas_reservation_duration](TransactionBuilder::gas_reservation_duration) and +//! [add_gas_station_header](TransactionBuilder::add_gas_station_header). +//! +//! By default the request will contain the header `Content-Type: +//! application/json` +//! +//! When this data has been set, calling [execute](TransactionBuilder::execute) +//! will request gas from and send the resulting transaction to this endpoint +//! instead of using the GraphQL client. +//! +//! ## Traits and Helpers +//! +//! This crate provides several traits which enable the functionality of the +//! builder. Often, when providing arguments, functions will accept either a +//! single [PTBArgument] or a [PTBArgumentList]. +//! +//! [PTBArgument] is implemented for any type implementing +//! [MoveArg](types::MoveArg) as well as: +//! - [unresolved::Argument]: Arguments returned by various builder functions. +//! Distinct from [iota_types::Argument], which cannot be used. +//! - [Input](iota_types::Input): A resolved input. +//! - [ObjectId](iota_types::ObjectId): An object's ID. Can only be used when a +//! client is provided. This will be assumed immutable or owned. +//! - [ObjectReference](iota_types::ObjectReference): An object's reference. +//! This will be assumed immutable or owned. +//! - [Res](builder::ptb_arguments::Res): A reference to the result of a +//! previous named command, set with [name](TransactionBuilder::name). +//! - [Shared]: Allows specifying shared immutable move objects. +//! - [SharedMut]: Allows specifying shared mutable move objects. +//! - [Receiving]: Allows specifying receiving move objects. +//! +//! [PTBArgumentList] is implemented for collection types, and represents a set +//! of arguments. For move calls, this enables tuples of rust values to +//! represent the parameters defined in the smart contract. For calls like +//! [merge_coins](TransactionBuilder::merge_coins), this can represent a list of +//! coins. +//! +//! [MoveArg](types::MoveArg) represents types that can be serialized and +//! provided to the transaction as pure bytes. +//! +//! [MoveType](types::MoveType) defines the type tag for a rust type, so that it +//! can be used for generic arguments. +//! +//! ### Example +//! +//! The following function is defined in move in `vec_map`: +//! +//! ```ignore +//! public fun from_keys_values(mut keys: vector, mut values: vector): VecMap +//! ``` +//! +//! ```ignore +//! builder +//! .move_call(Address::TWO, "vec_map", "from_keys_values") +//! .generics::<(Address, u64)>() +//! .arguments((vec![address1, address2], vec![10000000u64, 20000000u64])); +//! ``` +//! +//! ### Custom Type +//! +//! In order to use a custom type, implement [MoveType](types::MoveType) and +//! [MoveArg](types::MoveArg). +//! +//! ``` +//! # use std::str::FromStr; +//! # use iota_transaction_builder::types::{MoveArg, MoveType, PureBytes}; +//! # use iota_types::TypeTag; +//! #[derive(serde::Serialize)] +//! struct MyStruct { +//! val1: String, +//! val2: u64, +//! } +//! +//! impl MoveType for MyStruct { +//! fn type_tag() -> TypeTag { +//! TypeTag::from_str("0x0::my_module::MyStruct").unwrap() +//! } +//! } +//! +//! impl MoveArg for MyStruct { +//! fn pure_bytes(self) -> PureBytes { +//! PureBytes(bcs::to_bytes(&self).unwrap()) +//! } +//! } +//! ``` #![warn(missing_docs)] #![deny(unreachable_pub)]