@mysten/sui 2.27.1 → 2.28.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.
Files changed (60) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/bcs/bcs.d.mts +6 -6
  3. package/dist/bcs/bcs.d.mts.map +1 -1
  4. package/dist/bcs/bcs.mjs +29 -2
  5. package/dist/bcs/bcs.mjs.map +1 -1
  6. package/dist/bcs/effects.mjs +2 -1
  7. package/dist/bcs/effects.mjs.map +1 -1
  8. package/dist/bcs/index.d.mts +137 -41
  9. package/dist/bcs/index.d.mts.map +1 -1
  10. package/dist/bcs/transactions.mjs +2 -1
  11. package/dist/bcs/transactions.mjs.map +1 -1
  12. package/dist/client/transaction-resolver.mjs +45 -9
  13. package/dist/client/transaction-resolver.mjs.map +1 -1
  14. package/dist/cryptography/signature.d.mts +14 -14
  15. package/dist/grpc/proto/sui/forking/v1alpha/forking_service.client.d.mts +4 -4
  16. package/dist/grpc/proto/sui/rpc/v2/execution_status.d.mts +9 -1
  17. package/dist/grpc/proto/sui/rpc/v2/execution_status.d.mts.map +1 -1
  18. package/dist/grpc/proto/sui/rpc/v2/execution_status.mjs +8 -0
  19. package/dist/grpc/proto/sui/rpc/v2/execution_status.mjs.map +1 -1
  20. package/dist/grpc/proto/sui/rpc/v2/ledger_service.client.d.mts +4 -4
  21. package/dist/grpc/proto/sui/rpc/v2/move_package_service.client.d.mts +4 -4
  22. package/dist/grpc/proto/sui/rpc/v2/name_service.client.d.mts +4 -4
  23. package/dist/grpc/proto/sui/rpc/v2/signature_verification_service.client.d.mts +4 -4
  24. package/dist/grpc/proto/sui/rpc/v2/state_service.client.d.mts +4 -4
  25. package/dist/grpc/proto/sui/rpc/v2/subscription_service.client.d.mts +4 -4
  26. package/dist/grpc/proto/sui/rpc/v2/transaction.d.mts +50 -2
  27. package/dist/grpc/proto/sui/rpc/v2/transaction.d.mts.map +1 -1
  28. package/dist/grpc/proto/sui/rpc/v2/transaction.mjs +36 -1
  29. package/dist/grpc/proto/sui/rpc/v2/transaction.mjs.map +1 -1
  30. package/dist/grpc/proto/types.d.mts +2 -2
  31. package/dist/grpc/proto/types.mjs +2 -1
  32. package/dist/transactions/Transaction.d.mts +21 -9
  33. package/dist/transactions/Transaction.d.mts.map +1 -1
  34. package/dist/transactions/data/internal.d.mts +133 -109
  35. package/dist/transactions/data/internal.d.mts.map +1 -1
  36. package/dist/transactions/data/internal.mjs +11 -2
  37. package/dist/transactions/data/internal.mjs.map +1 -1
  38. package/dist/transactions/data/v1.d.mts +242 -220
  39. package/dist/transactions/data/v1.d.mts.map +1 -1
  40. package/dist/transactions/data/v1.mjs +27 -4
  41. package/dist/transactions/data/v1.mjs.map +1 -1
  42. package/dist/transactions/data/v2.d.mts +28 -16
  43. package/dist/transactions/data/v2.d.mts.map +1 -1
  44. package/dist/transactions/data/v2.mjs +3 -2
  45. package/dist/transactions/data/v2.mjs.map +1 -1
  46. package/dist/version.mjs +1 -1
  47. package/dist/version.mjs.map +1 -1
  48. package/dist/zklogin/bcs.d.mts +14 -14
  49. package/package.json +1 -1
  50. package/src/bcs/bcs.ts +45 -0
  51. package/src/bcs/effects.ts +3 -0
  52. package/src/bcs/transactions.ts +1 -0
  53. package/src/bcs/types.ts +10 -1
  54. package/src/client/transaction-resolver.ts +79 -9
  55. package/src/grpc/proto/sui/rpc/v2/execution_status.ts +8 -0
  56. package/src/grpc/proto/sui/rpc/v2/transaction.ts +68 -0
  57. package/src/transactions/data/internal.ts +19 -0
  58. package/src/transactions/data/v1.ts +51 -12
  59. package/src/transactions/data/v2.ts +2 -0
  60. package/src/version.ts +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # @mysten/sui.js
2
2
 
3
+ ## 2.28.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 5c16cf4: Add BCS, transaction schema, and gRPC support for `Validity` transaction expirations and
8
+ allowed proposers. Also synchronize recently added transaction and execution error variants.
9
+
10
+ The deprecated v1 JSON transaction format now represents `ValidDuring` and `Validity` expirations
11
+ instead of collapsing them to `{ None: true }`. Previously a `Transaction.serialize()` ->
12
+ `Transaction.from()` round trip silently discarded the expiration — and, for `Validity`, the set
13
+ of validators allowed to propose the transaction — so the rebuilt transaction signed materially
14
+ broader bytes. An expiration the v1 reader does not recognize is now an error rather than a silent
15
+ downgrade.
16
+
3
17
  ## 2.27.1
4
18
 
5
19
  ### Patch Changes
@@ -1,21 +1,21 @@
1
1
  import { TypeTag as TypeTag$1 } from "./types.mjs";
2
- import * as _mysten_bcs1226 from "@mysten/bcs";
2
+ import * as _mysten_bcs1258 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): _mysten_bcs1226.BcsStruct<{
8
- intent: _mysten_bcs1226.BcsStruct<{
9
- scope: _mysten_bcs1226.BcsEnum<{
7
+ declare function IntentMessage<T extends BcsType<any>>(T: T): _mysten_bcs1258.BcsStruct<{
8
+ intent: _mysten_bcs1258.BcsStruct<{
9
+ scope: _mysten_bcs1258.BcsEnum<{
10
10
  TransactionData: null;
11
11
  TransactionEffects: null;
12
12
  CheckpointSummary: null;
13
13
  PersonalMessage: null;
14
14
  }, "IntentScope">;
15
- version: _mysten_bcs1226.BcsEnum<{
15
+ version: _mysten_bcs1258.BcsEnum<{
16
16
  V0: null;
17
17
  }, "IntentVersion">;
18
- appId: _mysten_bcs1226.BcsEnum<{
18
+ appId: _mysten_bcs1258.BcsEnum<{
19
19
  Sui: null;
20
20
  }, "AppId">;
21
21
  }, string>;
@@ -1 +1 @@
1
- {"version":3,"file":"bcs.d.mts","names":[],"sources":["../../src/bcs/bcs.ts"],"mappings":";;;;;cAoIa,OAAA,EAAO,OAAA,kBAAA,SAAA;AAAA,iBAqJJ,aAAA,WAAwB,OAAA,MAAA,CAAc,CAAA,EAAG,CAAA,mBAAC,SAAA;;WAAA,eAAA,CAAA,OAAA"}
1
+ {"version":3,"file":"bcs.d.mts","names":[],"sources":["../../src/bcs/bcs.ts"],"mappings":";;;;;cAoIa,OAAA,EAAO,OAAA,kBAAA,SAAA;AAAA,iBAkMJ,aAAA,WAAwB,OAAA,MAAA,CAAc,CAAA,EAAG,CAAA,mBAAC,SAAA;;WAAA,eAAA,CAAA,OAAA"}
package/dist/bcs/bcs.mjs CHANGED
@@ -158,10 +158,37 @@ const ValidDuring = bcs.struct("ValidDuring", {
158
158
  chain: ObjectDigest,
159
159
  nonce: bcs.u32()
160
160
  });
161
+ function assertAllowedProposersNotEmpty(proposers) {
162
+ if (proposers.length === 0) throw new Error("Allowed proposers must not be empty");
163
+ return proposers;
164
+ }
165
+ function assertAllowedProposersStrictlyIncreasing(proposers) {
166
+ assertAllowedProposersNotEmpty(proposers);
167
+ for (let i = 1; i < proposers.length; i++) if (proposers[i] <= proposers[i - 1]) throw new Error("Allowed proposers must be strictly increasing");
168
+ return proposers;
169
+ }
170
+ const AllowedProposerIndices = bcs.vector(bcs.u32()).transform({
171
+ input: assertAllowedProposersStrictlyIncreasing,
172
+ output: assertAllowedProposersNotEmpty
173
+ });
174
+ const AllowedProposers = bcs.struct("AllowedProposers", {
175
+ epoch: bcs.u64(),
176
+ proposers: AllowedProposerIndices
177
+ });
178
+ const Validity = bcs.struct("Validity", {
179
+ minEpoch: bcs.option(bcs.u64()),
180
+ maxEpoch: bcs.option(bcs.u64()),
181
+ minTimestamp: bcs.option(bcs.u64()),
182
+ maxTimestamp: bcs.option(bcs.u64()),
183
+ chain: ObjectDigest,
184
+ nonce: bcs.u32(),
185
+ allowedProposers: bcs.option(AllowedProposers)
186
+ });
161
187
  const TransactionExpiration = bcs.enum("TransactionExpiration", {
162
188
  None: null,
163
189
  Epoch: unsafe_u64(),
164
- ValidDuring
190
+ ValidDuring,
191
+ Validity
165
192
  });
166
193
  const StructTag = bcs.struct("StructTag", {
167
194
  address: Address,
@@ -271,5 +298,5 @@ const ObjectInner = bcs.struct("ObjectInner", {
271
298
  });
272
299
 
273
300
  //#endregion
274
- export { Address, AppId, Argument, CallArg, Command, CompressedSignature, Data, GasData, Intent, IntentMessage, IntentScope, IntentVersion, MoveObject, MoveObjectType, MovePackage, MultiSig, MultiSigPkMap, MultiSigPublicKey, ObjectArg, ObjectDigest, ObjectInner, Owner, PasskeyAuthenticator, ProgrammableMoveCall, ProgrammableTransaction, PublicKey, SharedObjectRef, StructTag, SuiObjectRef, TransactionExpiration, TypeOrigin, TypeTag, UpgradeInfo, base64String };
301
+ export { Address, AppId, Argument, CallArg, Command, CompressedSignature, Data, GasData, Intent, IntentMessage, IntentScope, IntentVersion, MoveObject, MoveObjectType, MovePackage, MultiSig, MultiSigPkMap, MultiSigPublicKey, ObjectArg, ObjectDigest, ObjectInner, Owner, PasskeyAuthenticator, ProgrammableMoveCall, ProgrammableTransaction, PublicKey, SharedObjectRef, StructTag, SuiObjectRef, TransactionExpiration, TypeOrigin, TypeTag, UpgradeInfo, assertAllowedProposersNotEmpty, assertAllowedProposersStrictlyIncreasing, base64String };
275
302
  //# sourceMappingURL=bcs.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"bcs.mjs","names":[],"sources":["../../src/bcs/bcs.ts"],"sourcesContent":["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { BcsType, BcsTypeOptions } from '@mysten/bcs';\nimport { bcs, fromBase58, fromBase64, fromHex, toBase58, toBase64, toHex } from '@mysten/bcs';\n\nimport { isValidSuiAddress, normalizeSuiAddress, SUI_ADDRESS_LENGTH } from '../utils/sui-types.js';\nimport { TypeTagSerializer } from './type-tag-serializer.js';\nimport type { TypeTag as TypeTagType } from './types.js';\n\nfunction unsafe_u64(options?: BcsTypeOptions<number>) {\n\treturn bcs\n\t\t.u64({\n\t\t\tname: 'unsafe_u64',\n\t\t\t...(options as object),\n\t\t})\n\t\t.transform({\n\t\t\tinput: (val: number | string) => val,\n\t\t\toutput: (val) => Number(val),\n\t\t});\n}\n\nfunction optionEnum<T extends BcsType<any, any>>(type: T) {\n\treturn bcs.enum('Option', {\n\t\tNone: null,\n\t\tSome: type,\n\t});\n}\n\nexport const Address = bcs.bytes(SUI_ADDRESS_LENGTH).transform({\n\tvalidate: (val) => {\n\t\tconst address = typeof val === 'string' ? val : toHex(val);\n\t\tif (!address || !isValidSuiAddress(normalizeSuiAddress(address))) {\n\t\t\tthrow new Error(`Invalid Sui address ${address}`);\n\t\t}\n\t},\n\tinput: (val: string | Uint8Array) =>\n\t\ttypeof val === 'string' ? fromHex(normalizeSuiAddress(val)) : val,\n\toutput: (val) => normalizeSuiAddress(toHex(val)),\n});\n\nexport const ObjectDigest = bcs.byteVector().transform({\n\tname: 'ObjectDigest',\n\tinput: (value: string) => fromBase58(value),\n\toutput: (value) => toBase58(new Uint8Array(value)),\n\tvalidate: (value) => {\n\t\tif (fromBase58(value).length !== 32) {\n\t\t\tthrow new Error('ObjectDigest must be 32 bytes');\n\t\t}\n\t},\n});\n\nexport const SuiObjectRef = bcs.struct('SuiObjectRef', {\n\tobjectId: Address,\n\tversion: bcs.u64(),\n\tdigest: ObjectDigest,\n});\n\nexport const SharedObjectRef = bcs.struct('SharedObjectRef', {\n\tobjectId: Address,\n\tinitialSharedVersion: bcs.u64(),\n\tmutable: bcs.bool(),\n});\n\nexport const ObjectArg = bcs.enum('ObjectArg', {\n\tImmOrOwnedObject: SuiObjectRef,\n\tSharedObject: SharedObjectRef,\n\tReceiving: SuiObjectRef,\n});\n\n// Rust: crates/sui-types/src/object.rs\nexport const Owner = bcs.enum('Owner', {\n\tAddressOwner: Address,\n\tObjectOwner: Address,\n\tShared: bcs.struct('Shared', {\n\t\tinitialSharedVersion: bcs.u64(),\n\t}),\n\tImmutable: null,\n\tConsensusAddressOwner: bcs.struct('ConsensusAddressOwner', {\n\t\tstartVersion: bcs.u64(),\n\t\towner: Address,\n\t}),\n});\n\n// Rust: crates/sui-types/src/transaction.rs\nexport const Reservation = bcs.enum('Reservation', {\n\tMaxAmountU64: bcs.u64(),\n});\n\n// Rust: crates/sui-types/src/transaction.rs\nexport const WithdrawalType = bcs.enum('WithdrawalType', {\n\tBalance: bcs.lazy(() => TypeTag),\n});\n\n// Rust: crates/sui-types/src/transaction.rs\nexport const WithdrawFrom = bcs.enum('WithdrawFrom', {\n\tSender: null,\n\tSponsor: null,\n});\n\n// Rust: crates/sui-types/src/transaction.rs\nexport const FundsWithdrawal = bcs.struct('FundsWithdrawal', {\n\treservation: Reservation,\n\ttypeArg: WithdrawalType,\n\twithdrawFrom: WithdrawFrom,\n});\n\nexport const CallArg = bcs.enum('CallArg', {\n\tPure: bcs.struct('Pure', {\n\t\tbytes: bcs.byteVector().transform({\n\t\t\tinput: (val: string | Uint8Array) => (typeof val === 'string' ? fromBase64(val) : val),\n\t\t\toutput: (val) => toBase64(new Uint8Array(val)),\n\t\t}),\n\t}),\n\tObject: ObjectArg,\n\tFundsWithdrawal: FundsWithdrawal,\n});\n\nconst InnerTypeTag: BcsType<TypeTagType, TypeTagType> = bcs.enum('TypeTag', {\n\tbool: null,\n\tu8: null,\n\tu64: null,\n\tu128: null,\n\taddress: null,\n\tsigner: null,\n\tvector: bcs.lazy(() => InnerTypeTag),\n\tstruct: bcs.lazy(() => StructTag),\n\tu16: null,\n\tu32: null,\n\tu256: null,\n}) as BcsType<TypeTagType>;\n\nexport const TypeTag = InnerTypeTag.transform({\n\tinput: (typeTag: string | TypeTagType) =>\n\t\ttypeof typeTag === 'string' ? TypeTagSerializer.parseFromStr(typeTag, true) : typeTag,\n\toutput: (typeTag: TypeTagType) => TypeTagSerializer.tagToString(typeTag),\n});\n\nexport const Argument = bcs.enum('Argument', {\n\tGasCoin: null,\n\tInput: bcs.u16(),\n\tResult: bcs.u16(),\n\tNestedResult: bcs.tuple([bcs.u16(), bcs.u16()]),\n});\n\nexport const ProgrammableMoveCall = bcs.struct('ProgrammableMoveCall', {\n\tpackage: Address,\n\tmodule: bcs.string(),\n\tfunction: bcs.string(),\n\ttypeArguments: bcs.vector(TypeTag),\n\targuments: bcs.vector(Argument),\n});\n\nexport const Command = bcs.enum('Command', {\n\t/**\n\t * A Move Call - any public Move function can be called via\n\t * this transaction. The results can be used that instant to pass\n\t * into the next transaction.\n\t */\n\tMoveCall: ProgrammableMoveCall,\n\t/**\n\t * Transfer vector of objects to a receiver.\n\t */\n\tTransferObjects: bcs.struct('TransferObjects', {\n\t\tobjects: bcs.vector(Argument),\n\t\taddress: Argument,\n\t}),\n\t// /**\n\t// * Split `amount` from a `coin`.\n\t// */\n\tSplitCoins: bcs.struct('SplitCoins', {\n\t\tcoin: Argument,\n\t\tamounts: bcs.vector(Argument),\n\t}),\n\t// /**\n\t// * Merge Vector of Coins (`sources`) into a `destination`.\n\t// */\n\tMergeCoins: bcs.struct('MergeCoins', {\n\t\tdestination: Argument,\n\t\tsources: bcs.vector(Argument),\n\t}),\n\t// /**\n\t// * Publish a Move module.\n\t// */\n\tPublish: bcs.struct('Publish', {\n\t\tmodules: bcs.vector(\n\t\t\tbcs.byteVector().transform({\n\t\t\t\tinput: (val: string | Uint8Array) => (typeof val === 'string' ? fromBase64(val) : val),\n\t\t\t\toutput: (val) => toBase64(new Uint8Array(val)),\n\t\t\t}),\n\t\t),\n\t\tdependencies: bcs.vector(Address),\n\t}),\n\t// /**\n\t// * Build a vector of objects using the input arguments.\n\t// * It is impossible to export construct a `vector<T: key>` otherwise,\n\t// * so this call serves a utility function.\n\t// */\n\tMakeMoveVec: bcs.struct('MakeMoveVec', {\n\t\ttype: optionEnum(TypeTag).transform({\n\t\t\tinput: (val: string | null) =>\n\t\t\t\tval === null\n\t\t\t\t\t? {\n\t\t\t\t\t\t\tNone: true,\n\t\t\t\t\t\t}\n\t\t\t\t\t: {\n\t\t\t\t\t\t\tSome: val,\n\t\t\t\t\t\t},\n\t\t\toutput: (val) => val.Some ?? null,\n\t\t}),\n\t\telements: bcs.vector(Argument),\n\t}),\n\tUpgrade: bcs.struct('Upgrade', {\n\t\tmodules: bcs.vector(\n\t\t\tbcs.byteVector().transform({\n\t\t\t\tinput: (val: string | Uint8Array) => (typeof val === 'string' ? fromBase64(val) : val),\n\t\t\t\toutput: (val) => toBase64(new Uint8Array(val)),\n\t\t\t}),\n\t\t),\n\t\tdependencies: bcs.vector(Address),\n\t\tpackage: Address,\n\t\tticket: Argument,\n\t}),\n});\n\nexport const ProgrammableTransaction = bcs.struct('ProgrammableTransaction', {\n\tinputs: bcs.vector(CallArg),\n\tcommands: bcs.vector(Command),\n});\n\n// Rust: crates/sui-types/src/transaction.rs\nexport const ValidDuring = bcs.struct('ValidDuring', {\n\tminEpoch: bcs.option(bcs.u64()),\n\tmaxEpoch: bcs.option(bcs.u64()),\n\tminTimestamp: bcs.option(bcs.u64()),\n\tmaxTimestamp: bcs.option(bcs.u64()),\n\tchain: ObjectDigest,\n\tnonce: bcs.u32(),\n});\n\nexport const TransactionExpiration = bcs.enum('TransactionExpiration', {\n\tNone: null,\n\tEpoch: unsafe_u64(),\n\tValidDuring: ValidDuring,\n});\n\nexport const StructTag = bcs.struct('StructTag', {\n\taddress: Address,\n\tmodule: bcs.string(),\n\tname: bcs.string(),\n\ttypeParams: bcs.vector(InnerTypeTag),\n});\n\nexport const GasData = bcs.struct('GasData', {\n\tpayment: bcs.vector(SuiObjectRef),\n\towner: Address,\n\tprice: bcs.u64(),\n\tbudget: bcs.u64(),\n});\n\nexport const IntentScope = bcs.enum('IntentScope', {\n\tTransactionData: null,\n\tTransactionEffects: null,\n\tCheckpointSummary: null,\n\tPersonalMessage: null,\n});\n\nexport const IntentVersion = bcs.enum('IntentVersion', {\n\tV0: null,\n});\n\nexport const AppId = bcs.enum('AppId', {\n\tSui: null,\n});\n\nexport const Intent = bcs.struct('Intent', {\n\tscope: IntentScope,\n\tversion: IntentVersion,\n\tappId: AppId,\n});\n\nexport function IntentMessage<T extends BcsType<any>>(T: T) {\n\treturn bcs.struct(`IntentMessage<${T.name}>`, {\n\t\tintent: Intent,\n\t\tvalue: T,\n\t});\n}\n\nexport const CompressedSignature = bcs.enum('CompressedSignature', {\n\tED25519: bcs.bytes(64),\n\tSecp256k1: bcs.bytes(64),\n\tSecp256r1: bcs.bytes(64),\n\tZkLogin: bcs.byteVector(),\n\tPasskey: bcs.byteVector(),\n});\n\nexport const PublicKey = bcs.enum('PublicKey', {\n\tED25519: bcs.bytes(32),\n\tSecp256k1: bcs.bytes(33),\n\tSecp256r1: bcs.bytes(33),\n\tZkLogin: bcs.byteVector(),\n\tPasskey: bcs.bytes(33),\n});\n\nexport const MultiSigPkMap = bcs.struct('MultiSigPkMap', {\n\tpubKey: PublicKey,\n\tweight: bcs.u8(),\n});\n\nexport const MultiSigPublicKey = bcs.struct('MultiSigPublicKey', {\n\tpk_map: bcs.vector(MultiSigPkMap),\n\tthreshold: bcs.u16(),\n});\n\nexport const MultiSig = bcs.struct('MultiSig', {\n\tsigs: bcs.vector(CompressedSignature),\n\tbitmap: bcs.u16(),\n\tmultisig_pk: MultiSigPublicKey,\n});\n\nexport const base64String = bcs.byteVector().transform({\n\tinput: (val: string | Uint8Array) => (typeof val === 'string' ? fromBase64(val) : val),\n\toutput: (val) => toBase64(new Uint8Array(val)),\n});\n\nexport const PasskeyAuthenticator = bcs.struct('PasskeyAuthenticator', {\n\tauthenticatorData: bcs.byteVector(),\n\tclientDataJson: bcs.string(),\n\tuserSignature: bcs.byteVector(),\n});\n\n// Rust: crates/sui-types/src/object.rs\nexport const MoveObjectType = bcs.enum('MoveObjectType', {\n\tOther: StructTag,\n\tGasCoin: null,\n\tStakedSui: null,\n\tCoin: TypeTag,\n\tAccumulatorBalanceWrapper: null,\n});\n\n// Rust: crates/sui-types/src/object.rs\nexport const TypeOrigin = bcs.struct('TypeOrigin', {\n\tmoduleName: bcs.string(),\n\tdatatypeName: bcs.string(),\n\tpackage: Address,\n});\n\n// Rust: crates/sui-types/src/object.rs\nexport const UpgradeInfo = bcs.struct('UpgradeInfo', {\n\tupgradedId: Address,\n\tupgradedVersion: bcs.u64(),\n});\n\n// Rust: crates/sui-types/src/object.rs\nexport const MovePackage = bcs.struct('MovePackage', {\n\tid: Address,\n\tversion: bcs.u64(),\n\tmoduleMap: bcs.map(bcs.string(), bcs.byteVector()),\n\ttypeOriginTable: bcs.vector(TypeOrigin),\n\tlinkageTable: bcs.map(Address, UpgradeInfo),\n});\n\n// Rust: crates/sui-types/src/object.rs\nexport const MoveObject = bcs.struct('MoveObject', {\n\ttype: MoveObjectType,\n\thasPublicTransfer: bcs.bool(),\n\tversion: bcs.u64(),\n\tcontents: bcs.byteVector(),\n});\n\n// Rust: crates/sui-types/src/object.rs\nexport const Data = bcs.enum('Data', {\n\tMove: MoveObject,\n\tPackage: MovePackage,\n});\n\n// Rust: crates/sui-types/src/object.rs\nexport const ObjectInner = bcs.struct('ObjectInner', {\n\tdata: Data,\n\towner: Owner,\n\tpreviousTransaction: ObjectDigest,\n\tstorageRebate: bcs.u64(),\n});\n"],"mappings":";;;;;AAUA,SAAS,WAAW,SAAkC;AACrD,QAAO,IACL,IAAI;EACJ,MAAM;EACN,GAAI;EACJ,CAAC,CACD,UAAU;EACV,QAAQ,QAAyB;EACjC,SAAS,QAAQ,OAAO,IAAI;EAC5B,CAAC;;AAGJ,SAAS,WAAwC,MAAS;AACzD,QAAO,IAAI,KAAK,UAAU;EACzB,MAAM;EACN,MAAM;EACN,CAAC;;AAGH,MAAa,UAAU,IAAI,MAAM,mBAAmB,CAAC,UAAU;CAC9D,WAAW,QAAQ;EAClB,MAAM,UAAU,OAAO,QAAQ,WAAW,MAAM,MAAM,IAAI;AAC1D,MAAI,CAAC,WAAW,CAAC,kBAAkB,oBAAoB,QAAQ,CAAC,CAC/D,OAAM,IAAI,MAAM,uBAAuB,UAAU;;CAGnD,QAAQ,QACP,OAAO,QAAQ,WAAW,QAAQ,oBAAoB,IAAI,CAAC,GAAG;CAC/D,SAAS,QAAQ,oBAAoB,MAAM,IAAI,CAAC;CAChD,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":3,"file":"bcs.mjs","names":[],"sources":["../../src/bcs/bcs.ts"],"sourcesContent":["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { BcsType, BcsTypeOptions } from '@mysten/bcs';\nimport { bcs, fromBase58, fromBase64, fromHex, toBase58, toBase64, toHex } from '@mysten/bcs';\n\nimport { isValidSuiAddress, normalizeSuiAddress, SUI_ADDRESS_LENGTH } from '../utils/sui-types.js';\nimport { TypeTagSerializer } from './type-tag-serializer.js';\nimport type { TypeTag as TypeTagType } from './types.js';\n\nfunction unsafe_u64(options?: BcsTypeOptions<number>) {\n\treturn bcs\n\t\t.u64({\n\t\t\tname: 'unsafe_u64',\n\t\t\t...(options as object),\n\t\t})\n\t\t.transform({\n\t\t\tinput: (val: number | string) => val,\n\t\t\toutput: (val) => Number(val),\n\t\t});\n}\n\nfunction optionEnum<T extends BcsType<any, any>>(type: T) {\n\treturn bcs.enum('Option', {\n\t\tNone: null,\n\t\tSome: type,\n\t});\n}\n\nexport const Address = bcs.bytes(SUI_ADDRESS_LENGTH).transform({\n\tvalidate: (val) => {\n\t\tconst address = typeof val === 'string' ? val : toHex(val);\n\t\tif (!address || !isValidSuiAddress(normalizeSuiAddress(address))) {\n\t\t\tthrow new Error(`Invalid Sui address ${address}`);\n\t\t}\n\t},\n\tinput: (val: string | Uint8Array) =>\n\t\ttypeof val === 'string' ? fromHex(normalizeSuiAddress(val)) : val,\n\toutput: (val) => normalizeSuiAddress(toHex(val)),\n});\n\nexport const ObjectDigest = bcs.byteVector().transform({\n\tname: 'ObjectDigest',\n\tinput: (value: string) => fromBase58(value),\n\toutput: (value) => toBase58(new Uint8Array(value)),\n\tvalidate: (value) => {\n\t\tif (fromBase58(value).length !== 32) {\n\t\t\tthrow new Error('ObjectDigest must be 32 bytes');\n\t\t}\n\t},\n});\n\nexport const SuiObjectRef = bcs.struct('SuiObjectRef', {\n\tobjectId: Address,\n\tversion: bcs.u64(),\n\tdigest: ObjectDigest,\n});\n\nexport const SharedObjectRef = bcs.struct('SharedObjectRef', {\n\tobjectId: Address,\n\tinitialSharedVersion: bcs.u64(),\n\tmutable: bcs.bool(),\n});\n\nexport const ObjectArg = bcs.enum('ObjectArg', {\n\tImmOrOwnedObject: SuiObjectRef,\n\tSharedObject: SharedObjectRef,\n\tReceiving: SuiObjectRef,\n});\n\n// Rust: crates/sui-types/src/object.rs\nexport const Owner = bcs.enum('Owner', {\n\tAddressOwner: Address,\n\tObjectOwner: Address,\n\tShared: bcs.struct('Shared', {\n\t\tinitialSharedVersion: bcs.u64(),\n\t}),\n\tImmutable: null,\n\tConsensusAddressOwner: bcs.struct('ConsensusAddressOwner', {\n\t\tstartVersion: bcs.u64(),\n\t\towner: Address,\n\t}),\n});\n\n// Rust: crates/sui-types/src/transaction.rs\nexport const Reservation = bcs.enum('Reservation', {\n\tMaxAmountU64: bcs.u64(),\n});\n\n// Rust: crates/sui-types/src/transaction.rs\nexport const WithdrawalType = bcs.enum('WithdrawalType', {\n\tBalance: bcs.lazy(() => TypeTag),\n});\n\n// Rust: crates/sui-types/src/transaction.rs\nexport const WithdrawFrom = bcs.enum('WithdrawFrom', {\n\tSender: null,\n\tSponsor: null,\n});\n\n// Rust: crates/sui-types/src/transaction.rs\nexport const FundsWithdrawal = bcs.struct('FundsWithdrawal', {\n\treservation: Reservation,\n\ttypeArg: WithdrawalType,\n\twithdrawFrom: WithdrawFrom,\n});\n\nexport const CallArg = bcs.enum('CallArg', {\n\tPure: bcs.struct('Pure', {\n\t\tbytes: bcs.byteVector().transform({\n\t\t\tinput: (val: string | Uint8Array) => (typeof val === 'string' ? fromBase64(val) : val),\n\t\t\toutput: (val) => toBase64(new Uint8Array(val)),\n\t\t}),\n\t}),\n\tObject: ObjectArg,\n\tFundsWithdrawal: FundsWithdrawal,\n});\n\nconst InnerTypeTag: BcsType<TypeTagType, TypeTagType> = bcs.enum('TypeTag', {\n\tbool: null,\n\tu8: null,\n\tu64: null,\n\tu128: null,\n\taddress: null,\n\tsigner: null,\n\tvector: bcs.lazy(() => InnerTypeTag),\n\tstruct: bcs.lazy(() => StructTag),\n\tu16: null,\n\tu32: null,\n\tu256: null,\n}) as BcsType<TypeTagType>;\n\nexport const TypeTag = InnerTypeTag.transform({\n\tinput: (typeTag: string | TypeTagType) =>\n\t\ttypeof typeTag === 'string' ? TypeTagSerializer.parseFromStr(typeTag, true) : typeTag,\n\toutput: (typeTag: TypeTagType) => TypeTagSerializer.tagToString(typeTag),\n});\n\nexport const Argument = bcs.enum('Argument', {\n\tGasCoin: null,\n\tInput: bcs.u16(),\n\tResult: bcs.u16(),\n\tNestedResult: bcs.tuple([bcs.u16(), bcs.u16()]),\n});\n\nexport const ProgrammableMoveCall = bcs.struct('ProgrammableMoveCall', {\n\tpackage: Address,\n\tmodule: bcs.string(),\n\tfunction: bcs.string(),\n\ttypeArguments: bcs.vector(TypeTag),\n\targuments: bcs.vector(Argument),\n});\n\nexport const Command = bcs.enum('Command', {\n\t/**\n\t * A Move Call - any public Move function can be called via\n\t * this transaction. The results can be used that instant to pass\n\t * into the next transaction.\n\t */\n\tMoveCall: ProgrammableMoveCall,\n\t/**\n\t * Transfer vector of objects to a receiver.\n\t */\n\tTransferObjects: bcs.struct('TransferObjects', {\n\t\tobjects: bcs.vector(Argument),\n\t\taddress: Argument,\n\t}),\n\t// /**\n\t// * Split `amount` from a `coin`.\n\t// */\n\tSplitCoins: bcs.struct('SplitCoins', {\n\t\tcoin: Argument,\n\t\tamounts: bcs.vector(Argument),\n\t}),\n\t// /**\n\t// * Merge Vector of Coins (`sources`) into a `destination`.\n\t// */\n\tMergeCoins: bcs.struct('MergeCoins', {\n\t\tdestination: Argument,\n\t\tsources: bcs.vector(Argument),\n\t}),\n\t// /**\n\t// * Publish a Move module.\n\t// */\n\tPublish: bcs.struct('Publish', {\n\t\tmodules: bcs.vector(\n\t\t\tbcs.byteVector().transform({\n\t\t\t\tinput: (val: string | Uint8Array) => (typeof val === 'string' ? fromBase64(val) : val),\n\t\t\t\toutput: (val) => toBase64(new Uint8Array(val)),\n\t\t\t}),\n\t\t),\n\t\tdependencies: bcs.vector(Address),\n\t}),\n\t// /**\n\t// * Build a vector of objects using the input arguments.\n\t// * It is impossible to export construct a `vector<T: key>` otherwise,\n\t// * so this call serves a utility function.\n\t// */\n\tMakeMoveVec: bcs.struct('MakeMoveVec', {\n\t\ttype: optionEnum(TypeTag).transform({\n\t\t\tinput: (val: string | null) =>\n\t\t\t\tval === null\n\t\t\t\t\t? {\n\t\t\t\t\t\t\tNone: true,\n\t\t\t\t\t\t}\n\t\t\t\t\t: {\n\t\t\t\t\t\t\tSome: val,\n\t\t\t\t\t\t},\n\t\t\toutput: (val) => val.Some ?? null,\n\t\t}),\n\t\telements: bcs.vector(Argument),\n\t}),\n\tUpgrade: bcs.struct('Upgrade', {\n\t\tmodules: bcs.vector(\n\t\t\tbcs.byteVector().transform({\n\t\t\t\tinput: (val: string | Uint8Array) => (typeof val === 'string' ? fromBase64(val) : val),\n\t\t\t\toutput: (val) => toBase64(new Uint8Array(val)),\n\t\t\t}),\n\t\t),\n\t\tdependencies: bcs.vector(Address),\n\t\tpackage: Address,\n\t\tticket: Argument,\n\t}),\n});\n\nexport const ProgrammableTransaction = bcs.struct('ProgrammableTransaction', {\n\tinputs: bcs.vector(CallArg),\n\tcommands: bcs.vector(Command),\n});\n\n// Rust: crates/sui-types/src/transaction.rs\nexport const ValidDuring = bcs.struct('ValidDuring', {\n\tminEpoch: bcs.option(bcs.u64()),\n\tmaxEpoch: bcs.option(bcs.u64()),\n\tminTimestamp: bcs.option(bcs.u64()),\n\tmaxTimestamp: bcs.option(bcs.u64()),\n\tchain: ObjectDigest,\n\tnonce: bcs.u32(),\n});\n\nexport function assertAllowedProposersNotEmpty(proposers: number[]) {\n\tif (proposers.length === 0) {\n\t\tthrow new Error('Allowed proposers must not be empty');\n\t}\n\n\treturn proposers;\n}\n\nexport function assertAllowedProposersStrictlyIncreasing(proposers: number[]) {\n\tassertAllowedProposersNotEmpty(proposers);\n\n\tfor (let i = 1; i < proposers.length; i++) {\n\t\tif (proposers[i] <= proposers[i - 1]) {\n\t\t\tthrow new Error('Allowed proposers must be strictly increasing');\n\t\t}\n\t}\n\n\treturn proposers;\n}\n\n// Upstream only checks sortedness in `validity_check`, on submission, so decoding an unsorted\n// set must succeed. Empty is a deserialization error there, and here.\nconst AllowedProposerIndices = bcs.vector(bcs.u32()).transform({\n\tinput: assertAllowedProposersStrictlyIncreasing,\n\toutput: assertAllowedProposersNotEmpty,\n});\n\n// Rust: crates/sui-types/src/transaction.rs\nexport const AllowedProposers = bcs.struct('AllowedProposers', {\n\tepoch: bcs.u64(),\n\tproposers: AllowedProposerIndices,\n});\n\n// Rust: crates/sui-types/src/transaction.rs\nexport const Validity = bcs.struct('Validity', {\n\tminEpoch: bcs.option(bcs.u64()),\n\tmaxEpoch: bcs.option(bcs.u64()),\n\tminTimestamp: bcs.option(bcs.u64()),\n\tmaxTimestamp: bcs.option(bcs.u64()),\n\tchain: ObjectDigest,\n\tnonce: bcs.u32(),\n\tallowedProposers: bcs.option(AllowedProposers),\n});\n\nexport const TransactionExpiration = bcs.enum('TransactionExpiration', {\n\tNone: null,\n\tEpoch: unsafe_u64(),\n\tValidDuring: ValidDuring,\n\tValidity,\n});\n\nexport const StructTag = bcs.struct('StructTag', {\n\taddress: Address,\n\tmodule: bcs.string(),\n\tname: bcs.string(),\n\ttypeParams: bcs.vector(InnerTypeTag),\n});\n\nexport const GasData = bcs.struct('GasData', {\n\tpayment: bcs.vector(SuiObjectRef),\n\towner: Address,\n\tprice: bcs.u64(),\n\tbudget: bcs.u64(),\n});\n\nexport const IntentScope = bcs.enum('IntentScope', {\n\tTransactionData: null,\n\tTransactionEffects: null,\n\tCheckpointSummary: null,\n\tPersonalMessage: null,\n});\n\nexport const IntentVersion = bcs.enum('IntentVersion', {\n\tV0: null,\n});\n\nexport const AppId = bcs.enum('AppId', {\n\tSui: null,\n});\n\nexport const Intent = bcs.struct('Intent', {\n\tscope: IntentScope,\n\tversion: IntentVersion,\n\tappId: AppId,\n});\n\nexport function IntentMessage<T extends BcsType<any>>(T: T) {\n\treturn bcs.struct(`IntentMessage<${T.name}>`, {\n\t\tintent: Intent,\n\t\tvalue: T,\n\t});\n}\n\nexport const CompressedSignature = bcs.enum('CompressedSignature', {\n\tED25519: bcs.bytes(64),\n\tSecp256k1: bcs.bytes(64),\n\tSecp256r1: bcs.bytes(64),\n\tZkLogin: bcs.byteVector(),\n\tPasskey: bcs.byteVector(),\n});\n\nexport const PublicKey = bcs.enum('PublicKey', {\n\tED25519: bcs.bytes(32),\n\tSecp256k1: bcs.bytes(33),\n\tSecp256r1: bcs.bytes(33),\n\tZkLogin: bcs.byteVector(),\n\tPasskey: bcs.bytes(33),\n});\n\nexport const MultiSigPkMap = bcs.struct('MultiSigPkMap', {\n\tpubKey: PublicKey,\n\tweight: bcs.u8(),\n});\n\nexport const MultiSigPublicKey = bcs.struct('MultiSigPublicKey', {\n\tpk_map: bcs.vector(MultiSigPkMap),\n\tthreshold: bcs.u16(),\n});\n\nexport const MultiSig = bcs.struct('MultiSig', {\n\tsigs: bcs.vector(CompressedSignature),\n\tbitmap: bcs.u16(),\n\tmultisig_pk: MultiSigPublicKey,\n});\n\nexport const base64String = bcs.byteVector().transform({\n\tinput: (val: string | Uint8Array) => (typeof val === 'string' ? fromBase64(val) : val),\n\toutput: (val) => toBase64(new Uint8Array(val)),\n});\n\nexport const PasskeyAuthenticator = bcs.struct('PasskeyAuthenticator', {\n\tauthenticatorData: bcs.byteVector(),\n\tclientDataJson: bcs.string(),\n\tuserSignature: bcs.byteVector(),\n});\n\n// Rust: crates/sui-types/src/object.rs\nexport const MoveObjectType = bcs.enum('MoveObjectType', {\n\tOther: StructTag,\n\tGasCoin: null,\n\tStakedSui: null,\n\tCoin: TypeTag,\n\tAccumulatorBalanceWrapper: null,\n});\n\n// Rust: crates/sui-types/src/object.rs\nexport const TypeOrigin = bcs.struct('TypeOrigin', {\n\tmoduleName: bcs.string(),\n\tdatatypeName: bcs.string(),\n\tpackage: Address,\n});\n\n// Rust: crates/sui-types/src/object.rs\nexport const UpgradeInfo = bcs.struct('UpgradeInfo', {\n\tupgradedId: Address,\n\tupgradedVersion: bcs.u64(),\n});\n\n// Rust: crates/sui-types/src/object.rs\nexport const MovePackage = bcs.struct('MovePackage', {\n\tid: Address,\n\tversion: bcs.u64(),\n\tmoduleMap: bcs.map(bcs.string(), bcs.byteVector()),\n\ttypeOriginTable: bcs.vector(TypeOrigin),\n\tlinkageTable: bcs.map(Address, UpgradeInfo),\n});\n\n// Rust: crates/sui-types/src/object.rs\nexport const MoveObject = bcs.struct('MoveObject', {\n\ttype: MoveObjectType,\n\thasPublicTransfer: bcs.bool(),\n\tversion: bcs.u64(),\n\tcontents: bcs.byteVector(),\n});\n\n// Rust: crates/sui-types/src/object.rs\nexport const Data = bcs.enum('Data', {\n\tMove: MoveObject,\n\tPackage: MovePackage,\n});\n\n// Rust: crates/sui-types/src/object.rs\nexport const ObjectInner = bcs.struct('ObjectInner', {\n\tdata: Data,\n\towner: Owner,\n\tpreviousTransaction: ObjectDigest,\n\tstorageRebate: bcs.u64(),\n});\n"],"mappings":";;;;;AAUA,SAAS,WAAW,SAAkC;AACrD,QAAO,IACL,IAAI;EACJ,MAAM;EACN,GAAI;EACJ,CAAC,CACD,UAAU;EACV,QAAQ,QAAyB;EACjC,SAAS,QAAQ,OAAO,IAAI;EAC5B,CAAC;;AAGJ,SAAS,WAAwC,MAAS;AACzD,QAAO,IAAI,KAAK,UAAU;EACzB,MAAM;EACN,MAAM;EACN,CAAC;;AAGH,MAAa,UAAU,IAAI,MAAM,mBAAmB,CAAC,UAAU;CAC9D,WAAW,QAAQ;EAClB,MAAM,UAAU,OAAO,QAAQ,WAAW,MAAM,MAAM,IAAI;AAC1D,MAAI,CAAC,WAAW,CAAC,kBAAkB,oBAAoB,QAAQ,CAAC,CAC/D,OAAM,IAAI,MAAM,uBAAuB,UAAU;;CAGnD,QAAQ,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,IAAI,YAAY;CAC/B,CAAC;AAGF,MAAa,iBAAiB,IAAI,KAAK,kBAAkB;CACxD,OAAO;CACP,SAAS;CACT,WAAW;CACX,MAAM;CACN,2BAA2B;CAC3B,CAAC;AAGF,MAAa,aAAa,IAAI,OAAO,cAAc;CAClD,YAAY,IAAI,QAAQ;CACxB,cAAc,IAAI,QAAQ;CAC1B,SAAS;CACT,CAAC;AAGF,MAAa,cAAc,IAAI,OAAO,eAAe;CACpD,YAAY;CACZ,iBAAiB,IAAI,KAAK;CAC1B,CAAC;AAGF,MAAa,cAAc,IAAI,OAAO,eAAe;CACpD,IAAI;CACJ,SAAS,IAAI,KAAK;CAClB,WAAW,IAAI,IAAI,IAAI,QAAQ,EAAE,IAAI,YAAY,CAAC;CAClD,iBAAiB,IAAI,OAAO,WAAW;CACvC,cAAc,IAAI,IAAI,SAAS,YAAY;CAC3C,CAAC;AAGF,MAAa,aAAa,IAAI,OAAO,cAAc;CAClD,MAAM;CACN,mBAAmB,IAAI,MAAM;CAC7B,SAAS,IAAI,KAAK;CAClB,UAAU,IAAI,YAAY;CAC1B,CAAC;AAGF,MAAa,OAAO,IAAI,KAAK,QAAQ;CACpC,MAAM;CACN,SAAS;CACT,CAAC;AAGF,MAAa,cAAc,IAAI,OAAO,eAAe;CACpD,MAAM;CACN,OAAO;CACP,qBAAqB;CACrB,eAAe,IAAI,KAAK;CACxB,CAAC"}
@@ -45,7 +45,8 @@ const CommandArgumentError = bcs.enum("CommandArgumentError", {
45
45
  ArgumentWithoutValue: null,
46
46
  CannotMoveBorrowedValue: null,
47
47
  CannotWriteToExtendedReference: null,
48
- InvalidReferenceArgument: null
48
+ InvalidReferenceArgument: null,
49
+ InvalidTxContext: null
49
50
  });
50
51
  const TypeArgumentError = bcs.enum("TypeArgumentError", {
51
52
  TypeNotFound: null,
@@ -1 +1 @@
1
- {"version":3,"file":"effects.mjs","names":[],"sources":["../../src/bcs/effects.ts"],"sourcesContent":["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { bcs } from '@mysten/bcs';\n\nimport { Address, ObjectDigest, Owner, SuiObjectRef, TypeTag } from './bcs.js';\n\n// Rust: crates/sui-types/src/execution_status.rs (PackageUpgradeError enum)\nconst PackageUpgradeError = bcs.enum('PackageUpgradeError', {\n\tUnableToFetchPackage: bcs.struct('UnableToFetchPackage', { packageId: Address }),\n\tNotAPackage: bcs.struct('NotAPackage', { objectId: Address }),\n\tIncompatibleUpgrade: null,\n\tDigestDoesNotMatch: bcs.struct('DigestDoesNotMatch', { digest: bcs.byteVector() }),\n\tUnknownUpgradePolicy: bcs.struct('UnknownUpgradePolicy', { policy: bcs.u8() }),\n\tPackageIDDoesNotMatch: bcs.struct('PackageIDDoesNotMatch', {\n\t\tpackageId: Address,\n\t\tticketId: Address,\n\t}),\n});\n\n// Rust: move-core-types/src/language_storage.rs\nconst ModuleId = bcs.struct('ModuleId', {\n\taddress: Address,\n\tname: bcs.string(),\n});\n// Rust: crates/sui-types/src/execution_status.rs\nconst MoveLocation = bcs.struct('MoveLocation', {\n\tmodule: ModuleId,\n\tfunction: bcs.u16(),\n\tinstruction: bcs.u16(),\n\tfunctionName: bcs.option(bcs.string()),\n});\n\n// Rust: crates/sui-types/src/execution_status.rs\nconst CommandArgumentError = bcs.enum('CommandArgumentError', {\n\tTypeMismatch: null,\n\tInvalidBCSBytes: null,\n\tInvalidUsageOfPureArg: null,\n\tInvalidArgumentToPrivateEntryFunction: null,\n\tIndexOutOfBounds: bcs.struct('IndexOutOfBounds', { idx: bcs.u16() }),\n\tSecondaryIndexOutOfBounds: bcs.struct('SecondaryIndexOutOfBounds', {\n\t\tresultIdx: bcs.u16(),\n\t\tsecondaryIdx: bcs.u16(),\n\t}),\n\tInvalidResultArity: bcs.struct('InvalidResultArity', { resultIdx: bcs.u16() }),\n\tInvalidGasCoinUsage: null,\n\tInvalidValueUsage: null,\n\tInvalidObjectByValue: null,\n\tInvalidObjectByMutRef: null,\n\tSharedObjectOperationNotAllowed: null,\n\tInvalidArgumentArity: null,\n\tInvalidTransferObject: null,\n\tInvalidMakeMoveVecNonObjectArgument: null,\n\tArgumentWithoutValue: null,\n\tCannotMoveBorrowedValue: null,\n\tCannotWriteToExtendedReference: null,\n\tInvalidReferenceArgument: null,\n});\n\n// Rust: crates/sui-types/src/execution_status.rs\nconst TypeArgumentError = bcs.enum('TypeArgumentError', {\n\tTypeNotFound: null,\n\tConstraintNotSatisfied: null,\n});\n\n// Rust: crates/sui-types/src/execution_status.rs\nconst ExecutionFailureStatus = bcs.enum('ExecutionFailureStatus', {\n\tInsufficientGas: null,\n\tInvalidGasObject: null,\n\tInvariantViolation: null,\n\tFeatureNotYetSupported: null,\n\tMoveObjectTooBig: bcs.struct('MoveObjectTooBig', {\n\t\tobjectSize: bcs.u64(),\n\t\tmaxObjectSize: bcs.u64(),\n\t}),\n\tMovePackageTooBig: bcs.struct('MovePackageTooBig', {\n\t\tobjectSize: bcs.u64(),\n\t\tmaxObjectSize: bcs.u64(),\n\t}),\n\tCircularObjectOwnership: bcs.struct('CircularObjectOwnership', { object: Address }),\n\tInsufficientCoinBalance: null,\n\tCoinBalanceOverflow: null,\n\tPublishErrorNonZeroAddress: null,\n\tSuiMoveVerificationError: null,\n\tMovePrimitiveRuntimeError: bcs.option(MoveLocation),\n\tMoveAbort: bcs.tuple([MoveLocation, bcs.u64()]),\n\tVMVerificationOrDeserializationError: null,\n\tVMInvariantViolation: null,\n\tFunctionNotFound: null,\n\tArityMismatch: null,\n\tTypeArityMismatch: null,\n\tNonEntryFunctionInvoked: null,\n\tCommandArgumentError: bcs.struct('CommandArgumentError', {\n\t\targIdx: bcs.u16(),\n\t\tkind: CommandArgumentError,\n\t}),\n\tTypeArgumentError: bcs.struct('TypeArgumentError', {\n\t\targumentIdx: bcs.u16(),\n\t\tkind: TypeArgumentError,\n\t}),\n\tUnusedValueWithoutDrop: bcs.struct('UnusedValueWithoutDrop', {\n\t\tresultIdx: bcs.u16(),\n\t\tsecondaryIdx: bcs.u16(),\n\t}),\n\tInvalidPublicFunctionReturnType: bcs.struct('InvalidPublicFunctionReturnType', {\n\t\tidx: bcs.u16(),\n\t}),\n\tInvalidTransferObject: null,\n\tEffectsTooLarge: bcs.struct('EffectsTooLarge', { currentSize: bcs.u64(), maxSize: bcs.u64() }),\n\tPublishUpgradeMissingDependency: null,\n\tPublishUpgradeDependencyDowngrade: null,\n\tPackageUpgradeError: bcs.struct('PackageUpgradeError', { upgradeError: PackageUpgradeError }),\n\tWrittenObjectsTooLarge: bcs.struct('WrittenObjectsTooLarge', {\n\t\tcurrentSize: bcs.u64(),\n\t\tmaxSize: bcs.u64(),\n\t}),\n\tCertificateDenied: null,\n\tSuiMoveVerificationTimedout: null,\n\tSharedObjectOperationNotAllowed: null,\n\tInputObjectDeleted: null,\n\tExecutionCancelledDueToSharedObjectCongestion: bcs.struct(\n\t\t'ExecutionCancelledDueToSharedObjectCongestion',\n\t\t{\n\t\t\tcongested_objects: bcs.vector(Address),\n\t\t},\n\t),\n\tAddressDeniedForCoin: bcs.struct('AddressDeniedForCoin', {\n\t\taddress: Address,\n\t\tcoinType: bcs.string(),\n\t}),\n\tCoinTypeGlobalPause: bcs.struct('CoinTypeGlobalPause', { coinType: bcs.string() }),\n\tExecutionCancelledDueToRandomnessUnavailable: null,\n\tMoveVectorElemTooBig: bcs.struct('MoveVectorElemTooBig', {\n\t\tvalueSize: bcs.u64(),\n\t\tmaxScaledSize: bcs.u64(),\n\t}),\n\tMoveRawValueTooBig: bcs.struct('MoveRawValueTooBig', {\n\t\tvalueSize: bcs.u64(),\n\t\tmaxScaledSize: bcs.u64(),\n\t}),\n\tInvalidLinkage: null,\n\tInsufficientBalanceForWithdraw: null,\n\tNonExclusiveWriteInputObjectModified: bcs.struct('NonExclusiveWriteInputObjectModified', {\n\t\tid: Address,\n\t}),\n});\n\n// Rust: crates/sui-types/src/execution_status.rs\nexport const ExecutionStatus = bcs.enum('ExecutionStatus', {\n\tSuccess: null,\n\tFailure: bcs.struct('Failure', {\n\t\terror: ExecutionFailureStatus,\n\t\tcommand: bcs.option(bcs.u64()),\n\t}),\n});\n\n// Rust: crates/sui-types/src/gas.rs\nconst GasCostSummary = bcs.struct('GasCostSummary', {\n\tcomputationCost: bcs.u64(),\n\tstorageCost: bcs.u64(),\n\tstorageRebate: bcs.u64(),\n\tnonRefundableStorageFee: bcs.u64(),\n});\n\n// Rust: crates/sui-types/src/effects/effects_v1.rs\nconst TransactionEffectsV1 = bcs.struct('TransactionEffectsV1', {\n\tstatus: ExecutionStatus,\n\texecutedEpoch: bcs.u64(),\n\tgasUsed: GasCostSummary,\n\tmodifiedAtVersions: bcs.vector(bcs.tuple([Address, bcs.u64()])),\n\tsharedObjects: bcs.vector(SuiObjectRef),\n\ttransactionDigest: ObjectDigest,\n\tcreated: bcs.vector(bcs.tuple([SuiObjectRef, Owner])),\n\tmutated: bcs.vector(bcs.tuple([SuiObjectRef, Owner])),\n\tunwrapped: bcs.vector(bcs.tuple([SuiObjectRef, Owner])),\n\tdeleted: bcs.vector(SuiObjectRef),\n\tunwrappedThenDeleted: bcs.vector(SuiObjectRef),\n\twrapped: bcs.vector(SuiObjectRef),\n\tgasObject: bcs.tuple([SuiObjectRef, Owner]),\n\teventsDigest: bcs.option(ObjectDigest),\n\tdependencies: bcs.vector(ObjectDigest),\n});\n\n// Rust: crates/sui-types/src/base_types.rs\nconst VersionDigest = bcs.tuple([bcs.u64(), ObjectDigest]);\n\n// Rust: crates/sui-types/src/effects/object_change.rs\nconst ObjectIn = bcs.enum('ObjectIn', {\n\tNotExist: null,\n\tExist: bcs.tuple([VersionDigest, Owner]),\n});\n\n// Rust: crates/sui-types/src/effects/object_change.rs\nconst AccumulatorAddress = bcs.struct('AccumulatorAddress', {\n\taddress: Address,\n\t// TODO: ask why this is the name\n\tty: TypeTag,\n});\n\n// Rust: crates/sui-types/src/effects/object_change.rs\nconst AccumulatorOperation = bcs.enum('AccumulatorOperation', {\n\tMerge: null,\n\tSplit: null,\n});\n\n// Rust: crates/sui-types/src/effects/object_change.rs\nconst AccumulatorValue = bcs.enum('AccumulatorValue', {\n\tInteger: bcs.u64(),\n\tIntegerTuple: bcs.tuple([bcs.u64(), bcs.u64()]),\n\t// NonEmpty<(u64, Digest)> in Rust - vector must have at least one element\n\tEventDigest: bcs.vector(bcs.tuple([bcs.u64(), ObjectDigest])),\n});\n\n// Rust: crates/sui-types/src/effects/object_change.rs\nconst AccumulatorWriteV1 = bcs.struct('AccumulatorWriteV1', {\n\taddress: AccumulatorAddress,\n\toperation: AccumulatorOperation,\n\tvalue: AccumulatorValue,\n});\n\n// Rust: crates/sui-types/src/effects/object_change.rs\nconst ObjectOut = bcs.enum('ObjectOut', {\n\tNotExist: null,\n\tObjectWrite: bcs.tuple([ObjectDigest, Owner]),\n\tPackageWrite: VersionDigest,\n\tAccumulatorWriteV1: AccumulatorWriteV1,\n});\n\n// Rust: crates/sui-types/src/effects/mod.rs\nconst IDOperation = bcs.enum('IDOperation', {\n\tNone: null,\n\tCreated: null,\n\tDeleted: null,\n});\n\n// Rust: crates/sui-types/src/effects/object_change.rs\nconst EffectsObjectChange = bcs.struct('EffectsObjectChange', {\n\tinputState: ObjectIn,\n\toutputState: ObjectOut,\n\tidOperation: IDOperation,\n});\n\n// Rust: crates/sui-types/src/effects/effects_v2.rs\nconst UnchangedConsensusKind = bcs.enum('UnchangedConsensusKind', {\n\tReadOnlyRoot: VersionDigest,\n\tMutateConsensusStreamEnded: bcs.u64(),\n\tReadConsensusStreamEnded: bcs.u64(),\n\tCancelled: bcs.u64(),\n\tPerEpochConfig: null,\n});\n\n// Rust: crates/sui-types/src/effects/effects_v2.rs\nconst TransactionEffectsV2 = bcs.struct('TransactionEffectsV2', {\n\tstatus: ExecutionStatus,\n\texecutedEpoch: bcs.u64(),\n\tgasUsed: GasCostSummary,\n\ttransactionDigest: ObjectDigest,\n\tgasObjectIndex: bcs.option(bcs.u32()),\n\teventsDigest: bcs.option(ObjectDigest),\n\tdependencies: bcs.vector(ObjectDigest),\n\tlamportVersion: bcs.u64(),\n\tchangedObjects: bcs.vector(bcs.tuple([Address, EffectsObjectChange])),\n\tunchangedConsensusObjects: bcs.vector(bcs.tuple([Address, UnchangedConsensusKind])),\n\tauxDataDigest: bcs.option(ObjectDigest),\n});\n\n// Rust: crates/sui-types/src/effects/mod.rs\nexport const TransactionEffects = bcs.enum('TransactionEffects', {\n\tV1: TransactionEffectsV1,\n\tV2: TransactionEffectsV2,\n});\n"],"mappings":";;;;AAQA,MAAM,sBAAsB,IAAI,KAAK,uBAAuB;CAC3D,sBAAsB,IAAI,OAAO,wBAAwB,EAAE,WAAW,SAAS,CAAC;CAChF,aAAa,IAAI,OAAO,eAAe,EAAE,UAAU,SAAS,CAAC;CAC7D,qBAAqB;CACrB,oBAAoB,IAAI,OAAO,sBAAsB,EAAE,QAAQ,IAAI,YAAY,EAAE,CAAC;CAClF,sBAAsB,IAAI,OAAO,wBAAwB,EAAE,QAAQ,IAAI,IAAI,EAAE,CAAC;CAC9E,uBAAuB,IAAI,OAAO,yBAAyB;EAC1D,WAAW;EACX,UAAU;EACV,CAAC;CACF,CAAC;AAGF,MAAM,WAAW,IAAI,OAAO,YAAY;CACvC,SAAS;CACT,MAAM,IAAI,QAAQ;CAClB,CAAC;AAEF,MAAM,eAAe,IAAI,OAAO,gBAAgB;CAC/C,QAAQ;CACR,UAAU,IAAI,KAAK;CACnB,aAAa,IAAI,KAAK;CACtB,cAAc,IAAI,OAAO,IAAI,QAAQ,CAAC;CACtC,CAAC;AAGF,MAAM,uBAAuB,IAAI,KAAK,wBAAwB;CAC7D,cAAc;CACd,iBAAiB;CACjB,uBAAuB;CACvB,uCAAuC;CACvC,kBAAkB,IAAI,OAAO,oBAAoB,EAAE,KAAK,IAAI,KAAK,EAAE,CAAC;CACpE,2BAA2B,IAAI,OAAO,6BAA6B;EAClE,WAAW,IAAI,KAAK;EACpB,cAAc,IAAI,KAAK;EACvB,CAAC;CACF,oBAAoB,IAAI,OA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,CAAC;AAGF,MAAM,YAAY,IAAI,KAAK,aAAa;CACvC,UAAU;CACV,aAAa,IAAI,MAAM,CAAC,cAAc,MAAM,CAAC;CAC7C,cAAc;CACM;CACpB,CAAC;AAGF,MAAM,cAAc,IAAI,KAAK,eAAe;CAC3C,MAAM;CACN,SAAS;CACT,SAAS;CACT,CAAC;AAGF,MAAM,sBAAsB,IAAI,OAAO,uBAAuB;CAC7D,YAAY;CACZ,aAAa;CACb,aAAa;CACb,CAAC;AAGF,MAAM,yBAAyB,IAAI,KAAK,0BAA0B;CACjE,cAAc;CACd,4BAA4B,IAAI,KAAK;CACrC,0BAA0B,IAAI,KAAK;CACnC,WAAW,IAAI,KAAK;CACpB,gBAAgB;CAChB,CAAC;AAGF,MAAM,uBAAuB,IAAI,OAAO,wBAAwB;CAC/D,QAAQ;CACR,eAAe,IAAI,KAAK;CACxB,SAAS;CACT,mBAAmB;CACnB,gBAAgB,IAAI,OAAO,IAAI,KAAK,CAAC;CACrC,cAAc,IAAI,OAAO,aAAa;CACtC,cAAc,IAAI,OAAO,aAAa;CACtC,gBAAgB,IAAI,KAAK;CACzB,gBAAgB,IAAI,OAAO,IAAI,MAAM,CAAC,SAAS,oBAAoB,CAAC,CAAC;CACrE,2BAA2B,IAAI,OAAO,IAAI,MAAM,CAAC,SAAS,uBAAuB,CAAC,CAAC;CACnF,eAAe,IAAI,OAAO,aAAa;CACvC,CAAC;AAGF,MAAa,qBAAqB,IAAI,KAAK,sBAAsB;CAChE,IAAI;CACJ,IAAI;CACJ,CAAC"}
1
+ {"version":3,"file":"effects.mjs","names":[],"sources":["../../src/bcs/effects.ts"],"sourcesContent":["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { bcs } from '@mysten/bcs';\n\nimport { Address, ObjectDigest, Owner, SuiObjectRef, TypeTag } from './bcs.js';\n\n// Rust: crates/sui-types/src/execution_status.rs (PackageUpgradeError enum)\nconst PackageUpgradeError = bcs.enum('PackageUpgradeError', {\n\tUnableToFetchPackage: bcs.struct('UnableToFetchPackage', { packageId: Address }),\n\tNotAPackage: bcs.struct('NotAPackage', { objectId: Address }),\n\tIncompatibleUpgrade: null,\n\tDigestDoesNotMatch: bcs.struct('DigestDoesNotMatch', { digest: bcs.byteVector() }),\n\tUnknownUpgradePolicy: bcs.struct('UnknownUpgradePolicy', { policy: bcs.u8() }),\n\tPackageIDDoesNotMatch: bcs.struct('PackageIDDoesNotMatch', {\n\t\tpackageId: Address,\n\t\tticketId: Address,\n\t}),\n});\n\n// Rust: move-core-types/src/language_storage.rs\nconst ModuleId = bcs.struct('ModuleId', {\n\taddress: Address,\n\tname: bcs.string(),\n});\n// Rust: crates/sui-types/src/execution_status.rs\nconst MoveLocation = bcs.struct('MoveLocation', {\n\tmodule: ModuleId,\n\tfunction: bcs.u16(),\n\tinstruction: bcs.u16(),\n\tfunctionName: bcs.option(bcs.string()),\n});\n\n// Rust: crates/sui-types/src/execution_status.rs\nconst CommandArgumentError = bcs.enum('CommandArgumentError', {\n\tTypeMismatch: null,\n\tInvalidBCSBytes: null,\n\tInvalidUsageOfPureArg: null,\n\tInvalidArgumentToPrivateEntryFunction: null,\n\tIndexOutOfBounds: bcs.struct('IndexOutOfBounds', { idx: bcs.u16() }),\n\tSecondaryIndexOutOfBounds: bcs.struct('SecondaryIndexOutOfBounds', {\n\t\tresultIdx: bcs.u16(),\n\t\tsecondaryIdx: bcs.u16(),\n\t}),\n\tInvalidResultArity: bcs.struct('InvalidResultArity', { resultIdx: bcs.u16() }),\n\tInvalidGasCoinUsage: null,\n\tInvalidValueUsage: null,\n\tInvalidObjectByValue: null,\n\tInvalidObjectByMutRef: null,\n\tSharedObjectOperationNotAllowed: null,\n\tInvalidArgumentArity: null,\n\tInvalidTransferObject: null,\n\tInvalidMakeMoveVecNonObjectArgument: null,\n\tArgumentWithoutValue: null,\n\tCannotMoveBorrowedValue: null,\n\tCannotWriteToExtendedReference: null,\n\tInvalidReferenceArgument: null,\n\tInvalidTxContext: null,\n});\n\n// Rust: crates/sui-types/src/execution_status.rs\nconst TypeArgumentError = bcs.enum('TypeArgumentError', {\n\tTypeNotFound: null,\n\tConstraintNotSatisfied: null,\n});\n\n// Rust: crates/sui-types/src/execution_status.rs\nconst ExecutionFailureStatus = bcs.enum('ExecutionFailureStatus', {\n\tInsufficientGas: null,\n\tInvalidGasObject: null,\n\tInvariantViolation: null,\n\tFeatureNotYetSupported: null,\n\tMoveObjectTooBig: bcs.struct('MoveObjectTooBig', {\n\t\tobjectSize: bcs.u64(),\n\t\tmaxObjectSize: bcs.u64(),\n\t}),\n\tMovePackageTooBig: bcs.struct('MovePackageTooBig', {\n\t\tobjectSize: bcs.u64(),\n\t\tmaxObjectSize: bcs.u64(),\n\t}),\n\tCircularObjectOwnership: bcs.struct('CircularObjectOwnership', { object: Address }),\n\tInsufficientCoinBalance: null,\n\tCoinBalanceOverflow: null,\n\tPublishErrorNonZeroAddress: null,\n\tSuiMoveVerificationError: null,\n\tMovePrimitiveRuntimeError: bcs.option(MoveLocation),\n\tMoveAbort: bcs.tuple([MoveLocation, bcs.u64()]),\n\tVMVerificationOrDeserializationError: null,\n\tVMInvariantViolation: null,\n\tFunctionNotFound: null,\n\tArityMismatch: null,\n\tTypeArityMismatch: null,\n\tNonEntryFunctionInvoked: null,\n\tCommandArgumentError: bcs.struct('CommandArgumentError', {\n\t\targIdx: bcs.u16(),\n\t\tkind: CommandArgumentError,\n\t}),\n\tTypeArgumentError: bcs.struct('TypeArgumentError', {\n\t\targumentIdx: bcs.u16(),\n\t\tkind: TypeArgumentError,\n\t}),\n\tUnusedValueWithoutDrop: bcs.struct('UnusedValueWithoutDrop', {\n\t\tresultIdx: bcs.u16(),\n\t\tsecondaryIdx: bcs.u16(),\n\t}),\n\tInvalidPublicFunctionReturnType: bcs.struct('InvalidPublicFunctionReturnType', {\n\t\tidx: bcs.u16(),\n\t}),\n\tInvalidTransferObject: null,\n\tEffectsTooLarge: bcs.struct('EffectsTooLarge', { currentSize: bcs.u64(), maxSize: bcs.u64() }),\n\tPublishUpgradeMissingDependency: null,\n\tPublishUpgradeDependencyDowngrade: null,\n\tPackageUpgradeError: bcs.struct('PackageUpgradeError', { upgradeError: PackageUpgradeError }),\n\tWrittenObjectsTooLarge: bcs.struct('WrittenObjectsTooLarge', {\n\t\tcurrentSize: bcs.u64(),\n\t\tmaxSize: bcs.u64(),\n\t}),\n\tCertificateDenied: null,\n\tSuiMoveVerificationTimedout: null,\n\tSharedObjectOperationNotAllowed: null,\n\tInputObjectDeleted: null,\n\tExecutionCancelledDueToSharedObjectCongestion: bcs.struct(\n\t\t'ExecutionCancelledDueToSharedObjectCongestion',\n\t\t{\n\t\t\tcongested_objects: bcs.vector(Address),\n\t\t},\n\t),\n\tAddressDeniedForCoin: bcs.struct('AddressDeniedForCoin', {\n\t\taddress: Address,\n\t\tcoinType: bcs.string(),\n\t}),\n\tCoinTypeGlobalPause: bcs.struct('CoinTypeGlobalPause', { coinType: bcs.string() }),\n\tExecutionCancelledDueToRandomnessUnavailable: null,\n\tMoveVectorElemTooBig: bcs.struct('MoveVectorElemTooBig', {\n\t\tvalueSize: bcs.u64(),\n\t\tmaxScaledSize: bcs.u64(),\n\t}),\n\tMoveRawValueTooBig: bcs.struct('MoveRawValueTooBig', {\n\t\tvalueSize: bcs.u64(),\n\t\tmaxScaledSize: bcs.u64(),\n\t}),\n\tInvalidLinkage: null,\n\t// Upstream renamed this to `InsufficientFundsForWithdraw`; renaming the parsed `$kind` would\n\t// break the public API, and the wire representation is unchanged either way.\n\tInsufficientBalanceForWithdraw: null,\n\tNonExclusiveWriteInputObjectModified: bcs.struct('NonExclusiveWriteInputObjectModified', {\n\t\tid: Address,\n\t}),\n});\n\n// Rust: crates/sui-types/src/execution_status.rs\nexport const ExecutionStatus = bcs.enum('ExecutionStatus', {\n\tSuccess: null,\n\tFailure: bcs.struct('Failure', {\n\t\terror: ExecutionFailureStatus,\n\t\tcommand: bcs.option(bcs.u64()),\n\t}),\n});\n\n// Rust: crates/sui-types/src/gas.rs\nconst GasCostSummary = bcs.struct('GasCostSummary', {\n\tcomputationCost: bcs.u64(),\n\tstorageCost: bcs.u64(),\n\tstorageRebate: bcs.u64(),\n\tnonRefundableStorageFee: bcs.u64(),\n});\n\n// Rust: crates/sui-types/src/effects/effects_v1.rs\nconst TransactionEffectsV1 = bcs.struct('TransactionEffectsV1', {\n\tstatus: ExecutionStatus,\n\texecutedEpoch: bcs.u64(),\n\tgasUsed: GasCostSummary,\n\tmodifiedAtVersions: bcs.vector(bcs.tuple([Address, bcs.u64()])),\n\tsharedObjects: bcs.vector(SuiObjectRef),\n\ttransactionDigest: ObjectDigest,\n\tcreated: bcs.vector(bcs.tuple([SuiObjectRef, Owner])),\n\tmutated: bcs.vector(bcs.tuple([SuiObjectRef, Owner])),\n\tunwrapped: bcs.vector(bcs.tuple([SuiObjectRef, Owner])),\n\tdeleted: bcs.vector(SuiObjectRef),\n\tunwrappedThenDeleted: bcs.vector(SuiObjectRef),\n\twrapped: bcs.vector(SuiObjectRef),\n\tgasObject: bcs.tuple([SuiObjectRef, Owner]),\n\teventsDigest: bcs.option(ObjectDigest),\n\tdependencies: bcs.vector(ObjectDigest),\n});\n\n// Rust: crates/sui-types/src/base_types.rs\nconst VersionDigest = bcs.tuple([bcs.u64(), ObjectDigest]);\n\n// Rust: crates/sui-types/src/effects/object_change.rs\nconst ObjectIn = bcs.enum('ObjectIn', {\n\tNotExist: null,\n\tExist: bcs.tuple([VersionDigest, Owner]),\n});\n\n// Rust: crates/sui-types/src/effects/object_change.rs\nconst AccumulatorAddress = bcs.struct('AccumulatorAddress', {\n\taddress: Address,\n\t// TODO: ask why this is the name\n\tty: TypeTag,\n});\n\n// Rust: crates/sui-types/src/effects/object_change.rs\nconst AccumulatorOperation = bcs.enum('AccumulatorOperation', {\n\tMerge: null,\n\tSplit: null,\n});\n\n// Rust: crates/sui-types/src/effects/object_change.rs\nconst AccumulatorValue = bcs.enum('AccumulatorValue', {\n\tInteger: bcs.u64(),\n\tIntegerTuple: bcs.tuple([bcs.u64(), bcs.u64()]),\n\t// NonEmpty<(u64, Digest)> in Rust - vector must have at least one element\n\tEventDigest: bcs.vector(bcs.tuple([bcs.u64(), ObjectDigest])),\n});\n\n// Rust: crates/sui-types/src/effects/object_change.rs\nconst AccumulatorWriteV1 = bcs.struct('AccumulatorWriteV1', {\n\taddress: AccumulatorAddress,\n\toperation: AccumulatorOperation,\n\tvalue: AccumulatorValue,\n});\n\n// Rust: crates/sui-types/src/effects/object_change.rs\nconst ObjectOut = bcs.enum('ObjectOut', {\n\tNotExist: null,\n\tObjectWrite: bcs.tuple([ObjectDigest, Owner]),\n\tPackageWrite: VersionDigest,\n\tAccumulatorWriteV1: AccumulatorWriteV1,\n});\n\n// Rust: crates/sui-types/src/effects/mod.rs\nconst IDOperation = bcs.enum('IDOperation', {\n\tNone: null,\n\tCreated: null,\n\tDeleted: null,\n});\n\n// Rust: crates/sui-types/src/effects/object_change.rs\nconst EffectsObjectChange = bcs.struct('EffectsObjectChange', {\n\tinputState: ObjectIn,\n\toutputState: ObjectOut,\n\tidOperation: IDOperation,\n});\n\n// Rust: crates/sui-types/src/effects/effects_v2.rs\nconst UnchangedConsensusKind = bcs.enum('UnchangedConsensusKind', {\n\tReadOnlyRoot: VersionDigest,\n\tMutateConsensusStreamEnded: bcs.u64(),\n\tReadConsensusStreamEnded: bcs.u64(),\n\tCancelled: bcs.u64(),\n\tPerEpochConfig: null,\n});\n\n// Rust: crates/sui-types/src/effects/effects_v2.rs\nconst TransactionEffectsV2 = bcs.struct('TransactionEffectsV2', {\n\tstatus: ExecutionStatus,\n\texecutedEpoch: bcs.u64(),\n\tgasUsed: GasCostSummary,\n\ttransactionDigest: ObjectDigest,\n\tgasObjectIndex: bcs.option(bcs.u32()),\n\teventsDigest: bcs.option(ObjectDigest),\n\tdependencies: bcs.vector(ObjectDigest),\n\tlamportVersion: bcs.u64(),\n\tchangedObjects: bcs.vector(bcs.tuple([Address, EffectsObjectChange])),\n\tunchangedConsensusObjects: bcs.vector(bcs.tuple([Address, UnchangedConsensusKind])),\n\tauxDataDigest: bcs.option(ObjectDigest),\n});\n\n// Rust: crates/sui-types/src/effects/mod.rs\nexport const TransactionEffects = bcs.enum('TransactionEffects', {\n\tV1: TransactionEffectsV1,\n\tV2: TransactionEffectsV2,\n});\n"],"mappings":";;;;AAQA,MAAM,sBAAsB,IAAI,KAAK,uBAAuB;CAC3D,sBAAsB,IAAI,OAAO,wBAAwB,EAAE,WAAW,SAAS,CAAC;CAChF,aAAa,IAAI,OAAO,eAAe,EAAE,UAAU,SAAS,CAAC;CAC7D,qBAAqB;CACrB,oBAAoB,IAAI,OAAO,sBAAsB,EAAE,QAAQ,IAAI,YAAY,EAAE,CAAC;CAClF,sBAAsB,IAAI,OAAO,wBAAwB,EAAE,QAAQ,IAAI,IAAI,EAAE,CAAC;CAC9E,uBAAuB,IAAI,OAAO,yBAAyB;EAC1D,WAAW;EACX,UAAU;EACV,CAAC;CACF,CAAC;AAGF,MAAM,WAAW,IAAI,OAAO,YAAY;CACvC,SAAS;CACT,MAAM,IAAI,QAAQ;CAClB,CAAC;AAEF,MAAM,eAAe,IAAI,OAAO,gBAAgB;CAC/C,QAAQ;CACR,UAAU,IAAI,KAAK;CACnB,aAAa,IAAI,KAAK;CACtB,cAAc,IAAI,OAAO,IAAI,QAAQ,CAAC;CACtC,CAAC;AAGF,MAAM,uBAAuB,IAAI,KAAK,wBAAwB;CAC7D,cAAc;CACd,iBAAiB;CACjB,uBAAuB;CACvB,uCAAuC;CACvC,kBAAkB,IAAI,OAAO,oBAAoB,EAAE,KAAK,IAAI,KAAK,EAAE,CAAC;CACpE,2BAA2B,IAAI,OAAO,6BAA6B;EAClE,WAAW,IAAI,KAAK;EACpB,cAAc,IAAI,KAAK;EACvB,CAAC;CACF,oBAAoB,IAAI,OAAO,sBAAsB,EAAE,WAAW,IAAI,KAAK,EAAE,CAAC;CAC9E,qBAAqB;CACrB,mBAAmB;CACnB,sB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