Skip to content

Commit

Permalink
Commit client dist
Browse files Browse the repository at this point in the history
  • Loading branch information
sisou committed Feb 24, 2024
1 parent d365111 commit 7b07573
Show file tree
Hide file tree
Showing 11 changed files with 1,687 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.DS_Store
node_modules
dist
/dist

# only yarn
package-lock.json
Expand Down
2 changes: 1 addition & 1 deletion client/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
build
dist
# dist
511 changes: 511 additions & 0 deletions client/dist/HubApi.es.js

Large diffs are not rendered by default.

516 changes: 516 additions & 0 deletions client/dist/HubApi.umd.js

Large diffs are not rendered by default.

65 changes: 65 additions & 0 deletions client/dist/src/HubApi.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
import { PopupRequestBehavior, RequestBehavior, RedirectRequestBehavior, BehaviorType } from './RequestBehavior';
import { AccountType, RequestType, BasicRequest, SimpleRequest, OnboardRequest, ChooseAddressRequest, ChooseAddressResult, CheckoutRequest, SignTransactionRequest, RenameRequest, SignMessageRequest, ExportRequest, ResultByRequestType, Account, Address, SignedTransaction, SimpleResult, ExportResult, SignedMessage, CreateCashlinkRequest, ManageCashlinkRequest, SignBtcTransactionRequest, SignedBtcTransaction, AddBtcAddressesRequest, AddBtcAddressesResult, SignPolygonTransactionRequest, SignedPolygonTransaction, Cashlink, CashlinkState, CashlinkTheme, Currency, PaymentType, PaymentState, SetupSwapRequest, SetupSwapResult, RefundSwapRequest } from './PublicRequestTypes';
export default class HubApi<DB extends BehaviorType = BehaviorType.POPUP, IB extends BehaviorType = BehaviorType.IFRAME> {
static readonly BehaviorType: typeof BehaviorType;
static readonly RequestType: typeof RequestType;
static readonly RedirectRequestBehavior: typeof RedirectRequestBehavior;
static readonly PopupRequestBehavior: typeof PopupRequestBehavior;
static readonly AccountType: typeof AccountType;
static readonly CashlinkState: typeof CashlinkState;
static readonly CashlinkTheme: typeof CashlinkTheme;
static readonly Currency: typeof Currency;
static readonly PaymentType: typeof PaymentType;
static readonly PaymentState: typeof PaymentState;
static readonly MSG_PREFIX = "\u0016Nimiq Signed Message:\n";
/** @deprecated */
static get PaymentMethod(): typeof PaymentType;
private static get DEFAULT_ENDPOINT();
private readonly _endpoint;
private readonly _defaultBehavior;
private readonly _checkoutDefaultBehavior;
private readonly _iframeBehavior;
private readonly _redirectClient;
constructor(endpoint?: string, defaultBehavior?: RequestBehavior<DB>);
checkRedirectResponse(): Promise<void>;
on<T extends RequestType>(command: T, resolve: (result: ResultByRequestType<T>, state: any) => void, reject?: (error: Error, state: any) => void): void;
/**
* Public API
*/
createCashlink<B extends BehaviorType = DB>(request: Promise<CreateCashlinkRequest> | CreateCashlinkRequest, requestBehavior?: RequestBehavior<B>): Promise<B extends BehaviorType.REDIRECT ? void : Cashlink>;
manageCashlink<B extends BehaviorType = DB>(request: Promise<ManageCashlinkRequest> | ManageCashlinkRequest, requestBehavior?: RequestBehavior<B>): Promise<B extends BehaviorType.REDIRECT ? void : Cashlink>;
checkout<R extends CheckoutRequest, B extends BehaviorType = DB>(request: Promise<R> | R, requestBehavior?: RequestBehavior<B>): Promise<B extends BehaviorType.REDIRECT ? void : R extends {
version: 2;
} ? SimpleResult | SignedTransaction : SignedTransaction>;
chooseAddress<B extends BehaviorType = DB>(request: Promise<ChooseAddressRequest> | ChooseAddressRequest, requestBehavior?: RequestBehavior<B>): Promise<B extends BehaviorType.REDIRECT ? void : ChooseAddressResult>;
signTransaction<B extends BehaviorType = DB>(request: Promise<SignTransactionRequest> | SignTransactionRequest, requestBehavior?: RequestBehavior<B>): Promise<B extends BehaviorType.REDIRECT ? void : SignedTransaction>;
signMessage<B extends BehaviorType = DB>(request: Promise<SignMessageRequest> | SignMessageRequest, requestBehavior?: RequestBehavior<B>): Promise<B extends BehaviorType.REDIRECT ? void : SignedMessage>;
signBtcTransaction<B extends BehaviorType = DB>(request: Promise<SignBtcTransactionRequest> | SignBtcTransactionRequest, requestBehavior?: RequestBehavior<B>): Promise<B extends BehaviorType.REDIRECT ? void : SignedBtcTransaction>;
signPolygonTransaction<B extends BehaviorType = DB>(request: Promise<SignPolygonTransactionRequest> | SignPolygonTransactionRequest, requestBehavior?: RequestBehavior<B>): Promise<B extends BehaviorType.REDIRECT ? void : SignedPolygonTransaction>;
setupSwap<B extends BehaviorType = DB>(request: Promise<SetupSwapRequest> | SetupSwapRequest, requestBehavior?: RequestBehavior<B>): Promise<B extends BehaviorType.REDIRECT ? void : SetupSwapResult>;
refundSwap<B extends BehaviorType = DB>(request: Promise<RefundSwapRequest> | RefundSwapRequest, requestBehavior?: RequestBehavior<B>): Promise<B extends BehaviorType.REDIRECT ? void : SignedTransaction | SignedBtcTransaction | SignedPolygonTransaction>;
/**
* Account Management
*
* Only accessible from Nimiq domains.
*/
onboard<B extends BehaviorType = DB>(request: Promise<OnboardRequest> | OnboardRequest, requestBehavior?: RequestBehavior<B>): Promise<B extends BehaviorType.REDIRECT ? void : Account[]>;
signup<B extends BehaviorType = DB>(request: Promise<BasicRequest> | BasicRequest, requestBehavior?: RequestBehavior<B>): Promise<B extends BehaviorType.REDIRECT ? void : Account[]>;
login<B extends BehaviorType = DB>(request: Promise<BasicRequest> | BasicRequest, requestBehavior?: RequestBehavior<B>): Promise<B extends BehaviorType.REDIRECT ? void : Account[]>;
logout<B extends BehaviorType = DB>(request: Promise<SimpleRequest> | SimpleRequest, requestBehavior?: RequestBehavior<B>): Promise<B extends BehaviorType.REDIRECT ? void : SimpleResult>;
export<B extends BehaviorType = DB>(request: Promise<ExportRequest> | ExportRequest, requestBehavior?: RequestBehavior<B>): Promise<B extends BehaviorType.REDIRECT ? void : ExportResult>;
changePassword<B extends BehaviorType = DB>(request: Promise<SimpleRequest> | SimpleRequest, requestBehavior?: RequestBehavior<B>): Promise<B extends BehaviorType.REDIRECT ? void : SimpleResult>;
addAddress<B extends BehaviorType = DB>(request: Promise<SimpleRequest> | SimpleRequest, requestBehavior?: RequestBehavior<B>): Promise<B extends BehaviorType.REDIRECT ? void : Address>;
rename<B extends BehaviorType = DB>(request: Promise<RenameRequest> | RenameRequest, requestBehavior?: RequestBehavior<B>): Promise<B extends BehaviorType.REDIRECT ? void : Account>;
addVestingContract<B extends BehaviorType = DB>(request: Promise<BasicRequest> | BasicRequest, requestBehavior?: RequestBehavior<B>): Promise<B extends BehaviorType.REDIRECT ? void : Account>;
migrate<B extends BehaviorType = DB>(requestBehavior?: RequestBehavior<B>): Promise<B extends BehaviorType.REDIRECT ? void : Account[]>;
activateBitcoin<B extends BehaviorType = DB>(request: Promise<SimpleRequest> | SimpleRequest, requestBehavior?: RequestBehavior<B>): Promise<B extends BehaviorType.REDIRECT ? void : Account>;
activatePolygon<B extends BehaviorType = DB>(request: Promise<SimpleRequest> | SimpleRequest, requestBehavior?: RequestBehavior<B>): Promise<B extends BehaviorType.REDIRECT ? void : Account>;
/**
* Only accessible in iframe from Nimiq domains.
*/
list<B extends BehaviorType = IB>(requestBehavior?: RequestBehavior<B>): Promise<B extends BehaviorType.REDIRECT ? void : Account[]>;
cashlinks<B extends BehaviorType = IB>(requestBehavior?: RequestBehavior<B>): Promise<B extends BehaviorType.REDIRECT ? void : Cashlink[]>;
addBtcAddresses<B extends BehaviorType = IB>(request: AddBtcAddressesRequest, requestBehavior?: RequestBehavior<B>): Promise<B extends BehaviorType.REDIRECT ? void : AddBtcAddressesResult>;
private _request;
}
25 changes: 25 additions & 0 deletions client/dist/src/PublicPaymentOptions.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { PaymentOptions, Currency, PaymentType } from './PublicRequestTypes';
export interface NimiqSpecifics {
fee?: number | string;
feePerByte?: number | string;
extraData?: Uint8Array | string;
validityDuration?: number;
flags?: number;
sender?: string;
forceSender?: boolean;
recipient?: string;
recipientType?: Nimiq.Account.Type;
}
export declare type NimiqDirectPaymentOptions = PaymentOptions<Currency.NIM, PaymentType.DIRECT>;
export interface BitcoinSpecifics {
fee?: number | string;
feePerByte?: number | string;
recipient?: string;
}
export declare type BitcoinDirectPaymentOptions = PaymentOptions<Currency.BTC, PaymentType.DIRECT>;
export interface EtherSpecifics {
gasLimit?: number | string;
gasPrice?: string;
recipient?: string;
}
export declare type EtherDirectPaymentOptions = PaymentOptions<Currency.ETH, PaymentType.DIRECT>;
Loading

0 comments on commit 7b07573

Please sign in to comment.