@mysten/sui
Version:
Sui TypeScript API
848 lines (847 loc) • 18.8 kB
JavaScript
//#region src/graphql/generated/queries.ts
/** The execution status of this transaction: success or failure. */
let ExecutionStatus = /* @__PURE__ */ function(ExecutionStatus$1) {
/** The transaction could not be executed. */
ExecutionStatus$1["Failure"] = "FAILURE";
/** The transaction was successfully executed. */
ExecutionStatus$1["Success"] = "SUCCESS";
return ExecutionStatus$1;
}({});
/** An enum that specifies the intent scope to be used to parse the bytes for signature verification. */
let ZkLoginIntentScope = /* @__PURE__ */ function(ZkLoginIntentScope$1) {
/** Indicates that the bytes are to be parsed as a personal message. */
ZkLoginIntentScope$1["PersonalMessage"] = "PERSONAL_MESSAGE";
/** Indicates that the bytes are to be parsed as transaction data bytes. */
ZkLoginIntentScope$1["TransactionData"] = "TRANSACTION_DATA";
return ZkLoginIntentScope$1;
}({});
var TypedDocumentString = class extends String {
constructor(value, __meta__) {
super(value);
this.value = value;
this.__meta__ = __meta__;
}
toString() {
return this.value;
}
};
const Object_Owner_FieldsFragmentDoc = new TypedDocumentString(`
fragment OBJECT_OWNER_FIELDS on Owner {
__typename
... on AddressOwner {
address {
address
}
}
... on ObjectOwner {
address {
address
}
}
... on Shared {
initialSharedVersion
}
... on ConsensusAddressOwner {
startVersion
address {
address
}
}
}
`, { "fragmentName": "OBJECT_OWNER_FIELDS" });
const Object_FieldsFragmentDoc = new TypedDocumentString(`
fragment OBJECT_FIELDS on Object {
address
digest
version
objectBcs @include(if: $includeObjectBcs)
asMoveObject {
contents {
bcs @include(if: $includeContent)
json @include(if: $includeJson)
display @include(if: $includeDisplay) {
output
errors
}
type {
repr
}
}
}
asMovePackage {
__typename
}
owner {
...OBJECT_OWNER_FIELDS
}
previousTransaction @include(if: $includePreviousTransaction) {
digest
}
}
fragment OBJECT_OWNER_FIELDS on Owner {
__typename
... on AddressOwner {
address {
address
}
}
... on ObjectOwner {
address {
address
}
}
... on Shared {
initialSharedVersion
}
... on ConsensusAddressOwner {
startVersion
address {
address
}
}
}`, { "fragmentName": "OBJECT_FIELDS" });
const Move_Object_FieldsFragmentDoc = new TypedDocumentString(`
fragment MOVE_OBJECT_FIELDS on MoveObject {
address
digest
version
objectBcs @include(if: $includeObjectBcs)
contents {
bcs @include(if: $includeContent)
json @include(if: $includeJson)
display @include(if: $includeDisplay) {
output
errors
}
type {
repr
}
}
owner {
...OBJECT_OWNER_FIELDS
}
previousTransaction @include(if: $includePreviousTransaction) {
digest
}
}
fragment OBJECT_OWNER_FIELDS on Owner {
__typename
... on AddressOwner {
address {
address
}
}
... on ObjectOwner {
address {
address
}
}
... on Shared {
initialSharedVersion
}
... on ConsensusAddressOwner {
startVersion
address {
address
}
}
}`, { "fragmentName": "MOVE_OBJECT_FIELDS" });
const Transaction_FieldsFragmentDoc = new TypedDocumentString(`
fragment TRANSACTION_FIELDS on Transaction {
digest
transactionJson @include(if: $includeTransaction)
transactionBcs @include(if: $includeBcs)
signatures {
signatureBytes
}
effects {
status
executionError {
message
abortCode
identifier
constant
sourceLineNumber
instructionOffset
module {
name
package {
address
}
}
function {
name
}
}
epoch {
epochId
}
effectsBcs @include(if: $includeEffects)
effectsJson @include(if: $includeObjectTypes)
objectChanges(first: 50) @include(if: $includeObjectTypes) {
nodes {
address
outputState {
asMoveObject {
contents {
type {
repr
}
}
}
}
}
}
balanceChangesJson @include(if: $includeBalanceChanges)
events(first: 50) @include(if: $includeEvents) {
pageInfo {
hasNextPage
}
nodes {
transactionModule {
package {
address
}
name
}
sender {
address
}
contents {
type {
repr
}
bcs
json
}
}
}
}
}
`, { "fragmentName": "TRANSACTION_FIELDS" });
const GetAllBalancesDocument = new TypedDocumentString(`
query getAllBalances($owner: SuiAddress!, $limit: Int, $cursor: String) {
address(address: $owner) {
balances(first: $limit, after: $cursor) {
pageInfo {
hasNextPage
endCursor
}
nodes {
coinType {
repr
}
totalBalance
addressBalance
}
}
}
}
`);
const GetBalanceDocument = new TypedDocumentString(`
query getBalance($owner: SuiAddress!, $coinType: String = "0x2::sui::SUI") {
address(address: $owner) {
balance(coinType: $coinType) {
coinType {
repr
}
totalBalance
addressBalance
}
}
}
`);
const GetChainIdentifierDocument = new TypedDocumentString(`
query getChainIdentifier {
checkpoint(sequenceNumber: 0) {
digest
}
}
`);
const GetCoinMetadataDocument = new TypedDocumentString(`
query getCoinMetadata($coinType: String!) {
coinMetadata(coinType: $coinType) {
address
decimals
name
symbol
description
iconUrl
}
}
`);
const GetCoinsDocument = new TypedDocumentString(`
query getCoins($owner: SuiAddress!, $first: Int, $cursor: String, $type: String = "0x2::coin::Coin<0x2::sui::SUI>") {
address(address: $owner) {
address
objects(first: $first, after: $cursor, filter: {type: $type}) {
pageInfo {
hasNextPage
endCursor
}
nodes {
owner {
...OBJECT_OWNER_FIELDS
}
contents {
json
type {
repr
}
}
address
version
digest
}
}
}
}
fragment OBJECT_OWNER_FIELDS on Owner {
__typename
... on AddressOwner {
address {
address
}
}
... on ObjectOwner {
address {
address
}
}
... on Shared {
initialSharedVersion
}
... on ConsensusAddressOwner {
startVersion
address {
address
}
}
}`);
const GetCurrentSystemStateDocument = new TypedDocumentString(`
query getCurrentSystemState {
epoch {
epochId
referenceGasPrice
startTimestamp
protocolConfigs {
protocolVersion
}
systemState {
json
}
}
}
`);
const GetDynamicFieldsDocument = new TypedDocumentString(`
query getDynamicFields($parentId: SuiAddress!, $first: Int, $cursor: String, $includeValue: Boolean = false) {
address(address: $parentId) {
dynamicFields(first: $first, after: $cursor) {
pageInfo {
hasNextPage
endCursor
}
nodes {
name {
bcs
type {
repr
}
}
value {
__typename
... on MoveValue {
bcs @include(if: $includeValue)
type {
repr
}
}
... on MoveObject {
address
contents {
bcs @include(if: $includeValue)
type {
repr
}
}
}
}
}
}
}
}
`);
const GetMoveFunctionDocument = new TypedDocumentString(`
query getMoveFunction($package: SuiAddress!, $module: String!, $function: String!) {
package(address: $package) {
module(name: $module) {
function(name: $function) {
name
visibility
isEntry
typeParameters {
constraints
}
parameters {
signature
}
return {
signature
}
}
}
}
}
`);
const GetProtocolConfigDocument = new TypedDocumentString(`
query getProtocolConfig {
epoch {
protocolConfigs {
protocolVersion
featureFlags {
key
value
}
configs {
key
value
}
}
}
}
`);
const GetReferenceGasPriceDocument = new TypedDocumentString(`
query getReferenceGasPrice {
epoch {
referenceGasPrice
}
}
`);
const DefaultSuinsNameDocument = new TypedDocumentString(`
query defaultSuinsName($address: SuiAddress!) {
address(address: $address) {
defaultNameRecord {
domain
}
}
}
`);
const GetOwnedObjectsDocument = new TypedDocumentString(`
query getOwnedObjects($owner: SuiAddress!, $limit: Int, $cursor: String, $filter: ObjectFilter, $includeContent: Boolean = false, $includePreviousTransaction: Boolean = false, $includeObjectBcs: Boolean = false, $includeJson: Boolean = false, $includeDisplay: Boolean = false) {
address(address: $owner) {
objects(first: $limit, after: $cursor, filter: $filter) {
pageInfo {
hasNextPage
endCursor
}
nodes {
...MOVE_OBJECT_FIELDS
}
}
}
}
fragment MOVE_OBJECT_FIELDS on MoveObject {
address
digest
version
objectBcs @include(if: $includeObjectBcs)
contents {
bcs @include(if: $includeContent)
json @include(if: $includeJson)
display @include(if: $includeDisplay) {
output
errors
}
type {
repr
}
}
owner {
...OBJECT_OWNER_FIELDS
}
previousTransaction @include(if: $includePreviousTransaction) {
digest
}
}
fragment OBJECT_OWNER_FIELDS on Owner {
__typename
... on AddressOwner {
address {
address
}
}
... on ObjectOwner {
address {
address
}
}
... on Shared {
initialSharedVersion
}
... on ConsensusAddressOwner {
startVersion
address {
address
}
}
}`);
const MultiGetObjectsDocument = new TypedDocumentString(`
query multiGetObjects($objectKeys: [ObjectKey!]!, $includeContent: Boolean = false, $includePreviousTransaction: Boolean = false, $includeObjectBcs: Boolean = false, $includeJson: Boolean = false, $includeDisplay: Boolean = false) {
multiGetObjects(keys: $objectKeys) {
...OBJECT_FIELDS
}
}
fragment OBJECT_FIELDS on Object {
address
digest
version
objectBcs @include(if: $includeObjectBcs)
asMoveObject {
contents {
bcs @include(if: $includeContent)
json @include(if: $includeJson)
display @include(if: $includeDisplay) {
output
errors
}
type {
repr
}
}
}
asMovePackage {
__typename
}
owner {
...OBJECT_OWNER_FIELDS
}
previousTransaction @include(if: $includePreviousTransaction) {
digest
}
}
fragment OBJECT_OWNER_FIELDS on Owner {
__typename
... on AddressOwner {
address {
address
}
}
... on ObjectOwner {
address {
address
}
}
... on Shared {
initialSharedVersion
}
... on ConsensusAddressOwner {
startVersion
address {
address
}
}
}`);
const SimulateTransactionDocument = new TypedDocumentString(`
query simulateTransaction($transaction: JSON!, $includeTransaction: Boolean = false, $includeEffects: Boolean = false, $includeEvents: Boolean = false, $includeBalanceChanges: Boolean = false, $includeObjectTypes: Boolean = false, $includeCommandResults: Boolean = false, $includeBcs: Boolean = false, $doGasSelection: Boolean = false, $checksEnabled: Boolean = true) {
simulateTransaction(
transaction: $transaction
doGasSelection: $doGasSelection
checksEnabled: $checksEnabled
) {
effects {
transaction {
...TRANSACTION_FIELDS
}
}
outputs @include(if: $includeCommandResults) {
returnValues {
value {
bcs
}
}
mutatedReferences {
value {
bcs
}
}
}
}
}
fragment TRANSACTION_FIELDS on Transaction {
digest
transactionJson @include(if: $includeTransaction)
transactionBcs @include(if: $includeBcs)
signatures {
signatureBytes
}
effects {
status
executionError {
message
abortCode
identifier
constant
sourceLineNumber
instructionOffset
module {
name
package {
address
}
}
function {
name
}
}
epoch {
epochId
}
effectsBcs @include(if: $includeEffects)
effectsJson @include(if: $includeObjectTypes)
objectChanges(first: 50) @include(if: $includeObjectTypes) {
nodes {
address
outputState {
asMoveObject {
contents {
type {
repr
}
}
}
}
}
}
balanceChangesJson @include(if: $includeBalanceChanges)
events(first: 50) @include(if: $includeEvents) {
pageInfo {
hasNextPage
}
nodes {
transactionModule {
package {
address
}
name
}
sender {
address
}
contents {
type {
repr
}
bcs
json
}
}
}
}
}`);
const ExecuteTransactionDocument = new TypedDocumentString(`
mutation executeTransaction($transactionDataBcs: Base64!, $signatures: [Base64!]!, $includeTransaction: Boolean = false, $includeEffects: Boolean = false, $includeEvents: Boolean = false, $includeBalanceChanges: Boolean = false, $includeObjectTypes: Boolean = false, $includeBcs: Boolean = false) {
executeTransaction(
transactionDataBcs: $transactionDataBcs
signatures: $signatures
) {
effects {
transaction {
...TRANSACTION_FIELDS
}
}
}
}
fragment TRANSACTION_FIELDS on Transaction {
digest
transactionJson @include(if: $includeTransaction)
transactionBcs @include(if: $includeBcs)
signatures {
signatureBytes
}
effects {
status
executionError {
message
abortCode
identifier
constant
sourceLineNumber
instructionOffset
module {
name
package {
address
}
}
function {
name
}
}
epoch {
epochId
}
effectsBcs @include(if: $includeEffects)
effectsJson @include(if: $includeObjectTypes)
objectChanges(first: 50) @include(if: $includeObjectTypes) {
nodes {
address
outputState {
asMoveObject {
contents {
type {
repr
}
}
}
}
}
}
balanceChangesJson @include(if: $includeBalanceChanges)
events(first: 50) @include(if: $includeEvents) {
pageInfo {
hasNextPage
}
nodes {
transactionModule {
package {
address
}
name
}
sender {
address
}
contents {
type {
repr
}
bcs
json
}
}
}
}
}`);
const GetTransactionBlockDocument = new TypedDocumentString(`
query getTransactionBlock($digest: String!, $includeTransaction: Boolean = false, $includeEffects: Boolean = false, $includeEvents: Boolean = false, $includeBalanceChanges: Boolean = false, $includeObjectTypes: Boolean = false, $includeBcs: Boolean = false) {
transaction(digest: $digest) {
...TRANSACTION_FIELDS
}
}
fragment TRANSACTION_FIELDS on Transaction {
digest
transactionJson @include(if: $includeTransaction)
transactionBcs @include(if: $includeBcs)
signatures {
signatureBytes
}
effects {
status
executionError {
message
abortCode
identifier
constant
sourceLineNumber
instructionOffset
module {
name
package {
address
}
}
function {
name
}
}
epoch {
epochId
}
effectsBcs @include(if: $includeEffects)
effectsJson @include(if: $includeObjectTypes)
objectChanges(first: 50) @include(if: $includeObjectTypes) {
nodes {
address
outputState {
asMoveObject {
contents {
type {
repr
}
}
}
}
}
}
balanceChangesJson @include(if: $includeBalanceChanges)
events(first: 50) @include(if: $includeEvents) {
pageInfo {
hasNextPage
}
nodes {
transactionModule {
package {
address
}
name
}
sender {
address
}
contents {
type {
repr
}
bcs
json
}
}
}
}
}`);
const ResolveTransactionDocument = new TypedDocumentString(`
query resolveTransaction($transaction: JSON!, $doGasSelection: Boolean = true) {
simulateTransaction(transaction: $transaction, doGasSelection: $doGasSelection) {
effects {
transaction {
transactionBcs
effects {
status
executionError {
message
abortCode
identifier
constant
sourceLineNumber
instructionOffset
module {
name
package {
address
}
}
function {
name
}
}
}
}
}
}
}
`);
const VerifyZkLoginSignatureDocument = new TypedDocumentString(`
query verifyZkLoginSignature($bytes: Base64!, $signature: Base64!, $intentScope: ZkLoginIntentScope!, $author: SuiAddress!) {
verifyZkLoginSignature(
bytes: $bytes
signature: $signature
intentScope: $intentScope
author: $author
) {
success
}
}
`);
//#endregion
export { DefaultSuinsNameDocument, ExecuteTransactionDocument, ExecutionStatus, GetAllBalancesDocument, GetBalanceDocument, GetChainIdentifierDocument, GetCoinMetadataDocument, GetCoinsDocument, GetCurrentSystemStateDocument, GetDynamicFieldsDocument, GetMoveFunctionDocument, GetOwnedObjectsDocument, GetProtocolConfigDocument, GetReferenceGasPriceDocument, GetTransactionBlockDocument, MultiGetObjectsDocument, ResolveTransactionDocument, SimulateTransactionDocument, VerifyZkLoginSignatureDocument, ZkLoginIntentScope };
//# sourceMappingURL=queries.mjs.map