@zing-protocol/zing-sdk 0.0.1 → 0.0.3
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/dist/_generated/index.js +6 -0
- package/dist/_generated/utils/index.d.ts +12 -0
- package/dist/_generated/utils/index.js +135 -0
- package/dist/_generated/zing_framework/coin_utils.d.ts +15 -0
- package/dist/_generated/zing_framework/coin_utils.js +19 -0
- package/dist/_generated/zing_framework/deps/sui/object.d.ts +8 -0
- package/{src/_generated/zing_governance/deps/sui/object.ts → dist/_generated/zing_framework/deps/sui/object.js} +4 -7
- package/dist/_generated/zing_framework/derived_object_bag.d.ts +166 -0
- package/dist/_generated/zing_framework/derived_object_bag.js +221 -0
- package/dist/_generated/zing_framework/derived_table.d.ts +153 -0
- package/dist/_generated/zing_framework/derived_table.js +200 -0
- package/dist/_generated/zing_governance/admin.d.ts +20 -0
- package/dist/_generated/zing_governance/admin.js +26 -0
- package/dist/_generated/zing_governance/deps/sui/object.d.ts +8 -0
- package/{src/_generated/zing_identity/deps/sui/object.ts → dist/_generated/zing_governance/deps/sui/object.js} +4 -7
- package/dist/_generated/zing_governance/treasury.d.ts +56 -0
- package/dist/_generated/zing_governance/treasury.js +78 -0
- package/dist/_generated/zing_identity/config.d.ts +87 -0
- package/dist/_generated/zing_identity/config.js +98 -0
- package/{src/_generated/zing_studio/deps/std/type_name.ts → dist/_generated/zing_identity/deps/std/type_name.d.ts} +3 -11
- package/dist/_generated/zing_identity/deps/std/type_name.js +22 -0
- package/dist/_generated/zing_identity/deps/sui/object.d.ts +8 -0
- package/{src/_generated/zing_studio/deps/sui/object.ts → dist/_generated/zing_identity/deps/sui/object.js} +4 -7
- package/dist/_generated/zing_identity/deps/sui/object_table.d.ts +12 -0
- package/{src/_generated/zing_identity/deps/sui/object_table.ts → dist/_generated/zing_identity/deps/sui/object_table.js} +7 -10
- package/dist/_generated/zing_identity/deps/sui/table.d.ts +12 -0
- package/{src/_generated/zing_studio/deps/sui/table.ts → dist/_generated/zing_identity/deps/sui/table.js} +7 -10
- package/{src/_generated/zing_identity/deps/sui/vec_set.ts → dist/_generated/zing_identity/deps/sui/vec_set.d.ts} +3 -14
- package/dist/_generated/zing_identity/deps/sui/vec_set.js +22 -0
- package/dist/_generated/zing_identity/ecdsa.d.ts +81 -0
- package/dist/_generated/zing_identity/ecdsa.js +87 -0
- package/dist/_generated/zing_identity/identity.d.ts +262 -0
- package/dist/_generated/zing_identity/identity.js +294 -0
- package/dist/_generated/zing_identity/reclaim.d.ts +356 -0
- package/dist/_generated/zing_identity/reclaim.js +414 -0
- package/dist/_generated/zing_studio/app.d.ts +351 -0
- package/dist/_generated/zing_studio/app.js +451 -0
- package/dist/_generated/zing_studio/article.d.ts +331 -0
- package/dist/_generated/zing_studio/article.js +331 -0
- package/dist/_generated/zing_studio/config.d.ts +203 -0
- package/dist/_generated/zing_studio/config.js +233 -0
- package/{src/_generated/zing_identity/deps/std/type_name.ts → dist/_generated/zing_studio/deps/std/type_name.d.ts} +3 -11
- package/dist/_generated/zing_studio/deps/std/type_name.js +22 -0
- package/dist/_generated/zing_studio/deps/sui/bag.d.ts +12 -0
- package/{src/_generated/zing_studio/deps/sui/bag.ts → dist/_generated/zing_studio/deps/sui/bag.js} +7 -10
- package/dist/_generated/zing_studio/deps/sui/balance.d.ts +12 -0
- package/{src/_generated/zing_studio/deps/sui/balance.ts → dist/_generated/zing_studio/deps/sui/balance.js} +4 -7
- package/dist/_generated/zing_studio/deps/sui/coin.d.ts +12 -0
- package/{src/_generated/zing_studio/deps/sui/coin.ts → dist/_generated/zing_studio/deps/sui/coin.js} +5 -8
- package/dist/_generated/zing_studio/deps/sui/dynamic_field.d.ts +126 -0
- package/dist/_generated/zing_studio/deps/sui/dynamic_field.js +140 -0
- package/dist/_generated/zing_studio/deps/sui/object.d.ts +8 -0
- package/{src/_generated/zing_framework/deps/sui/object.ts → dist/_generated/zing_studio/deps/sui/object.js} +4 -7
- package/dist/_generated/zing_studio/deps/sui/table.d.ts +12 -0
- package/{src/_generated/zing_identity/deps/sui/table.ts → dist/_generated/zing_studio/deps/sui/table.js} +7 -10
- package/dist/_generated/zing_studio/deps/sui/vec_map.d.ts +30 -0
- package/{src/_generated/zing_studio/deps/sui/vec_map.ts → dist/_generated/zing_studio/deps/sui/vec_map.js} +15 -21
- package/{src/_generated/zing_studio/deps/sui/vec_set.ts → dist/_generated/zing_studio/deps/sui/vec_set.d.ts} +3 -14
- package/dist/_generated/zing_studio/deps/sui/vec_set.js +22 -0
- package/dist/_generated/zing_studio/deps/walrus/blob.d.ts +20 -0
- package/{src/_generated/zing_studio/deps/walrus/blob.ts → dist/_generated/zing_studio/deps/walrus/blob.js} +11 -12
- package/dist/_generated/zing_studio/deps/walrus/events.d.ts +83 -0
- package/dist/_generated/zing_studio/deps/walrus/events.js +122 -0
- package/dist/_generated/zing_studio/deps/walrus/metadata.d.ts +71 -0
- package/dist/_generated/zing_studio/deps/walrus/metadata.js +73 -0
- package/dist/_generated/zing_studio/deps/walrus/storage_resource.d.ts +12 -0
- package/{src/_generated/zing_studio/deps/walrus/storage_resource.ts → dist/_generated/zing_studio/deps/walrus/storage_resource.js} +7 -8
- package/dist/_generated/zing_studio/deps/zing_framework/derived_object_bag.d.ts +12 -0
- package/{src/_generated/zing_studio/deps/zing_framework/derived_object_bag.ts → dist/_generated/zing_studio/deps/zing_framework/derived_object_bag.js} +7 -8
- package/dist/_generated/zing_studio/deps/zing_framework/derived_table.d.ts +12 -0
- package/{src/_generated/zing_studio/deps/zing_framework/derived_table.ts → dist/_generated/zing_studio/deps/zing_framework/derived_table.js} +7 -8
- package/dist/_generated/zing_studio/donation.d.ts +24 -0
- package/{src/_generated/zing_studio/donation.ts → dist/_generated/zing_studio/donation.js} +7 -8
- package/dist/_generated/zing_studio/enclave.d.ts +187 -0
- package/dist/_generated/zing_studio/enclave.js +231 -0
- package/dist/_generated/zing_studio/nitro_attestation.d.ts +148 -0
- package/dist/_generated/zing_studio/nitro_attestation.js +183 -0
- package/dist/_generated/zing_studio/referral.d.ts +166 -0
- package/dist/_generated/zing_studio/referral.js +224 -0
- package/dist/_generated/zing_studio/storage.d.ts +327 -0
- package/dist/_generated/zing_studio/storage.js +365 -0
- package/dist/_generated/zing_studio/studio.d.ts +282 -0
- package/dist/_generated/zing_studio/studio.js +360 -0
- package/dist/bcs.d.ts +61 -0
- package/dist/bcs.js +109 -0
- package/dist/client/index.d.ts +228 -0
- package/dist/client/index.js +296 -0
- package/dist/client/types.d.ts +23 -0
- package/dist/client/types.js +1 -0
- package/dist/components/index.js +3 -0
- package/dist/components/wallet-provider.d.ts +7 -0
- package/dist/components/wallet-provider.js +33 -0
- package/dist/components/walrus-provider.d.ts +31 -0
- package/dist/components/walrus-provider.js +71 -0
- package/dist/components/zing-provider.d.ts +15 -0
- package/dist/components/zing-provider.js +22 -0
- package/dist/config/common.d.ts +23 -0
- package/dist/config/common.js +61 -0
- package/dist/config/index.d.ts +8 -0
- package/dist/config/index.js +28 -0
- package/dist/config/mainnet.d.ts +6 -0
- package/dist/config/mainnet.js +80 -0
- package/dist/config/testnet.d.ts +6 -0
- package/dist/config/testnet.js +81 -0
- package/dist/config/types.d.ts +49 -0
- package/dist/config/types.js +1 -0
- package/dist/const.d.ts +4 -0
- package/dist/const.js +25 -0
- package/dist/getters.d.ts +228 -0
- package/dist/getters.js +317 -0
- package/{src/hooks/index.ts → dist/hooks/index.d.ts} +2 -3
- package/dist/hooks/index.js +9 -0
- package/dist/hooks/useGetStudio.d.ts +26 -0
- package/dist/hooks/useGetStudio.js +17 -0
- package/dist/hooks/useGetTierPlan.d.ts +7 -0
- package/dist/hooks/useGetTierPlan.js +85 -0
- package/dist/hooks/useReclaim.d.ts +12 -0
- package/dist/hooks/useReclaim.js +87 -0
- package/dist/hooks/useSignAndExecuteTransaction.d.ts +6 -0
- package/dist/hooks/useSignAndExecuteTransaction.js +40 -0
- package/dist/hooks/useSignPersonalMessage.d.ts +8 -0
- package/dist/hooks/useSignPersonalMessage.js +21 -0
- package/dist/hooks/useZingInfiniteQueries.d.ts +75 -0
- package/dist/hooks/useZingInfiniteQueries.js +28 -0
- package/dist/hooks/useZingMutation.d.ts +35 -0
- package/dist/hooks/useZingMutation.js +37 -0
- package/dist/hooks/useZingQueries.d.ts +127 -0
- package/dist/hooks/useZingQueries.js +37 -0
- package/dist/hooks/useZingQuery.d.ts +147 -0
- package/dist/hooks/useZingQuery.js +34 -0
- package/{src/index.ts → dist/index.d.ts} +2 -3
- package/dist/index.js +9 -0
- package/dist/lib/utils/colorful-logger.d.ts +2 -0
- package/dist/lib/utils/colorful-logger.js +23 -0
- package/dist/lib/utils/const.d.ts +25 -0
- package/dist/lib/utils/const.js +25 -0
- package/dist/lib/utils/helpers.d.ts +10 -0
- package/dist/lib/utils/helpers.js +49 -0
- package/dist/lib/utils/index.js +4 -0
- package/dist/lib/utils/init-app-with-shadow.d.ts +6 -0
- package/dist/lib/utils/init-app-with-shadow.js +28 -0
- package/dist/lib/utils/quilt.d.ts +61 -0
- package/dist/lib/utils/quilt.js +194 -0
- package/dist/lib/utils/reclaim.d.ts +29 -0
- package/dist/lib/utils/reclaim.js +88 -0
- package/dist/lib/utils/types.d.ts +5 -0
- package/dist/lib/utils/types.js +1 -0
- package/dist/mutations/index.js +3 -0
- package/dist/mutations/seal.d.ts +12 -0
- package/dist/mutations/seal.js +41 -0
- package/dist/mutations/signer.d.ts +10 -0
- package/dist/mutations/signer.js +176 -0
- package/dist/mutations/walrus.d.ts +98 -0
- package/dist/mutations/walrus.js +488 -0
- package/dist/stores/index.js +3 -0
- package/dist/stores/walletStore.d.ts +48 -0
- package/dist/stores/walletStore.js +232 -0
- package/dist/stores/walrusStore.d.ts +28 -0
- package/dist/stores/walrusStore.js +61 -0
- package/dist/stores/zkloginStore.d.ts +28 -0
- package/dist/stores/zkloginStore.js +27 -0
- package/dist/types.d.ts +99 -0
- package/dist/types.js +1 -0
- package/package.json +18 -10
- package/src/_generated/utils/index.ts +0 -181
- package/src/_generated/zing_framework/coin_utils.ts +0 -41
- package/src/_generated/zing_framework/derived_object_bag.ts +0 -400
- package/src/_generated/zing_framework/derived_table.ts +0 -366
- package/src/_generated/zing_governance/admin.ts +0 -47
- package/src/_generated/zing_governance/treasury.ts +0 -134
- package/src/_generated/zing_identity/config.ts +0 -191
- package/src/_generated/zing_identity/ecdsa.ts +0 -166
- package/src/_generated/zing_identity/identity.ts +0 -661
- package/src/_generated/zing_identity/reclaim.ts +0 -803
- package/src/_generated/zing_studio/app.ts +0 -855
- package/src/_generated/zing_studio/article.ts +0 -598
- package/src/_generated/zing_studio/config.ts +0 -475
- package/src/_generated/zing_studio/deps/sui/dynamic_field.ts +0 -272
- package/src/_generated/zing_studio/deps/walrus/events.ts +0 -124
- package/src/_generated/zing_studio/deps/walrus/metadata.ts +0 -137
- package/src/_generated/zing_studio/enclave.ts +0 -466
- package/src/_generated/zing_studio/nitro_attestation.ts +0 -308
- package/src/_generated/zing_studio/referral.ts +0 -447
- package/src/_generated/zing_studio/storage.ts +0 -664
- package/src/_generated/zing_studio/studio.ts +0 -682
- package/src/bcs.ts +0 -139
- package/src/client/index.ts +0 -557
- package/src/client/types.ts +0 -28
- package/src/components/wallet-provider.tsx +0 -53
- package/src/components/walrus-provider.tsx +0 -212
- package/src/components/zing-provider.tsx +0 -54
- package/src/config/common.ts +0 -82
- package/src/config/index.ts +0 -45
- package/src/config/mainnet.ts +0 -109
- package/src/config/testnet.ts +0 -111
- package/src/config/types.ts +0 -69
- package/src/const.ts +0 -32
- package/src/getters.ts +0 -523
- package/src/hooks/useGetStudio.ts +0 -22
- package/src/hooks/useGetTierPlan.ts +0 -115
- package/src/hooks/useReclaim.ts +0 -165
- package/src/hooks/useSignAndExecuteTransaction.ts +0 -57
- package/src/hooks/useSignPersonalMessage.ts +0 -28
- package/src/hooks/useZingInfiniteQueries.ts +0 -92
- package/src/hooks/useZingMutation.ts +0 -66
- package/src/hooks/useZingQueries.ts +0 -107
- package/src/hooks/useZingQuery.ts +0 -88
- package/src/lib/utils/colorful-logger.ts +0 -27
- package/src/lib/utils/const.ts +0 -25
- package/src/lib/utils/helpers.ts +0 -78
- package/src/lib/utils/init-app-with-shadow.ts +0 -42
- package/src/lib/utils/quilt.ts +0 -317
- package/src/lib/utils/reclaim.ts +0 -148
- package/src/lib/utils/types.ts +0 -14
- package/src/mutations/seal.ts +0 -78
- package/src/mutations/signer.ts +0 -241
- package/src/mutations/walrus.ts +0 -862
- package/src/stores/walletStore.ts +0 -360
- package/src/stores/walrusStore.ts +0 -118
- package/src/stores/zkloginStore.ts +0 -53
- package/src/types.ts +0 -120
- package/tsconfig.json +0 -12
- /package/{src/_generated/index.js → dist/_generated/index.d.ts} +0 -0
- /package/{src/components/index.ts → dist/components/index.d.ts} +0 -0
- /package/{src/lib/utils/index.ts → dist/lib/utils/index.d.ts} +0 -0
- /package/{src/mutations/index.ts → dist/mutations/index.d.ts} +0 -0
- /package/{src/stores/index.ts → dist/stores/index.d.ts} +0 -0
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
// zing
|
|
2
|
+
export const mainnetZingConfig = {
|
|
3
|
+
ZING_FRAMEWORK_PACKAGE_ADDRESS: "0x58c2589e21157bac347513cb4c392ffa34af0e1a630f5a77c0ee92f141057d01",
|
|
4
|
+
ZING_IDENTITY_PACKAGE_ADDRESS: "0x4a22da297adc51ec5ed6e1f4fc884a45a50d8299b8c3deb9d056392210ce951d",
|
|
5
|
+
ZING_STUDIO_PACKAGE_ADDRESS: "0x3db3853f032b5b403e35a7d863fb630359c5bec238990f52a8c33c6ac1f5222f",
|
|
6
|
+
ZING_STUDIO_V0_PACKAGE_ADDRESS: "0xf245105e9896942a02614e4dbbb6c6636452879d58b1e12db1e0364c0d1532a7",
|
|
7
|
+
ZING_TREASURY_SHARED_OBJECT_REF: {
|
|
8
|
+
objectId: "0x30f0dc6c1ad6bdf944ed303e9c966af60a3bbbef1b5b9ae3f23de1d44b02f5b6",
|
|
9
|
+
initialSharedVersion: 661729837,
|
|
10
|
+
mutable: true,
|
|
11
|
+
},
|
|
12
|
+
ZING_IDENTITY_CONFIG_SHARED_OBJECT_REF: {
|
|
13
|
+
objectId: "0xd511beaa68a5647cdc193b753f3658e8e33bc87ec603857c3d6d315562f0e470",
|
|
14
|
+
initialSharedVersion: 661729843,
|
|
15
|
+
mutable: true,
|
|
16
|
+
},
|
|
17
|
+
PROOF_COMMITMENT_TYPE: "0xd666d3234eb46551273014f5616ed2575e709a861dd3812613d59104a4cb7344::reclaim::ProofCommitment",
|
|
18
|
+
IDENTITY_PLATFORMS: {
|
|
19
|
+
twitter: {
|
|
20
|
+
PLATFORM_UPDATE_PROOF_TARGET: "0x910fd7e88647ea9369ab269fa5629f0efd815dfa5a7b7ef2355ffee13852413b::twitter::update_with_twitter_proof",
|
|
21
|
+
PLATFORM_TYPE: "0x910fd7e88647ea9369ab269fa5629f0efd815dfa5a7b7ef2355ffee13852413b::twitter::Twitter",
|
|
22
|
+
RECLAIM_MANAGER_SHARED_OBJECT_REF: {
|
|
23
|
+
objectId: "0xe8849f48412d3b7220902fd56b7f128f324ffb27615bf57e83c638f523aa10e6",
|
|
24
|
+
initialSharedVersion: 662715429,
|
|
25
|
+
mutable: true,
|
|
26
|
+
},
|
|
27
|
+
IDENTITY_MANAGER_SHARED_OBJECT_REF: {
|
|
28
|
+
objectId: "0xff54f2a3bfc4daedbbc7ecbb1b0985e8311c95fd847f070825882e7e083af5f1",
|
|
29
|
+
initialSharedVersion: 662715429,
|
|
30
|
+
mutable: true,
|
|
31
|
+
},
|
|
32
|
+
IDENTITY_MANAGER_IDENTIFIER_INFO_DF_ID: "0xcbe996d13835c0fcc9a0a015098546997ae9ff58dd075389bfe764d43bb46c2e",
|
|
33
|
+
IDENTITY_MANAGER_ADDRESS_TO_IDENTIFIER_DF_ID: "0x20ba08956972f73a956b288dde1659f9ad6059256205beb20bc3fa2cc0377ac2",
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
ZING_STUDIO_CONFIG_SHARED_OBJECT_REF: {
|
|
37
|
+
objectId: "0x9fe332fc68cb2a736a9643dc4f06089c7c4894396db0fb47895d216599ee5c00",
|
|
38
|
+
initialSharedVersion: 663114127,
|
|
39
|
+
mutable: true,
|
|
40
|
+
},
|
|
41
|
+
ZING_STORAGE_TREASURY_SHARED_OBJECT_REF: {
|
|
42
|
+
objectId: "0xd80e520d304a43b21c3d2dba2c89463819c2ef9b779c89d15e19b425b385fe74",
|
|
43
|
+
initialSharedVersion: 663114127,
|
|
44
|
+
mutable: true,
|
|
45
|
+
},
|
|
46
|
+
ZING_WORKS_TYPE: {
|
|
47
|
+
article: "0xf245105e9896942a02614e4dbbb6c6636452879d58b1e12db1e0364c0d1532a7::article::Article",
|
|
48
|
+
},
|
|
49
|
+
EVENT_TYPES: {
|
|
50
|
+
publishArticleEvent: "0xf245105e9896942a02614e4dbbb6c6636452879d58b1e12db1e0364c0d1532a7::article::PublishArticle",
|
|
51
|
+
},
|
|
52
|
+
};
|
|
53
|
+
// walrus
|
|
54
|
+
export const mainnetWalrusConfig = {
|
|
55
|
+
WALRUS_PACKAGE: "0xfa65cb2d62f4d39e60346fb7d501c12538ca2bbc646eaa37ece2aec5f897814e",
|
|
56
|
+
WAL_STAKING_INNER_FIELD: "0x16f1f9fcdf5a746da423d1ad055d88f88b24a9272ca8afb4c0dcf074ae6c730a",
|
|
57
|
+
WALRUS_SYSTEM_SHARED_OBJECT_REF: {
|
|
58
|
+
objectId: "0x2134d52768ea07e8c43570ef975eb3e4c27a39fa6396bef985b5abc58d03ddd2",
|
|
59
|
+
initialSharedVersion: 317862159,
|
|
60
|
+
mutable: true, // mutable when register_blob
|
|
61
|
+
},
|
|
62
|
+
WALRUS_AGGREGATORS: ["https://aggregator.suicore.com"],
|
|
63
|
+
WALRUS_UPLOAD_RELAY_BASE_URL: "https://walrus-upload-relay-production-73a4.up.railway.app",
|
|
64
|
+
EVENT_TYPES: {
|
|
65
|
+
blobRegistered: "0xfdc88f7d7cf30afab2f82e8380d11ee8f70efb90e863d1de8616fae1bb09ea77::events::BlobRegistered",
|
|
66
|
+
},
|
|
67
|
+
};
|
|
68
|
+
// coins
|
|
69
|
+
export const mainnetCoinConfig = {
|
|
70
|
+
USDC: "0xa1ec7fc00a6f40db9693ad1415d0c193ad3906494428cf252621037bd7117e29::usdc::USDC",
|
|
71
|
+
};
|
|
72
|
+
// seal
|
|
73
|
+
export const mainnetSealConfig = {
|
|
74
|
+
serverConfigs: [
|
|
75
|
+
{
|
|
76
|
+
objectId: "0xe0eb52eba9261b96e895bbb4deca10dcd64fbc626a1133017adcd5131353fd10",
|
|
77
|
+
weight: 1,
|
|
78
|
+
},
|
|
79
|
+
],
|
|
80
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { CoinSymbol } from "./common.js";
|
|
2
|
+
import type { SealConfig, WalrusConfig, ZingConfig } from "./types.js";
|
|
3
|
+
export declare const testnetZingConfig: ZingConfig;
|
|
4
|
+
export declare const testnetWalrusConfig: WalrusConfig;
|
|
5
|
+
export declare const testnetCoinConfig: Record<CoinSymbol, string>;
|
|
6
|
+
export declare const testnetSealConfig: SealConfig;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
export const testnetZingConfig = {
|
|
2
|
+
ZING_FRAMEWORK_PACKAGE_ADDRESS: "0xd851eb5b907b60aa5fd958dd74044d809c49ee60001cad621726f03ea138f943",
|
|
3
|
+
ZING_IDENTITY_PACKAGE_ADDRESS: "0xaaf27a90890ac1efface4fbb22597e95829cbe6cbb771df02f0d2cc93f067c70",
|
|
4
|
+
ZING_STUDIO_PACKAGE_ADDRESS: "0x455bd1ba1afe47158c9155001f33b4069c9f008d091eef28f61c47c857bf60aa",
|
|
5
|
+
ZING_STUDIO_V0_PACKAGE_ADDRESS: "0x455bd1ba1afe47158c9155001f33b4069c9f008d091eef28f61c47c857bf60aa",
|
|
6
|
+
ZING_TREASURY_SHARED_OBJECT_REF: {
|
|
7
|
+
objectId: "0xca56bc3982525decbd4b025d3d4ae4de07259d6efc187577bfc3ab212e20574f",
|
|
8
|
+
initialSharedVersion: 645292716,
|
|
9
|
+
mutable: true,
|
|
10
|
+
},
|
|
11
|
+
ZING_IDENTITY_CONFIG_SHARED_OBJECT_REF: {
|
|
12
|
+
objectId: "0xde2eb80aa01db47e65b705c80af931ccb1d56a8a6a06403e205fa8fb1ad4a02e",
|
|
13
|
+
initialSharedVersion: 645292717,
|
|
14
|
+
mutable: false,
|
|
15
|
+
},
|
|
16
|
+
PROOF_COMMITMENT_TYPE: "0xaaf27a90890ac1efface4fbb22597e95829cbe6cbb771df02f0d2cc93f067c70::reclaim::ProofCommitment",
|
|
17
|
+
IDENTITY_PLATFORMS: {
|
|
18
|
+
twitter: {
|
|
19
|
+
PLATFORM_UPDATE_PROOF_TARGET: "0xa0d84dc088ba37e3108e69458c4dc0d0f836479f384fbe1fe98c737d27945c3e::twitter::update_with_twitter_proof",
|
|
20
|
+
PLATFORM_TYPE: "0xa0d84dc088ba37e3108e69458c4dc0d0f836479f384fbe1fe98c737d27945c3e::twitter::Twitter",
|
|
21
|
+
RECLAIM_MANAGER_SHARED_OBJECT_REF: {
|
|
22
|
+
objectId: "0x3d3c56359728f12f8b54e9e2f5d5861a168f7d75675b83afc7f8b9cce289bfc1",
|
|
23
|
+
initialSharedVersion: 663897156,
|
|
24
|
+
mutable: true,
|
|
25
|
+
},
|
|
26
|
+
IDENTITY_MANAGER_SHARED_OBJECT_REF: {
|
|
27
|
+
objectId: "0x44e9171b465f9bbad19864c06cec7ad24d3e830198fe10d9acc84f4e31ad59f6",
|
|
28
|
+
initialSharedVersion: 663897156,
|
|
29
|
+
mutable: true,
|
|
30
|
+
},
|
|
31
|
+
IDENTITY_MANAGER_IDENTIFIER_INFO_DF_ID: "0x69ff6f5d7e4a64d177c24ae9882e732402065eb9668f41f9337b56fea39bd46d",
|
|
32
|
+
IDENTITY_MANAGER_ADDRESS_TO_IDENTIFIER_DF_ID: "0x1073c13dfed532938cd978adfcb0b14a165350762392e0bb3137f493112d0520",
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
ZING_STUDIO_CONFIG_SHARED_OBJECT_REF: {
|
|
36
|
+
objectId: "0x4257dc4f3a3fe73e5f8d8c86c2233210876c35dc9b369f72d6aab0521733e57e",
|
|
37
|
+
initialSharedVersion: 723767900,
|
|
38
|
+
mutable: false,
|
|
39
|
+
},
|
|
40
|
+
ZING_STORAGE_TREASURY_SHARED_OBJECT_REF: {
|
|
41
|
+
objectId: "0xde26730698493f851a7d9cd4d49b5b56f6781d902d3a63e24aa1f25820924cc8",
|
|
42
|
+
initialSharedVersion: 723767900,
|
|
43
|
+
mutable: true,
|
|
44
|
+
},
|
|
45
|
+
ZING_WORKS_TYPE: {
|
|
46
|
+
article: "0x455bd1ba1afe47158c9155001f33b4069c9f008d091eef28f61c47c857bf60aa::article::Article",
|
|
47
|
+
},
|
|
48
|
+
EVENT_TYPES: {
|
|
49
|
+
publishArticleEvent: "0x455bd1ba1afe47158c9155001f33b4069c9f008d091eef28f61c47c857bf60aa::article::PublishArticleEvent",
|
|
50
|
+
},
|
|
51
|
+
};
|
|
52
|
+
export const testnetWalrusConfig = {
|
|
53
|
+
WALRUS_PACKAGE: "0xa998b8719ca1c0a6dc4e24a859bbb39f5477417f71885fbf2967a6510f699144",
|
|
54
|
+
WAL_STAKING_INNER_FIELD: "0x93429364cd0447556847e7e96f15c20411e9cc9769c0877e5b6e99732a73a006",
|
|
55
|
+
WALRUS_SYSTEM_SHARED_OBJECT_REF: {
|
|
56
|
+
objectId: "0x6c2547cbbc38025cf3adac45f63cb0a8d12ecf777cdc75a4971612bf97fdf6af",
|
|
57
|
+
initialSharedVersion: 400185623,
|
|
58
|
+
mutable: true, // mutable when register_blob
|
|
59
|
+
},
|
|
60
|
+
WALRUS_AGGREGATORS: ["https://aggregator.suicore.com"],
|
|
61
|
+
WALRUS_UPLOAD_RELAY_BASE_URL: "https://walrus-upload-relay-production-73a4.up.railway.app",
|
|
62
|
+
EVENT_TYPES: {
|
|
63
|
+
blobRegistered: "0xd84704c17fc870b8764832c535aa6b11f21a95cd6f5bb38a9b07d2cf42220c66::events::BlobRegistered",
|
|
64
|
+
},
|
|
65
|
+
};
|
|
66
|
+
// coins
|
|
67
|
+
export const testnetCoinConfig = {
|
|
68
|
+
USDC: "0xa1ec7fc00a6f40db9693ad1415d0c193ad3906494428cf252621037bd7117e29::usdc::USDC",
|
|
69
|
+
};
|
|
70
|
+
export const testnetSealConfig = {
|
|
71
|
+
serverConfigs: [
|
|
72
|
+
{
|
|
73
|
+
objectId: "0x73d05d62c18d9374e3ea529e8e0ed6161da1a141a94d3f76ae3fe4e99356db75",
|
|
74
|
+
weight: 1,
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
objectId: "0xf5d14a81a982144ae441cd7d64b09027f116a468bd36e7eca494f750591623c8",
|
|
78
|
+
weight: 1,
|
|
79
|
+
},
|
|
80
|
+
],
|
|
81
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { CoinSymbol, PlatformType, WorkType } from "./common.js";
|
|
2
|
+
import type { KeyServerConfig } from "@mysten/seal";
|
|
3
|
+
import type { WalrusClient } from "@mysten/walrus";
|
|
4
|
+
export interface SharedObjectRef {
|
|
5
|
+
objectId: string;
|
|
6
|
+
initialSharedVersion: number;
|
|
7
|
+
mutable: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface PlatformConfig {
|
|
10
|
+
PLATFORM_UPDATE_PROOF_TARGET: string;
|
|
11
|
+
PLATFORM_TYPE: string;
|
|
12
|
+
RECLAIM_MANAGER_SHARED_OBJECT_REF: SharedObjectRef;
|
|
13
|
+
IDENTITY_MANAGER_SHARED_OBJECT_REF: SharedObjectRef;
|
|
14
|
+
IDENTITY_MANAGER_IDENTIFIER_INFO_DF_ID: string;
|
|
15
|
+
IDENTITY_MANAGER_ADDRESS_TO_IDENTIFIER_DF_ID: string;
|
|
16
|
+
}
|
|
17
|
+
export interface ZingConfig {
|
|
18
|
+
ZING_FRAMEWORK_PACKAGE_ADDRESS: string;
|
|
19
|
+
ZING_IDENTITY_PACKAGE_ADDRESS: string;
|
|
20
|
+
ZING_STUDIO_PACKAGE_ADDRESS: string;
|
|
21
|
+
ZING_STUDIO_V0_PACKAGE_ADDRESS: string;
|
|
22
|
+
ZING_TREASURY_SHARED_OBJECT_REF: SharedObjectRef;
|
|
23
|
+
ZING_IDENTITY_CONFIG_SHARED_OBJECT_REF: SharedObjectRef;
|
|
24
|
+
PROOF_COMMITMENT_TYPE: string;
|
|
25
|
+
IDENTITY_PLATFORMS: Record<PlatformType, PlatformConfig>;
|
|
26
|
+
ZING_STUDIO_CONFIG_SHARED_OBJECT_REF: SharedObjectRef;
|
|
27
|
+
ZING_STORAGE_TREASURY_SHARED_OBJECT_REF: SharedObjectRef;
|
|
28
|
+
ZING_WORKS_TYPE: Record<WorkType, string>;
|
|
29
|
+
EVENT_TYPES: Record<"publishArticleEvent", string>;
|
|
30
|
+
}
|
|
31
|
+
export interface WalrusConfig {
|
|
32
|
+
WALRUS_PACKAGE: string;
|
|
33
|
+
WAL_STAKING_INNER_FIELD: string;
|
|
34
|
+
WALRUS_SYSTEM_SHARED_OBJECT_REF: SharedObjectRef;
|
|
35
|
+
WALRUS_AGGREGATORS: string[];
|
|
36
|
+
WALRUS_UPLOAD_RELAY_BASE_URL: string;
|
|
37
|
+
EVENT_TYPES: Record<"blobRegistered", string>;
|
|
38
|
+
}
|
|
39
|
+
export interface SealConfig {
|
|
40
|
+
serverConfigs: KeyServerConfig[];
|
|
41
|
+
}
|
|
42
|
+
export interface Config {
|
|
43
|
+
zing: ZingConfig;
|
|
44
|
+
walrus: WalrusConfig;
|
|
45
|
+
seal: SealConfig;
|
|
46
|
+
coins: Record<CoinSymbol, string>;
|
|
47
|
+
}
|
|
48
|
+
export type WalrusStakingState = Awaited<ReturnType<WalrusClient["stakingState"]>>;
|
|
49
|
+
export type WalrusSystemState = Awaited<ReturnType<WalrusClient["systemState"]>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/const.d.ts
ADDED
package/dist/const.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// // Walrus upload relay
|
|
2
|
+
export const WALRUS_UPLOAD_RELAY_BASE_URL = {
|
|
3
|
+
mainnet: "https://walrus-upload-relay-production-73a4.up.railway.app",
|
|
4
|
+
testnet: "https://walrus-upload-relay-production-73a4.up.railway.app",
|
|
5
|
+
};
|
|
6
|
+
// Platform
|
|
7
|
+
// seal
|
|
8
|
+
export const SEAL_SERVERS_CONFIGS = {
|
|
9
|
+
mainnet: [
|
|
10
|
+
{
|
|
11
|
+
objectId: "0xe0eb52eba9261b96e895bbb4deca10dcd64fbc626a1133017adcd5131353fd10",
|
|
12
|
+
weight: 1,
|
|
13
|
+
},
|
|
14
|
+
],
|
|
15
|
+
testnet: [
|
|
16
|
+
{
|
|
17
|
+
objectId: "0x73d05d62c18d9374e3ea529e8e0ed6161da1a141a94d3f76ae3fe4e99356db75",
|
|
18
|
+
weight: 1,
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
objectId: "0xf5d14a81a982144ae441cd7d64b09027f116a468bd36e7eca494f750591623c8",
|
|
22
|
+
weight: 1,
|
|
23
|
+
},
|
|
24
|
+
],
|
|
25
|
+
};
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
import { QuiltPatchId } from "./bcs.js";
|
|
2
|
+
import type { WalrusSystemState } from "./config/types.js";
|
|
3
|
+
import type { SuiGrpcClient } from "@mysten/sui/grpc";
|
|
4
|
+
import type { SuiJsonRpcClient } from "@mysten/sui/jsonRpc";
|
|
5
|
+
import type { EncodingType, WalrusClient } from "@mysten/walrus";
|
|
6
|
+
export declare function getDerivedStudioID(studioConfigId: string, address: string): string;
|
|
7
|
+
export declare function getDerivedStorageID(studioConfigId: string, address: string): string;
|
|
8
|
+
export declare function getDerivedWorksID(studioConfigId: string, address: string): string;
|
|
9
|
+
export declare function getDerivedMembershipID(studioConfigId: string, address: string): string;
|
|
10
|
+
export declare function getIdentifierByAddress(suiGrpcClient: SuiGrpcClient, addressToIdentifierDynamicFieldId: string, address: string): Promise<string | null>;
|
|
11
|
+
export declare function getIdentifierInfoByIdentifier(suiGrpcClient: SuiGrpcClient, identifierInfoDynamicFieldId: string, identifier: string): Promise<{
|
|
12
|
+
owner: string;
|
|
13
|
+
updated_at: string;
|
|
14
|
+
} | null>;
|
|
15
|
+
export declare function getDonationByIdentifier(suiGrpcClient: SuiGrpcClient, donationTableId: string, identifier: string): Promise<{
|
|
16
|
+
contents: {
|
|
17
|
+
key: {
|
|
18
|
+
name: string;
|
|
19
|
+
};
|
|
20
|
+
value: string;
|
|
21
|
+
}[];
|
|
22
|
+
} | null>;
|
|
23
|
+
export declare function getStudio(suiGrpcClient: SuiGrpcClient, studioId: string): Promise<{
|
|
24
|
+
id: {
|
|
25
|
+
id: string;
|
|
26
|
+
};
|
|
27
|
+
owner: string;
|
|
28
|
+
period: string[];
|
|
29
|
+
monthly_subscription_fee: {
|
|
30
|
+
contents: {
|
|
31
|
+
key: number;
|
|
32
|
+
value: string;
|
|
33
|
+
}[];
|
|
34
|
+
};
|
|
35
|
+
membership: {
|
|
36
|
+
id: {
|
|
37
|
+
id: string;
|
|
38
|
+
};
|
|
39
|
+
size: string;
|
|
40
|
+
};
|
|
41
|
+
works: {
|
|
42
|
+
id: {
|
|
43
|
+
id: string;
|
|
44
|
+
};
|
|
45
|
+
size: string;
|
|
46
|
+
};
|
|
47
|
+
encrypted_file_key: number[] | null;
|
|
48
|
+
} | null>;
|
|
49
|
+
export declare function getStorageSpace(suiGrpcClient: SuiGrpcClient, storageSpaceId: string): Promise<{
|
|
50
|
+
id: {
|
|
51
|
+
id: string;
|
|
52
|
+
};
|
|
53
|
+
owner: string;
|
|
54
|
+
tier: number | null;
|
|
55
|
+
storage_used: {
|
|
56
|
+
contents: {
|
|
57
|
+
key: number;
|
|
58
|
+
value: string;
|
|
59
|
+
}[];
|
|
60
|
+
};
|
|
61
|
+
credits: string;
|
|
62
|
+
} | null>;
|
|
63
|
+
export declare function getStorageTreasury(suiGrpcClient: SuiGrpcClient, storageTreasuryId: string): Promise<{
|
|
64
|
+
id: {
|
|
65
|
+
id: string;
|
|
66
|
+
};
|
|
67
|
+
tier_plan: {
|
|
68
|
+
contents: {
|
|
69
|
+
key: number;
|
|
70
|
+
value: {
|
|
71
|
+
price: string;
|
|
72
|
+
duration_days: number;
|
|
73
|
+
storage_limit: string;
|
|
74
|
+
};
|
|
75
|
+
}[];
|
|
76
|
+
};
|
|
77
|
+
storages_by_epoch: {
|
|
78
|
+
contents: {
|
|
79
|
+
key: number;
|
|
80
|
+
value: {
|
|
81
|
+
id: {
|
|
82
|
+
id: string;
|
|
83
|
+
};
|
|
84
|
+
start_epoch: number;
|
|
85
|
+
end_epoch: number;
|
|
86
|
+
storage_size: string;
|
|
87
|
+
};
|
|
88
|
+
}[];
|
|
89
|
+
};
|
|
90
|
+
wal_treasury: {
|
|
91
|
+
id: {
|
|
92
|
+
id: string;
|
|
93
|
+
};
|
|
94
|
+
balance: {
|
|
95
|
+
value: string;
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
} | null>;
|
|
99
|
+
export declare function getMember(suiGrpcClient: SuiGrpcClient, membershipTableId: string, member: string): Promise<{
|
|
100
|
+
level: number;
|
|
101
|
+
expired_at: string;
|
|
102
|
+
} | null>;
|
|
103
|
+
export declare function getMembers(suiGrpcClient: SuiGrpcClient, membershipTableId: string, cursor?: string, limit?: number): Promise<{
|
|
104
|
+
data: {
|
|
105
|
+
member: string;
|
|
106
|
+
level: number;
|
|
107
|
+
expiredAt: string;
|
|
108
|
+
}[];
|
|
109
|
+
nextCursor: string | undefined;
|
|
110
|
+
hasNextPage: boolean;
|
|
111
|
+
}>;
|
|
112
|
+
export declare function getWork(suiGrpcClient: SuiGrpcClient, walrusSystem: WalrusSystemState, workId: string, workType?: string): Promise<{
|
|
113
|
+
id: {
|
|
114
|
+
id: string;
|
|
115
|
+
};
|
|
116
|
+
owner: string;
|
|
117
|
+
deleted: boolean;
|
|
118
|
+
created_at: string;
|
|
119
|
+
subscription_level: number | null;
|
|
120
|
+
blobs: {
|
|
121
|
+
id: {
|
|
122
|
+
id: string;
|
|
123
|
+
};
|
|
124
|
+
registered_epoch: number;
|
|
125
|
+
blob_id: string;
|
|
126
|
+
size: string;
|
|
127
|
+
encoding_type: number;
|
|
128
|
+
certified_epoch: number | null;
|
|
129
|
+
storage: {
|
|
130
|
+
id: {
|
|
131
|
+
id: string;
|
|
132
|
+
};
|
|
133
|
+
start_epoch: number;
|
|
134
|
+
end_epoch: number;
|
|
135
|
+
storage_size: string;
|
|
136
|
+
};
|
|
137
|
+
deletable: boolean;
|
|
138
|
+
}[];
|
|
139
|
+
files: {
|
|
140
|
+
contents: {
|
|
141
|
+
key: string;
|
|
142
|
+
value: {
|
|
143
|
+
blob_index: string;
|
|
144
|
+
mime_type: string;
|
|
145
|
+
size: string;
|
|
146
|
+
};
|
|
147
|
+
}[];
|
|
148
|
+
};
|
|
149
|
+
} | null>;
|
|
150
|
+
export declare function getWorks(suiGrpcClient: SuiGrpcClient, walrusSystem: WalrusSystemState, workTableId: string, workType?: string, cursor?: string, limit?: number): Promise<{
|
|
151
|
+
data: {
|
|
152
|
+
id: {
|
|
153
|
+
id: string;
|
|
154
|
+
};
|
|
155
|
+
owner: string;
|
|
156
|
+
deleted: boolean;
|
|
157
|
+
created_at: string;
|
|
158
|
+
subscription_level: number | null;
|
|
159
|
+
blobs: {
|
|
160
|
+
id: {
|
|
161
|
+
id: string;
|
|
162
|
+
};
|
|
163
|
+
registered_epoch: number;
|
|
164
|
+
blob_id: string;
|
|
165
|
+
size: string;
|
|
166
|
+
encoding_type: number;
|
|
167
|
+
certified_epoch: number | null;
|
|
168
|
+
storage: {
|
|
169
|
+
id: {
|
|
170
|
+
id: string;
|
|
171
|
+
};
|
|
172
|
+
start_epoch: number;
|
|
173
|
+
end_epoch: number;
|
|
174
|
+
storage_size: string;
|
|
175
|
+
};
|
|
176
|
+
deletable: boolean;
|
|
177
|
+
}[];
|
|
178
|
+
files: {
|
|
179
|
+
contents: {
|
|
180
|
+
key: string;
|
|
181
|
+
value: {
|
|
182
|
+
blob_index: string;
|
|
183
|
+
mime_type: string;
|
|
184
|
+
size: string;
|
|
185
|
+
};
|
|
186
|
+
}[];
|
|
187
|
+
};
|
|
188
|
+
}[];
|
|
189
|
+
nextCursor: string | undefined;
|
|
190
|
+
hasNextPage: boolean;
|
|
191
|
+
}>;
|
|
192
|
+
export declare function getPublishedArticleAndBlobId(suiGrpcClient: SuiGrpcClient, suiClient: SuiJsonRpcClient, walrusClient: WalrusClient, digest: string, blobRegisteredEventType: string, publishArticleEventType: string): Promise<{
|
|
193
|
+
parsedPublishArticleEvent: {
|
|
194
|
+
article_id: string;
|
|
195
|
+
owner: string;
|
|
196
|
+
blob_ids: string[];
|
|
197
|
+
blob_sizes: string[];
|
|
198
|
+
blob_storage_sizes: string[];
|
|
199
|
+
blob_end_epochs: number[];
|
|
200
|
+
files: {
|
|
201
|
+
contents: {
|
|
202
|
+
key: string;
|
|
203
|
+
value: {
|
|
204
|
+
blob_index: string;
|
|
205
|
+
mime_type: string;
|
|
206
|
+
size: string;
|
|
207
|
+
};
|
|
208
|
+
}[];
|
|
209
|
+
};
|
|
210
|
+
timestamp_ms: string;
|
|
211
|
+
};
|
|
212
|
+
blobObjectId: string;
|
|
213
|
+
}>;
|
|
214
|
+
export declare function encodeQuiltPatchId(id: typeof QuiltPatchId.$inferInput): string;
|
|
215
|
+
export declare function urlSafeBase64(bytes: Uint8Array): string;
|
|
216
|
+
export declare function getMaxFaultyNodes(nShards: number): number;
|
|
217
|
+
export declare function decodingSafetyLimit(nShards: number, encodingType: EncodingType): number;
|
|
218
|
+
export declare function signersToBitmap(signers: number[], committeeSize: number): Uint8Array;
|
|
219
|
+
export declare function getSourceSymbols(nShards: number, encodingType?: EncodingType): {
|
|
220
|
+
primarySymbols: number;
|
|
221
|
+
secondarySymbols: number;
|
|
222
|
+
};
|
|
223
|
+
/**
|
|
224
|
+
* Calculate the encoded sliver size.
|
|
225
|
+
* This matches the Walrus SDK's encodedSliverSize function.
|
|
226
|
+
*/
|
|
227
|
+
export declare function encodedSliverSize(unencodedLength: number, nShards: number, encodingType?: EncodingType): number;
|
|
228
|
+
export declare function encodedBlobLength(unencodedLength: number, nShards: number, encodingType?: EncodingType): number;
|