@aptos-labs/ts-sdk 7.3.0 → 7.4.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/LICENSE +43 -43
- package/README.md +19 -20
- package/dist/api/account/abstraction.d.ts +10 -0
- package/dist/api/account/abstraction.d.ts.map +1 -1
- package/dist/api/account/abstraction.js +19 -6
- package/dist/api/account/abstraction.js.map +1 -1
- package/dist/api/ans.d.ts +9 -0
- package/dist/api/ans.d.ts.map +1 -1
- package/dist/api/ans.js +5 -0
- package/dist/api/ans.js.map +1 -1
- package/dist/api/coin.d.ts +2 -0
- package/dist/api/coin.d.ts.map +1 -1
- package/dist/api/coin.js +1 -0
- package/dist/api/coin.js.map +1 -1
- package/dist/api/digitalAsset.d.ts +30 -0
- package/dist/api/digitalAsset.d.ts.map +1 -1
- package/dist/api/digitalAsset.js +15 -0
- package/dist/api/digitalAsset.js.map +1 -1
- package/dist/api/fungibleAsset.d.ts +4 -0
- package/dist/api/fungibleAsset.d.ts.map +1 -1
- package/dist/api/fungibleAsset.js +2 -0
- package/dist/api/fungibleAsset.js.map +1 -1
- package/dist/api/keyless.d.ts +38 -1
- package/dist/api/keyless.d.ts.map +1 -1
- package/dist/api/keyless.js +29 -1
- package/dist/api/keyless.js.map +1 -1
- package/dist/api/transaction.d.ts +41 -1
- package/dist/api/transaction.d.ts.map +1 -1
- package/dist/api/transaction.js +42 -2
- package/dist/api/transaction.js.map +1 -1
- package/dist/api/transactionSubmission/build.d.ts +7 -5
- package/dist/api/transactionSubmission/build.d.ts.map +1 -1
- package/dist/api/transactionSubmission/build.js +13 -5
- package/dist/api/transactionSubmission/build.js.map +1 -1
- package/dist/api/transactionSubmission/simulate.d.ts +7 -3
- package/dist/api/transactionSubmission/simulate.d.ts.map +1 -1
- package/dist/api/transactionSubmission/simulate.js +7 -3
- package/dist/api/transactionSubmission/simulate.js.map +1 -1
- package/dist/bcs/serializable/moveStructs.d.ts +72 -28
- package/dist/bcs/serializable/moveStructs.d.ts.map +1 -1
- package/dist/bcs/serializable/moveStructs.js +76 -28
- package/dist/bcs/serializable/moveStructs.js.map +1 -1
- package/dist/functions/keyless.d.ts +1 -1
- package/dist/functions/keyless.d.ts.map +1 -1
- package/dist/functions/keyless.js +1 -1
- package/dist/functions/keyless.js.map +1 -1
- package/dist/functions/transaction.d.ts +1 -1
- package/dist/functions/transaction.d.ts.map +1 -1
- package/dist/functions/transaction.js +1 -1
- package/dist/functions/transaction.js.map +1 -1
- package/dist/internal/abstraction.d.ts +35 -0
- package/dist/internal/abstraction.d.ts.map +1 -1
- package/dist/internal/abstraction.js +38 -3
- package/dist/internal/abstraction.js.map +1 -1
- package/dist/internal/account.d.ts +6 -0
- package/dist/internal/account.d.ts.map +1 -1
- package/dist/internal/account.js +55 -37
- package/dist/internal/account.js.map +1 -1
- package/dist/internal/ans.d.ts +11 -0
- package/dist/internal/ans.d.ts.map +1 -1
- package/dist/internal/ans.js +18 -6
- package/dist/internal/ans.js.map +1 -1
- package/dist/internal/coin.d.ts +2 -0
- package/dist/internal/coin.d.ts.map +1 -1
- package/dist/internal/coin.js +3 -1
- package/dist/internal/coin.js.map +1 -1
- package/dist/internal/digitalAsset.d.ts +30 -0
- package/dist/internal/digitalAsset.d.ts.map +1 -1
- package/dist/internal/digitalAsset.js +45 -15
- package/dist/internal/digitalAsset.js.map +1 -1
- package/dist/internal/fungibleAsset.d.ts +4 -0
- package/dist/internal/fungibleAsset.d.ts.map +1 -1
- package/dist/internal/fungibleAsset.js +6 -2
- package/dist/internal/fungibleAsset.js.map +1 -1
- package/dist/internal/keyless.d.ts +39 -1
- package/dist/internal/keyless.d.ts.map +1 -1
- package/dist/internal/keyless.js +71 -13
- package/dist/internal/keyless.js.map +1 -1
- package/dist/internal/transaction.d.ts +24 -1
- package/dist/internal/transaction.d.ts.map +1 -1
- package/dist/internal/transaction.js +125 -4
- package/dist/internal/transaction.js.map +1 -1
- package/dist/internal/transactionSubmission.d.ts +2 -0
- package/dist/internal/transactionSubmission.d.ts.map +1 -1
- package/dist/internal/transactionSubmission.js +3 -1
- package/dist/internal/transactionSubmission.js.map +1 -1
- package/dist/transactions/management/transactionWorker.d.ts +10 -6
- package/dist/transactions/management/transactionWorker.d.ts.map +1 -1
- package/dist/transactions/management/transactionWorker.js +28 -24
- package/dist/transactions/management/transactionWorker.js.map +1 -1
- package/dist/transactions/transactionBuilder/index.d.ts +1 -0
- package/dist/transactions/transactionBuilder/index.d.ts.map +1 -1
- package/dist/transactions/transactionBuilder/index.js +1 -0
- package/dist/transactions/transactionBuilder/index.js.map +1 -1
- package/dist/transactions/transactionBuilder/scriptAbi.d.ts +10 -0
- package/dist/transactions/transactionBuilder/scriptAbi.d.ts.map +1 -0
- package/dist/transactions/transactionBuilder/scriptAbi.js +863 -0
- package/dist/transactions/transactionBuilder/scriptAbi.js.map +1 -0
- package/dist/transactions/transactionBuilder/transactionBuilder.d.ts.map +1 -1
- package/dist/transactions/transactionBuilder/transactionBuilder.js +65 -1
- package/dist/transactions/transactionBuilder/transactionBuilder.js.map +1 -1
- package/dist/transactions/types.d.ts +9 -4
- package/dist/transactions/types.d.ts.map +1 -1
- package/dist/types/keyless.d.ts +2 -2
- package/dist/types/keyless.d.ts.map +1 -1
- package/dist/types/types.d.ts +2 -2
- package/dist/types/types.d.ts.map +1 -1
- package/dist/utils/const.d.ts +11 -0
- package/dist/utils/const.d.ts.map +1 -1
- package/dist/utils/const.js +11 -0
- package/dist/utils/const.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +26 -25
- package/src/api/account/abstraction.ts +23 -6
- package/src/api/ans.ts +9 -0
- package/src/api/coin.ts +2 -0
- package/src/api/digitalAsset.ts +30 -0
- package/src/api/fungibleAsset.ts +4 -0
- package/src/api/keyless.ts +39 -1
- package/src/api/transaction.ts +48 -1
- package/src/api/transactionSubmission/build.ts +16 -6
- package/src/api/transactionSubmission/simulate.ts +7 -3
- package/src/bcs/serializable/moveStructs.ts +80 -28
- package/src/functions/keyless.ts +1 -0
- package/src/functions/transaction.ts +1 -0
- package/src/internal/abstraction.ts +41 -3
- package/src/internal/account.ts +60 -38
- package/src/internal/ans.ts +24 -6
- package/src/internal/coin.ts +4 -1
- package/src/internal/digitalAsset.ts +60 -9
- package/src/internal/fungibleAsset.ts +8 -2
- package/src/internal/keyless.ts +91 -14
- package/src/internal/transaction.ts +154 -4
- package/src/internal/transactionSubmission.ts +4 -1
- package/src/transactions/management/transactionWorker.ts +35 -23
- package/src/transactions/transactionBuilder/index.ts +1 -0
- package/src/transactions/transactionBuilder/scriptAbi.ts +1145 -0
- package/src/transactions/transactionBuilder/transactionBuilder.ts +91 -6
- package/src/transactions/types.ts +10 -4
- package/src/types/keyless.ts +2 -2
- package/src/types/types.ts +2 -2
- package/src/utils/const.ts +12 -0
- package/src/version.ts +1 -1
|
@@ -319,6 +319,7 @@ const createCollectionAbi: EntryFunctionABI = {
|
|
|
319
319
|
* @param args.description - A description of the collection.
|
|
320
320
|
* @param args.name - The name of the collection.
|
|
321
321
|
* @param args.uri - The URI associated with the collection.
|
|
322
|
+
* @param args.withFeePayer - Whether to build a fee-payer transaction.
|
|
322
323
|
* @param args.options - Optional parameters for generating the transaction.
|
|
323
324
|
* @param args.maxSupply - The maximum supply of tokens in the collection (optional).
|
|
324
325
|
* @param args.mutableDescription - Indicates if the collection description can be changed (optional, defaults to true).
|
|
@@ -341,10 +342,11 @@ export async function createCollectionTransaction(
|
|
|
341
342
|
description: string;
|
|
342
343
|
name: string;
|
|
343
344
|
uri: string;
|
|
345
|
+
withFeePayer?: boolean;
|
|
344
346
|
options?: InputGenerateTransactionOptions;
|
|
345
347
|
} & CreateCollectionOptions,
|
|
346
348
|
): Promise<SimpleTransaction> {
|
|
347
|
-
const { aptosConfig,
|
|
349
|
+
const { aptosConfig, creator, withFeePayer, options } = args;
|
|
348
350
|
return generateTransaction({
|
|
349
351
|
aptosConfig,
|
|
350
352
|
sender: creator.accountAddress,
|
|
@@ -370,6 +372,7 @@ export async function createCollectionTransaction(
|
|
|
370
372
|
],
|
|
371
373
|
abi: createCollectionAbi,
|
|
372
374
|
},
|
|
375
|
+
withFeePayer,
|
|
373
376
|
options,
|
|
374
377
|
});
|
|
375
378
|
}
|
|
@@ -572,6 +575,7 @@ const mintDigitalAssetAbi: EntryFunctionABI = {
|
|
|
572
575
|
* @param [args.propertyKeys] - Optional array of property keys associated with the asset.
|
|
573
576
|
* @param [args.propertyTypes] - Optional array of property types corresponding to the asset's properties.
|
|
574
577
|
* @param [args.propertyValues] - Optional array of property values for the asset's properties.
|
|
578
|
+
* @param args.withFeePayer - Whether to build a fee-payer transaction.
|
|
575
579
|
* @param [args.options] - Optional transaction generation options.
|
|
576
580
|
* @group Implementation
|
|
577
581
|
*/
|
|
@@ -585,6 +589,7 @@ export async function mintDigitalAssetTransaction(args: {
|
|
|
585
589
|
propertyKeys?: Array<string>;
|
|
586
590
|
propertyTypes?: Array<PropertyType>;
|
|
587
591
|
propertyValues?: Array<PropertyValue>;
|
|
592
|
+
withFeePayer?: boolean;
|
|
588
593
|
options?: InputGenerateTransactionOptions;
|
|
589
594
|
}): Promise<SimpleTransaction> {
|
|
590
595
|
const {
|
|
@@ -598,6 +603,7 @@ export async function mintDigitalAssetTransaction(args: {
|
|
|
598
603
|
propertyKeys,
|
|
599
604
|
propertyTypes,
|
|
600
605
|
propertyValues,
|
|
606
|
+
withFeePayer,
|
|
601
607
|
} = args;
|
|
602
608
|
const convertedPropertyType = propertyTypes?.map((type) => PropertyTypeMap[type]);
|
|
603
609
|
return generateTransaction({
|
|
@@ -625,6 +631,7 @@ export async function mintDigitalAssetTransaction(args: {
|
|
|
625
631
|
],
|
|
626
632
|
abi: mintDigitalAssetAbi,
|
|
627
633
|
},
|
|
634
|
+
withFeePayer,
|
|
628
635
|
options,
|
|
629
636
|
});
|
|
630
637
|
}
|
|
@@ -644,6 +651,7 @@ const transferDigitalAssetAbi: EntryFunctionABI = {
|
|
|
644
651
|
* @param args.digitalAssetAddress - The address of the digital asset being transferred.
|
|
645
652
|
* @param args.recipient - The address of the account receiving the digital asset.
|
|
646
653
|
* @param args.digitalAssetType - (Optional) The type of the digital asset being transferred.
|
|
654
|
+
* @param args.withFeePayer - Whether to build a fee-payer transaction.
|
|
647
655
|
* @param args.options - (Optional) Additional options for generating the transaction.
|
|
648
656
|
* @group Implementation
|
|
649
657
|
*/
|
|
@@ -653,9 +661,10 @@ export async function transferDigitalAssetTransaction(args: {
|
|
|
653
661
|
digitalAssetAddress: AccountAddressInput;
|
|
654
662
|
recipient: AccountAddressInput;
|
|
655
663
|
digitalAssetType?: MoveStructId;
|
|
664
|
+
withFeePayer?: boolean;
|
|
656
665
|
options?: InputGenerateTransactionOptions;
|
|
657
666
|
}): Promise<SimpleTransaction> {
|
|
658
|
-
const { aptosConfig, sender, digitalAssetAddress, recipient, digitalAssetType, options } = args;
|
|
667
|
+
const { aptosConfig, sender, digitalAssetAddress, recipient, digitalAssetType, withFeePayer, options } = args;
|
|
659
668
|
return generateTransaction({
|
|
660
669
|
aptosConfig,
|
|
661
670
|
sender: sender.accountAddress,
|
|
@@ -665,6 +674,7 @@ export async function transferDigitalAssetTransaction(args: {
|
|
|
665
674
|
functionArguments: [AccountAddress.from(digitalAssetAddress), AccountAddress.from(recipient)],
|
|
666
675
|
abi: transferDigitalAssetAbi,
|
|
667
676
|
},
|
|
677
|
+
withFeePayer,
|
|
668
678
|
options,
|
|
669
679
|
});
|
|
670
680
|
}
|
|
@@ -698,6 +708,7 @@ const mintSoulBoundAbi: EntryFunctionABI = {
|
|
|
698
708
|
* @param [args.propertyKeys] - Optional array of property keys associated with the token.
|
|
699
709
|
* @param [args.propertyTypes] - Optional array of property types corresponding to the property keys.
|
|
700
710
|
* @param [args.propertyValues] - Optional array of property values that match the property keys and types.
|
|
711
|
+
* @param args.withFeePayer - Whether to build a fee-payer transaction.
|
|
701
712
|
* @param [args.options] - Optional transaction generation options.
|
|
702
713
|
* @throws Error if the counts of property keys, property types, and property values do not match.
|
|
703
714
|
* @group Implementation
|
|
@@ -713,6 +724,7 @@ export async function mintSoulBoundTransaction(args: {
|
|
|
713
724
|
propertyKeys?: Array<string>;
|
|
714
725
|
propertyTypes?: Array<PropertyType>;
|
|
715
726
|
propertyValues?: Array<PropertyValue>;
|
|
727
|
+
withFeePayer?: boolean;
|
|
716
728
|
options?: InputGenerateTransactionOptions;
|
|
717
729
|
}): Promise<SimpleTransaction> {
|
|
718
730
|
const {
|
|
@@ -726,6 +738,7 @@ export async function mintSoulBoundTransaction(args: {
|
|
|
726
738
|
propertyKeys,
|
|
727
739
|
propertyTypes,
|
|
728
740
|
propertyValues,
|
|
741
|
+
withFeePayer,
|
|
729
742
|
options,
|
|
730
743
|
} = args;
|
|
731
744
|
if (propertyKeys?.length !== propertyValues?.length) {
|
|
@@ -752,6 +765,7 @@ export async function mintSoulBoundTransaction(args: {
|
|
|
752
765
|
],
|
|
753
766
|
abi: mintSoulBoundAbi,
|
|
754
767
|
},
|
|
768
|
+
withFeePayer,
|
|
755
769
|
options,
|
|
756
770
|
});
|
|
757
771
|
}
|
|
@@ -770,6 +784,7 @@ const burnDigitalAssetAbi: EntryFunctionABI = {
|
|
|
770
784
|
* @param args.creator - The account that is initiating the burn transaction.
|
|
771
785
|
* @param args.digitalAssetAddress - The address of the digital asset to be burned.
|
|
772
786
|
* @param args.digitalAssetType - Optional; the type of the digital asset being burned.
|
|
787
|
+
* @param args.withFeePayer - Whether to build a fee-payer transaction.
|
|
773
788
|
* @param args.options - Optional; additional options for generating the transaction.
|
|
774
789
|
* @group Implementation
|
|
775
790
|
*/
|
|
@@ -778,9 +793,10 @@ export async function burnDigitalAssetTransaction(args: {
|
|
|
778
793
|
creator: Account;
|
|
779
794
|
digitalAssetAddress: AccountAddressInput;
|
|
780
795
|
digitalAssetType?: MoveStructId;
|
|
796
|
+
withFeePayer?: boolean;
|
|
781
797
|
options?: InputGenerateTransactionOptions;
|
|
782
798
|
}): Promise<SimpleTransaction> {
|
|
783
|
-
const { aptosConfig, creator, digitalAssetAddress, digitalAssetType, options } = args;
|
|
799
|
+
const { aptosConfig, creator, digitalAssetAddress, digitalAssetType, withFeePayer, options } = args;
|
|
784
800
|
return generateTransaction({
|
|
785
801
|
aptosConfig,
|
|
786
802
|
sender: creator.accountAddress,
|
|
@@ -790,6 +806,7 @@ export async function burnDigitalAssetTransaction(args: {
|
|
|
790
806
|
functionArguments: [AccountAddress.from(digitalAssetAddress)],
|
|
791
807
|
abi: burnDigitalAssetAbi,
|
|
792
808
|
},
|
|
809
|
+
withFeePayer,
|
|
793
810
|
options,
|
|
794
811
|
});
|
|
795
812
|
}
|
|
@@ -808,6 +825,7 @@ const freezeDigitalAssetAbi: EntryFunctionABI = {
|
|
|
808
825
|
* @param args.creator - The account that is creating the transaction.
|
|
809
826
|
* @param args.digitalAssetAddress - The address of the digital asset to be frozen.
|
|
810
827
|
* @param args.digitalAssetType - (Optional) The type of the digital asset as a Move struct ID.
|
|
828
|
+
* @param args.withFeePayer - Whether to build a fee-payer transaction.
|
|
811
829
|
* @param args.options - (Optional) Additional options for generating the transaction.
|
|
812
830
|
* @group Implementation
|
|
813
831
|
*/
|
|
@@ -816,9 +834,10 @@ export async function freezeDigitalAssetTransferTransaction(args: {
|
|
|
816
834
|
creator: Account;
|
|
817
835
|
digitalAssetAddress: AccountAddressInput;
|
|
818
836
|
digitalAssetType?: MoveStructId;
|
|
837
|
+
withFeePayer?: boolean;
|
|
819
838
|
options?: InputGenerateTransactionOptions;
|
|
820
839
|
}): Promise<SimpleTransaction> {
|
|
821
|
-
const { aptosConfig, creator, digitalAssetAddress, digitalAssetType, options } = args;
|
|
840
|
+
const { aptosConfig, creator, digitalAssetAddress, digitalAssetType, withFeePayer, options } = args;
|
|
822
841
|
return generateTransaction({
|
|
823
842
|
aptosConfig,
|
|
824
843
|
sender: creator.accountAddress,
|
|
@@ -828,6 +847,7 @@ export async function freezeDigitalAssetTransferTransaction(args: {
|
|
|
828
847
|
functionArguments: [digitalAssetAddress],
|
|
829
848
|
abi: freezeDigitalAssetAbi,
|
|
830
849
|
},
|
|
850
|
+
withFeePayer,
|
|
831
851
|
options,
|
|
832
852
|
});
|
|
833
853
|
}
|
|
@@ -845,6 +865,7 @@ const unfreezeDigitalAssetAbi: EntryFunctionABI = {
|
|
|
845
865
|
* @param args.creator - The account that is initiating the unfreeze transaction.
|
|
846
866
|
* @param args.digitalAssetAddress - The address of the digital asset to be unfrozen.
|
|
847
867
|
* @param args.digitalAssetType - (Optional) The type of the digital asset being unfrozen.
|
|
868
|
+
* @param args.withFeePayer - Whether to build a fee-payer transaction.
|
|
848
869
|
* @param args.options - (Optional) Additional options for generating the transaction.
|
|
849
870
|
* @group Implementation
|
|
850
871
|
*/
|
|
@@ -853,9 +874,10 @@ export async function unfreezeDigitalAssetTransferTransaction(args: {
|
|
|
853
874
|
creator: Account;
|
|
854
875
|
digitalAssetAddress: AccountAddressInput;
|
|
855
876
|
digitalAssetType?: MoveStructId;
|
|
877
|
+
withFeePayer?: boolean;
|
|
856
878
|
options?: InputGenerateTransactionOptions;
|
|
857
879
|
}): Promise<SimpleTransaction> {
|
|
858
|
-
const { aptosConfig, creator, digitalAssetAddress, digitalAssetType, options } = args;
|
|
880
|
+
const { aptosConfig, creator, digitalAssetAddress, digitalAssetType, withFeePayer, options } = args;
|
|
859
881
|
return generateTransaction({
|
|
860
882
|
aptosConfig,
|
|
861
883
|
sender: creator.accountAddress,
|
|
@@ -865,6 +887,7 @@ export async function unfreezeDigitalAssetTransferTransaction(args: {
|
|
|
865
887
|
functionArguments: [digitalAssetAddress],
|
|
866
888
|
abi: unfreezeDigitalAssetAbi,
|
|
867
889
|
},
|
|
890
|
+
withFeePayer,
|
|
868
891
|
options,
|
|
869
892
|
});
|
|
870
893
|
}
|
|
@@ -883,6 +906,7 @@ const setDigitalAssetDescriptionAbi: EntryFunctionABI = {
|
|
|
883
906
|
* @param args.description - The new description for the digital asset.
|
|
884
907
|
* @param args.digitalAssetAddress - The address of the digital asset whose description is being set.
|
|
885
908
|
* @param args.digitalAssetType - (Optional) The type of the digital asset.
|
|
909
|
+
* @param args.withFeePayer - Whether to build a fee-payer transaction.
|
|
886
910
|
* @param args.options - (Optional) Additional options for generating the transaction.
|
|
887
911
|
* @group Implementation
|
|
888
912
|
*/
|
|
@@ -892,9 +916,10 @@ export async function setDigitalAssetDescriptionTransaction(args: {
|
|
|
892
916
|
description: string;
|
|
893
917
|
digitalAssetAddress: AccountAddressInput;
|
|
894
918
|
digitalAssetType?: MoveStructId;
|
|
919
|
+
withFeePayer?: boolean;
|
|
895
920
|
options?: InputGenerateTransactionOptions;
|
|
896
921
|
}): Promise<SimpleTransaction> {
|
|
897
|
-
const { aptosConfig, creator, description, digitalAssetAddress, digitalAssetType, options } = args;
|
|
922
|
+
const { aptosConfig, creator, description, digitalAssetAddress, digitalAssetType, withFeePayer, options } = args;
|
|
898
923
|
return generateTransaction({
|
|
899
924
|
aptosConfig,
|
|
900
925
|
sender: creator.accountAddress,
|
|
@@ -904,6 +929,7 @@ export async function setDigitalAssetDescriptionTransaction(args: {
|
|
|
904
929
|
functionArguments: [AccountAddress.from(digitalAssetAddress), new MoveString(description)],
|
|
905
930
|
abi: setDigitalAssetDescriptionAbi,
|
|
906
931
|
},
|
|
932
|
+
withFeePayer,
|
|
907
933
|
options,
|
|
908
934
|
});
|
|
909
935
|
}
|
|
@@ -923,6 +949,7 @@ const setDigitalAssetNameAbi: EntryFunctionABI = {
|
|
|
923
949
|
* @param args.name - The new name to assign to the digital asset.
|
|
924
950
|
* @param args.digitalAssetAddress - The address of the digital asset to update.
|
|
925
951
|
* @param args.digitalAssetType - (Optional) The type of the digital asset, represented as a Move struct ID.
|
|
952
|
+
* @param args.withFeePayer - Whether to build a fee-payer transaction.
|
|
926
953
|
* @param args.options - (Optional) Additional options for generating the transaction.
|
|
927
954
|
* @group Implementation
|
|
928
955
|
*/
|
|
@@ -932,9 +959,10 @@ export async function setDigitalAssetNameTransaction(args: {
|
|
|
932
959
|
name: string;
|
|
933
960
|
digitalAssetAddress: AccountAddressInput;
|
|
934
961
|
digitalAssetType?: MoveStructId;
|
|
962
|
+
withFeePayer?: boolean;
|
|
935
963
|
options?: InputGenerateTransactionOptions;
|
|
936
964
|
}): Promise<SimpleTransaction> {
|
|
937
|
-
const { aptosConfig, creator, name, digitalAssetAddress, digitalAssetType, options } = args;
|
|
965
|
+
const { aptosConfig, creator, name, digitalAssetAddress, digitalAssetType, withFeePayer, options } = args;
|
|
938
966
|
return generateTransaction({
|
|
939
967
|
aptosConfig,
|
|
940
968
|
sender: creator.accountAddress,
|
|
@@ -944,6 +972,7 @@ export async function setDigitalAssetNameTransaction(args: {
|
|
|
944
972
|
functionArguments: [AccountAddress.from(digitalAssetAddress), new MoveString(name)],
|
|
945
973
|
abi: setDigitalAssetNameAbi,
|
|
946
974
|
},
|
|
975
|
+
withFeePayer,
|
|
947
976
|
options,
|
|
948
977
|
});
|
|
949
978
|
}
|
|
@@ -962,6 +991,7 @@ const setDigitalAssetURIAbi: EntryFunctionABI = {
|
|
|
962
991
|
* @param args.uri - The new URI to be set for the digital asset.
|
|
963
992
|
* @param args.digitalAssetAddress - The address of the digital asset whose URI is being set.
|
|
964
993
|
* @param args.digitalAssetType - The optional type of the digital asset; defaults to a predefined type if not provided.
|
|
994
|
+
* @param args.withFeePayer - Whether to build a fee-payer transaction.
|
|
965
995
|
* @param args.options - Optional settings for generating the transaction.
|
|
966
996
|
* @group Implementation
|
|
967
997
|
*/
|
|
@@ -971,9 +1001,10 @@ export async function setDigitalAssetURITransaction(args: {
|
|
|
971
1001
|
uri: string;
|
|
972
1002
|
digitalAssetAddress: AccountAddressInput;
|
|
973
1003
|
digitalAssetType?: MoveStructId;
|
|
1004
|
+
withFeePayer?: boolean;
|
|
974
1005
|
options?: InputGenerateTransactionOptions;
|
|
975
1006
|
}): Promise<SimpleTransaction> {
|
|
976
|
-
const { aptosConfig, creator, uri, digitalAssetAddress, digitalAssetType, options } = args;
|
|
1007
|
+
const { aptosConfig, creator, uri, digitalAssetAddress, digitalAssetType, withFeePayer, options } = args;
|
|
977
1008
|
return generateTransaction({
|
|
978
1009
|
aptosConfig,
|
|
979
1010
|
sender: creator.accountAddress,
|
|
@@ -983,6 +1014,7 @@ export async function setDigitalAssetURITransaction(args: {
|
|
|
983
1014
|
functionArguments: [AccountAddress.from(digitalAssetAddress), new MoveString(uri)],
|
|
984
1015
|
abi: setDigitalAssetURIAbi,
|
|
985
1016
|
},
|
|
1017
|
+
withFeePayer,
|
|
986
1018
|
options,
|
|
987
1019
|
});
|
|
988
1020
|
}
|
|
@@ -1009,6 +1041,7 @@ const addDigitalAssetPropertyAbi: EntryFunctionABI = {
|
|
|
1009
1041
|
* @param args.propertyValue - The value of the property being added.
|
|
1010
1042
|
* @param args.digitalAssetAddress - The address of the digital asset to which the property is being added.
|
|
1011
1043
|
* @param args.digitalAssetType - The optional type of the digital asset.
|
|
1044
|
+
* @param args.withFeePayer - Whether to build a fee-payer transaction.
|
|
1012
1045
|
* @param args.options - Optional transaction generation options.
|
|
1013
1046
|
* @group Implementation
|
|
1014
1047
|
*/
|
|
@@ -1020,6 +1053,7 @@ export async function addDigitalAssetPropertyTransaction(args: {
|
|
|
1020
1053
|
propertyValue: PropertyValue;
|
|
1021
1054
|
digitalAssetAddress: AccountAddressInput;
|
|
1022
1055
|
digitalAssetType?: MoveStructId;
|
|
1056
|
+
withFeePayer?: boolean;
|
|
1023
1057
|
options?: InputGenerateTransactionOptions;
|
|
1024
1058
|
}): Promise<SimpleTransaction> {
|
|
1025
1059
|
const {
|
|
@@ -1030,6 +1064,7 @@ export async function addDigitalAssetPropertyTransaction(args: {
|
|
|
1030
1064
|
propertyValue,
|
|
1031
1065
|
digitalAssetAddress,
|
|
1032
1066
|
digitalAssetType,
|
|
1067
|
+
withFeePayer,
|
|
1033
1068
|
options,
|
|
1034
1069
|
} = args;
|
|
1035
1070
|
return generateTransaction({
|
|
@@ -1046,6 +1081,7 @@ export async function addDigitalAssetPropertyTransaction(args: {
|
|
|
1046
1081
|
],
|
|
1047
1082
|
abi: addDigitalAssetPropertyAbi,
|
|
1048
1083
|
},
|
|
1084
|
+
withFeePayer,
|
|
1049
1085
|
options,
|
|
1050
1086
|
});
|
|
1051
1087
|
}
|
|
@@ -1065,6 +1101,7 @@ const removeDigitalAssetPropertyAbi: EntryFunctionABI = {
|
|
|
1065
1101
|
* @param args.propertyKey - The key of the property to be removed.
|
|
1066
1102
|
* @param args.digitalAssetAddress - The address of the digital asset from which the property will be removed.
|
|
1067
1103
|
* @param args.digitalAssetType - The type of the digital asset (optional).
|
|
1104
|
+
* @param args.withFeePayer - Whether to build a fee-payer transaction.
|
|
1068
1105
|
* @param args.options - Additional options for generating the transaction (optional).
|
|
1069
1106
|
* @group Implementation
|
|
1070
1107
|
*/
|
|
@@ -1074,9 +1111,10 @@ export async function removeDigitalAssetPropertyTransaction(args: {
|
|
|
1074
1111
|
propertyKey: string;
|
|
1075
1112
|
digitalAssetAddress: AccountAddressInput;
|
|
1076
1113
|
digitalAssetType?: MoveStructId;
|
|
1114
|
+
withFeePayer?: boolean;
|
|
1077
1115
|
options?: InputGenerateTransactionOptions;
|
|
1078
1116
|
}): Promise<SimpleTransaction> {
|
|
1079
|
-
const { aptosConfig, creator, propertyKey, digitalAssetAddress, digitalAssetType, options } = args;
|
|
1117
|
+
const { aptosConfig, creator, propertyKey, digitalAssetAddress, digitalAssetType, withFeePayer, options } = args;
|
|
1080
1118
|
return generateTransaction({
|
|
1081
1119
|
aptosConfig,
|
|
1082
1120
|
sender: creator.accountAddress,
|
|
@@ -1086,6 +1124,7 @@ export async function removeDigitalAssetPropertyTransaction(args: {
|
|
|
1086
1124
|
functionArguments: [AccountAddress.from(digitalAssetAddress), new MoveString(propertyKey)],
|
|
1087
1125
|
abi: removeDigitalAssetPropertyAbi,
|
|
1088
1126
|
},
|
|
1127
|
+
withFeePayer,
|
|
1089
1128
|
options,
|
|
1090
1129
|
});
|
|
1091
1130
|
}
|
|
@@ -1112,6 +1151,7 @@ const updateDigitalAssetPropertyAbi: EntryFunctionABI = {
|
|
|
1112
1151
|
* @param args.propertyValue - The new value for the property.
|
|
1113
1152
|
* @param args.digitalAssetAddress - The address of the digital asset to update.
|
|
1114
1153
|
* @param args.digitalAssetType - (Optional) The type of the digital asset.
|
|
1154
|
+
* @param args.withFeePayer - Whether to build a fee-payer transaction.
|
|
1115
1155
|
* @param args.options - (Optional) Additional options for generating the transaction.
|
|
1116
1156
|
* @group Implementation
|
|
1117
1157
|
*/
|
|
@@ -1123,6 +1163,7 @@ export async function updateDigitalAssetPropertyTransaction(args: {
|
|
|
1123
1163
|
propertyValue: PropertyValue;
|
|
1124
1164
|
digitalAssetAddress: AccountAddressInput;
|
|
1125
1165
|
digitalAssetType?: MoveStructId;
|
|
1166
|
+
withFeePayer?: boolean;
|
|
1126
1167
|
options?: InputGenerateTransactionOptions;
|
|
1127
1168
|
}): Promise<SimpleTransaction> {
|
|
1128
1169
|
const {
|
|
@@ -1133,6 +1174,7 @@ export async function updateDigitalAssetPropertyTransaction(args: {
|
|
|
1133
1174
|
propertyValue,
|
|
1134
1175
|
digitalAssetAddress,
|
|
1135
1176
|
digitalAssetType,
|
|
1177
|
+
withFeePayer,
|
|
1136
1178
|
options,
|
|
1137
1179
|
} = args;
|
|
1138
1180
|
return generateTransaction({
|
|
@@ -1158,6 +1200,7 @@ export async function updateDigitalAssetPropertyTransaction(args: {
|
|
|
1158
1200
|
],
|
|
1159
1201
|
abi: updateDigitalAssetPropertyAbi,
|
|
1160
1202
|
},
|
|
1203
|
+
withFeePayer,
|
|
1161
1204
|
options,
|
|
1162
1205
|
});
|
|
1163
1206
|
}
|
|
@@ -1183,6 +1226,7 @@ const addDigitalAssetTypedPropertyAbi: EntryFunctionABI = {
|
|
|
1183
1226
|
* @param args.propertyValue - The value of the property being added.
|
|
1184
1227
|
* @param args.digitalAssetAddress - The address of the digital asset to which the property is being added.
|
|
1185
1228
|
* @param args.digitalAssetType - (Optional) The type of the digital asset.
|
|
1229
|
+
* @param args.withFeePayer - Whether to build a fee-payer transaction.
|
|
1186
1230
|
* @param args.options - (Optional) Additional options for generating the transaction.
|
|
1187
1231
|
* @group Implementation
|
|
1188
1232
|
*/
|
|
@@ -1194,6 +1238,7 @@ export async function addDigitalAssetTypedPropertyTransaction(args: {
|
|
|
1194
1238
|
propertyValue: PropertyValue;
|
|
1195
1239
|
digitalAssetAddress: AccountAddressInput;
|
|
1196
1240
|
digitalAssetType?: MoveStructId;
|
|
1241
|
+
withFeePayer?: boolean;
|
|
1197
1242
|
options?: InputGenerateTransactionOptions;
|
|
1198
1243
|
}): Promise<SimpleTransaction> {
|
|
1199
1244
|
const {
|
|
@@ -1204,6 +1249,7 @@ export async function addDigitalAssetTypedPropertyTransaction(args: {
|
|
|
1204
1249
|
propertyValue,
|
|
1205
1250
|
digitalAssetAddress,
|
|
1206
1251
|
digitalAssetType,
|
|
1252
|
+
withFeePayer,
|
|
1207
1253
|
options,
|
|
1208
1254
|
} = args;
|
|
1209
1255
|
return generateTransaction({
|
|
@@ -1215,6 +1261,7 @@ export async function addDigitalAssetTypedPropertyTransaction(args: {
|
|
|
1215
1261
|
functionArguments: [AccountAddress.from(digitalAssetAddress), new MoveString(propertyKey), propertyValue],
|
|
1216
1262
|
abi: addDigitalAssetTypedPropertyAbi,
|
|
1217
1263
|
},
|
|
1264
|
+
withFeePayer,
|
|
1218
1265
|
options,
|
|
1219
1266
|
});
|
|
1220
1267
|
}
|
|
@@ -1239,6 +1286,7 @@ const updateDigitalAssetTypedPropertyAbi: EntryFunctionABI = {
|
|
|
1239
1286
|
* @param args.propertyValue - The new value for the property.
|
|
1240
1287
|
* @param args.digitalAssetAddress - The address of the digital asset to be updated.
|
|
1241
1288
|
* @param args.digitalAssetType - Optional. The type of the digital asset, if not provided, defaults to the standard type.
|
|
1289
|
+
* @param args.withFeePayer - Whether to build a fee-payer transaction.
|
|
1242
1290
|
* @param args.options - Optional. Additional options for generating the transaction.
|
|
1243
1291
|
* @group Implementation
|
|
1244
1292
|
*/
|
|
@@ -1250,6 +1298,7 @@ export async function updateDigitalAssetTypedPropertyTransaction(args: {
|
|
|
1250
1298
|
propertyValue: PropertyValue;
|
|
1251
1299
|
digitalAssetAddress: AccountAddressInput;
|
|
1252
1300
|
digitalAssetType?: MoveStructId;
|
|
1301
|
+
withFeePayer?: boolean;
|
|
1253
1302
|
options?: InputGenerateTransactionOptions;
|
|
1254
1303
|
}): Promise<SimpleTransaction> {
|
|
1255
1304
|
const {
|
|
@@ -1260,6 +1309,7 @@ export async function updateDigitalAssetTypedPropertyTransaction(args: {
|
|
|
1260
1309
|
propertyValue,
|
|
1261
1310
|
digitalAssetAddress,
|
|
1262
1311
|
digitalAssetType,
|
|
1312
|
+
withFeePayer,
|
|
1263
1313
|
options,
|
|
1264
1314
|
} = args;
|
|
1265
1315
|
return generateTransaction({
|
|
@@ -1271,6 +1321,7 @@ export async function updateDigitalAssetTypedPropertyTransaction(args: {
|
|
|
1271
1321
|
functionArguments: [AccountAddress.from(digitalAssetAddress), new MoveString(propertyKey), propertyValue],
|
|
1272
1322
|
abi: updateDigitalAssetTypedPropertyAbi,
|
|
1273
1323
|
},
|
|
1324
|
+
withFeePayer,
|
|
1274
1325
|
options,
|
|
1275
1326
|
});
|
|
1276
1327
|
}
|
|
@@ -170,6 +170,7 @@ const faTransferAbi: EntryFunctionABI = {
|
|
|
170
170
|
* @param args.fungibleAssetMetadataAddress - The address of the fungible asset's metadata.
|
|
171
171
|
* @param args.recipient - The address of the account receiving the asset.
|
|
172
172
|
* @param args.amount - The amount of the fungible asset to transfer.
|
|
173
|
+
* @param args.withFeePayer - Whether to build a fee-payer transaction.
|
|
173
174
|
* @param args.options - Optional settings for generating the transaction.
|
|
174
175
|
* @group Implementation
|
|
175
176
|
*/
|
|
@@ -179,9 +180,10 @@ export async function transferFungibleAsset(args: {
|
|
|
179
180
|
fungibleAssetMetadataAddress: AccountAddressInput;
|
|
180
181
|
recipient: AccountAddressInput;
|
|
181
182
|
amount: AnyNumber;
|
|
183
|
+
withFeePayer?: boolean;
|
|
182
184
|
options?: InputGenerateTransactionOptions;
|
|
183
185
|
}): Promise<SimpleTransaction> {
|
|
184
|
-
const { aptosConfig, sender, fungibleAssetMetadataAddress, recipient, amount, options } = args;
|
|
186
|
+
const { aptosConfig, sender, fungibleAssetMetadataAddress, recipient, amount, withFeePayer, options } = args;
|
|
185
187
|
return generateTransaction({
|
|
186
188
|
aptosConfig,
|
|
187
189
|
sender: sender.accountAddress,
|
|
@@ -191,6 +193,7 @@ export async function transferFungibleAsset(args: {
|
|
|
191
193
|
functionArguments: [fungibleAssetMetadataAddress, recipient, amount],
|
|
192
194
|
abi: faTransferAbi,
|
|
193
195
|
},
|
|
196
|
+
withFeePayer,
|
|
194
197
|
options,
|
|
195
198
|
});
|
|
196
199
|
}
|
|
@@ -205,6 +208,7 @@ export async function transferFungibleAsset(args: {
|
|
|
205
208
|
* @param args.fromStore - The address of the fungible store initiating the transfer.
|
|
206
209
|
* @param args.toStore - The address of the fungible store receiving the asset.
|
|
207
210
|
* @param args.amount - The amount of the fungible asset to transfer. Must be a positive number.
|
|
211
|
+
* @param args.withFeePayer - Whether to build a fee-payer transaction.
|
|
208
212
|
* @param args.options - Optional settings for generating the transaction.
|
|
209
213
|
* @returns A SimpleTransaction that can be submitted to the blockchain.
|
|
210
214
|
* @throws Error if the transaction generation fails or if the input parameters are invalid.
|
|
@@ -216,9 +220,10 @@ export async function transferFungibleAssetBetweenStores(args: {
|
|
|
216
220
|
fromStore: AccountAddressInput;
|
|
217
221
|
toStore: AccountAddressInput;
|
|
218
222
|
amount: AnyNumber;
|
|
223
|
+
withFeePayer?: boolean;
|
|
219
224
|
options?: InputGenerateTransactionOptions;
|
|
220
225
|
}): Promise<SimpleTransaction> {
|
|
221
|
-
const { aptosConfig, sender, fromStore, toStore, amount, options } = args;
|
|
226
|
+
const { aptosConfig, sender, fromStore, toStore, amount, withFeePayer, options } = args;
|
|
222
227
|
return generateTransaction({
|
|
223
228
|
aptosConfig,
|
|
224
229
|
sender: sender.accountAddress,
|
|
@@ -228,6 +233,7 @@ export async function transferFungibleAssetBetweenStores(args: {
|
|
|
228
233
|
functionArguments: [fromStore, toStore, amount],
|
|
229
234
|
abi: faTransferAbi,
|
|
230
235
|
},
|
|
236
|
+
withFeePayer,
|
|
231
237
|
options,
|
|
232
238
|
});
|
|
233
239
|
}
|
package/src/internal/keyless.ts
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
import { jwtDecode, JwtPayload } from "jwt-decode";
|
|
12
12
|
import { AptosConfig } from "../api/aptosConfig.js";
|
|
13
13
|
import { postAptosPepperService, postAptosProvingService } from "../client/index.js";
|
|
14
|
-
import { AccountAddressInput } from "../core/accountAddress.js";
|
|
14
|
+
import { AccountAddress, AccountAddressInput } from "../core/accountAddress.js";
|
|
15
15
|
import { Hex } from "../core/hex.js";
|
|
16
16
|
import { EphemeralSignature } from "../core/crypto/ephemeral.js";
|
|
17
17
|
import {
|
|
@@ -43,6 +43,35 @@ import { InputGenerateTransactionOptions, SimpleTransaction } from "../transacti
|
|
|
43
43
|
import { KeylessError, KeylessErrorType } from "../errors/index.js";
|
|
44
44
|
import { FIREBASE_AUTH_ISS_PATTERN } from "../utils/const.js";
|
|
45
45
|
|
|
46
|
+
async function fetchPepper(args: {
|
|
47
|
+
aptosConfig: AptosConfig;
|
|
48
|
+
jwt: string;
|
|
49
|
+
ephemeralPublicKey: HexInput;
|
|
50
|
+
expiryDateSecs: number;
|
|
51
|
+
blinder: HexInput;
|
|
52
|
+
uidKey: string;
|
|
53
|
+
derivationPath?: string;
|
|
54
|
+
originMethod: string;
|
|
55
|
+
}): Promise<PepperFetchResponse> {
|
|
56
|
+
const { aptosConfig, jwt, ephemeralPublicKey, expiryDateSecs, blinder, uidKey, derivationPath, originMethod } = args;
|
|
57
|
+
const body: PepperFetchRequest = {
|
|
58
|
+
jwt_b64: jwt,
|
|
59
|
+
epk: Hex.fromHexInput(ephemeralPublicKey).toStringWithoutPrefix(),
|
|
60
|
+
exp_date_secs: expiryDateSecs,
|
|
61
|
+
epk_blinder: Hex.fromHexInput(blinder).toStringWithoutPrefix(),
|
|
62
|
+
uid_key: uidKey,
|
|
63
|
+
derivation_path: derivationPath,
|
|
64
|
+
};
|
|
65
|
+
const { data } = await postAptosPepperService<PepperFetchRequest, PepperFetchResponse>({
|
|
66
|
+
aptosConfig,
|
|
67
|
+
path: "fetch",
|
|
68
|
+
body,
|
|
69
|
+
originMethod,
|
|
70
|
+
overrides: { WITH_CREDENTIALS: false },
|
|
71
|
+
});
|
|
72
|
+
return data;
|
|
73
|
+
}
|
|
74
|
+
|
|
46
75
|
/**
|
|
47
76
|
* Retrieves a pepper value based on the provided configuration and authentication details.
|
|
48
77
|
*
|
|
@@ -64,24 +93,57 @@ export async function getPepper(args: {
|
|
|
64
93
|
}): Promise<Uint8Array> {
|
|
65
94
|
const { aptosConfig, jwt, ephemeralKeyPair, uidKey = "sub", derivationPath } = args;
|
|
66
95
|
|
|
67
|
-
const
|
|
68
|
-
jwt_b64: jwt,
|
|
69
|
-
epk: ephemeralKeyPair.getPublicKey().bcsToHex().toStringWithoutPrefix(),
|
|
70
|
-
exp_date_secs: ephemeralKeyPair.expiryDateSecs,
|
|
71
|
-
epk_blinder: Hex.fromHexInput(ephemeralKeyPair.blinder).toStringWithoutPrefix(),
|
|
72
|
-
uid_key: uidKey,
|
|
73
|
-
derivation_path: derivationPath,
|
|
74
|
-
};
|
|
75
|
-
const { data } = await postAptosPepperService<PepperFetchRequest, PepperFetchResponse>({
|
|
96
|
+
const data = await fetchPepper({
|
|
76
97
|
aptosConfig,
|
|
77
|
-
|
|
78
|
-
|
|
98
|
+
jwt,
|
|
99
|
+
ephemeralPublicKey: ephemeralKeyPair.getPublicKey().bcsToBytes(),
|
|
100
|
+
expiryDateSecs: ephemeralKeyPair.expiryDateSecs,
|
|
101
|
+
blinder: ephemeralKeyPair.blinder,
|
|
102
|
+
uidKey,
|
|
103
|
+
derivationPath,
|
|
79
104
|
originMethod: "getPepper",
|
|
80
|
-
overrides: { WITH_CREDENTIALS: false },
|
|
81
105
|
});
|
|
82
106
|
return Hex.fromHexInput(data.pepper).toUint8Array();
|
|
83
107
|
}
|
|
84
108
|
|
|
109
|
+
/**
|
|
110
|
+
* Retrieves pepper bytes and the initial Keyless account address from public
|
|
111
|
+
* ephemeral key components.
|
|
112
|
+
*
|
|
113
|
+
* The ephemeral public key must be BCS-serialized. The returned address is the
|
|
114
|
+
* initial address derived by the pepper service; it does not account for later
|
|
115
|
+
* authentication-key rotation. This lookup does not prove possession of the
|
|
116
|
+
* ephemeral private key. Off-chain authentication must additionally verify a
|
|
117
|
+
* signature over a fresh, replay-protected challenge.
|
|
118
|
+
*
|
|
119
|
+
* @group Implementation
|
|
120
|
+
*/
|
|
121
|
+
export async function getPepperAndAddress(args: {
|
|
122
|
+
aptosConfig: AptosConfig;
|
|
123
|
+
jwt: string;
|
|
124
|
+
ephemeralPublicKey: HexInput;
|
|
125
|
+
expiryDateSecs: number;
|
|
126
|
+
blinder: HexInput;
|
|
127
|
+
uidKey?: string;
|
|
128
|
+
derivationPath?: string;
|
|
129
|
+
}): Promise<{ pepper: Uint8Array; address: AccountAddress }> {
|
|
130
|
+
const { aptosConfig, jwt, ephemeralPublicKey, expiryDateSecs, blinder, uidKey = "sub", derivationPath } = args;
|
|
131
|
+
const data = await fetchPepper({
|
|
132
|
+
aptosConfig,
|
|
133
|
+
jwt,
|
|
134
|
+
ephemeralPublicKey,
|
|
135
|
+
expiryDateSecs,
|
|
136
|
+
blinder,
|
|
137
|
+
uidKey,
|
|
138
|
+
derivationPath,
|
|
139
|
+
originMethod: "getPepperAndAddress",
|
|
140
|
+
});
|
|
141
|
+
return {
|
|
142
|
+
pepper: Hex.fromHexInput(data.pepper).toUint8Array(),
|
|
143
|
+
address: AccountAddress.from(data.address),
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
|
|
85
147
|
/**
|
|
86
148
|
* Retrieves the `pepper_base` for an account — the VUF signature from which the final pepper is derived.
|
|
87
149
|
*
|
|
@@ -300,14 +362,28 @@ export interface JWKS {
|
|
|
300
362
|
keys: MoveJWK[];
|
|
301
363
|
}
|
|
302
364
|
|
|
365
|
+
/**
|
|
366
|
+
* Builds a transaction that updates the federated keyless JWK set for an issuer.
|
|
367
|
+
*
|
|
368
|
+
* @param args - The arguments for updating the JWK set.
|
|
369
|
+
* @param args.aptosConfig - The configuration settings for the Aptos client.
|
|
370
|
+
* @param args.sender - The account that will install the JWK set.
|
|
371
|
+
* @param args.iss - The issuer claim of the federated OIDC provider.
|
|
372
|
+
* @param args.jwksUrl - The optional URL from which to fetch the JWK set.
|
|
373
|
+
* @param args.withFeePayer - Whether to build a sponsored transaction.
|
|
374
|
+
* @param args.options - Optional settings for generating the transaction.
|
|
375
|
+
* @returns A transaction that updates the federated JWK set.
|
|
376
|
+
* @group Implementation
|
|
377
|
+
*/
|
|
303
378
|
export async function updateFederatedKeylessJwkSetTransaction(args: {
|
|
304
379
|
aptosConfig: AptosConfig;
|
|
305
380
|
sender: Account;
|
|
306
381
|
iss: string;
|
|
307
382
|
jwksUrl?: string;
|
|
383
|
+
withFeePayer?: boolean;
|
|
308
384
|
options?: InputGenerateTransactionOptions;
|
|
309
385
|
}): Promise<SimpleTransaction> {
|
|
310
|
-
const { aptosConfig, sender, iss, options } = args;
|
|
386
|
+
const { aptosConfig, sender, iss, withFeePayer, options } = args;
|
|
311
387
|
|
|
312
388
|
let { jwksUrl } = args;
|
|
313
389
|
|
|
@@ -371,6 +447,7 @@ export async function updateFederatedKeylessJwkSetTransaction(args: {
|
|
|
371
447
|
return generateTransaction({
|
|
372
448
|
aptosConfig,
|
|
373
449
|
sender: sender.accountAddress,
|
|
450
|
+
withFeePayer,
|
|
374
451
|
data: {
|
|
375
452
|
function: "0x1::jwks::update_federated_jwk_set",
|
|
376
453
|
functionArguments: [
|