@aptos-labs/js-pro 0.1.3 → 0.1.5
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 +12 -0
- package/dist/client.d.ts +1 -4
- package/dist/client.d.ts.map +1 -1
- package/dist/index.js +34 -51
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +34 -51
- package/dist/index.mjs.map +1 -1
- package/dist/operations/generated/operations.d.ts +0 -27
- package/dist/operations/generated/operations.d.ts.map +1 -1
- package/dist/operations/generated/sdk.d.ts +0 -4
- package/dist/operations/generated/sdk.d.ts.map +1 -1
- package/dist/operations/generated/types.d.ts +37 -3645
- package/dist/operations/generated/types.d.ts.map +1 -1
- package/dist/operations/index.d.ts +0 -2
- package/dist/operations/index.d.ts.map +1 -1
- package/dist/queries/index.d.ts +0 -1
- package/dist/queries/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/client.ts +0 -3
- package/src/index.ts +1 -1
- package/src/mutations/buildTransaction.ts +3 -3
- package/src/mutations/signAndSubmitTransaction.ts +1 -1
- package/src/mutations/signTransaction.ts +1 -1
- package/src/mutations/simulateTransaction.ts +3 -3
- package/src/mutations/submitTransaction.ts +1 -1
- package/src/mutations/waitForTransaction.ts +1 -1
- package/src/operations/generated/operations.ts +0 -14
- package/src/operations/generated/sdk.ts +0 -25
- package/src/operations/generated/types.ts +5007 -9064
- package/src/operations/index.ts +1 -1
- package/src/operations/schemas/account.gql +0 -19
- package/src/queries/fetchAccountCoins.ts +2 -2
- package/src/queries/fetchAccountCollections.ts +2 -2
- package/src/queries/fetchAccountTokens.ts +1 -1
- package/src/queries/fetchAccountTransactions.ts +2 -2
- package/src/queries/fetchAddressFromName.ts +2 -2
- package/src/queries/fetchAptBalance.ts +1 -1
- package/src/queries/fetchBalance.ts +1 -1
- package/src/queries/fetchEstimatedGasPrice.ts +1 -1
- package/src/queries/fetchFungibleAssetMetadata.ts +1 -1
- package/src/queries/fetchLedgerInfo.ts +1 -1
- package/src/queries/fetchNameFromAddress.ts +2 -2
- package/src/queries/fetchProcessorStatus.ts +1 -1
- package/src/queries/fetchResourceType.ts +1 -1
- package/src/queries/fetchResources.ts +2 -2
- package/src/queries/fetchTokenData.ts +1 -1
- package/src/queries/fetchTransaction.ts +1 -1
- package/src/queries/fetchUserTransactions.ts +1 -1
- package/src/queries/fetchViewModule.ts +1 -1
- package/src/queries/getClients.ts +1 -1
- package/src/queries/index.ts +0 -1
- package/src/types/signers.ts +2 -2
- package/src/utils/convert.ts +3 -3
- package/src/utils/fungibleAssets.ts +2 -2
- package/src/utils/index.ts +1 -1
- package/src/utils/lib.ts +2 -2
- package/src/utils/normalize.ts +16 -16
- package/src/utils/objects.ts +1 -1
- package/src/utils/tokens.ts +1 -1
- package/src/utils/transactions/TransactionParser.ts +6 -6
- package/src/utils/transactions/parsers/CoinEventParser.ts +2 -2
- package/src/utils/transactions/parsers/CoinStoreWritesetParser.ts +4 -4
- package/src/utils/transactions/parsers/FungibleAssetEventParser.ts +4 -4
- package/src/utils/transactions/parsers/FungibleAssetStoreWritesetParser.ts +2 -2
- package/src/utils/transactions/parsers/ObjectOwnersWritesetParser.ts +1 -1
- package/src/utils/transactions/shared.ts +2 -2
- package/dist/queries/fetchAccountTotalTransactions.d.ts +0 -9
- package/dist/queries/fetchAccountTotalTransactions.d.ts.map +0 -1
- package/src/queries/fetchAccountTotalTransactions.ts +0 -27
|
@@ -23,7 +23,7 @@ export class FungibleAssetEventParser extends EventParser<
|
|
|
23
23
|
context: FungibleAssetEventParserRequiredContext &
|
|
24
24
|
FungibleAssetEventParserProvides,
|
|
25
25
|
storeAddress: string,
|
|
26
|
-
amount: bigint
|
|
26
|
+
amount: bigint,
|
|
27
27
|
) {
|
|
28
28
|
const ownerAddress = context.objectOwners[storeAddress];
|
|
29
29
|
const assetAddress = context.fungibleAssetStoreMetadata[storeAddress];
|
|
@@ -50,14 +50,14 @@ export class FungibleAssetEventParser extends EventParser<
|
|
|
50
50
|
override parse(
|
|
51
51
|
context: FungibleAssetEventParserRequiredContext &
|
|
52
52
|
FungibleAssetEventParserProvides,
|
|
53
|
-
event: Event
|
|
53
|
+
event: Event,
|
|
54
54
|
) {
|
|
55
55
|
switch (event.type) {
|
|
56
56
|
case "0x1::fungible_asset::Deposit": {
|
|
57
57
|
this.applyChange(
|
|
58
58
|
context,
|
|
59
59
|
normalizeAddress(event.data.store),
|
|
60
|
-
BigInt(event.data.amount)
|
|
60
|
+
BigInt(event.data.amount),
|
|
61
61
|
);
|
|
62
62
|
return true;
|
|
63
63
|
}
|
|
@@ -65,7 +65,7 @@ export class FungibleAssetEventParser extends EventParser<
|
|
|
65
65
|
this.applyChange(
|
|
66
66
|
context,
|
|
67
67
|
normalizeAddress(event.data.store),
|
|
68
|
-
-BigInt(event.data.amount)
|
|
68
|
+
-BigInt(event.data.amount),
|
|
69
69
|
);
|
|
70
70
|
return true;
|
|
71
71
|
}
|
|
@@ -16,7 +16,7 @@ export class FungibleAssetStoreWritesetParser extends WritesetParser<
|
|
|
16
16
|
context: object & {
|
|
17
17
|
fungibleAssetStoreMetadata: { [storeAddress: string]: string };
|
|
18
18
|
},
|
|
19
|
-
change: WriteSetChange
|
|
19
|
+
change: WriteSetChange,
|
|
20
20
|
) {
|
|
21
21
|
if (
|
|
22
22
|
!isWriteResourceChange(change) ||
|
|
@@ -30,7 +30,7 @@ export class FungibleAssetStoreWritesetParser extends WritesetParser<
|
|
|
30
30
|
const storeAddress = normalizeAddress(change.address);
|
|
31
31
|
const { metadata } = resource.data as { metadata: { inner: string } };
|
|
32
32
|
context.fungibleAssetStoreMetadata[storeAddress] = normalizeAddress(
|
|
33
|
-
metadata.inner
|
|
33
|
+
metadata.inner,
|
|
34
34
|
);
|
|
35
35
|
|
|
36
36
|
return true;
|
|
@@ -10,7 +10,7 @@ export class ObjectOwnersWritesetParser extends WritesetParser<
|
|
|
10
10
|
> {
|
|
11
11
|
override parse(
|
|
12
12
|
context: object & { objectOwners: { [objectAddress: string]: string } },
|
|
13
|
-
change: WriteSetChange
|
|
13
|
+
change: WriteSetChange,
|
|
14
14
|
) {
|
|
15
15
|
if (
|
|
16
16
|
!isWriteResourceChange(change) ||
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
} from "@aptos-labs/ts-sdk";
|
|
10
10
|
|
|
11
11
|
export function isWriteResourceChange(
|
|
12
|
-
change: WriteSetChange
|
|
12
|
+
change: WriteSetChange,
|
|
13
13
|
): change is WriteSetChangeWriteResource {
|
|
14
14
|
return change.type === "write_resource";
|
|
15
15
|
}
|
|
@@ -30,7 +30,7 @@ export function normalizeAddress(address: AccountAddressInput) {
|
|
|
30
30
|
*/
|
|
31
31
|
export function serializeEventGuid(
|
|
32
32
|
creatorAddress: AccountAddressInput,
|
|
33
|
-
creationNum: string
|
|
33
|
+
creationNum: string,
|
|
34
34
|
) {
|
|
35
35
|
return `${normalizeAddress(creatorAddress)}_${creationNum}`;
|
|
36
36
|
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { AccountAddressInput } from "@aptos-labs/ts-sdk";
|
|
2
|
-
import { AptosJSProClient } from "../client.js";
|
|
3
|
-
import { WithNetwork } from "../types/parameters.js";
|
|
4
|
-
export type FetchAccountTotalTransactionsParameters = WithNetwork<{
|
|
5
|
-
address: AccountAddressInput;
|
|
6
|
-
}>;
|
|
7
|
-
export type FetchAccountTotalTransactionsResult = number;
|
|
8
|
-
export declare function fetchAccountTotalTransactions(this: AptosJSProClient, { address, network }: FetchAccountTotalTransactionsParameters): Promise<FetchAccountTotalTransactionsResult>;
|
|
9
|
-
//# sourceMappingURL=fetchAccountTotalTransactions.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fetchAccountTotalTransactions.d.ts","sourceRoot":"","sources":["../../src/queries/fetchAccountTotalTransactions.ts"],"names":[],"mappings":"AAGA,OAAO,EAAkB,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzE,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAGrD,MAAM,MAAM,uCAAuC,GAAG,WAAW,CAAC;IAChE,OAAO,EAAE,mBAAmB,CAAC;CAC9B,CAAC,CAAC;AAEH,MAAM,MAAM,mCAAmC,GAAG,MAAM,CAAC;AAEzD,wBAAsB,6BAA6B,CACjD,IAAI,EAAE,gBAAgB,EACtB,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,uCAAuC,GAC5D,OAAO,CAAC,mCAAmC,CAAC,CAS9C"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
// Copyright © Aptos
|
|
2
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
|
|
4
|
-
import { AccountAddress, AccountAddressInput } from "@aptos-labs/ts-sdk";
|
|
5
|
-
import { AptosJSProClient } from "../client.js";
|
|
6
|
-
import { WithNetwork } from "../types/parameters.js";
|
|
7
|
-
import { IndexerNotInitializedError } from "../errors/index.js";
|
|
8
|
-
|
|
9
|
-
export type FetchAccountTotalTransactionsParameters = WithNetwork<{
|
|
10
|
-
address: AccountAddressInput;
|
|
11
|
-
}>;
|
|
12
|
-
|
|
13
|
-
export type FetchAccountTotalTransactionsResult = number;
|
|
14
|
-
|
|
15
|
-
export async function fetchAccountTotalTransactions(
|
|
16
|
-
this: AptosJSProClient,
|
|
17
|
-
{ address, network }: FetchAccountTotalTransactionsParameters
|
|
18
|
-
): Promise<FetchAccountTotalTransactionsResult> {
|
|
19
|
-
const { indexer } = this.getClients({ network });
|
|
20
|
-
if (!indexer) throw new IndexerNotInitializedError();
|
|
21
|
-
|
|
22
|
-
const result = await indexer.getAccountTotalTransactions({
|
|
23
|
-
address: AccountAddress.from(address).toStringLong(),
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
return result.move_resources_aggregate?.aggregate?.count ?? 0;
|
|
27
|
-
}
|