Skip to content

Commit

Permalink
fix packages (#435)
Browse files Browse the repository at this point in the history
  • Loading branch information
rubenmarcus authored Nov 21, 2023
1 parent 3babad1 commit 8180ff6
Show file tree
Hide file tree
Showing 7 changed files with 88 additions and 134 deletions.
106 changes: 83 additions & 23 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions packages/react/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ This package contains React helpers for interacting with Mintbase JS.
</p>

Example:
You can check a [quick example of Simple Login](https://github.com/Mintbase/starter) using Next.js 14 and @mintbase-js/react
You can check a [quick example of Simple Login](https://github.com/Mintbase/examples/tree/main/starter) using Next.js 14 and @mintbase-js/react


[Live Demo](https://mintbase-starter.vercel.app/)
Expand Down Expand Up @@ -66,7 +66,7 @@ the default way of interacting with Mintbase Wallet is using the MintbaseWalletC
**additionalWallets** : `WalletModuleFactory[] extra wallets setup`

```typescript

import "@near-wallet-selector/modal-ui/styles.css";
import { MintbaseWalletContextProvider } from '@mintbase-js/react'

<MintbaseWalletContextProvider
Expand Down
2 changes: 0 additions & 2 deletions packages/react/src/MintbaseWalletContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ import type {
WalletModuleFactory,
} from '@near-wallet-selector/core';
import type { WalletSelectorModal } from '@near-wallet-selector/modal-ui';
import '@near-wallet-selector/modal-ui/styles.css';


// This is heavily based on
// https://github.com/near/wallet-selector/blob/main/examples/react/contexts/WalletSelectorContext.tsx
Expand Down
5 changes: 2 additions & 3 deletions packages/storage/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@
"author": "",
"license": "MIT",
"dependencies": {
"@mintbase-js/sdk": "^0.5.0-beta-prerelease.0",
"near-api-js": "^2.1.3",
"superagent": "^8.0.3"
"@mintbase-js/sdk": "^0.5.0-beta-prerelease.4",
"near-api-js": "^2.1.3"
},
"devDependencies": {
"@types/node": "^18.11.9"
Expand Down
65 changes: 0 additions & 65 deletions packages/storage/src/uploads.test.ts

This file was deleted.

38 changes: 0 additions & 38 deletions packages/storage/src/uploads.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {
OBJECT_IS_EMPTY_ERROR,
} from './constants';
import { mbjs } from '@mintbase-js/sdk';
import superagent from 'superagent';


export type ArweaveResponse = {
Expand Down Expand Up @@ -43,43 +42,6 @@ type Trait = {
}


/**
* (NodeJS) upload a file via POST to upload service
* @param file A file to upload
* @param name The name of the file to upload
*/
export const uploadBuffer = async (
file: Buffer,
name: string,
): Promise<ArweaveResponse> => {
if (mbjs.keys.apiKey == MINTBASE_API_ANON_USER) {
console.warn(ANON_USER_WARNING);
}

const size = (file as Buffer).length;

// if size is more than 30MB, throw since cloud run won't upload.
if (size > MAX_UPLOAD_BYTES) {
throw new Error(MAX_UPLOAD_ERROR_MSG);
}

try {
const { body } = await superagent
.post(ARWEAVE_SERVICE_HOST)
.set({
[MINTBASE_API_KEY_HEADER]: mbjs.keys.apiKey,
})
.attach('file', file, name);
return body;
} catch (err: unknown) {
const httpError = err as HttpError;
console.error(
`Uploading file to arweave failed: ${httpError.status} ${httpError.response.text}`,
);
throw err;
}
};

/**
* (Browser) upload a file via POST to upload service
* @param file A file to upload
Expand Down
2 changes: 1 addition & 1 deletion packages/wallet/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ You can check a quick example of Simple Login using Next.js 14 and @mintbase-js/
check our [React integration](https://docs.mintbase.xyz/dev/mintbase-sdk-ref/react#mintbasewalletcontextprovider)

Example:
You can check a [quick example of Simple Login](https://github.com/Mintbase/starter) using Next.js 14 and @mintbase-js/react
You can check a [quick example of Simple Login](https://github.com/Mintbase/examples/tree/main/starter) using Next.js 14 and @mintbase-js/react


## Installation and Usage
Expand Down

0 comments on commit 8180ff6

Please sign in to comment.