Skip to content

Commit

Permalink
feat: add dist
Browse files Browse the repository at this point in the history
  • Loading branch information
cmartinho committed Oct 17, 2023
1 parent 80ad19a commit ee78072
Show file tree
Hide file tree
Showing 4 changed files with 33,716 additions and 0 deletions.
74 changes: 74 additions & 0 deletions dist/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
import BigNumber from 'bignumber.js';
import { Observable } from 'rxjs';
import { SecretNetworkClient } from 'secretjs';

declare type ClientData = {
client: SecretNetworkClient;
endpoint: string;
chainId: string;
};

/**
* Gets the active query client. If one does not exist, initialize it and stores it for
* future use.
* @param lcdEndpoint uses a default mainnet endpoint if one is not provided
* @param chainId uses a default mainnet chainID if one is not provided
*/
export declare function getActiveQueryClient$(lcdEndpoint?: string, chainId?: string): Observable<ClientData>;

/**
* Create and returns Secret Network client
* @param walletAccount not required for making public queries
*/
export declare const getSecretNetworkClient$: ({ walletAccount, lcdEndpoint, chainId, }: {
walletAccount?: WalletAccount | undefined;
lcdEndpoint: string;
chainId: string;
}) => Observable<ClientData>;

declare type ParsedOraclePriceResponse = {
oracleKey: string;
rate: BigNumber;
lastUpdatedBase: number;
lastUpdatedQuote: number;
};

declare type ParsedOraclePricesResponse = {
[oracleKey: string]: ParsedOraclePriceResponse;
};

/**
* query the price of an asset using the oracle key
*/
export declare const queryPrice$: ({ contractAddress, codeHash, oracleKey, lcdEndpoint, chainId, }: {
contractAddress: string;
codeHash?: string | undefined;
oracleKey: string;
lcdEndpoint?: string | undefined;
chainId?: string | undefined;
}) => Observable<ParsedOraclePriceResponse>;

/**
* query multiple asset prices using oracle keys
*/
export declare const queryPrices$: ({ contractAddress, codeHash, oracleKeys, lcdEndpoint, chainId, }: {
contractAddress: string;
codeHash?: string | undefined;
oracleKeys: string[];
lcdEndpoint?: string | undefined;
chainId?: string | undefined;
}) => Observable<ParsedOraclePricesResponse>;

declare type WalletAccount = WalletSigner & WalletAddress;

declare type WalletAddress = {
walletAddress: string;
};

declare type WalletSigner = {
signer: any;
encryptionSeed?: Uint8Array;
encryptionUtils?: any;
};

export { }
7 changes: 7 additions & 0 deletions dist/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"src/index.ts": {
"file": "shadejs.cjs",
"isEntry": true,
"src": "src/index.ts"
}
}
70 changes: 70 additions & 0 deletions dist/shadejs.cjs

Large diffs are not rendered by default.

Loading

0 comments on commit ee78072

Please sign in to comment.