@meddleware/token-deployer-ui 0.0.25 → 0.0.26
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@meddleware/token-deployer-ui",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.26",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "0BSD",
|
|
6
6
|
"repository": {
|
|
@@ -51,10 +51,10 @@
|
|
|
51
51
|
"@meddleware/design-tokens": "^0.1.8",
|
|
52
52
|
"@meddleware/sui-token-client": "^0.0.5",
|
|
53
53
|
"@meddleware/ui": "^0.1.30",
|
|
54
|
-
"@meddleware/walrus-client": "^0.0.
|
|
55
|
-
"@meddleware/walrus-relay": "^0.1.
|
|
54
|
+
"@meddleware/walrus-client": "^0.0.26",
|
|
55
|
+
"@meddleware/walrus-relay": "^0.1.28",
|
|
56
56
|
"@mysten/move-bytecode-template": "~0.4.1",
|
|
57
|
-
"@mysten/sui": "^2.33.
|
|
57
|
+
"@mysten/sui": "^2.33.2",
|
|
58
58
|
"@mysten/walrus": "~1.2.32",
|
|
59
59
|
"vue": "^3.5.0"
|
|
60
60
|
},
|
|
@@ -62,7 +62,8 @@
|
|
|
62
62
|
"@meddleware/wallet-adapter": ">=0.0.12 <0.2.0"
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
|
65
|
-
"@meddleware/access-gate-client": "^0.0.
|
|
65
|
+
"@meddleware/access-gate-client": "^0.0.6",
|
|
66
|
+
"@meddleware/eslint-config": "^0.0.1",
|
|
66
67
|
"@meddleware/wallet-adapter": "^0.0.13",
|
|
67
68
|
"@playwright/test": "^1.56.0",
|
|
68
69
|
"@types/node": "~24.12.2",
|
|
@@ -79,7 +80,7 @@
|
|
|
79
80
|
"html-validate-vue": "^9.3.1",
|
|
80
81
|
"jiti": "^2.7.0",
|
|
81
82
|
"jsdom": "^29.1.1",
|
|
82
|
-
"oxfmt": "^0.
|
|
83
|
+
"oxfmt": "^0.72.0",
|
|
83
84
|
"oxlint": "~1.76.0",
|
|
84
85
|
"playwright": "^1.62.0",
|
|
85
86
|
"postcss": "^8.4.49",
|
|
@@ -6,7 +6,8 @@ import { getReadClient } from '../wallet.js'
|
|
|
6
6
|
import { useWalrusRelay } from '../composables/useWalrusRelay.js'
|
|
7
7
|
import { useAccessGate } from '@meddleware/walrus-relay'
|
|
8
8
|
// The flow subpath carries no wasm; it loads the Walrus client lazily when an upload starts.
|
|
9
|
-
import { browserStorage, consumeStorageKey, createGatedAccess, runBlobUpload } from '@meddleware/walrus-client/flow'
|
|
9
|
+
import { browserStorage, consumeStorageKey, createGatedAccess, getUploadRetry, runBlobUpload } from '@meddleware/walrus-client/flow'
|
|
10
|
+
import { normalizeSuiAddress } from '@mysten/sui/utils'
|
|
10
11
|
import { ICON_EPOCHS } from '../lib/walrus-constants.js'
|
|
11
12
|
import { ACCESS_GATE, ICON_MAX_BYTES, WALRUS_MAX_TIP_MIST, WALRUS_RPC_URLS, validateIconFile } from '../config.js'
|
|
12
13
|
import type { WalrusNetwork } from '../config.js'
|
|
@@ -80,6 +81,9 @@ const tab = ref('url')
|
|
|
80
81
|
const uploading = ref(false)
|
|
81
82
|
const status = ref('')
|
|
82
83
|
const uploadError = ref<string | null>(null)
|
|
84
|
+
// Set when the relay upload failed after the icon was registered (and paid for): retries on it.
|
|
85
|
+
const retryUpload = ref<(() => Promise<{ url: string }>) | null>(null)
|
|
86
|
+
const retrying = ref(false)
|
|
83
87
|
const fileName = ref('')
|
|
84
88
|
let bytes: Uint8Array | null = null
|
|
85
89
|
|
|
@@ -131,6 +135,26 @@ function onRelayChange(newHost: string): void {
|
|
|
131
135
|
selectedRelayHost.value = newHost
|
|
132
136
|
}
|
|
133
137
|
|
|
138
|
+
async function retryUploadOnRegistration(): Promise<void> {
|
|
139
|
+
const retry = retryUpload.value
|
|
140
|
+
if (!retry || retrying.value) return
|
|
141
|
+
retrying.value = true
|
|
142
|
+
uploadError.value = null
|
|
143
|
+
try {
|
|
144
|
+
const result = await retry()
|
|
145
|
+
emit('update:modelValue', result.url)
|
|
146
|
+
tab.value = 'url'
|
|
147
|
+
status.value = 'Uploaded ✓ — URL filled in above.'
|
|
148
|
+
retryUpload.value = null
|
|
149
|
+
} catch (e) {
|
|
150
|
+
uploadError.value = e instanceof Error ? e.message : String(e)
|
|
151
|
+
retryUpload.value = getUploadRetry<{ url: string }>(e)
|
|
152
|
+
} finally {
|
|
153
|
+
retrying.value = false
|
|
154
|
+
if (account.value) void refreshAccess()
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
134
158
|
async function upload(): Promise<void> {
|
|
135
159
|
if (!bytes) {
|
|
136
160
|
uploadError.value = 'Choose an image first.'
|
|
@@ -161,8 +185,10 @@ async function upload(): Promise<void> {
|
|
|
161
185
|
key: consumeStorageKey(walrusNet, gate.gateId, address),
|
|
162
186
|
relayHost: selectedRelayHost.value,
|
|
163
187
|
address,
|
|
188
|
+
gateId: normalizeSuiAddress(gate.gateId),
|
|
189
|
+
network: walrusNet,
|
|
164
190
|
nftId,
|
|
165
|
-
singleUse: accessGate.
|
|
191
|
+
singleUse: accessGate.singleUse.value,
|
|
166
192
|
buildConsume: (id, nonce) => accessGate.buildConsume(id, nonce),
|
|
167
193
|
signAndExecute: (tx) => executor.signAndExecute(tx),
|
|
168
194
|
waitForTransaction: (digest) => executor.waitForTransaction(digest),
|
|
@@ -189,8 +215,10 @@ async function upload(): Promise<void> {
|
|
|
189
215
|
emit('update:modelValue', result.url)
|
|
190
216
|
tab.value = 'url'
|
|
191
217
|
status.value = 'Uploaded ✓ — URL filled in above.'
|
|
218
|
+
retryUpload.value = null
|
|
192
219
|
} catch (e) {
|
|
193
220
|
uploadError.value = e instanceof Error ? e.message : String(e)
|
|
221
|
+
retryUpload.value = getUploadRetry<{ url: string }>(e)
|
|
194
222
|
status.value = ''
|
|
195
223
|
} finally {
|
|
196
224
|
uploading.value = false
|
|
@@ -338,6 +366,10 @@ function onBrowseSelect(url: string): void {
|
|
|
338
366
|
years. <span v-if="status">{{ status }}</span>
|
|
339
367
|
</p>
|
|
340
368
|
<UiNotice v-if="uploadError" type="error">{{ uploadError }}</UiNotice>
|
|
369
|
+
<p v-if="retryUpload" class="upload-note">
|
|
370
|
+
The icon is registered and paid for. <button type="button" :disabled="retrying" @click="retryUploadOnRegistration">{{ retrying ? 'Retrying…' : 'Retry upload' }}</button>
|
|
371
|
+
(no second payment).
|
|
372
|
+
</p>
|
|
341
373
|
</div>
|
|
342
374
|
|
|
343
375
|
<!-- Browse panel -->
|