DynamicField
Dynamic fields are heterogenous fields that can be added or removed from an object at runtime. Their names are arbitrary Move values that have copy
, drop
, and store
.
There are two sub-types of dynamic fields:
- Dynamic fields can store any value that has
store
. Objects stored in this kind of field will be considered wrapped (not accessible via its ID by external tools like explorers, wallets, etc. accessing storage). - Dynamic object fields can only store objects (values that have the
key
ability, and anid: UID
as its first field) that havestore
, but they will still be directly accessible off-chain via their ID after being attached as a field.
type DynamicField implements IAddressable, IObject, IMoveObject {
address: SuiAddress!
balance(
coinType: String!
): Balance
balances(
first: Int
after: String
last: Int
before: String
): BalanceConnection
contents: MoveValue
digest: String!
dynamicField(
name: DynamicFieldName!
): DynamicField
dynamicFields(
first: Int
after: String
last: Int
before: String
): DynamicFieldConnection
dynamicObjectField(
name: DynamicFieldName!
): DynamicField
moveObjectBcs: Base64
multiGetBalances(
keys: [String!]!
): [Balance!]
multiGetDynamicFields(
keys: [DynamicFieldName!]!
): [DynamicField]!
multiGetDynamicObjectFields(
keys: [DynamicFieldName!]!
): [DynamicField]!
name: MoveValue
objectAt(
version: UInt53
rootVersion: UInt53
checkpoint: UInt53
): Object
objectBcs: Base64
objectVersionsAfter(
first: Int
after: String
last: Int
before: String
filter: VersionFilter
): ObjectConnection!
objectVersionsBefore(
first: Int
after: String
last: Int
before: String
filter: VersionFilter
): ObjectConnection!
objects(
first: Int
after: String
last: Int
before: String
filter: ObjectFilter
): MoveObjectConnection
owner: Owner
previousTransaction: Transaction
storageRebate: BigInt
value: DynamicFieldValue
version: UInt53!
}
Fields
DynamicField.address
● SuiAddress!
non-null scalar
The DynamicField's ID.
DynamicField.balance
● Balance
object
Fetch the total balance for coins with marker type coinType
(e.g. 0x2::sui::SUI
), owned by this address.
If the address does not own any coins of that type, a balance of zero is returned.
DynamicField.balance.coinType
● String!
non-null scalar
DynamicField.balances
● BalanceConnection
object
Total balance across coins owned by this address, grouped by coin type.
DynamicField.balances.first
● Int
scalar
DynamicField.balances.after
● String
scalar
DynamicField.balances.last
● Int
scalar
DynamicField.balances.before
● String
scalar
DynamicField.contents
● MoveValue
object
The structured representation of the object's contents.
DynamicField.digest
● String!
non-null scalar
32-byte hash that identifies the object's contents, encoded in Base58.
DynamicField.dynamicField
● DynamicField
object
Access a dynamic field on an object using its type and BCS-encoded name.
DynamicField.dynamicField.name
● DynamicFieldName!
non-null input
DynamicField.dynamicFields
● DynamicFieldConnection
object
Dynamic fields owned by this object.
Dynamic fields on wrapped objects can be accessed using Address.dynamicFields
.
DynamicField.dynamicFields.first
● Int
scalar
DynamicField.dynamicFields.after
● String
scalar
DynamicField.dynamicFields.last
● Int
scalar
DynamicField.dynamicFields.before
● String
scalar
DynamicField.dynamicObjectField
● DynamicField
object
Access a dynamic object field on an object using its type and BCS-encoded name.
DynamicField.dynamicObjectField.name
● DynamicFieldName!
non-null input
DynamicField.moveObjectBcs
● Base64
scalar
The Base64-encoded BCS serialize of this object, as a MoveObject
.
DynamicField.multiGetBalances
● [Balance!]
list object
Fetch the total balances keyed by coin types (e.g. 0x2::sui::SUI
) owned by this address.
If the address does not own any coins of a given type, a balance of zero is returned for that type.
DynamicField.multiGetBalances.keys
● [String!]!
non-null scalar
DynamicField.multiGetDynamicFields
● [DynamicField]!
non-null object
Access dynamic fields on an object using their types and BCS-encoded names.
Returns a list of dynamic fields that is guaranteed to be the same length as keys
. If a dynamic field in keys
could not be found in the store, its corresponding entry in the result will be null
.
DynamicField.multiGetDynamicFields.keys
● [DynamicFieldName!]!
non-null input
DynamicField.multiGetDynamicObjectFields
● [DynamicField]!
non-null object
Access dynamic object fields on an object using their types and BCS-encoded names.
Returns a list of dynamic object fields that is guaranteed to be the same length as keys
. If a dynamic object field in keys
could not be found in the store, its corresponding entry in the result will be null
.
DynamicField.multiGetDynamicObjectFields.keys
● [DynamicFieldName!]!
non-null input
DynamicField.name
● MoveValue
object
The dynamic field's name, as a Move value.
DynamicField.objectAt
● Object
object
Fetch the object with the same ID, at a different version, root version bound, or checkpoint.
DynamicField.objectAt.version
● UInt53
scalar
DynamicField.objectAt.rootVersion
● UInt53
scalar
DynamicField.objectAt.checkpoint
● UInt53
scalar
DynamicField.objectBcs
● Base64
scalar
The Base64-encoded BCS serialization of this object, as an Object
.
DynamicField.objectVersionsAfter
● ObjectConnection!
non-null object
Paginate all versions of this object after this one.
DynamicField.objectVersionsAfter.first
● Int
scalar
DynamicField.objectVersionsAfter.after
● String
scalar
DynamicField.objectVersionsAfter.last
● Int
scalar
DynamicField.objectVersionsAfter.before
● String
scalar
DynamicField.objectVersionsAfter.filter
● VersionFilter
input
DynamicField.objectVersionsBefore
● ObjectConnection!
non-null object
Paginate all versions of this object before this one.
DynamicField.objectVersionsBefore.first
● Int
scalar
DynamicField.objectVersionsBefore.after
● String
scalar
DynamicField.objectVersionsBefore.last
● Int
scalar
DynamicField.objectVersionsBefore.before
● String
scalar
DynamicField.objectVersionsBefore.filter
● VersionFilter
input
DynamicField.objects
● MoveObjectConnection
object
Objects owned by this object, optionally filtered by type.
DynamicField.objects.first
● Int
scalar
DynamicField.objects.after
● String
scalar
DynamicField.objects.last
● Int
scalar
DynamicField.objects.before
● String
scalar
DynamicField.objects.filter
● ObjectFilter
input
DynamicField.owner
● Owner
union
The object's owner kind.
DynamicField.previousTransaction
● Transaction
object
The transaction that created this version of the object.
DynamicField.storageRebate
● BigInt
scalar
The SUI returned to the sponsor or sender of the transaction that modifies or deletes this object.
DynamicField.value
● DynamicFieldValue
union
The dynamic field's value, as a Move value for dynamic fields and as a MoveObject for dynamic object fields.
DynamicField.version
● UInt53!
non-null scalar
The version of this object that this content comes from.
Interfaces
IAddressable
interface
Interface implemented by GraphQL types representing entities that are identified by an address.
An address uniquely represents either the public key of an account, or an object's ID, but never both. It is not possible to determine which type an address represents up-front. If an object is wrapped, its contents will not be accessible via its address, but it will still be possible to access other objects it owns.
IObject
interface
Interface implemented by versioned on-chain values that are addressable by an ID (also referred to as its address). This includes Move objects and packages.
IMoveObject
interface
Interface implemented by types that represent a Move object on-chain (A Move value whose type has key
).
Member Of
Address
object ● DynamicField
object ● DynamicFieldConnection
object ● DynamicFieldEdge
object ● IMoveObject
interface ● MoveObject
object