@chainflip/sdk 0.2.20 → 0.2.21
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.
- package/dist/contracts-rsXvYw7v.d.mts +41 -0
- package/dist/funding.d.mts +1 -1
- package/dist/swap.d.mts +3 -2
- package/dist/swap.d.ts +1 -0
- package/dist/swap.js +11 -11
- package/dist/swap.mjs +11 -11
- package/package.json +3 -3
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
type ArrayToMap<T extends readonly string[]> = {
|
|
2
|
+
[K in T[number]]: K;
|
|
3
|
+
};
|
|
4
|
+
declare const Chains: ArrayToMap<readonly ["Bitcoin", "Ethereum", "Polkadot"]>;
|
|
5
|
+
type Chain = (typeof Chains)[keyof typeof Chains];
|
|
6
|
+
declare const Assets: ArrayToMap<readonly ["FLIP", "USDC", "DOT", "ETH", "BTC"]>;
|
|
7
|
+
type Asset = (typeof Assets)[keyof typeof Assets];
|
|
8
|
+
declare const ChainflipNetworks: ArrayToMap<readonly ["backspin", "sisyphos", "perseverance", "mainnet"]>;
|
|
9
|
+
type ChainflipNetwork = (typeof ChainflipNetworks)[keyof typeof ChainflipNetworks];
|
|
10
|
+
declare const assetChains: {
|
|
11
|
+
ETH: "Ethereum";
|
|
12
|
+
FLIP: "Ethereum";
|
|
13
|
+
USDC: "Ethereum";
|
|
14
|
+
BTC: "Bitcoin";
|
|
15
|
+
DOT: "Polkadot";
|
|
16
|
+
};
|
|
17
|
+
declare const assetDecimals: {
|
|
18
|
+
DOT: number;
|
|
19
|
+
ETH: number;
|
|
20
|
+
FLIP: number;
|
|
21
|
+
USDC: number;
|
|
22
|
+
BTC: number;
|
|
23
|
+
};
|
|
24
|
+
declare const assetContractIds: Record<Asset, number>;
|
|
25
|
+
declare const chainAssets: {
|
|
26
|
+
Ethereum: ("FLIP" | "USDC" | "ETH")[];
|
|
27
|
+
Bitcoin: "BTC"[];
|
|
28
|
+
Polkadot: "DOT"[];
|
|
29
|
+
};
|
|
30
|
+
declare const chainContractIds: Record<Chain, number>;
|
|
31
|
+
|
|
32
|
+
type TransactionOptions = {
|
|
33
|
+
gasLimit?: bigint;
|
|
34
|
+
gasPrice?: bigint;
|
|
35
|
+
maxFeePerGas?: bigint;
|
|
36
|
+
maxPriorityFeePerGas?: bigint;
|
|
37
|
+
nonce?: number;
|
|
38
|
+
wait?: number;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export { type Asset as A, type Chain as C, type TransactionOptions as T, type ChainflipNetwork as a, Chains as b, chainAssets as c, Assets as d, ChainflipNetworks as e, assetChains as f, assetDecimals as g, assetContractIds as h, chainContractIds as i };
|
package/dist/funding.d.mts
CHANGED
package/dist/swap.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Signer } from 'ethers';
|
|
2
|
-
import { A as Asset, C as Chain, c as chainAssets, a as ChainflipNetwork, T as TransactionOptions } from './contracts-rsXvYw7v.
|
|
3
|
-
export { d as Assets, e as ChainflipNetworks, b as Chains, f as assetChains, h as assetContractIds, g as assetDecimals, i as chainContractIds } from './contracts-rsXvYw7v.
|
|
2
|
+
import { A as Asset, C as Chain, c as chainAssets, a as ChainflipNetwork, T as TransactionOptions } from './contracts-rsXvYw7v.mjs';
|
|
3
|
+
export { d as Assets, e as ChainflipNetworks, b as Chains, f as assetChains, h as assetContractIds, g as assetDecimals, i as chainContractIds } from './contracts-rsXvYw7v.mjs';
|
|
4
4
|
import { z } from 'zod';
|
|
5
5
|
|
|
6
6
|
declare const tokenSwapParamsSchema: z.ZodUnion<[z.ZodObject<{
|
|
@@ -429,6 +429,7 @@ interface CommonStatusFields extends ChainsAndAssets {
|
|
|
429
429
|
depositChannelExpiryBlock: bigint;
|
|
430
430
|
estimatedDepositChannelExpiryTime: number | undefined;
|
|
431
431
|
isDepositChanneExpired: boolean;
|
|
432
|
+
depositChannelOpenedThroughBackend: boolean;
|
|
432
433
|
ccmDepositReceivedBlockIndex: string | undefined;
|
|
433
434
|
ccmMetadata: {
|
|
434
435
|
gasBudget: string;
|
package/dist/swap.d.ts
CHANGED
|
@@ -429,6 +429,7 @@ interface CommonStatusFields extends ChainsAndAssets {
|
|
|
429
429
|
depositChannelExpiryBlock: bigint;
|
|
430
430
|
estimatedDepositChannelExpiryTime: number | undefined;
|
|
431
431
|
isDepositChanneExpired: boolean;
|
|
432
|
+
depositChannelOpenedThroughBackend: boolean;
|
|
432
433
|
ccmDepositReceivedBlockIndex: string | undefined;
|
|
433
434
|
ccmMetadata: {
|
|
434
435
|
gasBudget: string;
|
package/dist/swap.js
CHANGED
|
@@ -4478,7 +4478,7 @@ var init_broker = __esm({
|
|
|
4478
4478
|
}
|
|
4479
4479
|
});
|
|
4480
4480
|
|
|
4481
|
-
// ../../node_modules/.pnpm/@trpc+server@10.
|
|
4481
|
+
// ../../node_modules/.pnpm/@trpc+server@10.44.1/node_modules/@trpc/server/dist/observable-ade1bad8.mjs
|
|
4482
4482
|
function identity(x) {
|
|
4483
4483
|
return x;
|
|
4484
4484
|
}
|
|
@@ -4557,7 +4557,7 @@ function observable(subscribe) {
|
|
|
4557
4557
|
}
|
|
4558
4558
|
__name(observable, "observable");
|
|
4559
4559
|
|
|
4560
|
-
// ../../node_modules/.pnpm/@trpc+server@10.
|
|
4560
|
+
// ../../node_modules/.pnpm/@trpc+server@10.44.1/node_modules/@trpc/server/dist/observable/index.mjs
|
|
4561
4561
|
function share(_opts) {
|
|
4562
4562
|
return (originalObserver) => {
|
|
4563
4563
|
let refCount = 0;
|
|
@@ -4662,7 +4662,7 @@ function observableToPromise(observable2) {
|
|
|
4662
4662
|
}
|
|
4663
4663
|
__name(observableToPromise, "observableToPromise");
|
|
4664
4664
|
|
|
4665
|
-
// ../../node_modules/.pnpm/@trpc+client@10.
|
|
4665
|
+
// ../../node_modules/.pnpm/@trpc+client@10.44.1_@trpc+server@10.44.1/node_modules/@trpc/client/dist/splitLink-4c75f7be.mjs
|
|
4666
4666
|
function createChain(opts) {
|
|
4667
4667
|
return observable((observer) => {
|
|
4668
4668
|
function execute(index = 0, op = opts.op) {
|
|
@@ -4686,7 +4686,7 @@ function createChain(opts) {
|
|
|
4686
4686
|
}
|
|
4687
4687
|
__name(createChain, "createChain");
|
|
4688
4688
|
|
|
4689
|
-
// ../../node_modules/.pnpm/@trpc+client@10.
|
|
4689
|
+
// ../../node_modules/.pnpm/@trpc+client@10.44.1_@trpc+server@10.44.1/node_modules/@trpc/client/dist/transformResult-ace864b8.mjs
|
|
4690
4690
|
function isObject(value) {
|
|
4691
4691
|
return !!value && !Array.isArray(value) && typeof value === "object";
|
|
4692
4692
|
}
|
|
@@ -4739,7 +4739,7 @@ function transformResult(response, runtime) {
|
|
|
4739
4739
|
}
|
|
4740
4740
|
__name(transformResult, "transformResult");
|
|
4741
4741
|
|
|
4742
|
-
// ../../node_modules/.pnpm/@trpc+client@10.
|
|
4742
|
+
// ../../node_modules/.pnpm/@trpc+client@10.44.1_@trpc+server@10.44.1/node_modules/@trpc/client/dist/TRPCClientError-0de4d231.mjs
|
|
4743
4743
|
function isTRPCClientError(cause) {
|
|
4744
4744
|
return cause instanceof TRPCClientError || /**
|
|
4745
4745
|
* @deprecated
|
|
@@ -4797,7 +4797,7 @@ var _TRPCClientError = class _TRPCClientError extends Error {
|
|
|
4797
4797
|
__name(_TRPCClientError, "TRPCClientError");
|
|
4798
4798
|
var TRPCClientError = _TRPCClientError;
|
|
4799
4799
|
|
|
4800
|
-
// ../../node_modules/.pnpm/@trpc+server@10.
|
|
4800
|
+
// ../../node_modules/.pnpm/@trpc+server@10.44.1/node_modules/@trpc/server/dist/codes-c924c3db.mjs
|
|
4801
4801
|
function invert(obj) {
|
|
4802
4802
|
const newObj = /* @__PURE__ */ Object.create(null);
|
|
4803
4803
|
for (const key in obj) {
|
|
@@ -4835,7 +4835,7 @@ var TRPC_ERROR_CODES_BY_KEY = {
|
|
|
4835
4835
|
};
|
|
4836
4836
|
invert(TRPC_ERROR_CODES_BY_KEY);
|
|
4837
4837
|
|
|
4838
|
-
// ../../node_modules/.pnpm/@trpc+server@10.
|
|
4838
|
+
// ../../node_modules/.pnpm/@trpc+server@10.44.1/node_modules/@trpc/server/dist/index-f91d720c.mjs
|
|
4839
4839
|
invert(TRPC_ERROR_CODES_BY_KEY);
|
|
4840
4840
|
var noop = /* @__PURE__ */ __name(() => {
|
|
4841
4841
|
}, "noop");
|
|
@@ -4873,7 +4873,7 @@ var createFlatProxy = /* @__PURE__ */ __name((callback) => {
|
|
|
4873
4873
|
});
|
|
4874
4874
|
}, "createFlatProxy");
|
|
4875
4875
|
|
|
4876
|
-
// ../../node_modules/.pnpm/@trpc+client@10.
|
|
4876
|
+
// ../../node_modules/.pnpm/@trpc+client@10.44.1_@trpc+server@10.44.1/node_modules/@trpc/client/dist/httpUtils-f58ceda1.mjs
|
|
4877
4877
|
var isFunction = /* @__PURE__ */ __name((fn) => typeof fn === "function", "isFunction");
|
|
4878
4878
|
function getFetch(customFetchImpl) {
|
|
4879
4879
|
if (customFetchImpl) {
|
|
@@ -5017,7 +5017,7 @@ function httpRequest(opts) {
|
|
|
5017
5017
|
}
|
|
5018
5018
|
__name(httpRequest, "httpRequest");
|
|
5019
5019
|
|
|
5020
|
-
// ../../node_modules/.pnpm/@trpc+client@10.
|
|
5020
|
+
// ../../node_modules/.pnpm/@trpc+client@10.44.1_@trpc+server@10.44.1/node_modules/@trpc/client/dist/httpBatchLink-204206a5.mjs
|
|
5021
5021
|
var throwFatalError = /* @__PURE__ */ __name(() => {
|
|
5022
5022
|
throw new Error("Something went wrong. Please submit an issue at https://github.com/trpc/trpc/issues/new");
|
|
5023
5023
|
}, "throwFatalError");
|
|
@@ -5247,7 +5247,7 @@ var batchRequester = /* @__PURE__ */ __name((requesterOpts) => {
|
|
|
5247
5247
|
}, "batchRequester");
|
|
5248
5248
|
var httpBatchLink = createHTTPBatchLink(batchRequester);
|
|
5249
5249
|
|
|
5250
|
-
// ../../node_modules/.pnpm/@trpc+client@10.
|
|
5250
|
+
// ../../node_modules/.pnpm/@trpc+client@10.44.1_@trpc+server@10.44.1/node_modules/@trpc/client/dist/links/httpLink.mjs
|
|
5251
5251
|
function httpLinkFactory(factoryOpts) {
|
|
5252
5252
|
return (opts) => {
|
|
5253
5253
|
const resolvedOpts = resolveHTTPLinkOptions(opts);
|
|
@@ -5299,7 +5299,7 @@ function httpLinkFactory(factoryOpts) {
|
|
|
5299
5299
|
}
|
|
5300
5300
|
__name(httpLinkFactory, "httpLinkFactory");
|
|
5301
5301
|
|
|
5302
|
-
// ../../node_modules/.pnpm/@trpc+client@10.
|
|
5302
|
+
// ../../node_modules/.pnpm/@trpc+client@10.44.1_@trpc+server@10.44.1/node_modules/@trpc/client/dist/index.mjs
|
|
5303
5303
|
var _TRPCUntypedClient = class _TRPCUntypedClient {
|
|
5304
5304
|
$request({ type, input, path, context = {} }) {
|
|
5305
5305
|
const chain$ = createChain({
|
package/dist/swap.mjs
CHANGED
|
@@ -5,7 +5,7 @@ export { Assets, ChainflipNetworks, Chains, assetChains, assetContractIds, asset
|
|
|
5
5
|
import { decodeAddress } from '@polkadot/util-crypto';
|
|
6
6
|
import axios from 'axios';
|
|
7
7
|
|
|
8
|
-
// ../../node_modules/.pnpm/@trpc+server@10.
|
|
8
|
+
// ../../node_modules/.pnpm/@trpc+server@10.44.1/node_modules/@trpc/server/dist/observable-ade1bad8.mjs
|
|
9
9
|
function identity(x) {
|
|
10
10
|
return x;
|
|
11
11
|
}
|
|
@@ -84,7 +84,7 @@ function observable(subscribe) {
|
|
|
84
84
|
}
|
|
85
85
|
__name(observable, "observable");
|
|
86
86
|
|
|
87
|
-
// ../../node_modules/.pnpm/@trpc+server@10.
|
|
87
|
+
// ../../node_modules/.pnpm/@trpc+server@10.44.1/node_modules/@trpc/server/dist/observable/index.mjs
|
|
88
88
|
function share(_opts) {
|
|
89
89
|
return (originalObserver) => {
|
|
90
90
|
let refCount = 0;
|
|
@@ -189,7 +189,7 @@ function observableToPromise(observable2) {
|
|
|
189
189
|
}
|
|
190
190
|
__name(observableToPromise, "observableToPromise");
|
|
191
191
|
|
|
192
|
-
// ../../node_modules/.pnpm/@trpc+client@10.
|
|
192
|
+
// ../../node_modules/.pnpm/@trpc+client@10.44.1_@trpc+server@10.44.1/node_modules/@trpc/client/dist/splitLink-4c75f7be.mjs
|
|
193
193
|
function createChain(opts) {
|
|
194
194
|
return observable((observer) => {
|
|
195
195
|
function execute(index = 0, op = opts.op) {
|
|
@@ -213,7 +213,7 @@ function createChain(opts) {
|
|
|
213
213
|
}
|
|
214
214
|
__name(createChain, "createChain");
|
|
215
215
|
|
|
216
|
-
// ../../node_modules/.pnpm/@trpc+client@10.
|
|
216
|
+
// ../../node_modules/.pnpm/@trpc+client@10.44.1_@trpc+server@10.44.1/node_modules/@trpc/client/dist/transformResult-ace864b8.mjs
|
|
217
217
|
function isObject(value) {
|
|
218
218
|
return !!value && !Array.isArray(value) && typeof value === "object";
|
|
219
219
|
}
|
|
@@ -266,7 +266,7 @@ function transformResult(response, runtime) {
|
|
|
266
266
|
}
|
|
267
267
|
__name(transformResult, "transformResult");
|
|
268
268
|
|
|
269
|
-
// ../../node_modules/.pnpm/@trpc+client@10.
|
|
269
|
+
// ../../node_modules/.pnpm/@trpc+client@10.44.1_@trpc+server@10.44.1/node_modules/@trpc/client/dist/TRPCClientError-0de4d231.mjs
|
|
270
270
|
function isTRPCClientError(cause) {
|
|
271
271
|
return cause instanceof TRPCClientError || /**
|
|
272
272
|
* @deprecated
|
|
@@ -324,7 +324,7 @@ var _TRPCClientError = class _TRPCClientError extends Error {
|
|
|
324
324
|
__name(_TRPCClientError, "TRPCClientError");
|
|
325
325
|
var TRPCClientError = _TRPCClientError;
|
|
326
326
|
|
|
327
|
-
// ../../node_modules/.pnpm/@trpc+server@10.
|
|
327
|
+
// ../../node_modules/.pnpm/@trpc+server@10.44.1/node_modules/@trpc/server/dist/codes-c924c3db.mjs
|
|
328
328
|
function invert(obj) {
|
|
329
329
|
const newObj = /* @__PURE__ */ Object.create(null);
|
|
330
330
|
for (const key in obj) {
|
|
@@ -362,7 +362,7 @@ var TRPC_ERROR_CODES_BY_KEY = {
|
|
|
362
362
|
};
|
|
363
363
|
invert(TRPC_ERROR_CODES_BY_KEY);
|
|
364
364
|
|
|
365
|
-
// ../../node_modules/.pnpm/@trpc+server@10.
|
|
365
|
+
// ../../node_modules/.pnpm/@trpc+server@10.44.1/node_modules/@trpc/server/dist/index-f91d720c.mjs
|
|
366
366
|
invert(TRPC_ERROR_CODES_BY_KEY);
|
|
367
367
|
var noop = /* @__PURE__ */ __name(() => {
|
|
368
368
|
}, "noop");
|
|
@@ -400,7 +400,7 @@ var createFlatProxy = /* @__PURE__ */ __name((callback) => {
|
|
|
400
400
|
});
|
|
401
401
|
}, "createFlatProxy");
|
|
402
402
|
|
|
403
|
-
// ../../node_modules/.pnpm/@trpc+client@10.
|
|
403
|
+
// ../../node_modules/.pnpm/@trpc+client@10.44.1_@trpc+server@10.44.1/node_modules/@trpc/client/dist/httpUtils-f58ceda1.mjs
|
|
404
404
|
var isFunction = /* @__PURE__ */ __name((fn) => typeof fn === "function", "isFunction");
|
|
405
405
|
function getFetch(customFetchImpl) {
|
|
406
406
|
if (customFetchImpl) {
|
|
@@ -544,7 +544,7 @@ function httpRequest(opts) {
|
|
|
544
544
|
}
|
|
545
545
|
__name(httpRequest, "httpRequest");
|
|
546
546
|
|
|
547
|
-
// ../../node_modules/.pnpm/@trpc+client@10.
|
|
547
|
+
// ../../node_modules/.pnpm/@trpc+client@10.44.1_@trpc+server@10.44.1/node_modules/@trpc/client/dist/httpBatchLink-204206a5.mjs
|
|
548
548
|
var throwFatalError = /* @__PURE__ */ __name(() => {
|
|
549
549
|
throw new Error("Something went wrong. Please submit an issue at https://github.com/trpc/trpc/issues/new");
|
|
550
550
|
}, "throwFatalError");
|
|
@@ -774,7 +774,7 @@ var batchRequester = /* @__PURE__ */ __name((requesterOpts) => {
|
|
|
774
774
|
}, "batchRequester");
|
|
775
775
|
var httpBatchLink = createHTTPBatchLink(batchRequester);
|
|
776
776
|
|
|
777
|
-
// ../../node_modules/.pnpm/@trpc+client@10.
|
|
777
|
+
// ../../node_modules/.pnpm/@trpc+client@10.44.1_@trpc+server@10.44.1/node_modules/@trpc/client/dist/links/httpLink.mjs
|
|
778
778
|
function httpLinkFactory(factoryOpts) {
|
|
779
779
|
return (opts) => {
|
|
780
780
|
const resolvedOpts = resolveHTTPLinkOptions(opts);
|
|
@@ -826,7 +826,7 @@ function httpLinkFactory(factoryOpts) {
|
|
|
826
826
|
}
|
|
827
827
|
__name(httpLinkFactory, "httpLinkFactory");
|
|
828
828
|
|
|
829
|
-
// ../../node_modules/.pnpm/@trpc+client@10.
|
|
829
|
+
// ../../node_modules/.pnpm/@trpc+client@10.44.1_@trpc+server@10.44.1/node_modules/@trpc/client/dist/index.mjs
|
|
830
830
|
var _TRPCUntypedClient = class _TRPCUntypedClient {
|
|
831
831
|
$request({ type, input, path, context = {} }) {
|
|
832
832
|
const chain$ = createChain({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chainflip/sdk",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.21",
|
|
4
4
|
"description": "",
|
|
5
5
|
"exports": {
|
|
6
6
|
"./swap": {
|
|
@@ -44,10 +44,10 @@
|
|
|
44
44
|
"@polkadot/util": "^12.6.1",
|
|
45
45
|
"@polkadot/util-crypto": "^12.6.1",
|
|
46
46
|
"axios": "^1.6.0",
|
|
47
|
-
"ethers": "6.
|
|
47
|
+
"ethers": "6.9.0"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"tsup": "^8.0.
|
|
50
|
+
"tsup": "^8.0.1"
|
|
51
51
|
},
|
|
52
52
|
"scripts": {
|
|
53
53
|
"test": "jest --forceExit",
|