@mysten/sui 2.25.0 → 2.26.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/CHANGELOG.md +9 -0
- package/dist/bcs/bcs.d.mts +6 -6
- package/dist/bcs/index.d.mts +36 -36
- package/dist/client/errors.d.mts +31 -2
- package/dist/client/errors.d.mts.map +1 -1
- package/dist/client/errors.mjs +15 -13
- package/dist/client/errors.mjs.map +1 -1
- package/dist/client/index.d.mts +2 -2
- package/dist/client/index.mjs +2 -2
- package/dist/graphql/core.d.mts.map +1 -1
- package/dist/graphql/core.mjs +11 -5
- package/dist/graphql/core.mjs.map +1 -1
- package/dist/grpc/core.d.mts.map +1 -1
- package/dist/grpc/core.mjs +29 -12
- package/dist/grpc/core.mjs.map +1 -1
- 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/jsonRpc/core.d.mts.map +1 -1
- package/dist/jsonRpc/core.mjs +55 -15
- package/dist/jsonRpc/core.mjs.map +1 -1
- package/dist/transactions/Transaction.d.mts +9 -9
- package/dist/version.mjs +1 -1
- package/dist/version.mjs.map +1 -1
- package/package.json +1 -1
- package/src/client/errors.ts +39 -23
- package/src/client/index.ts +9 -1
- package/src/graphql/core.ts +11 -6
- package/src/grpc/core.ts +90 -65
- package/src/jsonRpc/core.ts +83 -18
- package/src/version.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @mysten/sui.js
|
|
2
2
|
|
|
3
|
+
## 2.26.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 87989d5: Add transport-neutral `ObjectError` and `TransactionError` lookup details across the Core
|
|
8
|
+
API clients. The existing transport-specific `ObjectError.code` field and `(code, message)`
|
|
9
|
+
constructor remain supported; the transport-neutral `reason`, resource identity, and `cause`
|
|
10
|
+
fields are additive.
|
|
11
|
+
|
|
3
12
|
## 2.25.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_bcs1226 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_bcs1226.BcsStruct<{
|
|
8
|
+
intent: _mysten_bcs1226.BcsStruct<{
|
|
9
|
+
scope: _mysten_bcs1226.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_bcs1226.BcsEnum<{
|
|
16
16
|
V0: null;
|
|
17
17
|
}, "IntentVersion">;
|
|
18
|
-
appId:
|
|
18
|
+
appId: _mysten_bcs1226.BcsEnum<{
|
|
19
19
|
Sui: null;
|
|
20
20
|
}, "AppId">;
|
|
21
21
|
}, string>;
|
package/dist/bcs/index.d.mts
CHANGED
|
@@ -545,7 +545,7 @@ declare const suiBcs: {
|
|
|
545
545
|
version: string;
|
|
546
546
|
digest: string;
|
|
547
547
|
};
|
|
548
|
-
}, "
|
|
548
|
+
}, "Receiving" | "ImmOrOwnedObject" | "SharedObject">;
|
|
549
549
|
FundsWithdrawal: {
|
|
550
550
|
reservation: {
|
|
551
551
|
MaxAmountU64: string;
|
|
@@ -560,7 +560,7 @@ declare const suiBcs: {
|
|
|
560
560
|
Sponsor: true;
|
|
561
561
|
}, "Sender" | "Sponsor">;
|
|
562
562
|
};
|
|
563
|
-
}, "
|
|
563
|
+
}, "Object" | "Pure" | "FundsWithdrawal">[], Iterable<_mysten_bcs0.EnumInputShape<{
|
|
564
564
|
Pure: {
|
|
565
565
|
bytes: string | Uint8Array<ArrayBufferLike>;
|
|
566
566
|
};
|
|
@@ -793,7 +793,7 @@ declare const suiBcs: {
|
|
|
793
793
|
TransactionEffects: true;
|
|
794
794
|
CheckpointSummary: true;
|
|
795
795
|
PersonalMessage: true;
|
|
796
|
-
}, "
|
|
796
|
+
}, "TransactionEffects" | "TransactionData" | "CheckpointSummary" | "PersonalMessage">;
|
|
797
797
|
version: {
|
|
798
798
|
V0: true;
|
|
799
799
|
$kind: "V0";
|
|
@@ -827,7 +827,7 @@ declare const suiBcs: {
|
|
|
827
827
|
version: string;
|
|
828
828
|
digest: string;
|
|
829
829
|
};
|
|
830
|
-
}, "
|
|
830
|
+
}, "Receiving" | "ImmOrOwnedObject" | "SharedObject">;
|
|
831
831
|
FundsWithdrawal: {
|
|
832
832
|
reservation: {
|
|
833
833
|
MaxAmountU64: string;
|
|
@@ -842,7 +842,7 @@ declare const suiBcs: {
|
|
|
842
842
|
Sponsor: true;
|
|
843
843
|
}, "Sender" | "Sponsor">;
|
|
844
844
|
};
|
|
845
|
-
}, "
|
|
845
|
+
}, "Object" | "Pure" | "FundsWithdrawal">[];
|
|
846
846
|
commands: _mysten_bcs0.EnumOutputShapeWithKeys<{
|
|
847
847
|
MoveCall: {
|
|
848
848
|
package: string;
|
|
@@ -981,7 +981,7 @@ declare const suiBcs: {
|
|
|
981
981
|
startVersion: string;
|
|
982
982
|
owner: string;
|
|
983
983
|
};
|
|
984
|
-
}, "AddressOwner" | "
|
|
984
|
+
}, "AddressOwner" | "ConsensusAddressOwner" | "Immutable" | "ObjectOwner" | "Shared">;
|
|
985
985
|
};
|
|
986
986
|
$kind: "RawObject";
|
|
987
987
|
}[];
|
|
@@ -1113,7 +1113,7 @@ declare const suiBcs: {
|
|
|
1113
1113
|
version: string;
|
|
1114
1114
|
digest: string;
|
|
1115
1115
|
};
|
|
1116
|
-
}, "
|
|
1116
|
+
}, "Receiving" | "ImmOrOwnedObject" | "SharedObject">;
|
|
1117
1117
|
FundsWithdrawal: {
|
|
1118
1118
|
reservation: {
|
|
1119
1119
|
MaxAmountU64: string;
|
|
@@ -1128,7 +1128,7 @@ declare const suiBcs: {
|
|
|
1128
1128
|
Sponsor: true;
|
|
1129
1129
|
}, "Sender" | "Sponsor">;
|
|
1130
1130
|
};
|
|
1131
|
-
}, "
|
|
1131
|
+
}, "Object" | "Pure" | "FundsWithdrawal">[];
|
|
1132
1132
|
commands: _mysten_bcs0.EnumOutputShapeWithKeys<{
|
|
1133
1133
|
MoveCall: {
|
|
1134
1134
|
package: string;
|
|
@@ -1210,7 +1210,7 @@ declare const suiBcs: {
|
|
|
1210
1210
|
};
|
|
1211
1211
|
}, "MoveCall" | "TransferObjects" | "SplitCoins" | "MergeCoins" | "Publish" | "MakeMoveVec" | "Upgrade">[];
|
|
1212
1212
|
};
|
|
1213
|
-
}, "
|
|
1213
|
+
}, "EndOfEpochTransaction" | "ProgrammableSystemTransaction" | "ProgrammableTransaction" | "ChangeEpoch" | "Genesis" | "ConsensusCommitPrologue" | "AuthenticatorStateUpdate" | "RandomnessStateUpdate" | "ConsensusCommitPrologueV2" | "ConsensusCommitPrologueV3" | "ConsensusCommitPrologueV4">;
|
|
1214
1214
|
sender: string;
|
|
1215
1215
|
gasData: {
|
|
1216
1216
|
payment: {
|
|
@@ -1233,7 +1233,7 @@ declare const suiBcs: {
|
|
|
1233
1233
|
chain: string;
|
|
1234
1234
|
nonce: number;
|
|
1235
1235
|
};
|
|
1236
|
-
}, "
|
|
1236
|
+
}, "Epoch" | "None" | "ValidDuring">;
|
|
1237
1237
|
};
|
|
1238
1238
|
$kind: "V1";
|
|
1239
1239
|
};
|
|
@@ -1823,7 +1823,7 @@ declare const suiBcs: {
|
|
|
1823
1823
|
version: string;
|
|
1824
1824
|
digest: string;
|
|
1825
1825
|
};
|
|
1826
|
-
}, "
|
|
1826
|
+
}, "Receiving" | "ImmOrOwnedObject" | "SharedObject">;
|
|
1827
1827
|
FundsWithdrawal: {
|
|
1828
1828
|
reservation: {
|
|
1829
1829
|
MaxAmountU64: string;
|
|
@@ -1838,7 +1838,7 @@ declare const suiBcs: {
|
|
|
1838
1838
|
Sponsor: true;
|
|
1839
1839
|
}, "Sender" | "Sponsor">;
|
|
1840
1840
|
};
|
|
1841
|
-
}, "
|
|
1841
|
+
}, "Object" | "Pure" | "FundsWithdrawal">[], Iterable<_mysten_bcs0.EnumInputShape<{
|
|
1842
1842
|
Pure: {
|
|
1843
1843
|
bytes: string | Uint8Array<ArrayBufferLike>;
|
|
1844
1844
|
};
|
|
@@ -2119,7 +2119,7 @@ declare const suiBcs: {
|
|
|
2119
2119
|
startVersion: string;
|
|
2120
2120
|
owner: string;
|
|
2121
2121
|
};
|
|
2122
|
-
}, "AddressOwner" | "
|
|
2122
|
+
}, "AddressOwner" | "ConsensusAddressOwner" | "Immutable" | "ObjectOwner" | "Shared">;
|
|
2123
2123
|
};
|
|
2124
2124
|
$kind: "RawObject";
|
|
2125
2125
|
}[], Iterable<{
|
|
@@ -2395,7 +2395,7 @@ declare const suiBcs: {
|
|
|
2395
2395
|
version: string;
|
|
2396
2396
|
digest: string;
|
|
2397
2397
|
};
|
|
2398
|
-
}, "
|
|
2398
|
+
}, "Receiving" | "ImmOrOwnedObject" | "SharedObject">;
|
|
2399
2399
|
FundsWithdrawal: {
|
|
2400
2400
|
reservation: {
|
|
2401
2401
|
MaxAmountU64: string;
|
|
@@ -2410,7 +2410,7 @@ declare const suiBcs: {
|
|
|
2410
2410
|
Sponsor: true;
|
|
2411
2411
|
}, "Sender" | "Sponsor">;
|
|
2412
2412
|
};
|
|
2413
|
-
}, "
|
|
2413
|
+
}, "Object" | "Pure" | "FundsWithdrawal">[], Iterable<_mysten_bcs0.EnumInputShape<{
|
|
2414
2414
|
Pure: {
|
|
2415
2415
|
bytes: string | Uint8Array<ArrayBufferLike>;
|
|
2416
2416
|
};
|
|
@@ -2707,7 +2707,7 @@ declare const suiBcs: {
|
|
|
2707
2707
|
version: string;
|
|
2708
2708
|
digest: string;
|
|
2709
2709
|
};
|
|
2710
|
-
}, "
|
|
2710
|
+
}, "Receiving" | "ImmOrOwnedObject" | "SharedObject">;
|
|
2711
2711
|
FundsWithdrawal: {
|
|
2712
2712
|
reservation: {
|
|
2713
2713
|
MaxAmountU64: string;
|
|
@@ -2722,7 +2722,7 @@ declare const suiBcs: {
|
|
|
2722
2722
|
Sponsor: true;
|
|
2723
2723
|
}, "Sender" | "Sponsor">;
|
|
2724
2724
|
};
|
|
2725
|
-
}, "
|
|
2725
|
+
}, "Object" | "Pure" | "FundsWithdrawal">[], Iterable<_mysten_bcs0.EnumInputShape<{
|
|
2726
2726
|
Pure: {
|
|
2727
2727
|
bytes: string | Uint8Array<ArrayBufferLike>;
|
|
2728
2728
|
};
|
|
@@ -3003,7 +3003,7 @@ declare const suiBcs: {
|
|
|
3003
3003
|
startVersion: string;
|
|
3004
3004
|
owner: string;
|
|
3005
3005
|
};
|
|
3006
|
-
}, "AddressOwner" | "
|
|
3006
|
+
}, "AddressOwner" | "ConsensusAddressOwner" | "Immutable" | "ObjectOwner" | "Shared">;
|
|
3007
3007
|
};
|
|
3008
3008
|
$kind: "RawObject";
|
|
3009
3009
|
}[], Iterable<{
|
|
@@ -3279,7 +3279,7 @@ declare const suiBcs: {
|
|
|
3279
3279
|
version: string;
|
|
3280
3280
|
digest: string;
|
|
3281
3281
|
};
|
|
3282
|
-
}, "
|
|
3282
|
+
}, "Receiving" | "ImmOrOwnedObject" | "SharedObject">;
|
|
3283
3283
|
FundsWithdrawal: {
|
|
3284
3284
|
reservation: {
|
|
3285
3285
|
MaxAmountU64: string;
|
|
@@ -3294,7 +3294,7 @@ declare const suiBcs: {
|
|
|
3294
3294
|
Sponsor: true;
|
|
3295
3295
|
}, "Sender" | "Sponsor">;
|
|
3296
3296
|
};
|
|
3297
|
-
}, "
|
|
3297
|
+
}, "Object" | "Pure" | "FundsWithdrawal">[], Iterable<_mysten_bcs0.EnumInputShape<{
|
|
3298
3298
|
Pure: {
|
|
3299
3299
|
bytes: string | Uint8Array<ArrayBufferLike>;
|
|
3300
3300
|
};
|
|
@@ -3567,7 +3567,7 @@ declare const suiBcs: {
|
|
|
3567
3567
|
version: string;
|
|
3568
3568
|
digest: string;
|
|
3569
3569
|
};
|
|
3570
|
-
}, "
|
|
3570
|
+
}, "Receiving" | "ImmOrOwnedObject" | "SharedObject">;
|
|
3571
3571
|
FundsWithdrawal: {
|
|
3572
3572
|
reservation: {
|
|
3573
3573
|
MaxAmountU64: string;
|
|
@@ -3582,7 +3582,7 @@ declare const suiBcs: {
|
|
|
3582
3582
|
Sponsor: true;
|
|
3583
3583
|
}, "Sender" | "Sponsor">;
|
|
3584
3584
|
};
|
|
3585
|
-
}, "
|
|
3585
|
+
}, "Object" | "Pure" | "FundsWithdrawal">[], Iterable<_mysten_bcs0.EnumInputShape<{
|
|
3586
3586
|
Pure: {
|
|
3587
3587
|
bytes: string | Uint8Array<ArrayBufferLike>;
|
|
3588
3588
|
};
|
|
@@ -3863,7 +3863,7 @@ declare const suiBcs: {
|
|
|
3863
3863
|
startVersion: string;
|
|
3864
3864
|
owner: string;
|
|
3865
3865
|
};
|
|
3866
|
-
}, "AddressOwner" | "
|
|
3866
|
+
}, "AddressOwner" | "ConsensusAddressOwner" | "Immutable" | "ObjectOwner" | "Shared">;
|
|
3867
3867
|
};
|
|
3868
3868
|
$kind: "RawObject";
|
|
3869
3869
|
}[], Iterable<{
|
|
@@ -4139,7 +4139,7 @@ declare const suiBcs: {
|
|
|
4139
4139
|
version: string;
|
|
4140
4140
|
digest: string;
|
|
4141
4141
|
};
|
|
4142
|
-
}, "
|
|
4142
|
+
}, "Receiving" | "ImmOrOwnedObject" | "SharedObject">;
|
|
4143
4143
|
FundsWithdrawal: {
|
|
4144
4144
|
reservation: {
|
|
4145
4145
|
MaxAmountU64: string;
|
|
@@ -4154,7 +4154,7 @@ declare const suiBcs: {
|
|
|
4154
4154
|
Sponsor: true;
|
|
4155
4155
|
}, "Sender" | "Sponsor">;
|
|
4156
4156
|
};
|
|
4157
|
-
}, "
|
|
4157
|
+
}, "Object" | "Pure" | "FundsWithdrawal">[], Iterable<_mysten_bcs0.EnumInputShape<{
|
|
4158
4158
|
Pure: {
|
|
4159
4159
|
bytes: string | Uint8Array<ArrayBufferLike>;
|
|
4160
4160
|
};
|
|
@@ -4608,7 +4608,7 @@ declare const suiBcs: {
|
|
|
4608
4608
|
startVersion: string;
|
|
4609
4609
|
owner: string;
|
|
4610
4610
|
};
|
|
4611
|
-
}, "AddressOwner" | "
|
|
4611
|
+
}, "AddressOwner" | "ConsensusAddressOwner" | "Immutable" | "ObjectOwner" | "Shared">][], Iterable<readonly [{
|
|
4612
4612
|
objectId: string | Uint8Array<ArrayBufferLike>;
|
|
4613
4613
|
version: string | number | bigint;
|
|
4614
4614
|
digest: string;
|
|
@@ -4641,7 +4641,7 @@ declare const suiBcs: {
|
|
|
4641
4641
|
startVersion: string;
|
|
4642
4642
|
owner: string;
|
|
4643
4643
|
};
|
|
4644
|
-
}, "AddressOwner" | "
|
|
4644
|
+
}, "AddressOwner" | "ConsensusAddressOwner" | "Immutable" | "ObjectOwner" | "Shared">][], Iterable<readonly [{
|
|
4645
4645
|
objectId: string | Uint8Array<ArrayBufferLike>;
|
|
4646
4646
|
version: string | number | bigint;
|
|
4647
4647
|
digest: string;
|
|
@@ -4674,7 +4674,7 @@ declare const suiBcs: {
|
|
|
4674
4674
|
startVersion: string;
|
|
4675
4675
|
owner: string;
|
|
4676
4676
|
};
|
|
4677
|
-
}, "AddressOwner" | "
|
|
4677
|
+
}, "AddressOwner" | "ConsensusAddressOwner" | "Immutable" | "ObjectOwner" | "Shared">][], Iterable<readonly [{
|
|
4678
4678
|
objectId: string | Uint8Array<ArrayBufferLike>;
|
|
4679
4679
|
version: string | number | bigint;
|
|
4680
4680
|
digest: string;
|
|
@@ -4941,7 +4941,7 @@ declare const suiBcs: {
|
|
|
4941
4941
|
startVersion: string;
|
|
4942
4942
|
owner: string;
|
|
4943
4943
|
};
|
|
4944
|
-
}, "AddressOwner" | "
|
|
4944
|
+
}, "AddressOwner" | "ConsensusAddressOwner" | "Immutable" | "ObjectOwner" | "Shared">];
|
|
4945
4945
|
}, "NotExist" | "Exist">;
|
|
4946
4946
|
outputState: _mysten_bcs0.EnumOutputShapeWithKeys<{
|
|
4947
4947
|
NotExist: true;
|
|
@@ -4956,7 +4956,7 @@ declare const suiBcs: {
|
|
|
4956
4956
|
startVersion: string;
|
|
4957
4957
|
owner: string;
|
|
4958
4958
|
};
|
|
4959
|
-
}, "AddressOwner" | "
|
|
4959
|
+
}, "AddressOwner" | "ConsensusAddressOwner" | "Immutable" | "ObjectOwner" | "Shared">];
|
|
4960
4960
|
PackageWrite: [string, string];
|
|
4961
4961
|
AccumulatorWriteV1: {
|
|
4962
4962
|
address: {
|
|
@@ -5042,7 +5042,7 @@ declare const suiBcs: {
|
|
|
5042
5042
|
ReadConsensusStreamEnded: string;
|
|
5043
5043
|
Cancelled: string;
|
|
5044
5044
|
PerEpochConfig: true;
|
|
5045
|
-
}, "
|
|
5045
|
+
}, "MutateConsensusStreamEnded" | "PerEpochConfig" | "ReadConsensusStreamEnded" | "ReadOnlyRoot" | "Cancelled">][], Iterable<readonly [string | Uint8Array<ArrayBufferLike>, _mysten_bcs0.EnumInputShape<{
|
|
5046
5046
|
ReadOnlyRoot: readonly [string | number | bigint, string];
|
|
5047
5047
|
MutateConsensusStreamEnded: string | number | bigint;
|
|
5048
5048
|
ReadConsensusStreamEnded: string | number | bigint;
|
|
@@ -5088,7 +5088,7 @@ declare const suiBcs: {
|
|
|
5088
5088
|
version: string;
|
|
5089
5089
|
digest: string;
|
|
5090
5090
|
};
|
|
5091
|
-
}, "
|
|
5091
|
+
}, "Receiving" | "ImmOrOwnedObject" | "SharedObject">;
|
|
5092
5092
|
FundsWithdrawal: {
|
|
5093
5093
|
reservation: {
|
|
5094
5094
|
MaxAmountU64: string;
|
|
@@ -5103,7 +5103,7 @@ declare const suiBcs: {
|
|
|
5103
5103
|
Sponsor: true;
|
|
5104
5104
|
}, "Sender" | "Sponsor">;
|
|
5105
5105
|
};
|
|
5106
|
-
}, "
|
|
5106
|
+
}, "Object" | "Pure" | "FundsWithdrawal">[], Iterable<_mysten_bcs0.EnumInputShape<{
|
|
5107
5107
|
Pure: {
|
|
5108
5108
|
bytes: string | Uint8Array<ArrayBufferLike>;
|
|
5109
5109
|
};
|
|
@@ -5384,7 +5384,7 @@ declare const suiBcs: {
|
|
|
5384
5384
|
startVersion: string;
|
|
5385
5385
|
owner: string;
|
|
5386
5386
|
};
|
|
5387
|
-
}, "AddressOwner" | "
|
|
5387
|
+
}, "AddressOwner" | "ConsensusAddressOwner" | "Immutable" | "ObjectOwner" | "Shared">;
|
|
5388
5388
|
};
|
|
5389
5389
|
$kind: "RawObject";
|
|
5390
5390
|
}[], Iterable<{
|
|
@@ -5660,7 +5660,7 @@ declare const suiBcs: {
|
|
|
5660
5660
|
version: string;
|
|
5661
5661
|
digest: string;
|
|
5662
5662
|
};
|
|
5663
|
-
}, "
|
|
5663
|
+
}, "Receiving" | "ImmOrOwnedObject" | "SharedObject">;
|
|
5664
5664
|
FundsWithdrawal: {
|
|
5665
5665
|
reservation: {
|
|
5666
5666
|
MaxAmountU64: string;
|
|
@@ -5675,7 +5675,7 @@ declare const suiBcs: {
|
|
|
5675
5675
|
Sponsor: true;
|
|
5676
5676
|
}, "Sender" | "Sponsor">;
|
|
5677
5677
|
};
|
|
5678
|
-
}, "
|
|
5678
|
+
}, "Object" | "Pure" | "FundsWithdrawal">[], Iterable<_mysten_bcs0.EnumInputShape<{
|
|
5679
5679
|
Pure: {
|
|
5680
5680
|
bytes: string | Uint8Array<ArrayBufferLike>;
|
|
5681
5681
|
};
|
package/dist/client/errors.d.mts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { SuiClientTypes } from "./types.mjs";
|
|
2
|
-
import "../jsonRpc/index.mjs";
|
|
3
2
|
|
|
4
3
|
//#region src/client/errors.d.ts
|
|
5
4
|
declare class SuiClientError extends Error {}
|
|
@@ -10,6 +9,36 @@ declare class SimulationError extends SuiClientError {
|
|
|
10
9
|
executionError?: SuiClientTypes.ExecutionError;
|
|
11
10
|
});
|
|
12
11
|
}
|
|
12
|
+
type ObjectErrorReason = 'notFound' | 'deleted' | 'unknown';
|
|
13
|
+
interface ObjectErrorOptions {
|
|
14
|
+
/** A transport-neutral reason shared by all Core API clients. */
|
|
15
|
+
reason: ObjectErrorReason;
|
|
16
|
+
/** The requested object ID, when the lookup identifies one. */
|
|
17
|
+
objectId?: string;
|
|
18
|
+
/** The original transport error or response. */
|
|
19
|
+
cause?: unknown;
|
|
20
|
+
}
|
|
21
|
+
/** An error returned for an individual object lookup. */
|
|
22
|
+
declare class ObjectError extends SuiClientError {
|
|
23
|
+
/** The transport's error code. Use `reason` for transport-neutral handling. */
|
|
24
|
+
code: string;
|
|
25
|
+
/** A transport-neutral reason shared by all Core API clients. */
|
|
26
|
+
readonly reason: ObjectErrorReason;
|
|
27
|
+
/** The requested object ID, when the lookup identifies one. */
|
|
28
|
+
readonly objectId?: string;
|
|
29
|
+
constructor(code: string, message: string, options?: ObjectErrorOptions);
|
|
30
|
+
}
|
|
31
|
+
type TransactionErrorReason = 'notFound';
|
|
32
|
+
/** An error returned by a transaction lookup. */
|
|
33
|
+
declare class TransactionError extends SuiClientError {
|
|
34
|
+
/** A transport-neutral reason shared by all Core API clients. */
|
|
35
|
+
readonly reason: TransactionErrorReason;
|
|
36
|
+
/** The requested transaction digest. */
|
|
37
|
+
readonly digest: string;
|
|
38
|
+
constructor(reason: TransactionErrorReason, digest: string, options?: {
|
|
39
|
+
cause?: unknown;
|
|
40
|
+
});
|
|
41
|
+
}
|
|
13
42
|
//#endregion
|
|
14
|
-
export { SimulationError };
|
|
43
|
+
export { ObjectError, ObjectErrorOptions, ObjectErrorReason, SimulationError, SuiClientError, TransactionError, TransactionErrorReason };
|
|
15
44
|
//# sourceMappingURL=errors.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.mts","names":[],"sources":["../../src/client/errors.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"errors.d.mts","names":[],"sources":["../../src/client/errors.ts"],"mappings":";;;cAKa,cAAA,SAAuB,KAAA;AAAA,cAEvB,eAAA,SAAwB,cAAA;EACpC,cAAA,GAAiB,cAAA,CAAe,cAAA;cAG/B,OAAA,UACA,OAAA;IAAY,KAAA;IAAiB,cAAA,GAAiB,cAAA,CAAe,cAAA;EAAA;AAAA;AAAA,KAOnD,iBAAA;AAAA,UAEK,kBAAA;EAT+B;EAW/C,MAAA,EAAQ,iBAAA;EAhB0C;EAkBlD,QAAA;EAlBoC;EAoBpC,KAAA;AAAA;;cAIY,WAAA,SAAoB,cAAA;EApB/B;EAsBD,IAAA;EArB8B;EAAA,SAuBrB,MAAA,EAAQ,iBAAA;EAvB6C;EAAA,SAyBrD,QAAA;cAEG,IAAA,UAAc,OAAA,UAAiB,OAAA,GAAU,kBAAA;AAAA;AAAA,KAQ1C,sBAAA;;cAOC,gBAAA,SAAyB,cAAA;EAnCT;EAAA,SAqCnB,MAAA,EAAQ,sBAAA;EAnCD;EAAA,SAqCP,MAAA;cAEG,MAAA,EAAQ,sBAAA,EAAwB,MAAA,UAAgB,OAAA;IAAY,KAAA;EAAA;AAAA"}
|
package/dist/client/errors.mjs
CHANGED
|
@@ -6,23 +6,25 @@ var SimulationError = class extends SuiClientError {
|
|
|
6
6
|
this.executionError = options?.executionError;
|
|
7
7
|
}
|
|
8
8
|
};
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
/** An error returned for an individual object lookup. */
|
|
10
|
+
var ObjectError = class extends SuiClientError {
|
|
11
|
+
constructor(code, message, options) {
|
|
12
|
+
super(message, { cause: options?.cause });
|
|
12
13
|
this.code = code;
|
|
14
|
+
this.reason = options?.reason ?? "unknown";
|
|
15
|
+
this.objectId = options?.objectId;
|
|
13
16
|
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
17
|
+
};
|
|
18
|
+
const TRANSACTION_ERROR_MESSAGES = { notFound: (digest) => `Transaction ${digest} not found` };
|
|
19
|
+
/** An error returned by a transaction lookup. */
|
|
20
|
+
var TransactionError = class extends SuiClientError {
|
|
21
|
+
constructor(reason, digest, options) {
|
|
22
|
+
super(TRANSACTION_ERROR_MESSAGES[reason](digest), options);
|
|
23
|
+
this.reason = reason;
|
|
24
|
+
this.digest = digest;
|
|
23
25
|
}
|
|
24
26
|
};
|
|
25
27
|
|
|
26
28
|
//#endregion
|
|
27
|
-
export { ObjectError, SimulationError };
|
|
29
|
+
export { ObjectError, SimulationError, SuiClientError, TransactionError };
|
|
28
30
|
//# sourceMappingURL=errors.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.mjs","names":[],"sources":["../../src/client/errors.ts"],"sourcesContent":["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type {
|
|
1
|
+
{"version":3,"file":"errors.mjs","names":[],"sources":["../../src/client/errors.ts"],"sourcesContent":["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { SuiClientTypes } from './types.js';\n\nexport class SuiClientError extends Error {}\n\nexport class SimulationError extends SuiClientError {\n\texecutionError?: SuiClientTypes.ExecutionError;\n\n\tconstructor(\n\t\tmessage: string,\n\t\toptions?: { cause?: unknown; executionError?: SuiClientTypes.ExecutionError },\n\t) {\n\t\tsuper(message, { cause: options?.cause });\n\t\tthis.executionError = options?.executionError;\n\t}\n}\n\nexport type ObjectErrorReason = 'notFound' | 'deleted' | 'unknown';\n\nexport interface ObjectErrorOptions {\n\t/** A transport-neutral reason shared by all Core API clients. */\n\treason: ObjectErrorReason;\n\t/** The requested object ID, when the lookup identifies one. */\n\tobjectId?: string;\n\t/** The original transport error or response. */\n\tcause?: unknown;\n}\n\n/** An error returned for an individual object lookup. */\nexport class ObjectError extends SuiClientError {\n\t/** The transport's error code. Use `reason` for transport-neutral handling. */\n\tcode: string;\n\t/** A transport-neutral reason shared by all Core API clients. */\n\treadonly reason: ObjectErrorReason;\n\t/** The requested object ID, when the lookup identifies one. */\n\treadonly objectId?: string;\n\n\tconstructor(code: string, message: string, options?: ObjectErrorOptions) {\n\t\tsuper(message, { cause: options?.cause });\n\t\tthis.code = code;\n\t\tthis.reason = options?.reason ?? 'unknown';\n\t\tthis.objectId = options?.objectId;\n\t}\n}\n\nexport type TransactionErrorReason = 'notFound';\n\nconst TRANSACTION_ERROR_MESSAGES: Record<TransactionErrorReason, (digest: string) => string> = {\n\tnotFound: (digest) => `Transaction ${digest} not found`,\n};\n\n/** An error returned by a transaction lookup. */\nexport class TransactionError extends SuiClientError {\n\t/** A transport-neutral reason shared by all Core API clients. */\n\treadonly reason: TransactionErrorReason;\n\t/** The requested transaction digest. */\n\treadonly digest: string;\n\n\tconstructor(reason: TransactionErrorReason, digest: string, options?: { cause?: unknown }) {\n\t\tsuper(TRANSACTION_ERROR_MESSAGES[reason](digest), options);\n\t\tthis.reason = reason;\n\t\tthis.digest = digest;\n\t}\n}\n"],"mappings":";AAKA,IAAa,iBAAb,cAAoC,MAAM;AAE1C,IAAa,kBAAb,cAAqC,eAAe;CAGnD,YACC,SACA,SACC;AACD,QAAM,SAAS,EAAE,OAAO,SAAS,OAAO,CAAC;AACzC,OAAK,iBAAiB,SAAS;;;;AAgBjC,IAAa,cAAb,cAAiC,eAAe;CAQ/C,YAAY,MAAc,SAAiB,SAA8B;AACxE,QAAM,SAAS,EAAE,OAAO,SAAS,OAAO,CAAC;AACzC,OAAK,OAAO;AACZ,OAAK,SAAS,SAAS,UAAU;AACjC,OAAK,WAAW,SAAS;;;AAM3B,MAAM,6BAAyF,EAC9F,WAAW,WAAW,eAAe,OAAO,aAC5C;;AAGD,IAAa,mBAAb,cAAsC,eAAe;CAMpD,YAAY,QAAgC,QAAgB,SAA+B;AAC1F,QAAM,2BAA2B,QAAQ,OAAO,EAAE,QAAQ;AAC1D,OAAK,SAAS;AACd,OAAK,SAAS"}
|
package/dist/client/index.d.mts
CHANGED
|
@@ -3,6 +3,6 @@ import { ClientWithExtensions, SuiClientRegistration, SuiClientTypes } from "./t
|
|
|
3
3
|
import { ClientWithCoreApi, CoreClient, CoreClientOptions } from "./core.mjs";
|
|
4
4
|
import { BaseClient } from "./client.mjs";
|
|
5
5
|
import { extractStatusFromEffectsBcs, formatMoveAbortMessage, parseTransactionBcs, parseTransactionEffectsBcs } from "./utils.mjs";
|
|
6
|
-
import { SimulationError } from "./errors.mjs";
|
|
6
|
+
import { ObjectError, ObjectErrorOptions, ObjectErrorReason, SimulationError, SuiClientError, TransactionError, TransactionErrorReason } from "./errors.mjs";
|
|
7
7
|
import { NamedPackagesOverrides } from "./mvr.mjs";
|
|
8
|
-
export { BaseClient, ClientCache, type ClientCacheOptions, type ClientWithCoreApi, type ClientWithExtensions, CoreClient, type CoreClientOptions, type NamedPackagesOverrides, SimulationError, type SuiClientRegistration, type SuiClientTypes, extractStatusFromEffectsBcs, formatMoveAbortMessage, parseTransactionBcs, parseTransactionEffectsBcs };
|
|
8
|
+
export { BaseClient, ClientCache, type ClientCacheOptions, type ClientWithCoreApi, type ClientWithExtensions, CoreClient, type CoreClientOptions, type NamedPackagesOverrides, ObjectError, type ObjectErrorOptions, type ObjectErrorReason, SimulationError, SuiClientError, type SuiClientRegistration, type SuiClientTypes, TransactionError, type TransactionErrorReason, extractStatusFromEffectsBcs, formatMoveAbortMessage, parseTransactionBcs, parseTransactionEffectsBcs };
|
package/dist/client/index.mjs
CHANGED
|
@@ -2,6 +2,6 @@ import { ClientCache } from "./cache.mjs";
|
|
|
2
2
|
import { BaseClient } from "./client.mjs";
|
|
3
3
|
import { CoreClient } from "./core.mjs";
|
|
4
4
|
import { extractStatusFromEffectsBcs, formatMoveAbortMessage, parseTransactionBcs, parseTransactionEffectsBcs } from "./utils.mjs";
|
|
5
|
-
import { SimulationError } from "./errors.mjs";
|
|
5
|
+
import { ObjectError, SimulationError, SuiClientError, TransactionError } from "./errors.mjs";
|
|
6
6
|
|
|
7
|
-
export { BaseClient, ClientCache, CoreClient, SimulationError, extractStatusFromEffectsBcs, formatMoveAbortMessage, parseTransactionBcs, parseTransactionEffectsBcs };
|
|
7
|
+
export { BaseClient, ClientCache, CoreClient, ObjectError, SimulationError, SuiClientError, TransactionError, extractStatusFromEffectsBcs, formatMoveAbortMessage, parseTransactionBcs, parseTransactionEffectsBcs };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core.d.mts","names":[],"sources":["../../src/graphql/core.ts"],"mappings":";;;;;;;;cAmEa,iBAAA,SAA0B,UAAA;EAAA;;IAIrC,aAAA;IACA;EAAA;IAEA,aAAA,EAAe,gBAAA;IACf,GAAA,GAAM,cAAA,CAAe,UAAA;EAAA;
|
|
1
|
+
{"version":3,"file":"core.d.mts","names":[],"sources":["../../src/graphql/core.ts"],"mappings":"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"}
|
package/dist/graphql/core.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import { raceSignal } from "../client/mvr.mjs";
|
|
|
3
3
|
import { CoreClient } from "../client/core.mjs";
|
|
4
4
|
import { TransactionDataBuilder } from "../transactions/TransactionData.mjs";
|
|
5
5
|
import { formatMoveAbortMessage, parseTransactionEffectsBcs, transactionBytesHaveEmptyGasPayment } from "../client/utils.mjs";
|
|
6
|
-
import { ObjectError, SimulationError } from "../client/errors.mjs";
|
|
6
|
+
import { ObjectError, SimulationError, TransactionError } from "../client/errors.mjs";
|
|
7
7
|
import { SUI_TYPE_ARG } from "../utils/constants.mjs";
|
|
8
8
|
import { DefaultSuinsNameDocument, ExecuteTransactionDocument, ExecutionStatus, GetAllBalancesDocument, GetBalanceDocument, GetChainIdentifierDocument, GetCoinMetadataDocument, GetCoinsDocument, GetCurrentSystemStateDocument, GetMoveFunctionDocument, GetOwnedObjectsDocument, GetProtocolConfigDocument, GetReferenceGasPriceDocument, GetTransactionBlockDocument, ListEventsDocument, ListTransactionsDocument, MultiGetObjectsDocument, ResolveNameServiceAddressDocument, ResolveTransactionDocument, SimulateTransactionDocument, VerifyZkLoginSignatureDocument, ZkLoginIntentScope } from "./generated/queries.mjs";
|
|
9
9
|
import { Transaction } from "../grpc/proto/sui/rpc/v2/transaction.mjs";
|
|
@@ -25,11 +25,11 @@ var GraphQLCoreClient = class extends CoreClient {
|
|
|
25
25
|
});
|
|
26
26
|
this.#graphqlClient = graphqlClient;
|
|
27
27
|
}
|
|
28
|
-
async #graphqlQuery(options, getData) {
|
|
28
|
+
async #graphqlQuery(options, getData, createMissingDataError) {
|
|
29
29
|
const { data, errors } = await this.#graphqlClient.query(options);
|
|
30
30
|
handleGraphQLErrors(errors);
|
|
31
31
|
const extractedData = data && (getData ? getData(data) : data);
|
|
32
|
-
if (extractedData == null) throw new Error("Missing response data");
|
|
32
|
+
if (extractedData == null) throw createMissingDataError?.() ?? /* @__PURE__ */ new Error("Missing response data");
|
|
33
33
|
return extractedData;
|
|
34
34
|
}
|
|
35
35
|
async getObjects(options) {
|
|
@@ -48,7 +48,13 @@ var GraphQLCoreClient = class extends CoreClient {
|
|
|
48
48
|
includeDisplay: options.include?.display ?? false
|
|
49
49
|
}
|
|
50
50
|
}, (result) => result.multiGetObjects);
|
|
51
|
-
results.push(...batch.map((
|
|
51
|
+
results.push(...batch.map((objectId) => ({
|
|
52
|
+
objectId,
|
|
53
|
+
normalized: normalizeSuiAddress(objectId)
|
|
54
|
+
})).map(({ objectId, normalized }) => page.find((obj) => obj?.address === normalized) ?? new ObjectError("notFound", `Object ${normalized} not found`, {
|
|
55
|
+
reason: "notFound",
|
|
56
|
+
objectId
|
|
57
|
+
})).map((obj) => {
|
|
52
58
|
if (obj instanceof ObjectError) return obj;
|
|
53
59
|
const bcsContent = obj.asMoveObject?.contents?.bcs ? fromBase64(obj.asMoveObject.contents.bcs) : void 0;
|
|
54
60
|
const objectBcs = obj.objectBcs ? fromBase64(obj.objectBcs) : void 0;
|
|
@@ -219,7 +225,7 @@ var GraphQLCoreClient = class extends CoreClient {
|
|
|
219
225
|
includeObjectTypes: options.include?.objectTypes ?? false,
|
|
220
226
|
includeBcs: options.include?.bcs ?? false
|
|
221
227
|
}
|
|
222
|
-
}, (result) => result.transaction), options.include);
|
|
228
|
+
}, (result) => result.transaction, () => new TransactionError("notFound", options.digest)), options.include);
|
|
223
229
|
}
|
|
224
230
|
async executeTransaction(options) {
|
|
225
231
|
return parseTransaction((await this.#graphqlQuery({
|