Skip to content

Feat/testnet bundler changes #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions build/cjs/common/account.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import type { IrysClient } from "./irys";
import type { Base58, U64 } from "./dataTypes";
export declare class Account {
irys: IrysClient;
constructor(irys: IrysClient);
getBalance(address: string): Promise<U64>;
getAddresses(key: string): {
irys: Base58;
exec: string;
};
}
51 changes: 51 additions & 0 deletions build/cjs/common/api.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/// <reference types="node" />
import type { AxiosResponse, AxiosRequestConfig, AxiosInstance } from "axios";
import AsyncRetry from "async-retry";
import { JsonRpcProvider } from "ethers";
export declare const isApiConfig: (o: URL | ApiConfig | string) => o is ApiConfig;
export type ApiConfig = {
url: URL;
timeout?: number;
logging?: boolean;
logger?: (msg: string) => void;
network?: string;
headers?: Record<string, string>;
withCredentials?: boolean;
retry?: AsyncRetry.Options;
};
export type ApiRequestConfig = {
retry?: AsyncRetry.Options;
} & AxiosRequestConfig;
export declare enum V1_API_ROUTES {
GET_TX_HEADER = "/v1/tx/#",
GET_PROMOTION_STATUS = "/v1/tx/#/is_promoted",
GET_STORAGE_CONFIG = "/v1/network/config",
GET_INFO = "/",
EXECUTION_RPC = "/v1/execution-rpc",
GET_LOCAL_DATA_START_OFFSET = "/v1/tx/#/local/data_start_offset",
GET_LATEST_BLOCK = "/v1/block/latest",
GET_TX_PRICE = "/v1/price/{ledgerId}/{size}",
POST_TX_HEADER = "/v1/tx",
POST_CHUNK = "/v1/chunk"
}
export declare const API_VERSIONS: string[];
export default class Api {
protected _instance?: AxiosInstance;
protected rpcInstance?: JsonRpcProvider;
cookieMap: Map<any, any>;
config: ApiConfig;
constructor(config?: ApiConfig);
get executionRpcUrl(): URL;
get rpcProvider(): JsonRpcProvider;
applyConfig(config: ApiConfig): void;
getConfig(): ApiConfig;
private requestInterceptor;
private responseInterceptor;
private mergeDefaults;
get<T = any>(path: string, config?: ApiRequestConfig): Promise<AxiosResponse<T>>;
post<T = any>(path: string, body: Buffer | string | object | null, config?: ApiRequestConfig): Promise<AxiosResponse<T>>;
get instance(): AxiosInstance;
request<T = any>(path: string, config?: ApiRequestConfig): Promise<AxiosResponse<T>>;
}
export declare function normalizeUrl(url: URL): URL;
export declare function buildUrl(base: URL, paths: string[]): URL;
30 changes: 27 additions & 3 deletions build/cjs/common/api.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion build/cjs/common/api.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions build/cjs/common/base.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
export declare const BaseDecoderSymbol: unique symbol;
export declare const BaseEncoderSymbol: unique symbol;
export declare class BaseObject {
[key: string]: any;
get(field: string): string;
get(field: string, options: {
decode: true;
string: false;
}): Uint8Array;
get(field: string, options: {
decode: true;
string: true;
}): string;
}
60 changes: 60 additions & 0 deletions build/cjs/common/chunk.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
import type { Address, Base58, Base64Url, H256, PartitionChunkOffset, TxRelativeChunkOffset, U64 } from "./dataTypes";
import type { IrysClient } from "./irys";
export declare enum ChunkFormat {
PackedChunk = "packed",
UnpackedChunk = "unpacked"
}
export type UnpackedChunkInterface = {
dataRoot: H256;
dataSize: U64;
dataPath: Uint8Array;
txOffset: TxRelativeChunkOffset;
bytes: Uint8Array;
};
export type EncodedUnpackedChunkInterface = {
dataRoot: Base58;
dataSize: U64;
dataPath: Base64Url;
txOffset: TxRelativeChunkOffset;
bytes: Base64Url;
};
export declare function chunkEndByteOffset(txOffset: number, dataSize: U64, chunkSize: number): U64;
export declare class UnpackedChunk implements UnpackedChunkInterface {
dataRoot: H256;
dataSize: U64;
dataPath: Uint8Array;
txOffset: TxRelativeChunkOffset;
bytes: Uint8Array;
constructor(attributes: UnpackedChunkInterface);
byteOffset(chunkSize: number): U64;
encode(): EncodedUnpackedChunkInterface;
static decode(data: EncodedUnpackedChunkInterface): UnpackedChunk;
toJSON(): string;
}
export type PackedChunkInterface = UnpackedChunkInterface & {
packingAddress: Address;
partitionOffset: PartitionChunkOffset;
partitionHash: H256;
};
export type EncodedPackedChunkInterface = EncodedUnpackedChunkInterface & {
packingAddress: Base58;
partitionOffset: PartitionChunkOffset;
partitionHash: Base58;
};
export declare const packedChunkProperties: string[];
export declare class PackedChunk implements PackedChunkInterface {
dataRoot: H256;
dataSize: bigint;
dataPath: Uint8Array;
txOffset: number;
bytes: Uint8Array;
packingAddress: Address;
partitionOffset: number;
partitionHash: H256;
irys: IrysClient;
constructor(irys: IrysClient, attributes: Partial<PackedChunkInterface>);
encode(): EncodedPackedChunkInterface;
toJSON(): string;
static decode(irys: IrysClient, data: EncodedPackedChunkInterface): PackedChunk;
unpack(): Promise<UnpackedChunk>;
}
8 changes: 4 additions & 4 deletions build/cjs/common/chunk.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading