Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: release v1.20.1 #207

Merged
merged 7 commits into from
Nov 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## [1.20.1-alpha.1](https://github.com/ardriveapp/turbo-sdk/compare/v1.20.0...v1.20.1-alpha.1) (2024-11-05)


### Bug Fixes

* access arweave at different levels of default for esm bundle compat PE-7069 ([4c75290](https://github.com/ardriveapp/turbo-sdk/commit/4c752909aae24eed985102511654c6361ede38a5))

# [1.20.0](https://github.com/ardriveapp/turbo-sdk/compare/v1.19.2...v1.20.0) (2024-11-04)


Expand Down
7 changes: 5 additions & 2 deletions examples/web/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ <h1>Upload File</h1>
port: 443,
protocol: 'https',
});

const jwk = await arweave.crypto.generateJWK();
const address = await arweave.wallets.jwkToAddress(jwk);
const turbo = TurboFactory.authenticated({
Expand All @@ -57,7 +58,9 @@ <h1>Upload File</h1>
/**
* Fetch fiat rates.
*/
const rates = await turbo.getFiatRates();
const rates = await turbo.getFiatRates().catch((err) => {
console.log('Error fetching rates!', err);
});

console.log(
'Successfully fetched rates!',
Expand All @@ -79,7 +82,7 @@ <h1>Upload File</h1>
balance,
null,
2,
);
).catch((err) => console.log('Error fetching balance!', err));

/**
* Handle file upload
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ardrive/turbo-sdk",
"version": "1.20.0",
"version": "1.20.1-alpha.1",
"main": "./lib/cjs/node/index.js",
"types": "./lib/types/node/index.d.ts",
"module": "./lib/esm/node/index.js",
Expand Down
13 changes: 9 additions & 4 deletions src/common/token/arweave.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import Arweave from 'arweave';
import ArweaveModule from 'arweave';
import { BigNumber } from 'bignumber.js';
import { Buffer } from 'node:buffer';

Expand All @@ -27,9 +27,14 @@ import { sha256B64Url, toB64Url } from '../../utils/base64.js';
import { sleep } from '../../utils/common.js';
import { TurboWinstonLogger } from '../logger.js';

const ArweaveClass =
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore -- Access the correct class constructor for Arweave
ArweaveModule.default?.default || ArweaveModule.default || ArweaveModule;

export class ArweaveToken implements TokenTools {
protected logger: TurboLogger;
protected arweave: Arweave;
protected arweave: ArweaveModule;
protected mintU: boolean;
protected pollingOptions: TokenPollingOptions;

Expand All @@ -45,7 +50,7 @@ export class ArweaveToken implements TokenTools {
},
}: {
gatewayUrl?: string;
arweave?: Arweave;
arweave?: ArweaveModule;
logger?: TurboLogger;
mintU?: boolean;
pollingOptions?: TokenPollingOptions;
Expand All @@ -54,7 +59,7 @@ export class ArweaveToken implements TokenTools {

this.arweave =
arweave ??
new Arweave({
new ArweaveClass({
host: url.hostname,
port: url.port,
protocol: url.protocol.replace(':', ''),
Expand Down
2 changes: 1 addition & 1 deletion src/version.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@
*/

// AUTOMATICALLY GENERATED FILE - DO NOT TOUCH
export const version = '1.20.0';
export const version = '1.20.1-alpha.1';