Skip to content

Commit

Permalink
Merge pull request #2025 from aeternity/prerelease-fixes
Browse files Browse the repository at this point in the history
Prere-lease fixes
  • Loading branch information
davidyuk authored Oct 20, 2024
2 parents 700205f + b19cc93 commit 568c291
Show file tree
Hide file tree
Showing 108 changed files with 758 additions and 758 deletions.
12 changes: 2 additions & 10 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,11 @@ jobs:
- uses: actions/setup-python@v5
with:
python-version: 3.x
cache: pip
- uses: actions/setup-node@v4
with:
node-version: 20.x
- uses: actions/cache@v4
with:
path: ~/.cache/pip3
key: ${{ runner.os }}-pip-${{ hashFiles('docs/requirements.txt') }}
- uses: actions/cache@v4
with:
path: |
~/.npm
~/.autorest
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
cache: npm
- run: pip3 install -r docs/requirements.txt
- run: git config --global user.email "[email protected]"
- run: git config --global user.name "GitHub Action"
Expand Down
7 changes: 1 addition & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,7 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: 20.x
- uses: actions/cache@v4
with:
path: |
~/.npm
~/.autorest
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
cache: npm
- run: npm ci
- name: Run Commitlint
if: github.event_name == 'pull_request'
Expand Down
15 changes: 6 additions & 9 deletions babel.esm.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,12 @@ config.presets
.filter((plugin) => Array.isArray(plugin))
.find(([name]) => name === '@babel/preset-env')[1].modules = false;

config.plugins.push(
['add-import-extension', { extension: 'js' }],
[
'import-globals',
{
Buffer: { moduleName: 'buffer', exportName: 'Buffer' },
},
],
);
config.plugins.push([
'import-globals',
{
Buffer: { moduleName: 'buffer', exportName: 'Buffer' },
},
]);
config.plugins = config.plugins.filter((p) => p !== 'babel-plugin-transform-import-meta');

export default config;
21 changes: 7 additions & 14 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
"build:es": "babel src --config-file ./babel.esm.config.js --out-dir es --extensions .ts --source-maps true",
"build:api:node": "autorest tooling/autorest/node.yaml && node tooling/autorest/postprocessing.js node",
"build:api:compiler": "node tooling/autorest/compiler-prepare.js && autorest tooling/autorest/compiler.yaml && node tooling/autorest/postprocessing.js compiler",
"build:api:middleware": "node tooling/autorest/middleware-prepare.js && autorest tooling/autorest/middleware.yaml && node tooling/autorest/postprocessing.js middleware",
"rem:build:api:middleware": "node tooling/autorest/middleware-prepare.js",
"build:api:middleware": "autorest tooling/autorest/middleware.yaml && node tooling/autorest/postprocessing.js middleware",
"build:generate": "tsx tooling/generate-schema.ts",
"build": "run-p build:api:* build:assets build:generate && run-p build:dist build:es build:types",
"docs:examples": "node tooling/docs/examples-to-md.js examples/node/*.js",
Expand Down Expand Up @@ -87,6 +88,7 @@
"tweetnacl": "^1.0.3",
"tweetnacl-auth": "^1.0.1",
"varuint-bitcoin": "^2.0.0",
"webextension-polyfill": "^0.12.0",
"websocket": "^1.0.35",
"ws": "^8.18.0"
},
Expand Down Expand Up @@ -116,7 +118,6 @@
"@typescript-eslint/parser": "^7.15.0",
"autorest": "^3.7.1",
"babel-loader": "^9.2.1",
"babel-plugin-add-import-extension": "^1.6.0",
"babel-plugin-import-globals": "^2.0.0",
"babel-plugin-transform-import-meta": "^2.2.1",
"chai": "^5.1.1",
Expand Down
10 changes: 5 additions & 5 deletions src/AeSdk.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import AeSdkBase from './AeSdkBase';
import { OnAccount } from './AeSdkMethods';
import AccountBase from './account/Base';
import { decode, Encoded } from './utils/encoder';
import { UnavailableAccountError } from './utils/errors';
import AeSdkBase from './AeSdkBase.js';
import { OnAccount } from './AeSdkMethods.js';
import AccountBase from './account/Base.js';
import { decode, Encoded } from './utils/encoder.js';
import { UnavailableAccountError } from './utils/errors.js';

export default class AeSdk extends AeSdkBase {
accounts: { [key: Encoded.AccountAddress]: AccountBase } = {};
Expand Down
22 changes: 11 additions & 11 deletions src/AeSdkAepp.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import AeSdkBase from './AeSdkBase';
import { OnAccount } from './AeSdkMethods';
import AccountBase from './account/Base';
import AccountRpc from './account/Rpc';
import { decode, Encoded } from './utils/encoder';
import AeSdkBase from './AeSdkBase.js';
import { OnAccount } from './AeSdkMethods.js';
import AccountBase from './account/Base.js';
import AccountRpc from './account/Rpc.js';
import { decode, Encoded } from './utils/encoder.js';
import {
Accounts,
RPC_VERSION,
Expand All @@ -12,18 +12,18 @@ import {
AeppApi,
Node as NodeRpc,
NetworkToSelect,
} from './aepp-wallet-communication/rpc/types';
import RpcClient from './aepp-wallet-communication/rpc/RpcClient';
import { METHODS, SUBSCRIPTION_TYPES } from './aepp-wallet-communication/schema';
} from './aepp-wallet-communication/rpc/types.js';
import RpcClient from './aepp-wallet-communication/rpc/RpcClient.js';
import { METHODS, SUBSCRIPTION_TYPES } from './aepp-wallet-communication/schema.js';
import {
AlreadyConnectedError,
NoWalletConnectedError,
UnsubscribedAccountError,
UnAuthorizedAccountError,
RpcConnectionError,
} from './utils/errors';
import Node from './Node';
import BrowserConnection from './aepp-wallet-communication/connection/Browser';
} from './utils/errors.js';
import Node from './Node.js';
import BrowserConnection from './aepp-wallet-communication/connection/Browser.js';

/**
* RPC handler for AEPP side
Expand Down
14 changes: 7 additions & 7 deletions src/AeSdkBase.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import Node from './Node';
import AccountBase from './account/Base';
import Node from './Node.js';
import AccountBase from './account/Base.js';
import {
CompilerError,
DuplicateNodeError,
NodeNotFoundError,
NotImplementedError,
TypeError,
} from './utils/errors';
import { Encoded } from './utils/encoder';
import { wrapWithProxy } from './utils/wrap-proxy';
import CompilerBase from './contract/compiler/Base';
import AeSdkMethods, { OnAccount, AeSdkMethodsOptions, WrappedOptions } from './AeSdkMethods';
} from './utils/errors.js';
import { Encoded } from './utils/encoder.js';
import { wrapWithProxy } from './utils/wrap-proxy.js';
import CompilerBase from './contract/compiler/Base.js';
import AeSdkMethods, { OnAccount, AeSdkMethodsOptions, WrappedOptions } from './AeSdkMethods.js';

type NodeInfo = Awaited<ReturnType<Node['getNodeInfo']>> & { name: string };

Expand Down
24 changes: 12 additions & 12 deletions src/AeSdkMethods.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import * as chainMethods from './chain';
import { sendTransaction } from './send-transaction';
import * as spendMethods from './spend';
import * as contractGaMethods from './contract/ga';
import { buildTxAsync } from './tx/builder';
import { mapObject, UnionToIntersection } from './utils/other';
import { wrapWithProxy } from './utils/wrap-proxy';
import Node from './Node';
import { TxParamsAsync } from './tx/builder/schema.generated';
import AccountBase from './account/Base';
import { Encoded } from './utils/encoder';
import CompilerBase from './contract/compiler/Base';
import * as chainMethods from './chain.js';
import { sendTransaction } from './send-transaction.js';
import * as spendMethods from './spend.js';
import * as contractGaMethods from './contract/ga.js';
import { buildTxAsync } from './tx/builder/index.js';
import { mapObject, UnionToIntersection } from './utils/other.js';
import { wrapWithProxy } from './utils/wrap-proxy.js';
import Node from './Node.js';
import { TxParamsAsync } from './tx/builder/schema.generated.js';
import AccountBase from './account/Base.js';
import { Encoded } from './utils/encoder.js';
import CompilerBase from './contract/compiler/Base.js';

export type OnAccount = Encoded.AccountAddress | AccountBase | undefined;

Expand Down
20 changes: 10 additions & 10 deletions src/AeSdkWallet.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import nacl from 'tweetnacl';
import AeSdk from './AeSdk';
import verifyTransaction from './tx/validator';
import RpcClient from './aepp-wallet-communication/rpc/RpcClient';
import AeSdk from './AeSdk.js';
import verifyTransaction from './tx/validator.js';
import RpcClient from './aepp-wallet-communication/rpc/RpcClient.js';
import {
METHODS,
RPC_STATUS,
Expand All @@ -11,10 +11,10 @@ import {
RpcNotAuthorizeError,
RpcPermissionDenyError,
RpcUnsupportedProtocolError,
} from './aepp-wallet-communication/schema';
import { InternalError, UnknownRpcClientError } from './utils/errors';
import AccountBase from './account/Base';
import BrowserConnection from './aepp-wallet-communication/connection/Browser';
} from './aepp-wallet-communication/schema.js';
import { InternalError, UnknownRpcClientError } from './utils/errors.js';
import AccountBase from './account/Base.js';
import BrowserConnection from './aepp-wallet-communication/connection/Browser.js';
import {
Accounts,
AeppApi,
Expand All @@ -23,9 +23,9 @@ import {
RPC_VERSION,
WalletApi,
WalletInfo,
} from './aepp-wallet-communication/rpc/types';
import { Encoded, Encoding, encode, decode } from './utils/encoder';
import jsonBig from './utils/json-big';
} from './aepp-wallet-communication/rpc/types.js';
import { Encoded, Encoding, encode, decode } from './utils/encoder.js';
import jsonBig from './utils/json-big.js';

type RpcClientWallet = RpcClient<AeppApi, WalletApi>;

Expand Down
10 changes: 5 additions & 5 deletions src/Middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ import {
parseBigIntPolicy,
genVersionCheckPolicy,
genRetryOnFailurePolicy,
} from './utils/autorest';
} from './utils/autorest.js';
import {
Middleware as MiddlewareApi,
MiddlewareOptionalParams,
ErrorResponse,
} from './apis/middleware';
import { operationSpecs } from './apis/middleware/middleware';
import { IllegalArgumentError, InternalError } from './utils/errors';
import { MiddlewarePage, isMiddlewareRawPage } from './utils/MiddlewarePage';
} from './apis/middleware/index.js';
import { operationSpecs } from './apis/middleware/middleware.js';
import { IllegalArgumentError, InternalError } from './utils/errors.js';
import { MiddlewarePage, isMiddlewareRawPage } from './utils/MiddlewarePage.js';

export default class Middleware extends MiddlewareApi {
/**
Expand Down
4 changes: 2 additions & 2 deletions src/MiddlewareSubscriber.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable max-classes-per-file */
import WebSocket from 'isomorphic-ws';
import { BaseError, UnexpectedTsError, InternalError } from './utils/errors';
import { Encoded } from './utils/encoder';
import { BaseError, UnexpectedTsError, InternalError } from './utils/errors.js';
import { Encoded } from './utils/encoder.js';

interface Message {
payload: Object;
Expand Down
8 changes: 4 additions & 4 deletions src/Node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import {
parseBigIntPolicy,
genVersionCheckPolicy,
genRetryOnFailurePolicy,
} from './utils/autorest';
import { Node as NodeApi, NodeOptionalParams, ErrorModel } from './apis/node';
import { UnsupportedVersionError } from './utils/errors';
import { ConsensusProtocolVersion } from './tx/builder/constants';
} from './utils/autorest.js';
import { Node as NodeApi, NodeOptionalParams, ErrorModel } from './apis/node/index.js';
import { UnsupportedVersionError } from './utils/errors.js';
import { ConsensusProtocolVersion } from './tx/builder/constants.js';

interface NodeInfo {
url: string;
Expand Down
10 changes: 5 additions & 5 deletions src/account/Base.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Encoded } from '../utils/encoder';
import Node from '../Node';
import CompilerBase from '../contract/compiler/Base';
import { Int } from '../tx/builder/constants';
import { AciValue, Domain } from '../utils/typed-data';
import { Encoded } from '../utils/encoder.js';
import Node from '../Node.js';
import CompilerBase from '../contract/compiler/Base.js';
import { Int } from '../tx/builder/constants.js';
import { AciValue, Domain } from '../utils/typed-data.js';

interface AuthData {
fee?: Int;
Expand Down
4 changes: 2 additions & 2 deletions src/account/BaseFactory.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Node from '../Node';
import AccountBase from './Base';
import Node from '../Node.js';
import AccountBase from './Base.js';

/**
* A factory class that generates instances of AccountBase by index.
Expand Down
14 changes: 7 additions & 7 deletions src/account/Generalized.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import AccountBase from './Base';
import AccountBase from './Base.js';
import {
ArgumentError,
InternalError,
InvalidAuthDataError,
NotImplementedError,
} from '../utils/errors';
import { decode, Encoded } from '../utils/encoder';
import { getAccount } from '../chain';
import Contract from '../contract/Contract';
import { buildTxAsync, buildTx } from '../tx/builder';
import { Tag } from '../tx/builder/constants';
} from '../utils/errors.js';
import { decode, Encoded } from '../utils/encoder.js';
import { getAccount } from '../chain.js';
import Contract from '../contract/Contract.js';
import { buildTxAsync, buildTx } from '../tx/builder/index.js';
import { Tag } from '../tx/builder/constants.js';

/**
* Generalized account class
Expand Down
10 changes: 5 additions & 5 deletions src/account/Ledger.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type Transport from '@ledgerhq/hw-transport';
import AccountBase from './Base';
import { ArgumentError, NotImplementedError } from '../utils/errors';
import { decode, Encoded } from '../utils/encoder';
import { buildTx } from '../tx/builder';
import { Tag } from '../tx/builder/constants';
import AccountBase from './Base.js';
import { ArgumentError, NotImplementedError } from '../utils/errors.js';
import { decode, Encoded } from '../utils/encoder.js';
import { buildTx } from '../tx/builder/index.js';
import { Tag } from '../tx/builder/constants.js';

export const CLA = 0xe0;
export const GET_ADDRESS = 0x02;
Expand Down
10 changes: 5 additions & 5 deletions src/account/LedgerFactory.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type Transport from '@ledgerhq/hw-transport';
import AccountLedger, { CLA, GET_ADDRESS, GET_APP_CONFIGURATION } from './Ledger';
import { UnsupportedVersionError } from '../utils/errors';
import { Encoded } from '../utils/encoder';
import semverSatisfies from '../utils/semver-satisfies';
import AccountBaseFactory from './BaseFactory';
import AccountLedger, { CLA, GET_ADDRESS, GET_APP_CONFIGURATION } from './Ledger.js';
import { UnsupportedVersionError } from '../utils/errors.js';
import { Encoded } from '../utils/encoder.js';
import semverSatisfies from '../utils/semver-satisfies.js';
import AccountBaseFactory from './BaseFactory.js';

interface AppConfiguration {
version: string;
Expand Down
Loading

0 comments on commit 568c291

Please sign in to comment.