@aptos-labs/js-pro 0.1.0-beta.2 → 0.1.0-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/dist/client.d.ts +2 -3
- package/dist/client.d.ts.map +1 -1
- package/dist/index.js +32 -31
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +28 -27
- package/dist/index.mjs.map +1 -1
- package/dist/operations/generated/operations.d.ts +2 -0
- package/dist/operations/generated/operations.d.ts.map +1 -1
- package/dist/operations/generated/sdk.d.ts.map +1 -1
- package/dist/queries/fetchEvents.d.ts +7 -0
- package/dist/queries/fetchEvents.d.ts.map +1 -0
- package/dist/queries/index.d.ts +1 -0
- package/dist/queries/index.d.ts.map +1 -1
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/transactions.d.ts +1 -0
- package/dist/types/transactions.d.ts.map +1 -1
- package/dist/utils/explorer.d.ts +2 -1
- package/dist/utils/explorer.d.ts.map +1 -1
- package/dist/utils/normalize.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/client.ts +5 -2
- package/src/operations/generated/operations.ts +2 -2
- package/src/operations/generated/sdk.ts +1 -0
- package/src/operations/schemas/account.gql +1 -0
- package/src/queries/fetchEvents.ts +23 -0
- package/src/queries/index.ts +1 -0
- package/src/types/index.ts +2 -0
- package/src/types/transactions.ts +1 -0
- package/src/utils/explorer.ts +3 -1
- package/src/utils/normalize.ts +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @aptos-labs/js-pro
|
|
2
2
|
|
|
3
|
+
## 0.1.0-beta.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 7ebca81: Fix explorer url to accept pathname
|
|
8
|
+
- 364ad41: Add `useEvents` hook
|
|
9
|
+
|
|
10
|
+
## 0.1.0-beta.3
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- f57c51a: `useAccountTransactions` will now provide the entryFunction
|
|
15
|
+
|
|
3
16
|
## 0.1.0-beta.2
|
|
4
17
|
|
|
5
18
|
## 0.1.0-beta.1
|
package/dist/client.d.ts
CHANGED
|
@@ -3,10 +3,8 @@ import { Aptos, AptosSettings } from "@aptos-labs/ts-sdk";
|
|
|
3
3
|
import { GraphQLClient } from "graphql-request";
|
|
4
4
|
import { Sdk } from "./operations/index.js";
|
|
5
5
|
import { AccountInfo, NetworkInfo, SignerClient } from "./types/index.js";
|
|
6
|
-
import { getClients, fetchAccountCoins, fetchAptBalance, fetchBalance, fetchProcessorStatus, fetchAddressFromName, fetchNameFromAddress, fetchEstimatedGasPrice, fetchTransaction, fetchResources, fetchResourceType, fetchTokenData, fetchFungibleAssetMetadata, fetchAccountCollections, fetchViewModule, fetchLedgerInfo } from "./queries/index.js";
|
|
6
|
+
import { getClients, fetchAccountCoins, fetchAptBalance, fetchBalance, fetchProcessorStatus, fetchAddressFromName, fetchNameFromAddress, fetchEstimatedGasPrice, fetchTransaction, fetchResources, fetchResourceType, fetchTokenData, fetchFungibleAssetMetadata, fetchAccountCollections, fetchViewModule, fetchLedgerInfo, fetchEvents, fetchAccountTransactions, fetchAccountTokens } from "./queries/index.js";
|
|
7
7
|
import { buildTransaction, signAndSubmitTransaction, signTransaction, simulateTransaction, submitTransaction, waitForTransaction } from "./mutations/index.js";
|
|
8
|
-
import { fetchAccountTokens } from "./queries/fetchAccountTokens.js";
|
|
9
|
-
import { fetchAccountTransactions } from "./queries/fetchAccountTransactions.js";
|
|
10
8
|
type IndexerClientOptions = ConstructorParameters<typeof GraphQLClient>[1];
|
|
11
9
|
export type ClientConfigs = {
|
|
12
10
|
/**
|
|
@@ -122,6 +120,7 @@ export declare class AptosJSProClient {
|
|
|
122
120
|
fetchBalance: typeof fetchBalance;
|
|
123
121
|
fetchEstimatedGasPrice: typeof fetchEstimatedGasPrice;
|
|
124
122
|
fetchViewModule: typeof fetchViewModule;
|
|
123
|
+
fetchEvents: typeof fetchEvents;
|
|
125
124
|
submitTransaction: typeof submitTransaction;
|
|
126
125
|
waitForTransaction: typeof waitForTransaction;
|
|
127
126
|
simulateTransaction: typeof simulateTransaction;
|
package/dist/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAIA,OAAO,EAAuB,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAChE,OAAO,EACL,KAAK,EAGL,aAAa,EAEd,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,GAAG,EAAuB,MAAM,uBAAuB,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAC1E,OAAO,EACL,UAAU,EACV,iBAAiB,EACjB,eAAe,EACf,YAAY,EACZ,oBAAoB,EACpB,oBAAoB,EACpB,oBAAoB,EACpB,sBAAsB,EACtB,gBAAgB,EAChB,cAAc,EACd,iBAAiB,EACjB,cAAc,EACd,0BAA0B,EAC1B,uBAAuB,EACvB,eAAe,EACf,eAAe,
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAIA,OAAO,EAAuB,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAChE,OAAO,EACL,KAAK,EAGL,aAAa,EAEd,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,GAAG,EAAuB,MAAM,uBAAuB,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAC1E,OAAO,EACL,UAAU,EACV,iBAAiB,EACjB,eAAe,EACf,YAAY,EACZ,oBAAoB,EACpB,oBAAoB,EACpB,oBAAoB,EACpB,sBAAsB,EACtB,gBAAgB,EAChB,cAAc,EACd,iBAAiB,EACjB,cAAc,EACd,0BAA0B,EAC1B,uBAAuB,EACvB,eAAe,EACf,eAAe,EACf,WAAW,EACX,wBAAwB,EACxB,kBAAkB,EACnB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,gBAAgB,EAChB,wBAAwB,EACxB,eAAe,EACf,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,EACnB,MAAM,sBAAsB,CAAC;AAE9B,KAAK,oBAAoB,GAAG,qBAAqB,CAAC,OAAO,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC;AAE3E,MAAM,MAAM,aAAa,GAAG;IAC1B;;;;;;;;;;OAUG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,KAAK,CAAC,EAAE;QAAE,MAAM,EAAE,aAAa,CAAA;KAAE,CAAC;IAClC,aAAa,CAAC,EAAE;QAAE,OAAO,EAAE,oBAAoB,CAAA;KAAE,CAAC;IAClD;;;;;OAKG;IACH,UAAU,CAAC,EAAE,MAAM,MAAM,CAAC;CAC3B,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG;IACvC,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,MAAM,CAAC,EAAE,aAAa,CAAC;IACvB,OAAO,EAAE,WAAW,CAAC;IACrB,MAAM,CAAC,EAAE,YAAY,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,MAAM,CAAC,EAAE,aAAa,CAAC;IACvB,OAAO,EAAE,WAAW,CAAC;IACrB,MAAM,CAAC,EAAE,YAAY,CAAC;CACvB,CAAC;AAEF,qBAAa,gBAAgB;;gBAUf,MAAM,EAAE,0BAA0B;IAkB9C,IAAI,KAAK,0BAER;IAED,IAAI,KAAK;;;;;;;;MAER;IAED,IAAI,MAAM,gEAET;IAED,IAAI,OAAO,4BAEV;IAED,IAAI,OAAO,gBAEV;IAED,IAAI,KAAK,UAER;IAED,IAAI,OAAO;;;;;;;;;;;;;;;;kBAEV;IAED,aAAa,eAAuD;IAEpE,aAAa,aAAwC;IAErD,UAAU,GAAI,SAAS,WAAW,GAAG,SAAS,UAE5C;IAEF,UAAU,GAAI,SAAS,WAAW,UAGhC;IAEF,SAAS,GAAI,QAAQ,YAAY,GAAG,SAAS,UAE3C;IAEF,SAAS,GAAI,QAAQ,aAAa,UAGhC;IAEF,eAAe,GAAI,UAAU,CAAC,OAAO,CAAC,EAAE,WAAW,KAAK,IAAI,gBAIxD;IAEJ,eAAe,GAAI,UAAU,CAAC,OAAO,EAAE,WAAW,KAAK,IAAI,gBAIvD;IAEJ,cAAc,GAAI,UAAU,CAAC,MAAM,CAAC,EAAE,YAAY,KAAK,IAAI,gBAIvD;IAEJ,cAAc,GAAI,UAAU,CAAC,MAAM,CAAC,EAAE,aAAa,KAAK,IAAI,gBAIxD;IAEJ,QAAQ,GAAI,UAAU,CAAC,KAAK,EAAE,qBAAqB,KAAK,IAAI,gBACR;IAEpD,mBAAmB,GACjB,UAAS,WAAgC,KACxC,aAAa,CAYd;IAEF;;;;OAIG;IACH,WAAW,GACT,eAAe,aAAa,EAC5B,UAAS,WAAgC,WAyBzC;IAEF,aAAa,GACX,eAAe,aAAa,EAC5B,UAAS,WAAgC,KACxC,GAAG,GAAG,SAAS,CAoBhB;IAEF,OAAO,CAAC,cAAc,CAGpB;IAIF,UAAU,oBAAc;IAExB,wBAAwB,kCAA4B;IAEpD,uBAAuB,iCAA2B;IAElD,iBAAiB,2BAAqB;IAEtC,kBAAkB,4BAAsB;IAExC,gBAAgB,0BAAoB;IAEpC,cAAc,wBAAkB;IAEhC,iBAAiB,2BAAqB;IAEtC,oBAAoB,8BAAwB;IAE5C,cAAc,wBAAkB;IAEhC,0BAA0B,oCAA8B;IAExD,eAAe,yBAAmB;IAElC,oBAAoB,8BAAwB;IAE5C,oBAAoB,8BAAwB;IAE5C,eAAe,yBAAmB;IAElC,YAAY,sBAAgB;IAE5B,sBAAsB,gCAA0B;IAEhD,eAAe,yBAAmB;IAElC,WAAW,qBAAe;IAI1B,iBAAiB,2BAAqB;IAEtC,kBAAkB,4BAAsB;IAExC,mBAAmB,6BAAuB;IAE1C,eAAe,yBAAmB;IAElC,wBAAwB,kCAA4B;IAEpD,gBAAgB,0BAAoB;CACrC"}
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var $=Object.defineProperty;var
|
|
1
|
+
"use strict";var $=Object.defineProperty;var Ye=Object.getOwnPropertyDescriptor;var ta=Object.getOwnPropertyNames;var ea=Object.prototype.hasOwnProperty;var It=t=>{throw TypeError(t)};var aa=(t,a)=>{for(var e in a)$(t,e,{get:a[e],enumerable:!0})},ra=(t,a,e,r)=>{if(a&&typeof a=="object"||typeof a=="function")for(let n of ta(a))!ea.call(t,n)&&n!==e&&$(t,n,{get:()=>a[n],enumerable:!(r=Ye(a,n))||r.enumerable});return t};var na=t=>ra($({},"__esModule",{value:!0}),t);var St=(t,a,e)=>a.has(t)||It("Cannot "+e);var M=(t,a,e)=>(St(t,a,"read from private field"),e?e.call(t):a.get(t)),f=(t,a,e)=>a.has(t)?It("Cannot add the same private member more than once"):a instanceof WeakSet?a.add(t):a.set(t,e),B=(t,a,e,r)=>(St(t,a,"write to private field"),r?r.call(t,e):a.set(t,e),e);var Da={};aa(Da,{Account_Transactions_Select_Column:()=>kt,Address_Events_Summary_Select_Column:()=>Ct,Address_Version_From_Events_Select_Column:()=>Ot,Address_Version_From_Move_Resources_Select_Column:()=>ht,AptosBaseError:()=>C,AptosJSProClient:()=>Mt,AptosName:()=>E,Block_Metadata_Transactions_Select_Column:()=>ft,Coin_Activities_Select_Column:()=>Tt,Coin_Activities_Select_Column_Coin_Activities_Aggregate_Bool_Exp_Bool_And_Arguments_Columns:()=>Et,Coin_Activities_Select_Column_Coin_Activities_Aggregate_Bool_Exp_Bool_Or_Arguments_Columns:()=>Ft,Coin_Balances_Select_Column:()=>wt,Coin_Infos_Select_Column:()=>Vt,Coin_Supply_Select_Column:()=>Pt,Collection_Datas_Select_Column:()=>Rt,Current_Ans_Lookup_Select_Column:()=>Dt,Current_Ans_Lookup_V2_Select_Column:()=>Nt,Current_Aptos_Names_Select_Column:()=>qt,Current_Aptos_Names_Select_Column_Current_Aptos_Names_Aggregate_Bool_Exp_Bool_And_Arguments_Columns:()=>Qt,Current_Aptos_Names_Select_Column_Current_Aptos_Names_Aggregate_Bool_Exp_Bool_Or_Arguments_Columns:()=>Lt,Current_Coin_Balances_Select_Column:()=>$t,Current_Collection_Datas_Select_Column:()=>Gt,Current_Collection_Ownership_V2_View_Select_Column:()=>zt,Current_Collections_V2_Select_Column:()=>jt,Current_Delegated_Staking_Pool_Balances_Select_Column:()=>Ut,Current_Delegated_Voter_Select_Column:()=>Jt,Current_Delegator_Balances_Select_Column:()=>Ht,Current_Fungible_Asset_Balances_Select_Column:()=>Wt,Current_Objects_Select_Column:()=>Kt,Current_Staking_Pool_Voter_Select_Column:()=>Xt,Current_Table_Items_Select_Column:()=>Zt,Current_Token_Datas_Select_Column:()=>Yt,Current_Token_Datas_V2_Select_Column:()=>te,Current_Token_Ownerships_Select_Column:()=>ee,Current_Token_Ownerships_V2_Select_Column:()=>ae,Current_Token_Ownerships_V2_Select_Column_Current_Token_Ownerships_V2_Aggregate_Bool_Exp_Bool_And_Arguments_Columns:()=>re,Current_Token_Ownerships_V2_Select_Column_Current_Token_Ownerships_V2_Aggregate_Bool_Exp_Bool_Or_Arguments_Columns:()=>ne,Current_Token_Pending_Claims_Select_Column:()=>_e,Current_Token_Royalty_V1_Select_Column:()=>oe,Cursor_Ordering:()=>se,Delegated_Staking_Activities_Select_Column:()=>ie,Delegated_Staking_Pool_Balances_Select_Column:()=>pe,Delegated_Staking_Pools_Select_Column:()=>ue,Delegator_Distinct_Pool_Select_Column:()=>ye,Events_Select_Column:()=>ce,Fungible_Asset_Activities_Select_Column:()=>le,Fungible_Asset_Metadata_Select_Column:()=>de,IndexerNotInitializedError:()=>x,Indexer_Status_Select_Column:()=>be,Ledger_Infos_Select_Column:()=>me,Move_Resources_Select_Column:()=>ge,Nft_Metadata_Crawler_Parsed_Asset_Uris_Select_Column:()=>Me,Num_Active_Delegator_Per_Pool_Select_Column:()=>Ie,Order_By:()=>N,Processor_Status_Select_Column:()=>Se,Proposal_Votes_Select_Column:()=>ve,SenderNotFoundError:()=>D,Signatures_Select_Column:()=>Ae,SignerNotFoundError:()=>T,Table_Items_Select_Column:()=>xe,Table_Metadatas_Select_Column:()=>Be,Token_Activities_Select_Column:()=>ke,Token_Activities_V2_Select_Column:()=>Ce,Token_Activities_V2_Select_Column_Token_Activities_V2_Aggregate_Bool_Exp_Bool_And_Arguments_Columns:()=>Oe,Token_Activities_V2_Select_Column_Token_Activities_V2_Aggregate_Bool_Exp_Bool_Or_Arguments_Columns:()=>he,Token_Datas_Select_Column:()=>fe,Token_Ownerships_Select_Column:()=>Te,Tokens_Select_Column:()=>Ee,User_Transactions_Select_Column:()=>Fe,buildTransaction:()=>ct,convertAptosAccountToAccountInfo:()=>Pa,convertAptosAccountToSigner:()=>Ra,createIndexerClient:()=>z,fetchAccountCoins:()=>J,fetchAccountCollections:()=>ot,fetchAccountTokens:()=>ut,fetchAccountTransactions:()=>pt,fetchAddressFromName:()=>Z,fetchAptBalance:()=>W,fetchBalance:()=>K,fetchEstimatedGasPrice:()=>tt,fetchEvents:()=>yt,fetchFungibleAssetMetadata:()=>it,fetchLedgerInfo:()=>nt,fetchNameFromAddress:()=>Y,fetchProcessorStatus:()=>X,fetchResourceType:()=>at,fetchResources:()=>rt,fetchTokenData:()=>_t,fetchTransaction:()=>et,fetchViewModule:()=>st,formatApt:()=>Va,formatUnits:()=>Ze,getClients:()=>H,getExplorerUrl:()=>Fa,parseApt:()=>wa,parseUnits:()=>Xe,signAndSubmitTransaction:()=>gt,signTransaction:()=>mt,simulateTransaction:()=>bt,submitTransaction:()=>lt,waitForTransaction:()=>dt});module.exports=na(Da);var He=require("zustand/middleware"),We=require("zustand/vanilla"),h=require("@aptos-labs/ts-sdk");var we=require("graphql-request");var b=require("graphql-tag"),vt=b.gql`
|
|
2
2
|
fragment CollectionDataFields on current_collections_v2 {
|
|
3
3
|
uri
|
|
4
4
|
max_supply
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
token_name
|
|
29
29
|
token_uri
|
|
30
30
|
}
|
|
31
|
-
${
|
|
31
|
+
${vt}`,_a=b.gql`
|
|
32
32
|
fragment TokenOwnershipFields on current_token_ownerships_v2 {
|
|
33
33
|
current_token_data {
|
|
34
34
|
...TokenDataFields
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
owner_address
|
|
38
38
|
amount
|
|
39
39
|
}
|
|
40
|
-
${G}`,
|
|
40
|
+
${G}`,oa=b.gql`
|
|
41
41
|
fragment CollectionOwnership on current_collection_ownership_v2_view {
|
|
42
42
|
distinct_tokens
|
|
43
43
|
single_token_uri
|
|
@@ -45,12 +45,12 @@
|
|
|
45
45
|
...CollectionDataFields
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
|
-
${
|
|
48
|
+
${vt}`,sa=b.gql`
|
|
49
49
|
fragment PrimaryAptosName on current_aptos_names {
|
|
50
50
|
domain
|
|
51
51
|
subdomain
|
|
52
52
|
}
|
|
53
|
-
`,
|
|
53
|
+
`,At=b.gql`
|
|
54
54
|
fragment FungibleAssetMetadataFields on fungible_asset_metadata {
|
|
55
55
|
asset_type
|
|
56
56
|
creator_address
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
supply_v2
|
|
64
64
|
maximum_v2
|
|
65
65
|
}
|
|
66
|
-
`,
|
|
66
|
+
`,ia=b.gql`
|
|
67
67
|
fragment FungibleAssetActivity on fungible_asset_activities {
|
|
68
68
|
owner_primary_aptos_name: owner_aptos_names(
|
|
69
69
|
where: {is_primary: {_eq: true}, is_active: {_eq: true}}
|
|
@@ -86,8 +86,8 @@
|
|
|
86
86
|
transaction_timestamp
|
|
87
87
|
transaction_version
|
|
88
88
|
}
|
|
89
|
-
${
|
|
90
|
-
${
|
|
89
|
+
${sa}
|
|
90
|
+
${At}`,pa=b.gql`
|
|
91
91
|
fragment BaseTokenActivity on token_activities_v2 {
|
|
92
92
|
from_address
|
|
93
93
|
to_address
|
|
@@ -97,7 +97,7 @@ ${vt}`,ia=b.gql`
|
|
|
97
97
|
event_account_address
|
|
98
98
|
event_index
|
|
99
99
|
}
|
|
100
|
-
`,
|
|
100
|
+
`,xt=b.gql`
|
|
101
101
|
fragment TokenActivity on token_activities_v2 {
|
|
102
102
|
...BaseTokenActivity
|
|
103
103
|
primary_aptos_name_from: aptos_names_from(
|
|
@@ -120,8 +120,8 @@ ${vt}`,ia=b.gql`
|
|
|
120
120
|
token_amount
|
|
121
121
|
token_data_id
|
|
122
122
|
}
|
|
123
|
-
${
|
|
124
|
-
${G}`,
|
|
123
|
+
${pa}
|
|
124
|
+
${G}`,ua=b.gql`
|
|
125
125
|
fragment DelegatedStakingActivity on delegated_staking_activities {
|
|
126
126
|
amount
|
|
127
127
|
delegator_address
|
|
@@ -130,7 +130,7 @@ ${G}`,pa=b.gql`
|
|
|
130
130
|
pool_address
|
|
131
131
|
transaction_version
|
|
132
132
|
}
|
|
133
|
-
`,
|
|
133
|
+
`,ya=b.gql`
|
|
134
134
|
fragment AccountTransaction on account_transactions {
|
|
135
135
|
account_address
|
|
136
136
|
transaction_version
|
|
@@ -152,11 +152,12 @@ ${G}`,pa=b.gql`
|
|
|
152
152
|
user_transaction {
|
|
153
153
|
sequence_number
|
|
154
154
|
sender
|
|
155
|
+
entry_function_id_str
|
|
155
156
|
}
|
|
156
157
|
}
|
|
157
|
-
${
|
|
158
|
-
${
|
|
159
|
-
${
|
|
158
|
+
${ia}
|
|
159
|
+
${xt}
|
|
160
|
+
${ua}`,ca=b.gql`
|
|
160
161
|
fragment FungibleAssetBalanceFields on current_fungible_asset_balances {
|
|
161
162
|
amount
|
|
162
163
|
amount_v1
|
|
@@ -174,7 +175,7 @@ ${pa}`,ya=b.gql`
|
|
|
174
175
|
...FungibleAssetMetadataFields
|
|
175
176
|
}
|
|
176
177
|
}
|
|
177
|
-
${
|
|
178
|
+
${At}`,la=b.gql`
|
|
178
179
|
query getAccountTokensTotal($address: String!, $where: [current_token_ownerships_v2_bool_exp!]!) {
|
|
179
180
|
current_token_ownerships_v2_aggregate(
|
|
180
181
|
where: {owner_address: {_eq: $address}, amount: {_gt: 0}, _and: $where}
|
|
@@ -184,7 +185,7 @@ ${pa}`,ya=b.gql`
|
|
|
184
185
|
}
|
|
185
186
|
}
|
|
186
187
|
}
|
|
187
|
-
`,
|
|
188
|
+
`,da=b.gql`
|
|
188
189
|
query getAccountTokenOwnerships($address: String!, $offset: Int, $limit: Int, $where: [current_token_ownerships_v2_bool_exp!]!, $order_by: [current_token_ownerships_v2_order_by!]!) {
|
|
189
190
|
current_token_ownerships_v2(
|
|
190
191
|
where: {owner_address: {_eq: $address}, amount: {_gt: 0}, current_token_data: {token_data_id: {_is_null: false}}, _and: $where}
|
|
@@ -195,7 +196,7 @@ ${pa}`,ya=b.gql`
|
|
|
195
196
|
...TokenOwnershipFields
|
|
196
197
|
}
|
|
197
198
|
}
|
|
198
|
-
${
|
|
199
|
+
${_a}`,ba=b.gql`
|
|
199
200
|
query getCurrentTokenData($tokenId: String!, $address: String!) {
|
|
200
201
|
current_token_datas_v2(where: {token_data_id: {_eq: $tokenId}}) {
|
|
201
202
|
token_name
|
|
@@ -236,7 +237,7 @@ ${pa}`,ya=b.gql`
|
|
|
236
237
|
event_index
|
|
237
238
|
}
|
|
238
239
|
}
|
|
239
|
-
`,
|
|
240
|
+
`,ma=b.gql`
|
|
240
241
|
query getAccountCollections($address: String!, $offset: Int, $limit: Int, $where: [current_collection_ownership_v2_view_bool_exp!]!, $order_by: [current_collection_ownership_v2_view_order_by!]!) {
|
|
241
242
|
current_collection_ownership_v2_view(
|
|
242
243
|
where: {owner_address: {_eq: $address}, _and: $where}
|
|
@@ -247,7 +248,7 @@ ${pa}`,ya=b.gql`
|
|
|
247
248
|
...CollectionOwnership
|
|
248
249
|
}
|
|
249
250
|
}
|
|
250
|
-
${
|
|
251
|
+
${oa}`,ga=b.gql`
|
|
251
252
|
query getTokenData($address: String!) {
|
|
252
253
|
current_token_datas_v2(where: {token_data_id: {_eq: $address}}) {
|
|
253
254
|
...TokenDataFields
|
|
@@ -279,7 +280,7 @@ ${pa}`,ya=b.gql`
|
|
|
279
280
|
event_account_address
|
|
280
281
|
}
|
|
281
282
|
}
|
|
282
|
-
${G}`,
|
|
283
|
+
${G}`,Ma=b.gql`
|
|
283
284
|
query getActivitiesAggregate($account_address: String!) {
|
|
284
285
|
address_events_summary(where: {account_address: {_eq: $account_address}}) {
|
|
285
286
|
block_metadata {
|
|
@@ -288,7 +289,7 @@ ${pa}`,ya=b.gql`
|
|
|
288
289
|
num_distinct_versions
|
|
289
290
|
}
|
|
290
291
|
}
|
|
291
|
-
`,
|
|
292
|
+
`,Ia=b.gql`
|
|
292
293
|
query getTokenActivities($tokenId: String!, $offset: Int, $limit: Int) {
|
|
293
294
|
token_activities_v2(
|
|
294
295
|
where: {token_data_id: {_eq: $tokenId}}
|
|
@@ -299,7 +300,7 @@ ${pa}`,ya=b.gql`
|
|
|
299
300
|
...TokenActivity
|
|
300
301
|
}
|
|
301
302
|
}
|
|
302
|
-
${
|
|
303
|
+
${xt}`,Sa=b.gql`
|
|
303
304
|
query getTokenAcquisitionActivity($address: String!, $tokenId: String!) {
|
|
304
305
|
token_activities_v2(
|
|
305
306
|
where: {token_data_id: {_eq: $tokenId}, to_address: {_eq: $address}}
|
|
@@ -308,7 +309,7 @@ ${pa}`,ya=b.gql`
|
|
|
308
309
|
transaction_timestamp
|
|
309
310
|
}
|
|
310
311
|
}
|
|
311
|
-
`,
|
|
312
|
+
`,va=b.gql`
|
|
312
313
|
query getAccountTransactions($address: String!, $limit: Int, $offset: Int, $where: [account_transactions_bool_exp!]!, $fungible_asset_activities_where: [fungible_asset_activities_bool_exp!]!, $token_activities_v2_where: [token_activities_v2_bool_exp!]!, $order_by: [account_transactions_order_by!]!, $fungible_asset_activities_order_by: [fungible_asset_activities_order_by!]!, $token_activities_v2_order_by: [token_activities_v2_order_by!]!) {
|
|
313
314
|
account_transactions(
|
|
314
315
|
limit: $limit
|
|
@@ -319,7 +320,7 @@ ${pa}`,ya=b.gql`
|
|
|
319
320
|
...AccountTransaction
|
|
320
321
|
}
|
|
321
322
|
}
|
|
322
|
-
${
|
|
323
|
+
${ya}`,Aa=b.gql`
|
|
323
324
|
query getFungibleAssetMetadata($type: String!) {
|
|
324
325
|
fungible_asset_metadata(where: {asset_type: {_eq: $type}}) {
|
|
325
326
|
asset_type
|
|
@@ -328,7 +329,7 @@ ${pa}`,ya=b.gql`
|
|
|
328
329
|
symbol
|
|
329
330
|
}
|
|
330
331
|
}
|
|
331
|
-
`,
|
|
332
|
+
`,xa=b.gql`
|
|
332
333
|
query getFungibleAssetBalances($where: current_fungible_asset_balances_bool_exp, $order_by: [current_fungible_asset_balances_order_by!], $offset: Int, $limit: Int) {
|
|
333
334
|
current_fungible_asset_balances(
|
|
334
335
|
where: $where
|
|
@@ -339,7 +340,7 @@ ${pa}`,ya=b.gql`
|
|
|
339
340
|
...FungibleAssetBalanceFields
|
|
340
341
|
}
|
|
341
342
|
}
|
|
342
|
-
${
|
|
343
|
+
${ca}`,Ba=b.gql`
|
|
343
344
|
query getDelegatedStakingRoyalties($address: String!, $pool: String) {
|
|
344
345
|
delegated_staking_activities(
|
|
345
346
|
where: {delegator_address: {_eq: $address}, pool_address: {_eq: $pool}}
|
|
@@ -353,7 +354,7 @@ ${pa}`,ya=b.gql`
|
|
|
353
354
|
transaction_version
|
|
354
355
|
}
|
|
355
356
|
}
|
|
356
|
-
`,
|
|
357
|
+
`,ka=b.gql`
|
|
357
358
|
query getDelegatedStaking($address: String!) {
|
|
358
359
|
delegator_distinct_pool(where: {delegator_address: {_eq: $address}}) {
|
|
359
360
|
delegator_address
|
|
@@ -369,7 +370,7 @@ ${pa}`,ya=b.gql`
|
|
|
369
370
|
}
|
|
370
371
|
}
|
|
371
372
|
}
|
|
372
|
-
`,
|
|
373
|
+
`,Ca=b.gql`
|
|
373
374
|
query getDelegationPools {
|
|
374
375
|
delegated_staking_pools {
|
|
375
376
|
staking_pool_address
|
|
@@ -378,7 +379,7 @@ ${pa}`,ya=b.gql`
|
|
|
378
379
|
}
|
|
379
380
|
}
|
|
380
381
|
}
|
|
381
|
-
`,
|
|
382
|
+
`,Oa=b.gql`
|
|
382
383
|
query getNumberOfDelegators($poolAddress: String) {
|
|
383
384
|
num_active_delegator_per_pool(
|
|
384
385
|
where: {pool_address: {_eq: $poolAddress}, num_active_delegator: {_gt: "0"}}
|
|
@@ -387,5 +388,5 @@ ${pa}`,ya=b.gql`
|
|
|
387
388
|
num_active_delegator
|
|
388
389
|
}
|
|
389
390
|
}
|
|
390
|
-
`,Oa=(t,a,e,r)=>t();function xt(t,a=Oa){return{getAccountTokensTotal(e,r){return a(n=>t.request(ca,e,{...r,...n}),"getAccountTokensTotal","query",e)},getAccountTokenOwnerships(e,r){return a(n=>t.request(la,e,{...r,...n}),"getAccountTokenOwnerships","query",e)},getCurrentTokenData(e,r){return a(n=>t.request(da,e,{...r,...n}),"getCurrentTokenData","query",e)},getAccountCollections(e,r){return a(n=>t.request(ba,e,{...r,...n}),"getAccountCollections","query",e)},getTokenData(e,r){return a(n=>t.request(ma,e,{...r,...n}),"getTokenData","query",e)},getActivitiesAggregate(e,r){return a(n=>t.request(ga,e,{...r,...n}),"getActivitiesAggregate","query",e)},getTokenActivities(e,r){return a(n=>t.request(Ma,e,{...r,...n}),"getTokenActivities","query",e)},getTokenAcquisitionActivity(e,r){return a(n=>t.request(Ia,e,{...r,...n}),"getTokenAcquisitionActivity","query",e)},getAccountTransactions(e,r){return a(n=>t.request(Sa,e,{...r,...n}),"getAccountTransactions","query",e)},getFungibleAssetMetadata(e,r){return a(n=>t.request(va,e,{...r,...n}),"getFungibleAssetMetadata","query",e)},getFungibleAssetBalances(e,r){return a(n=>t.request(Aa,e,{...r,...n}),"getFungibleAssetBalances","query",e)},getDelegatedStakingRoyalties(e,r){return a(n=>t.request(xa,e,{...r,...n}),"getDelegatedStakingRoyalties","query",e)},getDelegatedStaking(e,r){return a(n=>t.request(Ba,e,{...r,...n}),"getDelegatedStaking","query",e)},getDelegationPools(e,r){return a(n=>t.request(ka,e,{...r,...n}),"getDelegationPools","query",e)},getNumberOfDelegators(e,r){return a(n=>t.request(Ca,e,{...r,...n}),"getNumberOfDelegators","query",e)}}}var Bt=(e=>(e.AccountAddress="account_address",e.TransactionVersion="transaction_version",e))(Bt||{}),kt=(r=>(r.AccountAddress="account_address",r.MinBlockHeight="min_block_height",r.NumDistinctVersions="num_distinct_versions",r))(kt||{}),Ct=(e=>(e.AccountAddress="account_address",e.TransactionVersion="transaction_version",e))(Ct||{}),Ot=(e=>(e.Address="address",e.TransactionVersion="transaction_version",e))(Ot||{}),ht=(p=>(p.BlockHeight="block_height",p.Epoch="epoch",p.FailedProposerIndices="failed_proposer_indices",p.Id="id",p.PreviousBlockVotesBitvec="previous_block_votes_bitvec",p.Proposer="proposer",p.Round="round",p.Timestamp="timestamp",p.Version="version",p))(ht||{}),ft=(s=>(s.ActivityType="activity_type",s.Amount="amount",s.BlockHeight="block_height",s.CoinType="coin_type",s.EntryFunctionIdStr="entry_function_id_str",s.EventAccountAddress="event_account_address",s.EventCreationNumber="event_creation_number",s.EventIndex="event_index",s.EventSequenceNumber="event_sequence_number",s.IsGasFee="is_gas_fee",s.IsTransactionSuccess="is_transaction_success",s.OwnerAddress="owner_address",s.StorageRefundAmount="storage_refund_amount",s.TransactionTimestamp="transaction_timestamp",s.TransactionVersion="transaction_version",s))(ft||{}),Tt=(e=>(e.IsGasFee="is_gas_fee",e.IsTransactionSuccess="is_transaction_success",e))(Tt||{}),Et=(e=>(e.IsGasFee="is_gas_fee",e.IsTransactionSuccess="is_transaction_success",e))(Et||{}),Ft=(o=>(o.Amount="amount",o.CoinType="coin_type",o.CoinTypeHash="coin_type_hash",o.OwnerAddress="owner_address",o.TransactionTimestamp="transaction_timestamp",o.TransactionVersion="transaction_version",o))(Ft||{}),wt=(g=>(g.CoinType="coin_type",g.CoinTypeHash="coin_type_hash",g.CreatorAddress="creator_address",g.Decimals="decimals",g.Name="name",g.SupplyAggregatorTableHandle="supply_aggregator_table_handle",g.SupplyAggregatorTableKey="supply_aggregator_table_key",g.Symbol="symbol",g.TransactionCreatedTimestamp="transaction_created_timestamp",g.TransactionVersionCreated="transaction_version_created",g))(wt||{}),Vt=(o=>(o.CoinType="coin_type",o.CoinTypeHash="coin_type_hash",o.Supply="supply",o.TransactionEpoch="transaction_epoch",o.TransactionTimestamp="transaction_timestamp",o.TransactionVersion="transaction_version",o))(Vt||{}),Pt=(i=>(i.CollectionDataIdHash="collection_data_id_hash",i.CollectionName="collection_name",i.CreatorAddress="creator_address",i.Description="description",i.DescriptionMutable="description_mutable",i.Maximum="maximum",i.MaximumMutable="maximum_mutable",i.MetadataUri="metadata_uri",i.Supply="supply",i.TableHandle="table_handle",i.TransactionTimestamp="transaction_timestamp",i.TransactionVersion="transaction_version",i.UriMutable="uri_mutable",i))(Pt||{}),Dt=(_=>(_.Domain="domain",_.ExpirationTimestamp="expiration_timestamp",_.IsDeleted="is_deleted",_.LastTransactionVersion="last_transaction_version",_.RegisteredAddress="registered_address",_.Subdomain="subdomain",_.TokenName="token_name",_))(Dt||{}),Rt=(c=>(c.Domain="domain",c.ExpirationTimestamp="expiration_timestamp",c.IsDeleted="is_deleted",c.LastTransactionVersion="last_transaction_version",c.RegisteredAddress="registered_address",c.Subdomain="subdomain",c.TokenName="token_name",c.TokenStandard="token_standard",c))(Rt||{}),Nt=(i=>(i.Domain="domain",i.DomainExpirationTimestamp="domain_expiration_timestamp",i.DomainWithSuffix="domain_with_suffix",i.ExpirationTimestamp="expiration_timestamp",i.IsActive="is_active",i.IsPrimary="is_primary",i.LastTransactionVersion="last_transaction_version",i.OwnerAddress="owner_address",i.RegisteredAddress="registered_address",i.Subdomain="subdomain",i.SubdomainExpirationPolicy="subdomain_expiration_policy",i.TokenName="token_name",i.TokenStandard="token_standard",i))(Nt||{}),qt=(e=>(e.IsActive="is_active",e.IsPrimary="is_primary",e))(qt||{}),Qt=(e=>(e.IsActive="is_active",e.IsPrimary="is_primary",e))(Qt||{}),Lt=(o=>(o.Amount="amount",o.CoinType="coin_type",o.CoinTypeHash="coin_type_hash",o.LastTransactionTimestamp="last_transaction_timestamp",o.LastTransactionVersion="last_transaction_version",o.OwnerAddress="owner_address",o))(Lt||{}),$t=(i=>(i.CollectionDataIdHash="collection_data_id_hash",i.CollectionName="collection_name",i.CreatorAddress="creator_address",i.Description="description",i.DescriptionMutable="description_mutable",i.LastTransactionTimestamp="last_transaction_timestamp",i.LastTransactionVersion="last_transaction_version",i.Maximum="maximum",i.MaximumMutable="maximum_mutable",i.MetadataUri="metadata_uri",i.Supply="supply",i.TableHandle="table_handle",i.UriMutable="uri_mutable",i))($t||{}),Gt=(c=>(c.CollectionId="collection_id",c.CollectionName="collection_name",c.CollectionUri="collection_uri",c.CreatorAddress="creator_address",c.DistinctTokens="distinct_tokens",c.LastTransactionVersion="last_transaction_version",c.OwnerAddress="owner_address",c.SingleTokenUri="single_token_uri",c))(Gt||{}),zt=(s=>(s.CollectionId="collection_id",s.CollectionName="collection_name",s.CollectionProperties="collection_properties",s.CreatorAddress="creator_address",s.CurrentSupply="current_supply",s.Description="description",s.LastTransactionTimestamp="last_transaction_timestamp",s.LastTransactionVersion="last_transaction_version",s.MaxSupply="max_supply",s.MutableDescription="mutable_description",s.MutableUri="mutable_uri",s.TableHandleV1="table_handle_v1",s.TokenStandard="token_standard",s.TotalMintedV2="total_minted_v2",s.Uri="uri",s))(zt||{}),jt=(_=>(_.ActiveTableHandle="active_table_handle",_.InactiveTableHandle="inactive_table_handle",_.LastTransactionVersion="last_transaction_version",_.OperatorCommissionPercentage="operator_commission_percentage",_.StakingPoolAddress="staking_pool_address",_.TotalCoins="total_coins",_.TotalShares="total_shares",_))(jt||{}),Ut=(_=>(_.DelegationPoolAddress="delegation_pool_address",_.DelegatorAddress="delegator_address",_.LastTransactionTimestamp="last_transaction_timestamp",_.LastTransactionVersion="last_transaction_version",_.PendingVoter="pending_voter",_.TableHandle="table_handle",_.Voter="voter",_))(Ut||{}),Jt=(_=>(_.DelegatorAddress="delegator_address",_.LastTransactionVersion="last_transaction_version",_.ParentTableHandle="parent_table_handle",_.PoolAddress="pool_address",_.PoolType="pool_type",_.Shares="shares",_.TableHandle="table_handle",_))(Jt||{}),Ht=(S=>(S.Amount="amount",S.AmountV1="amount_v1",S.AmountV2="amount_v2",S.AssetType="asset_type",S.AssetTypeV1="asset_type_v1",S.AssetTypeV2="asset_type_v2",S.IsFrozen="is_frozen",S.IsPrimary="is_primary",S.LastTransactionTimestamp="last_transaction_timestamp",S.LastTransactionTimestampV1="last_transaction_timestamp_v1",S.LastTransactionTimestampV2="last_transaction_timestamp_v2",S.LastTransactionVersion="last_transaction_version",S.LastTransactionVersionV1="last_transaction_version_v1",S.LastTransactionVersionV2="last_transaction_version_v2",S.OwnerAddress="owner_address",S.StorageId="storage_id",S.TokenStandard="token_standard",S))(Ht||{}),Wt=(_=>(_.AllowUngatedTransfer="allow_ungated_transfer",_.IsDeleted="is_deleted",_.LastGuidCreationNum="last_guid_creation_num",_.LastTransactionVersion="last_transaction_version",_.ObjectAddress="object_address",_.OwnerAddress="owner_address",_.StateKeyHash="state_key_hash",_))(Wt||{}),Kt=(n=>(n.LastTransactionVersion="last_transaction_version",n.OperatorAddress="operator_address",n.StakingPoolAddress="staking_pool_address",n.VoterAddress="voter_address",n))(Kt||{}),Xt=(_=>(_.DecodedKey="decoded_key",_.DecodedValue="decoded_value",_.IsDeleted="is_deleted",_.Key="key",_.KeyHash="key_hash",_.LastTransactionVersion="last_transaction_version",_.TableHandle="table_handle",_))(Xt||{}),Zt=(y=>(y.CollectionDataIdHash="collection_data_id_hash",y.CollectionName="collection_name",y.CreatorAddress="creator_address",y.DefaultProperties="default_properties",y.Description="description",y.DescriptionMutable="description_mutable",y.LargestPropertyVersion="largest_property_version",y.LastTransactionTimestamp="last_transaction_timestamp",y.LastTransactionVersion="last_transaction_version",y.Maximum="maximum",y.MaximumMutable="maximum_mutable",y.MetadataUri="metadata_uri",y.Name="name",y.PayeeAddress="payee_address",y.PropertiesMutable="properties_mutable",y.RoyaltyMutable="royalty_mutable",y.RoyaltyPointsDenominator="royalty_points_denominator",y.RoyaltyPointsNumerator="royalty_points_numerator",y.Supply="supply",y.TokenDataIdHash="token_data_id_hash",y.UriMutable="uri_mutable",y))(Zt||{}),Yt=(s=>(s.CollectionId="collection_id",s.Decimals="decimals",s.Description="description",s.IsDeletedV2="is_deleted_v2",s.IsFungibleV2="is_fungible_v2",s.LargestPropertyVersionV1="largest_property_version_v1",s.LastTransactionTimestamp="last_transaction_timestamp",s.LastTransactionVersion="last_transaction_version",s.Maximum="maximum",s.Supply="supply",s.TokenDataId="token_data_id",s.TokenName="token_name",s.TokenProperties="token_properties",s.TokenStandard="token_standard",s.TokenUri="token_uri",s))(Yt||{}),te=(l=>(l.Amount="amount",l.CollectionDataIdHash="collection_data_id_hash",l.CollectionName="collection_name",l.CreatorAddress="creator_address",l.LastTransactionTimestamp="last_transaction_timestamp",l.LastTransactionVersion="last_transaction_version",l.Name="name",l.OwnerAddress="owner_address",l.PropertyVersion="property_version",l.TableType="table_type",l.TokenDataIdHash="token_data_id_hash",l.TokenProperties="token_properties",l))(te||{}),ee=(i=>(i.Amount="amount",i.IsFungibleV2="is_fungible_v2",i.IsSoulboundV2="is_soulbound_v2",i.LastTransactionTimestamp="last_transaction_timestamp",i.LastTransactionVersion="last_transaction_version",i.NonTransferrableByOwner="non_transferrable_by_owner",i.OwnerAddress="owner_address",i.PropertyVersionV1="property_version_v1",i.StorageId="storage_id",i.TableTypeV1="table_type_v1",i.TokenDataId="token_data_id",i.TokenPropertiesMutatedV1="token_properties_mutated_v1",i.TokenStandard="token_standard",i))(ee||{}),ae=(r=>(r.IsFungibleV2="is_fungible_v2",r.IsSoulboundV2="is_soulbound_v2",r.NonTransferrableByOwner="non_transferrable_by_owner",r))(ae||{}),re=(r=>(r.IsFungibleV2="is_fungible_v2",r.IsSoulboundV2="is_soulbound_v2",r.NonTransferrableByOwner="non_transferrable_by_owner",r))(re||{}),ne=(u=>(u.Amount="amount",u.CollectionDataIdHash="collection_data_id_hash",u.CollectionId="collection_id",u.CollectionName="collection_name",u.CreatorAddress="creator_address",u.FromAddress="from_address",u.LastTransactionTimestamp="last_transaction_timestamp",u.LastTransactionVersion="last_transaction_version",u.Name="name",u.PropertyVersion="property_version",u.TableHandle="table_handle",u.ToAddress="to_address",u.TokenDataId="token_data_id",u.TokenDataIdHash="token_data_id_hash",u))(ne||{}),_e=(o=>(o.LastTransactionTimestamp="last_transaction_timestamp",o.LastTransactionVersion="last_transaction_version",o.PayeeAddress="payee_address",o.RoyaltyPointsDenominator="royalty_points_denominator",o.RoyaltyPointsNumerator="royalty_points_numerator",o.TokenDataId="token_data_id",o))(_e||{}),oe=(e=>(e.Asc="ASC",e.Desc="DESC",e))(oe||{}),se=(o=>(o.Amount="amount",o.DelegatorAddress="delegator_address",o.EventIndex="event_index",o.EventType="event_type",o.PoolAddress="pool_address",o.TransactionVersion="transaction_version",o))(se||{}),ie=(_=>(_.ActiveTableHandle="active_table_handle",_.InactiveTableHandle="inactive_table_handle",_.OperatorCommissionPercentage="operator_commission_percentage",_.StakingPoolAddress="staking_pool_address",_.TotalCoins="total_coins",_.TotalShares="total_shares",_.TransactionVersion="transaction_version",_))(ie||{}),pe=(e=>(e.FirstTransactionVersion="first_transaction_version",e.StakingPoolAddress="staking_pool_address",e))(pe||{}),ue=(e=>(e.DelegatorAddress="delegator_address",e.PoolAddress="pool_address",e))(ue||{}),ye=(p=>(p.AccountAddress="account_address",p.CreationNumber="creation_number",p.Data="data",p.EventIndex="event_index",p.IndexedType="indexed_type",p.SequenceNumber="sequence_number",p.TransactionBlockHeight="transaction_block_height",p.TransactionVersion="transaction_version",p.Type="type",p))(ye||{}),ce=(v=>(v.Amount="amount",v.AssetType="asset_type",v.BlockHeight="block_height",v.EntryFunctionIdStr="entry_function_id_str",v.EventIndex="event_index",v.GasFeePayerAddress="gas_fee_payer_address",v.IsFrozen="is_frozen",v.IsGasFee="is_gas_fee",v.IsTransactionSuccess="is_transaction_success",v.OwnerAddress="owner_address",v.StorageId="storage_id",v.StorageRefundAmount="storage_refund_amount",v.TokenStandard="token_standard",v.TransactionTimestamp="transaction_timestamp",v.TransactionVersion="transaction_version",v.Type="type",v))(ce||{}),le=(u=>(u.AssetType="asset_type",u.CreatorAddress="creator_address",u.Decimals="decimals",u.IconUri="icon_uri",u.LastTransactionTimestamp="last_transaction_timestamp",u.LastTransactionVersion="last_transaction_version",u.MaximumV2="maximum_v2",u.Name="name",u.ProjectUri="project_uri",u.SupplyAggregatorTableHandleV1="supply_aggregator_table_handle_v1",u.SupplyAggregatorTableKeyV1="supply_aggregator_table_key_v1",u.SupplyV2="supply_v2",u.Symbol="symbol",u.TokenStandard="token_standard",u))(le||{}),de=(e=>(e.Db="db",e.IsIndexerUp="is_indexer_up",e))(de||{}),be=(a=>(a.ChainId="chain_id",a))(be||{}),me=(e=>(e.Address="address",e.TransactionVersion="transaction_version",e))(me||{}),ge=(p=>(p.AnimationOptimizerRetryCount="animation_optimizer_retry_count",p.AssetUri="asset_uri",p.CdnAnimationUri="cdn_animation_uri",p.CdnImageUri="cdn_image_uri",p.CdnJsonUri="cdn_json_uri",p.ImageOptimizerRetryCount="image_optimizer_retry_count",p.JsonParserRetryCount="json_parser_retry_count",p.RawAnimationUri="raw_animation_uri",p.RawImageUri="raw_image_uri",p))(ge||{}),Me=(e=>(e.NumActiveDelegator="num_active_delegator",e.PoolAddress="pool_address",e))(Me||{}),N=(o=>(o.Asc="asc",o.AscNullsFirst="asc_nulls_first",o.AscNullsLast="asc_nulls_last",o.Desc="desc",o.DescNullsFirst="desc_nulls_first",o.DescNullsLast="desc_nulls_last",o))(N||{}),Ie=(n=>(n.LastSuccessVersion="last_success_version",n.LastTransactionTimestamp="last_transaction_timestamp",n.LastUpdated="last_updated",n.Processor="processor",n))(Ie||{}),Se=(_=>(_.NumVotes="num_votes",_.ProposalId="proposal_id",_.ShouldPass="should_pass",_.StakingPoolAddress="staking_pool_address",_.TransactionTimestamp="transaction_timestamp",_.TransactionVersion="transaction_version",_.VoterAddress="voter_address",_))(Se||{}),ve=(m=>(m.IsSenderPrimary="is_sender_primary",m.MultiAgentIndex="multi_agent_index",m.MultiSigIndex="multi_sig_index",m.PublicKey="public_key",m.PublicKeyIndices="public_key_indices",m.Signature="signature",m.Signer="signer",m.Threshold="threshold",m.TransactionBlockHeight="transaction_block_height",m.TransactionVersion="transaction_version",m.Type="type",m))(ve||{}),Ae=(o=>(o.DecodedKey="decoded_key",o.DecodedValue="decoded_value",o.Key="key",o.TableHandle="table_handle",o.TransactionVersion="transaction_version",o.WriteSetChangeIndex="write_set_change_index",o))(Ae||{}),xe=(r=>(r.Handle="handle",r.KeyType="key_type",r.ValueType="value_type",r))(xe||{}),Be=(I=>(I.CoinAmount="coin_amount",I.CoinType="coin_type",I.CollectionDataIdHash="collection_data_id_hash",I.CollectionName="collection_name",I.CreatorAddress="creator_address",I.EventAccountAddress="event_account_address",I.EventCreationNumber="event_creation_number",I.EventIndex="event_index",I.EventSequenceNumber="event_sequence_number",I.FromAddress="from_address",I.Name="name",I.PropertyVersion="property_version",I.ToAddress="to_address",I.TokenAmount="token_amount",I.TokenDataIdHash="token_data_id_hash",I.TransactionTimestamp="transaction_timestamp",I.TransactionVersion="transaction_version",I.TransferType="transfer_type",I))(Be||{}),ke=(s=>(s.AfterValue="after_value",s.BeforeValue="before_value",s.EntryFunctionIdStr="entry_function_id_str",s.EventAccountAddress="event_account_address",s.EventIndex="event_index",s.FromAddress="from_address",s.IsFungibleV2="is_fungible_v2",s.PropertyVersionV1="property_version_v1",s.ToAddress="to_address",s.TokenAmount="token_amount",s.TokenDataId="token_data_id",s.TokenStandard="token_standard",s.TransactionTimestamp="transaction_timestamp",s.TransactionVersion="transaction_version",s.Type="type",s))(ke||{}),Ce=(a=>(a.IsFungibleV2="is_fungible_v2",a))(Ce||{}),Oe=(a=>(a.IsFungibleV2="is_fungible_v2",a))(Oe||{}),he=(y=>(y.CollectionDataIdHash="collection_data_id_hash",y.CollectionName="collection_name",y.CreatorAddress="creator_address",y.DefaultProperties="default_properties",y.Description="description",y.DescriptionMutable="description_mutable",y.LargestPropertyVersion="largest_property_version",y.Maximum="maximum",y.MaximumMutable="maximum_mutable",y.MetadataUri="metadata_uri",y.Name="name",y.PayeeAddress="payee_address",y.PropertiesMutable="properties_mutable",y.RoyaltyMutable="royalty_mutable",y.RoyaltyPointsDenominator="royalty_points_denominator",y.RoyaltyPointsNumerator="royalty_points_numerator",y.Supply="supply",y.TokenDataIdHash="token_data_id_hash",y.TransactionTimestamp="transaction_timestamp",y.TransactionVersion="transaction_version",y.UriMutable="uri_mutable",y))(he||{}),fe=(l=>(l.Amount="amount",l.CollectionDataIdHash="collection_data_id_hash",l.CollectionName="collection_name",l.CreatorAddress="creator_address",l.Name="name",l.OwnerAddress="owner_address",l.PropertyVersion="property_version",l.TableHandle="table_handle",l.TableType="table_type",l.TokenDataIdHash="token_data_id_hash",l.TransactionTimestamp="transaction_timestamp",l.TransactionVersion="transaction_version",l))(fe||{}),Te=(p=>(p.CollectionDataIdHash="collection_data_id_hash",p.CollectionName="collection_name",p.CreatorAddress="creator_address",p.Name="name",p.PropertyVersion="property_version",p.TokenDataIdHash="token_data_id_hash",p.TokenProperties="token_properties",p.TransactionTimestamp="transaction_timestamp",p.TransactionVersion="transaction_version",p))(Te||{}),Ee=(u=>(u.BlockHeight="block_height",u.EntryFunctionContractAddress="entry_function_contract_address",u.EntryFunctionFunctionName="entry_function_function_name",u.EntryFunctionIdStr="entry_function_id_str",u.EntryFunctionModuleName="entry_function_module_name",u.Epoch="epoch",u.ExpirationTimestampSecs="expiration_timestamp_secs",u.GasUnitPrice="gas_unit_price",u.MaxGasAmount="max_gas_amount",u.ParentSignatureType="parent_signature_type",u.Sender="sender",u.SequenceNumber="sequence_number",u.Timestamp="timestamp",u.Version="version",u))(Ee||{});function z(t,a){let e=new Fe.GraphQLClient(t,a);return xt(e)}var Re=require("@aptos-labs/ts-sdk");var k=async({limit:t,offset:a,queryFn:e})=>{let r=await e({limit:t,offset:a}),{hasNextPage:n,hasPrevPage:d,...o}=r,_=n?a+t:void 0,c=d??a>0?Math.max(a-t,0):void 0;return{nextCursor:_,prevCursor:c,...o}};var C=class extends Error{constructor(e,r){super();this.docsBaseUrl="https://js-pro-docs.vercel.app/";this.name="AptosJSProError";this.shortMessage=e,this.longMessage=r?.longMessage}};var x=class extends C{constructor(){super("The AptosJSProClient was not initialized with an indexer",{longMessage:"The AptosJSProClient was not initialized with an indexer. Please specify an indexer endpoint when setting up custom networks."});this.name="IndexerNotInitializedError"}},T=class extends C{constructor(){super("The AptosJSProClient was not initialized with a signer",{longMessage:"The AptosJSProClient was not initialized with a signer. Please specify a signer when setting up the client."});this.name="SignerNotFoundError"}};var O,F,E=class{constructor(a,e){f(this,O);f(this,F);if(!a)return;let n=[e,a].filter(Boolean).join(".").toLowerCase().replace(/(\.apt)$/,""),d=/^(?:([a-zA-Z0-9-]+)\.)?([a-zA-Z0-9-]+)$/,o=n.match(d);if(!o)return;let[,_,c]=o;B(this,O,c),B(this,F,_)}toString(){return M(this,O)?this.noSuffix().concat(".apt"):""}noSuffix(){return M(this,O)?M(this,F)?`${M(this,F)}.${M(this,O)}`:M(this,O):""}};O=new WeakMap,F=new WeakMap;var we="https://www.aptosnames.com/api";function Ve(t){let a=t.match(/^https:\/\/aptosnames.com\/name\/([^/]+)$/)??t.match(/^https:\/\/aptosnames.com\/api(?:\/[^/]+)?\/v\d+\/metadata\/([^/]+)/);return a?`${we}/v1/metadata/${a[1]}`:t}var j=t=>t.domain?new E(t.domain,t.subdomain):void 0,q=t=>({assetType:t.asset_type,creatorAddress:t.creator_address,decimals:t.decimals,iconUri:t.icon_uri,name:t.name,projectUri:t.project_uri,symbol:t.symbol,tokenStandard:t.token_standard}),Pe=t=>t.map(a=>({amount:a.amount,amountV1:a.amount_v1,amountV2:a.amount_v2,assetType:a.asset_type,assetTypeV1:a.asset_type_v1,assetTypeV2:a.asset_type_v2,isFrozen:a.is_frozen,isPrimary:a.is_primary,lastTransactionTimestamp:a.last_transaction_timestamp,lastTransactionVersion:a.last_transaction_version,metadata:q(a.metadata),ownerAddress:a.owner_address,tokenStandard:a.token_standard})),U=t=>({cdnImageUri:t.cdn_asset_uris?.cdn_image_uri,collectionId:t.collection_id,collectionName:t.collection_name,creatorAddress:t.creator_address,description:t.description,metadataUri:t.uri,name:t.collection_name,supply:t.max_supply});var D=t=>{let a=Ve(t.token_uri);return{cdnImageUri:t.cdn_asset_uris?.cdn_image_uri,collection:t.current_collection?.collection_name??"",collectionData:t.current_collection?U(t.current_collection):void 0,collectionId:t.current_collection?.collection_id??"",creator:t.current_collection?.creator_address??"",description:t.description,isFungibleV2:t.is_fungible_v2??!1,isSoulbound:!1,lastTransactionTimestamp:t.last_transaction_timestamp,lastTransactionVersion:t.last_transaction_version,metadataUri:a,name:t.token_name,tokenId:t.token_data_id,tokenProperties:t.token_properties,tokenStandard:t.token_standard}},Q=t=>({fromAddress:t.from_address,toAddress:t.to_address,transactionTimestamp:t.transaction_timestamp,transactionVersion:t.transaction_version,type:t.type,eventAccountAddress:t.event_account_address,eventIndex:t.event_index}),De=t=>{let a=[],e=[],r=[];return t.fungible_asset_activities.forEach(n=>{!n.asset_type||!n.metadata||a.push(ha({...n,asset_type:n.asset_type,metadata:n.metadata}))}),t.token_activities_v2.forEach(n=>{n.current_token_data&&e.push(fa({...n,current_token_data:n.current_token_data}))}),t.delegated_staking_activities.forEach(n=>r.push(Ta(n))),{accountAddress:t.account_address,transactionVersion:t.transaction_version,fungibleAssetActivities:a,tokenActivities:e,delegatedStakingActivities:r,userTransaction:t.user_transaction?{sequenceNumber:t.user_transaction.sequence_number,sender:t.user_transaction.sender}:void 0}},ha=t=>({ownerAddress:t.owner_address,ownerPrimaryAptosName:t.owner_primary_aptos_name.at(0)?j(t.owner_primary_aptos_name[0]):void 0,amount:t.amount,type:t.type,blockHeight:t.block_height,assetType:t.asset_type,metadata:q(t.metadata),entryFunctionIdStr:t.entry_function_id_str,eventIndex:t.event_index,isGasFee:t.is_gas_fee,gasFeePayerAddress:t.gas_fee_payer_address,isTransactionSuccess:t.is_transaction_success,transactionTimestamp:t.transaction_timestamp,transactionVersion:t.transaction_version}),fa=t=>({...Q(t),primaryAptosNameFrom:t.primary_aptos_name_from.at(0)?j(t.primary_aptos_name_from[0]):void 0,primaryAptosNameTo:t.primary_aptos_name_to.at(0)?j(t.primary_aptos_name_to[0]):void 0,currentTokenData:D(t.current_token_data),propertyVersionV1:t.property_version_v1,tokenAmount:t.token_amount,tokenDataId:t.token_data_id}),Ta=t=>({delegatorAddress:t.delegator_address,eventIndex:t.event_index,eventType:t.event_type,poolAddress:t.pool_address,transactionVersion:t.transaction_version,amount:t.amount});async function J({address:t,network:a,limit:e=100,offset:r=0,orderBy:n,where:d}){let{indexer:o}=this.getClients({network:a});if(!o)throw new x;return k({limit:e,offset:r,queryFn:async({limit:_,offset:c})=>{let p=await o.getFungibleAssetBalances({limit:_,offset:c,order_by:n,where:{_and:[{metadata:{asset_type:{_is_null:!1}},owner_address:{_eq:Re.AccountAddress.from(t).toString()}},d??{}]}}),g=p.current_fungible_asset_balances.filter(m=>m.metadata!==void 0&&m.metadata!==null);return{balances:Pe(g),hasNextPage:p.current_fungible_asset_balances.length===_}}})}function H({network:t}={}){let a=this.aptos,e=this.indexer;return t&&(a=this.createAptos(void 0,t),e=this.createIndexer(void 0,t)),{account:this.account,aptos:a,indexer:e,network:t??this.network,signer:this.signer}}var Ne=require("@aptos-labs/ts-sdk");async function W({address:t,network:a}){let{aptos:e}=this.getClients({network:a}),r=await e.account.getAccountCoinAmount({accountAddress:Ne.AccountAddress.from(t).toString(),coinType:"0x1::aptos_coin::AptosCoin"});return BigInt(r)}var qe=require("@aptos-labs/ts-sdk");async function K({address:t,asset:a,network:e}){let{aptos:r}=this.getClients({network:e}),n=a.includes("::"),d=await r.account.getAccountCoinAmount({accountAddress:qe.AccountAddress.from(t).toString(),coinType:n?a:void 0,faMetadataAddress:n?void 0:a});return BigInt(d)}async function X({network:t,processor:a}){let{aptos:e}=this.getClients({network:t}),r=await e.getProcessorStatus(a);return{lastSuccessVersion:r.last_success_version,lastUpdated:r.last_updated}}var Qe=require("@aptos-labs/ts-sdk");var w=async(t,a)=>{try{return await t()}catch{return a}};async function Z({network:t,name:a}){let{aptos:e}=this.getClients({network:t}),r=await w(()=>e.getTargetAddress({name:a.toString()}),void 0);return r?Qe.AccountAddress.from(r):void 0}var Le=require("@aptos-labs/ts-sdk");async function Y({network:t,address:a}){let{aptos:e}=this.getClients({network:t}),r=await w(()=>e.getPrimaryName({address:Le.AccountAddress.from(a)}),void 0);return r?new E(r):void 0}async function tt({network:t}){let{aptos:a}=this.getClients({network:t}),e=await a.getGasPriceEstimation();return{deprioritizedGasEstimate:e.deprioritized_gas_estimate,gasEstimate:e.gas_estimate,prioritizedGasEstimate:e.prioritized_gas_estimate}}async function et({network:t,...a}){let{aptos:e}=this.getClients({network:t});return"ledgerVersion"in a?e.getTransactionByVersion({ledgerVersion:a.ledgerVersion}):e.getTransactionByHash({transactionHash:a.transactionHash})}var $e=require("@aptos-labs/ts-sdk");async function at({network:t,accountAddress:a,...e}){let{aptos:r}=this.getClients({network:t});return await r.getAccountResource({...e,accountAddress:$e.AccountAddress.from(a).toString(),resourceType:e.resourceType})}async function rt({network:t,...a}){let{aptos:e}=this.getClients({network:t});return await w(()=>e.getAccountResources(a),[])}async function nt({network:t}){let{aptos:a}=this.getClients({network:t}),e=await a.getLedgerInfo();return{chainId:e.chain_id,epoch:e.epoch,ledgerVersion:e.ledger_version,oldestLedgerVersion:e.oldest_ledger_version,ledgerTimestamp:e.ledger_timestamp,nodeRole:e.node_role,oldestBlockHeight:e.oldest_block_height,blockHeight:e.block_height,gitHash:e.git_hash}}async function _t(t){let{indexer:a}=this.getClients({network:t.network});if(!a)throw new x;let e=await a.getTokenData({address:t.address});if(e.current_token_datas_v2.length!==0)return{...D(e.current_token_datas_v2[0]),createdActivity:e.created_activity.at(0)?Q(e.created_activity[0]):void 0,acquiredActivity:e.acquired_activity.at(0)?Q(e.acquired_activity[0]):void 0}}var Ge=require("@aptos-labs/ts-sdk");var R=class extends C{constructor(){super("No sender found");this.name="SenderNotFoundError"}};async function ot({network:t,limit:a=100,offset:e=0,orderBy:r=[],where:n=[],...d}){let{indexer:o}=this.getClients({network:t});if(!o)throw new x;return k({limit:a,offset:e,queryFn:async({limit:_,offset:c})=>{let p=await o.getAccountCollections({limit:_,offset:c,address:Ge.AccountAddress.from(d.address).toString(),where:n,order_by:[{last_transaction_version:"desc",collection_id:"desc"},...Array.isArray(r)?r:[r]]}),g=[];return p.current_collection_ownership_v2_view.forEach(m=>{m.current_collection&&g.push(U(m.current_collection))}),{hasNextPage:p.current_collection_ownership_v2_view.length===_,collections:g}}})}async function st(t){let{aptos:a}=this.getClients({network:t.network});return await a.view(t)}async function it({network:t,...a}){let{aptos:e}=this.getClients({network:t}),r=await e.getFungibleAssetMetadata({options:{where:{asset_type:{_eq:a.asset}}}});return r.at(0)?q(r[0]):void 0}var ze=require("@aptos-labs/ts-sdk");async function pt({network:t,address:a,limit:e=100,offset:r=0,orderBy:n=[],where:d=[],fungibleAssetActivitiesWhere:o=[],tokenActivitiesWhere:_=[],fungibleAssetActivitiesOrderBy:c=[],tokenActivitiesOrderBy:p=[]}){let{indexer:g}=this.getClients({network:t});if(!g)throw new x;return k({limit:e,offset:r,queryFn:async({limit:m,offset:l})=>{let i=await g.getAccountTransactions({address:ze.AccountAddress.from(a).toString(),limit:m,offset:l,order_by:[{transaction_version:"desc"},...Array.isArray(n)?n:[n]],where:d,fungible_asset_activities_where:o,token_activities_v2_where:_,fungible_asset_activities_order_by:c,token_activities_v2_order_by:p});return{hasNextPage:i.account_transactions.length===m,transactions:i.account_transactions.map(De)}}})}var je=require("@aptos-labs/ts-sdk");async function ut({network:t,address:a,collectionId:e,limit:r=100,offset:n=0,orderBy:d=[],where:o=[]}){let{indexer:_}=this.getClients({network:t});if(!_)throw new x;return k({limit:r,offset:n,queryFn:async({limit:c,offset:p})=>{let g=await _.getAccountTokenOwnerships({address:je.AccountAddress.from(a).toString(),limit:c,offset:p,order_by:d,where:[...e?[{current_token_data:{current_collection:{collection_id:{_eq:e}}}}]:[],...Array.isArray(o)?o:[o]]}),m=[];return g.current_token_ownerships_v2.forEach(l=>{!l.current_token_data||!l.current_token_data.current_collection||m.push({...D(l.current_token_data),amount:l.amount,isSoulbound:l.is_soulbound_v2??!1,ownerAddress:l.owner_address})}),{hasNextPage:g.current_token_ownerships_v2.length===c,tokens:m}}})}var Ue=require("@aptos-labs/ts-sdk");async function yt(t){let{network:a,data:e,options:r,sender:n,withFeePayer:d}=t,{account:o,aptos:_}=this.getClients({network:a}),c=n??o?.address;if(!c)throw new R;let p={...r};return p.expireTimestamp??=Math.floor(this.getServerTime()/1e3)+Ue.DEFAULT_TXN_EXP_SEC_FROM_NOW,"secondarySignerAddresses"in t?_.transaction.build.multiAgent({data:e,options:p,secondarySignerAddresses:t.secondarySignerAddresses,sender:c,withFeePayer:d}):_.transaction.build.simple({data:e,options:p,sender:c,withFeePayer:d})}var L=require("@aptos-labs/ts-sdk");async function ct({network:t,transaction:a}){let{aptos:e}=this.getClients({network:t}),{data:r}=await(0,L.postAptosFullNode)({aptosConfig:e.config,body:a,contentType:L.MimeType.BCS_SIGNED_TRANSACTION,originMethod:"submitTransaction",path:"transactions"});return r}async function lt({network:t,...a}){let{aptos:e}=this.getClients({network:t});return await e.waitForTransaction({...a,transactionHash:a.hash})}async function dt(t){let{aptos:a}=this.getClients({network:t.network});return"secondarySignerAddresses"in t?(await a.transaction.simulate.multiAgent(t))[0]:(await a.transaction.simulate.simple(t))[0]}async function bt({network:t,...a}){let{aptos:e,signer:r}=this.getClients({network:t});if(!r)throw new T;return r.signTransaction({aptos:e,transaction:a.transaction,signer:a.signer})}async function mt(t){let{aptos:a,signer:e}=this.getClients({network:t.network});if(!e)throw new T;let r;return"data"in t?r=await this.buildTransaction(t):r=t.transaction,e.signAndSubmitTransaction({aptos:a,transaction:r,signer:t.signer})}var A,V,P,gt=class{constructor(a){f(this,A);f(this,V);f(this,P);this.getServerTime=()=>(this.state.config?.serverTime??Date.now)();this.getServerDate=()=>new Date(this.getServerTime());this.setAccount=a=>{M(this,A).setState({...this.state,account:a},!0)};this.setNetwork=a=>{M(this,A).setState({...this.state,network:a},!0),this.refreshClients()};this.setSigner=a=>{M(this,A).setState({...this.state,signer:a},!0)};this.setConfig=a=>{M(this,A).setState({...this.state,config:a},!0),this.refreshClients()};this.onAccountChange=a=>M(this,A).subscribe(e=>e.account,e=>a(e));this.onNetworkChange=a=>M(this,A).subscribe(e=>e.network,e=>a(e));this.onSignerChange=a=>M(this,A).subscribe(e=>e.signer,e=>a(e));this.onConfigChange=a=>M(this,A).subscribe(e=>e.config,e=>a(e));this.onChange=a=>M(this,A).subscribe(e=>a(e));this.createNetworkConfig=(a=this.state.network)=>a.network===h.Network.CUSTOM?{network:a.network,fullnode:a.nodeUrl,indexer:a.indexerUrl,faucet:a.faucetUrl,prover:a.proverUrl,pepper:a.pepperUrl}:a;this.createAptos=(a,e=this.state.network)=>{let{state:r}=this,n=this.createNetworkConfig(e),d=r.config?.aptos?.config??{},o=new h.AptosConfig({...n,...d,...a,clientConfig:{...d.clientConfig,API_KEY:r.config?.apiKey,...a?.clientConfig}});return new h.Aptos(o)};this.createIndexer=(a,e=this.state.network)=>{let r=this.createAptos(a,e).config.getRequestUrl(h.AptosApiType.INDEXER);if(r===void 0)return;let n=this.state.config?.indexerClient?.options??{},d=this.state?.config?.apiKey?{Authorization:`Bearer ${this.state.config.apiKey}`}:{},o={...n,headers:{...n.headers,...d}};return z(r,o)};this.refreshClients=()=>{B(this,V,this.createAptos()),B(this,P,this.createIndexer())};this.getClients=H;this.fetchAccountTransactions=pt;this.fetchAccountCollections=ot;this.fetchAccountCoins=J;this.fetchAccountTokens=ut;this.fetchTransaction=et;this.fetchResources=rt;this.fetchResourceType=at;this.fetchProcessorStatus=X;this.fetchTokenData=_t;this.fetchFungibleAssetMetadata=it;this.fetchLedgerInfo=nt;this.fetchAddressFromName=Z;this.fetchNameFromAddress=Y;this.fetchAptBalance=W;this.fetchBalance=K;this.fetchEstimatedGasPrice=tt;this.fetchViewModule=st;this.submitTransaction=ct;this.waitForTransaction=lt;this.simulateTransaction=dt;this.signTransaction=bt;this.signAndSubmitTransaction=mt;this.buildTransaction=yt;B(this,A,(0,He.createStore)((0,Je.subscribeWithSelector)(()=>({account:a.account,config:a.config,network:a.network,signer:a.signer})))),B(this,V,this.createAptos()),B(this,P,this.createIndexer())}get state(){return M(this,A).getState()}get store(){return M(this,A)}get signer(){return this.state.signer}get account(){return this.state.account}get network(){return this.state.network}get aptos(){return M(this,V)}get indexer(){return M(this,P)}};A=new WeakMap,V=new WeakMap,P=new WeakMap;var We=require("@aptos-labs/ts-sdk"),Ea=({basePath:t="https://explorer.aptoslabs.com",network:a=We.Network.MAINNET})=>{let e=new URLSearchParams;return e.set("network",a),`${t}/?${e.toString()}`};function Ke(t,a){let[e,r="0"]=t.split("."),n=e.startsWith("-");if(n&&(e=e.slice(1)),r=r.replace(/(0+)$/,""),a===0)Math.round(+`.${r}`)===1&&(e=`${BigInt(e)+BigInt(1)}`),r="";else if(r.length>a){let[d,o,_]=[r.slice(0,a-1),r.slice(a-1,a),r.slice(a)],c=Math.round(+`${o}.${_}`);c>9?r=`${BigInt(d)+BigInt(1)}0`.padStart(d.length+1,"0"):r=`${d}${c}`,r.length>a&&(r=r.slice(1),e=`${BigInt(e)+BigInt(1)}`),r=r.slice(0,a)}else r=r.padEnd(a,"0");return BigInt(`${n?"-":""}${e}${r}`)}var Fa=t=>Ke(t,8),Xe=(t,a)=>{let e=t.toString(),r=e.startsWith("-");r&&(e=e.slice(1)),e=e.padStart(a,"0");let[n,d]=[e.slice(0,e.length-a),e.slice(e.length-a)];return d=d.replace(/(0+)$/,""),`${r?"-":""}${n||"0"}${d?`.${d}`:""}`},wa=t=>Xe(t,8);var Va=t=>t?{address:t.accountAddress,publicKey:t.publicKey}:void 0,Pa=t=>t?{type:"custom",signAndSubmitTransaction:async({aptos:a,signer:e,...r})=>a.signAndSubmitTransaction({signer:e??t,...r}),signTransaction:async({signer:a,transaction:e})=>({rawTransaction:e.rawTransaction.bcsToBytes(),authenticator:(a??t).signTransactionWithAuthenticator(e)})}:void 0;0&&(module.exports={Account_Transactions_Select_Column,Address_Events_Summary_Select_Column,Address_Version_From_Events_Select_Column,Address_Version_From_Move_Resources_Select_Column,AptosBaseError,AptosJSProClient,AptosName,Block_Metadata_Transactions_Select_Column,Coin_Activities_Select_Column,Coin_Activities_Select_Column_Coin_Activities_Aggregate_Bool_Exp_Bool_And_Arguments_Columns,Coin_Activities_Select_Column_Coin_Activities_Aggregate_Bool_Exp_Bool_Or_Arguments_Columns,Coin_Balances_Select_Column,Coin_Infos_Select_Column,Coin_Supply_Select_Column,Collection_Datas_Select_Column,Current_Ans_Lookup_Select_Column,Current_Ans_Lookup_V2_Select_Column,Current_Aptos_Names_Select_Column,Current_Aptos_Names_Select_Column_Current_Aptos_Names_Aggregate_Bool_Exp_Bool_And_Arguments_Columns,Current_Aptos_Names_Select_Column_Current_Aptos_Names_Aggregate_Bool_Exp_Bool_Or_Arguments_Columns,Current_Coin_Balances_Select_Column,Current_Collection_Datas_Select_Column,Current_Collection_Ownership_V2_View_Select_Column,Current_Collections_V2_Select_Column,Current_Delegated_Staking_Pool_Balances_Select_Column,Current_Delegated_Voter_Select_Column,Current_Delegator_Balances_Select_Column,Current_Fungible_Asset_Balances_Select_Column,Current_Objects_Select_Column,Current_Staking_Pool_Voter_Select_Column,Current_Table_Items_Select_Column,Current_Token_Datas_Select_Column,Current_Token_Datas_V2_Select_Column,Current_Token_Ownerships_Select_Column,Current_Token_Ownerships_V2_Select_Column,Current_Token_Ownerships_V2_Select_Column_Current_Token_Ownerships_V2_Aggregate_Bool_Exp_Bool_And_Arguments_Columns,Current_Token_Ownerships_V2_Select_Column_Current_Token_Ownerships_V2_Aggregate_Bool_Exp_Bool_Or_Arguments_Columns,Current_Token_Pending_Claims_Select_Column,Current_Token_Royalty_V1_Select_Column,Cursor_Ordering,Delegated_Staking_Activities_Select_Column,Delegated_Staking_Pool_Balances_Select_Column,Delegated_Staking_Pools_Select_Column,Delegator_Distinct_Pool_Select_Column,Events_Select_Column,Fungible_Asset_Activities_Select_Column,Fungible_Asset_Metadata_Select_Column,IndexerNotInitializedError,Indexer_Status_Select_Column,Ledger_Infos_Select_Column,Move_Resources_Select_Column,Nft_Metadata_Crawler_Parsed_Asset_Uris_Select_Column,Num_Active_Delegator_Per_Pool_Select_Column,Order_By,Processor_Status_Select_Column,Proposal_Votes_Select_Column,SenderNotFoundError,Signatures_Select_Column,SignerNotFoundError,Table_Items_Select_Column,Table_Metadatas_Select_Column,Token_Activities_Select_Column,Token_Activities_V2_Select_Column,Token_Activities_V2_Select_Column_Token_Activities_V2_Aggregate_Bool_Exp_Bool_And_Arguments_Columns,Token_Activities_V2_Select_Column_Token_Activities_V2_Aggregate_Bool_Exp_Bool_Or_Arguments_Columns,Token_Datas_Select_Column,Token_Ownerships_Select_Column,Tokens_Select_Column,User_Transactions_Select_Column,buildTransaction,convertAptosAccountToAccountInfo,convertAptosAccountToSigner,createIndexerClient,fetchAccountCoins,fetchAccountCollections,fetchAccountTokens,fetchAccountTransactions,fetchAddressFromName,fetchAptBalance,fetchBalance,fetchEstimatedGasPrice,fetchFungibleAssetMetadata,fetchLedgerInfo,fetchNameFromAddress,fetchProcessorStatus,fetchResourceType,fetchResources,fetchTokenData,fetchTransaction,fetchViewModule,formatApt,formatUnits,getClients,getExplorerUrl,parseApt,parseUnits,signAndSubmitTransaction,signTransaction,simulateTransaction,submitTransaction,waitForTransaction});
|
|
391
|
+
`,ha=(t,a,e,r)=>t();function Bt(t,a=ha){return{getAccountTokensTotal(e,r){return a(n=>t.request(la,e,{...r,...n}),"getAccountTokensTotal","query",e)},getAccountTokenOwnerships(e,r){return a(n=>t.request(da,e,{...r,...n}),"getAccountTokenOwnerships","query",e)},getCurrentTokenData(e,r){return a(n=>t.request(ba,e,{...r,...n}),"getCurrentTokenData","query",e)},getAccountCollections(e,r){return a(n=>t.request(ma,e,{...r,...n}),"getAccountCollections","query",e)},getTokenData(e,r){return a(n=>t.request(ga,e,{...r,...n}),"getTokenData","query",e)},getActivitiesAggregate(e,r){return a(n=>t.request(Ma,e,{...r,...n}),"getActivitiesAggregate","query",e)},getTokenActivities(e,r){return a(n=>t.request(Ia,e,{...r,...n}),"getTokenActivities","query",e)},getTokenAcquisitionActivity(e,r){return a(n=>t.request(Sa,e,{...r,...n}),"getTokenAcquisitionActivity","query",e)},getAccountTransactions(e,r){return a(n=>t.request(va,e,{...r,...n}),"getAccountTransactions","query",e)},getFungibleAssetMetadata(e,r){return a(n=>t.request(Aa,e,{...r,...n}),"getFungibleAssetMetadata","query",e)},getFungibleAssetBalances(e,r){return a(n=>t.request(xa,e,{...r,...n}),"getFungibleAssetBalances","query",e)},getDelegatedStakingRoyalties(e,r){return a(n=>t.request(Ba,e,{...r,...n}),"getDelegatedStakingRoyalties","query",e)},getDelegatedStaking(e,r){return a(n=>t.request(ka,e,{...r,...n}),"getDelegatedStaking","query",e)},getDelegationPools(e,r){return a(n=>t.request(Ca,e,{...r,...n}),"getDelegationPools","query",e)},getNumberOfDelegators(e,r){return a(n=>t.request(Oa,e,{...r,...n}),"getNumberOfDelegators","query",e)}}}var kt=(e=>(e.AccountAddress="account_address",e.TransactionVersion="transaction_version",e))(kt||{}),Ct=(r=>(r.AccountAddress="account_address",r.MinBlockHeight="min_block_height",r.NumDistinctVersions="num_distinct_versions",r))(Ct||{}),Ot=(e=>(e.AccountAddress="account_address",e.TransactionVersion="transaction_version",e))(Ot||{}),ht=(e=>(e.Address="address",e.TransactionVersion="transaction_version",e))(ht||{}),ft=(p=>(p.BlockHeight="block_height",p.Epoch="epoch",p.FailedProposerIndices="failed_proposer_indices",p.Id="id",p.PreviousBlockVotesBitvec="previous_block_votes_bitvec",p.Proposer="proposer",p.Round="round",p.Timestamp="timestamp",p.Version="version",p))(ft||{}),Tt=(s=>(s.ActivityType="activity_type",s.Amount="amount",s.BlockHeight="block_height",s.CoinType="coin_type",s.EntryFunctionIdStr="entry_function_id_str",s.EventAccountAddress="event_account_address",s.EventCreationNumber="event_creation_number",s.EventIndex="event_index",s.EventSequenceNumber="event_sequence_number",s.IsGasFee="is_gas_fee",s.IsTransactionSuccess="is_transaction_success",s.OwnerAddress="owner_address",s.StorageRefundAmount="storage_refund_amount",s.TransactionTimestamp="transaction_timestamp",s.TransactionVersion="transaction_version",s))(Tt||{}),Et=(e=>(e.IsGasFee="is_gas_fee",e.IsTransactionSuccess="is_transaction_success",e))(Et||{}),Ft=(e=>(e.IsGasFee="is_gas_fee",e.IsTransactionSuccess="is_transaction_success",e))(Ft||{}),wt=(o=>(o.Amount="amount",o.CoinType="coin_type",o.CoinTypeHash="coin_type_hash",o.OwnerAddress="owner_address",o.TransactionTimestamp="transaction_timestamp",o.TransactionVersion="transaction_version",o))(wt||{}),Vt=(g=>(g.CoinType="coin_type",g.CoinTypeHash="coin_type_hash",g.CreatorAddress="creator_address",g.Decimals="decimals",g.Name="name",g.SupplyAggregatorTableHandle="supply_aggregator_table_handle",g.SupplyAggregatorTableKey="supply_aggregator_table_key",g.Symbol="symbol",g.TransactionCreatedTimestamp="transaction_created_timestamp",g.TransactionVersionCreated="transaction_version_created",g))(Vt||{}),Pt=(o=>(o.CoinType="coin_type",o.CoinTypeHash="coin_type_hash",o.Supply="supply",o.TransactionEpoch="transaction_epoch",o.TransactionTimestamp="transaction_timestamp",o.TransactionVersion="transaction_version",o))(Pt||{}),Rt=(i=>(i.CollectionDataIdHash="collection_data_id_hash",i.CollectionName="collection_name",i.CreatorAddress="creator_address",i.Description="description",i.DescriptionMutable="description_mutable",i.Maximum="maximum",i.MaximumMutable="maximum_mutable",i.MetadataUri="metadata_uri",i.Supply="supply",i.TableHandle="table_handle",i.TransactionTimestamp="transaction_timestamp",i.TransactionVersion="transaction_version",i.UriMutable="uri_mutable",i))(Rt||{}),Dt=(_=>(_.Domain="domain",_.ExpirationTimestamp="expiration_timestamp",_.IsDeleted="is_deleted",_.LastTransactionVersion="last_transaction_version",_.RegisteredAddress="registered_address",_.Subdomain="subdomain",_.TokenName="token_name",_))(Dt||{}),Nt=(c=>(c.Domain="domain",c.ExpirationTimestamp="expiration_timestamp",c.IsDeleted="is_deleted",c.LastTransactionVersion="last_transaction_version",c.RegisteredAddress="registered_address",c.Subdomain="subdomain",c.TokenName="token_name",c.TokenStandard="token_standard",c))(Nt||{}),qt=(i=>(i.Domain="domain",i.DomainExpirationTimestamp="domain_expiration_timestamp",i.DomainWithSuffix="domain_with_suffix",i.ExpirationTimestamp="expiration_timestamp",i.IsActive="is_active",i.IsPrimary="is_primary",i.LastTransactionVersion="last_transaction_version",i.OwnerAddress="owner_address",i.RegisteredAddress="registered_address",i.Subdomain="subdomain",i.SubdomainExpirationPolicy="subdomain_expiration_policy",i.TokenName="token_name",i.TokenStandard="token_standard",i))(qt||{}),Qt=(e=>(e.IsActive="is_active",e.IsPrimary="is_primary",e))(Qt||{}),Lt=(e=>(e.IsActive="is_active",e.IsPrimary="is_primary",e))(Lt||{}),$t=(o=>(o.Amount="amount",o.CoinType="coin_type",o.CoinTypeHash="coin_type_hash",o.LastTransactionTimestamp="last_transaction_timestamp",o.LastTransactionVersion="last_transaction_version",o.OwnerAddress="owner_address",o))($t||{}),Gt=(i=>(i.CollectionDataIdHash="collection_data_id_hash",i.CollectionName="collection_name",i.CreatorAddress="creator_address",i.Description="description",i.DescriptionMutable="description_mutable",i.LastTransactionTimestamp="last_transaction_timestamp",i.LastTransactionVersion="last_transaction_version",i.Maximum="maximum",i.MaximumMutable="maximum_mutable",i.MetadataUri="metadata_uri",i.Supply="supply",i.TableHandle="table_handle",i.UriMutable="uri_mutable",i))(Gt||{}),zt=(c=>(c.CollectionId="collection_id",c.CollectionName="collection_name",c.CollectionUri="collection_uri",c.CreatorAddress="creator_address",c.DistinctTokens="distinct_tokens",c.LastTransactionVersion="last_transaction_version",c.OwnerAddress="owner_address",c.SingleTokenUri="single_token_uri",c))(zt||{}),jt=(s=>(s.CollectionId="collection_id",s.CollectionName="collection_name",s.CollectionProperties="collection_properties",s.CreatorAddress="creator_address",s.CurrentSupply="current_supply",s.Description="description",s.LastTransactionTimestamp="last_transaction_timestamp",s.LastTransactionVersion="last_transaction_version",s.MaxSupply="max_supply",s.MutableDescription="mutable_description",s.MutableUri="mutable_uri",s.TableHandleV1="table_handle_v1",s.TokenStandard="token_standard",s.TotalMintedV2="total_minted_v2",s.Uri="uri",s))(jt||{}),Ut=(_=>(_.ActiveTableHandle="active_table_handle",_.InactiveTableHandle="inactive_table_handle",_.LastTransactionVersion="last_transaction_version",_.OperatorCommissionPercentage="operator_commission_percentage",_.StakingPoolAddress="staking_pool_address",_.TotalCoins="total_coins",_.TotalShares="total_shares",_))(Ut||{}),Jt=(_=>(_.DelegationPoolAddress="delegation_pool_address",_.DelegatorAddress="delegator_address",_.LastTransactionTimestamp="last_transaction_timestamp",_.LastTransactionVersion="last_transaction_version",_.PendingVoter="pending_voter",_.TableHandle="table_handle",_.Voter="voter",_))(Jt||{}),Ht=(_=>(_.DelegatorAddress="delegator_address",_.LastTransactionVersion="last_transaction_version",_.ParentTableHandle="parent_table_handle",_.PoolAddress="pool_address",_.PoolType="pool_type",_.Shares="shares",_.TableHandle="table_handle",_))(Ht||{}),Wt=(S=>(S.Amount="amount",S.AmountV1="amount_v1",S.AmountV2="amount_v2",S.AssetType="asset_type",S.AssetTypeV1="asset_type_v1",S.AssetTypeV2="asset_type_v2",S.IsFrozen="is_frozen",S.IsPrimary="is_primary",S.LastTransactionTimestamp="last_transaction_timestamp",S.LastTransactionTimestampV1="last_transaction_timestamp_v1",S.LastTransactionTimestampV2="last_transaction_timestamp_v2",S.LastTransactionVersion="last_transaction_version",S.LastTransactionVersionV1="last_transaction_version_v1",S.LastTransactionVersionV2="last_transaction_version_v2",S.OwnerAddress="owner_address",S.StorageId="storage_id",S.TokenStandard="token_standard",S))(Wt||{}),Kt=(_=>(_.AllowUngatedTransfer="allow_ungated_transfer",_.IsDeleted="is_deleted",_.LastGuidCreationNum="last_guid_creation_num",_.LastTransactionVersion="last_transaction_version",_.ObjectAddress="object_address",_.OwnerAddress="owner_address",_.StateKeyHash="state_key_hash",_))(Kt||{}),Xt=(n=>(n.LastTransactionVersion="last_transaction_version",n.OperatorAddress="operator_address",n.StakingPoolAddress="staking_pool_address",n.VoterAddress="voter_address",n))(Xt||{}),Zt=(_=>(_.DecodedKey="decoded_key",_.DecodedValue="decoded_value",_.IsDeleted="is_deleted",_.Key="key",_.KeyHash="key_hash",_.LastTransactionVersion="last_transaction_version",_.TableHandle="table_handle",_))(Zt||{}),Yt=(y=>(y.CollectionDataIdHash="collection_data_id_hash",y.CollectionName="collection_name",y.CreatorAddress="creator_address",y.DefaultProperties="default_properties",y.Description="description",y.DescriptionMutable="description_mutable",y.LargestPropertyVersion="largest_property_version",y.LastTransactionTimestamp="last_transaction_timestamp",y.LastTransactionVersion="last_transaction_version",y.Maximum="maximum",y.MaximumMutable="maximum_mutable",y.MetadataUri="metadata_uri",y.Name="name",y.PayeeAddress="payee_address",y.PropertiesMutable="properties_mutable",y.RoyaltyMutable="royalty_mutable",y.RoyaltyPointsDenominator="royalty_points_denominator",y.RoyaltyPointsNumerator="royalty_points_numerator",y.Supply="supply",y.TokenDataIdHash="token_data_id_hash",y.UriMutable="uri_mutable",y))(Yt||{}),te=(s=>(s.CollectionId="collection_id",s.Decimals="decimals",s.Description="description",s.IsDeletedV2="is_deleted_v2",s.IsFungibleV2="is_fungible_v2",s.LargestPropertyVersionV1="largest_property_version_v1",s.LastTransactionTimestamp="last_transaction_timestamp",s.LastTransactionVersion="last_transaction_version",s.Maximum="maximum",s.Supply="supply",s.TokenDataId="token_data_id",s.TokenName="token_name",s.TokenProperties="token_properties",s.TokenStandard="token_standard",s.TokenUri="token_uri",s))(te||{}),ee=(l=>(l.Amount="amount",l.CollectionDataIdHash="collection_data_id_hash",l.CollectionName="collection_name",l.CreatorAddress="creator_address",l.LastTransactionTimestamp="last_transaction_timestamp",l.LastTransactionVersion="last_transaction_version",l.Name="name",l.OwnerAddress="owner_address",l.PropertyVersion="property_version",l.TableType="table_type",l.TokenDataIdHash="token_data_id_hash",l.TokenProperties="token_properties",l))(ee||{}),ae=(i=>(i.Amount="amount",i.IsFungibleV2="is_fungible_v2",i.IsSoulboundV2="is_soulbound_v2",i.LastTransactionTimestamp="last_transaction_timestamp",i.LastTransactionVersion="last_transaction_version",i.NonTransferrableByOwner="non_transferrable_by_owner",i.OwnerAddress="owner_address",i.PropertyVersionV1="property_version_v1",i.StorageId="storage_id",i.TableTypeV1="table_type_v1",i.TokenDataId="token_data_id",i.TokenPropertiesMutatedV1="token_properties_mutated_v1",i.TokenStandard="token_standard",i))(ae||{}),re=(r=>(r.IsFungibleV2="is_fungible_v2",r.IsSoulboundV2="is_soulbound_v2",r.NonTransferrableByOwner="non_transferrable_by_owner",r))(re||{}),ne=(r=>(r.IsFungibleV2="is_fungible_v2",r.IsSoulboundV2="is_soulbound_v2",r.NonTransferrableByOwner="non_transferrable_by_owner",r))(ne||{}),_e=(u=>(u.Amount="amount",u.CollectionDataIdHash="collection_data_id_hash",u.CollectionId="collection_id",u.CollectionName="collection_name",u.CreatorAddress="creator_address",u.FromAddress="from_address",u.LastTransactionTimestamp="last_transaction_timestamp",u.LastTransactionVersion="last_transaction_version",u.Name="name",u.PropertyVersion="property_version",u.TableHandle="table_handle",u.ToAddress="to_address",u.TokenDataId="token_data_id",u.TokenDataIdHash="token_data_id_hash",u))(_e||{}),oe=(o=>(o.LastTransactionTimestamp="last_transaction_timestamp",o.LastTransactionVersion="last_transaction_version",o.PayeeAddress="payee_address",o.RoyaltyPointsDenominator="royalty_points_denominator",o.RoyaltyPointsNumerator="royalty_points_numerator",o.TokenDataId="token_data_id",o))(oe||{}),se=(e=>(e.Asc="ASC",e.Desc="DESC",e))(se||{}),ie=(o=>(o.Amount="amount",o.DelegatorAddress="delegator_address",o.EventIndex="event_index",o.EventType="event_type",o.PoolAddress="pool_address",o.TransactionVersion="transaction_version",o))(ie||{}),pe=(_=>(_.ActiveTableHandle="active_table_handle",_.InactiveTableHandle="inactive_table_handle",_.OperatorCommissionPercentage="operator_commission_percentage",_.StakingPoolAddress="staking_pool_address",_.TotalCoins="total_coins",_.TotalShares="total_shares",_.TransactionVersion="transaction_version",_))(pe||{}),ue=(e=>(e.FirstTransactionVersion="first_transaction_version",e.StakingPoolAddress="staking_pool_address",e))(ue||{}),ye=(e=>(e.DelegatorAddress="delegator_address",e.PoolAddress="pool_address",e))(ye||{}),ce=(p=>(p.AccountAddress="account_address",p.CreationNumber="creation_number",p.Data="data",p.EventIndex="event_index",p.IndexedType="indexed_type",p.SequenceNumber="sequence_number",p.TransactionBlockHeight="transaction_block_height",p.TransactionVersion="transaction_version",p.Type="type",p))(ce||{}),le=(v=>(v.Amount="amount",v.AssetType="asset_type",v.BlockHeight="block_height",v.EntryFunctionIdStr="entry_function_id_str",v.EventIndex="event_index",v.GasFeePayerAddress="gas_fee_payer_address",v.IsFrozen="is_frozen",v.IsGasFee="is_gas_fee",v.IsTransactionSuccess="is_transaction_success",v.OwnerAddress="owner_address",v.StorageId="storage_id",v.StorageRefundAmount="storage_refund_amount",v.TokenStandard="token_standard",v.TransactionTimestamp="transaction_timestamp",v.TransactionVersion="transaction_version",v.Type="type",v))(le||{}),de=(u=>(u.AssetType="asset_type",u.CreatorAddress="creator_address",u.Decimals="decimals",u.IconUri="icon_uri",u.LastTransactionTimestamp="last_transaction_timestamp",u.LastTransactionVersion="last_transaction_version",u.MaximumV2="maximum_v2",u.Name="name",u.ProjectUri="project_uri",u.SupplyAggregatorTableHandleV1="supply_aggregator_table_handle_v1",u.SupplyAggregatorTableKeyV1="supply_aggregator_table_key_v1",u.SupplyV2="supply_v2",u.Symbol="symbol",u.TokenStandard="token_standard",u))(de||{}),be=(e=>(e.Db="db",e.IsIndexerUp="is_indexer_up",e))(be||{}),me=(a=>(a.ChainId="chain_id",a))(me||{}),ge=(e=>(e.Address="address",e.TransactionVersion="transaction_version",e))(ge||{}),Me=(p=>(p.AnimationOptimizerRetryCount="animation_optimizer_retry_count",p.AssetUri="asset_uri",p.CdnAnimationUri="cdn_animation_uri",p.CdnImageUri="cdn_image_uri",p.CdnJsonUri="cdn_json_uri",p.ImageOptimizerRetryCount="image_optimizer_retry_count",p.JsonParserRetryCount="json_parser_retry_count",p.RawAnimationUri="raw_animation_uri",p.RawImageUri="raw_image_uri",p))(Me||{}),Ie=(e=>(e.NumActiveDelegator="num_active_delegator",e.PoolAddress="pool_address",e))(Ie||{}),N=(o=>(o.Asc="asc",o.AscNullsFirst="asc_nulls_first",o.AscNullsLast="asc_nulls_last",o.Desc="desc",o.DescNullsFirst="desc_nulls_first",o.DescNullsLast="desc_nulls_last",o))(N||{}),Se=(n=>(n.LastSuccessVersion="last_success_version",n.LastTransactionTimestamp="last_transaction_timestamp",n.LastUpdated="last_updated",n.Processor="processor",n))(Se||{}),ve=(_=>(_.NumVotes="num_votes",_.ProposalId="proposal_id",_.ShouldPass="should_pass",_.StakingPoolAddress="staking_pool_address",_.TransactionTimestamp="transaction_timestamp",_.TransactionVersion="transaction_version",_.VoterAddress="voter_address",_))(ve||{}),Ae=(m=>(m.IsSenderPrimary="is_sender_primary",m.MultiAgentIndex="multi_agent_index",m.MultiSigIndex="multi_sig_index",m.PublicKey="public_key",m.PublicKeyIndices="public_key_indices",m.Signature="signature",m.Signer="signer",m.Threshold="threshold",m.TransactionBlockHeight="transaction_block_height",m.TransactionVersion="transaction_version",m.Type="type",m))(Ae||{}),xe=(o=>(o.DecodedKey="decoded_key",o.DecodedValue="decoded_value",o.Key="key",o.TableHandle="table_handle",o.TransactionVersion="transaction_version",o.WriteSetChangeIndex="write_set_change_index",o))(xe||{}),Be=(r=>(r.Handle="handle",r.KeyType="key_type",r.ValueType="value_type",r))(Be||{}),ke=(I=>(I.CoinAmount="coin_amount",I.CoinType="coin_type",I.CollectionDataIdHash="collection_data_id_hash",I.CollectionName="collection_name",I.CreatorAddress="creator_address",I.EventAccountAddress="event_account_address",I.EventCreationNumber="event_creation_number",I.EventIndex="event_index",I.EventSequenceNumber="event_sequence_number",I.FromAddress="from_address",I.Name="name",I.PropertyVersion="property_version",I.ToAddress="to_address",I.TokenAmount="token_amount",I.TokenDataIdHash="token_data_id_hash",I.TransactionTimestamp="transaction_timestamp",I.TransactionVersion="transaction_version",I.TransferType="transfer_type",I))(ke||{}),Ce=(s=>(s.AfterValue="after_value",s.BeforeValue="before_value",s.EntryFunctionIdStr="entry_function_id_str",s.EventAccountAddress="event_account_address",s.EventIndex="event_index",s.FromAddress="from_address",s.IsFungibleV2="is_fungible_v2",s.PropertyVersionV1="property_version_v1",s.ToAddress="to_address",s.TokenAmount="token_amount",s.TokenDataId="token_data_id",s.TokenStandard="token_standard",s.TransactionTimestamp="transaction_timestamp",s.TransactionVersion="transaction_version",s.Type="type",s))(Ce||{}),Oe=(a=>(a.IsFungibleV2="is_fungible_v2",a))(Oe||{}),he=(a=>(a.IsFungibleV2="is_fungible_v2",a))(he||{}),fe=(y=>(y.CollectionDataIdHash="collection_data_id_hash",y.CollectionName="collection_name",y.CreatorAddress="creator_address",y.DefaultProperties="default_properties",y.Description="description",y.DescriptionMutable="description_mutable",y.LargestPropertyVersion="largest_property_version",y.Maximum="maximum",y.MaximumMutable="maximum_mutable",y.MetadataUri="metadata_uri",y.Name="name",y.PayeeAddress="payee_address",y.PropertiesMutable="properties_mutable",y.RoyaltyMutable="royalty_mutable",y.RoyaltyPointsDenominator="royalty_points_denominator",y.RoyaltyPointsNumerator="royalty_points_numerator",y.Supply="supply",y.TokenDataIdHash="token_data_id_hash",y.TransactionTimestamp="transaction_timestamp",y.TransactionVersion="transaction_version",y.UriMutable="uri_mutable",y))(fe||{}),Te=(l=>(l.Amount="amount",l.CollectionDataIdHash="collection_data_id_hash",l.CollectionName="collection_name",l.CreatorAddress="creator_address",l.Name="name",l.OwnerAddress="owner_address",l.PropertyVersion="property_version",l.TableHandle="table_handle",l.TableType="table_type",l.TokenDataIdHash="token_data_id_hash",l.TransactionTimestamp="transaction_timestamp",l.TransactionVersion="transaction_version",l))(Te||{}),Ee=(p=>(p.CollectionDataIdHash="collection_data_id_hash",p.CollectionName="collection_name",p.CreatorAddress="creator_address",p.Name="name",p.PropertyVersion="property_version",p.TokenDataIdHash="token_data_id_hash",p.TokenProperties="token_properties",p.TransactionTimestamp="transaction_timestamp",p.TransactionVersion="transaction_version",p))(Ee||{}),Fe=(u=>(u.BlockHeight="block_height",u.EntryFunctionContractAddress="entry_function_contract_address",u.EntryFunctionFunctionName="entry_function_function_name",u.EntryFunctionIdStr="entry_function_id_str",u.EntryFunctionModuleName="entry_function_module_name",u.Epoch="epoch",u.ExpirationTimestampSecs="expiration_timestamp_secs",u.GasUnitPrice="gas_unit_price",u.MaxGasAmount="max_gas_amount",u.ParentSignatureType="parent_signature_type",u.Sender="sender",u.SequenceNumber="sequence_number",u.Timestamp="timestamp",u.Version="version",u))(Fe||{});function z(t,a){let e=new we.GraphQLClient(t,a);return Bt(e)}var Ne=require("@aptos-labs/ts-sdk");var k=async({limit:t,offset:a,queryFn:e})=>{let r=await e({limit:t,offset:a}),{hasNextPage:n,hasPrevPage:d,...o}=r,_=n?a+t:void 0,c=d??a>0?Math.max(a-t,0):void 0;return{nextCursor:_,prevCursor:c,...o}};var C=class extends Error{constructor(e,r){super();this.docsBaseUrl="https://js-pro-docs.vercel.app/";this.name="AptosJSProError";this.shortMessage=e,this.longMessage=r?.longMessage}};var x=class extends C{constructor(){super("The AptosJSProClient was not initialized with an indexer",{longMessage:"The AptosJSProClient was not initialized with an indexer. Please specify an indexer endpoint when setting up custom networks."});this.name="IndexerNotInitializedError"}},T=class extends C{constructor(){super("The AptosJSProClient was not initialized with a signer",{longMessage:"The AptosJSProClient was not initialized with a signer. Please specify a signer when setting up the client."});this.name="SignerNotFoundError"}};var O,F,E=class{constructor(a,e){f(this,O);f(this,F);if(!a)return;let n=[e,a].filter(Boolean).join(".").toLowerCase().replace(/(\.apt)$/,""),d=/^(?:([a-zA-Z0-9-]+)\.)?([a-zA-Z0-9-]+)$/,o=n.match(d);if(!o)return;let[,_,c]=o;B(this,O,c),B(this,F,_)}toString(){return M(this,O)?this.noSuffix().concat(".apt"):""}noSuffix(){return M(this,O)?M(this,F)?`${M(this,F)}.${M(this,O)}`:M(this,O):""}};O=new WeakMap,F=new WeakMap;var Ve="https://www.aptosnames.com/api";function Pe(t){let a=t.match(/^https:\/\/aptosnames.com\/name\/([^/]+)$/)??t.match(/^https:\/\/aptosnames.com\/api(?:\/[^/]+)?\/v\d+\/metadata\/([^/]+)/);return a?`${Ve}/v1/metadata/${a[1]}`:t}var j=t=>t.domain?new E(t.domain,t.subdomain):void 0,q=t=>({assetType:t.asset_type,creatorAddress:t.creator_address,decimals:t.decimals,iconUri:t.icon_uri,name:t.name,projectUri:t.project_uri,symbol:t.symbol,tokenStandard:t.token_standard}),Re=t=>t.map(a=>({amount:a.amount,amountV1:a.amount_v1,amountV2:a.amount_v2,assetType:a.asset_type,assetTypeV1:a.asset_type_v1,assetTypeV2:a.asset_type_v2,isFrozen:a.is_frozen,isPrimary:a.is_primary,lastTransactionTimestamp:a.last_transaction_timestamp,lastTransactionVersion:a.last_transaction_version,metadata:q(a.metadata),ownerAddress:a.owner_address,tokenStandard:a.token_standard})),U=t=>({cdnImageUri:t.cdn_asset_uris?.cdn_image_uri,collectionId:t.collection_id,collectionName:t.collection_name,creatorAddress:t.creator_address,description:t.description,metadataUri:t.uri,name:t.collection_name,supply:t.max_supply});var R=t=>{let a=Pe(t.token_uri);return{cdnImageUri:t.cdn_asset_uris?.cdn_image_uri,collection:t.current_collection?.collection_name??"",collectionData:t.current_collection?U(t.current_collection):void 0,collectionId:t.current_collection?.collection_id??"",creator:t.current_collection?.creator_address??"",description:t.description,isFungibleV2:t.is_fungible_v2??!1,isSoulbound:!1,lastTransactionTimestamp:t.last_transaction_timestamp,lastTransactionVersion:t.last_transaction_version,metadataUri:a,name:t.token_name,tokenId:t.token_data_id,tokenProperties:t.token_properties,tokenStandard:t.token_standard}},Q=t=>({fromAddress:t.from_address,toAddress:t.to_address,transactionTimestamp:t.transaction_timestamp,transactionVersion:t.transaction_version,type:t.type,eventAccountAddress:t.event_account_address,eventIndex:t.event_index}),De=t=>{let a=[],e=[],r=[];return t.fungible_asset_activities.forEach(n=>{!n.asset_type||!n.metadata||a.push(fa({...n,asset_type:n.asset_type,metadata:n.metadata}))}),t.token_activities_v2.forEach(n=>{n.current_token_data&&e.push(Ta({...n,current_token_data:n.current_token_data}))}),t.delegated_staking_activities.forEach(n=>r.push(Ea(n))),{accountAddress:t.account_address,transactionVersion:t.transaction_version,fungibleAssetActivities:a,tokenActivities:e,delegatedStakingActivities:r,userTransaction:t.user_transaction?{sequenceNumber:t.user_transaction.sequence_number,sender:t.user_transaction.sender,entryFunction:t.user_transaction.entry_function_id_str}:void 0}},fa=t=>({ownerAddress:t.owner_address,ownerPrimaryAptosName:t.owner_primary_aptos_name.at(0)?j(t.owner_primary_aptos_name[0]):void 0,amount:t.amount,type:t.type,blockHeight:t.block_height,assetType:t.asset_type,metadata:q(t.metadata),entryFunctionIdStr:t.entry_function_id_str,eventIndex:t.event_index,isGasFee:t.is_gas_fee,gasFeePayerAddress:t.gas_fee_payer_address,isTransactionSuccess:t.is_transaction_success,transactionTimestamp:t.transaction_timestamp,transactionVersion:t.transaction_version}),Ta=t=>({...Q(t),primaryAptosNameFrom:t.primary_aptos_name_from.at(0)?j(t.primary_aptos_name_from[0]):void 0,primaryAptosNameTo:t.primary_aptos_name_to.at(0)?j(t.primary_aptos_name_to[0]):void 0,currentTokenData:R(t.current_token_data),propertyVersionV1:t.property_version_v1,tokenAmount:t.token_amount,tokenDataId:t.token_data_id}),Ea=t=>({delegatorAddress:t.delegator_address,eventIndex:t.event_index,eventType:t.event_type,poolAddress:t.pool_address,transactionVersion:t.transaction_version,amount:t.amount});async function J({address:t,network:a,limit:e=100,offset:r=0,orderBy:n,where:d}){let{indexer:o}=this.getClients({network:a});if(!o)throw new x;return k({limit:e,offset:r,queryFn:async({limit:_,offset:c})=>{let p=await o.getFungibleAssetBalances({limit:_,offset:c,order_by:n,where:{_and:[{metadata:{asset_type:{_is_null:!1}},owner_address:{_eq:Ne.AccountAddress.from(t).toString()}},d??{}]}}),g=p.current_fungible_asset_balances.filter(m=>m.metadata!==void 0&&m.metadata!==null);return{balances:Re(g),hasNextPage:p.current_fungible_asset_balances.length===_}}})}function H({network:t}={}){let a=this.aptos,e=this.indexer;return t&&(a=this.createAptos(void 0,t),e=this.createIndexer(void 0,t)),{account:this.account,aptos:a,indexer:e,network:t??this.network,signer:this.signer}}var qe=require("@aptos-labs/ts-sdk");async function W({address:t,network:a}){let{aptos:e}=this.getClients({network:a}),r=await e.account.getAccountCoinAmount({accountAddress:qe.AccountAddress.from(t).toString(),coinType:"0x1::aptos_coin::AptosCoin"});return BigInt(r)}var Qe=require("@aptos-labs/ts-sdk");async function K({address:t,asset:a,network:e}){let{aptos:r}=this.getClients({network:e}),n=a.includes("::"),d=await r.account.getAccountCoinAmount({accountAddress:Qe.AccountAddress.from(t).toString(),coinType:n?a:void 0,faMetadataAddress:n?void 0:a});return BigInt(d)}async function X({network:t,processor:a}){let{aptos:e}=this.getClients({network:t}),r=await e.getProcessorStatus(a);return{lastSuccessVersion:r.last_success_version,lastUpdated:r.last_updated}}var Le=require("@aptos-labs/ts-sdk");var w=async(t,a)=>{try{return await t()}catch{return a}};async function Z({network:t,name:a}){let{aptos:e}=this.getClients({network:t}),r=await w(()=>e.getTargetAddress({name:a.toString()}),void 0);return r?Le.AccountAddress.from(r):void 0}var $e=require("@aptos-labs/ts-sdk");async function Y({network:t,address:a}){let{aptos:e}=this.getClients({network:t}),r=await w(()=>e.getPrimaryName({address:$e.AccountAddress.from(a)}),void 0);return r?new E(r):void 0}async function tt({network:t}){let{aptos:a}=this.getClients({network:t}),e=await a.getGasPriceEstimation();return{deprioritizedGasEstimate:e.deprioritized_gas_estimate,gasEstimate:e.gas_estimate,prioritizedGasEstimate:e.prioritized_gas_estimate}}async function et({network:t,...a}){let{aptos:e}=this.getClients({network:t});return"ledgerVersion"in a?e.getTransactionByVersion({ledgerVersion:a.ledgerVersion}):e.getTransactionByHash({transactionHash:a.transactionHash})}var Ge=require("@aptos-labs/ts-sdk");async function at({network:t,accountAddress:a,...e}){let{aptos:r}=this.getClients({network:t});return await r.getAccountResource({...e,accountAddress:Ge.AccountAddress.from(a).toString(),resourceType:e.resourceType})}async function rt({network:t,...a}){let{aptos:e}=this.getClients({network:t});return await w(()=>e.getAccountResources(a),[])}async function nt({network:t}){let{aptos:a}=this.getClients({network:t}),e=await a.getLedgerInfo();return{chainId:e.chain_id,epoch:e.epoch,ledgerVersion:e.ledger_version,oldestLedgerVersion:e.oldest_ledger_version,ledgerTimestamp:e.ledger_timestamp,nodeRole:e.node_role,oldestBlockHeight:e.oldest_block_height,blockHeight:e.block_height,gitHash:e.git_hash}}async function _t(t){let{indexer:a}=this.getClients({network:t.network});if(!a)throw new x;let e=await a.getTokenData({address:t.address});if(e.current_token_datas_v2.length!==0)return{...R(e.current_token_datas_v2[0]),createdActivity:e.created_activity.at(0)?Q(e.created_activity[0]):void 0,acquiredActivity:e.acquired_activity.at(0)?Q(e.acquired_activity[0]):void 0}}var ze=require("@aptos-labs/ts-sdk");var D=class extends C{constructor(){super("No sender found");this.name="SenderNotFoundError"}};async function ot({network:t,limit:a=100,offset:e=0,orderBy:r=[],where:n=[],...d}){let{indexer:o}=this.getClients({network:t});if(!o)throw new x;return k({limit:a,offset:e,queryFn:async({limit:_,offset:c})=>{let p=await o.getAccountCollections({limit:_,offset:c,address:ze.AccountAddress.from(d.address).toString(),where:n,order_by:[{last_transaction_version:"desc",collection_id:"desc"},...Array.isArray(r)?r:[r]]}),g=[];return p.current_collection_ownership_v2_view.forEach(m=>{m.current_collection&&g.push(U(m.current_collection))}),{hasNextPage:p.current_collection_ownership_v2_view.length===_,collections:g}}})}async function st(t){let{aptos:a}=this.getClients({network:t.network});return await a.view(t)}async function it({network:t,...a}){let{aptos:e}=this.getClients({network:t}),r=await e.getFungibleAssetMetadata({options:{where:{asset_type:{_eq:a.asset}}}});return r.at(0)?q(r[0]):void 0}var je=require("@aptos-labs/ts-sdk");async function pt({network:t,address:a,limit:e=100,offset:r=0,orderBy:n=[],where:d=[],fungibleAssetActivitiesWhere:o=[],tokenActivitiesWhere:_=[],fungibleAssetActivitiesOrderBy:c=[],tokenActivitiesOrderBy:p=[]}){let{indexer:g}=this.getClients({network:t});if(!g)throw new x;return k({limit:e,offset:r,queryFn:async({limit:m,offset:l})=>{let i=await g.getAccountTransactions({address:je.AccountAddress.from(a).toString(),limit:m,offset:l,order_by:[{transaction_version:"desc"},...Array.isArray(n)?n:[n]],where:d,fungible_asset_activities_where:o,token_activities_v2_where:_,fungible_asset_activities_order_by:c,token_activities_v2_order_by:p});return{hasNextPage:i.account_transactions.length===m,transactions:i.account_transactions.map(De)}}})}var Ue=require("@aptos-labs/ts-sdk");async function ut({network:t,address:a,collectionId:e,limit:r=100,offset:n=0,orderBy:d=[],where:o=[]}){let{indexer:_}=this.getClients({network:t});if(!_)throw new x;return k({limit:r,offset:n,queryFn:async({limit:c,offset:p})=>{let g=await _.getAccountTokenOwnerships({address:Ue.AccountAddress.from(a).toString(),limit:c,offset:p,order_by:d,where:[...e?[{current_token_data:{current_collection:{collection_id:{_eq:e}}}}]:[],...Array.isArray(o)?o:[o]]}),m=[];return g.current_token_ownerships_v2.forEach(l=>{!l.current_token_data||!l.current_token_data.current_collection||m.push({...R(l.current_token_data),amount:l.amount,isSoulbound:l.is_soulbound_v2??!1,ownerAddress:l.owner_address})}),{hasNextPage:g.current_token_ownerships_v2.length===c,tokens:m}}})}async function yt({network:t,...a}){let{aptos:e}=this.getClients({network:t});return await e.getEvents(a)}var Je=require("@aptos-labs/ts-sdk");async function ct(t){let{network:a,data:e,options:r,sender:n,withFeePayer:d}=t,{account:o,aptos:_}=this.getClients({network:a}),c=n??o?.address;if(!c)throw new D;let p={...r};return p.expireTimestamp??=Math.floor(this.getServerTime()/1e3)+Je.DEFAULT_TXN_EXP_SEC_FROM_NOW,"secondarySignerAddresses"in t?_.transaction.build.multiAgent({data:e,options:p,secondarySignerAddresses:t.secondarySignerAddresses,sender:c,withFeePayer:d}):_.transaction.build.simple({data:e,options:p,sender:c,withFeePayer:d})}var L=require("@aptos-labs/ts-sdk");async function lt({network:t,transaction:a}){let{aptos:e}=this.getClients({network:t}),{data:r}=await(0,L.postAptosFullNode)({aptosConfig:e.config,body:a,contentType:L.MimeType.BCS_SIGNED_TRANSACTION,originMethod:"submitTransaction",path:"transactions"});return r}async function dt({network:t,...a}){let{aptos:e}=this.getClients({network:t});return await e.waitForTransaction({...a,transactionHash:a.hash})}async function bt(t){let{aptos:a}=this.getClients({network:t.network});return"secondarySignerAddresses"in t?(await a.transaction.simulate.multiAgent(t))[0]:(await a.transaction.simulate.simple(t))[0]}async function mt({network:t,...a}){let{aptos:e,signer:r}=this.getClients({network:t});if(!r)throw new T;return r.signTransaction({aptos:e,transaction:a.transaction,signer:a.signer})}async function gt(t){let{aptos:a,signer:e}=this.getClients({network:t.network});if(!e)throw new T;let r;return"data"in t?r=await this.buildTransaction(t):r=t.transaction,e.signAndSubmitTransaction({aptos:a,transaction:r,signer:t.signer})}var A,V,P,Mt=class{constructor(a){f(this,A);f(this,V);f(this,P);this.getServerTime=()=>(this.state.config?.serverTime??Date.now)();this.getServerDate=()=>new Date(this.getServerTime());this.setAccount=a=>{M(this,A).setState({...this.state,account:a},!0)};this.setNetwork=a=>{M(this,A).setState({...this.state,network:a},!0),this.refreshClients()};this.setSigner=a=>{M(this,A).setState({...this.state,signer:a},!0)};this.setConfig=a=>{M(this,A).setState({...this.state,config:a},!0),this.refreshClients()};this.onAccountChange=a=>M(this,A).subscribe(e=>e.account,e=>a(e));this.onNetworkChange=a=>M(this,A).subscribe(e=>e.network,e=>a(e));this.onSignerChange=a=>M(this,A).subscribe(e=>e.signer,e=>a(e));this.onConfigChange=a=>M(this,A).subscribe(e=>e.config,e=>a(e));this.onChange=a=>M(this,A).subscribe(e=>a(e));this.createNetworkConfig=(a=this.state.network)=>a.network===h.Network.CUSTOM?{network:a.network,fullnode:a.nodeUrl,indexer:a.indexerUrl,faucet:a.faucetUrl,prover:a.proverUrl,pepper:a.pepperUrl}:a;this.createAptos=(a,e=this.state.network)=>{let{state:r}=this,n=this.createNetworkConfig(e),d=r.config?.aptos?.config??{},o=new h.AptosConfig({...n,...d,...a,clientConfig:{...d.clientConfig,API_KEY:r.config?.apiKey,...a?.clientConfig}});return new h.Aptos(o)};this.createIndexer=(a,e=this.state.network)=>{let r=this.createAptos(a,e).config.getRequestUrl(h.AptosApiType.INDEXER);if(r===void 0)return;let n=this.state.config?.indexerClient?.options??{},d=this.state?.config?.apiKey?{Authorization:`Bearer ${this.state.config.apiKey}`}:{},o={...n,headers:{...n.headers,...d}};return z(r,o)};this.refreshClients=()=>{B(this,V,this.createAptos()),B(this,P,this.createIndexer())};this.getClients=H;this.fetchAccountTransactions=pt;this.fetchAccountCollections=ot;this.fetchAccountCoins=J;this.fetchAccountTokens=ut;this.fetchTransaction=et;this.fetchResources=rt;this.fetchResourceType=at;this.fetchProcessorStatus=X;this.fetchTokenData=_t;this.fetchFungibleAssetMetadata=it;this.fetchLedgerInfo=nt;this.fetchAddressFromName=Z;this.fetchNameFromAddress=Y;this.fetchAptBalance=W;this.fetchBalance=K;this.fetchEstimatedGasPrice=tt;this.fetchViewModule=st;this.fetchEvents=yt;this.submitTransaction=lt;this.waitForTransaction=dt;this.simulateTransaction=bt;this.signTransaction=mt;this.signAndSubmitTransaction=gt;this.buildTransaction=ct;B(this,A,(0,We.createStore)((0,He.subscribeWithSelector)(()=>({account:a.account,config:a.config,network:a.network,signer:a.signer})))),B(this,V,this.createAptos()),B(this,P,this.createIndexer())}get state(){return M(this,A).getState()}get store(){return M(this,A)}get signer(){return this.state.signer}get account(){return this.state.account}get network(){return this.state.network}get aptos(){return M(this,V)}get indexer(){return M(this,P)}};A=new WeakMap,V=new WeakMap,P=new WeakMap;var Ke=require("@aptos-labs/ts-sdk"),Fa=({basePath:t="https://explorer.aptoslabs.com",network:a=Ke.Network.MAINNET,path:e=""})=>{let r=new URLSearchParams;return r.set("network",a),`${t}/${e}?${r.toString()}`};function Xe(t,a){let[e,r="0"]=t.split("."),n=e.startsWith("-");if(n&&(e=e.slice(1)),r=r.replace(/(0+)$/,""),a===0)Math.round(+`.${r}`)===1&&(e=`${BigInt(e)+BigInt(1)}`),r="";else if(r.length>a){let[d,o,_]=[r.slice(0,a-1),r.slice(a-1,a),r.slice(a)],c=Math.round(+`${o}.${_}`);c>9?r=`${BigInt(d)+BigInt(1)}0`.padStart(d.length+1,"0"):r=`${d}${c}`,r.length>a&&(r=r.slice(1),e=`${BigInt(e)+BigInt(1)}`),r=r.slice(0,a)}else r=r.padEnd(a,"0");return BigInt(`${n?"-":""}${e}${r}`)}var wa=t=>Xe(t,8),Ze=(t,a)=>{let e=t.toString(),r=e.startsWith("-");r&&(e=e.slice(1)),e=e.padStart(a,"0");let[n,d]=[e.slice(0,e.length-a),e.slice(e.length-a)];return d=d.replace(/(0+)$/,""),`${r?"-":""}${n||"0"}${d?`.${d}`:""}`},Va=t=>Ze(t,8);var Pa=t=>t?{address:t.accountAddress,publicKey:t.publicKey}:void 0,Ra=t=>t?{type:"custom",signAndSubmitTransaction:async({aptos:a,signer:e,...r})=>a.signAndSubmitTransaction({signer:e??t,...r}),signTransaction:async({signer:a,transaction:e})=>({rawTransaction:e.rawTransaction.bcsToBytes(),authenticator:(a??t).signTransactionWithAuthenticator(e)})}:void 0;0&&(module.exports={Account_Transactions_Select_Column,Address_Events_Summary_Select_Column,Address_Version_From_Events_Select_Column,Address_Version_From_Move_Resources_Select_Column,AptosBaseError,AptosJSProClient,AptosName,Block_Metadata_Transactions_Select_Column,Coin_Activities_Select_Column,Coin_Activities_Select_Column_Coin_Activities_Aggregate_Bool_Exp_Bool_And_Arguments_Columns,Coin_Activities_Select_Column_Coin_Activities_Aggregate_Bool_Exp_Bool_Or_Arguments_Columns,Coin_Balances_Select_Column,Coin_Infos_Select_Column,Coin_Supply_Select_Column,Collection_Datas_Select_Column,Current_Ans_Lookup_Select_Column,Current_Ans_Lookup_V2_Select_Column,Current_Aptos_Names_Select_Column,Current_Aptos_Names_Select_Column_Current_Aptos_Names_Aggregate_Bool_Exp_Bool_And_Arguments_Columns,Current_Aptos_Names_Select_Column_Current_Aptos_Names_Aggregate_Bool_Exp_Bool_Or_Arguments_Columns,Current_Coin_Balances_Select_Column,Current_Collection_Datas_Select_Column,Current_Collection_Ownership_V2_View_Select_Column,Current_Collections_V2_Select_Column,Current_Delegated_Staking_Pool_Balances_Select_Column,Current_Delegated_Voter_Select_Column,Current_Delegator_Balances_Select_Column,Current_Fungible_Asset_Balances_Select_Column,Current_Objects_Select_Column,Current_Staking_Pool_Voter_Select_Column,Current_Table_Items_Select_Column,Current_Token_Datas_Select_Column,Current_Token_Datas_V2_Select_Column,Current_Token_Ownerships_Select_Column,Current_Token_Ownerships_V2_Select_Column,Current_Token_Ownerships_V2_Select_Column_Current_Token_Ownerships_V2_Aggregate_Bool_Exp_Bool_And_Arguments_Columns,Current_Token_Ownerships_V2_Select_Column_Current_Token_Ownerships_V2_Aggregate_Bool_Exp_Bool_Or_Arguments_Columns,Current_Token_Pending_Claims_Select_Column,Current_Token_Royalty_V1_Select_Column,Cursor_Ordering,Delegated_Staking_Activities_Select_Column,Delegated_Staking_Pool_Balances_Select_Column,Delegated_Staking_Pools_Select_Column,Delegator_Distinct_Pool_Select_Column,Events_Select_Column,Fungible_Asset_Activities_Select_Column,Fungible_Asset_Metadata_Select_Column,IndexerNotInitializedError,Indexer_Status_Select_Column,Ledger_Infos_Select_Column,Move_Resources_Select_Column,Nft_Metadata_Crawler_Parsed_Asset_Uris_Select_Column,Num_Active_Delegator_Per_Pool_Select_Column,Order_By,Processor_Status_Select_Column,Proposal_Votes_Select_Column,SenderNotFoundError,Signatures_Select_Column,SignerNotFoundError,Table_Items_Select_Column,Table_Metadatas_Select_Column,Token_Activities_Select_Column,Token_Activities_V2_Select_Column,Token_Activities_V2_Select_Column_Token_Activities_V2_Aggregate_Bool_Exp_Bool_And_Arguments_Columns,Token_Activities_V2_Select_Column_Token_Activities_V2_Aggregate_Bool_Exp_Bool_Or_Arguments_Columns,Token_Datas_Select_Column,Token_Ownerships_Select_Column,Tokens_Select_Column,User_Transactions_Select_Column,buildTransaction,convertAptosAccountToAccountInfo,convertAptosAccountToSigner,createIndexerClient,fetchAccountCoins,fetchAccountCollections,fetchAccountTokens,fetchAccountTransactions,fetchAddressFromName,fetchAptBalance,fetchBalance,fetchEstimatedGasPrice,fetchEvents,fetchFungibleAssetMetadata,fetchLedgerInfo,fetchNameFromAddress,fetchProcessorStatus,fetchResourceType,fetchResources,fetchTokenData,fetchTransaction,fetchViewModule,formatApt,formatUnits,getClients,getExplorerUrl,parseApt,parseUnits,signAndSubmitTransaction,signTransaction,simulateTransaction,submitTransaction,waitForTransaction});
|
|
391
392
|
//# sourceMappingURL=index.js.map
|