@mysten/walrus 0.0.8 → 0.0.10

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.
@@ -289,108 +289,3 @@ export declare const StorageConfirmation: BcsType<{
289
289
  }>;
290
290
  };
291
291
  }>;
292
- export declare const TestnetSystemStateInnerV1: BcsType<{
293
- committee: {
294
- members: {
295
- public_key: {
296
- bytes: number[];
297
- };
298
- weight: number;
299
- node_id: string;
300
- }[];
301
- n_shards: number;
302
- epoch: number;
303
- total_aggregated_key: {
304
- bytes: number[];
305
- };
306
- };
307
- total_capacity_size: string;
308
- used_capacity_size: string;
309
- storage_price_per_unit_size: string;
310
- write_price_per_unit_size: string;
311
- future_accounting: {
312
- current_index: number;
313
- length: number;
314
- ring_buffer: {
315
- epoch: number;
316
- used_capacity: string;
317
- rewards_to_distribute: {
318
- value: string;
319
- };
320
- }[];
321
- };
322
- event_blob_certification_state: {
323
- latest_certified_blob: {
324
- blob_id: string;
325
- ending_checkpoint_sequence_number: string;
326
- } | null;
327
- aggregate_weight_per_blob: {
328
- contents: {
329
- key: string;
330
- value: number;
331
- }[];
332
- };
333
- };
334
- deny_list_sizes: {
335
- id: {
336
- id: string;
337
- };
338
- };
339
- }, {
340
- committee: {
341
- members: Iterable<{
342
- public_key: {
343
- bytes: Iterable<number> & {
344
- length: number;
345
- };
346
- };
347
- weight: number;
348
- node_id: string | Uint8Array<ArrayBufferLike>;
349
- }> & {
350
- length: number;
351
- };
352
- n_shards: number;
353
- epoch: number;
354
- total_aggregated_key: {
355
- bytes: Iterable<number> & {
356
- length: number;
357
- };
358
- };
359
- };
360
- total_capacity_size: string | number | bigint;
361
- used_capacity_size: string | number | bigint;
362
- storage_price_per_unit_size: string | number | bigint;
363
- write_price_per_unit_size: string | number | bigint;
364
- future_accounting: {
365
- current_index: number;
366
- length: number;
367
- ring_buffer: Iterable<{
368
- epoch: number;
369
- used_capacity: string | number | bigint;
370
- rewards_to_distribute: {
371
- value: string | number | bigint;
372
- };
373
- }> & {
374
- length: number;
375
- };
376
- };
377
- event_blob_certification_state: {
378
- latest_certified_blob: {
379
- blob_id: string | number | bigint;
380
- ending_checkpoint_sequence_number: string | number | bigint;
381
- } | null | undefined;
382
- aggregate_weight_per_blob: {
383
- contents: Iterable<{
384
- key: string | number | bigint;
385
- value: number;
386
- }> & {
387
- length: number;
388
- };
389
- };
390
- };
391
- deny_list_sizes: {
392
- id: {
393
- id: string | Uint8Array<ArrayBufferLike>;
394
- };
395
- };
396
- }>;
@@ -32,18 +32,12 @@ __export(bcs_exports, {
32
32
  SliverPair: () => SliverPair,
33
33
  StorageConfirmation: () => StorageConfirmation,
34
34
  StorageConfirmationBody: () => StorageConfirmationBody,
35
- TestnetSystemStateInnerV1: () => TestnetSystemStateInnerV1,
36
35
  blobIdFromBytes: () => blobIdFromBytes,
37
36
  blobIdFromInt: () => blobIdFromInt,
38
37
  blobIdToInt: () => blobIdToInt
39
38
  });
40
39
  module.exports = __toCommonJS(bcs_exports);
41
40
  var import_bcs = require("@mysten/sui/bcs");
42
- var import_bls_aggregate = require("../contracts/bls_aggregate.js");
43
- var import_vec_map = require("../contracts/deps/0x0000000000000000000000000000000000000000000000000000000000000002/vec_map.js");
44
- var import_event_blob = require("../contracts/event_blob.js");
45
- var import_extended_field = require("../contracts/extended_field.js");
46
- var import_storage_accounting = require("../contracts/storage_accounting.js");
47
41
  const MerkleNode = import_bcs.bcs.enum("MerkleNode", {
48
42
  Empty: null,
49
43
  Digest: import_bcs.bcs.bytes(32)
@@ -140,18 +134,4 @@ const StorageConfirmationBody = import_bcs.bcs.struct("StorageConfirmationBody",
140
134
  blobType: BlobPersistenceType
141
135
  });
142
136
  const StorageConfirmation = ProtocolMessage(StorageConfirmationBody);
143
- const TestnetEventBlobCertificationState = import_bcs.bcs.struct("EventBlobCertificationState", {
144
- latest_certified_blob: import_bcs.bcs.option((0, import_event_blob.EventBlob)()),
145
- aggregate_weight_per_blob: (0, import_vec_map.VecMap)(import_bcs.bcs.u256(), import_bcs.bcs.u16())
146
- });
147
- const TestnetSystemStateInnerV1 = import_bcs.bcs.struct("SystemStateInnerV1", {
148
- committee: (0, import_bls_aggregate.BlsCommittee)(),
149
- total_capacity_size: import_bcs.bcs.u64(),
150
- used_capacity_size: import_bcs.bcs.u64(),
151
- storage_price_per_unit_size: import_bcs.bcs.u64(),
152
- write_price_per_unit_size: import_bcs.bcs.u64(),
153
- future_accounting: (0, import_storage_accounting.FutureAccountingRingBuffer)(),
154
- event_blob_certification_state: TestnetEventBlobCertificationState,
155
- deny_list_sizes: (0, import_extended_field.ExtendedField)()
156
- });
157
137
  //# sourceMappingURL=bcs.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/utils/bcs.ts"],
4
- "sourcesContent": ["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { BcsType } from '@mysten/sui/bcs';\nimport { bcs } from '@mysten/sui/bcs';\n\nimport { BlsCommittee } from '../contracts/bls_aggregate.js';\nimport { VecMap } from '../contracts/deps/0x0000000000000000000000000000000000000000000000000000000000000002/vec_map.js';\nimport { EventBlob } from '../contracts/event_blob.js';\nimport { ExtendedField } from '../contracts/extended_field.js';\nimport { FutureAccountingRingBuffer } from '../contracts/storage_accounting.js';\n\nconst MerkleNode = bcs.enum('MerkleNode', {\n\tEmpty: null,\n\tDigest: bcs.bytes(32),\n});\n\nconst SliverPairMetadata = bcs.struct('SliverPairMetadata', {\n\tprimary_hash: MerkleNode,\n\tsecondary_hash: MerkleNode,\n});\n\nexport const EncodingType = bcs\n\t.enum('EncodingType', {\n\t\tRedStuff: null,\n\t\tRS2: null,\n\t})\n\t.transform({\n\t\tinput: (\n\t\t\tencodingType:\n\t\t\t\t| { RedStuff: boolean | object | null }\n\t\t\t\t| { RS2: boolean | object | null }\n\t\t\t\t| 'RedStuff'\n\t\t\t\t| 'RS2',\n\t\t) =>\n\t\t\ttypeof encodingType === 'string'\n\t\t\t\t? ({ [encodingType]: null } as Exclude<typeof encodingType, string>)\n\t\t\t\t: encodingType,\n\t\toutput: (encodingType) => encodingType,\n\t});\n\nexport const BlobMetadataV1 = bcs.struct('BlobMetadataV1', {\n\tencoding_type: EncodingType,\n\tunencoded_length: bcs.u64(),\n\thashes: bcs.vector(SliverPairMetadata),\n});\n\nexport const BlobMetadata = bcs.enum('BlobMetadata', {\n\tV1: BlobMetadataV1,\n});\n\nexport const BlobId = bcs.u256().transform({\n\tinput: (blobId: string | bigint) => (typeof blobId === 'string' ? blobIdToInt(blobId) : blobId),\n\toutput: (id: string) => blobIdFromInt(id),\n});\n\nexport function blobIdFromInt(blobId: bigint | string): string {\n\treturn bcs\n\t\t.u256()\n\t\t.serialize(blobId)\n\t\t.toBase64()\n\t\t.replace(/=*$/, '')\n\t\t.replaceAll('+', '-')\n\t\t.replaceAll('/', '_');\n}\n\nexport function blobIdFromBytes(blobId: Uint8Array): string {\n\treturn blobIdFromInt(bcs.u256().parse(blobId));\n}\n\nexport function blobIdToInt(blobId: string): bigint {\n\treturn BigInt(bcs.u256().fromBase64(blobId.replaceAll('-', '+').replaceAll('_', '/')));\n}\n\nexport const BlobMetadataWithId = bcs.struct('BlobMetadataWithId', {\n\tblob_id: BlobId,\n\tmetadata: BlobMetadata,\n});\n\nconst Symbols = bcs.struct('Symbols', {\n\tdata: bcs.vector(bcs.u8()),\n\tsymbol_size: bcs.u16(),\n});\n\nexport const SliverData = bcs.struct('SliverData', {\n\tsymbols: Symbols,\n\tindex: bcs.u16(),\n});\n\nexport const Sliver = bcs.enum('Sliver', {\n\tPrimary: SliverData,\n\tSecondary: SliverData,\n});\n\nexport const SliverPair = bcs.struct('SliverPair', {\n\tprimary: SliverData,\n\tsecondary: SliverData,\n});\n\nexport enum IntentType {\n\tPROOF_OF_POSSESSION_MSG = 0,\n\tBLOB_CERT_MSG = 1,\n\tINVALID_BLOB_ID_MSG = 2,\n\tSYNC_SHARD_MSG = 3,\n}\n\nexport const Intent = bcs\n\t.struct('Intent', {\n\t\ttype: bcs.u8().transform({\n\t\t\tinput: (type: IntentType) => type,\n\t\t\toutput: (type: number) => type as IntentType,\n\t\t}),\n\t\tversion: bcs.u8(),\n\t\tappId: bcs.u8(),\n\t})\n\t.transform({\n\t\tinput: (intent: IntentType) => ({\n\t\t\ttype: intent,\n\t\t\tversion: 0,\n\t\t\tappId: 3,\n\t\t}),\n\t\toutput: (intent) => intent.type,\n\t});\n\nexport function ProtocolMessage<T extends BcsType<any>>(messageContents: T) {\n\treturn bcs.struct(`ProtocolMessage<${messageContents.name}>`, {\n\t\tintent: Intent,\n\t\tepoch: bcs.u32(),\n\t\tmessageContents,\n\t});\n}\n\nexport const BlobPersistenceType = bcs.enum('BlobPersistenceType', {\n\tPermanent: null,\n\tDeletable: bcs.struct('Deletable', {\n\t\tobjectId: bcs.Address,\n\t}),\n});\nexport const StorageConfirmationBody = bcs.struct('StorageConfirmationBody', {\n\tblobId: BlobId,\n\tblobType: BlobPersistenceType,\n});\n\nexport const StorageConfirmation = ProtocolMessage(StorageConfirmationBody);\n\n// TODO: Remove these once testnet is updated\nconst TestnetEventBlobCertificationState = bcs.struct('EventBlobCertificationState', {\n\tlatest_certified_blob: bcs.option(EventBlob()),\n\taggregate_weight_per_blob: VecMap(bcs.u256(), bcs.u16()),\n});\nexport const TestnetSystemStateInnerV1 = bcs.struct('SystemStateInnerV1', {\n\tcommittee: BlsCommittee(),\n\ttotal_capacity_size: bcs.u64(),\n\tused_capacity_size: bcs.u64(),\n\tstorage_price_per_unit_size: bcs.u64(),\n\twrite_price_per_unit_size: bcs.u64(),\n\tfuture_accounting: FutureAccountingRingBuffer(),\n\tevent_blob_certification_state: TestnetEventBlobCertificationState,\n\tdeny_list_sizes: ExtendedField(),\n});\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;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7D,QAAQ;AAAA,IACR,OAAO,eAAI,IAAI;AAAA,IACf;AAAA,EACD,CAAC;AACF;AAEO,MAAM,sBAAsB,eAAI,KAAK,uBAAuB;AAAA,EAClE,WAAW;AAAA,EACX,WAAW,eAAI,OAAO,aAAa;AAAA,IAClC,UAAU,eAAI;AAAA,EACf,CAAC;AACF,CAAC;AACM,MAAM,0BAA0B,eAAI,OAAO,2BAA2B;AAAA,EAC5E,QAAQ;AAAA,EACR,UAAU;AACX,CAAC;AAEM,MAAM,sBAAsB,gBAAgB,uBAAuB;AAG1E,MAAM,qCAAqC,eAAI,OAAO,+BAA+B;AAAA,EACpF,uBAAuB,eAAI,WAAO,6BAAU,CAAC;AAAA,EAC7C,+BAA2B,uBAAO,eAAI,KAAK,GAAG,eAAI,IAAI,CAAC;AACxD,CAAC;AACM,MAAM,4BAA4B,eAAI,OAAO,sBAAsB;AAAA,EACzE,eAAW,mCAAa;AAAA,EACxB,qBAAqB,eAAI,IAAI;AAAA,EAC7B,oBAAoB,eAAI,IAAI;AAAA,EAC5B,6BAA6B,eAAI,IAAI;AAAA,EACrC,2BAA2B,eAAI,IAAI;AAAA,EACnC,uBAAmB,sDAA2B;AAAA,EAC9C,gCAAgC;AAAA,EAChC,qBAAiB,qCAAc;AAChC,CAAC;",
4
+ "sourcesContent": ["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { BcsType } from '@mysten/sui/bcs';\nimport { bcs } from '@mysten/sui/bcs';\n\nconst MerkleNode = bcs.enum('MerkleNode', {\n\tEmpty: null,\n\tDigest: bcs.bytes(32),\n});\n\nconst SliverPairMetadata = bcs.struct('SliverPairMetadata', {\n\tprimary_hash: MerkleNode,\n\tsecondary_hash: MerkleNode,\n});\n\nexport const EncodingType = bcs\n\t.enum('EncodingType', {\n\t\tRedStuff: null,\n\t\tRS2: null,\n\t})\n\t.transform({\n\t\tinput: (\n\t\t\tencodingType:\n\t\t\t\t| { RedStuff: boolean | object | null }\n\t\t\t\t| { RS2: boolean | object | null }\n\t\t\t\t| 'RedStuff'\n\t\t\t\t| 'RS2',\n\t\t) =>\n\t\t\ttypeof encodingType === 'string'\n\t\t\t\t? ({ [encodingType]: null } as Exclude<typeof encodingType, string>)\n\t\t\t\t: encodingType,\n\t\toutput: (encodingType) => encodingType,\n\t});\n\nexport const BlobMetadataV1 = bcs.struct('BlobMetadataV1', {\n\tencoding_type: EncodingType,\n\tunencoded_length: bcs.u64(),\n\thashes: bcs.vector(SliverPairMetadata),\n});\n\nexport const BlobMetadata = bcs.enum('BlobMetadata', {\n\tV1: BlobMetadataV1,\n});\n\nexport const BlobId = bcs.u256().transform({\n\tinput: (blobId: string | bigint) => (typeof blobId === 'string' ? blobIdToInt(blobId) : blobId),\n\toutput: (id: string) => blobIdFromInt(id),\n});\n\nexport function blobIdFromInt(blobId: bigint | string): string {\n\treturn bcs\n\t\t.u256()\n\t\t.serialize(blobId)\n\t\t.toBase64()\n\t\t.replace(/=*$/, '')\n\t\t.replaceAll('+', '-')\n\t\t.replaceAll('/', '_');\n}\n\nexport function blobIdFromBytes(blobId: Uint8Array): string {\n\treturn blobIdFromInt(bcs.u256().parse(blobId));\n}\n\nexport function blobIdToInt(blobId: string): bigint {\n\treturn BigInt(bcs.u256().fromBase64(blobId.replaceAll('-', '+').replaceAll('_', '/')));\n}\n\nexport const BlobMetadataWithId = bcs.struct('BlobMetadataWithId', {\n\tblob_id: BlobId,\n\tmetadata: BlobMetadata,\n});\n\nconst Symbols = bcs.struct('Symbols', {\n\tdata: bcs.vector(bcs.u8()),\n\tsymbol_size: bcs.u16(),\n});\n\nexport const SliverData = bcs.struct('SliverData', {\n\tsymbols: Symbols,\n\tindex: bcs.u16(),\n});\n\nexport const Sliver = bcs.enum('Sliver', {\n\tPrimary: SliverData,\n\tSecondary: SliverData,\n});\n\nexport const SliverPair = bcs.struct('SliverPair', {\n\tprimary: SliverData,\n\tsecondary: SliverData,\n});\n\nexport enum IntentType {\n\tPROOF_OF_POSSESSION_MSG = 0,\n\tBLOB_CERT_MSG = 1,\n\tINVALID_BLOB_ID_MSG = 2,\n\tSYNC_SHARD_MSG = 3,\n}\n\nexport const Intent = bcs\n\t.struct('Intent', {\n\t\ttype: bcs.u8().transform({\n\t\t\tinput: (type: IntentType) => type,\n\t\t\toutput: (type: number) => type as IntentType,\n\t\t}),\n\t\tversion: bcs.u8(),\n\t\tappId: bcs.u8(),\n\t})\n\t.transform({\n\t\tinput: (intent: IntentType) => ({\n\t\t\ttype: intent,\n\t\t\tversion: 0,\n\t\t\tappId: 3,\n\t\t}),\n\t\toutput: (intent) => intent.type,\n\t});\n\nexport function ProtocolMessage<T extends BcsType<any>>(messageContents: T) {\n\treturn bcs.struct(`ProtocolMessage<${messageContents.name}>`, {\n\t\tintent: Intent,\n\t\tepoch: bcs.u32(),\n\t\tmessageContents,\n\t});\n}\n\nexport const BlobPersistenceType = bcs.enum('BlobPersistenceType', {\n\tPermanent: null,\n\tDeletable: bcs.struct('Deletable', {\n\t\tobjectId: bcs.Address,\n\t}),\n});\nexport const StorageConfirmationBody = bcs.struct('StorageConfirmationBody', {\n\tblobId: BlobId,\n\tblobType: BlobPersistenceType,\n});\n\nexport const StorageConfirmation = ProtocolMessage(StorageConfirmationBody);\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,iBAAoB;AAEpB,MAAM,aAAa,eAAI,KAAK,cAAc;AAAA,EACzC,OAAO;AAAA,EACP,QAAQ,eAAI,MAAM,EAAE;AACrB,CAAC;AAED,MAAM,qBAAqB,eAAI,OAAO,sBAAsB;AAAA,EAC3D,cAAc;AAAA,EACd,gBAAgB;AACjB,CAAC;AAEM,MAAM,eAAe,eAC1B,KAAK,gBAAgB;AAAA,EACrB,UAAU;AAAA,EACV,KAAK;AACN,C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ions, DeleteBlobOptions, ExtendBlobOptions, GetBlobM
6
6
  export declare class WalrusClient {
7
7
  #private;
8
8
  constructor(config: WalrusClientConfig);
9
+ /** The Move type for a Blob object */
10
+ getBlobType: () => string | Promise<string>;
9
11
  /** The cached system object for the walrus package */
10
12
  systemObject(): Promise<{
11
13
  id: {
@@ -6,7 +6,7 @@ var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read fr
6
6
  var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
7
7
  var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
8
8
  var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
9
- var _storageNodeClient, _packageConfig, _suiClient, _objectLoader, _blobMetadataConcurrencyLimit, _readCommittee, _memo, _walType, _getPackageId, _getBlobType, _getSystemContract, _getSubsidiesContract, _getBlobContract, _getMetadataContract, _WalrusClient_instances, internalReadBlob_fn, getCertificationEpoch_fn, getReadCommittee_fn, forceGetReadCommittee_fn, withWal_fn, writeBlobAttributesForRef_fn, executeTransaction_fn, getCommittee_fn, _getActiveCommittee, stakingPool_fn, getNodeByShardIndex_fn, retryOnPossibleEpochChange_fn;
9
+ var _storageNodeClient, _packageConfig, _suiClient, _objectLoader, _blobMetadataConcurrencyLimit, _readCommittee, _memo, _walType, _getPackageId, _getSystemContract, _getSubsidiesContract, _getBlobContract, _getMetadataContract, _WalrusClient_instances, internalReadBlob_fn, getCertificationEpoch_fn, getReadCommittee_fn, forceGetReadCommittee_fn, withWal_fn, writeBlobAttributesForRef_fn, executeTransaction_fn, getCommittee_fn, _getActiveCommittee, stakingPool_fn, getNodeByShardIndex_fn, retryOnPossibleEpochChange_fn;
10
10
  import { bcs } from "@mysten/bcs";
11
11
  import { SuiClient } from "@mysten/sui/client";
12
12
  import { coinWithBalance, Transaction } from "@mysten/sui/transactions";
@@ -40,13 +40,7 @@ import {
40
40
  } from "./error.js";
41
41
  import { StorageNodeClient } from "./storage-node/client.js";
42
42
  import { LegallyUnavailableError, NotFoundError, UserAbortError } from "./storage-node/error.js";
43
- import {
44
- blobIdToInt,
45
- IntentType,
46
- SliverData,
47
- StorageConfirmation,
48
- TestnetSystemStateInnerV1
49
- } from "./utils/bcs.js";
43
+ import { blobIdToInt, IntentType, SliverData, StorageConfirmation } from "./utils/bcs.js";
50
44
  import {
51
45
  chunk,
52
46
  encodedBlobLength,
@@ -103,9 +97,9 @@ class WalrusClient {
103
97
  return parseStructTag(system.type).address;
104
98
  }));
105
99
  /** The Move type for a Blob object */
106
- __privateAdd(this, _getBlobType, __privateGet(this, _memo).create("getBlobType", async () => {
100
+ this.getBlobType = __privateGet(this, _memo).create("getBlobType", async () => {
107
101
  return `${await __privateGet(this, _getPackageId).call(this)}::blob::Blob`;
108
- }));
102
+ });
109
103
  __privateAdd(this, _getSystemContract, __privateGet(this, _memo).create("getSystemContract", async () => {
110
104
  const { package_id } = await this.systemObject();
111
105
  return initSystemContract(package_id);
@@ -166,7 +160,7 @@ class WalrusClient {
166
160
  const systemState = await __privateGet(this, _objectLoader).loadFieldObject(
167
161
  __privateGet(this, _packageConfig).systemObjectId,
168
162
  { type: "u64", value: (await this.systemObject()).version },
169
- __privateGet(this, _packageConfig).systemObjectId === TESTNET_WALRUS_PACKAGE_CONFIG.systemObjectId ? TestnetSystemStateInnerV1 : SystemStateInnerV1()
163
+ SystemStateInnerV1()
170
164
  );
171
165
  return systemState;
172
166
  }
@@ -478,7 +472,7 @@ class WalrusClient {
478
472
  ...options,
479
473
  owner: options.transaction?.getData().sender ?? signer.toSuiAddress()
480
474
  });
481
- const blobType = await __privateGet(this, _getBlobType).call(this);
475
+ const blobType = await this.getBlobType();
482
476
  const { digest, effects } = await __privateMethod(this, _WalrusClient_instances, executeTransaction_fn).call(this, transaction, signer, "create storage");
483
477
  const createdObjectIds = effects?.created?.map((effect) => effect.reference.objectId) ?? [];
484
478
  const createdObjects = await __privateGet(this, _suiClient).multiGetObjects({
@@ -575,7 +569,7 @@ class WalrusClient {
575
569
  ...options,
576
570
  owner: options.owner ?? options.transaction?.getData().sender ?? signer.toSuiAddress()
577
571
  });
578
- const blobType = await __privateGet(this, _getBlobType).call(this);
572
+ const blobType = await this.getBlobType();
579
573
  const { digest, effects } = await __privateMethod(this, _WalrusClient_instances, executeTransaction_fn).call(this, transaction, signer, "register blob");
580
574
  const createdObjectIds = effects?.created?.map((effect) => effect.reference.objectId) ?? [];
581
575
  const createdObjects = await __privateGet(this, _suiClient).multiGetObjects({
@@ -1168,7 +1162,6 @@ _readCommittee = new WeakMap();
1168
1162
  _memo = new WeakMap();
1169
1163
  _walType = new WeakMap();
1170
1164
  _getPackageId = new WeakMap();
1171
- _getBlobType = new WeakMap();
1172
1165
  _getSystemContract = new WeakMap();
1173
1166
  _getSubsidiesContract = new WeakMap();
1174
1167
  _getBlobContract = new WeakMap();