Skip to content

Commit

Permalink
Merge pull request #34 from thencc/main
Browse files Browse the repository at this point in the history
updating npm stable release w new name + version
  • Loading branch information
spencercap authored Aug 15, 2022
2 parents 3faa14b + 3ca5ae2 commit 44d9d40
Show file tree
Hide file tree
Showing 19 changed files with 998 additions and 740 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/npm-publish-beta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
SHOULD_PUBLISH=0
PKG_VERSION_LOCAL=`cat package.json | jq -r '.version'`
echo 'local pkg: '$PKG_VERSION_LOCAL
PKG_VERSION_PUBLISHED=`npm view algonaut.js@beta version`
PKG_VERSION_PUBLISHED=`npm view @thencc/algonautjs@beta version`
echo 'beta pkg: '$PKG_VERSION_PUBLISHED
npx semver-compare $PKG_VERSION_LOCAL gt $PKG_VERSION_PUBLISHED && SHOULD_PUBLISH=1
echo 'publish beta?: '$SHOULD_PUBLISH
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@ jobs:
run: |
npm config set registry https://registry.npmjs.org/
PKG_VERSION_LOCAL=`cat package.json | jq -r '.version'`
npm dist-tag add algonaut.js@$PKG_VERSION_LOCAL latest
npm dist-tag add @thencc/algonautjs@$PKG_VERSION_LOCAL latest
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
32 changes: 23 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ We package, expose and depend on the JavaScript Algosdk. It's there if you need
To create an instance with a node and get ready to transact:

```js
import AlgonautJS from 'algonaut.js';
import AlgonautJS from '@thencc/algonautjs';

const algonaut = new AlgonautJS({
BASE_SERVER: 'https://testnet-algorand.api.purestake.io/ps2',
Expand Down Expand Up @@ -67,12 +67,12 @@ const response = await algonaut.callApp(
Install from NPM:
```npm install algonaut.js --save```
```npm install @thencc/algonautjs --save```
Usage:
```js
import Algonaut from 'algonaut.js';
import Algonaut from '@thencc/algonautjs';
const algonaut = new Algonaut({
BASE_SERVER: 'https://testnet-algorand.api.purestake.io/ps2',
LEDGER: 'TestNet',
Expand Down Expand Up @@ -101,14 +101,28 @@ Rudimentary tests done in `test/` dir.
## Contributing
### To generate docs:
```npm run docs```
[Typedoc options](https://typedoc.org/guides/options/) are set in `typedoc.json`.
---
### Publishing to NPM:
[ *latest/release* ]
stable releases have the default npm tag of `latest` (installable via `npm i @thencc/algonautjs` or `npm i @thencc/algonautjs@latest`) and are automatically published from the repo's `release` branch via a Github Action. so simply pull request the `main` branch (or feature specific branch) into `release` to publish to npm.
[ *beta/main* ]
similarly, pushing commits or merging pull requests to the repo's `main` branch will automatically publish to the npm `beta` release installable via `npm i @thencc/algonautjs@beta`.
note:
- to update either the `latest` or `beta` releases, the version in `package.json` must be higher than the previous release.
---
TBD:
- setting up a dev env
- ESLint and code style
- building and testing with Vite and Node
To generate docs:
```npm run docs```
[Typedoc options](https://typedoc.org/guides/options/) are set in `typedoc.json`.
56 changes: 34 additions & 22 deletions dist/index.cjs

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions dist/index.cjs.map

Large diffs are not rendered by default.

29 changes: 20 additions & 9 deletions dist/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/// <reference types="node" />
import algosdk from 'algosdk';
import { AlgonautConfig, AlgonautWallet, AlgonautTransactionStatus, AlgonautAtomicTransaction, AlgonautAppState, AlgonautStateData, AlgonautError, WalletConnectListener, AlgonautTxnCallbacks, AlgonautCreateAssetArguments, AlgonautSendAssetArguments, AlgonautCallAppArguments, AlgonautDeployArguments, AlgonautLsigDeployArguments, AlgonautLsigCallAppArguments, AlgonautLsigSendAssetArguments, AlgonautPaymentArguments, AlgonautLsigPaymentArguments, AlgonautUpdateAppArguments, AlgonautAppStateEncoded } from './AlgonautTypes';
import { IInternalEvent } from '@walletconnect/types';
import type { AlgonautConfig, AlgonautWallet, AlgonautTransactionStatus, AlgonautAtomicTransaction, AlgonautAppState, AlgonautStateData, AlgonautError, WalletConnectListener, AlgonautTxnCallbacks, AlgonautCreateAssetArguments, AlgonautSendAssetArguments, AlgonautCallAppArguments, AlgonautDeployArguments, AlgonautLsigDeployArguments, AlgonautLsigCallAppArguments, AlgonautLsigSendAssetArguments, AlgonautPaymentArguments, AlgonautLsigPaymentArguments, AlgonautUpdateAppArguments, AlgonautAppStateEncoded } from './AlgonautTypes';
import { FrameBus } from './FrameBus';
import { IInternalEvent } from '@walletconnect/types';
declare global {
interface Window {
AlgoSigner: any;
Expand All @@ -11,12 +11,11 @@ declare global {
export declare class Algonaut {
algodClient: algosdk.Algodv2;
indexerClient: algosdk.Indexer | undefined;
sdk: typeof algosdk;
config: AlgonautConfig | undefined;
account: algosdk.Account | undefined;
address: string | undefined;
sKey: Uint8Array | undefined;
mnemonic: string | undefined;
config: AlgonautConfig | undefined;
sdk: typeof algosdk | undefined;
uiLoading: boolean;
inkeyWallet: {
defaultSrc: string;
Expand All @@ -38,7 +37,7 @@ export declare class Algonaut {
* Usage:
*
* ```js
* import Algonaut from 'algonaut.js';
* import Algonaut from '@thencc/algonautjs';
* const algonaut = new Algonaut({
* BASE_SERVER: 'https://testnet-algorand.api.purestake.io/ps2',
* INDEX_SERVER: 'https://testnet-algorand.api.purestake.io/idx2'
Expand All @@ -53,9 +52,18 @@ export declare class Algonaut {
* @param config config object
*/
constructor(config: AlgonautConfig);
initInkey(mountConfig: {
src?: string;
}): void;
/**
* checks if config obj is valid for use
* @param config algonaut config for network + signing mode
* @returns boolean. true is good.
*/
isValidConfig(config: AlgonautConfig): boolean;
/**
* sets config for use (new algod, indexerClient, etc)
* @param config algonaut config for network + signing mode
* - will throw Error if config is lousy
*/
setConfig(config: AlgonautConfig): void;
/**
* @returns config object or `false` if no config is set
*/
Expand All @@ -65,6 +73,9 @@ export declare class Algonaut {
* @returns Promise resolving to status of Algorand network
*/
checkStatus(): Promise<any | AlgonautError>;
initInkey(mountConfig: {
src?: string;
}): void;
/**
* if you already have an account, set it here
* @param account an algosdk account already created
Expand Down
48 changes: 30 additions & 18 deletions dist/index.mjs

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions dist/index.mjs.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/docs/assets/search.js

Large diffs are not rendered by default.

156 changes: 83 additions & 73 deletions docs/docs/classes/Algonaut.html

Large diffs are not rendered by default.

Loading

0 comments on commit 44d9d40

Please sign in to comment.