Skip to content

Commit

Permalink
update permaweb-deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
NickJ202 committed Jul 3, 2024
1 parent 6d552f4 commit c1a3a8d
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 34 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions src/api/index.ts
Original file line number Diff line number Diff line change
@@ -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';

Expand Down Expand Up @@ -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 },
});
Expand Down
4 changes: 2 additions & 2 deletions src/api/profiles.ts
Original file line number Diff line number Diff line change
@@ -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<ProfileHeaderType | null> {
Expand All @@ -15,7 +15,7 @@ export async function getProfile(args: { address: string }): Promise<ProfileHead
};

const profileLookup = await readHandler({
processId: AOS.profileRegistry,
processId: AO.profileRegistry,
action: 'Get-Profiles-By-Delegate',
data: { Address: args.address },
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { IconButton } from 'components/atoms/IconButton';
import { Loader } from 'components/atoms/Loader';
import { Modal } from 'components/molecules/Modal';
import { Table } from 'components/molecules/Table';
import { AOS, ASSETS, PAGINATORS, REDIRECTS, URLS } from 'helpers/config';
import { AO, ASSETS, PAGINATORS, REDIRECTS, URLS } from 'helpers/config';
import { AlignType, CollectionType } from 'helpers/types';
import { checkAddress, formatAddress } from 'helpers/utils';
import { useArweaveProvider } from 'providers/ArweaveProvider';
Expand Down Expand Up @@ -90,10 +90,10 @@ function CollectionDropdown(props: { id: string; title: string }) {
}

if (balance > 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();
Expand Down Expand Up @@ -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 }],
});
Expand Down
8 changes: 4 additions & 4 deletions src/components/organisms/ProfileManage/ProfileManage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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();

Expand All @@ -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,
});
Expand Down
6 changes: 3 additions & 3 deletions src/gql/assets.ts
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -43,7 +43,7 @@ export async function getAssetById(args: { id: string; gateway: string }): Promi

export async function getAssetIdsByUser(args: { address: string }): Promise<string[]> {
const profileLookup = await readHandler({
processId: AOS.profileRegistry,
processId: AO.profileRegistry,
action: 'Get-Profiles-By-Delegate',
data: { Address: args.address },
});
Expand All @@ -61,7 +61,7 @@ export async function getAssetIdsByUser(args: { address: string }): Promise<stri
});

if (fetchedProfile) {
const swapIds = [AOS.defaultToken, AOS.pixl];
const swapIds = [AO.defaultToken, AO.pixl];
return fetchedProfile.Assets.map((asset: { Id: string; Quantity: string }) => asset.Id).filter(
(id: string) => !swapIds.includes(id)
);
Expand Down
2 changes: 1 addition & 1 deletion src/helpers/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
18 changes: 9 additions & 9 deletions src/providers/ArweaveProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -94,8 +94,8 @@ export function ArweaveProvider(props: ArweaveProviderProps) {
const [arBalance, setArBalance] = React.useState<number | null>(null);
const [turboBalance, setTurboBalance] = React.useState<number | string | null>(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<boolean>(false);

Expand Down Expand Up @@ -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);
Expand All @@ -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]);
Expand All @@ -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);
Expand Down
14 changes: 7 additions & 7 deletions src/views/Upload/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand All @@ -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,
});
Expand Down Expand Up @@ -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,
});
Expand Down Expand Up @@ -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();
}
Expand All @@ -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,
Expand Down

0 comments on commit c1a3a8d

Please sign in to comment.