@mysten/sui 2.31.0 → 2.31.1
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 +9 -0
- package/dist/bcs/bcs.d.mts +6 -6
- package/dist/bcs/index.d.mts +36 -36
- package/dist/client/core-resolver.d.mts.map +1 -1
- package/dist/client/core-resolver.mjs +3 -2
- package/dist/client/core-resolver.mjs.map +1 -1
- package/dist/cryptography/signature.d.mts +6 -6
- package/dist/grpc/proto/sui/forking/v1alpha/forking_service.client.d.mts +4 -4
- package/dist/grpc/proto/sui/rpc/v2/ledger_service.client.d.mts +4 -4
- package/dist/grpc/proto/sui/rpc/v2/move_package_service.client.d.mts +4 -4
- package/dist/grpc/proto/sui/rpc/v2/name_service.client.d.mts +4 -4
- package/dist/grpc/proto/sui/rpc/v2/signature_verification_service.client.d.mts +4 -4
- package/dist/grpc/proto/sui/rpc/v2/state_service.client.d.mts +4 -4
- package/dist/grpc/proto/sui/rpc/v2/subscription_service.client.d.mts +4 -4
- package/dist/grpc/proto/sui/rpc/v2/transaction_execution_service.client.d.mts +4 -4
- package/dist/transactions/Transaction.d.mts +3 -3
- package/dist/version.mjs +1 -1
- package/dist/version.mjs.map +1 -1
- package/dist/zklogin/bcs.d.mts +14 -14
- package/package.json +1 -1
- package/src/client/core-resolver.ts +6 -2
- package/src/version.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @mysten/sui.js
|
|
2
2
|
|
|
3
|
+
## 2.31.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- c3966e2: Limit automatic gas selection in the JSON-RPC transaction resolver to 256 payment
|
|
8
|
+
entries, including any address-balance reservation. Preserve the existing single-page coin fetch
|
|
9
|
+
and its default limit, then truncate the filtered coins without enforcing a combined transaction
|
|
10
|
+
input limit.
|
|
11
|
+
|
|
3
12
|
## 2.31.0
|
|
4
13
|
|
|
5
14
|
### Minor Changes
|
package/dist/bcs/bcs.d.mts
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { TypeTag as TypeTag$1 } from "./types.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as _mysten_bcs1254 from "@mysten/bcs";
|
|
3
3
|
import { BcsType } from "@mysten/bcs";
|
|
4
4
|
|
|
5
5
|
//#region src/bcs/bcs.d.ts
|
|
6
6
|
declare const TypeTag: BcsType<string, string | TypeTag$1, string>;
|
|
7
|
-
declare function IntentMessage<T extends BcsType<any>>(T: T):
|
|
8
|
-
intent:
|
|
9
|
-
scope:
|
|
7
|
+
declare function IntentMessage<T extends BcsType<any>>(T: T): _mysten_bcs1254.BcsStruct<{
|
|
8
|
+
intent: _mysten_bcs1254.BcsStruct<{
|
|
9
|
+
scope: _mysten_bcs1254.BcsEnum<{
|
|
10
10
|
TransactionData: null;
|
|
11
11
|
TransactionEffects: null;
|
|
12
12
|
CheckpointSummary: null;
|
|
13
13
|
PersonalMessage: null;
|
|
14
14
|
}, "IntentScope">;
|
|
15
|
-
version:
|
|
15
|
+
version: _mysten_bcs1254.BcsEnum<{
|
|
16
16
|
V0: null;
|
|
17
17
|
}, "IntentVersion">;
|
|
18
|
-
appId:
|
|
18
|
+
appId: _mysten_bcs1254.BcsEnum<{
|
|
19
19
|
Sui: null;
|
|
20
20
|
}, "AppId">;
|
|
21
21
|
}, string>;
|
package/dist/bcs/index.d.mts
CHANGED
|
@@ -549,7 +549,7 @@ declare const suiBcs: {
|
|
|
549
549
|
version: string;
|
|
550
550
|
digest: string;
|
|
551
551
|
};
|
|
552
|
-
}, "
|
|
552
|
+
}, "ImmOrOwnedObject" | "SharedObject" | "Receiving">;
|
|
553
553
|
FundsWithdrawal: {
|
|
554
554
|
reservation: {
|
|
555
555
|
MaxAmountU64: string;
|
|
@@ -568,7 +568,7 @@ declare const suiBcs: {
|
|
|
568
568
|
};
|
|
569
569
|
}, "Sender" | "Sponsor" | "SenderAllowance">;
|
|
570
570
|
};
|
|
571
|
-
}, "
|
|
571
|
+
}, "Pure" | "Object" | "FundsWithdrawal">[], Iterable<_mysten_bcs0.EnumInputShape<{
|
|
572
572
|
Pure: {
|
|
573
573
|
bytes: string | Uint8Array<ArrayBufferLike>;
|
|
574
574
|
};
|
|
@@ -805,7 +805,7 @@ declare const suiBcs: {
|
|
|
805
805
|
TransactionEffects: true;
|
|
806
806
|
CheckpointSummary: true;
|
|
807
807
|
PersonalMessage: true;
|
|
808
|
-
}, "
|
|
808
|
+
}, "TransactionData" | "TransactionEffects" | "CheckpointSummary" | "PersonalMessage">;
|
|
809
809
|
version: {
|
|
810
810
|
V0: true;
|
|
811
811
|
$kind: "V0";
|
|
@@ -839,7 +839,7 @@ declare const suiBcs: {
|
|
|
839
839
|
version: string;
|
|
840
840
|
digest: string;
|
|
841
841
|
};
|
|
842
|
-
}, "
|
|
842
|
+
}, "ImmOrOwnedObject" | "SharedObject" | "Receiving">;
|
|
843
843
|
FundsWithdrawal: {
|
|
844
844
|
reservation: {
|
|
845
845
|
MaxAmountU64: string;
|
|
@@ -858,7 +858,7 @@ declare const suiBcs: {
|
|
|
858
858
|
};
|
|
859
859
|
}, "Sender" | "Sponsor" | "SenderAllowance">;
|
|
860
860
|
};
|
|
861
|
-
}, "
|
|
861
|
+
}, "Pure" | "Object" | "FundsWithdrawal">[];
|
|
862
862
|
commands: _mysten_bcs0.EnumOutputShapeWithKeys<{
|
|
863
863
|
MoveCall: {
|
|
864
864
|
package: string;
|
|
@@ -997,7 +997,7 @@ declare const suiBcs: {
|
|
|
997
997
|
startVersion: string;
|
|
998
998
|
owner: string;
|
|
999
999
|
};
|
|
1000
|
-
}, "AddressOwner" | "
|
|
1000
|
+
}, "AddressOwner" | "ObjectOwner" | "Shared" | "Immutable" | "ConsensusAddressOwner">;
|
|
1001
1001
|
};
|
|
1002
1002
|
$kind: "RawObject";
|
|
1003
1003
|
}[];
|
|
@@ -1130,7 +1130,7 @@ declare const suiBcs: {
|
|
|
1130
1130
|
version: string;
|
|
1131
1131
|
digest: string;
|
|
1132
1132
|
};
|
|
1133
|
-
}, "
|
|
1133
|
+
}, "ImmOrOwnedObject" | "SharedObject" | "Receiving">;
|
|
1134
1134
|
FundsWithdrawal: {
|
|
1135
1135
|
reservation: {
|
|
1136
1136
|
MaxAmountU64: string;
|
|
@@ -1149,7 +1149,7 @@ declare const suiBcs: {
|
|
|
1149
1149
|
};
|
|
1150
1150
|
}, "Sender" | "Sponsor" | "SenderAllowance">;
|
|
1151
1151
|
};
|
|
1152
|
-
}, "
|
|
1152
|
+
}, "Pure" | "Object" | "FundsWithdrawal">[];
|
|
1153
1153
|
commands: _mysten_bcs0.EnumOutputShapeWithKeys<{
|
|
1154
1154
|
MoveCall: {
|
|
1155
1155
|
package: string;
|
|
@@ -1231,7 +1231,7 @@ declare const suiBcs: {
|
|
|
1231
1231
|
};
|
|
1232
1232
|
}, "MoveCall" | "TransferObjects" | "SplitCoins" | "MergeCoins" | "Publish" | "MakeMoveVec" | "Upgrade">[];
|
|
1233
1233
|
};
|
|
1234
|
-
}, "
|
|
1234
|
+
}, "ProgrammableTransaction" | "ChangeEpoch" | "Genesis" | "ConsensusCommitPrologue" | "AuthenticatorStateUpdate" | "EndOfEpochTransaction" | "RandomnessStateUpdate" | "ConsensusCommitPrologueV2" | "ConsensusCommitPrologueV3" | "ConsensusCommitPrologueV4" | "ProgrammableSystemTransaction">;
|
|
1235
1235
|
sender: string;
|
|
1236
1236
|
gasData: {
|
|
1237
1237
|
payment: {
|
|
@@ -1266,7 +1266,7 @@ declare const suiBcs: {
|
|
|
1266
1266
|
proposers: number[];
|
|
1267
1267
|
} | null;
|
|
1268
1268
|
};
|
|
1269
|
-
}, "
|
|
1269
|
+
}, "None" | "Epoch" | "ValidDuring" | "Validity">;
|
|
1270
1270
|
};
|
|
1271
1271
|
$kind: "V1";
|
|
1272
1272
|
};
|
|
@@ -1877,7 +1877,7 @@ declare const suiBcs: {
|
|
|
1877
1877
|
version: string;
|
|
1878
1878
|
digest: string;
|
|
1879
1879
|
};
|
|
1880
|
-
}, "
|
|
1880
|
+
}, "ImmOrOwnedObject" | "SharedObject" | "Receiving">;
|
|
1881
1881
|
FundsWithdrawal: {
|
|
1882
1882
|
reservation: {
|
|
1883
1883
|
MaxAmountU64: string;
|
|
@@ -1896,7 +1896,7 @@ declare const suiBcs: {
|
|
|
1896
1896
|
};
|
|
1897
1897
|
}, "Sender" | "Sponsor" | "SenderAllowance">;
|
|
1898
1898
|
};
|
|
1899
|
-
}, "
|
|
1899
|
+
}, "Pure" | "Object" | "FundsWithdrawal">[], Iterable<_mysten_bcs0.EnumInputShape<{
|
|
1900
1900
|
Pure: {
|
|
1901
1901
|
bytes: string | Uint8Array<ArrayBufferLike>;
|
|
1902
1902
|
};
|
|
@@ -2181,7 +2181,7 @@ declare const suiBcs: {
|
|
|
2181
2181
|
startVersion: string;
|
|
2182
2182
|
owner: string;
|
|
2183
2183
|
};
|
|
2184
|
-
}, "AddressOwner" | "
|
|
2184
|
+
}, "AddressOwner" | "ObjectOwner" | "Shared" | "Immutable" | "ConsensusAddressOwner">;
|
|
2185
2185
|
};
|
|
2186
2186
|
$kind: "RawObject";
|
|
2187
2187
|
}[], Iterable<{
|
|
@@ -2459,7 +2459,7 @@ declare const suiBcs: {
|
|
|
2459
2459
|
version: string;
|
|
2460
2460
|
digest: string;
|
|
2461
2461
|
};
|
|
2462
|
-
}, "
|
|
2462
|
+
}, "ImmOrOwnedObject" | "SharedObject" | "Receiving">;
|
|
2463
2463
|
FundsWithdrawal: {
|
|
2464
2464
|
reservation: {
|
|
2465
2465
|
MaxAmountU64: string;
|
|
@@ -2478,7 +2478,7 @@ declare const suiBcs: {
|
|
|
2478
2478
|
};
|
|
2479
2479
|
}, "Sender" | "Sponsor" | "SenderAllowance">;
|
|
2480
2480
|
};
|
|
2481
|
-
}, "
|
|
2481
|
+
}, "Pure" | "Object" | "FundsWithdrawal">[], Iterable<_mysten_bcs0.EnumInputShape<{
|
|
2482
2482
|
Pure: {
|
|
2483
2483
|
bytes: string | Uint8Array<ArrayBufferLike>;
|
|
2484
2484
|
};
|
|
@@ -2794,7 +2794,7 @@ declare const suiBcs: {
|
|
|
2794
2794
|
version: string;
|
|
2795
2795
|
digest: string;
|
|
2796
2796
|
};
|
|
2797
|
-
}, "
|
|
2797
|
+
}, "ImmOrOwnedObject" | "SharedObject" | "Receiving">;
|
|
2798
2798
|
FundsWithdrawal: {
|
|
2799
2799
|
reservation: {
|
|
2800
2800
|
MaxAmountU64: string;
|
|
@@ -2813,7 +2813,7 @@ declare const suiBcs: {
|
|
|
2813
2813
|
};
|
|
2814
2814
|
}, "Sender" | "Sponsor" | "SenderAllowance">;
|
|
2815
2815
|
};
|
|
2816
|
-
}, "
|
|
2816
|
+
}, "Pure" | "Object" | "FundsWithdrawal">[], Iterable<_mysten_bcs0.EnumInputShape<{
|
|
2817
2817
|
Pure: {
|
|
2818
2818
|
bytes: string | Uint8Array<ArrayBufferLike>;
|
|
2819
2819
|
};
|
|
@@ -3098,7 +3098,7 @@ declare const suiBcs: {
|
|
|
3098
3098
|
startVersion: string;
|
|
3099
3099
|
owner: string;
|
|
3100
3100
|
};
|
|
3101
|
-
}, "AddressOwner" | "
|
|
3101
|
+
}, "AddressOwner" | "ObjectOwner" | "Shared" | "Immutable" | "ConsensusAddressOwner">;
|
|
3102
3102
|
};
|
|
3103
3103
|
$kind: "RawObject";
|
|
3104
3104
|
}[], Iterable<{
|
|
@@ -3376,7 +3376,7 @@ declare const suiBcs: {
|
|
|
3376
3376
|
version: string;
|
|
3377
3377
|
digest: string;
|
|
3378
3378
|
};
|
|
3379
|
-
}, "
|
|
3379
|
+
}, "ImmOrOwnedObject" | "SharedObject" | "Receiving">;
|
|
3380
3380
|
FundsWithdrawal: {
|
|
3381
3381
|
reservation: {
|
|
3382
3382
|
MaxAmountU64: string;
|
|
@@ -3395,7 +3395,7 @@ declare const suiBcs: {
|
|
|
3395
3395
|
};
|
|
3396
3396
|
}, "Sender" | "Sponsor" | "SenderAllowance">;
|
|
3397
3397
|
};
|
|
3398
|
-
}, "
|
|
3398
|
+
}, "Pure" | "Object" | "FundsWithdrawal">[], Iterable<_mysten_bcs0.EnumInputShape<{
|
|
3399
3399
|
Pure: {
|
|
3400
3400
|
bytes: string | Uint8Array<ArrayBufferLike>;
|
|
3401
3401
|
};
|
|
@@ -3687,7 +3687,7 @@ declare const suiBcs: {
|
|
|
3687
3687
|
version: string;
|
|
3688
3688
|
digest: string;
|
|
3689
3689
|
};
|
|
3690
|
-
}, "
|
|
3690
|
+
}, "ImmOrOwnedObject" | "SharedObject" | "Receiving">;
|
|
3691
3691
|
FundsWithdrawal: {
|
|
3692
3692
|
reservation: {
|
|
3693
3693
|
MaxAmountU64: string;
|
|
@@ -3706,7 +3706,7 @@ declare const suiBcs: {
|
|
|
3706
3706
|
};
|
|
3707
3707
|
}, "Sender" | "Sponsor" | "SenderAllowance">;
|
|
3708
3708
|
};
|
|
3709
|
-
}, "
|
|
3709
|
+
}, "Pure" | "Object" | "FundsWithdrawal">[], Iterable<_mysten_bcs0.EnumInputShape<{
|
|
3710
3710
|
Pure: {
|
|
3711
3711
|
bytes: string | Uint8Array<ArrayBufferLike>;
|
|
3712
3712
|
};
|
|
@@ -3991,7 +3991,7 @@ declare const suiBcs: {
|
|
|
3991
3991
|
startVersion: string;
|
|
3992
3992
|
owner: string;
|
|
3993
3993
|
};
|
|
3994
|
-
}, "AddressOwner" | "
|
|
3994
|
+
}, "AddressOwner" | "ObjectOwner" | "Shared" | "Immutable" | "ConsensusAddressOwner">;
|
|
3995
3995
|
};
|
|
3996
3996
|
$kind: "RawObject";
|
|
3997
3997
|
}[], Iterable<{
|
|
@@ -4269,7 +4269,7 @@ declare const suiBcs: {
|
|
|
4269
4269
|
version: string;
|
|
4270
4270
|
digest: string;
|
|
4271
4271
|
};
|
|
4272
|
-
}, "
|
|
4272
|
+
}, "ImmOrOwnedObject" | "SharedObject" | "Receiving">;
|
|
4273
4273
|
FundsWithdrawal: {
|
|
4274
4274
|
reservation: {
|
|
4275
4275
|
MaxAmountU64: string;
|
|
@@ -4288,7 +4288,7 @@ declare const suiBcs: {
|
|
|
4288
4288
|
};
|
|
4289
4289
|
}, "Sender" | "Sponsor" | "SenderAllowance">;
|
|
4290
4290
|
};
|
|
4291
|
-
}, "
|
|
4291
|
+
}, "Pure" | "Object" | "FundsWithdrawal">[], Iterable<_mysten_bcs0.EnumInputShape<{
|
|
4292
4292
|
Pure: {
|
|
4293
4293
|
bytes: string | Uint8Array<ArrayBufferLike>;
|
|
4294
4294
|
};
|
|
@@ -4762,7 +4762,7 @@ declare const suiBcs: {
|
|
|
4762
4762
|
startVersion: string;
|
|
4763
4763
|
owner: string;
|
|
4764
4764
|
};
|
|
4765
|
-
}, "AddressOwner" | "
|
|
4765
|
+
}, "AddressOwner" | "ObjectOwner" | "Shared" | "Immutable" | "ConsensusAddressOwner">][], Iterable<readonly [{
|
|
4766
4766
|
objectId: string | Uint8Array<ArrayBufferLike>;
|
|
4767
4767
|
version: string | number | bigint;
|
|
4768
4768
|
digest: string;
|
|
@@ -4795,7 +4795,7 @@ declare const suiBcs: {
|
|
|
4795
4795
|
startVersion: string;
|
|
4796
4796
|
owner: string;
|
|
4797
4797
|
};
|
|
4798
|
-
}, "AddressOwner" | "
|
|
4798
|
+
}, "AddressOwner" | "ObjectOwner" | "Shared" | "Immutable" | "ConsensusAddressOwner">][], Iterable<readonly [{
|
|
4799
4799
|
objectId: string | Uint8Array<ArrayBufferLike>;
|
|
4800
4800
|
version: string | number | bigint;
|
|
4801
4801
|
digest: string;
|
|
@@ -4828,7 +4828,7 @@ declare const suiBcs: {
|
|
|
4828
4828
|
startVersion: string;
|
|
4829
4829
|
owner: string;
|
|
4830
4830
|
};
|
|
4831
|
-
}, "AddressOwner" | "
|
|
4831
|
+
}, "AddressOwner" | "ObjectOwner" | "Shared" | "Immutable" | "ConsensusAddressOwner">][], Iterable<readonly [{
|
|
4832
4832
|
objectId: string | Uint8Array<ArrayBufferLike>;
|
|
4833
4833
|
version: string | number | bigint;
|
|
4834
4834
|
digest: string;
|
|
@@ -5096,7 +5096,7 @@ declare const suiBcs: {
|
|
|
5096
5096
|
startVersion: string;
|
|
5097
5097
|
owner: string;
|
|
5098
5098
|
};
|
|
5099
|
-
}, "AddressOwner" | "
|
|
5099
|
+
}, "AddressOwner" | "ObjectOwner" | "Shared" | "Immutable" | "ConsensusAddressOwner">];
|
|
5100
5100
|
}, "NotExist" | "Exist">;
|
|
5101
5101
|
outputState: _mysten_bcs0.EnumOutputShapeWithKeys<{
|
|
5102
5102
|
NotExist: true;
|
|
@@ -5111,7 +5111,7 @@ declare const suiBcs: {
|
|
|
5111
5111
|
startVersion: string;
|
|
5112
5112
|
owner: string;
|
|
5113
5113
|
};
|
|
5114
|
-
}, "AddressOwner" | "
|
|
5114
|
+
}, "AddressOwner" | "ObjectOwner" | "Shared" | "Immutable" | "ConsensusAddressOwner">];
|
|
5115
5115
|
PackageWrite: [string, string];
|
|
5116
5116
|
AccumulatorWriteV1: {
|
|
5117
5117
|
address: {
|
|
@@ -5197,7 +5197,7 @@ declare const suiBcs: {
|
|
|
5197
5197
|
ReadConsensusStreamEnded: string;
|
|
5198
5198
|
Cancelled: string;
|
|
5199
5199
|
PerEpochConfig: true;
|
|
5200
|
-
}, "
|
|
5200
|
+
}, "ReadOnlyRoot" | "MutateConsensusStreamEnded" | "ReadConsensusStreamEnded" | "Cancelled" | "PerEpochConfig">][], Iterable<readonly [string | Uint8Array<ArrayBufferLike>, _mysten_bcs0.EnumInputShape<{
|
|
5201
5201
|
ReadOnlyRoot: readonly [string | number | bigint, string];
|
|
5202
5202
|
MutateConsensusStreamEnded: string | number | bigint;
|
|
5203
5203
|
ReadConsensusStreamEnded: string | number | bigint;
|
|
@@ -5258,7 +5258,7 @@ declare const suiBcs: {
|
|
|
5258
5258
|
version: string;
|
|
5259
5259
|
digest: string;
|
|
5260
5260
|
};
|
|
5261
|
-
}, "
|
|
5261
|
+
}, "ImmOrOwnedObject" | "SharedObject" | "Receiving">;
|
|
5262
5262
|
FundsWithdrawal: {
|
|
5263
5263
|
reservation: {
|
|
5264
5264
|
MaxAmountU64: string;
|
|
@@ -5277,7 +5277,7 @@ declare const suiBcs: {
|
|
|
5277
5277
|
};
|
|
5278
5278
|
}, "Sender" | "Sponsor" | "SenderAllowance">;
|
|
5279
5279
|
};
|
|
5280
|
-
}, "
|
|
5280
|
+
}, "Pure" | "Object" | "FundsWithdrawal">[], Iterable<_mysten_bcs0.EnumInputShape<{
|
|
5281
5281
|
Pure: {
|
|
5282
5282
|
bytes: string | Uint8Array<ArrayBufferLike>;
|
|
5283
5283
|
};
|
|
@@ -5562,7 +5562,7 @@ declare const suiBcs: {
|
|
|
5562
5562
|
startVersion: string;
|
|
5563
5563
|
owner: string;
|
|
5564
5564
|
};
|
|
5565
|
-
}, "AddressOwner" | "
|
|
5565
|
+
}, "AddressOwner" | "ObjectOwner" | "Shared" | "Immutable" | "ConsensusAddressOwner">;
|
|
5566
5566
|
};
|
|
5567
5567
|
$kind: "RawObject";
|
|
5568
5568
|
}[], Iterable<{
|
|
@@ -5840,7 +5840,7 @@ declare const suiBcs: {
|
|
|
5840
5840
|
version: string;
|
|
5841
5841
|
digest: string;
|
|
5842
5842
|
};
|
|
5843
|
-
}, "
|
|
5843
|
+
}, "ImmOrOwnedObject" | "SharedObject" | "Receiving">;
|
|
5844
5844
|
FundsWithdrawal: {
|
|
5845
5845
|
reservation: {
|
|
5846
5846
|
MaxAmountU64: string;
|
|
@@ -5859,7 +5859,7 @@ declare const suiBcs: {
|
|
|
5859
5859
|
};
|
|
5860
5860
|
}, "Sender" | "Sponsor" | "SenderAllowance">;
|
|
5861
5861
|
};
|
|
5862
|
-
}, "
|
|
5862
|
+
}, "Pure" | "Object" | "FundsWithdrawal">[], Iterable<_mysten_bcs0.EnumInputShape<{
|
|
5863
5863
|
Pure: {
|
|
5864
5864
|
bytes: string | Uint8Array<ArrayBufferLike>;
|
|
5865
5865
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core-resolver.d.mts","names":[],"sources":["../../src/client/core-resolver.ts"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"core-resolver.d.mts","names":[],"sources":["../../src/client/core-resolver.ts"],"mappings":";;;;;iBAsDsB,kCAAA,CACrB,eAAA,EAAiB,sBAAA,EACjB,OAAA,EAAS,uBAAA,EACT,IAAA,QAAY,OAAA,SAAa,OAAA"}
|
|
@@ -9,6 +9,7 @@ import { chunk } from "@mysten/utils";
|
|
|
9
9
|
|
|
10
10
|
//#region src/client/core-resolver.ts
|
|
11
11
|
const MAX_OBJECTS_PER_FETCH = 50;
|
|
12
|
+
const MAX_GAS_PAYMENT_OBJECTS = 256;
|
|
12
13
|
const GAS_SAFE_OVERHEAD = 1000n;
|
|
13
14
|
const MAX_GAS = 5e10;
|
|
14
15
|
/** Compute a gas budget from gasUsed effects data. */
|
|
@@ -114,9 +115,9 @@ function setGasPayment({ transactionData, balance, coins, usesGasCoin, withdrawa
|
|
|
114
115
|
version: coin.version
|
|
115
116
|
}));
|
|
116
117
|
const reservationAmount = addressBalance - withdrawals;
|
|
117
|
-
if (usesGasCoin && reservationAmount > 0n && chainIdentifier && epoch) transactionData.gasData.payment = [createCoinReservationRef(reservationAmount, gasPayer, chainIdentifier, epoch), ...paymentCoins];
|
|
118
|
+
if (usesGasCoin && reservationAmount > 0n && chainIdentifier && epoch) transactionData.gasData.payment = [createCoinReservationRef(reservationAmount, gasPayer, chainIdentifier, epoch), ...paymentCoins.slice(0, MAX_GAS_PAYMENT_OBJECTS - 1)];
|
|
118
119
|
else if (!filteredCoins.length) throw new Error("No valid gas coins found for the transaction.");
|
|
119
|
-
else transactionData.gasData.payment = paymentCoins;
|
|
120
|
+
else transactionData.gasData.payment = paymentCoins.slice(0, MAX_GAS_PAYMENT_OBJECTS);
|
|
120
121
|
}
|
|
121
122
|
async function setExpiration(transactionData, client, systemState, existingChainIdentifier = null) {
|
|
122
123
|
const [chainIdentifier, resolvedSystemState] = await Promise.all([existingChainIdentifier ?? client.core.getChainIdentifier().then((r) => r.chainIdentifier), systemState ?? client.core.getCurrentSystemState().then((r) => r.systemState)]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core-resolver.mjs","names":[],"sources":["../../src/client/core-resolver.ts"],"sourcesContent":["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nimport {\n\tnormalizeSuiAddress,\n\tnormalizeSuiObjectId,\n\tnormalizeStructTag,\n\tSUI_TYPE_ARG,\n} from '../utils/index.js';\nimport { createCoinReservationRef } from '../utils/coin-reservation.js';\nimport type { ClientWithCoreApi } from './core.js';\nimport type { CallArg, Command } from '../transactions/data/internal.js';\nimport type { SuiClientTypes } from './types.js';\nimport { SimulationError } from './errors.js';\nimport { Inputs } from '../transactions/Inputs.js';\nimport { getPureBcsSchema, isTxContext } from '../transactions/serializer.js';\nimport type { TransactionDataBuilder } from '../transactions/TransactionData.js';\nimport { chunk } from '@mysten/utils';\nimport type { BuildTransactionOptions } from '../transactions/index.js';\nimport { transactionUsesGasCoin } from '../transactions/resolution-utils.js';\n\n// The maximum objects that can be fetched at once using multiGetObjects.\nconst MAX_OBJECTS_PER_FETCH = 50;\n\n// An amount of gas (in gas units) that is added to transactions as an overhead to ensure transactions do not fail.\nconst GAS_SAFE_OVERHEAD = 1000n;\nconst MAX_GAS = 50_000_000_000;\n\n/** Compute a gas budget from gasUsed effects data. */\nexport function computeGasBudget(\n\tgasUsed: { computationCost: string; storageCost: string; storageRebate: string },\n\tgasPrice: bigint | string = 1n,\n): string {\n\tconst safeOverhead = GAS_SAFE_OVERHEAD * BigInt(gasPrice);\n\tconst baseComputationCostWithOverhead = BigInt(gasUsed.computationCost) + safeOverhead;\n\tconst gasBudget =\n\t\tbaseComputationCostWithOverhead + BigInt(gasUsed.storageCost) - BigInt(gasUsed.storageRebate);\n\treturn String(\n\t\tgasBudget > baseComputationCostWithOverhead ? gasBudget : baseComputationCostWithOverhead,\n\t);\n}\n\nfunction getClient(options: BuildTransactionOptions): ClientWithCoreApi {\n\tif (!options.client) {\n\t\tthrow new Error(\n\t\t\t`No sui client passed to Transaction#build, but transaction data was not sufficient to build offline.`,\n\t\t);\n\t}\n\treturn options.client;\n}\n\nexport async function coreClientResolveTransactionPlugin(\n\ttransactionData: TransactionDataBuilder,\n\toptions: BuildTransactionOptions,\n\tnext: () => Promise<void>,\n) {\n\tconst client = getClient(options);\n\tconst needsGasPrice = !options.onlyTransactionKind && !transactionData.gasData.price;\n\tconst needsPayment = !options.onlyTransactionKind && !transactionData.gasData.payment;\n\tconst gasPayer = transactionData.gasData.owner ?? transactionData.sender;\n\n\tconst usesGasCoin = transactionUsesGasCoin(transactionData);\n\tlet withdrawals = 0n;\n\n\tconst normalizedGasPayer = gasPayer ? normalizeSuiAddress(gasPayer) : null;\n\tfor (const input of transactionData.inputs) {\n\t\tif (input.$kind !== 'FundsWithdrawal' || !normalizedGasPayer) continue;\n\t\tif (normalizeStructTag(input.FundsWithdrawal.typeArg.Balance) !== SUI_TYPE_ARG) continue;\n\t\tconst source = input.FundsWithdrawal.withdrawFrom;\n\t\tconst withdrawalOwner = source.SenderAllowance\n\t\t\t? source.SenderAllowance.funder\n\t\t\t: source.Sender\n\t\t\t\t? transactionData.sender\n\t\t\t\t: gasPayer;\n\t\tif (\n\t\t\twithdrawalOwner &&\n\t\t\tnormalizeSuiAddress(withdrawalOwner) === normalizedGasPayer &&\n\t\t\tinput.FundsWithdrawal.reservation.$kind === 'MaxAmountU64'\n\t\t) {\n\t\t\twithdrawals += BigInt(input.FundsWithdrawal.reservation.MaxAmountU64);\n\t\t}\n\t}\n\n\t// `setGasBudget` simulates with `payment: []` whenever it has to compute a\n\t// budget (i.e. one wasn't preset). The validator's replay-protection check\n\t// then requires either a `ValidDuring` expiration or at least one\n\t// \"address-owned\" input — an `ImmOrOwnedMoveObject` whose owner is\n\t// `AddressOwner`, which we can't tell from `Immutable` without owner info we\n\t// don't track. Provide a simulate-only `ValidDuring` whenever we'll actually\n\t// simulate and one isn't user-set.\n\tconst needsSimulateExpiration =\n\t\t!options.onlyTransactionKind && !transactionData.expiration && !transactionData.gasData.budget;\n\tconst needsSystemState =\n\t\tneedsGasPrice || (needsPayment && usesGasCoin) || needsSimulateExpiration;\n\tconst needsChainId = (needsPayment && usesGasCoin) || needsSimulateExpiration;\n\tconst [, systemStateResult, balanceResult, coinsResult, chainIdResult] = await Promise.all([\n\t\tnormalizeInputs(transactionData, client),\n\t\tneedsSystemState ? client.core.getCurrentSystemState() : null,\n\t\tneedsPayment && gasPayer ? client.core.getBalance({ owner: gasPayer }) : null,\n\t\tneedsPayment && gasPayer\n\t\t\t? client.core.listCoins({ owner: gasPayer, coinType: SUI_TYPE_ARG })\n\t\t\t: null,\n\t\tneedsChainId ? client.core.getChainIdentifier() : null,\n\t]);\n\n\tawait resolveObjectReferences(transactionData, client);\n\n\tif (!options.onlyTransactionKind) {\n\t\tconst systemState = systemStateResult?.systemState ?? null;\n\t\tconst chainIdentifier = chainIdResult?.chainIdentifier ?? null;\n\n\t\tif (systemState && !transactionData.gasData.price) {\n\t\t\ttransactionData.gasData.price = systemState.referenceGasPrice;\n\t\t}\n\n\t\tconst simulateExpiration =\n\t\t\tneedsSimulateExpiration && systemState && chainIdentifier\n\t\t\t\t? buildValidDuringExpiration(systemState, chainIdentifier)\n\t\t\t\t: undefined;\n\n\t\tawait setGasBudget(transactionData, client, simulateExpiration);\n\n\t\tif (needsPayment) {\n\t\t\tif (!balanceResult || !coinsResult) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t'Could not resolve gas payment: a gas owner or sender must be set to fetch balance and coins.',\n\t\t\t\t);\n\t\t\t}\n\t\t\tsetGasPayment({\n\t\t\t\ttransactionData,\n\t\t\t\tbalance: balanceResult,\n\t\t\t\tcoins: coinsResult,\n\t\t\t\tusesGasCoin,\n\t\t\t\twithdrawals,\n\t\t\t\tgasPayer: gasPayer!,\n\t\t\t\tchainIdentifier,\n\t\t\t\tepoch: systemState?.epoch ?? null,\n\t\t\t});\n\t\t}\n\n\t\tif (!transactionData.expiration && transactionData.gasData.payment?.length === 0) {\n\t\t\tawait setExpiration(transactionData, client, systemState, chainIdentifier);\n\t\t}\n\t}\n\n\treturn await next();\n}\n\nasync function setGasBudget(\n\ttransactionData: TransactionDataBuilder,\n\tclient: ClientWithCoreApi,\n\tsimulateExpiration?: ValidDuringExpiration,\n) {\n\tif (transactionData.gasData.budget) {\n\t\treturn;\n\t}\n\n\tconst simulateResult = await client.core.simulateTransaction({\n\t\ttransaction: transactionData.build({\n\t\t\toverrides: {\n\t\t\t\tgasData: {\n\t\t\t\t\tbudget: String(MAX_GAS),\n\t\t\t\t\tpayment: [],\n\t\t\t\t},\n\t\t\t\t...(simulateExpiration && { expiration: simulateExpiration }),\n\t\t\t},\n\t\t}),\n\t\tinclude: { effects: true },\n\t\t// The empty payment above is a placeholder for budget estimation, not a real address\n\t\t// balance payment, so the server must simulate with a mocked gas coin rather than\n\t\t// selecting gas. gRPC and GraphQL support this option, and JSON-RPC always mocks gas.\n\t\tdoGasSelection: false,\n\t} as SuiClientTypes.SimulateTransactionOptions<{ effects: true }> & { doGasSelection: boolean });\n\n\tif (simulateResult.$kind === 'FailedTransaction') {\n\t\tconst executionError = simulateResult.FailedTransaction.status.error ?? undefined;\n\t\tconst errorMessage = executionError?.message ?? 'Unknown error';\n\t\tthrow new SimulationError(`Transaction resolution failed: ${errorMessage}`, {\n\t\t\tcause: simulateResult,\n\t\t\texecutionError,\n\t\t});\n\t}\n\n\ttransactionData.gasData.budget = computeGasBudget(\n\t\tsimulateResult.Transaction.effects!.gasUsed,\n\t\ttransactionData.gasData.price ? String(transactionData.gasData.price) : undefined,\n\t);\n}\n\nfunction setGasPayment({\n\ttransactionData,\n\tbalance,\n\tcoins,\n\tusesGasCoin,\n\twithdrawals,\n\tgasPayer,\n\tchainIdentifier,\n\tepoch,\n}: {\n\ttransactionData: TransactionDataBuilder;\n\tbalance: SuiClientTypes.GetBalanceResponse;\n\tcoins: SuiClientTypes.ListCoinsResponse;\n\tusesGasCoin: boolean;\n\twithdrawals: bigint;\n\tgasPayer: string;\n\tchainIdentifier: string | null;\n\tepoch: string | null;\n}) {\n\tconst budget = BigInt(transactionData.gasData.budget!);\n\tconst addressBalance = BigInt(balance.balance.addressBalance);\n\n\tif (budget === 0n || (!usesGasCoin && addressBalance >= budget + withdrawals)) {\n\t\ttransactionData.gasData.payment = [];\n\t\treturn;\n\t}\n\n\tconst filteredCoins = coins.objects.filter((coin) => {\n\t\tconst matchingInput = transactionData.inputs.find((input) => {\n\t\t\tif (input.Object?.ImmOrOwnedObject) {\n\t\t\t\treturn coin.objectId === input.Object.ImmOrOwnedObject.objectId;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t});\n\n\t\treturn !matchingInput;\n\t});\n\n\tconst paymentCoins = filteredCoins.map((coin) => ({\n\t\tobjectId: coin.objectId,\n\t\tdigest: coin.digest,\n\t\tversion: coin.version,\n\t}));\n\n\tconst reservationAmount = addressBalance - withdrawals;\n\n\tif (usesGasCoin && reservationAmount > 0n && chainIdentifier && epoch) {\n\t\ttransactionData.gasData.payment = [\n\t\t\tcreateCoinReservationRef(reservationAmount, gasPayer, chainIdentifier, epoch),\n\t\t\t...paymentCoins,\n\t\t];\n\t} else if (!filteredCoins.length) {\n\t\tthrow new Error('No valid gas coins found for the transaction.');\n\t} else {\n\t\ttransactionData.gasData.payment = paymentCoins;\n\t}\n}\n\ninterface SystemStateData {\n\tepoch: string;\n\treferenceGasPrice: string;\n}\n\nasync function setExpiration(\n\ttransactionData: TransactionDataBuilder,\n\tclient: ClientWithCoreApi,\n\tsystemState: SystemStateData | null,\n\texistingChainIdentifier: string | null = null,\n) {\n\tconst [chainIdentifier, resolvedSystemState] = await Promise.all([\n\t\texistingChainIdentifier ?? client.core.getChainIdentifier().then((r) => r.chainIdentifier),\n\t\tsystemState ?? client.core.getCurrentSystemState().then((r) => r.systemState),\n\t]);\n\ttransactionData.expiration = buildValidDuringExpiration(resolvedSystemState, chainIdentifier);\n}\n\ntype ValidDuringExpiration = {\n\t$kind: 'ValidDuring';\n\tValidDuring: {\n\t\tminEpoch: string;\n\t\tmaxEpoch: string;\n\t\tminTimestamp: null;\n\t\tmaxTimestamp: null;\n\t\tchain: string;\n\t\tnonce: number;\n\t};\n};\n\nfunction buildValidDuringExpiration(\n\tsystemState: SystemStateData,\n\tchainIdentifier: string,\n): ValidDuringExpiration {\n\tconst currentEpoch = BigInt(systemState.epoch);\n\treturn {\n\t\t$kind: 'ValidDuring',\n\t\tValidDuring: {\n\t\t\tminEpoch: String(currentEpoch),\n\t\t\tmaxEpoch: String(currentEpoch + 1n),\n\t\t\tminTimestamp: null,\n\t\t\tmaxTimestamp: null,\n\t\t\tchain: chainIdentifier,\n\t\t\tnonce: (Math.random() * 0x100000000) >>> 0,\n\t\t},\n\t};\n}\n\nasync function resolveObjectReferences(\n\ttransactionData: TransactionDataBuilder,\n\tclient: ClientWithCoreApi,\n) {\n\t// Keep track of the object references that will need to be resolved at the end of the transaction.\n\t// We keep the input by-reference to avoid needing to re-resolve it:\n\tconst objectsToResolve = transactionData.inputs.filter((input) => {\n\t\treturn (\n\t\t\tinput.UnresolvedObject &&\n\t\t\t!(input.UnresolvedObject.version || input.UnresolvedObject?.initialSharedVersion)\n\t\t);\n\t}) as Extract<CallArg, { UnresolvedObject: unknown }>[];\n\n\tconst dedupedIds = [\n\t\t...new Set(\n\t\t\tobjectsToResolve.map((input) => normalizeSuiObjectId(input.UnresolvedObject.objectId)),\n\t\t),\n\t];\n\n\tconst objectChunks = dedupedIds.length ? chunk(dedupedIds, MAX_OBJECTS_PER_FETCH) : [];\n\tconst resolved = (\n\t\tawait Promise.all(\n\t\t\tobjectChunks.map((chunkIds) =>\n\t\t\t\tclient.core.getObjects({\n\t\t\t\t\tobjectIds: chunkIds,\n\t\t\t\t}),\n\t\t\t),\n\t\t)\n\t).flatMap((result) => result.objects);\n\n\tconst responsesById = new Map(\n\t\tdedupedIds.map((id, index) => {\n\t\t\treturn [id, resolved[index]];\n\t\t}),\n\t);\n\n\tconst invalidObjects = Array.from(responsesById)\n\t\t.filter(([_, obj]) => obj instanceof Error)\n\t\t.map(([_, obj]) => (obj as Error).message);\n\n\tif (invalidObjects.length) {\n\t\tthrow new Error(`The following input objects are invalid: ${invalidObjects.join(', ')}`);\n\t}\n\n\tconst objects = resolved.map((object) => {\n\t\tif (object instanceof Error) {\n\t\t\tthrow new Error(`Failed to fetch object: ${object.message}`);\n\t\t}\n\t\tconst owner = object.owner;\n\t\tconst initialSharedVersion =\n\t\t\towner && typeof owner === 'object'\n\t\t\t\t? owner.$kind === 'Shared'\n\t\t\t\t\t? owner.Shared.initialSharedVersion\n\t\t\t\t\t: owner.$kind === 'ConsensusAddressOwner'\n\t\t\t\t\t\t? owner.ConsensusAddressOwner.startVersion\n\t\t\t\t\t\t: null\n\t\t\t\t: null;\n\n\t\treturn {\n\t\t\tobjectId: object.objectId,\n\t\t\tdigest: object.digest,\n\t\t\tversion: object.version,\n\t\t\tinitialSharedVersion,\n\t\t};\n\t});\n\n\tconst objectsById = new Map(\n\t\tdedupedIds.map((id, index) => {\n\t\t\treturn [id, objects[index]];\n\t\t}),\n\t);\n\n\tfor (const [index, input] of transactionData.inputs.entries()) {\n\t\tif (!input.UnresolvedObject) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tlet updated: CallArg | undefined;\n\t\tconst id = normalizeSuiAddress(input.UnresolvedObject.objectId);\n\t\tconst object = objectsById.get(id);\n\n\t\tif (input.UnresolvedObject.initialSharedVersion ?? object?.initialSharedVersion) {\n\t\t\tupdated = Inputs.SharedObjectRef({\n\t\t\t\tobjectId: id,\n\t\t\t\tinitialSharedVersion:\n\t\t\t\t\tinput.UnresolvedObject.initialSharedVersion || object?.initialSharedVersion!,\n\t\t\t\tmutable: input.UnresolvedObject.mutable || isUsedAsMutable(transactionData, index),\n\t\t\t});\n\t\t} else if (isUsedAsReceiving(transactionData, index)) {\n\t\t\tupdated = Inputs.ReceivingRef(\n\t\t\t\t{\n\t\t\t\t\tobjectId: id,\n\t\t\t\t\tdigest: input.UnresolvedObject.digest ?? object?.digest!,\n\t\t\t\t\tversion: input.UnresolvedObject.version ?? object?.version!,\n\t\t\t\t}!,\n\t\t\t);\n\t\t}\n\n\t\ttransactionData.inputs[transactionData.inputs.indexOf(input)] =\n\t\t\tupdated ??\n\t\t\tInputs.ObjectRef({\n\t\t\t\tobjectId: id,\n\t\t\t\tdigest: input.UnresolvedObject.digest ?? object?.digest!,\n\t\t\t\tversion: input.UnresolvedObject.version ?? object?.version!,\n\t\t\t});\n\t}\n}\n\nasync function normalizeInputs(transactionData: TransactionDataBuilder, client: ClientWithCoreApi) {\n\tconst { inputs, commands } = transactionData;\n\tconst moveCallsToResolve: Extract<Command, { MoveCall: unknown }>['MoveCall'][] = [];\n\tconst moveFunctionsToResolve = new Set<string>();\n\n\tcommands.forEach((command) => {\n\t\t// Special case move call:\n\t\tif (command.MoveCall) {\n\t\t\t// Determine if any of the arguments require encoding.\n\t\t\t// - If they don't, then this is good to go.\n\t\t\t// - If they do, then we need to fetch the normalized move module.\n\n\t\t\t// If we already know the argument types, we don't need to resolve them again\n\t\t\tif (command.MoveCall._argumentTypes) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst inputs = command.MoveCall.arguments.map((arg) => {\n\t\t\t\tif (arg.$kind === 'Input') {\n\t\t\t\t\treturn transactionData.inputs[arg.Input];\n\t\t\t\t}\n\t\t\t\treturn null;\n\t\t\t});\n\t\t\tconst needsResolution = inputs.some(\n\t\t\t\t(input) =>\n\t\t\t\t\tinput?.UnresolvedPure ||\n\t\t\t\t\t(input?.UnresolvedObject && typeof input?.UnresolvedObject.mutable !== 'boolean'),\n\t\t\t);\n\n\t\t\tif (needsResolution) {\n\t\t\t\tconst functionName = `${command.MoveCall.package}::${command.MoveCall.module}::${command.MoveCall.function}`;\n\t\t\t\tmoveFunctionsToResolve.add(functionName);\n\t\t\t\tmoveCallsToResolve.push(command.MoveCall);\n\t\t\t}\n\t\t}\n\t});\n\n\tconst moveFunctionParameters = new Map<string, SuiClientTypes.OpenSignature[]>();\n\tif (moveFunctionsToResolve.size > 0) {\n\t\tawait Promise.all(\n\t\t\t[...moveFunctionsToResolve].map(async (functionName) => {\n\t\t\t\tconst [packageId, moduleName, name] = functionName.split('::');\n\t\t\t\tconst { function: def } = await client.core.getMoveFunction({\n\t\t\t\t\tpackageId,\n\t\t\t\t\tmoduleName,\n\t\t\t\t\tname,\n\t\t\t\t});\n\n\t\t\t\tmoveFunctionParameters.set(functionName, def.parameters);\n\t\t\t}),\n\t\t);\n\t}\n\n\tif (moveCallsToResolve.length) {\n\t\tawait Promise.all(\n\t\t\tmoveCallsToResolve.map(async (moveCall) => {\n\t\t\t\tconst parameters = moveFunctionParameters.get(\n\t\t\t\t\t`${moveCall.package}::${moveCall.module}::${moveCall.function}`,\n\t\t\t\t);\n\n\t\t\t\tif (!parameters) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Entry functions can have a mutable reference to an instance of the TxContext\n\t\t\t\t// struct defined in the TxContext module as the last parameter. The caller of\n\t\t\t\t// the function does not need to pass it in as an argument.\n\t\t\t\tconst hasTxContext = parameters.length > 0 && isTxContext(parameters.at(-1)!);\n\t\t\t\tconst params = hasTxContext ? parameters.slice(0, parameters.length - 1) : parameters;\n\n\t\t\t\tmoveCall._argumentTypes = params;\n\t\t\t}),\n\t\t);\n\t}\n\n\tcommands.forEach((command) => {\n\t\tif (!command.MoveCall) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst moveCall = command.MoveCall;\n\t\tconst fnName = `${moveCall.package}::${moveCall.module}::${moveCall.function}`;\n\t\tconst params = moveCall._argumentTypes;\n\n\t\tif (!params) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (params.length !== command.MoveCall.arguments.length) {\n\t\t\tthrow new Error(`Incorrect number of arguments for ${fnName}`);\n\t\t}\n\n\t\tparams.forEach((param, i) => {\n\t\t\tconst arg = moveCall.arguments[i];\n\t\t\tif (arg.$kind !== 'Input') return;\n\t\t\tconst input = inputs[arg.Input];\n\n\t\t\t// Skip if the input is already resolved\n\t\t\tif (!input.UnresolvedPure && !input.UnresolvedObject) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst inputValue = input.UnresolvedPure?.value ?? input.UnresolvedObject?.objectId!;\n\n\t\t\tconst schema = getPureBcsSchema(param.body);\n\t\t\tif (schema) {\n\t\t\t\targ.type = 'pure';\n\t\t\t\tinputs[inputs.indexOf(input)] = Inputs.Pure(schema.serialize(inputValue));\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (typeof inputValue !== 'string') {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`Expect the argument to be an object id string, got ${JSON.stringify(\n\t\t\t\t\t\tinputValue,\n\t\t\t\t\t\tnull,\n\t\t\t\t\t\t2,\n\t\t\t\t\t)}`,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\targ.type = 'object';\n\t\t\tconst unresolvedObject: typeof input = input.UnresolvedPure\n\t\t\t\t? {\n\t\t\t\t\t\t$kind: 'UnresolvedObject',\n\t\t\t\t\t\tUnresolvedObject: {\n\t\t\t\t\t\t\tobjectId: inputValue,\n\t\t\t\t\t\t},\n\t\t\t\t\t}\n\t\t\t\t: input;\n\n\t\t\tinputs[arg.Input] = unresolvedObject;\n\t\t});\n\t});\n}\n\nfunction isUsedAsMutable(transactionData: TransactionDataBuilder, index: number) {\n\tlet usedAsMutable = false;\n\n\ttransactionData.getInputUses(index, (arg, tx) => {\n\t\tif (tx.MoveCall && tx.MoveCall._argumentTypes) {\n\t\t\tconst argIndex = tx.MoveCall.arguments.indexOf(arg);\n\t\t\tusedAsMutable =\n\t\t\t\ttx.MoveCall._argumentTypes[argIndex].reference !== 'immutable' || usedAsMutable;\n\t\t}\n\n\t\tif (\n\t\t\ttx.$kind === 'MakeMoveVec' ||\n\t\t\ttx.$kind === 'MergeCoins' ||\n\t\t\ttx.$kind === 'SplitCoins' ||\n\t\t\ttx.$kind === 'TransferObjects'\n\t\t) {\n\t\t\tusedAsMutable = true;\n\t\t}\n\t});\n\n\treturn usedAsMutable;\n}\n\nfunction isUsedAsReceiving(transactionData: TransactionDataBuilder, index: number) {\n\tlet usedAsReceiving = false;\n\n\ttransactionData.getInputUses(index, (arg, tx) => {\n\t\tif (tx.MoveCall && tx.MoveCall._argumentTypes) {\n\t\t\tconst argIndex = tx.MoveCall.arguments.indexOf(arg);\n\t\t\tusedAsReceiving = isReceivingType(tx.MoveCall._argumentTypes[argIndex]) || usedAsReceiving;\n\t\t}\n\t});\n\n\treturn usedAsReceiving;\n}\n\nconst RECEIVING_TYPE =\n\t'0x0000000000000000000000000000000000000000000000000000000000000002::transfer::Receiving';\n\nfunction isReceivingType(type: SuiClientTypes.OpenSignature): boolean {\n\tif (type.body.$kind !== 'datatype') {\n\t\treturn false;\n\t}\n\n\treturn type.body.datatype.typeName === RECEIVING_TYPE;\n}\n"],"mappings":";;;;;;;;;;AAsBA,MAAM,wBAAwB;AAG9B,MAAM,oBAAoB;AAC1B,MAAM,UAAU;;AAGhB,SAAgB,iBACf,SACA,WAA4B,IACnB;CACT,MAAM,eAAe,oBAAoB,OAAO,SAAS;CACzD,MAAM,kCAAkC,OAAO,QAAQ,gBAAgB,GAAG;CAC1E,MAAM,YACL,kCAAkC,OAAO,QAAQ,YAAY,GAAG,OAAO,QAAQ,cAAc;AAC9F,QAAO,OACN,YAAY,kCAAkC,YAAY,gCAC1D;;AAGF,SAAS,UAAU,SAAqD;AACvE,KAAI,CAAC,QAAQ,OACZ,OAAM,IAAI,MACT,uGACA;AAEF,QAAO,QAAQ;;AAGhB,eAAsB,mCACrB,iBACA,SACA,MACC;CACD,MAAM,SAAS,UAAU,QAAQ;CACjC,MAAM,gBAAgB,CAAC,QAAQ,uBAAuB,CAAC,gBAAgB,QAAQ;CAC/E,MAAM,e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,UAAU,WAAW,CAAC;AACzE;;AAGD,OAAI,OAAO,eAAe,SACzB,OAAM,IAAI,MACT,sDAAsD,KAAK,UAC1D,YACA,MACA,EACA,GACD;AAGF,OAAI,OAAO;GACX,MAAM,mBAAiC,MAAM,iBAC1C;IACA,OAAO;IACP,kBAAkB,EACjB,UAAU,YACV;IACD,GACA;AAEH,UAAO,IAAI,SAAS;IACnB;GACD;;AAGH,SAAS,gBAAgB,iBAAyC,OAAe;CAChF,IAAI,gBAAgB;AAEpB,iBAAgB,aAAa,QAAQ,KAAK,OAAO;AAChD,MAAI,GAAG,YAAY,GAAG,SAAS,gBAAgB;GAC9C,MAAM,WAAW,GAAG,SAAS,UAAU,QAAQ,IAAI;AACnD,mBACC,GAAG,SAAS,eAAe,UAAU,cAAc,eAAe;;AAGpE,MACC,GAAG,UAAU,iBACb,GAAG,UAAU,gBACb,GAAG,UAAU,gBACb,GAAG,UAAU,kBAEb,iBAAgB;GAEhB;AAEF,QAAO;;AAGR,SAAS,kBAAkB,iBAAyC,OAAe;CAClF,IAAI,kBAAkB;AAEtB,iBAAgB,aAAa,QAAQ,KAAK,OAAO;AAChD,MAAI,GAAG,YAAY,GAAG,SAAS,gBAAgB;GAC9C,MAAM,WAAW,GAAG,SAAS,UAAU,QAAQ,IAAI;AACnD,qBAAkB,gBAAgB,GAAG,SAAS,eAAe,UAAU,IAAI;;GAE3E;AAEF,QAAO;;AAGR,MAAM,iBACL;AAED,SAAS,gBAAgB,MAA6C;AACrE,KAAI,KAAK,KAAK,UAAU,WACvB,QAAO;AAGR,QAAO,KAAK,KAAK,SAAS,aAAa"}
|
|
1
|
+
{"version":3,"file":"core-resolver.mjs","names":[],"sources":["../../src/client/core-resolver.ts"],"sourcesContent":["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nimport {\n\tnormalizeSuiAddress,\n\tnormalizeSuiObjectId,\n\tnormalizeStructTag,\n\tSUI_TYPE_ARG,\n} from '../utils/index.js';\nimport { createCoinReservationRef } from '../utils/coin-reservation.js';\nimport type { ClientWithCoreApi } from './core.js';\nimport type { CallArg, Command } from '../transactions/data/internal.js';\nimport type { SuiClientTypes } from './types.js';\nimport { SimulationError } from './errors.js';\nimport { Inputs } from '../transactions/Inputs.js';\nimport { getPureBcsSchema, isTxContext } from '../transactions/serializer.js';\nimport type { TransactionDataBuilder } from '../transactions/TransactionData.js';\nimport { chunk } from '@mysten/utils';\nimport type { BuildTransactionOptions } from '../transactions/index.js';\nimport { transactionUsesGasCoin } from '../transactions/resolution-utils.js';\n\n// The maximum objects that can be fetched at once using multiGetObjects.\nconst MAX_OBJECTS_PER_FETCH = 50;\n\n// The gas payment limit is inclusive as of protocol version 96.\nconst MAX_GAS_PAYMENT_OBJECTS = 256;\n\n// An amount of gas (in gas units) that is added to transactions as an overhead to ensure transactions do not fail.\nconst GAS_SAFE_OVERHEAD = 1000n;\nconst MAX_GAS = 50_000_000_000;\n\n/** Compute a gas budget from gasUsed effects data. */\nexport function computeGasBudget(\n\tgasUsed: { computationCost: string; storageCost: string; storageRebate: string },\n\tgasPrice: bigint | string = 1n,\n): string {\n\tconst safeOverhead = GAS_SAFE_OVERHEAD * BigInt(gasPrice);\n\tconst baseComputationCostWithOverhead = BigInt(gasUsed.computationCost) + safeOverhead;\n\tconst gasBudget =\n\t\tbaseComputationCostWithOverhead + BigInt(gasUsed.storageCost) - BigInt(gasUsed.storageRebate);\n\treturn String(\n\t\tgasBudget > baseComputationCostWithOverhead ? gasBudget : baseComputationCostWithOverhead,\n\t);\n}\n\nfunction getClient(options: BuildTransactionOptions): ClientWithCoreApi {\n\tif (!options.client) {\n\t\tthrow new Error(\n\t\t\t`No sui client passed to Transaction#build, but transaction data was not sufficient to build offline.`,\n\t\t);\n\t}\n\treturn options.client;\n}\n\nexport async function coreClientResolveTransactionPlugin(\n\ttransactionData: TransactionDataBuilder,\n\toptions: BuildTransactionOptions,\n\tnext: () => Promise<void>,\n) {\n\tconst client = getClient(options);\n\tconst needsGasPrice = !options.onlyTransactionKind && !transactionData.gasData.price;\n\tconst needsPayment = !options.onlyTransactionKind && !transactionData.gasData.payment;\n\tconst gasPayer = transactionData.gasData.owner ?? transactionData.sender;\n\n\tconst usesGasCoin = transactionUsesGasCoin(transactionData);\n\tlet withdrawals = 0n;\n\n\tconst normalizedGasPayer = gasPayer ? normalizeSuiAddress(gasPayer) : null;\n\tfor (const input of transactionData.inputs) {\n\t\tif (input.$kind !== 'FundsWithdrawal' || !normalizedGasPayer) continue;\n\t\tif (normalizeStructTag(input.FundsWithdrawal.typeArg.Balance) !== SUI_TYPE_ARG) continue;\n\t\tconst source = input.FundsWithdrawal.withdrawFrom;\n\t\tconst withdrawalOwner = source.SenderAllowance\n\t\t\t? source.SenderAllowance.funder\n\t\t\t: source.Sender\n\t\t\t\t? transactionData.sender\n\t\t\t\t: gasPayer;\n\t\tif (\n\t\t\twithdrawalOwner &&\n\t\t\tnormalizeSuiAddress(withdrawalOwner) === normalizedGasPayer &&\n\t\t\tinput.FundsWithdrawal.reservation.$kind === 'MaxAmountU64'\n\t\t) {\n\t\t\twithdrawals += BigInt(input.FundsWithdrawal.reservation.MaxAmountU64);\n\t\t}\n\t}\n\n\t// `setGasBudget` simulates with `payment: []` whenever it has to compute a\n\t// budget (i.e. one wasn't preset). The validator's replay-protection check\n\t// then requires either a `ValidDuring` expiration or at least one\n\t// \"address-owned\" input — an `ImmOrOwnedMoveObject` whose owner is\n\t// `AddressOwner`, which we can't tell from `Immutable` without owner info we\n\t// don't track. Provide a simulate-only `ValidDuring` whenever we'll actually\n\t// simulate and one isn't user-set.\n\tconst needsSimulateExpiration =\n\t\t!options.onlyTransactionKind && !transactionData.expiration && !transactionData.gasData.budget;\n\tconst needsSystemState =\n\t\tneedsGasPrice || (needsPayment && usesGasCoin) || needsSimulateExpiration;\n\tconst needsChainId = (needsPayment && usesGasCoin) || needsSimulateExpiration;\n\tconst [, systemStateResult, balanceResult, coinsResult, chainIdResult] = await Promise.all([\n\t\tnormalizeInputs(transactionData, client),\n\t\tneedsSystemState ? client.core.getCurrentSystemState() : null,\n\t\tneedsPayment && gasPayer ? client.core.getBalance({ owner: gasPayer }) : null,\n\t\tneedsPayment && gasPayer\n\t\t\t? client.core.listCoins({ owner: gasPayer, coinType: SUI_TYPE_ARG })\n\t\t\t: null,\n\t\tneedsChainId ? client.core.getChainIdentifier() : null,\n\t]);\n\n\tawait resolveObjectReferences(transactionData, client);\n\n\tif (!options.onlyTransactionKind) {\n\t\tconst systemState = systemStateResult?.systemState ?? null;\n\t\tconst chainIdentifier = chainIdResult?.chainIdentifier ?? null;\n\n\t\tif (systemState && !transactionData.gasData.price) {\n\t\t\ttransactionData.gasData.price = systemState.referenceGasPrice;\n\t\t}\n\n\t\tconst simulateExpiration =\n\t\t\tneedsSimulateExpiration && systemState && chainIdentifier\n\t\t\t\t? buildValidDuringExpiration(systemState, chainIdentifier)\n\t\t\t\t: undefined;\n\n\t\tawait setGasBudget(transactionData, client, simulateExpiration);\n\n\t\tif (needsPayment) {\n\t\t\tif (!balanceResult || !coinsResult) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t'Could not resolve gas payment: a gas owner or sender must be set to fetch balance and coins.',\n\t\t\t\t);\n\t\t\t}\n\t\t\tsetGasPayment({\n\t\t\t\ttransactionData,\n\t\t\t\tbalance: balanceResult,\n\t\t\t\tcoins: coinsResult,\n\t\t\t\tusesGasCoin,\n\t\t\t\twithdrawals,\n\t\t\t\tgasPayer: gasPayer!,\n\t\t\t\tchainIdentifier,\n\t\t\t\tepoch: systemState?.epoch ?? null,\n\t\t\t});\n\t\t}\n\n\t\tif (!transactionData.expiration && transactionData.gasData.payment?.length === 0) {\n\t\t\tawait setExpiration(transactionData, client, systemState, chainIdentifier);\n\t\t}\n\t}\n\n\treturn await next();\n}\n\nasync function setGasBudget(\n\ttransactionData: TransactionDataBuilder,\n\tclient: ClientWithCoreApi,\n\tsimulateExpiration?: ValidDuringExpiration,\n) {\n\tif (transactionData.gasData.budget) {\n\t\treturn;\n\t}\n\n\tconst simulateResult = await client.core.simulateTransaction({\n\t\ttransaction: transactionData.build({\n\t\t\toverrides: {\n\t\t\t\tgasData: {\n\t\t\t\t\tbudget: String(MAX_GAS),\n\t\t\t\t\tpayment: [],\n\t\t\t\t},\n\t\t\t\t...(simulateExpiration && { expiration: simulateExpiration }),\n\t\t\t},\n\t\t}),\n\t\tinclude: { effects: true },\n\t\t// The empty payment above is a placeholder for budget estimation, not a real address\n\t\t// balance payment, so the server must simulate with a mocked gas coin rather than\n\t\t// selecting gas. gRPC and GraphQL support this option, and JSON-RPC always mocks gas.\n\t\tdoGasSelection: false,\n\t} as SuiClientTypes.SimulateTransactionOptions<{ effects: true }> & { doGasSelection: boolean });\n\n\tif (simulateResult.$kind === 'FailedTransaction') {\n\t\tconst executionError = simulateResult.FailedTransaction.status.error ?? undefined;\n\t\tconst errorMessage = executionError?.message ?? 'Unknown error';\n\t\tthrow new SimulationError(`Transaction resolution failed: ${errorMessage}`, {\n\t\t\tcause: simulateResult,\n\t\t\texecutionError,\n\t\t});\n\t}\n\n\ttransactionData.gasData.budget = computeGasBudget(\n\t\tsimulateResult.Transaction.effects!.gasUsed,\n\t\ttransactionData.gasData.price ? String(transactionData.gasData.price) : undefined,\n\t);\n}\n\nfunction setGasPayment({\n\ttransactionData,\n\tbalance,\n\tcoins,\n\tusesGasCoin,\n\twithdrawals,\n\tgasPayer,\n\tchainIdentifier,\n\tepoch,\n}: {\n\ttransactionData: TransactionDataBuilder;\n\tbalance: SuiClientTypes.GetBalanceResponse;\n\tcoins: SuiClientTypes.ListCoinsResponse;\n\tusesGasCoin: boolean;\n\twithdrawals: bigint;\n\tgasPayer: string;\n\tchainIdentifier: string | null;\n\tepoch: string | null;\n}) {\n\tconst budget = BigInt(transactionData.gasData.budget!);\n\tconst addressBalance = BigInt(balance.balance.addressBalance);\n\n\tif (budget === 0n || (!usesGasCoin && addressBalance >= budget + withdrawals)) {\n\t\ttransactionData.gasData.payment = [];\n\t\treturn;\n\t}\n\n\tconst filteredCoins = coins.objects.filter((coin) => {\n\t\tconst matchingInput = transactionData.inputs.find((input) => {\n\t\t\tif (input.Object?.ImmOrOwnedObject) {\n\t\t\t\treturn coin.objectId === input.Object.ImmOrOwnedObject.objectId;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t});\n\n\t\treturn !matchingInput;\n\t});\n\n\tconst paymentCoins = filteredCoins.map((coin) => ({\n\t\tobjectId: coin.objectId,\n\t\tdigest: coin.digest,\n\t\tversion: coin.version,\n\t}));\n\n\tconst reservationAmount = addressBalance - withdrawals;\n\n\tif (usesGasCoin && reservationAmount > 0n && chainIdentifier && epoch) {\n\t\ttransactionData.gasData.payment = [\n\t\t\tcreateCoinReservationRef(reservationAmount, gasPayer, chainIdentifier, epoch),\n\t\t\t// The reservation occupies one entry in the gas payment limit.\n\t\t\t...paymentCoins.slice(0, MAX_GAS_PAYMENT_OBJECTS - 1),\n\t\t];\n\t} else if (!filteredCoins.length) {\n\t\tthrow new Error('No valid gas coins found for the transaction.');\n\t} else {\n\t\ttransactionData.gasData.payment = paymentCoins.slice(0, MAX_GAS_PAYMENT_OBJECTS);\n\t}\n}\n\ninterface SystemStateData {\n\tepoch: string;\n\treferenceGasPrice: string;\n}\n\nasync function setExpiration(\n\ttransactionData: TransactionDataBuilder,\n\tclient: ClientWithCoreApi,\n\tsystemState: SystemStateData | null,\n\texistingChainIdentifier: string | null = null,\n) {\n\tconst [chainIdentifier, resolvedSystemState] = await Promise.all([\n\t\texistingChainIdentifier ?? client.core.getChainIdentifier().then((r) => r.chainIdentifier),\n\t\tsystemState ?? client.core.getCurrentSystemState().then((r) => r.systemState),\n\t]);\n\ttransactionData.expiration = buildValidDuringExpiration(resolvedSystemState, chainIdentifier);\n}\n\ntype ValidDuringExpiration = {\n\t$kind: 'ValidDuring';\n\tValidDuring: {\n\t\tminEpoch: string;\n\t\tmaxEpoch: string;\n\t\tminTimestamp: null;\n\t\tmaxTimestamp: null;\n\t\tchain: string;\n\t\tnonce: number;\n\t};\n};\n\nfunction buildValidDuringExpiration(\n\tsystemState: SystemStateData,\n\tchainIdentifier: string,\n): ValidDuringExpiration {\n\tconst currentEpoch = BigInt(systemState.epoch);\n\treturn {\n\t\t$kind: 'ValidDuring',\n\t\tValidDuring: {\n\t\t\tminEpoch: String(currentEpoch),\n\t\t\tmaxEpoch: String(currentEpoch + 1n),\n\t\t\tminTimestamp: null,\n\t\t\tmaxTimestamp: null,\n\t\t\tchain: chainIdentifier,\n\t\t\tnonce: (Math.random() * 0x100000000) >>> 0,\n\t\t},\n\t};\n}\n\nasync function resolveObjectReferences(\n\ttransactionData: TransactionDataBuilder,\n\tclient: ClientWithCoreApi,\n) {\n\t// Keep track of the object references that will need to be resolved at the end of the transaction.\n\t// We keep the input by-reference to avoid needing to re-resolve it:\n\tconst objectsToResolve = transactionData.inputs.filter((input) => {\n\t\treturn (\n\t\t\tinput.UnresolvedObject &&\n\t\t\t!(input.UnresolvedObject.version || input.UnresolvedObject?.initialSharedVersion)\n\t\t);\n\t}) as Extract<CallArg, { UnresolvedObject: unknown }>[];\n\n\tconst dedupedIds = [\n\t\t...new Set(\n\t\t\tobjectsToResolve.map((input) => normalizeSuiObjectId(input.UnresolvedObject.objectId)),\n\t\t),\n\t];\n\n\tconst objectChunks = dedupedIds.length ? chunk(dedupedIds, MAX_OBJECTS_PER_FETCH) : [];\n\tconst resolved = (\n\t\tawait Promise.all(\n\t\t\tobjectChunks.map((chunkIds) =>\n\t\t\t\tclient.core.getObjects({\n\t\t\t\t\tobjectIds: chunkIds,\n\t\t\t\t}),\n\t\t\t),\n\t\t)\n\t).flatMap((result) => result.objects);\n\n\tconst responsesById = new Map(\n\t\tdedupedIds.map((id, index) => {\n\t\t\treturn [id, resolved[index]];\n\t\t}),\n\t);\n\n\tconst invalidObjects = Array.from(responsesById)\n\t\t.filter(([_, obj]) => obj instanceof Error)\n\t\t.map(([_, obj]) => (obj as Error).message);\n\n\tif (invalidObjects.length) {\n\t\tthrow new Error(`The following input objects are invalid: ${invalidObjects.join(', ')}`);\n\t}\n\n\tconst objects = resolved.map((object) => {\n\t\tif (object instanceof Error) {\n\t\t\tthrow new Error(`Failed to fetch object: ${object.message}`);\n\t\t}\n\t\tconst owner = object.owner;\n\t\tconst initialSharedVersion =\n\t\t\towner && typeof owner === 'object'\n\t\t\t\t? owner.$kind === 'Shared'\n\t\t\t\t\t? owner.Shared.initialSharedVersion\n\t\t\t\t\t: owner.$kind === 'ConsensusAddressOwner'\n\t\t\t\t\t\t? owner.ConsensusAddressOwner.startVersion\n\t\t\t\t\t\t: null\n\t\t\t\t: null;\n\n\t\treturn {\n\t\t\tobjectId: object.objectId,\n\t\t\tdigest: object.digest,\n\t\t\tversion: object.version,\n\t\t\tinitialSharedVersion,\n\t\t};\n\t});\n\n\tconst objectsById = new Map(\n\t\tdedupedIds.map((id, index) => {\n\t\t\treturn [id, objects[index]];\n\t\t}),\n\t);\n\n\tfor (const [index, input] of transactionData.inputs.entries()) {\n\t\tif (!input.UnresolvedObject) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tlet updated: CallArg | undefined;\n\t\tconst id = normalizeSuiAddress(input.UnresolvedObject.objectId);\n\t\tconst object = objectsById.get(id);\n\n\t\tif (input.UnresolvedObject.initialSharedVersion ?? object?.initialSharedVersion) {\n\t\t\tupdated = Inputs.SharedObjectRef({\n\t\t\t\tobjectId: id,\n\t\t\t\tinitialSharedVersion:\n\t\t\t\t\tinput.UnresolvedObject.initialSharedVersion || object?.initialSharedVersion!,\n\t\t\t\tmutable: input.UnresolvedObject.mutable || isUsedAsMutable(transactionData, index),\n\t\t\t});\n\t\t} else if (isUsedAsReceiving(transactionData, index)) {\n\t\t\tupdated = Inputs.ReceivingRef(\n\t\t\t\t{\n\t\t\t\t\tobjectId: id,\n\t\t\t\t\tdigest: input.UnresolvedObject.digest ?? object?.digest!,\n\t\t\t\t\tversion: input.UnresolvedObject.version ?? object?.version!,\n\t\t\t\t}!,\n\t\t\t);\n\t\t}\n\n\t\ttransactionData.inputs[transactionData.inputs.indexOf(input)] =\n\t\t\tupdated ??\n\t\t\tInputs.ObjectRef({\n\t\t\t\tobjectId: id,\n\t\t\t\tdigest: input.UnresolvedObject.digest ?? object?.digest!,\n\t\t\t\tversion: input.UnresolvedObject.version ?? object?.version!,\n\t\t\t});\n\t}\n}\n\nasync function normalizeInputs(transactionData: TransactionDataBuilder, client: ClientWithCoreApi) {\n\tconst { inputs, commands } = transactionData;\n\tconst moveCallsToResolve: Extract<Command, { MoveCall: unknown }>['MoveCall'][] = [];\n\tconst moveFunctionsToResolve = new Set<string>();\n\n\tcommands.forEach((command) => {\n\t\t// Special case move call:\n\t\tif (command.MoveCall) {\n\t\t\t// Determine if any of the arguments require encoding.\n\t\t\t// - If they don't, then this is good to go.\n\t\t\t// - If they do, then we need to fetch the normalized move module.\n\n\t\t\t// If we already know the argument types, we don't need to resolve them again\n\t\t\tif (command.MoveCall._argumentTypes) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst inputs = command.MoveCall.arguments.map((arg) => {\n\t\t\t\tif (arg.$kind === 'Input') {\n\t\t\t\t\treturn transactionData.inputs[arg.Input];\n\t\t\t\t}\n\t\t\t\treturn null;\n\t\t\t});\n\t\t\tconst needsResolution = inputs.some(\n\t\t\t\t(input) =>\n\t\t\t\t\tinput?.UnresolvedPure ||\n\t\t\t\t\t(input?.UnresolvedObject && typeof input?.UnresolvedObject.mutable !== 'boolean'),\n\t\t\t);\n\n\t\t\tif (needsResolution) {\n\t\t\t\tconst functionName = `${command.MoveCall.package}::${command.MoveCall.module}::${command.MoveCall.function}`;\n\t\t\t\tmoveFunctionsToResolve.add(functionName);\n\t\t\t\tmoveCallsToResolve.push(command.MoveCall);\n\t\t\t}\n\t\t}\n\t});\n\n\tconst moveFunctionParameters = new Map<string, SuiClientTypes.OpenSignature[]>();\n\tif (moveFunctionsToResolve.size > 0) {\n\t\tawait Promise.all(\n\t\t\t[...moveFunctionsToResolve].map(async (functionName) => {\n\t\t\t\tconst [packageId, moduleName, name] = functionName.split('::');\n\t\t\t\tconst { function: def } = await client.core.getMoveFunction({\n\t\t\t\t\tpackageId,\n\t\t\t\t\tmoduleName,\n\t\t\t\t\tname,\n\t\t\t\t});\n\n\t\t\t\tmoveFunctionParameters.set(functionName, def.parameters);\n\t\t\t}),\n\t\t);\n\t}\n\n\tif (moveCallsToResolve.length) {\n\t\tawait Promise.all(\n\t\t\tmoveCallsToResolve.map(async (moveCall) => {\n\t\t\t\tconst parameters = moveFunctionParameters.get(\n\t\t\t\t\t`${moveCall.package}::${moveCall.module}::${moveCall.function}`,\n\t\t\t\t);\n\n\t\t\t\tif (!parameters) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Entry functions can have a mutable reference to an instance of the TxContext\n\t\t\t\t// struct defined in the TxContext module as the last parameter. The caller of\n\t\t\t\t// the function does not need to pass it in as an argument.\n\t\t\t\tconst hasTxContext = parameters.length > 0 && isTxContext(parameters.at(-1)!);\n\t\t\t\tconst params = hasTxContext ? parameters.slice(0, parameters.length - 1) : parameters;\n\n\t\t\t\tmoveCall._argumentTypes = params;\n\t\t\t}),\n\t\t);\n\t}\n\n\tcommands.forEach((command) => {\n\t\tif (!command.MoveCall) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst moveCall = command.MoveCall;\n\t\tconst fnName = `${moveCall.package}::${moveCall.module}::${moveCall.function}`;\n\t\tconst params = moveCall._argumentTypes;\n\n\t\tif (!params) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (params.length !== command.MoveCall.arguments.length) {\n\t\t\tthrow new Error(`Incorrect number of arguments for ${fnName}`);\n\t\t}\n\n\t\tparams.forEach((param, i) => {\n\t\t\tconst arg = moveCall.arguments[i];\n\t\t\tif (arg.$kind !== 'Input') return;\n\t\t\tconst input = inputs[arg.Input];\n\n\t\t\t// Skip if the input is already resolved\n\t\t\tif (!input.UnresolvedPure && !input.UnresolvedObject) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst inputValue = input.UnresolvedPure?.value ?? input.UnresolvedObject?.objectId!;\n\n\t\t\tconst schema = getPureBcsSchema(param.body);\n\t\t\tif (schema) {\n\t\t\t\targ.type = 'pure';\n\t\t\t\tinputs[inputs.indexOf(input)] = Inputs.Pure(schema.serialize(inputValue));\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (typeof inputValue !== 'string') {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`Expect the argument to be an object id string, got ${JSON.stringify(\n\t\t\t\t\t\tinputValue,\n\t\t\t\t\t\tnull,\n\t\t\t\t\t\t2,\n\t\t\t\t\t)}`,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\targ.type = 'object';\n\t\t\tconst unresolvedObject: typeof input = input.UnresolvedPure\n\t\t\t\t? {\n\t\t\t\t\t\t$kind: 'UnresolvedObject',\n\t\t\t\t\t\tUnresolvedObject: {\n\t\t\t\t\t\t\tobjectId: inputValue,\n\t\t\t\t\t\t},\n\t\t\t\t\t}\n\t\t\t\t: input;\n\n\t\t\tinputs[arg.Input] = unresolvedObject;\n\t\t});\n\t});\n}\n\nfunction isUsedAsMutable(transactionData: TransactionDataBuilder, index: number) {\n\tlet usedAsMutable = false;\n\n\ttransactionData.getInputUses(index, (arg, tx) => {\n\t\tif (tx.MoveCall && tx.MoveCall._argumentTypes) {\n\t\t\tconst argIndex = tx.MoveCall.arguments.indexOf(arg);\n\t\t\tusedAsMutable =\n\t\t\t\ttx.MoveCall._argumentTypes[argIndex].reference !== 'immutable' || usedAsMutable;\n\t\t}\n\n\t\tif (\n\t\t\ttx.$kind === 'MakeMoveVec' ||\n\t\t\ttx.$kind === 'MergeCoins' ||\n\t\t\ttx.$kind === 'SplitCoins' ||\n\t\t\ttx.$kind === 'TransferObjects'\n\t\t) {\n\t\t\tusedAsMutable = true;\n\t\t}\n\t});\n\n\treturn usedAsMutable;\n}\n\nfunction isUsedAsReceiving(transactionData: TransactionDataBuilder, index: number) {\n\tlet usedAsReceiving = false;\n\n\ttransactionData.getInputUses(index, (arg, tx) => {\n\t\tif (tx.MoveCall && tx.MoveCall._argumentTypes) {\n\t\t\tconst argIndex = tx.MoveCall.arguments.indexOf(arg);\n\t\t\tusedAsReceiving = isReceivingType(tx.MoveCall._argumentTypes[argIndex]) || usedAsReceiving;\n\t\t}\n\t});\n\n\treturn usedAsReceiving;\n}\n\nconst RECEIVING_TYPE =\n\t'0x0000000000000000000000000000000000000000000000000000000000000002::transfer::Receiving';\n\nfunction isReceivingType(type: SuiClientTypes.OpenSignature): boolean {\n\tif (type.body.$kind !== 'datatype') {\n\t\treturn false;\n\t}\n\n\treturn type.body.datatype.typeName === RECEIVING_TYPE;\n}\n"],"mappings":";;;;;;;;;;AAsBA,MAAM,wBAAwB;AAG9B,MAAM,0BAA0B;AAGhC,MAAM,oBAAoB;AAC1B,MAAM,UAAU;;AAGhB,SAAgB,iBACf,SACA,WAA4B,IACnB;CACT,MAAM,eAAe,oBAAoB,OAAO,SAAS;CACzD,MAAM,kCAAkC,OAAO,QAAQ,gBAAgB,GAAG;CAC1E,MAAM,YACL,kCAAkC,OAAO,QAAQ,YAAY,GAAG,OAAO,QAAQ,cAAc;AAC9F,QAAO,OACN,YAAY,kCAAkC,YAAY,gCAC1D;;AAGF,SAAS,UAAU,SAAqD;AACvE,KAAI,CAAC,QAAQ,OACZ,OAAM,IAAI,MACT,uGACA;AAEF,QAAO,QAAQ;;AAGhB,eAAsB,mCACrB,iBACA,SACA,MACC;CACD,MAAM,SAAS,UAAU,QAAQ;CACjC,MAAM,gBAAgB,CAAC,QAAQ,uBAAuB,CAAC,gBAAgB,QAAQ;CAC/E,MAAM,eAAe,CAAC,QAAQ,uBAAuB,CAAC,gBAAgB,QAAQ;CAC9E,MAAM,WAAW,gBAAgB,QAAQ,SAAS,gBAAgB;CAElE,MAAM,cAAc,uBAAuB,gBAAgB;CAC3D,IAAI,cAAc;CAElB,MAAM,qBAAqB,WAAW,oBAAoB,SAAS,GAAG;AACtE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mBAAiC,MAAM,iBAC1C;IACA,OAAO;IACP,kBAAkB,EACjB,UAAU,YACV;IACD,GACA;AAEH,UAAO,IAAI,SAAS;IACnB;GACD;;AAGH,SAAS,gBAAgB,iBAAyC,OAAe;CAChF,IAAI,gBAAgB;AAEpB,iBAAgB,aAAa,QAAQ,KAAK,OAAO;AAChD,MAAI,GAAG,YAAY,GAAG,SAAS,gBAAgB;GAC9C,MAAM,WAAW,GAAG,SAAS,UAAU,QAAQ,IAAI;AACnD,mBACC,GAAG,SAAS,eAAe,UAAU,cAAc,eAAe;;AAGpE,MACC,GAAG,UAAU,iBACb,GAAG,UAAU,gBACb,GAAG,UAAU,gBACb,GAAG,UAAU,kBAEb,iBAAgB;GAEhB;AAEF,QAAO;;AAGR,SAAS,kBAAkB,iBAAyC,OAAe;CAClF,IAAI,kBAAkB;AAEtB,iBAAgB,aAAa,QAAQ,KAAK,OAAO;AAChD,MAAI,GAAG,YAAY,GAAG,SAAS,gBAAgB;GAC9C,MAAM,WAAW,GAAG,SAAS,UAAU,QAAQ,IAAI;AACnD,qBAAkB,gBAAgB,GAAG,SAAS,eAAe,UAAU,IAAI;;GAE3E;AAEF,QAAO;;AAGR,MAAM,iBACL;AAED,SAAS,gBAAgB,MAA6C;AACrE,KAAI,KAAK,KAAK,UAAU,WACvB,QAAO;AAGR,QAAO,KAAK,KAAK,SAAS,aAAa"}
|
|
@@ -30,6 +30,12 @@ declare function parseSerializedSignature(serializedSignature: string): {
|
|
|
30
30
|
clientDataJson: string;
|
|
31
31
|
userSignature: Uint8Array<ArrayBuffer>;
|
|
32
32
|
publicKey: Uint8Array<ArrayBuffer>;
|
|
33
|
+
} | {
|
|
34
|
+
serializedSignature: string;
|
|
35
|
+
signatureScheme: "ED25519" | "Secp256k1" | "Secp256r1";
|
|
36
|
+
signature: Uint8Array<ArrayBuffer>;
|
|
37
|
+
publicKey: Uint8Array<ArrayBuffer>;
|
|
38
|
+
bytes: Uint8Array<ArrayBuffer>;
|
|
33
39
|
} | {
|
|
34
40
|
serializedSignature: string;
|
|
35
41
|
signatureScheme: "ZkLogin";
|
|
@@ -54,12 +60,6 @@ declare function parseSerializedSignature(serializedSignature: string): {
|
|
|
54
60
|
};
|
|
55
61
|
signature: Uint8Array<ArrayBufferLike>;
|
|
56
62
|
publicKey: Uint8Array<ArrayBuffer>;
|
|
57
|
-
} | {
|
|
58
|
-
serializedSignature: string;
|
|
59
|
-
signatureScheme: "ED25519" | "Secp256k1" | "Secp256r1";
|
|
60
|
-
signature: Uint8Array<ArrayBuffer>;
|
|
61
|
-
publicKey: Uint8Array<ArrayBuffer>;
|
|
62
|
-
bytes: Uint8Array<ArrayBuffer>;
|
|
63
63
|
} | {
|
|
64
64
|
serializedSignature: string;
|
|
65
65
|
signatureScheme: "MultiSig";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AdvanceCheckpointRequest, AdvanceCheckpointResponse, AdvanceClockRequest, AdvanceClockResponse, GetStatusRequest, GetStatusResponse } from "./forking_service.mjs";
|
|
2
|
-
import * as
|
|
3
|
-
import * as
|
|
2
|
+
import * as _protobuf_ts_runtime5 from "@protobuf-ts/runtime";
|
|
3
|
+
import * as _protobuf_ts_runtime_rpc5 from "@protobuf-ts/runtime-rpc";
|
|
4
4
|
import { RpcOptions, RpcTransport, ServiceInfo, UnaryCall } from "@protobuf-ts/runtime-rpc";
|
|
5
5
|
|
|
6
6
|
//#region src/grpc/proto/sui/forking/v1alpha/forking_service.client.d.ts
|
|
@@ -37,9 +37,9 @@ interface IForkingServiceClient {
|
|
|
37
37
|
declare class ForkingServiceClient implements IForkingServiceClient, ServiceInfo {
|
|
38
38
|
private readonly _transport;
|
|
39
39
|
typeName: string;
|
|
40
|
-
methods:
|
|
40
|
+
methods: _protobuf_ts_runtime_rpc5.MethodInfo<any, any>[];
|
|
41
41
|
options: {
|
|
42
|
-
[extensionName: string]:
|
|
42
|
+
[extensionName: string]: _protobuf_ts_runtime5.JsonValue;
|
|
43
43
|
};
|
|
44
44
|
constructor(_transport: RpcTransport);
|
|
45
45
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BatchGetObjectsRequest, BatchGetObjectsResponse, BatchGetTransactionsRequest, BatchGetTransactionsResponse, GetCheckpointRequest, GetCheckpointResponse, GetEpochRequest, GetEpochResponse, GetObjectRequest, GetObjectResponse, GetServiceInfoRequest, GetServiceInfoResponse, GetTransactionRequest, GetTransactionResponse, ListCheckpointsRequest, ListCheckpointsResponse, ListEventsRequest, ListEventsResponse, ListTransactionsRequest, ListTransactionsResponse } from "./ledger_service.mjs";
|
|
2
|
-
import * as
|
|
3
|
-
import * as
|
|
2
|
+
import * as _protobuf_ts_runtime0 from "@protobuf-ts/runtime";
|
|
3
|
+
import * as _protobuf_ts_runtime_rpc0 from "@protobuf-ts/runtime-rpc";
|
|
4
4
|
import { RpcOptions, RpcTransport, ServerStreamingCall, ServiceInfo, UnaryCall } from "@protobuf-ts/runtime-rpc";
|
|
5
5
|
|
|
6
6
|
//#region src/grpc/proto/sui/rpc/v2/ledger_service.client.d.ts
|
|
@@ -73,9 +73,9 @@ interface ILedgerServiceClient {
|
|
|
73
73
|
declare class LedgerServiceClient implements ILedgerServiceClient, ServiceInfo {
|
|
74
74
|
private readonly _transport;
|
|
75
75
|
typeName: string;
|
|
76
|
-
methods:
|
|
76
|
+
methods: _protobuf_ts_runtime_rpc0.MethodInfo<any, any>[];
|
|
77
77
|
options: {
|
|
78
|
-
[extensionName: string]:
|
|
78
|
+
[extensionName: string]: _protobuf_ts_runtime0.JsonValue;
|
|
79
79
|
};
|
|
80
80
|
constructor(_transport: RpcTransport);
|
|
81
81
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { GetDatatypeRequest, GetDatatypeResponse, GetFunctionRequest, GetFunctionResponse, GetPackageRequest, GetPackageResponse, ListPackageVersionsRequest, ListPackageVersionsResponse } from "./move_package_service.mjs";
|
|
2
|
-
import * as
|
|
3
|
-
import * as
|
|
2
|
+
import * as _protobuf_ts_runtime1 from "@protobuf-ts/runtime";
|
|
3
|
+
import * as _protobuf_ts_runtime_rpc1 from "@protobuf-ts/runtime-rpc";
|
|
4
4
|
import { RpcOptions, RpcTransport, ServiceInfo, UnaryCall } from "@protobuf-ts/runtime-rpc";
|
|
5
5
|
|
|
6
6
|
//#region src/grpc/proto/sui/rpc/v2/move_package_service.client.d.ts
|
|
@@ -31,9 +31,9 @@ interface IMovePackageServiceClient {
|
|
|
31
31
|
declare class MovePackageServiceClient implements IMovePackageServiceClient, ServiceInfo {
|
|
32
32
|
private readonly _transport;
|
|
33
33
|
typeName: string;
|
|
34
|
-
methods:
|
|
34
|
+
methods: _protobuf_ts_runtime_rpc1.MethodInfo<any, any>[];
|
|
35
35
|
options: {
|
|
36
|
-
[extensionName: string]:
|
|
36
|
+
[extensionName: string]: _protobuf_ts_runtime1.JsonValue;
|
|
37
37
|
};
|
|
38
38
|
constructor(_transport: RpcTransport);
|
|
39
39
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { LookupNameRequest, LookupNameResponse, ReverseLookupNameRequest, ReverseLookupNameResponse } from "./name_service.mjs";
|
|
2
|
-
import * as
|
|
3
|
-
import * as
|
|
2
|
+
import * as _protobuf_ts_runtime6 from "@protobuf-ts/runtime";
|
|
3
|
+
import * as _protobuf_ts_runtime_rpc6 from "@protobuf-ts/runtime-rpc";
|
|
4
4
|
import { RpcOptions, RpcTransport, ServiceInfo, UnaryCall } from "@protobuf-ts/runtime-rpc";
|
|
5
5
|
|
|
6
6
|
//#region src/grpc/proto/sui/rpc/v2/name_service.client.d.ts
|
|
@@ -23,9 +23,9 @@ interface INameServiceClient {
|
|
|
23
23
|
declare class NameServiceClient implements INameServiceClient, ServiceInfo {
|
|
24
24
|
private readonly _transport;
|
|
25
25
|
typeName: string;
|
|
26
|
-
methods:
|
|
26
|
+
methods: _protobuf_ts_runtime_rpc6.MethodInfo<any, any>[];
|
|
27
27
|
options: {
|
|
28
|
-
[extensionName: string]:
|
|
28
|
+
[extensionName: string]: _protobuf_ts_runtime6.JsonValue;
|
|
29
29
|
};
|
|
30
30
|
constructor(_transport: RpcTransport);
|
|
31
31
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { VerifySignatureRequest, VerifySignatureResponse } from "./signature_verification_service.mjs";
|
|
2
|
-
import * as
|
|
3
|
-
import * as
|
|
2
|
+
import * as _protobuf_ts_runtime3 from "@protobuf-ts/runtime";
|
|
3
|
+
import * as _protobuf_ts_runtime_rpc3 from "@protobuf-ts/runtime-rpc";
|
|
4
4
|
import { RpcOptions, RpcTransport, ServiceInfo, UnaryCall } from "@protobuf-ts/runtime-rpc";
|
|
5
5
|
|
|
6
6
|
//#region src/grpc/proto/sui/rpc/v2/signature_verification_service.client.d.ts
|
|
@@ -21,9 +21,9 @@ interface ISignatureVerificationServiceClient {
|
|
|
21
21
|
declare class SignatureVerificationServiceClient implements ISignatureVerificationServiceClient, ServiceInfo {
|
|
22
22
|
private readonly _transport;
|
|
23
23
|
typeName: string;
|
|
24
|
-
methods:
|
|
24
|
+
methods: _protobuf_ts_runtime_rpc3.MethodInfo<any, any>[];
|
|
25
25
|
options: {
|
|
26
|
-
[extensionName: string]:
|
|
26
|
+
[extensionName: string]: _protobuf_ts_runtime3.JsonValue;
|
|
27
27
|
};
|
|
28
28
|
constructor(_transport: RpcTransport);
|
|
29
29
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { GetBalanceRequest, GetBalanceResponse, GetCoinInfoRequest, GetCoinInfoResponse, ListBalancesRequest, ListBalancesResponse, ListDynamicFieldsRequest, ListDynamicFieldsResponse, ListOwnedObjectsRequest, ListOwnedObjectsResponse } from "./state_service.mjs";
|
|
2
|
-
import * as
|
|
3
|
-
import * as
|
|
2
|
+
import * as _protobuf_ts_runtime2 from "@protobuf-ts/runtime";
|
|
3
|
+
import * as _protobuf_ts_runtime_rpc2 from "@protobuf-ts/runtime-rpc";
|
|
4
4
|
import { RpcOptions, RpcTransport, ServiceInfo, UnaryCall } from "@protobuf-ts/runtime-rpc";
|
|
5
5
|
|
|
6
6
|
//#region src/grpc/proto/sui/rpc/v2/state_service.client.d.ts
|
|
@@ -35,9 +35,9 @@ interface IStateServiceClient {
|
|
|
35
35
|
declare class StateServiceClient implements IStateServiceClient, ServiceInfo {
|
|
36
36
|
private readonly _transport;
|
|
37
37
|
typeName: string;
|
|
38
|
-
methods:
|
|
38
|
+
methods: _protobuf_ts_runtime_rpc2.MethodInfo<any, any>[];
|
|
39
39
|
options: {
|
|
40
|
-
[extensionName: string]:
|
|
40
|
+
[extensionName: string]: _protobuf_ts_runtime2.JsonValue;
|
|
41
41
|
};
|
|
42
42
|
constructor(_transport: RpcTransport);
|
|
43
43
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SubscribeCheckpointsRequest, SubscribeCheckpointsResponse, SubscribeEventsRequest, SubscribeEventsResponse, SubscribeTransactionsRequest, SubscribeTransactionsResponse } from "./subscription_service.mjs";
|
|
2
|
-
import * as
|
|
3
|
-
import * as
|
|
2
|
+
import * as _protobuf_ts_runtime4 from "@protobuf-ts/runtime";
|
|
3
|
+
import * as _protobuf_ts_runtime_rpc4 from "@protobuf-ts/runtime-rpc";
|
|
4
4
|
import { RpcOptions, RpcTransport, ServerStreamingCall, ServiceInfo } from "@protobuf-ts/runtime-rpc";
|
|
5
5
|
|
|
6
6
|
//#region src/grpc/proto/sui/rpc/v2/subscription_service.client.d.ts
|
|
@@ -100,9 +100,9 @@ interface ISubscriptionServiceClient {
|
|
|
100
100
|
declare class SubscriptionServiceClient implements ISubscriptionServiceClient, ServiceInfo {
|
|
101
101
|
private readonly _transport;
|
|
102
102
|
typeName: string;
|
|
103
|
-
methods:
|
|
103
|
+
methods: _protobuf_ts_runtime_rpc4.MethodInfo<any, any>[];
|
|
104
104
|
options: {
|
|
105
|
-
[extensionName: string]:
|
|
105
|
+
[extensionName: string]: _protobuf_ts_runtime4.JsonValue;
|
|
106
106
|
};
|
|
107
107
|
constructor(_transport: RpcTransport);
|
|
108
108
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ExecuteTransactionRequest, ExecuteTransactionResponse, SimulateTransactionRequest, SimulateTransactionResponse } from "./transaction_execution_service.mjs";
|
|
2
|
-
import * as
|
|
3
|
-
import * as
|
|
2
|
+
import * as _protobuf_ts_runtime0 from "@protobuf-ts/runtime";
|
|
3
|
+
import * as _protobuf_ts_runtime_rpc0 from "@protobuf-ts/runtime-rpc";
|
|
4
4
|
import { RpcOptions, RpcTransport, ServiceInfo, UnaryCall } from "@protobuf-ts/runtime-rpc";
|
|
5
5
|
|
|
6
6
|
//#region src/grpc/proto/sui/rpc/v2/transaction_execution_service.client.d.ts
|
|
@@ -23,9 +23,9 @@ interface ITransactionExecutionServiceClient {
|
|
|
23
23
|
declare class TransactionExecutionServiceClient implements ITransactionExecutionServiceClient, ServiceInfo {
|
|
24
24
|
private readonly _transport;
|
|
25
25
|
typeName: string;
|
|
26
|
-
methods:
|
|
26
|
+
methods: _protobuf_ts_runtime_rpc0.MethodInfo<any, any>[];
|
|
27
27
|
options: {
|
|
28
|
-
[extensionName: string]:
|
|
28
|
+
[extensionName: string]: _protobuf_ts_runtime0.JsonValue;
|
|
29
29
|
};
|
|
30
30
|
constructor(_transport: RpcTransport);
|
|
31
31
|
/**
|
|
@@ -130,7 +130,7 @@ declare class Transaction {
|
|
|
130
130
|
chain: string;
|
|
131
131
|
nonce: number;
|
|
132
132
|
};
|
|
133
|
-
}, "
|
|
133
|
+
}, "None" | "Epoch" | "ValidDuring" | "Validity"> | null | undefined;
|
|
134
134
|
gasData: {
|
|
135
135
|
budget: string | number | null;
|
|
136
136
|
price: string | number | null;
|
|
@@ -158,7 +158,7 @@ declare class Transaction {
|
|
|
158
158
|
version: string | number;
|
|
159
159
|
digest: string;
|
|
160
160
|
};
|
|
161
|
-
}, "
|
|
161
|
+
}, "ImmOrOwnedObject" | "SharedObject" | "Receiving">;
|
|
162
162
|
Pure: {
|
|
163
163
|
bytes: string;
|
|
164
164
|
};
|
|
@@ -190,7 +190,7 @@ declare class Transaction {
|
|
|
190
190
|
};
|
|
191
191
|
}, "Sender" | "Sponsor" | "SenderAllowance">;
|
|
192
192
|
};
|
|
193
|
-
}, "
|
|
193
|
+
}, "Pure" | "Object" | "FundsWithdrawal" | "UnresolvedPure" | "UnresolvedObject">[];
|
|
194
194
|
commands: _mysten_bcs1397.EnumOutputShapeWithKeys<{
|
|
195
195
|
MoveCall: {
|
|
196
196
|
package: string;
|
package/dist/version.mjs
CHANGED
package/dist/version.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.mjs","names":[],"sources":["../src/version.ts"],"sourcesContent":["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\n// This file is generated by genversion.mjs. Do not edit it directly.\n\nexport const PACKAGE_VERSION = '2.31.
|
|
1
|
+
{"version":3,"file":"version.mjs","names":[],"sources":["../src/version.ts"],"sourcesContent":["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\n// This file is generated by genversion.mjs. Do not edit it directly.\n\nexport const PACKAGE_VERSION = '2.31.1';\n"],"mappings":";AAKA,MAAa,kBAAkB"}
|
package/dist/zklogin/bcs.d.mts
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _mysten_bcs1241 from "@mysten/bcs";
|
|
2
2
|
import { InferBcsInput } from "@mysten/bcs";
|
|
3
3
|
|
|
4
4
|
//#region src/zklogin/bcs.d.ts
|
|
5
|
-
declare const zkLoginSignature:
|
|
6
|
-
inputs:
|
|
7
|
-
proofPoints:
|
|
8
|
-
a:
|
|
5
|
+
declare const zkLoginSignature: _mysten_bcs1241.BcsStruct<{
|
|
6
|
+
inputs: _mysten_bcs1241.BcsStruct<{
|
|
7
|
+
proofPoints: _mysten_bcs1241.BcsStruct<{
|
|
8
|
+
a: _mysten_bcs1241.BcsType<string[], Iterable<string> & {
|
|
9
9
|
length: number;
|
|
10
10
|
}, string>;
|
|
11
|
-
b:
|
|
11
|
+
b: _mysten_bcs1241.BcsType<string[][], Iterable<Iterable<string> & {
|
|
12
12
|
length: number;
|
|
13
13
|
}> & {
|
|
14
14
|
length: number;
|
|
15
15
|
}, string>;
|
|
16
|
-
c:
|
|
16
|
+
c: _mysten_bcs1241.BcsType<string[], Iterable<string> & {
|
|
17
17
|
length: number;
|
|
18
18
|
}, string>;
|
|
19
19
|
}, string>;
|
|
20
|
-
issBase64Details:
|
|
21
|
-
value:
|
|
22
|
-
indexMod4:
|
|
20
|
+
issBase64Details: _mysten_bcs1241.BcsStruct<{
|
|
21
|
+
value: _mysten_bcs1241.BcsType<string, string, "string">;
|
|
22
|
+
indexMod4: _mysten_bcs1241.BcsType<number, number, "u8">;
|
|
23
23
|
}, string>;
|
|
24
|
-
headerBase64:
|
|
25
|
-
addressSeed:
|
|
24
|
+
headerBase64: _mysten_bcs1241.BcsType<string, string, "string">;
|
|
25
|
+
addressSeed: _mysten_bcs1241.BcsType<string, string, "string">;
|
|
26
26
|
}, string>;
|
|
27
|
-
maxEpoch:
|
|
28
|
-
userSignature:
|
|
27
|
+
maxEpoch: _mysten_bcs1241.BcsType<string, string | number | bigint, "u64">;
|
|
28
|
+
userSignature: _mysten_bcs1241.BcsType<Uint8Array<ArrayBufferLike>, Iterable<number>, "vector<u8>">;
|
|
29
29
|
}, string>;
|
|
30
30
|
type ZkLoginSignature = InferBcsInput<typeof zkLoginSignature>;
|
|
31
31
|
type ZkLoginSignatureInputs = ZkLoginSignature['inputs'];
|
package/package.json
CHANGED
|
@@ -22,6 +22,9 @@ import { transactionUsesGasCoin } from '../transactions/resolution-utils.js';
|
|
|
22
22
|
// The maximum objects that can be fetched at once using multiGetObjects.
|
|
23
23
|
const MAX_OBJECTS_PER_FETCH = 50;
|
|
24
24
|
|
|
25
|
+
// The gas payment limit is inclusive as of protocol version 96.
|
|
26
|
+
const MAX_GAS_PAYMENT_OBJECTS = 256;
|
|
27
|
+
|
|
25
28
|
// An amount of gas (in gas units) that is added to transactions as an overhead to ensure transactions do not fail.
|
|
26
29
|
const GAS_SAFE_OVERHEAD = 1000n;
|
|
27
30
|
const MAX_GAS = 50_000_000_000;
|
|
@@ -237,12 +240,13 @@ function setGasPayment({
|
|
|
237
240
|
if (usesGasCoin && reservationAmount > 0n && chainIdentifier && epoch) {
|
|
238
241
|
transactionData.gasData.payment = [
|
|
239
242
|
createCoinReservationRef(reservationAmount, gasPayer, chainIdentifier, epoch),
|
|
240
|
-
|
|
243
|
+
// The reservation occupies one entry in the gas payment limit.
|
|
244
|
+
...paymentCoins.slice(0, MAX_GAS_PAYMENT_OBJECTS - 1),
|
|
241
245
|
];
|
|
242
246
|
} else if (!filteredCoins.length) {
|
|
243
247
|
throw new Error('No valid gas coins found for the transaction.');
|
|
244
248
|
} else {
|
|
245
|
-
transactionData.gasData.payment = paymentCoins;
|
|
249
|
+
transactionData.gasData.payment = paymentCoins.slice(0, MAX_GAS_PAYMENT_OBJECTS);
|
|
246
250
|
}
|
|
247
251
|
}
|
|
248
252
|
|
package/src/version.ts
CHANGED