@mysten/walrus 0.0.2 → 0.0.4
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 +14 -0
- package/README.md +6 -8
- package/dist/cjs/client.d.ts +5 -89
- package/dist/cjs/client.js +194 -137
- package/dist/cjs/client.js.map +3 -3
- package/dist/cjs/constants.d.ts +13 -2
- package/dist/cjs/constants.js +6 -3
- package/dist/cjs/constants.js.map +2 -2
- package/dist/cjs/contracts/subsidies.d.ts +83 -0
- package/dist/cjs/contracts/subsidies.js +253 -0
- package/dist/cjs/contracts/subsidies.js.map +7 -0
- package/dist/cjs/types.d.ts +5 -6
- package/dist/cjs/types.js.map +1 -1
- package/dist/cjs/utils/index.d.ts +2 -0
- package/dist/cjs/utils/index.js +46 -1
- package/dist/cjs/utils/index.js.map +2 -2
- package/dist/cjs/utils/memo.d.ts +5 -0
- package/dist/cjs/utils/memo.js +59 -0
- package/dist/cjs/utils/memo.js.map +7 -0
- package/dist/cjs/utils/object-loader.js +2 -2
- package/dist/cjs/utils/object-loader.js.map +2 -2
- package/dist/esm/client.d.ts +5 -89
- package/dist/esm/client.js +182 -120
- package/dist/esm/client.js.map +3 -3
- package/dist/esm/constants.d.ts +13 -2
- package/dist/esm/constants.js +6 -3
- package/dist/esm/constants.js.map +2 -2
- package/dist/esm/contracts/subsidies.d.ts +83 -0
- package/dist/esm/contracts/subsidies.js +223 -0
- package/dist/esm/contracts/subsidies.js.map +7 -0
- package/dist/esm/types.d.ts +5 -6
- package/dist/esm/utils/index.d.ts +2 -0
- package/dist/esm/utils/index.js +46 -1
- package/dist/esm/utils/index.js.map +2 -2
- package/dist/esm/utils/memo.d.ts +5 -0
- package/dist/esm/utils/memo.js +39 -0
- package/dist/esm/utils/memo.js.map +7 -0
- package/dist/esm/utils/object-loader.js +2 -2
- package/dist/esm/utils/object-loader.js.map +2 -2
- package/dist/tsconfig.esm.tsbuildinfo +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @mysten/walrus
|
|
2
2
|
|
|
3
|
+
## 0.0.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 833e007: Add mainnet package ids
|
|
8
|
+
- 833e007: Add support for subsidies
|
|
9
|
+
|
|
10
|
+
## 0.0.3
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- Updated dependencies [e8b5d04]
|
|
15
|
+
- @mysten/sui@1.25.0
|
|
16
|
+
|
|
3
17
|
## 0.0.2
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -34,16 +34,14 @@ you to connect to a different network or updated deployment of the walrus contra
|
|
|
34
34
|
const walrusClient = new WalrusClient({
|
|
35
35
|
suiClient,
|
|
36
36
|
packageConfig: {
|
|
37
|
-
packageId: '0x795ddbc26b8cfff2551f45e198b87fc19473f2df50f995376b924ac80e56f88b',
|
|
38
37
|
systemObjectId: '0x98ebc47370603fe81d9e15491b2f1443d619d1dab720d586e429ed233e1255c1',
|
|
39
38
|
stakingPoolId: '0x20266a17b4f1a216727f3eef5772f8d486a9e3b5e319af80a5b75809c035561d',
|
|
40
|
-
walPackageId: '0x8190b041122eb492bf63cb464476bd68c6b7e570a4079645a8b28732b6197a82',
|
|
41
39
|
},
|
|
42
40
|
});
|
|
43
41
|
```
|
|
44
42
|
|
|
45
|
-
Walrus nodes currently use self-signed certificates. Until all nodes are updated to use
|
|
46
|
-
certificates, you may need to configure your environment to ignore certificate errors.
|
|
43
|
+
Walrus `testnet` nodes currently use self-signed certificates. Until all nodes are updated to use
|
|
44
|
+
valid certificates, you may need to configure your environment to ignore certificate errors.
|
|
47
45
|
|
|
48
46
|
In node this can be done though an environment variable:
|
|
49
47
|
|
|
@@ -72,10 +70,10 @@ any other desired behavior.
|
|
|
72
70
|
|
|
73
71
|
## SDK Overview
|
|
74
72
|
|
|
75
|
-
The walrus SDK is designed to be used to build aggregators and publishers, and
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
73
|
+
The walrus SDK is designed primarily to be used to build aggregators and publishers, and may not be
|
|
74
|
+
optimal when used directly in client side apps. Reading and writing directly from storage nodes
|
|
75
|
+
requires a lot of requests (~2200 to write a blob, ~335 to read a blob). For most apps, using
|
|
76
|
+
aggregators and publishers with optimized reads/writes will provide a better user experience.
|
|
79
77
|
|
|
80
78
|
The `WalrusClient` exposes high level methods for reading and writing blobs, as well as lower level
|
|
81
79
|
methods for the individual steps in the process that can be used to implement more complex flows
|
package/dist/cjs/client.d.ts
CHANGED
|
@@ -2,91 +2,10 @@ import type { Signer } from '@mysten/sui/cryptography';
|
|
|
2
2
|
import { Transaction } from '@mysten/sui/transactions';
|
|
3
3
|
import { Blob } from './contracts/blob.js';
|
|
4
4
|
import type { BlobStatus } from './storage-node/types.js';
|
|
5
|
-
import type { CertifyBlobOptions, DeleteBlobOptions, ExtendBlobOptions, GetBlobMetadataOptions, GetSliversOptions, GetStorageConfirmationOptions, GetVerifiedBlobStatusOptions, ReadBlobOptions, RegisterBlobOptions, SliversForNode, StorageWithSizeOptions, WalrusClientConfig,
|
|
5
|
+
import type { CertifyBlobOptions, DeleteBlobOptions, ExtendBlobOptions, GetBlobMetadataOptions, GetSliversOptions, GetStorageConfirmationOptions, GetVerifiedBlobStatusOptions, ReadBlobOptions, RegisterBlobOptions, SliversForNode, StorageWithSizeOptions, WalrusClientConfig, WriteBlobAttributesOptions, WriteBlobOptions, WriteEncodedBlobOptions, WriteEncodedBlobToNodesOptions, WriteMetadataOptions, WriteSliverOptions, WriteSliversToNodeOptions } from './types.js';
|
|
6
6
|
export declare class WalrusClient {
|
|
7
7
|
#private;
|
|
8
|
-
packageConfig: WalrusPackageConfig;
|
|
9
8
|
constructor(config: WalrusClientConfig);
|
|
10
|
-
/** The Move type for a WAL coin */
|
|
11
|
-
get walType(): string;
|
|
12
|
-
/** The Move type for a Blob object */
|
|
13
|
-
get blobType(): string;
|
|
14
|
-
/** The Move type for a Storage object */
|
|
15
|
-
get storageType(): string;
|
|
16
|
-
get systemContract(): {
|
|
17
|
-
create_empty: (options: {
|
|
18
|
-
arguments: [import("./contracts/utils/index.js").RawTransactionArgument<number>, import("./contracts/utils/index.js").RawTransactionArgument<string>];
|
|
19
|
-
}) => (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
20
|
-
invalidate_blob_id: (options: {
|
|
21
|
-
arguments: [import("./contracts/utils/index.js").RawTransactionArgument<string>, import("./contracts/utils/index.js").RawTransactionArgument<number[]>, import("./contracts/utils/index.js").RawTransactionArgument<number[]>, import("./contracts/utils/index.js").RawTransactionArgument<number[]>];
|
|
22
|
-
}) => (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
23
|
-
certify_event_blob: (options: {
|
|
24
|
-
arguments: [import("./contracts/utils/index.js").RawTransactionArgument<string>, import("./contracts/utils/index.js").RawTransactionArgument<string>, import("./contracts/utils/index.js").RawTransactionArgument<number | bigint>, import("./contracts/utils/index.js").RawTransactionArgument<number | bigint>, import("./contracts/utils/index.js").RawTransactionArgument<number | bigint>, import("./contracts/utils/index.js").RawTransactionArgument<number>, import("./contracts/utils/index.js").RawTransactionArgument<number | bigint>, import("./contracts/utils/index.js").RawTransactionArgument<number>];
|
|
25
|
-
}) => (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
26
|
-
reserve_space: (options: {
|
|
27
|
-
arguments: [import("./contracts/utils/index.js").RawTransactionArgument<string>, import("./contracts/utils/index.js").RawTransactionArgument<number | bigint>, import("./contracts/utils/index.js").RawTransactionArgument<number>, import("./contracts/utils/index.js").RawTransactionArgument<string>];
|
|
28
|
-
}) => (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
29
|
-
register_blob: (options: {
|
|
30
|
-
arguments: [import("./contracts/utils/index.js").RawTransactionArgument<string>, import("./contracts/utils/index.js").RawTransactionArgument<string>, import("./contracts/utils/index.js").RawTransactionArgument<number | bigint>, import("./contracts/utils/index.js").RawTransactionArgument<number | bigint>, import("./contracts/utils/index.js").RawTransactionArgument<number | bigint>, import("./contracts/utils/index.js").RawTransactionArgument<number>, import("./contracts/utils/index.js").RawTransactionArgument<boolean>, import("./contracts/utils/index.js").RawTransactionArgument<string>];
|
|
31
|
-
}) => (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
32
|
-
certify_blob: (options: {
|
|
33
|
-
arguments: [import("./contracts/utils/index.js").RawTransactionArgument<string>, import("./contracts/utils/index.js").RawTransactionArgument<string>, import("./contracts/utils/index.js").RawTransactionArgument<number[]>, import("./contracts/utils/index.js").RawTransactionArgument<number[]>, import("./contracts/utils/index.js").RawTransactionArgument<number[]>];
|
|
34
|
-
}) => (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
35
|
-
delete_blob: (options: {
|
|
36
|
-
arguments: [import("./contracts/utils/index.js").RawTransactionArgument<string>, import("./contracts/utils/index.js").RawTransactionArgument<string>];
|
|
37
|
-
}) => (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
38
|
-
extend_blob_with_resource: (options: {
|
|
39
|
-
arguments: [import("./contracts/utils/index.js").RawTransactionArgument<string>, import("./contracts/utils/index.js").RawTransactionArgument<string>, import("./contracts/utils/index.js").RawTransactionArgument<string>];
|
|
40
|
-
}) => (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
41
|
-
extend_blob: (options: {
|
|
42
|
-
arguments: [import("./contracts/utils/index.js").RawTransactionArgument<string>, import("./contracts/utils/index.js").RawTransactionArgument<string>, import("./contracts/utils/index.js").RawTransactionArgument<number>, import("./contracts/utils/index.js").RawTransactionArgument<string>];
|
|
43
|
-
}) => (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
44
|
-
add_subsidy: (options: {
|
|
45
|
-
arguments: [import("./contracts/utils/index.js").RawTransactionArgument<string>, import("./contracts/utils/index.js").RawTransactionArgument<string>, import("./contracts/utils/index.js").RawTransactionArgument<number>];
|
|
46
|
-
}) => (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
47
|
-
register_deny_list_update: (options: {
|
|
48
|
-
arguments: [import("./contracts/utils/index.js").RawTransactionArgument<string>, import("./contracts/utils/index.js").RawTransactionArgument<string>, import("./contracts/utils/index.js").RawTransactionArgument<number | bigint>, import("./contracts/utils/index.js").RawTransactionArgument<number | bigint>];
|
|
49
|
-
}) => (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
50
|
-
update_deny_list: (options: {
|
|
51
|
-
arguments: [import("./contracts/utils/index.js").RawTransactionArgument<string>, import("./contracts/utils/index.js").RawTransactionArgument<string>, import("./contracts/utils/index.js").RawTransactionArgument<number[]>, import("./contracts/utils/index.js").RawTransactionArgument<number[]>, import("./contracts/utils/index.js").RawTransactionArgument<number[]>];
|
|
52
|
-
}) => (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
53
|
-
delete_deny_listed_blob: (options: {
|
|
54
|
-
arguments: [import("./contracts/utils/index.js").RawTransactionArgument<string>, import("./contracts/utils/index.js").RawTransactionArgument<number[]>, import("./contracts/utils/index.js").RawTransactionArgument<number[]>, import("./contracts/utils/index.js").RawTransactionArgument<number[]>];
|
|
55
|
-
}) => (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
56
|
-
epoch: (options: {
|
|
57
|
-
arguments: [import("./contracts/utils/index.js").RawTransactionArgument<string>];
|
|
58
|
-
}) => (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
59
|
-
total_capacity_size: (options: {
|
|
60
|
-
arguments: [import("./contracts/utils/index.js").RawTransactionArgument<string>];
|
|
61
|
-
}) => (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
62
|
-
used_capacity_size: (options: {
|
|
63
|
-
arguments: [import("./contracts/utils/index.js").RawTransactionArgument<string>];
|
|
64
|
-
}) => (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
65
|
-
n_shards: (options: {
|
|
66
|
-
arguments: [import("./contracts/utils/index.js").RawTransactionArgument<string>];
|
|
67
|
-
}) => (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
68
|
-
advance_epoch: (options: {
|
|
69
|
-
arguments: [import("./contracts/utils/index.js").RawTransactionArgument<string>, import("./contracts/utils/index.js").RawTransactionArgument<string>, import("./contracts/utils/index.js").RawTransactionArgument<string>];
|
|
70
|
-
}) => (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
71
|
-
package_id: (options: {
|
|
72
|
-
arguments: [import("./contracts/utils/index.js").RawTransactionArgument<string>];
|
|
73
|
-
}) => (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
74
|
-
version: (options: {
|
|
75
|
-
arguments: [import("./contracts/utils/index.js").RawTransactionArgument<string>];
|
|
76
|
-
}) => (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
77
|
-
set_new_package_id: (options: {
|
|
78
|
-
arguments: [import("./contracts/utils/index.js").RawTransactionArgument<string>, import("./contracts/utils/index.js").RawTransactionArgument<string>];
|
|
79
|
-
}) => (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
80
|
-
migrate: (options: {
|
|
81
|
-
arguments: [import("./contracts/utils/index.js").RawTransactionArgument<string>];
|
|
82
|
-
}) => (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
83
|
-
inner_mut: (options: {
|
|
84
|
-
arguments: [import("./contracts/utils/index.js").RawTransactionArgument<string>];
|
|
85
|
-
}) => (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
86
|
-
inner: (options: {
|
|
87
|
-
arguments: [import("./contracts/utils/index.js").RawTransactionArgument<string>];
|
|
88
|
-
}) => (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
89
|
-
};
|
|
90
9
|
/** The cached system object for the walrus package */
|
|
91
10
|
systemObject(): Promise<{
|
|
92
11
|
id: {
|
|
@@ -266,7 +185,7 @@ export declare class WalrusClient {
|
|
|
266
185
|
* tx.transferObjects([await client.createStorage({ size: 1000, epochs: 3 })], owner);
|
|
267
186
|
* ```
|
|
268
187
|
*/
|
|
269
|
-
createStorage({ size, epochs, walCoin }: StorageWithSizeOptions): Promise<(tx: Transaction) => import("@mysten/sui/transactions").TransactionResult>;
|
|
188
|
+
createStorage({ size, epochs, walCoin, owner }: StorageWithSizeOptions): Promise<(tx: Transaction) => import("@mysten/sui/transactions").TransactionResult>;
|
|
270
189
|
/**
|
|
271
190
|
* Create a transaction that creates a storage object
|
|
272
191
|
*
|
|
@@ -277,7 +196,6 @@ export declare class WalrusClient {
|
|
|
277
196
|
*/
|
|
278
197
|
createStorageTransaction({ transaction, size, epochs, owner, }: StorageWithSizeOptions & {
|
|
279
198
|
transaction?: Transaction;
|
|
280
|
-
owner: string;
|
|
281
199
|
}): Promise<Transaction>;
|
|
282
200
|
/**
|
|
283
201
|
* Execute a transaction that creates a storage object
|
|
@@ -309,7 +227,7 @@ export declare class WalrusClient {
|
|
|
309
227
|
* tx.transferObjects([await client.registerBlob({ size: 1000, epochs: 3, blobId, rootHash, deletable: true })], owner);
|
|
310
228
|
* ```
|
|
311
229
|
*/
|
|
312
|
-
registerBlob({ size, epochs, blobId, rootHash, deletable, walCoin, attributes, }: RegisterBlobOptions): Promise<(tx: Transaction) => import("@mysten/sui/transactions").TransactionResult>;
|
|
230
|
+
registerBlob({ size, epochs, blobId, rootHash, deletable, walCoin, owner, attributes, }: RegisterBlobOptions): Promise<(tx: Transaction) => import("@mysten/sui/transactions").TransactionResult>;
|
|
313
231
|
/**
|
|
314
232
|
* Create a transaction that registers a blob
|
|
315
233
|
*
|
|
@@ -318,9 +236,8 @@ export declare class WalrusClient {
|
|
|
318
236
|
* const tx = await client.registerBlobTransaction({ size: 1000, epochs: 3, blobId, rootHash, deletable: true });
|
|
319
237
|
* ```
|
|
320
238
|
*/
|
|
321
|
-
registerBlobTransaction({ transaction,
|
|
239
|
+
registerBlobTransaction({ transaction, ...options }: RegisterBlobOptions & {
|
|
322
240
|
transaction?: Transaction;
|
|
323
|
-
owner: string;
|
|
324
241
|
}): Promise<Transaction>;
|
|
325
242
|
/**
|
|
326
243
|
* Execute a transaction that registers a blob
|
|
@@ -333,7 +250,6 @@ export declare class WalrusClient {
|
|
|
333
250
|
executeRegisterBlobTransaction({ signer, ...options }: RegisterBlobOptions & {
|
|
334
251
|
transaction?: Transaction;
|
|
335
252
|
signer: Signer;
|
|
336
|
-
owner?: string;
|
|
337
253
|
}): Promise<{
|
|
338
254
|
blob: ReturnType<typeof Blob>['$inferType'];
|
|
339
255
|
digest: string;
|
|
@@ -416,7 +332,7 @@ export declare class WalrusClient {
|
|
|
416
332
|
* const tx = await client.extendBlobTransaction({ blobObjectId, epochs });
|
|
417
333
|
* ```
|
|
418
334
|
*/
|
|
419
|
-
extendBlob({ blobObjectId, epochs, endEpoch, walCoin }: ExtendBlobOptions): Promise<(_tx: Transaction) => void>;
|
|
335
|
+
extendBlob({ blobObjectId, epochs, endEpoch, walCoin, owner }: ExtendBlobOptions): Promise<(_tx: Transaction) => void>;
|
|
420
336
|
/**
|
|
421
337
|
* Create a transaction that extends a blob
|
|
422
338
|
*
|