@relayprotocol/relay-sdk 8.2.0 → 8.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,6 @@
1
1
  export const routes = [
2
+ "/kyc/sessions",
3
+ "/kyc/status",
2
4
  "/app-fees/{wallet}/balances",
3
5
  "/app-fees/{wallet}/claim",
4
6
  "/app-fees/{wallet}/claims",
@@ -22,15 +24,18 @@ export const routes = [
22
24
  "/intents/status",
23
25
  "/intents/status/v2",
24
26
  "/intents/status/v3",
27
+ "/orders",
28
+ "/orders/{orderId}/signature",
29
+ "/orders/{orderId}/cancel",
25
30
  "/requests/v2",
26
31
  "/requests/v3",
27
32
  "/requests/metadata",
33
+ "/published-requests",
28
34
  "/transactions/index",
29
35
  "/transactions/single",
30
36
  "/transactions/deposit-address/reindex",
31
37
  "/swap-sources",
32
38
  "/loadforge.txt",
33
- "/prices/rates",
34
39
  "/currencies/v1",
35
40
  "/currencies/v2",
36
41
  "/currencies/token/price",
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/routes/index.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,6BAA6B;IAC7B,0BAA0B;IAC1B,2BAA2B;IAC3B,0BAA0B;IAC1B,SAAS;IACT,mBAAmB;IACnB,gBAAgB;IAChB,SAAS;IACT,YAAY;IACZ,uBAAuB;IACvB,uBAAuB;IACvB,kDAAkD;IAClD,iDAAiD;IACjD,kBAAkB;IAClB,QAAQ;IACR,WAAW;IACX,QAAQ;IACR,UAAU;IACV,YAAY;IACZ,QAAQ;IACR,iBAAiB;IACjB,oBAAoB;IACpB,oBAAoB;IACpB,cAAc;IACd,cAAc;IACd,oBAAoB;IACpB,qBAAqB;IACrB,sBAAsB;IACtB,uCAAuC;IACvC,eAAe;IACf,gBAAgB;IAChB,eAAe;IACf,gBAAgB;IAChB,gBAAgB;IAChB,yBAAyB;IACzB,4BAA4B;IAC5B,sBAAsB;IACtB,wCAAwC;IACxC,8CAA8C;IAC9C,6BAA6B;IAC7B,kBAAkB;IAClB,uBAAuB;IACvB,iBAAiB;IACjB,0BAA0B;IAC1B,sBAAsB;IACtB,6BAA6B;IAC7B,sBAAsB;IACtB,qBAAqB;IACrB,uBAAuB;IACvB,gBAAgB;IAChB,gBAAgB;IAChB,2BAA2B;IAC3B,qBAAqB;CACtB,CAAC","sourcesContent":["export const routes = [\n \"/app-fees/{wallet}/balances\",\n \"/app-fees/{wallet}/claim\",\n \"/app-fees/{wallet}/claims\",\n \"/balance/{wallet}/events\",\n \"/chains\",\n \"/chains/liquidity\",\n \"/chains/health\",\n \"/config\",\n \"/config/v2\",\n \"/deposit-addresses/v1\",\n \"/deposit-addresses/v2\",\n \"/deposit-addresses/{depositAddressId}/disable/v2\",\n \"/deposit-addresses/{depositAddressId}/update/v2\",\n \"/execute/permits\",\n \"/quote\",\n \"/quote/v2\",\n \"/price\",\n \"/execute\",\n \"/fast-fill\",\n \"/lives\",\n \"/intents/status\",\n \"/intents/status/v2\",\n \"/intents/status/v3\",\n \"/requests/v2\",\n \"/requests/v3\",\n \"/requests/metadata\",\n \"/transactions/index\",\n \"/transactions/single\",\n \"/transactions/deposit-address/reindex\",\n \"/swap-sources\",\n \"/loadforge.txt\",\n \"/prices/rates\",\n \"/currencies/v1\",\n \"/currencies/v2\",\n \"/currencies/token/price\",\n \"/currencies/token/price/v2\",\n \"/currencies/trending\",\n \"/chains/{chainId}/currencies/{address}\",\n \"/chains/{chainId}/currencies/{address}/chart\",\n \"/currencies/classifications\",\n \"/provision/chain\",\n \"/sanctioned/{address}\",\n \"/wallets/screen\",\n \"/wallets/screen/override\",\n \"/wallets/screen/info\",\n \"/withdrawals/attest-deposit\",\n \"/withdrawals/request\",\n \"/withdrawals/status\",\n \"/withdrawals/balances\",\n \"/access-tokens\",\n \"/metrics/usage\",\n \"/protocol/executions/{id}\",\n \"/protocol/transfers\"\n];"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/routes/index.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,eAAe;IACf,aAAa;IACb,6BAA6B;IAC7B,0BAA0B;IAC1B,2BAA2B;IAC3B,0BAA0B;IAC1B,SAAS;IACT,mBAAmB;IACnB,gBAAgB;IAChB,SAAS;IACT,YAAY;IACZ,uBAAuB;IACvB,uBAAuB;IACvB,kDAAkD;IAClD,iDAAiD;IACjD,kBAAkB;IAClB,QAAQ;IACR,WAAW;IACX,QAAQ;IACR,UAAU;IACV,YAAY;IACZ,QAAQ;IACR,iBAAiB;IACjB,oBAAoB;IACpB,oBAAoB;IACpB,SAAS;IACT,6BAA6B;IAC7B,0BAA0B;IAC1B,cAAc;IACd,cAAc;IACd,oBAAoB;IACpB,qBAAqB;IACrB,qBAAqB;IACrB,sBAAsB;IACtB,uCAAuC;IACvC,eAAe;IACf,gBAAgB;IAChB,gBAAgB;IAChB,gBAAgB;IAChB,yBAAyB;IACzB,4BAA4B;IAC5B,sBAAsB;IACtB,wCAAwC;IACxC,8CAA8C;IAC9C,6BAA6B;IAC7B,kBAAkB;IAClB,uBAAuB;IACvB,iBAAiB;IACjB,0BAA0B;IAC1B,sBAAsB;IACtB,6BAA6B;IAC7B,sBAAsB;IACtB,qBAAqB;IACrB,uBAAuB;IACvB,gBAAgB;IAChB,gBAAgB;IAChB,2BAA2B;IAC3B,qBAAqB;CACtB,CAAC","sourcesContent":["export const routes = [\n \"/kyc/sessions\",\n \"/kyc/status\",\n \"/app-fees/{wallet}/balances\",\n \"/app-fees/{wallet}/claim\",\n \"/app-fees/{wallet}/claims\",\n \"/balance/{wallet}/events\",\n \"/chains\",\n \"/chains/liquidity\",\n \"/chains/health\",\n \"/config\",\n \"/config/v2\",\n \"/deposit-addresses/v1\",\n \"/deposit-addresses/v2\",\n \"/deposit-addresses/{depositAddressId}/disable/v2\",\n \"/deposit-addresses/{depositAddressId}/update/v2\",\n \"/execute/permits\",\n \"/quote\",\n \"/quote/v2\",\n \"/price\",\n \"/execute\",\n \"/fast-fill\",\n \"/lives\",\n \"/intents/status\",\n \"/intents/status/v2\",\n \"/intents/status/v3\",\n \"/orders\",\n \"/orders/{orderId}/signature\",\n \"/orders/{orderId}/cancel\",\n \"/requests/v2\",\n \"/requests/v3\",\n \"/requests/metadata\",\n \"/published-requests\",\n \"/transactions/index\",\n \"/transactions/single\",\n \"/transactions/deposit-address/reindex\",\n \"/swap-sources\",\n \"/loadforge.txt\",\n \"/currencies/v1\",\n \"/currencies/v2\",\n \"/currencies/token/price\",\n \"/currencies/token/price/v2\",\n \"/currencies/trending\",\n \"/chains/{chainId}/currencies/{address}\",\n \"/chains/{chainId}/currencies/{address}/chart\",\n \"/currencies/classifications\",\n \"/provision/chain\",\n \"/sanctioned/{address}\",\n \"/wallets/screen\",\n \"/wallets/screen/override\",\n \"/wallets/screen/info\",\n \"/withdrawals/attest-deposit\",\n \"/withdrawals/request\",\n \"/withdrawals/status\",\n \"/withdrawals/balances\",\n \"/access-tokens\",\n \"/metrics/usage\",\n \"/protocol/executions/{id}\",\n \"/protocol/transfers\"\n];"]}
@@ -1 +1 @@
1
- {"version":3,"file":"Order.js","sourceRoot":"","sources":["../../../src/types/Order.ts"],"names":[],"mappings":"","sourcesContent":["export type OrderStatus =\n | 'pending'\n | 'open'\n | 'processing'\n | 'requires_action'\n | 'closed'\n\nexport type OrderOutcome = 'filled' | 'cancelled' | 'expired'\n\nexport type OrderCancelReason = 'requested' | 'access_revoked'\n\nexport type OrderRequiredAction = 'compliance_review' | 'manual_refund'\n\nexport type OrderStepId = 'approve' | 'authorize' | 'cancel' | 'withdraw'\n\nexport type OrderCheckReason =\n | 'price_not_reached'\n | 'no_route'\n | 'insufficient_balance'\n | 'insufficient_allowance'\n\nexport type OrderCreateErrorCode =\n | 'INVALID_REQUEST_PARAMS'\n | 'INVALID_ADDRESS'\n | 'UNSUPPORTED_CURRENCY'\n | 'UNSUPPORTED_ROUTE'\n | 'AMOUNT_TOO_LOW'\n | 'NO_QUOTES'\n | 'INSUFFICIENT_FUNDS'\n | 'MAX_OPEN_ORDERS_REACHED'\n | 'MAX_OPEN_ORDER_PAIRS_REACHED'\n | 'IDEMPOTENCY_KEY_REUSED'\n | 'CLIENT_ORDER_ID_EXISTS'\n | 'UNAUTHORIZED'\n | 'FORBIDDEN'\n | 'UNKNOWN_ERROR'\n\nexport type OrderSponsoredFeeComponent =\n | 'execution'\n | 'swap'\n | 'relay'\n | 'app'\n | 'rent'\n\nexport type OrderAppFee = { recipient: string; fee: string }\n\n/**\n * Body of `POST /orders`.\n * @property targetPrice - USD per unit of targetCurrency, all-in. Sell: minimum net proceeds per unit. Buy: maximum total cost per unit\n * @property amount - Base units of the currency spent: targetCurrency for a sell, settlementCurrency for a buy\n * @property expiresAt - RFC 3339 time, at least 15 minutes and at most 7 days from now\n * @property clientOrderId - The integrator's own id for the order; each id can be used once\n */\nexport type CreateOrderBody = {\n type: 'limit'\n user: string\n recipient?: string\n refundTo?: string\n side: 'buy' | 'sell'\n targetCurrency: string\n targetChainId: number\n settlementCurrency: string\n settlementChainId: number\n targetPrice: string\n amount: string\n expiresAt: string\n appFees?: OrderAppFee[]\n subsidizeFees?: boolean\n sponsoredFeeComponents?: OrderSponsoredFeeComponent[]\n maxSubsidizationAmount?: string\n subsidizationBps?: number\n clientOrderId?: string\n}\n\nexport type OrderStep = {\n id: OrderStepId\n action: string\n description: string\n kind: 'transaction' | 'signature'\n status: 'incomplete' | 'complete'\n data: any\n check?: { endpoint: string; method: 'GET' | 'POST' }\n}\n\nexport type OrderPriceCheck = {\n marketPrice: string | null\n allInPrice: string | null\n reason: OrderCheckReason | null\n checkedAt: string\n}\n\n/**\n * An order as the Orders API returns it.\n * @property outcome - How a closed order ended; null until it closes. A `cancelled` or `expired` order whose funds were already pulled shows the amount sent back in `refundedAmount`\n * @property cancellationReason - Who cancelled the order; null unless the outcome is `cancelled`\n * @property requiredAction - What Relay has to do before the order can continue; null unless the status is `requires_action`\n */\nexport type Order = Omit<\n CreateOrderBody,\n 'recipient' | 'refundTo' | 'clientOrderId'\n> & {\n id: string\n clientOrderId: string | null\n orderHash: string\n status: OrderStatus\n outcome: OrderOutcome | null\n cancellationReason: OrderCancelReason | null\n requiredAction: OrderRequiredAction | null\n recipient: string\n refundTo: string\n originChainId: number\n originCurrency: string\n destinationChainId: number\n destinationCurrency: string\n fees: Record<string, unknown>\n createdAt: string\n updatedAt: string\n expiresAt: string\n closedAt: string | null\n requestIds: string[]\n filledAmount: string\n refundedAmount: string\n withdrawnAmount: string\n steps: OrderStep[]\n latestCheck: OrderPriceCheck | null\n}\n\n/**\n * Query of `GET /orders`.\n * @property status - Only orders in these statuses\n * @property startTimestamp - Unix seconds; filters on the sortBy field\n * @property endTimestamp - Unix seconds; filters on the sortBy field\n */\nexport type GetOrdersQuery = {\n orderId?: string\n appId?: string\n user?: string\n status?: OrderStatus[]\n originChainId?: number\n destinationChainId?: number\n limit?: number\n continuation?: string\n startTimestamp?: number\n endTimestamp?: number\n sortBy?: 'createdAt' | 'updatedAt'\n sortDirection?: 'asc' | 'desc'\n}\n\nexport type GetOrdersResponse = { orders: Order[]; continuation?: string }\n"]}
1
+ {"version":3,"file":"Order.js","sourceRoot":"","sources":["../../../src/types/Order.ts"],"names":[],"mappings":"","sourcesContent":["import type { paths } from './api.js'\n\ntype OrdersRoute = paths['/orders']\ntype ListOrdersResponse =\n OrdersRoute['get']['responses']['200']['content']['application/json']\ntype ApiOrder = ListOrdersResponse['orders'][number]\ntype ApiOrderStep = NonNullable<ApiOrder['steps']>[number]\ntype ApiPriceCheck = NonNullable<ApiOrder['latestPriceCheck']>\n\n/** Body of `POST /orders`. */\nexport type CreateOrderBody =\n OrdersRoute['post']['requestBody']['content']['application/json']\n\nexport type OrderStatus = NonNullable<ApiOrder['status']>\n\nexport type OrderOutcome = NonNullable<ApiOrder['outcome']>\n\nexport type OrderCancelReason = NonNullable<ApiOrder['cancellationReason']>\n\nexport type OrderRequiredAction = NonNullable<ApiOrder['requiredAction']>\n\nexport type OrderStepId = NonNullable<ApiOrderStep['id']>\n\nexport type OrderCheckReason = NonNullable<ApiPriceCheck['reason']>\n\nexport type OrderCreateErrorCode = NonNullable<\n OrdersRoute['post']['responses']['400']['content']['application/json']['errorCode']\n>\n\nexport type OrderSponsoredFeeComponent = NonNullable<\n CreateOrderBody['sponsoredFeeComponents']\n>[number]\n\nexport type OrderAppFee = NonNullable<CreateOrderBody['appFees']>[number]\n\nexport type OrderStep = Required<Omit<ApiOrderStep, 'data' | 'check'>> & {\n data: any\n check?: { endpoint: string; method: 'GET' | 'POST' }\n}\n\nexport type OrderPriceCheck = Required<ApiPriceCheck>\n\ntype OptionalOrderField =\n | 'appFees'\n | 'subsidizeFees'\n | 'sponsoredFeeComponents'\n | 'maxSubsidizationAmount'\n | 'subsidizationBps'\n\n/**\n * An order as the Orders API returns it.\n * @property latestPriceCheck - Its `reason` is the first of `insufficient_balance`, `insufficient_allowance`, `no_route` and `price_not_reached` that stopped a fill, or null when nothing did\n */\nexport type Order = Required<\n Omit<\n ApiOrder,\n OptionalOrderField | 'steps' | 'latestPriceCheck' | 'closestPriceCheck'\n >\n> &\n Pick<CreateOrderBody, OptionalOrderField> & {\n steps: OrderStep[]\n latestPriceCheck: OrderPriceCheck | null\n closestPriceCheck: OrderPriceCheck | null\n }\n\n/** Query of `GET /orders`, with `status` as a list instead of a comma-separated string. */\nexport type GetOrdersQuery = Omit<\n NonNullable<OrdersRoute['get']['parameters']['query']>,\n 'status'\n> & { status?: OrderStatus[] }\n\nexport type GetOrdersResponse = Omit<ListOrdersResponse, 'orders'> & {\n orders: Order[]\n}\n"]}
@@ -1,6 +1,2 @@
1
- /**
2
- * This file was auto-generated by openapi-typescript.
3
- * Do not make direct changes to the file.
4
- */
5
1
  export {};
6
2
  //# sourceMappingURL=api.js.map