From 2104fb21854159522d3df90fbe3c4e9107a7df99 Mon Sep 17 00:00:00 2001 From: William Chong Date: Wed, 20 Sep 2023 19:22:49 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E2=9C=A8=20Add=20ipfs=20tag=20in=20arweave?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- utils/arweave/v2.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/utils/arweave/v2.ts b/utils/arweave/v2.ts index 76a5b26d..03d4a37c 100644 --- a/utils/arweave/v2.ts +++ b/utils/arweave/v2.ts @@ -150,8 +150,11 @@ export async function uploadSingleFileToBundlr( }: { fileSize: number; fileType?: string, ipfsHash: string; txHash: string }, ) { const bundler = await getBundler({ fileSize, ipfsHash, txHash }) - const response = await bundler.upload(file, { - tags: fileType ? [{ name: 'Content-Type', value: fileType }] : [], - }) + const tags = [ + { name: 'IPFS-Add', value: ipfsHash }, + { name: 'standard', value: 'v0.1'}, + ]; + if (fileType) tags.push({ name: 'Content-Type', value: fileType }) + const response = await bundler.upload(file, { tags }) return response.id } From f14d898f3ef502109610942e9a5267cc78821634 Mon Sep 17 00:00:00 2001 From: William Chong Date: Wed, 20 Sep 2023 19:26:15 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=9A=B8=20Add=20upload=20status=20upda?= =?UTF-8?q?te=20in=20iscn=20register=20steps?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/IscnRegisterForm.vue | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/components/IscnRegisterForm.vue b/components/IscnRegisterForm.vue index ef4dddaa..e7502ddd 100644 --- a/components/IscnRegisterForm.vue +++ b/components/IscnRegisterForm.vue @@ -1072,6 +1072,7 @@ export default class IscnRegisterForm extends Vue { async onUploadOnly(): Promise { logTrackerEvent(this, 'ISCNCreate', 'ClickUpload', '', 1); + this.uploadStatus = 'loading' await this.getLikerIdsAddresses() this.$emit('handleSubmit') this.error = '' @@ -1172,6 +1173,7 @@ export default class IscnRegisterForm extends Vue { logTrackerEvent(this, 'ISCNCreate', 'SubmitToNumbers', '', 1); } this.isUploadingArweave = true; + this.uploadStatus = 'uploading'; try { const arrayBuffer = await this.fileBlob.arrayBuffer(); const buffer = Buffer.from(arrayBuffer); @@ -1206,6 +1208,7 @@ export default class IscnRegisterForm extends Vue { logTrackerEvent(this, 'ISCNCreate', 'SubmitToNumbers', '', 1); this.isOpenSignDialog = true; try { + this.uploadStatus = 'loading'; const formData = new FormData(); if (this.fileBlob) formData.append('file', this.fileBlob); const { @@ -1250,6 +1253,7 @@ export default class IscnRegisterForm extends Vue { return } try { + this.uploadStatus = 'signing' const res = await signISCNTx(formatISCNTxPayload(this.payload), this.signer, this.address) this.uploadStatus = 'success' this.$emit('txBroadcasted', res)