From c1a3a8d95d64854779b8c7f1d4933b17ec8b5fa1 Mon Sep 17 00:00:00 2001 From: NickJ202 Date: Wed, 3 Jul 2024 19:59:53 -0400 Subject: [PATCH] update permaweb-deploy --- package.json | 4 ++-- src/api/index.ts | 4 ++-- src/api/profiles.ts | 4 ++-- .../CollectionsTable/CollectionsTable.tsx | 8 ++++---- .../organisms/ProfileManage/ProfileManage.tsx | 8 ++++---- src/gql/assets.ts | 6 +++--- src/helpers/config.ts | 2 +- src/providers/ArweaveProvider.tsx | 18 +++++++++--------- src/views/Upload/index.tsx | 14 +++++++------- 9 files changed, 34 insertions(+), 34 deletions(-) diff --git a/package.json b/package.json index ccaa038..c26fdd0 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "test:coverage": "CI=true npm test -- --env=jsdom --coverage", "prepare": "husky install", "build": "NODE_ENV=production webpack", - "deploy-main": "npm run build && permaweb-deploy --ant-process Y_0sEnzlPZGmbhknubMBhFmkK9AAylOnx4Tl3Mz_uQM" + "deploy-main": "permaweb-deploy --ant-process Y_0sEnzlPZGmbhknubMBhFmkK9AAylOnx4Tl3Mz_uQM" }, "dependencies": { "@irys/sdk": "^0.1.0-a1", @@ -69,7 +69,7 @@ "npm-force-resolutions": "^0.0.10", "os-browserify": "^0.3.0", "path-browserify": "^1.0.1", - "permaweb-deploy": "1.1.2", + "permaweb-deploy": "1.1.3", "prettier": "^2.8.3", "process": "^0.11.10", "raw-loader": "^4.0.2", diff --git a/src/api/index.ts b/src/api/index.ts index 3d5fa9b..b9e86ca 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -1,7 +1,7 @@ import Arweave from 'arweave'; import { createDataItemSigner, dryrun, message, result, results } from '@permaweb/aoconnect'; -import { AOS, API_CONFIG, CONTENT_TYPES, GATEWAYS } from 'helpers/config'; +import { AO, API_CONFIG, CONTENT_TYPES, GATEWAYS } from 'helpers/config'; import { TagType } from 'helpers/types'; import { getTagValue } from 'helpers/utils'; @@ -46,7 +46,7 @@ export async function getProfileByWalletAddress(args: { address: string }): Prom try { const profileLookup = await readHandler({ - processId: AOS.profileRegistry, + processId: AO.profileRegistry, action: 'Get-Profiles-By-Delegate', data: { Address: args.address }, }); diff --git a/src/api/profiles.ts b/src/api/profiles.ts index d82843c..12985bd 100644 --- a/src/api/profiles.ts +++ b/src/api/profiles.ts @@ -1,6 +1,6 @@ import { readHandler } from 'api'; -import { AOS } from 'helpers/config'; +import { AO } from 'helpers/config'; import { ProfileHeaderType } from 'helpers/types'; export async function getProfile(args: { address: string }): Promise { @@ -15,7 +15,7 @@ export async function getProfile(args: { address: string }): Promise 0) { - const pair = [collection.Assets[i], AOS.defaultToken]; + const pair = [collection.Assets[i], AO.defaultToken]; const dominantToken = pair[0]; const swapToken = pair[1]; - const recipient = AOS.ucm; + const recipient = AO.ucm; const quantity = Math.floor((percentage / 100) * balance).toString(); const unitPrice = (price * DENOMINATION).toString(); @@ -293,7 +293,7 @@ export default function CollectionsTable() { setLoading(true); try { const response = await readHandler({ - processId: AOS.collectionsRegistry, + processId: AO.collectionsRegistry, action: 'Get-Collections-By-User', tags: [{ name: 'Creator', value: arProvider.profile.id }], }); diff --git a/src/components/organisms/ProfileManage/ProfileManage.tsx b/src/components/organisms/ProfileManage/ProfileManage.tsx index 184387f..54ee49b 100644 --- a/src/components/organisms/ProfileManage/ProfileManage.tsx +++ b/src/components/organisms/ProfileManage/ProfileManage.tsx @@ -10,7 +10,7 @@ import { Button } from 'components/atoms/Button'; import { FormField } from 'components/atoms/FormField'; import { Notification } from 'components/atoms/Notification'; import { TextArea } from 'components/atoms/TextArea'; -import { AOS, ASSETS, GATEWAYS, TAGS } from 'helpers/config'; +import { AO, ASSETS, GATEWAYS, TAGS } from 'helpers/config'; import { getTxEndpoint } from 'helpers/endpoints'; import { NotificationType } from 'helpers/types'; import { checkAddress, getBase64Data, getDataURLContentType } from 'helpers/utils'; @@ -140,7 +140,7 @@ export default function ProfileManage(props: IProps) { let processSrc = null; try { - const processSrcFetch = await fetch(getTxEndpoint(AOS.profileSrc)); + const processSrcFetch = await fetch(getTxEndpoint(AO.profileSrc)); if (processSrcFetch.ok) { processSrc = await processSrcFetch.text(); @@ -153,8 +153,8 @@ export default function ProfileManage(props: IProps) { console.log('Spawning profile process...'); const processId = await aos.spawn({ - module: AOS.module, - scheduler: AOS.scheduler, + module: AO.module, + scheduler: AO.scheduler, signer: createDataItemSigner(arProvider.wallet), tags: profileTags, }); diff --git a/src/gql/assets.ts b/src/gql/assets.ts index e9e16a6..20acd75 100644 --- a/src/gql/assets.ts +++ b/src/gql/assets.ts @@ -1,7 +1,7 @@ import { readHandler } from 'api'; import { getGQLData, getProfiles } from 'gql'; -import { AOS, ASSETS, DEFAULT_THUMBNAIL, STORAGE, TAGS } from 'helpers/config'; +import { AO, ASSETS, DEFAULT_THUMBNAIL, STORAGE, TAGS } from 'helpers/config'; import { AGQLResponseType, AssetType, @@ -43,7 +43,7 @@ export async function getAssetById(args: { id: string; gateway: string }): Promi export async function getAssetIdsByUser(args: { address: string }): Promise { const profileLookup = await readHandler({ - processId: AOS.profileRegistry, + processId: AO.profileRegistry, action: 'Get-Profiles-By-Delegate', data: { Address: args.address }, }); @@ -61,7 +61,7 @@ export async function getAssetIdsByUser(args: { address: string }): Promise asset.Id).filter( (id: string) => !swapIds.includes(id) ); diff --git a/src/helpers/config.ts b/src/helpers/config.ts index 7fe23e8..50a7dfb 100644 --- a/src/helpers/config.ts +++ b/src/helpers/config.ts @@ -50,7 +50,7 @@ export const APP = { name: 'Helix', }; -export const AOS = { +export const AO = { module: 'Pq2Zftrqut0hdisH_MC2pDOT6S4eQFoxGsFUzR6r350', scheduler: '_GQ33BkPtZrqxA84vM8Zk-N2aO0toNNu_C-l-rawrBA', assetSrc: 'Fmtgzy1Chs-5ZuUwHpQjQrQ7H7v1fjsP0Bi8jVaDIKA', diff --git a/src/providers/ArweaveProvider.tsx b/src/providers/ArweaveProvider.tsx index f29f671..13ba1b0 100644 --- a/src/providers/ArweaveProvider.tsx +++ b/src/providers/ArweaveProvider.tsx @@ -8,7 +8,7 @@ import { ArconnectSigner } from 'arbundles'; import { getProfileByWalletAddress, readHandler } from 'api'; import { Modal } from 'components/molecules/Modal'; -import { AOS, API_CONFIG, AR_WALLETS, GATEWAYS, WALLET_PERMISSIONS } from 'helpers/config'; +import { AO, API_CONFIG, AR_WALLETS, GATEWAYS, WALLET_PERMISSIONS } from 'helpers/config'; import { getARBalanceEndpoint, getTurboBalanceEndpoint } from 'helpers/endpoints'; import { ProfileHeaderType, WalletEnum } from 'helpers/types'; import { getARAmountFromWinc } from 'helpers/utils'; @@ -94,8 +94,8 @@ export function ArweaveProvider(props: ArweaveProviderProps) { const [arBalance, setArBalance] = React.useState(null); const [turboBalance, setTurboBalance] = React.useState(null); const [tokenBalances, setTokenBalances] = React.useState<{ [address: string]: number } | null>({ - [AOS.defaultToken]: null, - [AOS.pixl]: null, + [AO.defaultToken]: null, + [AO.pixl]: null, }); const [toggleTokenBalanceUpdate, setToggleTokenBalanceUpdate] = React.useState(false); @@ -185,13 +185,13 @@ export function ArweaveProvider(props: ArweaveProviderProps) { const fetchDefaultTokenBalance = async () => { try { const defaultTokenBalance = await readHandler({ - processId: AOS.defaultToken, + processId: AO.defaultToken, action: 'Balance', tags: [{ name: 'Recipient', value: profile.id }], }); setTokenBalances((prevBalances) => ({ ...prevBalances, - [AOS.defaultToken]: defaultTokenBalance || 0, + [AO.defaultToken]: defaultTokenBalance || 0, })); } catch (e) { console.error(e); @@ -201,8 +201,8 @@ export function ArweaveProvider(props: ArweaveProviderProps) { fetchDefaultTokenBalance(); } else { setTokenBalances({ - [AOS.defaultToken]: 0, - [AOS.pixl]: 0, + [AO.defaultToken]: 0, + [AO.pixl]: 0, }); } }, [profile, toggleTokenBalanceUpdate]); @@ -212,13 +212,13 @@ export function ArweaveProvider(props: ArweaveProviderProps) { const fetchPixlTokenBalance = async () => { try { const pixlTokenBalance = await readHandler({ - processId: AOS.pixl, + processId: AO.pixl, action: 'Balance', tags: [{ name: 'Recipient', value: profile.id }], }); setTokenBalances((prevBalances) => ({ ...prevBalances, - [AOS.pixl]: pixlTokenBalance || 0, + [AO.pixl]: pixlTokenBalance || 0, })); } catch (e) { console.error(e); diff --git a/src/views/Upload/index.tsx b/src/views/Upload/index.tsx index 699c14a..129d31f 100644 --- a/src/views/Upload/index.tsx +++ b/src/views/Upload/index.tsx @@ -208,7 +208,7 @@ export default function Upload() { let processSrc = null; try { - const processSrcFetch = await fetch(getTxEndpoint(AOS.collectionSrc)); + const processSrcFetch = await fetch(getTxEndpoint(AO.collectionSrc)); if (processSrcFetch.ok) { processSrc = await processSrcFetch.text(); } @@ -234,8 +234,8 @@ export default function Upload() { while (!processId && retryCount < maxRetries) { try { processId = await aos.spawn({ - module: AOS.module, - scheduler: AOS.scheduler, + module: AO.module, + scheduler: AO.scheduler, signer: createDataItemSigner(globalThis.arweaveWallet), tags: collectionTags, }); @@ -303,7 +303,7 @@ export default function Upload() { if (thumbnailTx) registryTags.push({ name: 'Thumbnail', value: thumbnailTx }); await aos.message({ - process: AOS.collectionsRegistry, + process: AO.collectionsRegistry, signer: createDataItemSigner(globalThis.arweaveWallet), tags: registryTags, }); @@ -383,7 +383,7 @@ export default function Upload() { const buffer: any = await fileToBuffer(data.file); try { - const processSrcFetch = await fetch(getTxEndpoint(AOS.assetSrc)); + const processSrcFetch = await fetch(getTxEndpoint(AO.assetSrc)); if (processSrcFetch.ok) { processSrc = await processSrcFetch.text(); } @@ -410,8 +410,8 @@ export default function Upload() { while (!processId && retryCount < maxRetries) { try { processId = await aos.spawn({ - module: AOS.module, - scheduler: AOS.scheduler, + module: AO.module, + scheduler: AO.scheduler, signer: createDataItemSigner(globalThis.arweaveWallet), tags: assetTags, data: buffer,