Skip to content

Commit

Permalink
Merge pull request #77 from Hipo/main
Browse files Browse the repository at this point in the history
2.1.1
  • Loading branch information
jamcry authored Mar 27, 2023
2 parents 09f393c + ebe8a6b commit 6312b31
Show file tree
Hide file tree
Showing 25 changed files with 7,383 additions and 4,399 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/new-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: "New Release"

on:
push:
branches:
- main

jobs:
publish:
if: github.repository_owner == 'tinymanorg'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
- run: npm install
- run: npm test
- run: npm run build

- id: publish-to-npm
uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_TOKEN }} # This token should be added from repo settings

- id: create-gh-release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ steps.publish-to-npm.outputs.version }}
release_name: ${{ steps.publish-to-npm.outputs.version }}
5 changes: 4 additions & 1 deletion dist/add-liquidity/v2/util.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ export declare function calculateSubsequentAddLiquidity({ reserves, totalFeeShar
*/
internalSwapQuote: V2AddLiquidityInternalSwapQuote;
};
export declare function calculateInitialAddLiquidity(asset1: AssetWithAmountAndDecimals, asset2: AssetWithAmountAndDecimals): bigint;
/**
* @returns the amount of pool tokens that should be issued for the initial add liquidity operation
*/
export declare function calculateV2InitialLiquidityAmount(asset1: AssetWithAmountAndDecimals, asset2: AssetWithAmountAndDecimals): bigint;
/**
* @returns the fee that should be assigned to the app call transaction
*/
Expand Down
2 changes: 1 addition & 1 deletion dist/contract/types.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import { CONTRACT_VERSION } from "./constants";
import { ValueOf } from "../util/typeUtils";
export declare type ContractVersionValue = ValueOf<typeof CONTRACT_VERSION>;
export type ContractVersionValue = ValueOf<typeof CONTRACT_VERSION>;
4 changes: 1 addition & 3 deletions dist/index.js

Large diffs are not rendered by default.

6 changes: 2 additions & 4 deletions dist/remove-liquidity/v2/types.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { AssetWithIdAndAmount } from "../../util/asset/assetModels";
export interface V2QuoteAssetAmount {
assetId: number;
amount: bigint;
Expand Down Expand Up @@ -29,10 +30,7 @@ export interface V2RemoveLiquidityExecution {
* Can be `undefined` if the execution was successful, but there was an issue while
* extracting the output asset data fron the transaction response
*/
outputAssets: {
assetId: number;
amount: number;
}[] | undefined;
outputAssets: AssetWithIdAndAmount[] | undefined;
txnID: string;
}
export {};
6 changes: 2 additions & 4 deletions dist/swap/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,9 @@ export interface V1SwapExecution {
groupID: string;
}
export interface V2SwapExecution {
assetIn: AssetWithIdAndAmount;
/** Can be `undefined` if the execution was successful, but there was an issue while
* extracting the input asset data fron the transaction response */
assetIn: AssetWithIdAndAmount | undefined;
/** Can be `undefined` if the execution was successful, but there was an issue while
* extracting the output asset data fron the transaction response */
* extracting the output asset data from the transaction response */
assetOut: AssetWithIdAndAmount | undefined;
pool: V2PoolInfo;
txnID: string;
Expand Down
2 changes: 1 addition & 1 deletion dist/util/account/accountTypes.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export interface AccountInformation {
round: number;
status: "Offline";
}
export declare type AccountInformationData = AccountInformation & {
export type AccountInformationData = AccountInformation & {
minimum_required_balance: number;
};
export interface AccountExcessWithinPool {
Expand Down
28 changes: 25 additions & 3 deletions dist/util/commonTypes.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Transaction } from "algosdk";
import { Transaction, TransactionType } from "algosdk";
export interface SignerTransaction {
txn: Transaction;
/**
Expand All @@ -8,5 +8,27 @@ export interface SignerTransaction {
*/
signers?: string[];
}
export declare type InitiatorSigner = (txGroupList: SignerTransaction[][]) => Promise<Uint8Array[]>;
export declare type SupportedNetwork = "testnet" | "mainnet";
export type InitiatorSigner = (txGroupList: SignerTransaction[][]) => Promise<Uint8Array[]>;
export type SupportedNetwork = "testnet" | "mainnet";
/**
* Type of the waitForConfirmation()["inner-txns"]
* NOT a complete type, only the fields we need.
*/
export type TxnResponseInnerTxns = {
txn: {
txn: {
type: TransactionType.axfer;
xaid: number;
aamt: number;
} | {
type: TransactionType.pay;
amt: number;
} | {
/**
* This is not a real txn type, only added to
* demonstrate that there can be other types
*/
type: "other";
};
};
}[];
2 changes: 1 addition & 1 deletion dist/util/error/TinymanError.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
declare type TinymanErrorType = "LogicError" | "SlippageTolerance" | "TransactionError" | "ExceedingExcessAmountCount" | "Unknown";
type TinymanErrorType = "LogicError" | "SlippageTolerance" | "TransactionError" | "ExceedingExcessAmountCount" | "Unknown";
declare class TinymanError extends Error {
data: any;
type: TinymanErrorType;
Expand Down
2 changes: 1 addition & 1 deletion dist/util/pool/poolTypes.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export interface V1PoolInfo {
status: PoolStatus;
poolTokenID?: number;
}
export declare type V2PoolInfo = V1PoolInfo & {
export type V2PoolInfo = V1PoolInfo & {
issuedPoolTokens?: bigint;
asset1Reserves?: bigint;
asset2Reserves?: bigint;
Expand Down
19 changes: 9 additions & 10 deletions dist/util/transaction/transactionUtils.d.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
import { Algodv2 } from "algosdk";
import { SignerTransaction } from "../commonTypes";
import { AssetWithIdAndAmount } from "../asset/assetModels";
import { SignerTransaction, TxnResponseInnerTxns } from "../commonTypes";
export declare function getAppCallTxnResponse(client: Algodv2, txGroup: SignerTransaction[]): Promise<Record<string, any> | undefined>;
/**
* Tries to find the app call transaction in the group, get the response, and extract the inner txns data.
* @returns the innter transactions of the app call transaction or `undefined` if no app call transaction was found.
*/
export declare function getAppCallInnerTxns(client: Algodv2, txGroup: SignerTransaction[]): Promise<{
txn: {
txn: {
xaid: number;
aamt: number;
type: string;
};
};
}[] | undefined>;
export declare function getAppCallInnerTxns(client: Algodv2, txGroup: SignerTransaction[]): Promise<TxnResponseInnerTxns | undefined>;
/**
* Tries to find the asset related (asset transfer / payment (i.e. ALGO transfer))
* inner transactions in the app call, and return the extracted asset data.
* Useful for getting the asset data after an "execute" operation.
*/
export declare function getAppCallInnerAssetData(client: Algodv2, txGroup: SignerTransaction[]): Promise<AssetWithIdAndAmount[] | undefined>;
/**
* Combines the provided signer transaction groups into one signer transaction group, with a new group ID
* @param signerTransactions - The signer transaction groups to combine
Expand Down
2 changes: 1 addition & 1 deletion dist/util/typeUtils.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export declare type ValueOf<T> = T[keyof T];
export type ValueOf<T> = T[keyof T];
Loading

0 comments on commit 6312b31

Please sign in to comment.