Skip to content

Commit 6312b31

Browse files
authoredMar 27, 2023
Merge pull request #77 from Hipo/main
2.1.1
2 parents 09f393c + ebe8a6b commit 6312b31

File tree

25 files changed

+7383
-4399
lines changed

25 files changed

+7383
-4399
lines changed
 

‎.github/workflows/new-release.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: "New Release"
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
publish:
10+
if: github.repository_owner == 'tinymanorg'
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v3
14+
- uses: actions/setup-node@v3
15+
with:
16+
node-version: 16
17+
- run: npm install
18+
- run: npm test
19+
- run: npm run build
20+
21+
- id: publish-to-npm
22+
uses: JS-DevTools/npm-publish@v1
23+
with:
24+
token: ${{ secrets.NPM_TOKEN }} # This token should be added from repo settings
25+
26+
- id: create-gh-release
27+
uses: actions/create-release@v1
28+
env:
29+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
30+
with:
31+
tag_name: ${{ steps.publish-to-npm.outputs.version }}
32+
release_name: ${{ steps.publish-to-npm.outputs.version }}

‎dist/add-liquidity/v2/util.d.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@ export declare function calculateSubsequentAddLiquidity({ reserves, totalFeeShar
1616
*/
1717
internalSwapQuote: V2AddLiquidityInternalSwapQuote;
1818
};
19-
export declare function calculateInitialAddLiquidity(asset1: AssetWithAmountAndDecimals, asset2: AssetWithAmountAndDecimals): bigint;
19+
/**
20+
* @returns the amount of pool tokens that should be issued for the initial add liquidity operation
21+
*/
22+
export declare function calculateV2InitialLiquidityAmount(asset1: AssetWithAmountAndDecimals, asset2: AssetWithAmountAndDecimals): bigint;
2023
/**
2124
* @returns the fee that should be assigned to the app call transaction
2225
*/

‎dist/contract/types.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
import { CONTRACT_VERSION } from "./constants";
22
import { ValueOf } from "../util/typeUtils";
3-
export declare type ContractVersionValue = ValueOf<typeof CONTRACT_VERSION>;
3+
export type ContractVersionValue = ValueOf<typeof CONTRACT_VERSION>;

‎dist/index.js

Lines changed: 1 addition & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎dist/remove-liquidity/v2/types.d.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { AssetWithIdAndAmount } from "../../util/asset/assetModels";
12
export interface V2QuoteAssetAmount {
23
assetId: number;
34
amount: bigint;
@@ -29,10 +30,7 @@ export interface V2RemoveLiquidityExecution {
2930
* Can be `undefined` if the execution was successful, but there was an issue while
3031
* extracting the output asset data fron the transaction response
3132
*/
32-
outputAssets: {
33-
assetId: number;
34-
amount: number;
35-
}[] | undefined;
33+
outputAssets: AssetWithIdAndAmount[] | undefined;
3634
txnID: string;
3735
}
3836
export {};

‎dist/swap/types.d.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,9 @@ export interface V1SwapExecution {
5050
groupID: string;
5151
}
5252
export interface V2SwapExecution {
53+
assetIn: AssetWithIdAndAmount;
5354
/** Can be `undefined` if the execution was successful, but there was an issue while
54-
* extracting the input asset data fron the transaction response */
55-
assetIn: AssetWithIdAndAmount | undefined;
56-
/** Can be `undefined` if the execution was successful, but there was an issue while
57-
* extracting the output asset data fron the transaction response */
55+
* extracting the output asset data from the transaction response */
5856
assetOut: AssetWithIdAndAmount | undefined;
5957
pool: V2PoolInfo;
6058
txnID: string;

‎dist/util/account/accountTypes.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export interface AccountInformation {
3333
round: number;
3434
status: "Offline";
3535
}
36-
export declare type AccountInformationData = AccountInformation & {
36+
export type AccountInformationData = AccountInformation & {
3737
minimum_required_balance: number;
3838
};
3939
export interface AccountExcessWithinPool {

‎dist/util/commonTypes.d.ts

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Transaction } from "algosdk";
1+
import { Transaction, TransactionType } from "algosdk";
22
export interface SignerTransaction {
33
txn: Transaction;
44
/**
@@ -8,5 +8,27 @@ export interface SignerTransaction {
88
*/
99
signers?: string[];
1010
}
11-
export declare type InitiatorSigner = (txGroupList: SignerTransaction[][]) => Promise<Uint8Array[]>;
12-
export declare type SupportedNetwork = "testnet" | "mainnet";
11+
export type InitiatorSigner = (txGroupList: SignerTransaction[][]) => Promise<Uint8Array[]>;
12+
export type SupportedNetwork = "testnet" | "mainnet";
13+
/**
14+
* Type of the waitForConfirmation()["inner-txns"]
15+
* NOT a complete type, only the fields we need.
16+
*/
17+
export type TxnResponseInnerTxns = {
18+
txn: {
19+
txn: {
20+
type: TransactionType.axfer;
21+
xaid: number;
22+
aamt: number;
23+
} | {
24+
type: TransactionType.pay;
25+
amt: number;
26+
} | {
27+
/**
28+
* This is not a real txn type, only added to
29+
* demonstrate that there can be other types
30+
*/
31+
type: "other";
32+
};
33+
};
34+
}[];

‎dist/util/error/TinymanError.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
declare type TinymanErrorType = "LogicError" | "SlippageTolerance" | "TransactionError" | "ExceedingExcessAmountCount" | "Unknown";
1+
type TinymanErrorType = "LogicError" | "SlippageTolerance" | "TransactionError" | "ExceedingExcessAmountCount" | "Unknown";
22
declare class TinymanError extends Error {
33
data: any;
44
type: TinymanErrorType;

‎dist/util/pool/poolTypes.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export interface V1PoolInfo {
1515
status: PoolStatus;
1616
poolTokenID?: number;
1717
}
18-
export declare type V2PoolInfo = V1PoolInfo & {
18+
export type V2PoolInfo = V1PoolInfo & {
1919
issuedPoolTokens?: bigint;
2020
asset1Reserves?: bigint;
2121
asset2Reserves?: bigint;

‎dist/util/transaction/transactionUtils.d.ts

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
11
import { Algodv2 } from "algosdk";
2-
import { SignerTransaction } from "../commonTypes";
2+
import { AssetWithIdAndAmount } from "../asset/assetModels";
3+
import { SignerTransaction, TxnResponseInnerTxns } from "../commonTypes";
34
export declare function getAppCallTxnResponse(client: Algodv2, txGroup: SignerTransaction[]): Promise<Record<string, any> | undefined>;
45
/**
56
* Tries to find the app call transaction in the group, get the response, and extract the inner txns data.
67
* @returns the innter transactions of the app call transaction or `undefined` if no app call transaction was found.
78
*/
8-
export declare function getAppCallInnerTxns(client: Algodv2, txGroup: SignerTransaction[]): Promise<{
9-
txn: {
10-
txn: {
11-
xaid: number;
12-
aamt: number;
13-
type: string;
14-
};
15-
};
16-
}[] | undefined>;
9+
export declare function getAppCallInnerTxns(client: Algodv2, txGroup: SignerTransaction[]): Promise<TxnResponseInnerTxns | undefined>;
10+
/**
11+
* Tries to find the asset related (asset transfer / payment (i.e. ALGO transfer))
12+
* inner transactions in the app call, and return the extracted asset data.
13+
* Useful for getting the asset data after an "execute" operation.
14+
*/
15+
export declare function getAppCallInnerAssetData(client: Algodv2, txGroup: SignerTransaction[]): Promise<AssetWithIdAndAmount[] | undefined>;
1716
/**
1817
* Combines the provided signer transaction groups into one signer transaction group, with a new group ID
1918
* @param signerTransactions - The signer transaction groups to combine

‎dist/util/typeUtils.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export declare type ValueOf<T> = T[keyof T];
1+
export type ValueOf<T> = T[keyof T];

0 commit comments

Comments
 (0)