Comparing version 2.6.0-beta.0 to 2.6.0
/// <reference types="node" /> | ||
import { EventEmitter } from 'events'; | ||
import { AccountChannelsRequest, AccountChannelsResponse, AccountCurrenciesRequest, AccountCurrenciesResponse, AccountInfoRequest, AccountInfoResponse, AccountLinesRequest, AccountLinesResponse, AccountNFTsRequest, AccountNFTsResponse, AccountObjectsRequest, AccountObjectsResponse, AccountOffersRequest, AccountOffersResponse, AccountTxRequest, AccountTxResponse, AMMInfoRequest, AMMInfoResponse, GatewayBalancesRequest, GatewayBalancesResponse, NoRippleCheckRequest, NoRippleCheckResponse, LedgerRequest, LedgerResponse, LedgerClosedRequest, LedgerClosedResponse, LedgerCurrentRequest, LedgerCurrentResponse, LedgerDataRequest, LedgerDataResponse, LedgerEntryRequest, LedgerEntryResponse, SubmitRequest, SubmitResponse, SubmitMultisignedRequest, SubmitMultisignedResponse, TransactionEntryRequest, TransactionEntryResponse, TxRequest, TxResponse, BookOffersRequest, BookOffersResponse, DepositAuthorizedRequest, DepositAuthorizedResponse, PathFindRequest, PathFindResponse, RipplePathFindRequest, RipplePathFindResponse, ChannelVerifyRequest, ChannelVerifyResponse, FeeRequest, FeeResponse, ManifestRequest, ManifestResponse, ServerInfoRequest, ServerInfoResponse, ServerStateRequest, ServerStateResponse, PingRequest, PingResponse, RandomRequest, RandomResponse, LedgerStream, ValidationStream, TransactionStream, PathFindStream, PeerStatusStream, ConsensusStream, SubscribeRequest, SubscribeResponse, UnsubscribeRequest, UnsubscribeResponse, NFTBuyOffersRequest, NFTBuyOffersResponse, NFTSellOffersRequest, NFTSellOffersResponse } from '../models/methods'; | ||
import { AccountChannelsRequest, AccountChannelsResponse, AccountCurrenciesRequest, AccountCurrenciesResponse, AccountInfoRequest, AccountInfoResponse, AccountLinesRequest, AccountLinesResponse, AccountNFTsRequest, AccountNFTsResponse, AccountObjectsRequest, AccountObjectsResponse, AccountOffersRequest, AccountOffersResponse, AccountTxRequest, AccountTxResponse, GatewayBalancesRequest, GatewayBalancesResponse, NoRippleCheckRequest, NoRippleCheckResponse, LedgerRequest, LedgerResponse, LedgerClosedRequest, LedgerClosedResponse, LedgerCurrentRequest, LedgerCurrentResponse, LedgerDataRequest, LedgerDataResponse, LedgerEntryRequest, LedgerEntryResponse, SubmitRequest, SubmitResponse, SubmitMultisignedRequest, SubmitMultisignedResponse, TransactionEntryRequest, TransactionEntryResponse, TxRequest, TxResponse, BookOffersRequest, BookOffersResponse, DepositAuthorizedRequest, DepositAuthorizedResponse, PathFindRequest, PathFindResponse, RipplePathFindRequest, RipplePathFindResponse, ChannelVerifyRequest, ChannelVerifyResponse, FeeRequest, FeeResponse, ManifestRequest, ManifestResponse, ServerInfoRequest, ServerInfoResponse, ServerStateRequest, ServerStateResponse, PingRequest, PingResponse, RandomRequest, RandomResponse, LedgerStream, ValidationStream, TransactionStream, PathFindStream, PeerStatusStream, ConsensusStream, SubscribeRequest, SubscribeResponse, UnsubscribeRequest, UnsubscribeResponse, NFTBuyOffersRequest, NFTBuyOffersResponse, NFTSellOffersRequest, NFTSellOffersResponse } from '../models/methods'; | ||
import { BaseRequest, BaseResponse } from '../models/methods/baseMethod'; | ||
@@ -28,3 +28,2 @@ import { autofill, getLedgerIndex, getOrderbook, getBalances, getXrpBalance, submit, submitAndWait } from '../sugar'; | ||
request(r: AccountTxRequest): Promise<AccountTxResponse>; | ||
request(r: AMMInfoRequest): Promise<AMMInfoResponse>; | ||
request(r: BookOffersRequest): Promise<BookOffersResponse>; | ||
@@ -31,0 +30,0 @@ request(r: ChannelVerifyRequest): Promise<ChannelVerifyResponse>; |
export declare type LedgerIndex = number | ('validated' | 'closed' | 'current'); | ||
export declare type AccountObjectType = 'check' | 'deposit_preauth' | 'escrow' | 'nft_offer' | 'offer' | 'payment_channel' | 'signer_list' | 'ticket' | 'state' | 'xchain_create_account_claim_id' | 'xchain_claim_id'; | ||
export declare type AccountObjectType = 'check' | 'deposit_preauth' | 'escrow' | 'nft_offer' | 'offer' | 'payment_channel' | 'signer_list' | 'ticket' | 'state'; | ||
interface XRP { | ||
currency: 'XRP'; | ||
} | ||
export interface IssuedCurrency { | ||
interface IssuedCurrency { | ||
currency: string; | ||
@@ -11,3 +11,2 @@ issuer: string; | ||
export declare type Currency = IssuedCurrency | XRP; | ||
export declare type Issue = Currency; | ||
export interface IssuedCurrencyAmount extends IssuedCurrency { | ||
@@ -58,9 +57,3 @@ value: string; | ||
} | ||
export interface XChainBridge { | ||
LockingChainDoor: string; | ||
LockingChainIssue: Currency; | ||
IssuingChainDoor: string; | ||
IssuingChainIssue: Currency; | ||
} | ||
export {}; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -9,3 +9,2 @@ import { AccountChannelsRequest, AccountChannelsResponse } from './accountChannels'; | ||
import { AccountTxRequest, AccountTxResponse } from './accountTx'; | ||
import { AMMInfoRequest, AMMInfoResponse } from './ammInfo'; | ||
import { ErrorResponse } from './baseMethod'; | ||
@@ -39,5 +38,5 @@ import { BookOffersRequest, BookOffer, BookOffersResponse } from './bookOffers'; | ||
import { UnsubscribeRequest, UnsubscribeResponse } from './unsubscribe'; | ||
declare type Request = AccountChannelsRequest | AccountCurrenciesRequest | AccountInfoRequest | AccountLinesRequest | AccountNFTsRequest | AccountObjectsRequest | AccountOffersRequest | AccountTxRequest | AMMInfoRequest | GatewayBalancesRequest | NoRippleCheckRequest | LedgerRequest | LedgerClosedRequest | LedgerCurrentRequest | LedgerDataRequest | LedgerEntryRequest | SubmitRequest | SubmitMultisignedRequest | TransactionEntryRequest | TxRequest | BookOffersRequest | DepositAuthorizedRequest | PathFindRequest | RipplePathFindRequest | ChannelVerifyRequest | SubscribeRequest | UnsubscribeRequest | FeeRequest | ManifestRequest | ServerInfoRequest | ServerStateRequest | PingRequest | RandomRequest | NFTBuyOffersRequest | NFTSellOffersRequest | FederatorInfoRequest; | ||
declare type Response = AccountChannelsResponse | AccountCurrenciesResponse | AccountInfoResponse | AccountLinesResponse | AccountNFTsResponse | AccountObjectsResponse | AccountOffersResponse | AccountTxResponse | AMMInfoResponse | GatewayBalancesResponse | NoRippleCheckResponse | LedgerResponse | LedgerClosedResponse | LedgerCurrentResponse | LedgerDataResponse | LedgerEntryResponse | SubmitResponse | SubmitMultisignedResponse | TransactionEntryResponse | TxResponse | BookOffersResponse | DepositAuthorizedResponse | PathFindResponse | RipplePathFindResponse | ChannelVerifyResponse | SubscribeResponse | UnsubscribeResponse | FeeResponse | ManifestResponse | ServerInfoResponse | ServerStateResponse | PingResponse | RandomResponse | NFTBuyOffersResponse | NFTSellOffersResponse | FederatorInfoResponse; | ||
export { Request, Response, AccountChannelsRequest, AccountChannelsResponse, AccountCurrenciesRequest, AccountCurrenciesResponse, AccountInfoRequest, AccountInfoResponse, AccountLinesRequest, AccountLinesResponse, AccountNFTsRequest, AccountNFTsResponse, AccountObjectsRequest, AccountObjectsResponse, AccountOffer, AccountOffersRequest, AccountOffersResponse, AccountTxRequest, AccountTxResponse, AMMInfoRequest, AMMInfoResponse, GatewayBalancesRequest, GatewayBalancesResponse, NoRippleCheckRequest, NoRippleCheckResponse, LedgerRequest, LedgerResponse, LedgerClosedRequest, LedgerClosedResponse, LedgerCurrentRequest, LedgerCurrentResponse, LedgerDataRequest, LedgerDataResponse, LedgerEntryRequest, LedgerEntryResponse, SubmitRequest, SubmitResponse, SubmitMultisignedRequest, SubmitMultisignedResponse, TransactionEntryRequest, TransactionEntryResponse, TxRequest, TxResponse, BookOffersRequest, BookOffer, BookOffersResponse, DepositAuthorizedRequest, DepositAuthorizedResponse, PathFindRequest, PathFindCreateRequest, PathFindCloseRequest, PathFindStatusRequest, PathFindResponse, RipplePathFindRequest, RipplePathFindResponse, ChannelVerifyRequest, ChannelVerifyResponse, SubscribeRequest, SubscribeResponse, Stream, LedgerStream, ValidationStream, TransactionStream, PathFindStream, PeerStatusStream, OrderBookStream, ConsensusStream, UnsubscribeRequest, UnsubscribeResponse, FeeRequest, FeeResponse, ManifestRequest, ManifestResponse, ServerInfoRequest, ServerInfoResponse, ServerStateRequest, ServerStateResponse, PingRequest, PingResponse, RandomRequest, RandomResponse, ErrorResponse, NFTBuyOffersRequest, NFTBuyOffersResponse, NFTSellOffersRequest, NFTSellOffersResponse, FederatorInfoRequest, FederatorInfoResponse, }; | ||
declare type Request = AccountChannelsRequest | AccountCurrenciesRequest | AccountInfoRequest | AccountLinesRequest | AccountNFTsRequest | AccountObjectsRequest | AccountOffersRequest | AccountTxRequest | GatewayBalancesRequest | NoRippleCheckRequest | LedgerRequest | LedgerClosedRequest | LedgerCurrentRequest | LedgerDataRequest | LedgerEntryRequest | SubmitRequest | SubmitMultisignedRequest | TransactionEntryRequest | TxRequest | BookOffersRequest | DepositAuthorizedRequest | PathFindRequest | RipplePathFindRequest | ChannelVerifyRequest | SubscribeRequest | UnsubscribeRequest | FeeRequest | ManifestRequest | ServerInfoRequest | ServerStateRequest | PingRequest | RandomRequest | NFTBuyOffersRequest | NFTSellOffersRequest | FederatorInfoRequest; | ||
declare type Response = AccountChannelsResponse | AccountCurrenciesResponse | AccountInfoResponse | AccountLinesResponse | AccountNFTsResponse | AccountObjectsResponse | AccountOffersResponse | AccountTxResponse | GatewayBalancesResponse | NoRippleCheckResponse | LedgerResponse | LedgerClosedResponse | LedgerCurrentResponse | LedgerDataResponse | LedgerEntryResponse | SubmitResponse | SubmitMultisignedResponse | TransactionEntryResponse | TxResponse | BookOffersResponse | DepositAuthorizedResponse | PathFindResponse | RipplePathFindResponse | ChannelVerifyResponse | SubscribeResponse | UnsubscribeResponse | FeeResponse | ManifestResponse | ServerInfoResponse | ServerStateResponse | PingResponse | RandomResponse | NFTBuyOffersResponse | NFTSellOffersResponse | FederatorInfoResponse; | ||
export { Request, Response, AccountChannelsRequest, AccountChannelsResponse, AccountCurrenciesRequest, AccountCurrenciesResponse, AccountInfoRequest, AccountInfoResponse, AccountLinesRequest, AccountLinesResponse, AccountNFTsRequest, AccountNFTsResponse, AccountObjectsRequest, AccountObjectsResponse, AccountOffer, AccountOffersRequest, AccountOffersResponse, AccountTxRequest, AccountTxResponse, GatewayBalancesRequest, GatewayBalancesResponse, NoRippleCheckRequest, NoRippleCheckResponse, LedgerRequest, LedgerResponse, LedgerClosedRequest, LedgerClosedResponse, LedgerCurrentRequest, LedgerCurrentResponse, LedgerDataRequest, LedgerDataResponse, LedgerEntryRequest, LedgerEntryResponse, SubmitRequest, SubmitResponse, SubmitMultisignedRequest, SubmitMultisignedResponse, TransactionEntryRequest, TransactionEntryResponse, TxRequest, TxResponse, BookOffersRequest, BookOffer, BookOffersResponse, DepositAuthorizedRequest, DepositAuthorizedResponse, PathFindRequest, PathFindCreateRequest, PathFindCloseRequest, PathFindStatusRequest, PathFindResponse, RipplePathFindRequest, RipplePathFindResponse, ChannelVerifyRequest, ChannelVerifyResponse, SubscribeRequest, SubscribeResponse, Stream, LedgerStream, ValidationStream, TransactionStream, PathFindStream, PeerStatusStream, OrderBookStream, ConsensusStream, UnsubscribeRequest, UnsubscribeResponse, FeeRequest, FeeResponse, ManifestRequest, ManifestResponse, ServerInfoRequest, ServerInfoResponse, ServerStateRequest, ServerStateResponse, PingRequest, PingResponse, RandomRequest, RandomResponse, ErrorResponse, NFTBuyOffersRequest, NFTBuyOffersResponse, NFTSellOffersRequest, NFTSellOffersResponse, FederatorInfoRequest, FederatorInfoResponse, }; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -1,2 +0,2 @@ | ||
import { IssuedCurrency, LedgerIndex } from '../common'; | ||
import { LedgerIndex } from '../common'; | ||
import { LedgerEntry } from '../ledger'; | ||
@@ -38,22 +38,2 @@ import { BaseRequest, BaseResponse } from './baseMethod'; | ||
} | string; | ||
xchain_bridge?: { | ||
locking_chain_door: string; | ||
locking_chain_issue: 'XRP' | IssuedCurrency; | ||
issuing_chain_door: string; | ||
issuing_chain_issue: 'XRP' | IssuedCurrency; | ||
} | string; | ||
xchain_claim_id?: { | ||
locking_chain_door: string; | ||
locking_chain_issue: 'XRP' | IssuedCurrency; | ||
issuing_chain_door: string; | ||
issuing_chain_issue: 'XRP' | IssuedCurrency; | ||
xchain_claim_id: string | number; | ||
} | string; | ||
xchain_create_account_claim_id?: { | ||
locking_chain_door: string; | ||
locking_chain_issue: 'XRP' | IssuedCurrency; | ||
issuing_chain_door: string; | ||
issuing_chain_issue: 'XRP' | IssuedCurrency; | ||
xchain_create_account_claim_id: string | number; | ||
} | string; | ||
} | ||
@@ -60,0 +40,0 @@ export interface LedgerEntryResponse extends BaseResponse { |
@@ -1,5 +0,4 @@ | ||
import { Amount, Issue, IssuedCurrencyAmount, Memo, Signer } from '../common'; | ||
import { Amount, IssuedCurrencyAmount, Memo, Signer } from '../common'; | ||
export declare function isIssuedCurrency(input: unknown): input is IssuedCurrencyAmount; | ||
export declare function isAmount(amount: unknown): amount is Amount; | ||
export declare function isIssue(input: unknown): input is Issue; | ||
export interface GlobalFlags { | ||
@@ -6,0 +5,0 @@ } |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.parseAmountValue = exports.validateBaseTransaction = exports.isIssue = exports.isAmount = exports.isIssuedCurrency = void 0; | ||
exports.parseAmountValue = exports.validateBaseTransaction = exports.isAmount = exports.isIssuedCurrency = void 0; | ||
const ripple_binary_codec_1 = require("ripple-binary-codec"); | ||
@@ -52,13 +52,2 @@ const errors_1 = require("../../errors"); | ||
exports.isAmount = isAmount; | ||
function isIssue(input) { | ||
if (!isRecord(input)) { | ||
return false; | ||
} | ||
const length = Object.keys(input).length; | ||
return ((length === 1 && input.currency === 'XRP') || | ||
(length === 2 && | ||
typeof input.currency === 'string' && | ||
typeof input.issuer === 'string')); | ||
} | ||
exports.isIssue = isIssue; | ||
function validateBaseTransaction(common) { | ||
@@ -65,0 +54,0 @@ if (common.Account === undefined) { |
@@ -5,7 +5,2 @@ export { validate, TransactionAndMetadata, Transaction } from './transaction'; | ||
export { AccountDelete } from './accountDelete'; | ||
export { AMMBid } from './AMMBid'; | ||
export { AMMDepositFlags, AMMDepositFlagsInterface, AMMDeposit, } from './AMMDeposit'; | ||
export { AMMCreate } from './AMMCreate'; | ||
export { AMMVote } from './AMMVote'; | ||
export { AMMWithdrawFlags, AMMWithdrawFlagsInterface, AMMWithdraw, } from './AMMWithdraw'; | ||
export { CheckCancel } from './checkCancel'; | ||
@@ -33,9 +28,2 @@ export { CheckCash } from './checkCash'; | ||
export { TrustSetFlagsInterface, TrustSetFlags, TrustSet } from './trustSet'; | ||
export { XChainAddAttestation } from './XChainAddAttestation'; | ||
export { XChainClaim } from './XChainClaim'; | ||
export { XChainCommit } from './XChainCommit'; | ||
export { XChainCreateBridge } from './XChainCreateBridge'; | ||
export { XChainCreateClaimID } from './XChainCreateClaimID'; | ||
export { XChainAccountCreateCommit } from './XChainAccountCreateCommit'; | ||
export { XChainModifyBridge } from './XChainModifyBridge'; | ||
//# sourceMappingURL=index.d.ts.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.TrustSetFlags = exports.PaymentChannelClaimFlags = exports.PaymentFlags = exports.OfferCreateFlags = exports.NFTokenMintFlags = exports.NFTokenCreateOfferFlags = exports.AMMWithdrawFlags = exports.AMMDepositFlags = exports.AccountSetTfFlags = exports.AccountSetAsfFlags = exports.validate = void 0; | ||
exports.TrustSetFlags = exports.PaymentChannelClaimFlags = exports.PaymentFlags = exports.OfferCreateFlags = exports.NFTokenMintFlags = exports.NFTokenCreateOfferFlags = exports.AccountSetTfFlags = exports.AccountSetAsfFlags = exports.validate = void 0; | ||
var transaction_1 = require("./transaction"); | ||
@@ -9,6 +9,2 @@ Object.defineProperty(exports, "validate", { enumerable: true, get: function () { return transaction_1.validate; } }); | ||
Object.defineProperty(exports, "AccountSetTfFlags", { enumerable: true, get: function () { return accountSet_1.AccountSetTfFlags; } }); | ||
var AMMDeposit_1 = require("./AMMDeposit"); | ||
Object.defineProperty(exports, "AMMDepositFlags", { enumerable: true, get: function () { return AMMDeposit_1.AMMDepositFlags; } }); | ||
var AMMWithdraw_1 = require("./AMMWithdraw"); | ||
Object.defineProperty(exports, "AMMWithdrawFlags", { enumerable: true, get: function () { return AMMWithdraw_1.AMMWithdrawFlags; } }); | ||
var NFTokenCreateOffer_1 = require("./NFTokenCreateOffer"); | ||
@@ -15,0 +11,0 @@ Object.defineProperty(exports, "NFTokenCreateOfferFlags", { enumerable: true, get: function () { return NFTokenCreateOffer_1.NFTokenCreateOfferFlags; } }); |
import { AccountDelete } from './accountDelete'; | ||
import { AccountSet } from './accountSet'; | ||
import { AMMBid } from './AMMBid'; | ||
import { AMMCreate } from './AMMCreate'; | ||
import { AMMDeposit } from './AMMDeposit'; | ||
import { AMMVote } from './AMMVote'; | ||
import { AMMWithdraw } from './AMMWithdraw'; | ||
import { CheckCancel } from './checkCancel'; | ||
@@ -31,10 +26,3 @@ import { CheckCash } from './checkCash'; | ||
import { TrustSet } from './trustSet'; | ||
import { XChainAccountCreateCommit } from './XChainAccountCreateCommit'; | ||
import { XChainAddAttestation } from './XChainAddAttestation'; | ||
import { XChainClaim } from './XChainClaim'; | ||
import { XChainCommit } from './XChainCommit'; | ||
import { XChainCreateBridge } from './XChainCreateBridge'; | ||
import { XChainCreateClaimID } from './XChainCreateClaimID'; | ||
import { XChainModifyBridge } from './XChainModifyBridge'; | ||
export declare type Transaction = AccountDelete | AccountSet | AMMBid | AMMDeposit | AMMCreate | AMMVote | AMMWithdraw | CheckCancel | CheckCash | CheckCreate | DepositPreauth | EscrowCancel | EscrowCreate | EscrowFinish | NFTokenAcceptOffer | NFTokenBurn | NFTokenCancelOffer | NFTokenCreateOffer | NFTokenMint | OfferCancel | OfferCreate | Payment | PaymentChannelClaim | PaymentChannelCreate | PaymentChannelFund | SetRegularKey | SignerListSet | TicketCreate | TrustSet | XChainAddAttestation | XChainClaim | XChainCommit | XChainCreateBridge | XChainCreateClaimID | XChainAccountCreateCommit | XChainModifyBridge; | ||
export declare type Transaction = AccountDelete | AccountSet | CheckCancel | CheckCash | CheckCreate | DepositPreauth | EscrowCancel | EscrowCreate | EscrowFinish | NFTokenAcceptOffer | NFTokenBurn | NFTokenCancelOffer | NFTokenCreateOffer | NFTokenMint | OfferCancel | OfferCreate | Payment | PaymentChannelClaim | PaymentChannelCreate | PaymentChannelFund | SetRegularKey | SignerListSet | TicketCreate | TrustSet; | ||
export interface TransactionAndMetadata { | ||
@@ -41,0 +29,0 @@ transaction: Transaction; |
@@ -13,7 +13,2 @@ "use strict"; | ||
const accountSet_1 = require("./accountSet"); | ||
const AMMBid_1 = require("./AMMBid"); | ||
const AMMCreate_1 = require("./AMMCreate"); | ||
const AMMDeposit_1 = require("./AMMDeposit"); | ||
const AMMVote_1 = require("./AMMVote"); | ||
const AMMWithdraw_1 = require("./AMMWithdraw"); | ||
const checkCancel_1 = require("./checkCancel"); | ||
@@ -41,9 +36,2 @@ const checkCash_1 = require("./checkCash"); | ||
const trustSet_1 = require("./trustSet"); | ||
const XChainAccountCreateCommit_1 = require("./XChainAccountCreateCommit"); | ||
const XChainAddAttestation_1 = require("./XChainAddAttestation"); | ||
const XChainClaim_1 = require("./XChainClaim"); | ||
const XChainCommit_1 = require("./XChainCommit"); | ||
const XChainCreateBridge_1 = require("./XChainCreateBridge"); | ||
const XChainCreateClaimID_1 = require("./XChainCreateClaimID"); | ||
const XChainModifyBridge_1 = require("./XChainModifyBridge"); | ||
function validate(transaction) { | ||
@@ -65,17 +53,2 @@ const tx = Object.assign({}, transaction); | ||
break; | ||
case 'AMMBid': | ||
(0, AMMBid_1.validateAMMBid)(tx); | ||
break; | ||
case 'AMMDeposit': | ||
(0, AMMDeposit_1.validateAMMDeposit)(tx); | ||
break; | ||
case 'AMMCreate': | ||
(0, AMMCreate_1.validateAMMCreate)(tx); | ||
break; | ||
case 'AMMVote': | ||
(0, AMMVote_1.validateAMMVote)(tx); | ||
break; | ||
case 'AMMWithdraw': | ||
(0, AMMWithdraw_1.validateAMMWithdraw)(tx); | ||
break; | ||
case 'CheckCancel': | ||
@@ -147,23 +120,2 @@ (0, checkCancel_1.validateCheckCancel)(tx); | ||
break; | ||
case 'XChainAddAttestation': | ||
(0, XChainAddAttestation_1.validateXChainAddAttestation)(tx); | ||
break; | ||
case 'XChainClaim': | ||
(0, XChainClaim_1.validateXChainClaim)(tx); | ||
break; | ||
case 'XChainCommit': | ||
(0, XChainCommit_1.validateXChainCommit)(tx); | ||
break; | ||
case 'XChainCreateBridge': | ||
(0, XChainCreateBridge_1.validateXChainCreateBridge)(tx); | ||
break; | ||
case 'XChainCreateClaimID': | ||
(0, XChainCreateClaimID_1.validateXChainCreateClaimID)(tx); | ||
break; | ||
case 'XChainAccountCreateCommit': | ||
(0, XChainAccountCreateCommit_1.validateXChainAccountCreateCommit)(tx); | ||
break; | ||
case 'XChainModifyBridge': | ||
(0, XChainModifyBridge_1.validateXChainModifyBridge)(tx); | ||
break; | ||
default: | ||
@@ -170,0 +122,0 @@ throw new errors_1.ValidationError(`Invalid field TransactionType: ${tx.TransactionType}`); |
@@ -7,4 +7,2 @@ "use strict"; | ||
const accountSet_1 = require("../transactions/accountSet"); | ||
const AMMDeposit_1 = require("../transactions/AMMDeposit"); | ||
const AMMWithdraw_1 = require("../transactions/AMMWithdraw"); | ||
const offerCreate_1 = require("../transactions/offerCreate"); | ||
@@ -37,8 +35,2 @@ const payment_1 = require("../transactions/payment"); | ||
return; | ||
case 'AMMDeposit': | ||
tx.Flags = convertAMMDepositFlagsToNumber(tx.Flags); | ||
return; | ||
case 'AMMWithdraw': | ||
tx.Flags = convertAMMWithdrawFlagsToNumber(tx.Flags); | ||
return; | ||
case 'OfferCreate': | ||
@@ -64,8 +56,2 @@ tx.Flags = convertOfferCreateFlagsToNumber(tx.Flags); | ||
} | ||
function convertAMMDepositFlagsToNumber(flags) { | ||
return reduceFlags(flags, AMMDeposit_1.AMMDepositFlags); | ||
} | ||
function convertAMMWithdrawFlagsToNumber(flags) { | ||
return reduceFlags(flags, AMMWithdraw_1.AMMWithdrawFlags); | ||
} | ||
function convertOfferCreateFlagsToNumber(flags) { | ||
@@ -72,0 +58,0 @@ return reduceFlags(flags, offerCreate_1.OfferCreateFlags); |
import type { Client } from '..'; | ||
import Wallet from '.'; | ||
declare enum FaucetNetwork { | ||
Testnet = "faucet.altnet.rippletest.net", | ||
Devnet = "faucet.devnet.rippletest.net", | ||
NFTDevnet = "faucet-nft.ripple.com" | ||
} | ||
declare function fundWallet(this: Client, wallet?: Wallet | null, options?: { | ||
faucetHost?: string; | ||
faucetPath?: string; | ||
amount?: string; | ||
@@ -15,9 +11,3 @@ }): Promise<{ | ||
}>; | ||
declare function getFaucetHost(client: Client): FaucetNetwork | undefined; | ||
export default fundWallet; | ||
declare const _private: { | ||
FaucetNetwork: typeof FaucetNetwork; | ||
getFaucetHost: typeof getFaucetHost; | ||
}; | ||
export { _private }; | ||
//# sourceMappingURL=fundWallet.d.ts.map |
@@ -15,13 +15,7 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports._private = void 0; | ||
const https_1 = require("https"); | ||
const ripple_address_codec_1 = require("ripple-address-codec"); | ||
const errors_1 = require("../errors"); | ||
const defaultFaucets_1 = require("./defaultFaucets"); | ||
const _1 = __importDefault(require(".")); | ||
var FaucetNetwork; | ||
(function (FaucetNetwork) { | ||
FaucetNetwork["Testnet"] = "faucet.altnet.rippletest.net"; | ||
FaucetNetwork["Devnet"] = "faucet.devnet.rippletest.net"; | ||
FaucetNetwork["NFTDevnet"] = "faucet-nft.ripple.com"; | ||
})(FaucetNetwork || (FaucetNetwork = {})); | ||
const INTERVAL_SECONDS = 1; | ||
@@ -47,3 +41,6 @@ const MAX_ATTEMPTS = 20; | ||
} | ||
const httpOptions = getHTTPOptions(this, postBody, options === null || options === void 0 ? void 0 : options.faucetHost); | ||
const httpOptions = getHTTPOptions(this, postBody, { | ||
hostname: options === null || options === void 0 ? void 0 : options.faucetHost, | ||
pathname: options === null || options === void 0 ? void 0 : options.faucetPath, | ||
}); | ||
return returnPromise(httpOptions, this, startingBalance, walletToFund, postBody); | ||
@@ -70,7 +67,10 @@ }); | ||
} | ||
function getHTTPOptions(client, postBody, hostname) { | ||
function getHTTPOptions(client, postBody, options) { | ||
var _a, _b; | ||
const finalHostname = (_a = options === null || options === void 0 ? void 0 : options.hostname) !== null && _a !== void 0 ? _a : (0, defaultFaucets_1.getFaucetHost)(client); | ||
const finalPathname = (_b = options === null || options === void 0 ? void 0 : options.pathname) !== null && _b !== void 0 ? _b : (0, defaultFaucets_1.getDefaultFaucetPath)(finalHostname); | ||
return { | ||
hostname: hostname !== null && hostname !== void 0 ? hostname : getFaucetHost(client), | ||
hostname: finalHostname, | ||
port: 443, | ||
path: '/accounts', | ||
path: finalPathname, | ||
method: 'POST', | ||
@@ -88,3 +88,5 @@ headers: { | ||
if ((_a = response.headers['content-type']) === null || _a === void 0 ? void 0 : _a.startsWith('application/json')) { | ||
yield processSuccessfulResponse(client, body, startingBalance, walletToFund, resolve, reject); | ||
const faucetWallet = JSON.parse(body); | ||
const classicAddress = faucetWallet.account.classicAddress; | ||
yield processSuccessfulResponse(client, classicAddress, walletToFund, startingBalance, resolve, reject); | ||
} | ||
@@ -100,6 +102,4 @@ else { | ||
} | ||
function processSuccessfulResponse(client, body, startingBalance, walletToFund, resolve, reject) { | ||
function processSuccessfulResponse(client, classicAddress, walletToFund, startingBalance, resolve, reject) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const faucetWallet = JSON.parse(body); | ||
const classicAddress = faucetWallet.account.classicAddress; | ||
if (!classicAddress) { | ||
@@ -164,21 +164,3 @@ reject(new errors_1.XRPLFaucetError(`The faucet account is undefined`)); | ||
} | ||
function getFaucetHost(client) { | ||
const connectionUrl = client.url; | ||
if (connectionUrl.includes('altnet') || connectionUrl.includes('testnet')) { | ||
return FaucetNetwork.Testnet; | ||
} | ||
if (connectionUrl.includes('devnet')) { | ||
return FaucetNetwork.Devnet; | ||
} | ||
if (connectionUrl.includes('xls20-sandbox')) { | ||
return FaucetNetwork.NFTDevnet; | ||
} | ||
throw new errors_1.XRPLFaucetError('Faucet URL is not defined or inferrable.'); | ||
} | ||
exports.default = fundWallet; | ||
const _private = { | ||
FaucetNetwork, | ||
getFaucetHost, | ||
}; | ||
exports._private = _private; | ||
//# sourceMappingURL=fundWallet.js.map |
{ | ||
"name": "xrpl", | ||
"version": "2.6.0-beta.0", | ||
"version": "2.6.0", | ||
"license": "ISC", | ||
@@ -31,3 +31,3 @@ "description": "A TypeScript/JavaScript API for interacting with the XRP Ledger in Node.js and the browser", | ||
"ripple-address-codec": "^4.2.4", | ||
"ripple-binary-codec": "^1.5.0-beta.2", | ||
"ripple-binary-codec": "^1.4.2", | ||
"ripple-keypairs": "^1.1.4", | ||
@@ -73,3 +73,3 @@ "ws": "^8.2.2" | ||
}, | ||
"gitHead": "e2c6b9241eca89e4fb4fcb7c00c0e0a13d06ab93" | ||
"gitHead": "e52ca91d77b38e44e482eca689110b0fbe59b52f" | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
1
10093428
564
75796
3
Updatedripple-binary-codec@^1.4.2