@mysten/walrus 0.0.4 → 0.0.6
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 +15 -0
- package/dist/cjs/client.js +3 -3
- package/dist/cjs/client.js.map +2 -2
- package/dist/cjs/storage-node/client.js +1 -1
- package/dist/cjs/storage-node/client.js.map +2 -2
- package/dist/cjs/wasm.d.ts +4 -7
- package/dist/cjs/wasm.js +37 -27
- package/dist/cjs/wasm.js.map +3 -3
- package/dist/esm/client.js +3 -3
- package/dist/esm/client.js.map +2 -2
- package/dist/esm/storage-node/client.js +1 -1
- package/dist/esm/storage-node/client.js.map +2 -2
- package/dist/esm/wasm.d.ts +4 -7
- package/dist/esm/wasm.js +24 -24
- package/dist/esm/wasm.js.map +2 -2
- package/dist/tsconfig.esm.tsbuildinfo +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +5 -5
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/storage-node/client.ts"],
|
|
4
|
-
"sourcesContent": ["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { BlobMetadata, BlobMetadataWithId, SliverData } from '../utils/bcs.js';\nimport {\n\tConnectionTimeoutError,\n\tStorageNodeAPIError,\n\tStorageNodeError,\n\tUserAbortError,\n} from './error.js';\nimport type {\n\tGetBlobMetadataRequestInput,\n\tGetBlobMetadataResponse,\n\tGetBlobStatusRequestInput,\n\tGetBlobStatusResponse,\n\tGetDeletableBlobConfirmationRequestInput,\n\tGetDeletableBlobConfirmationResponse,\n\tGetPermanentBlobConfirmationRequestInput,\n\tGetPermanentBlobConfirmationResponse,\n\tGetSliverRequestInput,\n\tGetSliverResponse,\n\tRawGetBlobStatusResponse,\n\tStoreBlobMetadataRequestInput,\n\tStoreBlobMetadataResponse,\n\tStoreSliverRequestInput,\n\tStoreSliverResponse,\n} from './types.js';\nimport { mergeHeaders } from './utils.js';\n\nexport type Fetch = (url: RequestInfo, init?: RequestInit) => Promise<Response>;\n\nexport type StorageNodeClientOptions = {\n\t/**\n\t * An optional custom fetch function.\n\t *\n\t * If not provided, defaults to the global `fetch` function (`globalThis.fetch`).\n\t *\n\t * @default globalThis.fetch\n\t */\n\tfetch?: Fetch;\n\n\t/**\n\t * An optional timeout for requests.\n\t * @default 30_000ms (30 seconds)\n\t */\n\ttimeout?: number;\n};\n\nexport type RequestOptions = {\n\tnodeUrl: string;\n\ttimeout?: number;\n\theaders?: ReturnType<typeof mergeHeaders>;\n} & Omit<RequestInit, 'headers'>;\n\nexport class StorageNodeClient {\n\t#fetch: Fetch;\n\t#timeout: number;\n\n\tconstructor({ fetch: overriddenFetch, timeout }: StorageNodeClientOptions = {}) {\n\t\tthis.#fetch = overriddenFetch ?? globalThis.fetch;\n\t\tthis.#timeout = timeout ?? 30_000;\n\t}\n\n\t/**\n\t * Gets the metadata associated with a Walrus blob.\n\t */\n\tasync getBlobMetadata(\n\t\t{ blobId }: GetBlobMetadataRequestInput,\n\t\toptions: RequestOptions,\n\t): Promise<GetBlobMetadataResponse> {\n\t\tconst response = await this.#request(`/v1/blobs/${blobId}/metadata`, {\n\t\t\t...options,\n\t\t\theaders: mergeHeaders({ Accept: 'application/octet-stream' }, options.headers),\n\t\t});\n\n\t\tconst bcsBytes = await response.arrayBuffer();\n\t\treturn BlobMetadataWithId.parse(new Uint8Array(bcsBytes));\n\t}\n\n\t/**\n\t * Gets the status associated with a Walrus blob.\n\t */\n\tasync getBlobStatus(\n\t\t{ blobId }: GetBlobStatusRequestInput,\n\t\toptions: RequestOptions,\n\t): Promise<GetBlobStatusResponse> {\n\t\tconst response = await this.#request(`/v1/blobs/${blobId}/status`, options);\n\n\t\tconst json: RawGetBlobStatusResponse = await response.json();\n\t\tconst blobStatus = json.success.data;\n\n\t\tif (blobStatus === 'nonexistent') {\n\t\t\treturn { type: 'nonexistent' };\n\t\t}\n\n\t\tif ('invalid' in blobStatus) {\n\t\t\treturn {\n\t\t\t\ttype: 'invalid',\n\t\t\t\t...blobStatus.invalid,\n\t\t\t};\n\t\t}\n\n\t\tif ('permanent' in blobStatus) {\n\t\t\treturn {\n\t\t\t\ttype: 'permanent',\n\t\t\t\t...blobStatus.permanent,\n\t\t\t};\n\t\t}\n\n\t\tif ('deletable' in blobStatus) {\n\t\t\treturn {\n\t\t\t\ttype: 'deletable',\n\t\t\t\t...blobStatus.deletable,\n\t\t\t};\n\t\t}\n\n\t\tthrow new StorageNodeError(`Unknown blob status received: ${blobStatus}`);\n\t}\n\n\t/**\n\t * Stores the metadata associated with a registered Walrus blob at this storage\n\t * node. This is a pre-requisite for storing the encoded slivers of the blob. The\n\t * ID of the blob must first be registered on Sui, after which storing the metadata\n\t * becomes possible.\n\t *\n\t * This endpoint may return an error if the node has not yet received the\n\t * registration event from the chain.\n\t */\n\tasync storeBlobMetadata(\n\t\t{ blobId, metadata }: StoreBlobMetadataRequestInput,\n\t\toptions: RequestOptions,\n\t): Promise<StoreBlobMetadataResponse> {\n\t\tconst isBcsInput = typeof metadata === 'object' && 'V1' in metadata;\n\t\tconst body = isBcsInput ? BlobMetadata.serialize(metadata).toBytes() : metadata;\n\n\t\tconst response = await this.#request(`/v1/blobs/${blobId}/metadata`, {\n\t\t\t...options,\n\t\t\tmethod: 'PUT',\n\t\t\tbody,\n\t\t\theaders: mergeHeaders({ 'Content-Type': 'application/octet-stream' }, options.headers),\n\t\t});\n\n\t\tconst json: StoreBlobMetadataResponse = await response.json();\n\t\treturn json;\n\t}\n\n\t/**\n\t * Gets the primary or secondary sliver identified by the specified blob ID and\n\t * index. The index should represent a sliver that is assigned to be stored at one\n\t * of the shards managed by this storage node during this epoch.\n\t */\n\tasync getSliver(\n\t\t{ blobId, sliverPairIndex, sliverType }: GetSliverRequestInput,\n\t\toptions: RequestOptions,\n\t): Promise<GetSliverResponse> {\n\t\tconst response = await this.#request(\n\t\t\t`/v1/blobs/${blobId}/slivers/${sliverPairIndex}/${sliverType}`,\n\t\t\t{\n\t\t\t\t...options,\n\t\t\t\theaders: mergeHeaders({ Accept: 'application/octet-stream' }, options.headers),\n\t\t\t},\n\t\t);\n\n\t\tconst bcsBytes = await response.arrayBuffer();\n\t\treturn SliverData.parse(new Uint8Array(bcsBytes));\n\t}\n\n\t/**\n\t * Stores a primary or secondary blob sliver at the storage node.\n\t */\n\tasync storeSliver(\n\t\t{ blobId, sliverPairIndex, sliverType, sliver }: StoreSliverRequestInput,\n\t\toptions: RequestOptions,\n\t): Promise<StoreSliverResponse> {\n\t\tconst isBcsInput = typeof sliver === 'object' && 'symbols' in sliver;\n\t\tconst body = isBcsInput ? SliverData.serialize(sliver).toBytes() : sliver;\n\n\t\tconst response = await this.#request(\n\t\t\t`/v1/blobs/${blobId}/slivers/${sliverPairIndex}/${sliverType}`,\n\t\t\t{\n\t\t\t\t...options,\n\t\t\t\tmethod: 'PUT',\n\t\t\t\tbody,\n\t\t\t\theaders: mergeHeaders({ 'Content-Type': 'application/octet-stream' }, options.headers),\n\t\t\t},\n\t\t);\n\n\t\tconst json: StoreSliverResponse = await response.json();\n\t\treturn json;\n\t}\n\n\t/**\n\t * Gets a signed storage confirmation from this storage node, indicating that all shards\n\t * assigned to this storage node for the current epoch have stored their respective slivers.\n\t */\n\tasync getDeletableBlobConfirmation(\n\t\t{ blobId, objectId }: GetDeletableBlobConfirmationRequestInput,\n\t\toptions: RequestOptions,\n\t): Promise<GetDeletableBlobConfirmationResponse> {\n\t\tconst response = await this.#request(\n\t\t\t`/v1/blobs/${blobId}/confirmation/deletable/${objectId}`,\n\t\t\toptions,\n\t\t);\n\n\t\tconst json: GetDeletableBlobConfirmationResponse = await response.json();\n\t\treturn json;\n\t}\n\n\t/**\n\t * Gets a signed storage confirmation from this storage node, indicating that all shards\n\t * assigned to this storage node for the current epoch have stored their respective slivers.\n\t */\n\tasync getPermanentBlobConfirmation(\n\t\t{ blobId }: GetPermanentBlobConfirmationRequestInput,\n\t\toptions: RequestOptions,\n\t): Promise<GetPermanentBlobConfirmationResponse> {\n\t\tconst response = await this.#request(`/v1/blobs/${blobId}/confirmation/permanent`, options);\n\n\t\tconst json: GetPermanentBlobConfirmationResponse = await response.json();\n\t\treturn json;\n\t}\n\n\tasync #request(path: string, options: RequestOptions) {\n\t\tconst { nodeUrl, signal, timeout, ...init } = options;\n\n\t\tif (signal?.aborted) {\n\t\t\tthrow new UserAbortError();\n\t\t}\n\n\t\tconst timeoutSignal = AbortSignal.timeout(timeout ?? this.#timeout);\n\n\t\tlet response: Response | undefined;\n\n\t\ttry {\n\t\t\tresponse = await this.#fetch(`${nodeUrl}${path}`, {\n\t\t\t\t...init,\n\t\t\t\tsignal: signal ? AbortSignal.any([timeoutSignal, signal]) : timeoutSignal,\n\t\t\t});\n\t\t} catch (error) {\n\t\t\tif (signal?.aborted) {\n\t\t\t\tthrow new UserAbortError();\n\t\t\t}\n\n\t\t\tif (error instanceof Error && error.name === 'AbortError') {\n\t\t\t\tthrow new ConnectionTimeoutError();\n\t\t\t}\n\n\t\t\tthrow error;\n\t\t}\n\n\t\tif (!response.ok) {\n\t\t\tconst errorText = await response.text().catch((reason) => reason);\n\t\t\tconst errorJSON = safeParseJSON(errorText);\n\t\t\tconst errorMessage = errorJSON ? undefined : errorText;\n\t\t\tthrow StorageNodeAPIError.generate(response.status, errorJSON, errorMessage);\n\t\t}\n\n\t\treturn response;\n\t}\n}\n\nfunction safeParseJSON(value: string) {\n\ttry {\n\t\treturn JSON.parse(value);\n\t} catch {\n\t\treturn undefined;\n\t}\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;AAAA;AAGA,SAAS,cAAc,oBAAoB,kBAAkB;AAC7D;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACM;AAkBP,SAAS,oBAAoB;AA2BtB,MAAM,kBAAkB;AAAA,EAI9B,YAAY,EAAE,OAAO,iBAAiB,QAAQ,IAA8B,CAAC,GAAG;AAJ1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Aa,MAAM,2BAA2B,QAAQ,IACtD;AAGD,UAAM,OAA6C,MAAM,SAAS,KAAK;AACvE,WAAO;AAAA,EACR;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,MAAM,6BACL,EAAE,OAAO,GACT,SACgD;AAChD,UAAM,WAAW,MAAM,sBAAK,0CAAL,WAAc,aAAa,MAAM,2BAA2B;AAEnF,UAAM,OAA6C,MAAM,SAAS,KAAK;AACvE,WAAO;AAAA,EACR;AAuCD;AA5MC;AACA;AAFM;AAwKA,aAAQ,eAAC,MAAc,SAAyB;AACrD,QAAM,EAAE,SAAS,QAAQ,SAAS,GAAG,KAAK,IAAI;AAE9C,MAAI,QAAQ,SAAS;AACpB,UAAM,IAAI,eAAe;AAAA,EAC1B;AAEA,QAAM,gBAAgB,YAAY,QAAQ,WAAW,mBAAK,SAAQ;AAElE,MAAI;AAEJ,MAAI;AACH,eAAW,
|
|
4
|
+
"sourcesContent": ["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { BlobMetadata, BlobMetadataWithId, SliverData } from '../utils/bcs.js';\nimport {\n\tConnectionTimeoutError,\n\tStorageNodeAPIError,\n\tStorageNodeError,\n\tUserAbortError,\n} from './error.js';\nimport type {\n\tGetBlobMetadataRequestInput,\n\tGetBlobMetadataResponse,\n\tGetBlobStatusRequestInput,\n\tGetBlobStatusResponse,\n\tGetDeletableBlobConfirmationRequestInput,\n\tGetDeletableBlobConfirmationResponse,\n\tGetPermanentBlobConfirmationRequestInput,\n\tGetPermanentBlobConfirmationResponse,\n\tGetSliverRequestInput,\n\tGetSliverResponse,\n\tRawGetBlobStatusResponse,\n\tStoreBlobMetadataRequestInput,\n\tStoreBlobMetadataResponse,\n\tStoreSliverRequestInput,\n\tStoreSliverResponse,\n} from './types.js';\nimport { mergeHeaders } from './utils.js';\n\nexport type Fetch = (url: RequestInfo, init?: RequestInit) => Promise<Response>;\n\nexport type StorageNodeClientOptions = {\n\t/**\n\t * An optional custom fetch function.\n\t *\n\t * If not provided, defaults to the global `fetch` function (`globalThis.fetch`).\n\t *\n\t * @default globalThis.fetch\n\t */\n\tfetch?: Fetch;\n\n\t/**\n\t * An optional timeout for requests.\n\t * @default 30_000ms (30 seconds)\n\t */\n\ttimeout?: number;\n};\n\nexport type RequestOptions = {\n\tnodeUrl: string;\n\ttimeout?: number;\n\theaders?: ReturnType<typeof mergeHeaders>;\n} & Omit<RequestInit, 'headers'>;\n\nexport class StorageNodeClient {\n\t#fetch: Fetch;\n\t#timeout: number;\n\n\tconstructor({ fetch: overriddenFetch, timeout }: StorageNodeClientOptions = {}) {\n\t\tthis.#fetch = overriddenFetch ?? globalThis.fetch;\n\t\tthis.#timeout = timeout ?? 30_000;\n\t}\n\n\t/**\n\t * Gets the metadata associated with a Walrus blob.\n\t */\n\tasync getBlobMetadata(\n\t\t{ blobId }: GetBlobMetadataRequestInput,\n\t\toptions: RequestOptions,\n\t): Promise<GetBlobMetadataResponse> {\n\t\tconst response = await this.#request(`/v1/blobs/${blobId}/metadata`, {\n\t\t\t...options,\n\t\t\theaders: mergeHeaders({ Accept: 'application/octet-stream' }, options.headers),\n\t\t});\n\n\t\tconst bcsBytes = await response.arrayBuffer();\n\t\treturn BlobMetadataWithId.parse(new Uint8Array(bcsBytes));\n\t}\n\n\t/**\n\t * Gets the status associated with a Walrus blob.\n\t */\n\tasync getBlobStatus(\n\t\t{ blobId }: GetBlobStatusRequestInput,\n\t\toptions: RequestOptions,\n\t): Promise<GetBlobStatusResponse> {\n\t\tconst response = await this.#request(`/v1/blobs/${blobId}/status`, options);\n\n\t\tconst json: RawGetBlobStatusResponse = await response.json();\n\t\tconst blobStatus = json.success.data;\n\n\t\tif (blobStatus === 'nonexistent') {\n\t\t\treturn { type: 'nonexistent' };\n\t\t}\n\n\t\tif ('invalid' in blobStatus) {\n\t\t\treturn {\n\t\t\t\ttype: 'invalid',\n\t\t\t\t...blobStatus.invalid,\n\t\t\t};\n\t\t}\n\n\t\tif ('permanent' in blobStatus) {\n\t\t\treturn {\n\t\t\t\ttype: 'permanent',\n\t\t\t\t...blobStatus.permanent,\n\t\t\t};\n\t\t}\n\n\t\tif ('deletable' in blobStatus) {\n\t\t\treturn {\n\t\t\t\ttype: 'deletable',\n\t\t\t\t...blobStatus.deletable,\n\t\t\t};\n\t\t}\n\n\t\tthrow new StorageNodeError(`Unknown blob status received: ${blobStatus}`);\n\t}\n\n\t/**\n\t * Stores the metadata associated with a registered Walrus blob at this storage\n\t * node. This is a pre-requisite for storing the encoded slivers of the blob. The\n\t * ID of the blob must first be registered on Sui, after which storing the metadata\n\t * becomes possible.\n\t *\n\t * This endpoint may return an error if the node has not yet received the\n\t * registration event from the chain.\n\t */\n\tasync storeBlobMetadata(\n\t\t{ blobId, metadata }: StoreBlobMetadataRequestInput,\n\t\toptions: RequestOptions,\n\t): Promise<StoreBlobMetadataResponse> {\n\t\tconst isBcsInput = typeof metadata === 'object' && 'V1' in metadata;\n\t\tconst body = isBcsInput ? BlobMetadata.serialize(metadata).toBytes() : metadata;\n\n\t\tconst response = await this.#request(`/v1/blobs/${blobId}/metadata`, {\n\t\t\t...options,\n\t\t\tmethod: 'PUT',\n\t\t\tbody,\n\t\t\theaders: mergeHeaders({ 'Content-Type': 'application/octet-stream' }, options.headers),\n\t\t});\n\n\t\tconst json: StoreBlobMetadataResponse = await response.json();\n\t\treturn json;\n\t}\n\n\t/**\n\t * Gets the primary or secondary sliver identified by the specified blob ID and\n\t * index. The index should represent a sliver that is assigned to be stored at one\n\t * of the shards managed by this storage node during this epoch.\n\t */\n\tasync getSliver(\n\t\t{ blobId, sliverPairIndex, sliverType }: GetSliverRequestInput,\n\t\toptions: RequestOptions,\n\t): Promise<GetSliverResponse> {\n\t\tconst response = await this.#request(\n\t\t\t`/v1/blobs/${blobId}/slivers/${sliverPairIndex}/${sliverType}`,\n\t\t\t{\n\t\t\t\t...options,\n\t\t\t\theaders: mergeHeaders({ Accept: 'application/octet-stream' }, options.headers),\n\t\t\t},\n\t\t);\n\n\t\tconst bcsBytes = await response.arrayBuffer();\n\t\treturn SliverData.parse(new Uint8Array(bcsBytes));\n\t}\n\n\t/**\n\t * Stores a primary or secondary blob sliver at the storage node.\n\t */\n\tasync storeSliver(\n\t\t{ blobId, sliverPairIndex, sliverType, sliver }: StoreSliverRequestInput,\n\t\toptions: RequestOptions,\n\t): Promise<StoreSliverResponse> {\n\t\tconst isBcsInput = typeof sliver === 'object' && 'symbols' in sliver;\n\t\tconst body = isBcsInput ? SliverData.serialize(sliver).toBytes() : sliver;\n\n\t\tconst response = await this.#request(\n\t\t\t`/v1/blobs/${blobId}/slivers/${sliverPairIndex}/${sliverType}`,\n\t\t\t{\n\t\t\t\t...options,\n\t\t\t\tmethod: 'PUT',\n\t\t\t\tbody,\n\t\t\t\theaders: mergeHeaders({ 'Content-Type': 'application/octet-stream' }, options.headers),\n\t\t\t},\n\t\t);\n\n\t\tconst json: StoreSliverResponse = await response.json();\n\t\treturn json;\n\t}\n\n\t/**\n\t * Gets a signed storage confirmation from this storage node, indicating that all shards\n\t * assigned to this storage node for the current epoch have stored their respective slivers.\n\t */\n\tasync getDeletableBlobConfirmation(\n\t\t{ blobId, objectId }: GetDeletableBlobConfirmationRequestInput,\n\t\toptions: RequestOptions,\n\t): Promise<GetDeletableBlobConfirmationResponse> {\n\t\tconst response = await this.#request(\n\t\t\t`/v1/blobs/${blobId}/confirmation/deletable/${objectId}`,\n\t\t\toptions,\n\t\t);\n\n\t\tconst json: GetDeletableBlobConfirmationResponse = await response.json();\n\t\treturn json;\n\t}\n\n\t/**\n\t * Gets a signed storage confirmation from this storage node, indicating that all shards\n\t * assigned to this storage node for the current epoch have stored their respective slivers.\n\t */\n\tasync getPermanentBlobConfirmation(\n\t\t{ blobId }: GetPermanentBlobConfirmationRequestInput,\n\t\toptions: RequestOptions,\n\t): Promise<GetPermanentBlobConfirmationResponse> {\n\t\tconst response = await this.#request(`/v1/blobs/${blobId}/confirmation/permanent`, options);\n\n\t\tconst json: GetPermanentBlobConfirmationResponse = await response.json();\n\t\treturn json;\n\t}\n\n\tasync #request(path: string, options: RequestOptions) {\n\t\tconst { nodeUrl, signal, timeout, ...init } = options;\n\n\t\tif (signal?.aborted) {\n\t\t\tthrow new UserAbortError();\n\t\t}\n\n\t\tconst timeoutSignal = AbortSignal.timeout(timeout ?? this.#timeout);\n\n\t\tlet response: Response | undefined;\n\n\t\ttry {\n\t\t\tresponse = await (0, this.#fetch)(`${nodeUrl}${path}`, {\n\t\t\t\t...init,\n\t\t\t\tsignal: signal ? AbortSignal.any([timeoutSignal, signal]) : timeoutSignal,\n\t\t\t});\n\t\t} catch (error) {\n\t\t\tif (signal?.aborted) {\n\t\t\t\tthrow new UserAbortError();\n\t\t\t}\n\n\t\t\tif (error instanceof Error && error.name === 'AbortError') {\n\t\t\t\tthrow new ConnectionTimeoutError();\n\t\t\t}\n\n\t\t\tthrow error;\n\t\t}\n\n\t\tif (!response.ok) {\n\t\t\tconst errorText = await response.text().catch((reason) => reason);\n\t\t\tconst errorJSON = safeParseJSON(errorText);\n\t\t\tconst errorMessage = errorJSON ? undefined : errorText;\n\t\t\tthrow StorageNodeAPIError.generate(response.status, errorJSON, errorMessage);\n\t\t}\n\n\t\treturn response;\n\t}\n}\n\nfunction safeParseJSON(value: string) {\n\ttry {\n\t\treturn JSON.parse(value);\n\t} catch {\n\t\treturn undefined;\n\t}\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;AAAA;AAGA,SAAS,cAAc,oBAAoB,kBAAkB;AAC7D;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACM;AAkBP,SAAS,oBAAoB;AA2BtB,MAAM,kBAAkB;AAAA,EAI9B,YAAY,EAAE,OAAO,iBAAiB,QAAQ,IAA8B,CAAC,GAAG;AAJ1E;AACN;AACA;AAGC,uBAAK,QAAS,mBAAmB,WAAW;AAC5C,uBAAK,UAAW,WAAW;AAAA,EAC5B;AAAA;AAAA;AAAA;AAAA,EAKA,MAAM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1
|
+
import type { StorageConfirmation } from './storage-node/types.js';
|
|
1
2
|
import type { EncodingType } from './types.js';
|
|
2
3
|
import type { BlobMetadata, BlobMetadataWithId, SliverData, SliverPair } from './utils/bcs.js';
|
|
3
4
|
export interface EncodedBlob {
|
|
@@ -6,17 +7,13 @@ export interface EncodedBlob {
|
|
|
6
7
|
metadata: typeof BlobMetadata.$inferInput;
|
|
7
8
|
rootHash: Uint8Array;
|
|
8
9
|
}
|
|
9
|
-
export declare function encodeBlob(nShards: number, bytes: Uint8Array, encodingType?: EncodingType): EncodedBlob
|
|
10
|
+
export declare function encodeBlob(nShards: number, bytes: Uint8Array, encodingType?: EncodingType): Promise<EncodedBlob>;
|
|
10
11
|
export interface CombinedSignature {
|
|
11
12
|
signers: number[];
|
|
12
13
|
serializedMessage: Uint8Array;
|
|
13
|
-
signature:
|
|
14
|
+
signature: Uint8Array;
|
|
14
15
|
}
|
|
15
|
-
export
|
|
16
|
-
serializedMessage: string;
|
|
17
|
-
signature: string;
|
|
18
|
-
}
|
|
19
|
-
export declare function combineSignatures(confirmations: Confirmation[], signerIndices: number[]): CombinedSignature;
|
|
16
|
+
export declare function combineSignatures(confirmations: StorageConfirmation[], signerIndices: number[]): Promise<CombinedSignature>;
|
|
20
17
|
export declare function decodePrimarySlivers(blobId: string, nShards: number, size: number | bigint | string, slivers: (typeof SliverData.$inferInput)[], encodingType?: EncodingType): Uint8Array;
|
|
21
18
|
export declare function computeMetadata(nShards: number, bytes: Uint8Array, encodingType?: EncodingType): typeof BlobMetadataWithId.$inferInput & {
|
|
22
19
|
blob_id: string;
|
package/dist/esm/wasm.js
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { fromBase64 } from "@mysten/bcs";
|
|
2
|
+
import init, { BlobEncoder, bls12381_min_pk_aggregate } from "@mysten/walrus-wasm";
|
|
3
|
+
import { BlobId, blobIdFromBytes } from "./utils/bcs.js";
|
|
4
|
+
async function encodeBlob(nShards, bytes, encodingType = "RS2") {
|
|
5
|
+
await init();
|
|
4
6
|
const encoder = new BlobEncoder(nShards);
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
);
|
|
7
|
+
if (encodingType !== "RS2") {
|
|
8
|
+
throw new Error(`Unsupported encoding type: ${encodingType}`);
|
|
9
|
+
}
|
|
10
|
+
const [sliverPairs, metadata, rootHash] = encoder.encode_with_metadata(bytes);
|
|
9
11
|
return {
|
|
10
12
|
sliverPairs,
|
|
11
13
|
blobId: blobIdFromBytes(new Uint8Array(metadata.blob_id)),
|
|
@@ -13,40 +15,38 @@ function encodeBlob(nShards, bytes, encodingType = "RS2") {
|
|
|
13
15
|
rootHash: new Uint8Array(rootHash.Digest)
|
|
14
16
|
};
|
|
15
17
|
}
|
|
16
|
-
function combineSignatures(confirmations, signerIndices) {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
confirmations.map((confirmation) => (
|
|
20
|
-
serializedMessage: confirmation.serializedMessage,
|
|
21
|
-
signature: confirmation.signature
|
|
22
|
-
})),
|
|
23
|
-
new Uint16Array(signerIndices)
|
|
18
|
+
async function combineSignatures(confirmations, signerIndices) {
|
|
19
|
+
await init();
|
|
20
|
+
const signature = bls12381_min_pk_aggregate(
|
|
21
|
+
confirmations.map((confirmation) => fromBase64(confirmation.signature))
|
|
24
22
|
);
|
|
25
23
|
return {
|
|
26
24
|
signers: signerIndices,
|
|
27
|
-
serializedMessage:
|
|
28
|
-
signature
|
|
25
|
+
serializedMessage: fromBase64(confirmations[0].serializedMessage),
|
|
26
|
+
signature
|
|
29
27
|
};
|
|
30
28
|
}
|
|
31
29
|
function decodePrimarySlivers(blobId, nShards, size, slivers, encodingType = "RS2") {
|
|
32
30
|
const encoder = new BlobEncoder(nShards);
|
|
33
|
-
|
|
31
|
+
if (encodingType !== "RS2") {
|
|
32
|
+
throw new Error(`Unsupported encoding type: ${encodingType}`);
|
|
33
|
+
}
|
|
34
|
+
const [bytes] = encoder.decode(
|
|
34
35
|
BlobId.serialize(blobId).toBytes(),
|
|
35
36
|
BigInt(size),
|
|
36
37
|
slivers.map((sliver) => ({
|
|
37
38
|
...sliver,
|
|
38
39
|
_sliver_type: void 0
|
|
39
|
-
}))
|
|
40
|
-
BcsEncodingType.serialize(encodingType).toBytes()[0]
|
|
40
|
+
}))
|
|
41
41
|
);
|
|
42
42
|
return new Uint8Array(bytes);
|
|
43
43
|
}
|
|
44
44
|
function computeMetadata(nShards, bytes, encodingType = "RS2") {
|
|
45
45
|
const encoder = new BlobEncoder(nShards);
|
|
46
|
-
const metadata = encoder.compute_metadata(
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
46
|
+
const metadata = encoder.compute_metadata(bytes);
|
|
47
|
+
if (encodingType !== "RS2") {
|
|
48
|
+
throw new Error(`Unsupported encoding type: ${encodingType}`);
|
|
49
|
+
}
|
|
50
50
|
return {
|
|
51
51
|
...metadata,
|
|
52
52
|
blob_id: blobIdFromBytes(new Uint8Array(metadata.blob_id))
|
package/dist/esm/wasm.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/wasm.ts"],
|
|
4
|
-
"sourcesContent": ["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nimport {
|
|
5
|
-
"mappings": "AAGA,SAAS,aAAa,
|
|
4
|
+
"sourcesContent": ["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { fromBase64 } from '@mysten/bcs';\nimport init, { BlobEncoder, bls12381_min_pk_aggregate } from '@mysten/walrus-wasm';\n\nimport type { StorageConfirmation } from './storage-node/types.js';\nimport type { EncodingType } from './types.js';\nimport type { BlobMetadata, BlobMetadataWithId, SliverData, SliverPair } from './utils/bcs.js';\nimport { BlobId, blobIdFromBytes } from './utils/bcs.js';\n\nexport interface EncodedBlob {\n\tsliverPairs: (typeof SliverPair.$inferInput)[];\n\tblobId: string;\n\tmetadata: typeof BlobMetadata.$inferInput;\n\trootHash: Uint8Array;\n}\n\nexport async function encodeBlob(\n\tnShards: number,\n\tbytes: Uint8Array,\n\tencodingType: EncodingType = 'RS2',\n): Promise<EncodedBlob> {\n\tawait init();\n\n\tconst encoder = new BlobEncoder(nShards);\n\n\tif (encodingType !== 'RS2') {\n\t\tthrow new Error(`Unsupported encoding type: ${encodingType}`);\n\t}\n\n\tconst [sliverPairs, metadata, rootHash] = encoder.encode_with_metadata(bytes);\n\n\treturn {\n\t\tsliverPairs,\n\t\tblobId: blobIdFromBytes(new Uint8Array(metadata.blob_id)),\n\t\tmetadata: metadata.metadata,\n\t\trootHash: new Uint8Array(rootHash.Digest),\n\t};\n}\n\nexport interface CombinedSignature {\n\tsigners: number[];\n\tserializedMessage: Uint8Array;\n\tsignature: Uint8Array;\n}\n\nexport async function combineSignatures(\n\tconfirmations: StorageConfirmation[],\n\tsignerIndices: number[],\n): Promise<CombinedSignature> {\n\tawait init();\n\n\tconst signature = bls12381_min_pk_aggregate(\n\t\tconfirmations.map((confirmation) => fromBase64(confirmation.signature)),\n\t);\n\n\treturn {\n\t\tsigners: signerIndices,\n\t\tserializedMessage: fromBase64(confirmations[0].serializedMessage),\n\t\tsignature,\n\t};\n}\n\nexport function decodePrimarySlivers(\n\tblobId: string,\n\tnShards: number,\n\tsize: number | bigint | string,\n\tslivers: (typeof SliverData.$inferInput)[],\n\tencodingType: EncodingType = 'RS2',\n): Uint8Array {\n\tconst encoder = new BlobEncoder(nShards);\n\n\tif (encodingType !== 'RS2') {\n\t\tthrow new Error(`Unsupported encoding type: ${encodingType}`);\n\t}\n\n\tconst [bytes] = encoder.decode(\n\t\tBlobId.serialize(blobId).toBytes(),\n\t\tBigInt(size),\n\t\tslivers.map((sliver) => ({\n\t\t\t...sliver,\n\t\t\t_sliver_type: undefined,\n\t\t})),\n\t);\n\n\treturn new Uint8Array(bytes);\n}\n\nexport function computeMetadata(\n\tnShards: number,\n\tbytes: Uint8Array,\n\tencodingType: EncodingType = 'RS2',\n): typeof BlobMetadataWithId.$inferInput & { blob_id: string } {\n\tconst encoder = new BlobEncoder(nShards);\n\tconst metadata = encoder.compute_metadata(bytes);\n\n\tif (encodingType !== 'RS2') {\n\t\tthrow new Error(`Unsupported encoding type: ${encodingType}`);\n\t}\n\n\treturn {\n\t\t...metadata,\n\t\tblob_id: blobIdFromBytes(new Uint8Array(metadata.blob_id)),\n\t};\n}\n"],
|
|
5
|
+
"mappings": "AAGA,SAAS,kBAAkB;AAC3B,OAAO,QAAQ,aAAa,iCAAiC;AAK7D,SAAS,QAAQ,uBAAuB;AASxC,eAAsB,WACrB,SACA,OACA,eAA6B,OACN;AACvB,QAAM,KAAK;AAEX,QAAM,UAAU,IAAI,YAAY,OAAO;AAEvC,MAAI,iBAAiB,OAAO;AAC3B,UAAM,IAAI,MAAM,8BAA8B,YAAY,EAAE;AAAA,EAC7D;AAEA,QAAM,CAAC,aAAa,UAAU,QAAQ,IAAI,QAAQ,qBAAqB,KAAK;AAE5E,SAAO;AAAA,IACN;AAAA,IACA,QAAQ,gBAAgB,IAAI,WAAW,SAAS,OAAO,CAAC;AAAA,IACxD,UAAU,SAAS;AAAA,IACnB,UAAU,IAAI,WAAW,SAAS,MAAM;AAAA,EACzC;AACD;AAQA,eAAsB,kBACrB,eACA,eAC6B;AAC7B,QAAM,KAAK;AAEX,QAAM,YAAY;AAAA,IACjB,cAAc,IAAI,CAAC,iBAAiB,WAAW,aAAa,SAAS,CAAC;AAAA,EACvE;AAEA,SAAO;AAAA,IACN,SAAS;AAAA,IACT,mBAAmB,WAAW,cAAc,CAAC,EAAE,iBAAiB;AAAA,IAChE;AAAA,EACD;AACD;AAEO,SAAS,qBACf,QACA,SACA,MACA,SACA,eAA6B,OAChB;AACb,QAAM,UAAU,IAAI,YAAY,OAAO;AAEvC,MAAI,iBAAiB,OAAO;AAC3B,UAAM,IAAI,MAAM,8BAA8B,YAAY,EAA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