Skip to main content

Reference

Interfaces, signatures, parameters, and generated references.

Lookup friendly
TOC available

Overview

This reference is generated from the SDK core source. Some symbol breadcrumbs and source links still reflect the upstream generator format, but the package to install for Ring integrations is @ring-protocol/sdk-core.

Table of contents

Enumerations

Classes

Type Aliases

Variables

Functions

Type Aliases

BigintIsh

Ƭ BigintIsh: JSBI | string | number

Defined in

constants.ts:24


Currency

Ƭ Currency: NativeCurrency | Token

Defined in

entities/currency.ts:4

Variables

MaxUint256

Const MaxUint256: default

Defined in

constants.ts:37


WETH9

Const WETH9: Object

Known WETH9 implementation addresses, used in our implementation of Ether#wrapped

Index signature

▪ [chainId: number]: Token

Defined in

entities/weth9.ts:6

Functions

computePriceImpact

computePriceImpact<TBase, TQuote>(midPrice, inputAmount, outputAmount): Percent

Returns the percent difference between the mid price and the execution price, i.e. price impact.

Type parameters

NameType
TBaseextends Currency
TQuoteextends Currency

Parameters

NameTypeDescription
midPricePrice<TBase, TQuote>mid price before the trade
inputAmountCurrencyAmount<TBase>the input amount of the trade
outputAmountCurrencyAmount<TQuote>the output amount of the trade

Returns

Percent

Defined in

utils/computePriceImpact.ts:9


sortedInsert

sortedInsert<T>(items, add, maxSize, comparator): T | null

Type parameters

Name
T

Parameters

NameType
itemsT[]
addT
maxSizenumber
comparator(a: T, b: T) => number

Returns

T | null

Defined in

utils/sortedInsert.ts:5


sqrt

sqrt(value): JSBI

Computes floor(sqrt(value))

Parameters

NameTypeDescription
valuedefaultthe value for which to compute the square root, rounded down

Returns

JSBI

Defined in

utils/sqrt.ts:14


validateAndParseAddress

validateAndParseAddress(address): string

Validates an address and returns the parsed (checksummed) version of that address

Parameters

NameTypeDescription
addressstringthe unchecksummed hex address

Returns

string

Defined in

utils/validateAndParseAddress.ts:7