@aurigami/sdk 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2022 Vu
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,3 @@
1
+ # Aurigami SDK
2
+
3
+
@@ -0,0 +1,14 @@
1
+ import { Signer } from '@ethersproject/abstract-signer';
2
+ import { ProviderOrSigner } from './types';
3
+ export declare class BlockchainEntityRead {
4
+ protected _providerOrSigner: ProviderOrSigner;
5
+ constructor(providerOrSigner: ProviderOrSigner);
6
+ }
7
+ export declare class BlockchainEntityReadWrite extends BlockchainEntityRead {
8
+ constructor(signer: Signer);
9
+ }
10
+ export declare class BlockchainEntity {
11
+ constructor();
12
+ read(provider: ProviderOrSigner): BlockchainEntityRead;
13
+ readWrite(signer: Signer): BlockchainEntityReadWrite;
14
+ }
@@ -0,0 +1,24 @@
1
+ import { BlockchainEntity, BlockchainEntityRead } from './BlockchainEntity';
2
+ import { ProviderOrSigner, MoneyMarketDetails } from './types';
3
+ import { Address, CurrencyAmount } from '@pendle/sdk-core';
4
+ import { Contract } from 'ethers';
5
+ import { TransactionResponse } from '@ethersproject/abstract-provider';
6
+ export declare class MoneyMarketRead extends BlockchainEntityRead {
7
+ protected _auToken: Contract;
8
+ constructor(providerOrSigner: ProviderOrSigner, auToken: Address);
9
+ getDetails(): Promise<MoneyMarketDetails>;
10
+ }
11
+ export declare class MoneyMarketReadWrite extends MoneyMarketRead {
12
+ dummyTransaction: () => Promise<TransactionResponse>;
13
+ deposit(amount: CurrencyAmount): Promise<TransactionResponse>;
14
+ borrow(amount: CurrencyAmount): Promise<TransactionResponse>;
15
+ withdraw(amount: CurrencyAmount): Promise<TransactionResponse>;
16
+ repay(amount: CurrencyAmount): Promise<TransactionResponse>;
17
+ enableCollateral(): Promise<TransactionResponse>;
18
+ disableCollateral(): Promise<TransactionResponse>;
19
+ }
20
+ export declare class MoneyMarket extends BlockchainEntity {
21
+ protected address: Address;
22
+ constructor(address: string);
23
+ read(provider: ProviderOrSigner): MoneyMarketRead;
24
+ }
package/dist/SDK.d.ts ADDED
@@ -0,0 +1,23 @@
1
+ import { BlockchainEntity, BlockchainEntityRead } from './BlockchainEntity';
2
+ import { LockingDetails, PlyAuroraPoolDetails, ProviderOrSigner, UserDetails } from './types';
3
+ import { Token, CurrencyAmount } from '@pendle/sdk-core';
4
+ import { TransactionResponse } from '@ethersproject/abstract-provider';
5
+ export declare class SdkRead extends BlockchainEntityRead {
6
+ constructor(providerOrSigner: ProviderOrSigner);
7
+ getLockingDetails(): Promise<LockingDetails>;
8
+ getUserDetails(userAddress: string): Promise<UserDetails>;
9
+ getPlyAuroraPoolDetails(): Promise<PlyAuroraPoolDetails>;
10
+ getTokenPrice(token: Token): Promise<CurrencyAmount>;
11
+ stakeBalanceOf(user: string): Promise<CurrencyAmount>;
12
+ }
13
+ export declare class SdkReadWrite extends SdkRead {
14
+ dummyTransaction: () => Promise<TransactionResponse>;
15
+ claim(): Promise<TransactionResponse>;
16
+ stake(amount: CurrencyAmount): Promise<TransactionResponse>;
17
+ unstake(amount: CurrencyAmount): Promise<TransactionResponse>;
18
+ }
19
+ export declare class SDK extends BlockchainEntity {
20
+ constructor();
21
+ read(provider: ProviderOrSigner): SdkRead;
22
+ static defaultProvider(): ProviderOrSigner;
23
+ }
@@ -0,0 +1,6 @@
1
+ import { Token } from '@pendle/sdk-core';
2
+ import { Signer } from 'ethers';
3
+ export declare const DOLLAR: Token;
4
+ export declare const AVAX_DEFAULT_PROVIDER_URL = "https://api.avax.network/ext/bc/C/rpc";
5
+ export declare const AVAX_DEFAULT_PROVIDER: any;
6
+ export declare const AVAX_DEFAULT_SIGNER: Signer;
@@ -0,0 +1,11 @@
1
+ import { Token, CurrencyAmount } from '@pendle/sdk-core';
2
+ import { UserMarketDetails } from './types';
3
+ export declare const dummyToken: Token;
4
+ export declare const dummyPly: Token;
5
+ export declare const dummyPlyAurora: Token;
6
+ export declare const dummyTokenAmount: CurrencyAmount;
7
+ export declare const dummyZeroTokenAmount: CurrencyAmount;
8
+ export declare const dummyTokenAmount2: CurrencyAmount;
9
+ export declare const dummyTokenAmount3: CurrencyAmount;
10
+ export declare const dummyMarketAddress = "0xbeb5d47a3f720ec0a390d04b4d41ed7d9688bc7f";
11
+ export declare const dummyUserMarketDetails: UserMarketDetails;
@@ -0,0 +1 @@
1
+ export declare function formatObject(object: Object): string;
@@ -0,0 +1,7 @@
1
+ export * from './SDK';
2
+ export * from './MoneyMarket';
3
+ export * from './BlockchainEntity';
4
+ export * from './helpers';
5
+ export * from './constants';
6
+ export * from './dummy';
7
+ export declare function sum(a: number, b: number): number;
package/dist/index.js ADDED
@@ -0,0 +1,8 @@
1
+
2
+ 'use strict'
3
+
4
+ if (process.env.NODE_ENV === 'production') {
5
+ module.exports = require('./sdk.cjs.production.min.js')
6
+ } else {
7
+ module.exports = require('./sdk.cjs.development.js')
8
+ }