@chainflip/sdk 0.2.18 → 0.2.20
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/{broker-TKLJ3YAQ.mjs → broker-LHEVQ6DT.mjs} +2 -2
- package/dist/{chunk-2HHAR3ZI.mjs → chunk-N4SMMWKH.mjs} +5 -2
- package/dist/{chunk-JIK6G4FY.mjs → chunk-TCRJUCSA.mjs} +9 -10
- package/dist/{contracts-fee99026.d.ts → contracts-rsXvYw7v.d.ts} +1 -1
- package/dist/funding.d.mts +3 -3
- package/dist/funding.d.ts +3 -3
- package/dist/funding.js +19 -17
- package/dist/funding.mjs +2 -2
- package/dist/swap.d.mts +7 -7
- package/dist/swap.d.ts +7 -7
- package/dist/swap.js +24 -20
- package/dist/swap.mjs +17 -17
- package/package.json +4 -4
- /package/dist/{chunk-6B4B7WKD.mjs → chunk-B2TZXL7C.mjs} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { chainflipAssetAndChain, numericString, hexString, btcAddress, ccmMetadataSchema, hexStringFromNumber, dotAddress, unsignedInteger } from './chunk-
|
|
2
|
-
import { z, isNotNullish, __name, Assets } from './chunk-
|
|
1
|
+
import { chainflipAssetAndChain, numericString, hexString, btcAddress, ccmMetadataSchema, hexStringFromNumber, dotAddress, unsignedInteger } from './chunk-N4SMMWKH.mjs';
|
|
2
|
+
import { z, isNotNullish, __name, Assets } from './chunk-B2TZXL7C.mjs';
|
|
3
3
|
import { u8aToHex } from '@polkadot/util';
|
|
4
4
|
import { decodeAddress } from '@polkadot/util-crypto';
|
|
5
5
|
import axios from 'axios';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { z, isString, Chains, Assets, assetChains, ChainflipNetworks, __name, assert } from './chunk-
|
|
1
|
+
import { z, isString, Chains, Assets, assetChains, ChainflipNetworks, __name, assert } from './chunk-B2TZXL7C.mjs';
|
|
2
2
|
import { hexToU8a } from '@polkadot/util';
|
|
3
3
|
import { encodeAddress, decodeAddress, base58Decode } from '@polkadot/util-crypto';
|
|
4
4
|
import * as ethers from 'ethers';
|
|
@@ -253,6 +253,9 @@ z.number({
|
|
|
253
253
|
});
|
|
254
254
|
var numericString = string.regex(/^[0-9]+$/);
|
|
255
255
|
var hexString = z.custom((val) => typeof val === "string" && /^0x[0-9a-f]+$/i.test(val));
|
|
256
|
+
var hexStringWithMaxByteSize = /* @__PURE__ */ __name((maxByteSize) => hexString.refine((val) => val.length / 2 <= maxByteSize + 1, {
|
|
257
|
+
message: `String must be less than or equal to ${maxByteSize} bytes`
|
|
258
|
+
}), "hexStringWithMaxByteSize");
|
|
256
259
|
var hexStringFromNumber = numericString.transform((arg) => `0x${BigInt(arg).toString(16)}`);
|
|
257
260
|
string.regex(/^[0-9a-f]+$/);
|
|
258
261
|
var btcAddress = /* @__PURE__ */ __name((env) => {
|
|
@@ -350,7 +353,7 @@ z.object({
|
|
|
350
353
|
});
|
|
351
354
|
var ccmMetadataSchema = z.object({
|
|
352
355
|
gasBudget: numericString,
|
|
353
|
-
message:
|
|
356
|
+
message: hexStringWithMaxByteSize(1024 * 10)
|
|
354
357
|
});
|
|
355
358
|
z.object({
|
|
356
359
|
srcAsset: chainflipAsset,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { z, ChainflipNetworks, __name, __publicField,
|
|
1
|
+
import { z, ChainflipNetworks, __name, __publicField, Assets } from './chunk-B2TZXL7C.mjs';
|
|
2
2
|
import axios from 'axios';
|
|
3
3
|
import { Interface, Contract } from 'ethers';
|
|
4
4
|
|
|
@@ -2117,6 +2117,12 @@ var ADDRESSES = {
|
|
|
2117
2117
|
USDC_CONTRACT_ADDRESS: GOERLI_USDC_CONTRACT_ADDRESS,
|
|
2118
2118
|
VAULT_CONTRACT_ADDRESS: "0x40caFF3f3B6706Da904a7895e0fC7F7922437e9B",
|
|
2119
2119
|
STATE_CHAIN_GATEWAY_ADDRESS: "0x38AA40B7b5a70d738baBf6699a45DacdDBBEB3fc"
|
|
2120
|
+
},
|
|
2121
|
+
[ChainflipNetworks.mainnet]: {
|
|
2122
|
+
FLIP_CONTRACT_ADDRESS: "0x826180541412D574cf1336d22c0C0a287822678A",
|
|
2123
|
+
USDC_CONTRACT_ADDRESS: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
|
|
2124
|
+
VAULT_CONTRACT_ADDRESS: "0xF5e10380213880111522dd0efD3dbb45b9f62Bcc",
|
|
2125
|
+
STATE_CHAIN_GATEWAY_ADDRESS: "0x6995Ab7c4D7F4B03f467Cf4c8E920427d9621DBd"
|
|
2120
2126
|
}
|
|
2121
2127
|
};
|
|
2122
2128
|
|
|
@@ -2126,17 +2132,13 @@ var extractOverrides = /* @__PURE__ */ __name((transactionOverrides) => {
|
|
|
2126
2132
|
return ethersOverrides;
|
|
2127
2133
|
}, "extractOverrides");
|
|
2128
2134
|
var getTokenContractAddress = /* @__PURE__ */ __name((asset, network) => {
|
|
2129
|
-
assert(network !== ChainflipNetworks.mainnet, "Mainnet is not yet supported");
|
|
2130
2135
|
if (asset === Assets.FLIP)
|
|
2131
2136
|
return ADDRESSES[network].FLIP_CONTRACT_ADDRESS;
|
|
2132
2137
|
if (asset === Assets.USDC)
|
|
2133
2138
|
return ADDRESSES[network].USDC_CONTRACT_ADDRESS;
|
|
2134
2139
|
throw new Error("Only FLIP and USDC are supported for now");
|
|
2135
2140
|
}, "getTokenContractAddress");
|
|
2136
|
-
var getStateChainGatewayContractAddress = /* @__PURE__ */ __name((network) =>
|
|
2137
|
-
assert(network !== ChainflipNetworks.mainnet, "Mainnet is not yet supported");
|
|
2138
|
-
return ADDRESSES[network].STATE_CHAIN_GATEWAY_ADDRESS;
|
|
2139
|
-
}, "getStateChainGatewayContractAddress");
|
|
2141
|
+
var getStateChainGatewayContractAddress = /* @__PURE__ */ __name((network) => ADDRESSES[network].STATE_CHAIN_GATEWAY_ADDRESS, "getStateChainGatewayContractAddress");
|
|
2140
2142
|
var checkAllowance = /* @__PURE__ */ __name(async (amount, spenderAddress, erc20Address, signer) => {
|
|
2141
2143
|
const erc20 = ERC20__factory.connect(erc20Address, signer);
|
|
2142
2144
|
const signerAddress = await signer.getAddress();
|
|
@@ -2153,10 +2155,7 @@ var approve = /* @__PURE__ */ __name(async (amount, spenderAddress, erc20, allow
|
|
|
2153
2155
|
const transaction = await erc20.approve(spenderAddress, amount - allowance, extractOverrides(txOpts));
|
|
2154
2156
|
return transaction.wait(txOpts.wait);
|
|
2155
2157
|
}, "approve");
|
|
2156
|
-
var getVaultManagerContractAddress = /* @__PURE__ */ __name((network) =>
|
|
2157
|
-
assert(network !== ChainflipNetworks.mainnet, "Mainnet is not yet supported");
|
|
2158
|
-
return ADDRESSES[network].VAULT_CONTRACT_ADDRESS;
|
|
2159
|
-
}, "getVaultManagerContractAddress");
|
|
2158
|
+
var getVaultManagerContractAddress = /* @__PURE__ */ __name((network) => ADDRESSES[network].VAULT_CONTRACT_ADDRESS, "getVaultManagerContractAddress");
|
|
2160
2159
|
var getFlipBalance = /* @__PURE__ */ __name(async (network, signer) => {
|
|
2161
2160
|
const flipAddress = getTokenContractAddress("FLIP", network);
|
|
2162
2161
|
const flip = ERC20__factory.connect(flipAddress, signer);
|
|
@@ -38,4 +38,4 @@ type TransactionOptions = {
|
|
|
38
38
|
wait?: number;
|
|
39
39
|
};
|
|
40
40
|
|
|
41
|
-
export { Asset as A, Chain as C, TransactionOptions as T, 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 };
|
|
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
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Signer } from 'ethers';
|
|
2
|
-
import { a as ChainflipNetwork, T as TransactionOptions } from './contracts-
|
|
2
|
+
import { a as ChainflipNetwork, T as TransactionOptions } from './contracts-rsXvYw7v.js';
|
|
3
3
|
|
|
4
4
|
type PendingRedemption = {
|
|
5
5
|
amount: bigint;
|
|
@@ -9,7 +9,7 @@ type PendingRedemption = {
|
|
|
9
9
|
};
|
|
10
10
|
|
|
11
11
|
type FundingSDKOption = {
|
|
12
|
-
network?:
|
|
12
|
+
network?: ChainflipNetwork;
|
|
13
13
|
signer: Signer;
|
|
14
14
|
rpcUrl?: string;
|
|
15
15
|
};
|
|
@@ -29,4 +29,4 @@ declare class FundingSDK {
|
|
|
29
29
|
getRedemptionTax(): Promise<bigint>;
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
export { FundingSDK, FundingSDKOption, PendingRedemption };
|
|
32
|
+
export { FundingSDK, type FundingSDKOption, type PendingRedemption };
|
package/dist/funding.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Signer } from 'ethers';
|
|
2
|
-
import { a as ChainflipNetwork, T as TransactionOptions } from './contracts-
|
|
2
|
+
import { a as ChainflipNetwork, T as TransactionOptions } from './contracts-rsXvYw7v.js';
|
|
3
3
|
|
|
4
4
|
type PendingRedemption = {
|
|
5
5
|
amount: bigint;
|
|
@@ -9,7 +9,7 @@ type PendingRedemption = {
|
|
|
9
9
|
};
|
|
10
10
|
|
|
11
11
|
type FundingSDKOption = {
|
|
12
|
-
network?:
|
|
12
|
+
network?: ChainflipNetwork;
|
|
13
13
|
signer: Signer;
|
|
14
14
|
rpcUrl?: string;
|
|
15
15
|
};
|
|
@@ -29,4 +29,4 @@ declare class FundingSDK {
|
|
|
29
29
|
getRedemptionTax(): Promise<bigint>;
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
export { FundingSDK, FundingSDKOption, PendingRedemption };
|
|
32
|
+
export { FundingSDK, type FundingSDKOption, type PendingRedemption };
|
package/dist/funding.js
CHANGED
|
@@ -854,38 +854,28 @@ var ADDRESSES = {
|
|
|
854
854
|
USDC_CONTRACT_ADDRESS: GOERLI_USDC_CONTRACT_ADDRESS,
|
|
855
855
|
VAULT_CONTRACT_ADDRESS: "0x40caFF3f3B6706Da904a7895e0fC7F7922437e9B",
|
|
856
856
|
STATE_CHAIN_GATEWAY_ADDRESS: "0x38AA40B7b5a70d738baBf6699a45DacdDBBEB3fc"
|
|
857
|
+
},
|
|
858
|
+
[ChainflipNetworks.mainnet]: {
|
|
859
|
+
FLIP_CONTRACT_ADDRESS: "0x826180541412D574cf1336d22c0C0a287822678A",
|
|
860
|
+
USDC_CONTRACT_ADDRESS: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
|
|
861
|
+
VAULT_CONTRACT_ADDRESS: "0xF5e10380213880111522dd0efD3dbb45b9f62Bcc",
|
|
862
|
+
STATE_CHAIN_GATEWAY_ADDRESS: "0x6995Ab7c4D7F4B03f467Cf4c8E920427d9621DBd"
|
|
857
863
|
}
|
|
858
864
|
};
|
|
859
865
|
|
|
860
|
-
// ../shared/src/guards.ts
|
|
861
|
-
function assert(condition, message) {
|
|
862
|
-
if (condition)
|
|
863
|
-
return;
|
|
864
|
-
const error = new Error(message);
|
|
865
|
-
if (error.stack) {
|
|
866
|
-
error.stack = error.stack.replace(/\n.+/, "\n");
|
|
867
|
-
}
|
|
868
|
-
throw error;
|
|
869
|
-
}
|
|
870
|
-
__name(assert, "assert");
|
|
871
|
-
|
|
872
866
|
// ../shared/src/contracts.ts
|
|
873
867
|
var extractOverrides = /* @__PURE__ */ __name((transactionOverrides) => {
|
|
874
868
|
const { wait, ...ethersOverrides } = transactionOverrides;
|
|
875
869
|
return ethersOverrides;
|
|
876
870
|
}, "extractOverrides");
|
|
877
871
|
var getTokenContractAddress = /* @__PURE__ */ __name((asset, network) => {
|
|
878
|
-
assert(network !== ChainflipNetworks.mainnet, "Mainnet is not yet supported");
|
|
879
872
|
if (asset === Assets.FLIP)
|
|
880
873
|
return ADDRESSES[network].FLIP_CONTRACT_ADDRESS;
|
|
881
874
|
if (asset === Assets.USDC)
|
|
882
875
|
return ADDRESSES[network].USDC_CONTRACT_ADDRESS;
|
|
883
876
|
throw new Error("Only FLIP and USDC are supported for now");
|
|
884
877
|
}, "getTokenContractAddress");
|
|
885
|
-
var getStateChainGatewayContractAddress = /* @__PURE__ */ __name((network) =>
|
|
886
|
-
assert(network !== ChainflipNetworks.mainnet, "Mainnet is not yet supported");
|
|
887
|
-
return ADDRESSES[network].STATE_CHAIN_GATEWAY_ADDRESS;
|
|
888
|
-
}, "getStateChainGatewayContractAddress");
|
|
878
|
+
var getStateChainGatewayContractAddress = /* @__PURE__ */ __name((network) => ADDRESSES[network].STATE_CHAIN_GATEWAY_ADDRESS, "getStateChainGatewayContractAddress");
|
|
889
879
|
var checkAllowance = /* @__PURE__ */ __name(async (amount, spenderAddress, erc20Address, signer) => {
|
|
890
880
|
const erc20 = ERC20__factory.connect(erc20Address, signer);
|
|
891
881
|
const signerAddress = await signer.getAddress();
|
|
@@ -4861,6 +4851,18 @@ var getStateChainGateway = /* @__PURE__ */ __name((networkOpts) => {
|
|
|
4861
4851
|
return StateChainGateway__factory.connect(stateChainGatewayContractAddress, networkOpts.signer);
|
|
4862
4852
|
}, "getStateChainGateway");
|
|
4863
4853
|
|
|
4854
|
+
// ../shared/src/guards.ts
|
|
4855
|
+
function assert(condition, message) {
|
|
4856
|
+
if (condition)
|
|
4857
|
+
return;
|
|
4858
|
+
const error = new Error(message);
|
|
4859
|
+
if (error.stack) {
|
|
4860
|
+
error.stack = error.stack.replace(/\n.+/, "\n");
|
|
4861
|
+
}
|
|
4862
|
+
throw error;
|
|
4863
|
+
}
|
|
4864
|
+
__name(assert, "assert");
|
|
4865
|
+
|
|
4864
4866
|
// ../shared/src/stateChainGateway/approval.ts
|
|
4865
4867
|
var checkStateChainGatewayAllowance = /* @__PURE__ */ __name(async (amount, networkOpts) => {
|
|
4866
4868
|
const flipContractAddress = networkOpts.network === "localnet" ? networkOpts.flipContractAddress : getTokenContractAddress(Assets.FLIP, networkOpts.network);
|
package/dist/funding.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { getFlipBalance, getFundingEnvironment, getStateChainGatewayContractAddress, approve, getTokenContractAddress, checkAllowance, extractOverrides, StateChainGateway__factory } from './chunk-
|
|
2
|
-
import { __name, __publicField, ChainflipNetworks, Assets, assert } from './chunk-
|
|
1
|
+
import { getFlipBalance, getFundingEnvironment, getStateChainGatewayContractAddress, approve, getTokenContractAddress, checkAllowance, extractOverrides, StateChainGateway__factory } from './chunk-TCRJUCSA.mjs';
|
|
2
|
+
import { __name, __publicField, ChainflipNetworks, Assets, assert } from './chunk-B2TZXL7C.mjs';
|
|
3
3
|
|
|
4
4
|
// ../shared/src/stateChainGateway/utils.ts
|
|
5
5
|
var getStateChainGateway = /* @__PURE__ */ __name((networkOpts) => {
|
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-
|
|
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-
|
|
2
|
+
import { A as Asset, C as Chain, c as chainAssets, a as ChainflipNetwork, T as TransactionOptions } from './contracts-rsXvYw7v.js';
|
|
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.js';
|
|
4
4
|
import { z } from 'zod';
|
|
5
5
|
|
|
6
6
|
declare const tokenSwapParamsSchema: z.ZodUnion<[z.ZodObject<{
|
|
@@ -97,7 +97,7 @@ declare const executeSwapParamsSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
97
97
|
destAddress: z.ZodEffects<z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>, `0x${string}`, `0x${string}`>;
|
|
98
98
|
ccmMetadata: z.ZodObject<{
|
|
99
99
|
gasBudget: z.ZodString;
|
|
100
|
-
message: z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>;
|
|
100
|
+
message: z.ZodEffects<z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>, `0x${string}`, `0x${string}`>;
|
|
101
101
|
}, "strip", z.ZodTypeAny, {
|
|
102
102
|
message: `0x${string}`;
|
|
103
103
|
gasBudget: string;
|
|
@@ -136,7 +136,7 @@ declare const executeSwapParamsSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
136
136
|
destAddress: z.ZodEffects<z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>, `0x${string}`, `0x${string}`>;
|
|
137
137
|
ccmMetadata: z.ZodObject<{
|
|
138
138
|
gasBudget: z.ZodString;
|
|
139
|
-
message: z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>;
|
|
139
|
+
message: z.ZodEffects<z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>, `0x${string}`, `0x${string}`>;
|
|
140
140
|
}, "strip", z.ZodTypeAny, {
|
|
141
141
|
message: `0x${string}`;
|
|
142
142
|
gasBudget: string;
|
|
@@ -175,7 +175,7 @@ declare const executeSwapParamsSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
175
175
|
destAddress: z.ZodEffects<z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>, `0x${string}`, `0x${string}`>;
|
|
176
176
|
ccmMetadata: z.ZodObject<{
|
|
177
177
|
gasBudget: z.ZodString;
|
|
178
|
-
message: z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>;
|
|
178
|
+
message: z.ZodEffects<z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>, `0x${string}`, `0x${string}`>;
|
|
179
179
|
}, "strip", z.ZodTypeAny, {
|
|
180
180
|
message: `0x${string}`;
|
|
181
181
|
gasBudget: string;
|
|
@@ -358,7 +358,7 @@ type TokenSwapParams = z.infer<typeof tokenSwapParamsSchema>;
|
|
|
358
358
|
|
|
359
359
|
declare const ccmMetadataSchema: z.ZodObject<{
|
|
360
360
|
gasBudget: z.ZodString;
|
|
361
|
-
message: z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>;
|
|
361
|
+
message: z.ZodEffects<z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>, `0x${string}`, `0x${string}`>;
|
|
362
362
|
}, "strip", z.ZodTypeAny, {
|
|
363
363
|
message: `0x${string}`;
|
|
364
364
|
gasBudget: string;
|
|
@@ -549,4 +549,4 @@ declare class SwapSDK {
|
|
|
549
549
|
approveVault(params: Pick<TokenSwapParams, 'srcAsset' | 'amount'>, txOpts?: TransactionOptions): Promise<TransactionHash | null>;
|
|
550
550
|
}
|
|
551
551
|
|
|
552
|
-
export { Asset, AssetData, Chain, ChainData, ChainflipNetwork, DepositAddressRequest, DepositAddressResponse, QuoteRequest, QuoteResponse, SwapSDK, SwapSDKOptions, SwapStatusRequest, SwapStatusResponse, chainAssets };
|
|
552
|
+
export { Asset, type AssetData, Chain, type ChainData, ChainflipNetwork, type DepositAddressRequest, type DepositAddressResponse, type QuoteRequest, type QuoteResponse, SwapSDK, type SwapSDKOptions, type SwapStatusRequest, type SwapStatusResponse, chainAssets };
|
package/dist/swap.d.ts
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-
|
|
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-
|
|
2
|
+
import { A as Asset, C as Chain, c as chainAssets, a as ChainflipNetwork, T as TransactionOptions } from './contracts-rsXvYw7v.js';
|
|
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.js';
|
|
4
4
|
import { z } from 'zod';
|
|
5
5
|
|
|
6
6
|
declare const tokenSwapParamsSchema: z.ZodUnion<[z.ZodObject<{
|
|
@@ -97,7 +97,7 @@ declare const executeSwapParamsSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
97
97
|
destAddress: z.ZodEffects<z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>, `0x${string}`, `0x${string}`>;
|
|
98
98
|
ccmMetadata: z.ZodObject<{
|
|
99
99
|
gasBudget: z.ZodString;
|
|
100
|
-
message: z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>;
|
|
100
|
+
message: z.ZodEffects<z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>, `0x${string}`, `0x${string}`>;
|
|
101
101
|
}, "strip", z.ZodTypeAny, {
|
|
102
102
|
message: `0x${string}`;
|
|
103
103
|
gasBudget: string;
|
|
@@ -136,7 +136,7 @@ declare const executeSwapParamsSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
136
136
|
destAddress: z.ZodEffects<z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>, `0x${string}`, `0x${string}`>;
|
|
137
137
|
ccmMetadata: z.ZodObject<{
|
|
138
138
|
gasBudget: z.ZodString;
|
|
139
|
-
message: z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>;
|
|
139
|
+
message: z.ZodEffects<z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>, `0x${string}`, `0x${string}`>;
|
|
140
140
|
}, "strip", z.ZodTypeAny, {
|
|
141
141
|
message: `0x${string}`;
|
|
142
142
|
gasBudget: string;
|
|
@@ -175,7 +175,7 @@ declare const executeSwapParamsSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
175
175
|
destAddress: z.ZodEffects<z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>, `0x${string}`, `0x${string}`>;
|
|
176
176
|
ccmMetadata: z.ZodObject<{
|
|
177
177
|
gasBudget: z.ZodString;
|
|
178
|
-
message: z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>;
|
|
178
|
+
message: z.ZodEffects<z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>, `0x${string}`, `0x${string}`>;
|
|
179
179
|
}, "strip", z.ZodTypeAny, {
|
|
180
180
|
message: `0x${string}`;
|
|
181
181
|
gasBudget: string;
|
|
@@ -358,7 +358,7 @@ type TokenSwapParams = z.infer<typeof tokenSwapParamsSchema>;
|
|
|
358
358
|
|
|
359
359
|
declare const ccmMetadataSchema: z.ZodObject<{
|
|
360
360
|
gasBudget: z.ZodString;
|
|
361
|
-
message: z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>;
|
|
361
|
+
message: z.ZodEffects<z.ZodType<`0x${string}`, z.ZodTypeDef, `0x${string}`>, `0x${string}`, `0x${string}`>;
|
|
362
362
|
}, "strip", z.ZodTypeAny, {
|
|
363
363
|
message: `0x${string}`;
|
|
364
364
|
gasBudget: string;
|
|
@@ -549,4 +549,4 @@ declare class SwapSDK {
|
|
|
549
549
|
approveVault(params: Pick<TokenSwapParams, 'srcAsset' | 'amount'>, txOpts?: TransactionOptions): Promise<TransactionHash | null>;
|
|
550
550
|
}
|
|
551
551
|
|
|
552
|
-
export { Asset, AssetData, Chain, ChainData, ChainflipNetwork, DepositAddressRequest, DepositAddressResponse, QuoteRequest, QuoteResponse, SwapSDK, SwapSDKOptions, SwapStatusRequest, SwapStatusResponse, chainAssets };
|
|
552
|
+
export { Asset, type AssetData, Chain, type ChainData, ChainflipNetwork, type DepositAddressRequest, type DepositAddressResponse, type QuoteRequest, type QuoteResponse, SwapSDK, type SwapSDKOptions, type SwapStatusRequest, type SwapStatusResponse, chainAssets };
|
package/dist/swap.js
CHANGED
|
@@ -4211,7 +4211,7 @@ var init_addressValidation = __esm({
|
|
|
4211
4211
|
validateBitcoinRegtestAddress = /* @__PURE__ */ __name((address) => validateBitcoinAddress(address, "regtest"), "validateBitcoinRegtestAddress");
|
|
4212
4212
|
}
|
|
4213
4213
|
});
|
|
4214
|
-
var safeStringify, errorMap2, string, numericString, hexString, hexStringFromNumber, btcAddress, dotAddress, ethereumAddress, u128, unsignedInteger, transformAsset, chainflipChain, chainflipAsset, chainflipAssetAndChain;
|
|
4214
|
+
var safeStringify, errorMap2, string, numericString, hexString, hexStringWithMaxByteSize, hexStringFromNumber, btcAddress, dotAddress, ethereumAddress, u128, unsignedInteger, transformAsset, chainflipChain, chainflipAsset, chainflipAssetAndChain;
|
|
4215
4215
|
var init_parsers = __esm({
|
|
4216
4216
|
"../shared/src/parsers.ts"() {
|
|
4217
4217
|
init_lib();
|
|
@@ -4230,6 +4230,9 @@ var init_parsers = __esm({
|
|
|
4230
4230
|
});
|
|
4231
4231
|
numericString = string.regex(/^[0-9]+$/);
|
|
4232
4232
|
hexString = z.custom((val) => typeof val === "string" && /^0x[0-9a-f]+$/i.test(val));
|
|
4233
|
+
hexStringWithMaxByteSize = /* @__PURE__ */ __name((maxByteSize) => hexString.refine((val) => val.length / 2 <= maxByteSize + 1, {
|
|
4234
|
+
message: `String must be less than or equal to ${maxByteSize} bytes`
|
|
4235
|
+
}), "hexStringWithMaxByteSize");
|
|
4233
4236
|
hexStringFromNumber = numericString.transform((arg) => `0x${BigInt(arg).toString(16)}`);
|
|
4234
4237
|
string.regex(/^[0-9a-f]+$/);
|
|
4235
4238
|
btcAddress = /* @__PURE__ */ __name((env) => {
|
|
@@ -4334,7 +4337,7 @@ var init_schemas = __esm({
|
|
|
4334
4337
|
});
|
|
4335
4338
|
ccmMetadataSchema = z.object({
|
|
4336
4339
|
gasBudget: numericString,
|
|
4337
|
-
message:
|
|
4340
|
+
message: hexStringWithMaxByteSize(1024 * 10)
|
|
4338
4341
|
});
|
|
4339
4342
|
z.object({
|
|
4340
4343
|
srcAsset: chainflipAsset,
|
|
@@ -4475,7 +4478,7 @@ var init_broker = __esm({
|
|
|
4475
4478
|
}
|
|
4476
4479
|
});
|
|
4477
4480
|
|
|
4478
|
-
// ../../node_modules/.pnpm/@trpc+server@10.43.
|
|
4481
|
+
// ../../node_modules/.pnpm/@trpc+server@10.43.6/node_modules/@trpc/server/dist/observable-ade1bad8.mjs
|
|
4479
4482
|
function identity(x) {
|
|
4480
4483
|
return x;
|
|
4481
4484
|
}
|
|
@@ -4554,7 +4557,7 @@ function observable(subscribe) {
|
|
|
4554
4557
|
}
|
|
4555
4558
|
__name(observable, "observable");
|
|
4556
4559
|
|
|
4557
|
-
// ../../node_modules/.pnpm/@trpc+server@10.43.
|
|
4560
|
+
// ../../node_modules/.pnpm/@trpc+server@10.43.6/node_modules/@trpc/server/dist/observable/index.mjs
|
|
4558
4561
|
function share(_opts) {
|
|
4559
4562
|
return (originalObserver) => {
|
|
4560
4563
|
let refCount = 0;
|
|
@@ -4659,7 +4662,7 @@ function observableToPromise(observable2) {
|
|
|
4659
4662
|
}
|
|
4660
4663
|
__name(observableToPromise, "observableToPromise");
|
|
4661
4664
|
|
|
4662
|
-
// ../../node_modules/.pnpm/@trpc+client@10.43.
|
|
4665
|
+
// ../../node_modules/.pnpm/@trpc+client@10.43.6_@trpc+server@10.43.6/node_modules/@trpc/client/dist/splitLink-4c75f7be.mjs
|
|
4663
4666
|
function createChain(opts) {
|
|
4664
4667
|
return observable((observer) => {
|
|
4665
4668
|
function execute(index = 0, op = opts.op) {
|
|
@@ -4683,7 +4686,7 @@ function createChain(opts) {
|
|
|
4683
4686
|
}
|
|
4684
4687
|
__name(createChain, "createChain");
|
|
4685
4688
|
|
|
4686
|
-
// ../../node_modules/.pnpm/@trpc+client@10.43.
|
|
4689
|
+
// ../../node_modules/.pnpm/@trpc+client@10.43.6_@trpc+server@10.43.6/node_modules/@trpc/client/dist/transformResult-ace864b8.mjs
|
|
4687
4690
|
function isObject(value) {
|
|
4688
4691
|
return !!value && !Array.isArray(value) && typeof value === "object";
|
|
4689
4692
|
}
|
|
@@ -4736,7 +4739,7 @@ function transformResult(response, runtime) {
|
|
|
4736
4739
|
}
|
|
4737
4740
|
__name(transformResult, "transformResult");
|
|
4738
4741
|
|
|
4739
|
-
// ../../node_modules/.pnpm/@trpc+client@10.43.
|
|
4742
|
+
// ../../node_modules/.pnpm/@trpc+client@10.43.6_@trpc+server@10.43.6/node_modules/@trpc/client/dist/TRPCClientError-0de4d231.mjs
|
|
4740
4743
|
function isTRPCClientError(cause) {
|
|
4741
4744
|
return cause instanceof TRPCClientError || /**
|
|
4742
4745
|
* @deprecated
|
|
@@ -4794,7 +4797,7 @@ var _TRPCClientError = class _TRPCClientError extends Error {
|
|
|
4794
4797
|
__name(_TRPCClientError, "TRPCClientError");
|
|
4795
4798
|
var TRPCClientError = _TRPCClientError;
|
|
4796
4799
|
|
|
4797
|
-
// ../../node_modules/.pnpm/@trpc+server@10.43.
|
|
4800
|
+
// ../../node_modules/.pnpm/@trpc+server@10.43.6/node_modules/@trpc/server/dist/codes-c924c3db.mjs
|
|
4798
4801
|
function invert(obj) {
|
|
4799
4802
|
const newObj = /* @__PURE__ */ Object.create(null);
|
|
4800
4803
|
for (const key in obj) {
|
|
@@ -4832,7 +4835,7 @@ var TRPC_ERROR_CODES_BY_KEY = {
|
|
|
4832
4835
|
};
|
|
4833
4836
|
invert(TRPC_ERROR_CODES_BY_KEY);
|
|
4834
4837
|
|
|
4835
|
-
// ../../node_modules/.pnpm/@trpc+server@10.43.
|
|
4838
|
+
// ../../node_modules/.pnpm/@trpc+server@10.43.6/node_modules/@trpc/server/dist/index-f91d720c.mjs
|
|
4836
4839
|
invert(TRPC_ERROR_CODES_BY_KEY);
|
|
4837
4840
|
var noop = /* @__PURE__ */ __name(() => {
|
|
4838
4841
|
}, "noop");
|
|
@@ -4870,7 +4873,7 @@ var createFlatProxy = /* @__PURE__ */ __name((callback) => {
|
|
|
4870
4873
|
});
|
|
4871
4874
|
}, "createFlatProxy");
|
|
4872
4875
|
|
|
4873
|
-
// ../../node_modules/.pnpm/@trpc+client@10.43.
|
|
4876
|
+
// ../../node_modules/.pnpm/@trpc+client@10.43.6_@trpc+server@10.43.6/node_modules/@trpc/client/dist/httpUtils-f58ceda1.mjs
|
|
4874
4877
|
var isFunction = /* @__PURE__ */ __name((fn) => typeof fn === "function", "isFunction");
|
|
4875
4878
|
function getFetch(customFetchImpl) {
|
|
4876
4879
|
if (customFetchImpl) {
|
|
@@ -5014,7 +5017,7 @@ function httpRequest(opts) {
|
|
|
5014
5017
|
}
|
|
5015
5018
|
__name(httpRequest, "httpRequest");
|
|
5016
5019
|
|
|
5017
|
-
// ../../node_modules/.pnpm/@trpc+client@10.43.
|
|
5020
|
+
// ../../node_modules/.pnpm/@trpc+client@10.43.6_@trpc+server@10.43.6/node_modules/@trpc/client/dist/httpBatchLink-204206a5.mjs
|
|
5018
5021
|
var throwFatalError = /* @__PURE__ */ __name(() => {
|
|
5019
5022
|
throw new Error("Something went wrong. Please submit an issue at https://github.com/trpc/trpc/issues/new");
|
|
5020
5023
|
}, "throwFatalError");
|
|
@@ -5244,7 +5247,7 @@ var batchRequester = /* @__PURE__ */ __name((requesterOpts) => {
|
|
|
5244
5247
|
}, "batchRequester");
|
|
5245
5248
|
var httpBatchLink = createHTTPBatchLink(batchRequester);
|
|
5246
5249
|
|
|
5247
|
-
// ../../node_modules/.pnpm/@trpc+client@10.43.
|
|
5250
|
+
// ../../node_modules/.pnpm/@trpc+client@10.43.6_@trpc+server@10.43.6/node_modules/@trpc/client/dist/links/httpLink.mjs
|
|
5248
5251
|
function httpLinkFactory(factoryOpts) {
|
|
5249
5252
|
return (opts) => {
|
|
5250
5253
|
const resolvedOpts = resolveHTTPLinkOptions(opts);
|
|
@@ -5296,7 +5299,7 @@ function httpLinkFactory(factoryOpts) {
|
|
|
5296
5299
|
}
|
|
5297
5300
|
__name(httpLinkFactory, "httpLinkFactory");
|
|
5298
5301
|
|
|
5299
|
-
// ../../node_modules/.pnpm/@trpc+client@10.43.
|
|
5302
|
+
// ../../node_modules/.pnpm/@trpc+client@10.43.6_@trpc+server@10.43.6/node_modules/@trpc/client/dist/index.mjs
|
|
5300
5303
|
var _TRPCUntypedClient = class _TRPCUntypedClient {
|
|
5301
5304
|
$request({ type, input, path, context = {} }) {
|
|
5302
5305
|
const chain$ = createChain({
|
|
@@ -5565,7 +5568,7 @@ var Registry = (
|
|
|
5565
5568
|
);
|
|
5566
5569
|
|
|
5567
5570
|
// ../../node_modules/.pnpm/superjson@1.13.3/node_modules/superjson/dist/esm/class-registry.js
|
|
5568
|
-
var __extends = function() {
|
|
5571
|
+
var __extends = /* @__PURE__ */ function() {
|
|
5569
5572
|
var extendStatics = /* @__PURE__ */ __name(function(d, b) {
|
|
5570
5573
|
extendStatics = Object.setPrototypeOf || {
|
|
5571
5574
|
__proto__: []
|
|
@@ -8183,18 +8186,22 @@ var ADDRESSES = {
|
|
|
8183
8186
|
USDC_CONTRACT_ADDRESS: GOERLI_USDC_CONTRACT_ADDRESS,
|
|
8184
8187
|
VAULT_CONTRACT_ADDRESS: "0x40caFF3f3B6706Da904a7895e0fC7F7922437e9B",
|
|
8185
8188
|
STATE_CHAIN_GATEWAY_ADDRESS: "0x38AA40B7b5a70d738baBf6699a45DacdDBBEB3fc"
|
|
8189
|
+
},
|
|
8190
|
+
[exports.ChainflipNetworks.mainnet]: {
|
|
8191
|
+
FLIP_CONTRACT_ADDRESS: "0x826180541412D574cf1336d22c0C0a287822678A",
|
|
8192
|
+
USDC_CONTRACT_ADDRESS: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
|
|
8193
|
+
VAULT_CONTRACT_ADDRESS: "0xF5e10380213880111522dd0efD3dbb45b9f62Bcc",
|
|
8194
|
+
STATE_CHAIN_GATEWAY_ADDRESS: "0x6995Ab7c4D7F4B03f467Cf4c8E920427d9621DBd"
|
|
8186
8195
|
}
|
|
8187
8196
|
};
|
|
8188
8197
|
|
|
8189
8198
|
// ../shared/src/contracts.ts
|
|
8190
8199
|
init_enums();
|
|
8191
|
-
init_guards();
|
|
8192
8200
|
var extractOverrides = /* @__PURE__ */ __name((transactionOverrides) => {
|
|
8193
8201
|
const { wait, ...ethersOverrides } = transactionOverrides;
|
|
8194
8202
|
return ethersOverrides;
|
|
8195
8203
|
}, "extractOverrides");
|
|
8196
8204
|
var getTokenContractAddress = /* @__PURE__ */ __name((asset, network) => {
|
|
8197
|
-
assert(network !== exports.ChainflipNetworks.mainnet, "Mainnet is not yet supported");
|
|
8198
8205
|
if (asset === exports.Assets.FLIP)
|
|
8199
8206
|
return ADDRESSES[network].FLIP_CONTRACT_ADDRESS;
|
|
8200
8207
|
if (asset === exports.Assets.USDC)
|
|
@@ -8217,10 +8224,7 @@ var approve = /* @__PURE__ */ __name(async (amount, spenderAddress, erc20, allow
|
|
|
8217
8224
|
const transaction = await erc20.approve(spenderAddress, amount - allowance, extractOverrides(txOpts));
|
|
8218
8225
|
return transaction.wait(txOpts.wait);
|
|
8219
8226
|
}, "approve");
|
|
8220
|
-
var getVaultManagerContractAddress = /* @__PURE__ */ __name((network) =>
|
|
8221
|
-
assert(network !== exports.ChainflipNetworks.mainnet, "Mainnet is not yet supported");
|
|
8222
|
-
return ADDRESSES[network].VAULT_CONTRACT_ADDRESS;
|
|
8223
|
-
}, "getVaultManagerContractAddress");
|
|
8227
|
+
var getVaultManagerContractAddress = /* @__PURE__ */ __name((network) => ADDRESSES[network].VAULT_CONTRACT_ADDRESS, "getVaultManagerContractAddress");
|
|
8224
8228
|
|
|
8225
8229
|
// ../shared/src/vault/executeSwap.ts
|
|
8226
8230
|
init_enums();
|
package/dist/swap.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { getEnvironment, getVaultManagerContractAddress, approve, getTokenContractAddress, checkAllowance, Vault__factory, extractOverrides } from './chunk-
|
|
2
|
-
import { numericString, ethereumAddress, dotAddress, btcAddress, ccmMetadataSchema } from './chunk-
|
|
3
|
-
import { __name, z, Chains, Assets, ChainflipNetworks, __publicField, assert, isTokenCall, isTokenSwap, chainContractIds, assetContractIds, assetDecimals, isTestnet } from './chunk-
|
|
4
|
-
export { Assets, ChainflipNetworks, Chains, assetChains, assetContractIds, assetDecimals, chainAssets, chainContractIds } from './chunk-
|
|
1
|
+
import { getEnvironment, getVaultManagerContractAddress, approve, getTokenContractAddress, checkAllowance, Vault__factory, extractOverrides } from './chunk-TCRJUCSA.mjs';
|
|
2
|
+
import { numericString, ethereumAddress, dotAddress, btcAddress, ccmMetadataSchema } from './chunk-N4SMMWKH.mjs';
|
|
3
|
+
import { __name, z, Chains, Assets, ChainflipNetworks, __publicField, assert, isTokenCall, isTokenSwap, chainContractIds, assetContractIds, assetDecimals, isTestnet } from './chunk-B2TZXL7C.mjs';
|
|
4
|
+
export { Assets, ChainflipNetworks, Chains, assetChains, assetContractIds, assetDecimals, chainAssets, chainContractIds } from './chunk-B2TZXL7C.mjs';
|
|
5
5
|
import { decodeAddress } from '@polkadot/util-crypto';
|
|
6
6
|
import axios from 'axios';
|
|
7
7
|
|
|
8
|
-
// ../../node_modules/.pnpm/@trpc+server@10.43.
|
|
8
|
+
// ../../node_modules/.pnpm/@trpc+server@10.43.6/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.43.
|
|
87
|
+
// ../../node_modules/.pnpm/@trpc+server@10.43.6/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.43.
|
|
192
|
+
// ../../node_modules/.pnpm/@trpc+client@10.43.6_@trpc+server@10.43.6/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.43.
|
|
216
|
+
// ../../node_modules/.pnpm/@trpc+client@10.43.6_@trpc+server@10.43.6/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.43.
|
|
269
|
+
// ../../node_modules/.pnpm/@trpc+client@10.43.6_@trpc+server@10.43.6/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.43.
|
|
327
|
+
// ../../node_modules/.pnpm/@trpc+server@10.43.6/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.43.
|
|
365
|
+
// ../../node_modules/.pnpm/@trpc+server@10.43.6/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.43.
|
|
403
|
+
// ../../node_modules/.pnpm/@trpc+client@10.43.6_@trpc+server@10.43.6/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.43.
|
|
547
|
+
// ../../node_modules/.pnpm/@trpc+client@10.43.6_@trpc+server@10.43.6/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.43.
|
|
777
|
+
// ../../node_modules/.pnpm/@trpc+client@10.43.6_@trpc+server@10.43.6/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.43.
|
|
829
|
+
// ../../node_modules/.pnpm/@trpc+client@10.43.6_@trpc+server@10.43.6/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({
|
|
@@ -1095,7 +1095,7 @@ var Registry = (
|
|
|
1095
1095
|
);
|
|
1096
1096
|
|
|
1097
1097
|
// ../../node_modules/.pnpm/superjson@1.13.3/node_modules/superjson/dist/esm/class-registry.js
|
|
1098
|
-
var __extends = function() {
|
|
1098
|
+
var __extends = /* @__PURE__ */ function() {
|
|
1099
1099
|
var extendStatics = /* @__PURE__ */ __name(function(d, b) {
|
|
1100
1100
|
extendStatics = Object.setPrototypeOf || {
|
|
1101
1101
|
__proto__: []
|
|
@@ -2520,7 +2520,7 @@ var _SwapSDK = class _SwapSDK {
|
|
|
2520
2520
|
async requestDepositAddress(depositAddressRequest) {
|
|
2521
2521
|
let response;
|
|
2522
2522
|
if (this.brokerConfig !== void 0) {
|
|
2523
|
-
const { requestSwapDepositAddress } = await import('./broker-
|
|
2523
|
+
const { requestSwapDepositAddress } = await import('./broker-LHEVQ6DT.mjs');
|
|
2524
2524
|
const result = await requestSwapDepositAddress(depositAddressRequest, this.brokerConfig);
|
|
2525
2525
|
response = {
|
|
2526
2526
|
id: `${result.issuedBlock}-${depositAddressRequest.srcChain}-${result.channelId}`,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chainflip/sdk",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.20",
|
|
4
4
|
"description": "",
|
|
5
5
|
"exports": {
|
|
6
6
|
"./swap": {
|
|
@@ -41,13 +41,13 @@
|
|
|
41
41
|
"access": "public"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@polkadot/util": "^12.
|
|
45
|
-
"@polkadot/util-crypto": "^12.
|
|
44
|
+
"@polkadot/util": "^12.6.1",
|
|
45
|
+
"@polkadot/util-crypto": "^12.6.1",
|
|
46
46
|
"axios": "^1.6.0",
|
|
47
47
|
"ethers": "6.8.1"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"tsup": "^
|
|
50
|
+
"tsup": "^8.0.0"
|
|
51
51
|
},
|
|
52
52
|
"scripts": {
|
|
53
53
|
"test": "jest --forceExit",
|
|
File without changes
|