@0xsequence/api
Advanced tools
Comparing version 0.0.0-20241114193556 to 0.0.0-20241216114019
@@ -6,15 +6,20 @@ 'use strict'; | ||
function _extends() { | ||
return _extends = Object.assign ? Object.assign.bind() : function (n) { | ||
for (var e = 1; e < arguments.length; e++) { | ||
var t = arguments[e]; | ||
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); | ||
_extends = Object.assign ? Object.assign.bind() : function (target) { | ||
for (var i = 1; i < arguments.length; i++) { | ||
var source = arguments[i]; | ||
for (var key in source) { | ||
if (Object.prototype.hasOwnProperty.call(source, key)) { | ||
target[key] = source[key]; | ||
} | ||
} | ||
} | ||
return n; | ||
}, _extends.apply(null, arguments); | ||
return target; | ||
}; | ||
return _extends.apply(this, arguments); | ||
} | ||
/* eslint-disable */ | ||
// sequence-api v0.4.0 470a0f88ea399c2a57ff8c22da54358c033ed5f0 | ||
// sequence-api v0.4.0 bbe47e0331a18438fe5f7fe590a4b7b4e5102738 | ||
// -- | ||
// Code generated by webrpc-gen@v0.18.7 with typescript generator. DO NOT EDIT. | ||
// Code generated by webrpc-gen@v0.20.3 with typescript generator. DO NOT EDIT. | ||
// | ||
@@ -30,3 +35,3 @@ // webrpc-gen -schema=api.ridl -target=typescript -client -out=./clients/api.gen.ts | ||
// Schema hash generated from your RIDL schema | ||
const WebRPCSchemaHash = '470a0f88ea399c2a57ff8c22da54358c033ed5f0'; | ||
const WebRPCSchemaHash = 'bbe47e0331a18438fe5f7fe590a4b7b4e5102738'; | ||
@@ -180,2 +185,28 @@ // | ||
}; | ||
this.registerPublicKey = (args, headers, signal) => { | ||
return this.fetch(this.url('RegisterPublicKey'), createHTTPRequest(args, headers, signal)).then(res => { | ||
return buildResponse(res).then(_data => { | ||
return { | ||
status: _data.status | ||
}; | ||
}); | ||
}, error => { | ||
throw WebrpcRequestFailedError.new({ | ||
cause: `fetch(): ${error.message || ''}` | ||
}); | ||
}); | ||
}; | ||
this.getPublicKey = (args, headers, signal) => { | ||
return this.fetch(this.url('GetPublicKey'), createHTTPRequest(args, headers, signal)).then(res => { | ||
return buildResponse(res).then(_data => { | ||
return { | ||
publicKey: _data.publicKey | ||
}; | ||
}); | ||
}, error => { | ||
throw WebrpcRequestFailedError.new({ | ||
cause: `fetch(): ${error.message || ''}` | ||
}); | ||
}); | ||
}; | ||
this.friendList = (args, headers, signal) => { | ||
@@ -785,2 +816,15 @@ return this.fetch(this.url('FriendList'), createHTTPRequest(args, headers, signal)).then(res => { | ||
}; | ||
this.getSwapPrice = (args, headers, signal) => { | ||
return this.fetch(this.url('GetSwapPrice'), createHTTPRequest(args, headers, signal)).then(res => { | ||
return buildResponse(res).then(_data => { | ||
return { | ||
swapPrice: _data.swapPrice | ||
}; | ||
}); | ||
}, error => { | ||
throw WebrpcRequestFailedError.new({ | ||
cause: `fetch(): ${error.message || ''}` | ||
}); | ||
}); | ||
}; | ||
this.getSwapPrices = (args, headers, signal) => { | ||
@@ -915,3 +959,3 @@ return this.fetch(this.url('GetSwapPrices'), createHTTPRequest(args, headers, signal)).then(res => { | ||
}; | ||
this.hostname = hostname; | ||
this.hostname = hostname.replace(/\/*$/, ''); | ||
this.fetch = (input, init) => fetch(input, init); | ||
@@ -1154,3 +1198,2 @@ } | ||
const fetch = globalThis.fetch; | ||
class SequenceAPIClient extends API { | ||
@@ -1157,0 +1200,0 @@ constructor(hostname, projectAccessKey, jwtAuth) { |
@@ -6,15 +6,20 @@ 'use strict'; | ||
function _extends() { | ||
return _extends = Object.assign ? Object.assign.bind() : function (n) { | ||
for (var e = 1; e < arguments.length; e++) { | ||
var t = arguments[e]; | ||
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); | ||
_extends = Object.assign ? Object.assign.bind() : function (target) { | ||
for (var i = 1; i < arguments.length; i++) { | ||
var source = arguments[i]; | ||
for (var key in source) { | ||
if (Object.prototype.hasOwnProperty.call(source, key)) { | ||
target[key] = source[key]; | ||
} | ||
} | ||
} | ||
return n; | ||
}, _extends.apply(null, arguments); | ||
return target; | ||
}; | ||
return _extends.apply(this, arguments); | ||
} | ||
/* eslint-disable */ | ||
// sequence-api v0.4.0 470a0f88ea399c2a57ff8c22da54358c033ed5f0 | ||
// sequence-api v0.4.0 bbe47e0331a18438fe5f7fe590a4b7b4e5102738 | ||
// -- | ||
// Code generated by webrpc-gen@v0.18.7 with typescript generator. DO NOT EDIT. | ||
// Code generated by webrpc-gen@v0.20.3 with typescript generator. DO NOT EDIT. | ||
// | ||
@@ -30,3 +35,3 @@ // webrpc-gen -schema=api.ridl -target=typescript -client -out=./clients/api.gen.ts | ||
// Schema hash generated from your RIDL schema | ||
const WebRPCSchemaHash = '470a0f88ea399c2a57ff8c22da54358c033ed5f0'; | ||
const WebRPCSchemaHash = 'bbe47e0331a18438fe5f7fe590a4b7b4e5102738'; | ||
@@ -180,2 +185,28 @@ // | ||
}; | ||
this.registerPublicKey = (args, headers, signal) => { | ||
return this.fetch(this.url('RegisterPublicKey'), createHTTPRequest(args, headers, signal)).then(res => { | ||
return buildResponse(res).then(_data => { | ||
return { | ||
status: _data.status | ||
}; | ||
}); | ||
}, error => { | ||
throw WebrpcRequestFailedError.new({ | ||
cause: `fetch(): ${error.message || ''}` | ||
}); | ||
}); | ||
}; | ||
this.getPublicKey = (args, headers, signal) => { | ||
return this.fetch(this.url('GetPublicKey'), createHTTPRequest(args, headers, signal)).then(res => { | ||
return buildResponse(res).then(_data => { | ||
return { | ||
publicKey: _data.publicKey | ||
}; | ||
}); | ||
}, error => { | ||
throw WebrpcRequestFailedError.new({ | ||
cause: `fetch(): ${error.message || ''}` | ||
}); | ||
}); | ||
}; | ||
this.friendList = (args, headers, signal) => { | ||
@@ -785,2 +816,15 @@ return this.fetch(this.url('FriendList'), createHTTPRequest(args, headers, signal)).then(res => { | ||
}; | ||
this.getSwapPrice = (args, headers, signal) => { | ||
return this.fetch(this.url('GetSwapPrice'), createHTTPRequest(args, headers, signal)).then(res => { | ||
return buildResponse(res).then(_data => { | ||
return { | ||
swapPrice: _data.swapPrice | ||
}; | ||
}); | ||
}, error => { | ||
throw WebrpcRequestFailedError.new({ | ||
cause: `fetch(): ${error.message || ''}` | ||
}); | ||
}); | ||
}; | ||
this.getSwapPrices = (args, headers, signal) => { | ||
@@ -915,3 +959,3 @@ return this.fetch(this.url('GetSwapPrices'), createHTTPRequest(args, headers, signal)).then(res => { | ||
}; | ||
this.hostname = hostname; | ||
this.hostname = hostname.replace(/\/*$/, ''); | ||
this.fetch = (input, init) => fetch(input, init); | ||
@@ -1154,3 +1198,2 @@ } | ||
const fetch = globalThis.fetch; | ||
class SequenceAPIClient extends API { | ||
@@ -1157,0 +1200,0 @@ constructor(hostname, projectAccessKey, jwtAuth) { |
function _extends() { | ||
return _extends = Object.assign ? Object.assign.bind() : function (n) { | ||
for (var e = 1; e < arguments.length; e++) { | ||
var t = arguments[e]; | ||
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); | ||
_extends = Object.assign ? Object.assign.bind() : function (target) { | ||
for (var i = 1; i < arguments.length; i++) { | ||
var source = arguments[i]; | ||
for (var key in source) { | ||
if (Object.prototype.hasOwnProperty.call(source, key)) { | ||
target[key] = source[key]; | ||
} | ||
} | ||
} | ||
return n; | ||
}, _extends.apply(null, arguments); | ||
return target; | ||
}; | ||
return _extends.apply(this, arguments); | ||
} | ||
/* eslint-disable */ | ||
// sequence-api v0.4.0 470a0f88ea399c2a57ff8c22da54358c033ed5f0 | ||
// sequence-api v0.4.0 bbe47e0331a18438fe5f7fe590a4b7b4e5102738 | ||
// -- | ||
// Code generated by webrpc-gen@v0.18.7 with typescript generator. DO NOT EDIT. | ||
// Code generated by webrpc-gen@v0.20.3 with typescript generator. DO NOT EDIT. | ||
// | ||
@@ -25,3 +30,3 @@ // webrpc-gen -schema=api.ridl -target=typescript -client -out=./clients/api.gen.ts | ||
// Schema hash generated from your RIDL schema | ||
const WebRPCSchemaHash = '470a0f88ea399c2a57ff8c22da54358c033ed5f0'; | ||
const WebRPCSchemaHash = 'bbe47e0331a18438fe5f7fe590a4b7b4e5102738'; | ||
@@ -175,2 +180,28 @@ // | ||
}; | ||
this.registerPublicKey = (args, headers, signal) => { | ||
return this.fetch(this.url('RegisterPublicKey'), createHTTPRequest(args, headers, signal)).then(res => { | ||
return buildResponse(res).then(_data => { | ||
return { | ||
status: _data.status | ||
}; | ||
}); | ||
}, error => { | ||
throw WebrpcRequestFailedError.new({ | ||
cause: `fetch(): ${error.message || ''}` | ||
}); | ||
}); | ||
}; | ||
this.getPublicKey = (args, headers, signal) => { | ||
return this.fetch(this.url('GetPublicKey'), createHTTPRequest(args, headers, signal)).then(res => { | ||
return buildResponse(res).then(_data => { | ||
return { | ||
publicKey: _data.publicKey | ||
}; | ||
}); | ||
}, error => { | ||
throw WebrpcRequestFailedError.new({ | ||
cause: `fetch(): ${error.message || ''}` | ||
}); | ||
}); | ||
}; | ||
this.friendList = (args, headers, signal) => { | ||
@@ -780,2 +811,15 @@ return this.fetch(this.url('FriendList'), createHTTPRequest(args, headers, signal)).then(res => { | ||
}; | ||
this.getSwapPrice = (args, headers, signal) => { | ||
return this.fetch(this.url('GetSwapPrice'), createHTTPRequest(args, headers, signal)).then(res => { | ||
return buildResponse(res).then(_data => { | ||
return { | ||
swapPrice: _data.swapPrice | ||
}; | ||
}); | ||
}, error => { | ||
throw WebrpcRequestFailedError.new({ | ||
cause: `fetch(): ${error.message || ''}` | ||
}); | ||
}); | ||
}; | ||
this.getSwapPrices = (args, headers, signal) => { | ||
@@ -910,3 +954,3 @@ return this.fetch(this.url('GetSwapPrices'), createHTTPRequest(args, headers, signal)).then(res => { | ||
}; | ||
this.hostname = hostname; | ||
this.hostname = hostname.replace(/\/*$/, ''); | ||
this.fetch = (input, init) => fetch(input, init); | ||
@@ -1149,3 +1193,2 @@ } | ||
const fetch = globalThis.fetch; | ||
class SequenceAPIClient extends API { | ||
@@ -1152,0 +1195,0 @@ constructor(hostname, projectAccessKey, jwtAuth) { |
export declare const WebRPCVersion = "v1"; | ||
export declare const WebRPCSchemaVersion = "v0.4.0"; | ||
export declare const WebRPCSchemaHash = "470a0f88ea399c2a57ff8c22da54358c033ed5f0"; | ||
export declare const WebRPCSchemaHash = "bbe47e0331a18438fe5f7fe590a4b7b4e5102738"; | ||
export declare enum SortOrder { | ||
@@ -58,2 +58,7 @@ DESC = "DESC", | ||
} | ||
export interface PublicKey { | ||
id: string; | ||
x: string; | ||
y: string; | ||
} | ||
export interface User { | ||
@@ -314,3 +319,3 @@ address: string; | ||
price: string; | ||
to: string; | ||
maxPrice: string; | ||
transactionValue: string; | ||
@@ -387,2 +392,4 @@ } | ||
sendPasswordlessLink(args: SendPasswordlessLinkArgs, headers?: object, signal?: AbortSignal): Promise<SendPasswordlessLinkReturn>; | ||
registerPublicKey(args: RegisterPublicKeyArgs, headers?: object, signal?: AbortSignal): Promise<RegisterPublicKeyReturn>; | ||
getPublicKey(args: GetPublicKeyArgs, headers?: object, signal?: AbortSignal): Promise<GetPublicKeyReturn>; | ||
friendList(args: FriendListArgs, headers?: object, signal?: AbortSignal): Promise<FriendListReturn>; | ||
@@ -434,2 +441,3 @@ getFriendByAddress(args: GetFriendByAddressArgs, headers?: object, signal?: AbortSignal): Promise<GetFriendByAddressReturn>; | ||
validateWaaSVerificationNonce(args: ValidateWaaSVerificationNonceArgs, headers?: object, signal?: AbortSignal): Promise<ValidateWaaSVerificationNonceReturn>; | ||
getSwapPrice(args: GetSwapPriceArgs, headers?: object, signal?: AbortSignal): Promise<GetSwapPriceReturn>; | ||
getSwapPrices(args: GetSwapPricesArgs, headers?: object, signal?: AbortSignal): Promise<GetSwapPricesReturn>; | ||
@@ -499,2 +507,14 @@ getSwapQuote(args: GetSwapQuoteArgs, headers?: object, signal?: AbortSignal): Promise<GetSwapQuoteReturn>; | ||
} | ||
export interface RegisterPublicKeyArgs { | ||
publicKey: PublicKey; | ||
} | ||
export interface RegisterPublicKeyReturn { | ||
status: boolean; | ||
} | ||
export interface GetPublicKeyArgs { | ||
id: string; | ||
} | ||
export interface GetPublicKeyReturn { | ||
publicKey: PublicKey; | ||
} | ||
export interface FriendListArgs { | ||
@@ -802,4 +822,2 @@ nickname?: string; | ||
linkedWalletAddress: string; | ||
linkedWalletMessage: string; | ||
linkedWalletSignature: string; | ||
signatureChainId: string; | ||
@@ -826,2 +844,12 @@ } | ||
} | ||
export interface GetSwapPriceArgs { | ||
buyCurrencyAddress: string; | ||
sellCurrencyAddress: string; | ||
buyAmount: string; | ||
chainId: number; | ||
slippagePercentage?: number; | ||
} | ||
export interface GetSwapPriceReturn { | ||
swapPrice: SwapPrice; | ||
} | ||
export interface GetSwapPricesArgs { | ||
@@ -832,2 +860,3 @@ userAddress: string; | ||
chainId: number; | ||
slippagePercentage?: number; | ||
} | ||
@@ -844,2 +873,3 @@ export interface GetSwapPricesReturn { | ||
includeApprove: boolean; | ||
slippagePercentage?: number; | ||
} | ||
@@ -914,2 +944,4 @@ export interface GetSwapQuoteReturn { | ||
sendPasswordlessLink: (args: SendPasswordlessLinkArgs, headers?: object, signal?: AbortSignal) => Promise<SendPasswordlessLinkReturn>; | ||
registerPublicKey: (args: RegisterPublicKeyArgs, headers?: object, signal?: AbortSignal) => Promise<RegisterPublicKeyReturn>; | ||
getPublicKey: (args: GetPublicKeyArgs, headers?: object, signal?: AbortSignal) => Promise<GetPublicKeyReturn>; | ||
friendList: (args: FriendListArgs, headers?: object, signal?: AbortSignal) => Promise<FriendListReturn>; | ||
@@ -961,2 +993,3 @@ getFriendByAddress: (args: GetFriendByAddressArgs, headers?: object, signal?: AbortSignal) => Promise<GetFriendByAddressReturn>; | ||
validateWaaSVerificationNonce: (args: ValidateWaaSVerificationNonceArgs, headers?: object, signal?: AbortSignal) => Promise<ValidateWaaSVerificationNonceReturn>; | ||
getSwapPrice: (args: GetSwapPriceArgs, headers?: object, signal?: AbortSignal) => Promise<GetSwapPriceReturn>; | ||
getSwapPrices: (args: GetSwapPricesArgs, headers?: object, signal?: AbortSignal) => Promise<GetSwapPricesReturn>; | ||
@@ -963,0 +996,0 @@ getSwapQuote: (args: GetSwapQuoteArgs, headers?: object, signal?: AbortSignal) => Promise<GetSwapQuoteReturn>; |
{ | ||
"name": "@0xsequence/api", | ||
"version": "0.0.0-20241114193556", | ||
"version": "0.0.0-20241216114019", | ||
"description": "api sub-package for Sequence", | ||
@@ -5,0 +5,0 @@ "repository": "https://github.com/0xsequence/sequence.js/tree/master/packages/api", |
@@ -5,4 +5,2 @@ export * from './api.gen' | ||
const fetch = globalThis.fetch | ||
export class SequenceAPIClient extends ApiRpc { | ||
@@ -9,0 +7,0 @@ constructor( |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
258954
7208