@aptos-labs/ts-sdk 1.5.1 → 1.7.0
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/dist/browser/index.d.ts +33 -4
- package/dist/browser/index.global.js +30 -30
- package/dist/browser/index.global.js.map +1 -1
- package/dist/common/index.d.ts +33 -4
- package/dist/common/index.js +26 -26
- package/dist/common/index.js.map +1 -1
- package/dist/esm/api/account.mjs +1 -1
- package/dist/esm/api/ans.mjs +1 -1
- package/dist/esm/api/aptos.mjs +1 -1
- package/dist/esm/api/aptosConfig.d.mts +12 -0
- package/dist/esm/api/aptosConfig.mjs +1 -1
- package/dist/esm/api/coin.mjs +1 -1
- package/dist/esm/api/digitalAsset.mjs +1 -1
- package/dist/esm/api/event.mjs +1 -1
- package/dist/esm/api/faucet.mjs +1 -1
- package/dist/esm/api/fungibleAsset.mjs +1 -1
- package/dist/esm/api/general.mjs +1 -1
- package/dist/esm/api/index.mjs +1 -1
- package/dist/esm/api/staking.mjs +1 -1
- package/dist/esm/api/transaction.mjs +1 -1
- package/dist/esm/api/transactionSubmission/build.mjs +1 -1
- package/dist/esm/api/transactionSubmission/management.mjs +1 -1
- package/dist/esm/api/transactionSubmission/sign.mjs +1 -1
- package/dist/esm/api/transactionSubmission/sign.mjs.map +1 -1
- package/dist/esm/api/transactionSubmission/simulate.mjs +1 -1
- package/dist/esm/api/transactionSubmission/submit.mjs +1 -1
- package/dist/esm/api/utils.mjs +1 -1
- package/dist/esm/bcs/index.mjs +1 -1
- package/dist/esm/bcs/serializable/movePrimitives.mjs +1 -1
- package/dist/esm/bcs/serializable/moveStructs.mjs +1 -1
- package/dist/esm/{chunk-APOQ4ODM.mjs → chunk-2QV6HI3M.mjs} +2 -2
- package/dist/esm/chunk-3NOQE6U3.mjs +2 -0
- package/dist/esm/chunk-3NOQE6U3.mjs.map +1 -0
- package/dist/esm/chunk-3UYBNX3P.mjs +2 -0
- package/dist/esm/{chunk-X3SXV2RB.mjs.map → chunk-3UYBNX3P.mjs.map} +1 -1
- package/dist/esm/{chunk-2BSSYT6I.mjs → chunk-4SAUEZTN.mjs} +2 -2
- package/dist/esm/chunk-4SAUEZTN.mjs.map +1 -0
- package/dist/esm/{chunk-6XQ33PLM.mjs → chunk-5L6SRCJP.mjs} +2 -2
- package/dist/esm/{chunk-J4CN3Q2R.mjs → chunk-5WXR2O3T.mjs} +2 -2
- package/dist/esm/chunk-6UNBJAV6.mjs +2 -0
- package/dist/esm/chunk-6UNBJAV6.mjs.map +1 -0
- package/dist/esm/chunk-6Y3VBRMN.mjs +2 -0
- package/dist/esm/chunk-6Y3VBRMN.mjs.map +1 -0
- package/dist/esm/chunk-77SKA4HT.mjs +2 -0
- package/dist/esm/chunk-77SKA4HT.mjs.map +1 -0
- package/dist/esm/{chunk-IK7JAKXG.mjs → chunk-7JTOGYO7.mjs} +2 -2
- package/dist/esm/{chunk-VP5JCW6I.mjs → chunk-A2QH4A6D.mjs} +2 -2
- package/dist/esm/chunk-AA3GRJNL.mjs +2 -0
- package/dist/esm/chunk-AA3GRJNL.mjs.map +1 -0
- package/dist/esm/{chunk-CFQDJZBD.mjs → chunk-C7ZX475J.mjs} +2 -2
- package/dist/esm/{chunk-4DI53MOX.mjs → chunk-CCUD52OF.mjs} +2 -2
- package/dist/esm/{chunk-4DI53MOX.mjs.map → chunk-CCUD52OF.mjs.map} +1 -1
- package/dist/esm/{chunk-BDHRLMQP.mjs → chunk-CX5ULWJQ.mjs} +2 -2
- package/dist/esm/{chunk-6IMEQXW4.mjs → chunk-D2GNCG27.mjs} +2 -2
- package/dist/esm/{chunk-3T4NSGK5.mjs → chunk-DRF6AMEZ.mjs} +2 -2
- package/dist/esm/{chunk-FGHNLZRH.mjs → chunk-ERWQOVBF.mjs} +2 -2
- package/dist/esm/{chunk-DSGIOUTJ.mjs → chunk-ESX5X52V.mjs} +2 -2
- package/dist/esm/{chunk-P7B32QR3.mjs → chunk-FBFMQZTM.mjs} +2 -2
- package/dist/esm/{chunk-WXWFKCGO.mjs → chunk-FP5DPRYL.mjs} +2 -2
- package/dist/esm/{chunk-HV4ZPHSZ.mjs → chunk-GVHOHNHT.mjs} +2 -2
- package/dist/esm/chunk-IKCBGNRD.mjs +2 -0
- package/dist/esm/{chunk-R3URESCV.mjs.map → chunk-IKCBGNRD.mjs.map} +1 -1
- package/dist/esm/chunk-INV6U3KS.mjs +2 -0
- package/dist/esm/chunk-INV6U3KS.mjs.map +1 -0
- package/dist/esm/{chunk-2MOYURM2.mjs → chunk-J6RCCKOA.mjs} +2 -2
- package/dist/esm/{chunk-DIWRS4YQ.mjs → chunk-JLL7BCD4.mjs} +2 -2
- package/dist/esm/{chunk-ZDT4TIOP.mjs → chunk-MKERJNYN.mjs} +2 -2
- package/dist/esm/{chunk-4QWK47EH.mjs → chunk-NWRKJFHV.mjs} +2 -2
- package/dist/esm/{chunk-S4QKXXBT.mjs → chunk-OVSV4Y32.mjs} +2 -2
- package/dist/esm/{chunk-K6IBDLVC.mjs → chunk-OWZLBIDD.mjs} +2 -2
- package/dist/esm/chunk-PJNPLRPR.mjs +2 -0
- package/dist/esm/chunk-PJNPLRPR.mjs.map +1 -0
- package/dist/esm/{chunk-NXAHJ4KY.mjs → chunk-Q7JKS6WV.mjs} +2 -2
- package/dist/esm/{chunk-ED2OMOMT.mjs → chunk-RIL4SHXC.mjs} +2 -2
- package/dist/esm/{chunk-PPNI7SJK.mjs → chunk-RNO5ZG3C.mjs} +2 -2
- package/dist/esm/{chunk-7WQA7OMS.mjs → chunk-SBMJNU2O.mjs} +2 -2
- package/dist/esm/chunk-SZYATFM7.mjs +2 -0
- package/dist/esm/chunk-SZYATFM7.mjs.map +1 -0
- package/dist/esm/{chunk-LFWMWCS3.mjs → chunk-T5IFXLOP.mjs} +2 -2
- package/dist/esm/{chunk-LFWMWCS3.mjs.map → chunk-T5IFXLOP.mjs.map} +1 -1
- package/dist/esm/chunk-TVURQPLA.mjs +2 -0
- package/dist/esm/chunk-TVURQPLA.mjs.map +1 -0
- package/dist/esm/{chunk-J46VAO6L.mjs → chunk-UCHGKGCF.mjs} +2 -2
- package/dist/esm/{chunk-DHFOORW6.mjs → chunk-UJAX75ON.mjs} +2 -2
- package/dist/esm/{chunk-ACMNL2LL.mjs → chunk-WC2WSKYZ.mjs} +2 -2
- package/dist/esm/{chunk-QYB75IJ6.mjs → chunk-WK36MJRI.mjs} +2 -2
- package/dist/esm/{chunk-6KILJ43F.mjs → chunk-WQI2RH2S.mjs} +2 -2
- package/dist/esm/{chunk-HT6K4NWZ.mjs → chunk-XOBXX273.mjs} +2 -2
- package/dist/esm/{chunk-TRTTUBC4.mjs → chunk-XQIWF5HY.mjs} +2 -2
- package/dist/esm/{chunk-25YXK6L2.mjs → chunk-YE3DZD6T.mjs} +2 -2
- package/dist/esm/{chunk-4TGKQEEE.mjs → chunk-YGMT4GQ5.mjs} +2 -2
- package/dist/esm/{chunk-W5PZ5Z4H.mjs → chunk-Z6XNTGNK.mjs} +2 -2
- package/dist/esm/{chunk-W5PZ5Z4H.mjs.map → chunk-Z6XNTGNK.mjs.map} +1 -1
- package/dist/esm/{chunk-JBWJE4IP.mjs → chunk-ZFPA45OK.mjs} +2 -2
- package/dist/esm/{chunk-JRQMEVDE.mjs → chunk-ZIZ7PVK2.mjs} +2 -2
- package/dist/esm/client/core.mjs +1 -1
- package/dist/esm/client/get.mjs +1 -1
- package/dist/esm/client/index.mjs +1 -1
- package/dist/esm/client/post.mjs +1 -1
- package/dist/esm/core/account.mjs +1 -1
- package/dist/esm/core/accountAddress.mjs +1 -1
- package/dist/esm/core/authenticationKey.mjs +1 -1
- package/dist/esm/core/crypto/anyPublicKey.mjs +1 -1
- package/dist/esm/core/crypto/anySignature.mjs +1 -1
- package/dist/esm/core/crypto/asymmetricCrypto.mjs +1 -1
- package/dist/esm/core/crypto/ed25519.mjs +1 -1
- package/dist/esm/core/crypto/index.mjs +1 -1
- package/dist/esm/core/crypto/multiEd25519.mjs +1 -1
- package/dist/esm/core/crypto/multiKey.mjs +1 -1
- package/dist/esm/core/crypto/secp256k1.mjs +1 -1
- package/dist/esm/core/index.mjs +1 -1
- package/dist/esm/index.d.mts +1 -1
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/internal/account.mjs +1 -1
- package/dist/esm/internal/ans.mjs +1 -1
- package/dist/esm/internal/coin.mjs +1 -1
- package/dist/esm/internal/digitalAsset.d.mts +4 -4
- package/dist/esm/internal/digitalAsset.mjs +1 -1
- package/dist/esm/internal/event.d.mts +2 -1
- package/dist/esm/internal/event.mjs +1 -1
- package/dist/esm/internal/faucet.mjs +1 -1
- package/dist/esm/internal/fungibleAsset.mjs +1 -1
- package/dist/esm/internal/general.mjs +1 -1
- package/dist/esm/internal/staking.mjs +1 -1
- package/dist/esm/internal/transaction.mjs +1 -1
- package/dist/esm/internal/transactionSubmission.mjs +1 -1
- package/dist/esm/transactions/authenticator/account.mjs +1 -1
- package/dist/esm/transactions/authenticator/index.mjs +1 -1
- package/dist/esm/transactions/authenticator/transaction.mjs +1 -1
- package/dist/esm/transactions/index.d.mts +1 -1
- package/dist/esm/transactions/index.mjs +1 -1
- package/dist/esm/transactions/instances/index.mjs +1 -1
- package/dist/esm/transactions/instances/moduleId.mjs +1 -1
- package/dist/esm/transactions/instances/rawTransaction.mjs +1 -1
- package/dist/esm/transactions/instances/rotationProofChallenge.mjs +1 -1
- package/dist/esm/transactions/instances/signedTransaction.mjs +1 -1
- package/dist/esm/transactions/instances/transactionPayload.mjs +1 -1
- package/dist/esm/transactions/management/accountSequenceNumber.mjs +1 -1
- package/dist/esm/transactions/management/index.mjs +1 -1
- package/dist/esm/transactions/management/transactionWorker.d.mts +7 -1
- package/dist/esm/transactions/management/transactionWorker.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/helpers.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/index.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/remoteAbi.mjs +1 -1
- package/dist/esm/transactions/transactionBuilder/transactionBuilder.d.mts +4 -3
- package/dist/esm/transactions/transactionBuilder/transactionBuilder.mjs +1 -1
- package/dist/esm/transactions/typeTag/index.d.mts +1 -0
- package/dist/esm/transactions/typeTag/index.mjs +1 -1
- package/dist/esm/transactions/typeTag/parser.mjs +1 -1
- package/dist/esm/transactions/types.d.mts +9 -1
- package/dist/esm/utils/apiEndpoints.d.mts +1 -0
- package/dist/esm/utils/apiEndpoints.mjs +1 -1
- package/dist/esm/utils/const.mjs +1 -1
- package/dist/esm/utils/index.mjs +1 -1
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +16 -16
- package/src/api/aptosConfig.ts +18 -0
- package/src/api/digitalAsset.ts +4 -4
- package/src/client/core.ts +9 -2
- package/src/client/get.ts +3 -7
- package/src/internal/ans.ts +1 -0
- package/src/internal/coin.ts +9 -4
- package/src/internal/digitalAsset.ts +197 -60
- package/src/internal/event.ts +9 -2
- package/src/internal/fungibleAsset.ts +15 -3
- package/src/internal/transactionSubmission.ts +40 -14
- package/src/transactions/management/transactionWorker.ts +9 -5
- package/src/transactions/transactionBuilder/transactionBuilder.ts +41 -30
- package/src/transactions/typeTag/index.ts +4 -0
- package/src/transactions/typeTag/parser.ts +1 -1
- package/src/transactions/types.ts +11 -0
- package/src/utils/apiEndpoints.ts +6 -0
- package/src/version.ts +1 -1
- package/dist/esm/chunk-2BSSYT6I.mjs.map +0 -1
- package/dist/esm/chunk-2RN7N3EO.mjs +0 -2
- package/dist/esm/chunk-2RN7N3EO.mjs.map +0 -1
- package/dist/esm/chunk-ATHZ7INX.mjs +0 -2
- package/dist/esm/chunk-ATHZ7INX.mjs.map +0 -1
- package/dist/esm/chunk-BQYQ45QQ.mjs +0 -2
- package/dist/esm/chunk-BQYQ45QQ.mjs.map +0 -1
- package/dist/esm/chunk-C53MNMPH.mjs +0 -2
- package/dist/esm/chunk-C53MNMPH.mjs.map +0 -1
- package/dist/esm/chunk-FE2DRPX7.mjs +0 -2
- package/dist/esm/chunk-FE2DRPX7.mjs.map +0 -1
- package/dist/esm/chunk-FHUT4EJH.mjs +0 -2
- package/dist/esm/chunk-FHUT4EJH.mjs.map +0 -1
- package/dist/esm/chunk-HI6QP2FB.mjs +0 -2
- package/dist/esm/chunk-HI6QP2FB.mjs.map +0 -1
- package/dist/esm/chunk-JMV2QDNW.mjs +0 -2
- package/dist/esm/chunk-JMV2QDNW.mjs.map +0 -1
- package/dist/esm/chunk-LV33NV4J.mjs +0 -2
- package/dist/esm/chunk-LV33NV4J.mjs.map +0 -1
- package/dist/esm/chunk-R3URESCV.mjs +0 -2
- package/dist/esm/chunk-X3SXV2RB.mjs +0 -2
- /package/dist/esm/{chunk-APOQ4ODM.mjs.map → chunk-2QV6HI3M.mjs.map} +0 -0
- /package/dist/esm/{chunk-6XQ33PLM.mjs.map → chunk-5L6SRCJP.mjs.map} +0 -0
- /package/dist/esm/{chunk-J4CN3Q2R.mjs.map → chunk-5WXR2O3T.mjs.map} +0 -0
- /package/dist/esm/{chunk-IK7JAKXG.mjs.map → chunk-7JTOGYO7.mjs.map} +0 -0
- /package/dist/esm/{chunk-VP5JCW6I.mjs.map → chunk-A2QH4A6D.mjs.map} +0 -0
- /package/dist/esm/{chunk-CFQDJZBD.mjs.map → chunk-C7ZX475J.mjs.map} +0 -0
- /package/dist/esm/{chunk-BDHRLMQP.mjs.map → chunk-CX5ULWJQ.mjs.map} +0 -0
- /package/dist/esm/{chunk-6IMEQXW4.mjs.map → chunk-D2GNCG27.mjs.map} +0 -0
- /package/dist/esm/{chunk-3T4NSGK5.mjs.map → chunk-DRF6AMEZ.mjs.map} +0 -0
- /package/dist/esm/{chunk-FGHNLZRH.mjs.map → chunk-ERWQOVBF.mjs.map} +0 -0
- /package/dist/esm/{chunk-DSGIOUTJ.mjs.map → chunk-ESX5X52V.mjs.map} +0 -0
- /package/dist/esm/{chunk-P7B32QR3.mjs.map → chunk-FBFMQZTM.mjs.map} +0 -0
- /package/dist/esm/{chunk-WXWFKCGO.mjs.map → chunk-FP5DPRYL.mjs.map} +0 -0
- /package/dist/esm/{chunk-HV4ZPHSZ.mjs.map → chunk-GVHOHNHT.mjs.map} +0 -0
- /package/dist/esm/{chunk-2MOYURM2.mjs.map → chunk-J6RCCKOA.mjs.map} +0 -0
- /package/dist/esm/{chunk-DIWRS4YQ.mjs.map → chunk-JLL7BCD4.mjs.map} +0 -0
- /package/dist/esm/{chunk-ZDT4TIOP.mjs.map → chunk-MKERJNYN.mjs.map} +0 -0
- /package/dist/esm/{chunk-4QWK47EH.mjs.map → chunk-NWRKJFHV.mjs.map} +0 -0
- /package/dist/esm/{chunk-S4QKXXBT.mjs.map → chunk-OVSV4Y32.mjs.map} +0 -0
- /package/dist/esm/{chunk-K6IBDLVC.mjs.map → chunk-OWZLBIDD.mjs.map} +0 -0
- /package/dist/esm/{chunk-NXAHJ4KY.mjs.map → chunk-Q7JKS6WV.mjs.map} +0 -0
- /package/dist/esm/{chunk-ED2OMOMT.mjs.map → chunk-RIL4SHXC.mjs.map} +0 -0
- /package/dist/esm/{chunk-PPNI7SJK.mjs.map → chunk-RNO5ZG3C.mjs.map} +0 -0
- /package/dist/esm/{chunk-7WQA7OMS.mjs.map → chunk-SBMJNU2O.mjs.map} +0 -0
- /package/dist/esm/{chunk-J46VAO6L.mjs.map → chunk-UCHGKGCF.mjs.map} +0 -0
- /package/dist/esm/{chunk-DHFOORW6.mjs.map → chunk-UJAX75ON.mjs.map} +0 -0
- /package/dist/esm/{chunk-ACMNL2LL.mjs.map → chunk-WC2WSKYZ.mjs.map} +0 -0
- /package/dist/esm/{chunk-QYB75IJ6.mjs.map → chunk-WK36MJRI.mjs.map} +0 -0
- /package/dist/esm/{chunk-6KILJ43F.mjs.map → chunk-WQI2RH2S.mjs.map} +0 -0
- /package/dist/esm/{chunk-HT6K4NWZ.mjs.map → chunk-XOBXX273.mjs.map} +0 -0
- /package/dist/esm/{chunk-TRTTUBC4.mjs.map → chunk-XQIWF5HY.mjs.map} +0 -0
- /package/dist/esm/{chunk-25YXK6L2.mjs.map → chunk-YE3DZD6T.mjs.map} +0 -0
- /package/dist/esm/{chunk-4TGKQEEE.mjs.map → chunk-YGMT4GQ5.mjs.map} +0 -0
- /package/dist/esm/{chunk-JBWJE4IP.mjs.map → chunk-ZFPA45OK.mjs.map} +0 -0
- /package/dist/esm/{chunk-JRQMEVDE.mjs.map → chunk-ZIZ7PVK2.mjs.map} +0 -0
|
@@ -9,9 +9,9 @@
|
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
import { AptosConfig } from "../api/aptosConfig";
|
|
12
|
-
import { MoveString,
|
|
12
|
+
import { Bool, MoveString, MoveVector, U64 } from "../bcs";
|
|
13
13
|
import { Account, AccountAddress, AccountAddressInput } from "../core";
|
|
14
|
-
import { InputGenerateTransactionOptions, SimpleTransaction } from "../transactions/types";
|
|
14
|
+
import { EntryFunctionABI, InputGenerateTransactionOptions, SimpleTransaction } from "../transactions/types";
|
|
15
15
|
import {
|
|
16
16
|
AnyNumber,
|
|
17
17
|
GetCollectionDataResponse,
|
|
@@ -19,6 +19,7 @@ import {
|
|
|
19
19
|
GetOwnedTokensResponse,
|
|
20
20
|
GetTokenActivityResponse,
|
|
21
21
|
GetTokenDataResponse,
|
|
22
|
+
MoveAbility,
|
|
22
23
|
MoveStructId,
|
|
23
24
|
OrderByArg,
|
|
24
25
|
PaginationArgs,
|
|
@@ -40,7 +41,18 @@ import { queryIndexer } from "./general";
|
|
|
40
41
|
import { generateTransaction } from "./transactionSubmission";
|
|
41
42
|
import { MAX_U64_BIG_INT } from "../bcs/consts";
|
|
42
43
|
import { CurrentTokenOwnershipsV2BoolExp, TokenActivitiesV2BoolExp } from "../types/generated/types";
|
|
43
|
-
import {
|
|
44
|
+
import {
|
|
45
|
+
checkOrConvertArgument,
|
|
46
|
+
objectStructTag,
|
|
47
|
+
parseTypeTag,
|
|
48
|
+
stringStructTag,
|
|
49
|
+
TypeTagAddress,
|
|
50
|
+
TypeTagBool,
|
|
51
|
+
TypeTagGeneric,
|
|
52
|
+
TypeTagStruct,
|
|
53
|
+
TypeTagU64,
|
|
54
|
+
TypeTagVector,
|
|
55
|
+
} from "../transactions";
|
|
44
56
|
|
|
45
57
|
// A property type map for the user input and what Move expects
|
|
46
58
|
const PropertyTypeMap = {
|
|
@@ -196,6 +208,27 @@ export interface CreateCollectionOptions {
|
|
|
196
208
|
royaltyDenominator?: number;
|
|
197
209
|
}
|
|
198
210
|
|
|
211
|
+
const createCollectionAbi: EntryFunctionABI = {
|
|
212
|
+
typeParameters: [],
|
|
213
|
+
parameters: [
|
|
214
|
+
new TypeTagStruct(stringStructTag()),
|
|
215
|
+
new TypeTagU64(),
|
|
216
|
+
new TypeTagStruct(stringStructTag()),
|
|
217
|
+
new TypeTagStruct(stringStructTag()),
|
|
218
|
+
new TypeTagBool(),
|
|
219
|
+
new TypeTagBool(),
|
|
220
|
+
new TypeTagBool(),
|
|
221
|
+
new TypeTagBool(),
|
|
222
|
+
new TypeTagBool(),
|
|
223
|
+
new TypeTagBool(),
|
|
224
|
+
new TypeTagBool(),
|
|
225
|
+
new TypeTagBool(),
|
|
226
|
+
new TypeTagBool(),
|
|
227
|
+
new TypeTagU64(),
|
|
228
|
+
new TypeTagU64(),
|
|
229
|
+
],
|
|
230
|
+
};
|
|
231
|
+
|
|
199
232
|
export async function createCollectionTransaction(
|
|
200
233
|
args: {
|
|
201
234
|
aptosConfig: AptosConfig;
|
|
@@ -207,7 +240,7 @@ export async function createCollectionTransaction(
|
|
|
207
240
|
} & CreateCollectionOptions,
|
|
208
241
|
): Promise<SimpleTransaction> {
|
|
209
242
|
const { aptosConfig, options, creator } = args;
|
|
210
|
-
|
|
243
|
+
return generateTransaction({
|
|
211
244
|
aptosConfig,
|
|
212
245
|
sender: creator.accountAddress,
|
|
213
246
|
data: {
|
|
@@ -230,10 +263,10 @@ export async function createCollectionTransaction(
|
|
|
230
263
|
new U64(args.royaltyNumerator ?? 0),
|
|
231
264
|
new U64(args.royaltyDenominator ?? 1),
|
|
232
265
|
],
|
|
266
|
+
abi: createCollectionAbi,
|
|
233
267
|
},
|
|
234
268
|
options,
|
|
235
269
|
});
|
|
236
|
-
return transaction;
|
|
237
270
|
}
|
|
238
271
|
|
|
239
272
|
export async function getCollectionData(args: {
|
|
@@ -280,6 +313,19 @@ export async function getCollectionId(args: {
|
|
|
280
313
|
|
|
281
314
|
// TRANSACTIONS
|
|
282
315
|
|
|
316
|
+
const mintDigitalAssetAbi: EntryFunctionABI = {
|
|
317
|
+
typeParameters: [],
|
|
318
|
+
parameters: [
|
|
319
|
+
new TypeTagStruct(stringStructTag()),
|
|
320
|
+
new TypeTagStruct(stringStructTag()),
|
|
321
|
+
new TypeTagStruct(stringStructTag()),
|
|
322
|
+
new TypeTagStruct(stringStructTag()),
|
|
323
|
+
new TypeTagVector(new TypeTagStruct(stringStructTag())),
|
|
324
|
+
new TypeTagVector(new TypeTagStruct(stringStructTag())),
|
|
325
|
+
new TypeTagVector(TypeTagVector.u8()),
|
|
326
|
+
],
|
|
327
|
+
};
|
|
328
|
+
|
|
283
329
|
export async function mintDigitalAssetTransaction(args: {
|
|
284
330
|
aptosConfig: AptosConfig;
|
|
285
331
|
creator: Account;
|
|
@@ -305,48 +351,67 @@ export async function mintDigitalAssetTransaction(args: {
|
|
|
305
351
|
propertyValues,
|
|
306
352
|
} = args;
|
|
307
353
|
const convertedPropertyType = propertyTypes?.map((type) => PropertyTypeMap[type]);
|
|
308
|
-
|
|
354
|
+
return generateTransaction({
|
|
309
355
|
aptosConfig,
|
|
310
356
|
sender: creator.accountAddress,
|
|
311
357
|
data: {
|
|
312
358
|
function: "0x4::aptos_token::mint",
|
|
313
359
|
functionArguments: [
|
|
314
|
-
collection,
|
|
315
|
-
description,
|
|
316
|
-
name,
|
|
317
|
-
uri,
|
|
318
|
-
propertyKeys ?? [],
|
|
319
|
-
convertedPropertyType ?? [],
|
|
360
|
+
new MoveString(collection),
|
|
361
|
+
new MoveString(description),
|
|
362
|
+
new MoveString(name),
|
|
363
|
+
new MoveString(uri),
|
|
364
|
+
MoveVector.MoveString(propertyKeys ?? []),
|
|
365
|
+
MoveVector.MoveString(convertedPropertyType ?? []),
|
|
320
366
|
getPropertyValueRaw(propertyValues ?? [], convertedPropertyType ?? []),
|
|
321
367
|
],
|
|
368
|
+
abi: mintDigitalAssetAbi,
|
|
322
369
|
},
|
|
323
370
|
options,
|
|
324
371
|
});
|
|
325
|
-
return transaction;
|
|
326
372
|
}
|
|
327
373
|
|
|
374
|
+
const transferDigitalAssetAbi: EntryFunctionABI = {
|
|
375
|
+
typeParameters: [{ constraints: [MoveAbility.KEY] }],
|
|
376
|
+
parameters: [new TypeTagStruct(objectStructTag(new TypeTagGeneric(0))), new TypeTagAddress()],
|
|
377
|
+
};
|
|
378
|
+
|
|
328
379
|
export async function transferDigitalAssetTransaction(args: {
|
|
329
380
|
aptosConfig: AptosConfig;
|
|
330
381
|
sender: Account;
|
|
331
382
|
digitalAssetAddress: AccountAddressInput;
|
|
332
|
-
recipient:
|
|
383
|
+
recipient: AccountAddressInput;
|
|
333
384
|
digitalAssetType?: MoveStructId;
|
|
334
385
|
options?: InputGenerateTransactionOptions;
|
|
335
386
|
}): Promise<SimpleTransaction> {
|
|
336
387
|
const { aptosConfig, sender, digitalAssetAddress, recipient, digitalAssetType, options } = args;
|
|
337
|
-
|
|
388
|
+
return generateTransaction({
|
|
338
389
|
aptosConfig,
|
|
339
390
|
sender: sender.accountAddress,
|
|
340
391
|
data: {
|
|
341
392
|
function: "0x1::object::transfer",
|
|
342
393
|
typeArguments: [digitalAssetType ?? defaultDigitalAssetType],
|
|
343
|
-
functionArguments: [digitalAssetAddress, recipient],
|
|
394
|
+
functionArguments: [AccountAddress.from(digitalAssetAddress), AccountAddress.from(recipient)],
|
|
395
|
+
abi: transferDigitalAssetAbi,
|
|
344
396
|
},
|
|
345
397
|
options,
|
|
346
398
|
});
|
|
347
|
-
return transaction;
|
|
348
399
|
}
|
|
349
400
|
|
|
401
|
+
const mintSoulBoundAbi: EntryFunctionABI = {
|
|
402
|
+
typeParameters: [],
|
|
403
|
+
parameters: [
|
|
404
|
+
new TypeTagStruct(stringStructTag()),
|
|
405
|
+
new TypeTagStruct(stringStructTag()),
|
|
406
|
+
new TypeTagStruct(stringStructTag()),
|
|
407
|
+
new TypeTagStruct(stringStructTag()),
|
|
408
|
+
new TypeTagVector(new TypeTagStruct(stringStructTag())),
|
|
409
|
+
new TypeTagVector(new TypeTagStruct(stringStructTag())),
|
|
410
|
+
new TypeTagVector(TypeTagVector.u8()),
|
|
411
|
+
new TypeTagAddress(),
|
|
412
|
+
],
|
|
413
|
+
};
|
|
414
|
+
|
|
350
415
|
export async function mintSoulBoundTransaction(args: {
|
|
351
416
|
aptosConfig: AptosConfig;
|
|
352
417
|
account: Account;
|
|
@@ -380,7 +445,7 @@ export async function mintSoulBoundTransaction(args: {
|
|
|
380
445
|
throw new Error("Property types and property values counts do not match");
|
|
381
446
|
}
|
|
382
447
|
const convertedPropertyType = propertyTypes?.map((type) => PropertyTypeMap[type]);
|
|
383
|
-
|
|
448
|
+
return generateTransaction({
|
|
384
449
|
aptosConfig,
|
|
385
450
|
sender: account.accountAddress,
|
|
386
451
|
data: {
|
|
@@ -390,18 +455,22 @@ export async function mintSoulBoundTransaction(args: {
|
|
|
390
455
|
description,
|
|
391
456
|
name,
|
|
392
457
|
uri,
|
|
393
|
-
propertyKeys ?? [],
|
|
394
|
-
convertedPropertyType ?? [],
|
|
458
|
+
MoveVector.MoveString(propertyKeys ?? []),
|
|
459
|
+
MoveVector.MoveString(convertedPropertyType ?? []),
|
|
395
460
|
getPropertyValueRaw(propertyValues ?? [], convertedPropertyType ?? []),
|
|
396
461
|
recipient,
|
|
397
462
|
],
|
|
463
|
+
abi: mintSoulBoundAbi,
|
|
398
464
|
},
|
|
399
465
|
options,
|
|
400
466
|
});
|
|
401
|
-
|
|
402
|
-
return transaction;
|
|
403
467
|
}
|
|
404
468
|
|
|
469
|
+
const burnDigitalAssetAbi: EntryFunctionABI = {
|
|
470
|
+
typeParameters: [{ constraints: [MoveAbility.KEY] }],
|
|
471
|
+
parameters: [new TypeTagStruct(objectStructTag(new TypeTagGeneric(0)))],
|
|
472
|
+
};
|
|
473
|
+
|
|
405
474
|
export async function burnDigitalAssetTransaction(args: {
|
|
406
475
|
aptosConfig: AptosConfig;
|
|
407
476
|
creator: Account;
|
|
@@ -410,20 +479,25 @@ export async function burnDigitalAssetTransaction(args: {
|
|
|
410
479
|
options?: InputGenerateTransactionOptions;
|
|
411
480
|
}): Promise<SimpleTransaction> {
|
|
412
481
|
const { aptosConfig, creator, digitalAssetAddress, digitalAssetType, options } = args;
|
|
413
|
-
|
|
482
|
+
return generateTransaction({
|
|
414
483
|
aptosConfig,
|
|
415
484
|
sender: creator.accountAddress,
|
|
416
485
|
data: {
|
|
417
486
|
function: "0x4::aptos_token::burn",
|
|
418
487
|
typeArguments: [digitalAssetType ?? defaultDigitalAssetType],
|
|
419
|
-
functionArguments: [digitalAssetAddress],
|
|
488
|
+
functionArguments: [AccountAddress.from(digitalAssetAddress)],
|
|
489
|
+
abi: burnDigitalAssetAbi,
|
|
420
490
|
},
|
|
421
491
|
options,
|
|
422
492
|
});
|
|
423
|
-
return transaction;
|
|
424
493
|
}
|
|
425
494
|
|
|
426
|
-
|
|
495
|
+
const freezeDigitalAssetAbi: EntryFunctionABI = {
|
|
496
|
+
typeParameters: [{ constraints: [MoveAbility.KEY] }],
|
|
497
|
+
parameters: [new TypeTagStruct(objectStructTag(new TypeTagGeneric(0)))],
|
|
498
|
+
};
|
|
499
|
+
|
|
500
|
+
export async function freezeDigitalAssetTransferTransaction(args: {
|
|
427
501
|
aptosConfig: AptosConfig;
|
|
428
502
|
creator: Account;
|
|
429
503
|
digitalAssetAddress: AccountAddressInput;
|
|
@@ -431,20 +505,25 @@ export async function freezeDigitalAssetTransaferTransaction(args: {
|
|
|
431
505
|
options?: InputGenerateTransactionOptions;
|
|
432
506
|
}): Promise<SimpleTransaction> {
|
|
433
507
|
const { aptosConfig, creator, digitalAssetAddress, digitalAssetType, options } = args;
|
|
434
|
-
|
|
508
|
+
return generateTransaction({
|
|
435
509
|
aptosConfig,
|
|
436
510
|
sender: creator.accountAddress,
|
|
437
511
|
data: {
|
|
438
512
|
function: "0x4::aptos_token::freeze_transfer",
|
|
439
513
|
typeArguments: [digitalAssetType ?? defaultDigitalAssetType],
|
|
440
514
|
functionArguments: [digitalAssetAddress],
|
|
515
|
+
abi: freezeDigitalAssetAbi,
|
|
441
516
|
},
|
|
442
517
|
options,
|
|
443
518
|
});
|
|
444
|
-
return transaction;
|
|
445
519
|
}
|
|
446
520
|
|
|
447
|
-
|
|
521
|
+
const unfreezeDigitalAssetAbi: EntryFunctionABI = {
|
|
522
|
+
typeParameters: [{ constraints: [MoveAbility.KEY] }],
|
|
523
|
+
parameters: [new TypeTagStruct(objectStructTag(new TypeTagGeneric(0)))],
|
|
524
|
+
};
|
|
525
|
+
|
|
526
|
+
export async function unfreezeDigitalAssetTransferTransaction(args: {
|
|
448
527
|
aptosConfig: AptosConfig;
|
|
449
528
|
creator: Account;
|
|
450
529
|
digitalAssetAddress: AccountAddressInput;
|
|
@@ -452,19 +531,24 @@ export async function unfreezeDigitalAssetTransaferTransaction(args: {
|
|
|
452
531
|
options?: InputGenerateTransactionOptions;
|
|
453
532
|
}): Promise<SimpleTransaction> {
|
|
454
533
|
const { aptosConfig, creator, digitalAssetAddress, digitalAssetType, options } = args;
|
|
455
|
-
|
|
534
|
+
return generateTransaction({
|
|
456
535
|
aptosConfig,
|
|
457
536
|
sender: creator.accountAddress,
|
|
458
537
|
data: {
|
|
459
538
|
function: "0x4::aptos_token::unfreeze_transfer",
|
|
460
539
|
typeArguments: [digitalAssetType ?? defaultDigitalAssetType],
|
|
461
540
|
functionArguments: [digitalAssetAddress],
|
|
541
|
+
abi: unfreezeDigitalAssetAbi,
|
|
462
542
|
},
|
|
463
543
|
options,
|
|
464
544
|
});
|
|
465
|
-
return transaction;
|
|
466
545
|
}
|
|
467
546
|
|
|
547
|
+
const setDigitalAssetDescriptionAbi: EntryFunctionABI = {
|
|
548
|
+
typeParameters: [{ constraints: [MoveAbility.KEY] }],
|
|
549
|
+
parameters: [new TypeTagStruct(objectStructTag(new TypeTagGeneric(0))), new TypeTagStruct(stringStructTag())],
|
|
550
|
+
};
|
|
551
|
+
|
|
468
552
|
export async function setDigitalAssetDescriptionTransaction(args: {
|
|
469
553
|
aptosConfig: AptosConfig;
|
|
470
554
|
creator: Account;
|
|
@@ -474,19 +558,24 @@ export async function setDigitalAssetDescriptionTransaction(args: {
|
|
|
474
558
|
options?: InputGenerateTransactionOptions;
|
|
475
559
|
}): Promise<SimpleTransaction> {
|
|
476
560
|
const { aptosConfig, creator, description, digitalAssetAddress, digitalAssetType, options } = args;
|
|
477
|
-
|
|
561
|
+
return generateTransaction({
|
|
478
562
|
aptosConfig,
|
|
479
563
|
sender: creator.accountAddress,
|
|
480
564
|
data: {
|
|
481
565
|
function: "0x4::aptos_token::set_description",
|
|
482
566
|
typeArguments: [digitalAssetType ?? defaultDigitalAssetType],
|
|
483
|
-
functionArguments: [digitalAssetAddress, description],
|
|
567
|
+
functionArguments: [AccountAddress.from(digitalAssetAddress), new MoveString(description)],
|
|
568
|
+
abi: setDigitalAssetDescriptionAbi,
|
|
484
569
|
},
|
|
485
570
|
options,
|
|
486
571
|
});
|
|
487
|
-
return transaction;
|
|
488
572
|
}
|
|
489
573
|
|
|
574
|
+
const setDigitalAssetNameAbi: EntryFunctionABI = {
|
|
575
|
+
typeParameters: [{ constraints: [MoveAbility.KEY] }],
|
|
576
|
+
parameters: [new TypeTagStruct(objectStructTag(new TypeTagGeneric(0))), new TypeTagStruct(stringStructTag())],
|
|
577
|
+
};
|
|
578
|
+
|
|
490
579
|
export async function setDigitalAssetNameTransaction(args: {
|
|
491
580
|
aptosConfig: AptosConfig;
|
|
492
581
|
creator: Account;
|
|
@@ -496,19 +585,24 @@ export async function setDigitalAssetNameTransaction(args: {
|
|
|
496
585
|
options?: InputGenerateTransactionOptions;
|
|
497
586
|
}): Promise<SimpleTransaction> {
|
|
498
587
|
const { aptosConfig, creator, name, digitalAssetAddress, digitalAssetType, options } = args;
|
|
499
|
-
|
|
588
|
+
return generateTransaction({
|
|
500
589
|
aptosConfig,
|
|
501
590
|
sender: creator.accountAddress,
|
|
502
591
|
data: {
|
|
503
592
|
function: "0x4::aptos_token::set_name",
|
|
504
593
|
typeArguments: [digitalAssetType ?? defaultDigitalAssetType],
|
|
505
|
-
functionArguments: [digitalAssetAddress, name],
|
|
594
|
+
functionArguments: [AccountAddress.from(digitalAssetAddress), new MoveString(name)],
|
|
595
|
+
abi: setDigitalAssetNameAbi,
|
|
506
596
|
},
|
|
507
597
|
options,
|
|
508
598
|
});
|
|
509
|
-
return transaction;
|
|
510
599
|
}
|
|
511
600
|
|
|
601
|
+
const setDigitalAssetURIAbi: EntryFunctionABI = {
|
|
602
|
+
typeParameters: [{ constraints: [MoveAbility.KEY] }],
|
|
603
|
+
parameters: [new TypeTagStruct(objectStructTag(new TypeTagGeneric(0))), new TypeTagStruct(stringStructTag())],
|
|
604
|
+
};
|
|
605
|
+
|
|
512
606
|
export async function setDigitalAssetURITransaction(args: {
|
|
513
607
|
aptosConfig: AptosConfig;
|
|
514
608
|
creator: Account;
|
|
@@ -518,19 +612,29 @@ export async function setDigitalAssetURITransaction(args: {
|
|
|
518
612
|
options?: InputGenerateTransactionOptions;
|
|
519
613
|
}): Promise<SimpleTransaction> {
|
|
520
614
|
const { aptosConfig, creator, uri, digitalAssetAddress, digitalAssetType, options } = args;
|
|
521
|
-
|
|
615
|
+
return generateTransaction({
|
|
522
616
|
aptosConfig,
|
|
523
617
|
sender: creator.accountAddress,
|
|
524
618
|
data: {
|
|
525
619
|
function: "0x4::aptos_token::set_uri",
|
|
526
620
|
typeArguments: [digitalAssetType ?? defaultDigitalAssetType],
|
|
527
|
-
functionArguments: [digitalAssetAddress, uri],
|
|
621
|
+
functionArguments: [AccountAddress.from(digitalAssetAddress), new MoveString(uri)],
|
|
622
|
+
abi: setDigitalAssetURIAbi,
|
|
528
623
|
},
|
|
529
624
|
options,
|
|
530
625
|
});
|
|
531
|
-
return transaction;
|
|
532
626
|
}
|
|
533
627
|
|
|
628
|
+
const addDigitalAssetPropertyAbi: EntryFunctionABI = {
|
|
629
|
+
typeParameters: [{ constraints: [MoveAbility.KEY] }],
|
|
630
|
+
parameters: [
|
|
631
|
+
new TypeTagStruct(objectStructTag(new TypeTagGeneric(0))),
|
|
632
|
+
new TypeTagStruct(stringStructTag()),
|
|
633
|
+
new TypeTagStruct(stringStructTag()),
|
|
634
|
+
TypeTagVector.u8(),
|
|
635
|
+
],
|
|
636
|
+
};
|
|
637
|
+
|
|
534
638
|
export async function addDigitalAssetPropertyTransaction(args: {
|
|
535
639
|
aptosConfig: AptosConfig;
|
|
536
640
|
creator: Account;
|
|
@@ -551,24 +655,29 @@ export async function addDigitalAssetPropertyTransaction(args: {
|
|
|
551
655
|
digitalAssetType,
|
|
552
656
|
options,
|
|
553
657
|
} = args;
|
|
554
|
-
|
|
658
|
+
return generateTransaction({
|
|
555
659
|
aptosConfig,
|
|
556
660
|
sender: creator.accountAddress,
|
|
557
661
|
data: {
|
|
558
662
|
function: "0x4::aptos_token::add_property",
|
|
559
663
|
typeArguments: [digitalAssetType ?? defaultDigitalAssetType],
|
|
560
664
|
functionArguments: [
|
|
561
|
-
digitalAssetAddress,
|
|
562
|
-
propertyKey,
|
|
563
|
-
PropertyTypeMap[propertyType],
|
|
564
|
-
getSinglePropertyValueRaw(propertyValue, PropertyTypeMap[propertyType]),
|
|
665
|
+
AccountAddress.from(digitalAssetAddress),
|
|
666
|
+
new MoveString(propertyKey),
|
|
667
|
+
new MoveString(PropertyTypeMap[propertyType]),
|
|
668
|
+
MoveVector.U8(getSinglePropertyValueRaw(propertyValue, PropertyTypeMap[propertyType])),
|
|
565
669
|
],
|
|
670
|
+
abi: addDigitalAssetPropertyAbi,
|
|
566
671
|
},
|
|
567
672
|
options,
|
|
568
673
|
});
|
|
569
|
-
return transaction;
|
|
570
674
|
}
|
|
571
675
|
|
|
676
|
+
const removeDigitalAssetPropertyAbi: EntryFunctionABI = {
|
|
677
|
+
typeParameters: [{ constraints: [MoveAbility.KEY] }],
|
|
678
|
+
parameters: [new TypeTagStruct(objectStructTag(new TypeTagGeneric(0))), new TypeTagStruct(stringStructTag())],
|
|
679
|
+
};
|
|
680
|
+
|
|
572
681
|
export async function removeDigitalAssetPropertyTransaction(args: {
|
|
573
682
|
aptosConfig: AptosConfig;
|
|
574
683
|
creator: Account;
|
|
@@ -578,19 +687,29 @@ export async function removeDigitalAssetPropertyTransaction(args: {
|
|
|
578
687
|
options?: InputGenerateTransactionOptions;
|
|
579
688
|
}): Promise<SimpleTransaction> {
|
|
580
689
|
const { aptosConfig, creator, propertyKey, digitalAssetAddress, digitalAssetType, options } = args;
|
|
581
|
-
|
|
690
|
+
return generateTransaction({
|
|
582
691
|
aptosConfig,
|
|
583
692
|
sender: creator.accountAddress,
|
|
584
693
|
data: {
|
|
585
694
|
function: "0x4::aptos_token::remove_property",
|
|
586
695
|
typeArguments: [digitalAssetType ?? defaultDigitalAssetType],
|
|
587
|
-
functionArguments: [digitalAssetAddress, propertyKey],
|
|
696
|
+
functionArguments: [AccountAddress.from(digitalAssetAddress), new MoveString(propertyKey)],
|
|
697
|
+
abi: removeDigitalAssetPropertyAbi,
|
|
588
698
|
},
|
|
589
699
|
options,
|
|
590
700
|
});
|
|
591
|
-
return transaction;
|
|
592
701
|
}
|
|
593
702
|
|
|
703
|
+
const updateDigitalAssetPropertyAbi: EntryFunctionABI = {
|
|
704
|
+
typeParameters: [{ constraints: [MoveAbility.KEY] }],
|
|
705
|
+
parameters: [
|
|
706
|
+
new TypeTagStruct(objectStructTag(new TypeTagGeneric(0))),
|
|
707
|
+
new TypeTagStruct(stringStructTag()),
|
|
708
|
+
new TypeTagStruct(stringStructTag()),
|
|
709
|
+
TypeTagVector.u8(),
|
|
710
|
+
],
|
|
711
|
+
};
|
|
712
|
+
|
|
594
713
|
export async function updateDigitalAssetPropertyTransaction(args: {
|
|
595
714
|
aptosConfig: AptosConfig;
|
|
596
715
|
creator: Account;
|
|
@@ -611,24 +730,33 @@ export async function updateDigitalAssetPropertyTransaction(args: {
|
|
|
611
730
|
digitalAssetType,
|
|
612
731
|
options,
|
|
613
732
|
} = args;
|
|
614
|
-
|
|
733
|
+
return generateTransaction({
|
|
615
734
|
aptosConfig,
|
|
616
735
|
sender: creator.accountAddress,
|
|
617
736
|
data: {
|
|
618
737
|
function: "0x4::aptos_token::update_property",
|
|
619
738
|
typeArguments: [digitalAssetType ?? defaultDigitalAssetType],
|
|
620
739
|
functionArguments: [
|
|
621
|
-
digitalAssetAddress,
|
|
622
|
-
propertyKey,
|
|
623
|
-
PropertyTypeMap[propertyType],
|
|
740
|
+
AccountAddress.from(digitalAssetAddress),
|
|
741
|
+
new MoveString(propertyKey),
|
|
742
|
+
new MoveString(PropertyTypeMap[propertyType]),
|
|
624
743
|
getSinglePropertyValueRaw(propertyValue, PropertyTypeMap[propertyType]),
|
|
625
744
|
],
|
|
745
|
+
abi: updateDigitalAssetPropertyAbi,
|
|
626
746
|
},
|
|
627
747
|
options,
|
|
628
748
|
});
|
|
629
|
-
return transaction;
|
|
630
749
|
}
|
|
631
750
|
|
|
751
|
+
const addDigitalAssetTypedPropertyAbi: EntryFunctionABI = {
|
|
752
|
+
typeParameters: [{ constraints: [MoveAbility.KEY] }, { constraints: [] }],
|
|
753
|
+
parameters: [
|
|
754
|
+
new TypeTagStruct(objectStructTag(new TypeTagGeneric(0))),
|
|
755
|
+
new TypeTagStruct(stringStructTag()),
|
|
756
|
+
new TypeTagGeneric(1),
|
|
757
|
+
],
|
|
758
|
+
};
|
|
759
|
+
|
|
632
760
|
export async function addDigitalAssetTypedPropertyTransaction(args: {
|
|
633
761
|
aptosConfig: AptosConfig;
|
|
634
762
|
creator: Account;
|
|
@@ -649,19 +777,28 @@ export async function addDigitalAssetTypedPropertyTransaction(args: {
|
|
|
649
777
|
digitalAssetType,
|
|
650
778
|
options,
|
|
651
779
|
} = args;
|
|
652
|
-
|
|
780
|
+
return generateTransaction({
|
|
653
781
|
aptosConfig,
|
|
654
782
|
sender: creator.accountAddress,
|
|
655
783
|
data: {
|
|
656
784
|
function: "0x4::aptos_token::add_typed_property",
|
|
657
785
|
typeArguments: [digitalAssetType ?? defaultDigitalAssetType, PropertyTypeMap[propertyType]],
|
|
658
|
-
functionArguments: [digitalAssetAddress, propertyKey, propertyValue],
|
|
786
|
+
functionArguments: [AccountAddress.from(digitalAssetAddress), new MoveString(propertyKey), propertyValue],
|
|
787
|
+
abi: addDigitalAssetTypedPropertyAbi,
|
|
659
788
|
},
|
|
660
789
|
options,
|
|
661
790
|
});
|
|
662
|
-
return transaction;
|
|
663
791
|
}
|
|
664
792
|
|
|
793
|
+
const updateDigitalAssetTypedPropertyAbi: EntryFunctionABI = {
|
|
794
|
+
typeParameters: [{ constraints: [MoveAbility.KEY] }, { constraints: [] }],
|
|
795
|
+
parameters: [
|
|
796
|
+
new TypeTagStruct(objectStructTag(new TypeTagGeneric(0))),
|
|
797
|
+
new TypeTagStruct(stringStructTag()),
|
|
798
|
+
new TypeTagGeneric(1),
|
|
799
|
+
],
|
|
800
|
+
};
|
|
801
|
+
|
|
665
802
|
export async function updateDigitalAssetTypedPropertyTransaction(args: {
|
|
666
803
|
aptosConfig: AptosConfig;
|
|
667
804
|
creator: Account;
|
|
@@ -682,17 +819,17 @@ export async function updateDigitalAssetTypedPropertyTransaction(args: {
|
|
|
682
819
|
digitalAssetType,
|
|
683
820
|
options,
|
|
684
821
|
} = args;
|
|
685
|
-
|
|
822
|
+
return generateTransaction({
|
|
686
823
|
aptosConfig,
|
|
687
824
|
sender: creator.accountAddress,
|
|
688
825
|
data: {
|
|
689
826
|
function: "0x4::aptos_token::update_typed_property",
|
|
690
827
|
typeArguments: [digitalAssetType ?? defaultDigitalAssetType, PropertyTypeMap[propertyType]],
|
|
691
|
-
functionArguments: [digitalAssetAddress, propertyKey, propertyValue],
|
|
828
|
+
functionArguments: [AccountAddress.from(digitalAssetAddress), new MoveString(propertyKey), propertyValue],
|
|
829
|
+
abi: updateDigitalAssetTypedPropertyAbi,
|
|
692
830
|
},
|
|
693
831
|
options,
|
|
694
832
|
});
|
|
695
|
-
return transaction;
|
|
696
833
|
}
|
|
697
834
|
|
|
698
835
|
function getPropertyValueRaw(propertyValues: Array<PropertyValue>, propertyTypes: Array<string>): Array<Uint8Array> {
|
package/src/internal/event.ts
CHANGED
|
@@ -20,8 +20,9 @@ export async function getAccountEventsByCreationNumber(args: {
|
|
|
20
20
|
aptosConfig: AptosConfig;
|
|
21
21
|
accountAddress: AccountAddressInput;
|
|
22
22
|
creationNumber: AnyNumber;
|
|
23
|
+
options?: PaginationArgs & OrderByArg<GetEventsResponse[0]>;
|
|
23
24
|
}): Promise<GetEventsResponse> {
|
|
24
|
-
const { accountAddress, aptosConfig, creationNumber } = args;
|
|
25
|
+
const { accountAddress, aptosConfig, creationNumber, options } = args;
|
|
25
26
|
const address = AccountAddress.from(accountAddress);
|
|
26
27
|
|
|
27
28
|
const whereCondition: EventsBoolExp = {
|
|
@@ -29,7 +30,13 @@ export async function getAccountEventsByCreationNumber(args: {
|
|
|
29
30
|
creation_number: { _eq: creationNumber },
|
|
30
31
|
};
|
|
31
32
|
|
|
32
|
-
|
|
33
|
+
const customOptions = {
|
|
34
|
+
where: whereCondition,
|
|
35
|
+
pagination: options,
|
|
36
|
+
orderBy: options?.orderBy,
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
return getEvents({ aptosConfig, options: customOptions });
|
|
33
40
|
}
|
|
34
41
|
|
|
35
42
|
export async function getAccountEventsByEventType(args: {
|
|
@@ -34,7 +34,14 @@ import {
|
|
|
34
34
|
FungibleAssetMetadataBoolExp,
|
|
35
35
|
} from "../types/generated/types";
|
|
36
36
|
import { Account, AccountAddress } from "../core";
|
|
37
|
-
import {
|
|
37
|
+
import {
|
|
38
|
+
EntryFunctionABI,
|
|
39
|
+
InputGenerateTransactionOptions,
|
|
40
|
+
parseTypeTag,
|
|
41
|
+
SimpleTransaction,
|
|
42
|
+
TypeTagAddress,
|
|
43
|
+
TypeTagU64,
|
|
44
|
+
} from "../transactions";
|
|
38
45
|
import { generateTransaction } from "./transactionSubmission";
|
|
39
46
|
|
|
40
47
|
export async function getFungibleAssetMetadata(args: {
|
|
@@ -109,6 +116,11 @@ export async function getCurrentFungibleAssetBalances(args: {
|
|
|
109
116
|
return data.current_fungible_asset_balances;
|
|
110
117
|
}
|
|
111
118
|
|
|
119
|
+
const faTransferAbi: EntryFunctionABI = {
|
|
120
|
+
typeParameters: [],
|
|
121
|
+
parameters: [parseTypeTag("0x1::object::Object"), new TypeTagAddress(), new TypeTagU64()],
|
|
122
|
+
};
|
|
123
|
+
|
|
112
124
|
export async function transferFungibleAsset(args: {
|
|
113
125
|
aptosConfig: AptosConfig;
|
|
114
126
|
sender: Account;
|
|
@@ -118,15 +130,15 @@ export async function transferFungibleAsset(args: {
|
|
|
118
130
|
options?: InputGenerateTransactionOptions;
|
|
119
131
|
}): Promise<SimpleTransaction> {
|
|
120
132
|
const { aptosConfig, sender, fungibleAssetMetadataAddress, recipient, amount, options } = args;
|
|
121
|
-
|
|
133
|
+
return generateTransaction({
|
|
122
134
|
aptosConfig,
|
|
123
135
|
sender: sender.accountAddress,
|
|
124
136
|
data: {
|
|
125
137
|
function: "0x1::primary_fungible_store::transfer",
|
|
126
138
|
typeArguments: ["0x1::fungible_asset::Metadata"],
|
|
127
139
|
functionArguments: [fungibleAssetMetadataAddress, recipient, amount],
|
|
140
|
+
abi: faTransferAbi,
|
|
128
141
|
},
|
|
129
142
|
options,
|
|
130
143
|
});
|
|
131
|
-
return transaction;
|
|
132
144
|
}
|