@jimmygu/sfa-sdk-test 1.0.0 → 1.0.2
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/index.d.mts +6 -5
- package/dist/index.d.ts +6 -5
- package/dist/index.js +25 -8
- package/dist/index.mjs +25 -8
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -765,17 +765,17 @@ declare class HyperliquidService {
|
|
|
765
765
|
error: string | null;
|
|
766
766
|
}>;
|
|
767
767
|
transfer(params: HyperliquidTransferParams): Promise<string>;
|
|
768
|
-
deposit(params: HyperliquidDepositParams): Promise<
|
|
769
|
-
getStatus(params: HyperliquidGetStatusParams): Promise<
|
|
768
|
+
deposit(params: HyperliquidDepositParams): Promise<unknown>;
|
|
769
|
+
getStatus(params: HyperliquidGetStatusParams): Promise<unknown>;
|
|
770
770
|
protected generatePermit(params: HyperliquidGeneratePermitParams): Promise<{
|
|
771
|
-
|
|
771
|
+
amount: string;
|
|
772
|
+
deadline: number;
|
|
772
773
|
owner: string;
|
|
773
774
|
r: string;
|
|
774
775
|
s: string;
|
|
775
776
|
spender: string;
|
|
776
|
-
|
|
777
|
+
token_address: string;
|
|
777
778
|
v: 28 | 27;
|
|
778
|
-
value: string;
|
|
779
779
|
}>;
|
|
780
780
|
}
|
|
781
781
|
declare const Hyperliquid: HyperliquidService;
|
|
@@ -812,6 +812,7 @@ interface HyperliquidDepositParams extends HyperliquidTransferParams {
|
|
|
812
812
|
txhash: string;
|
|
813
813
|
}
|
|
814
814
|
interface HyperliquidGetStatusParams {
|
|
815
|
+
depositId: string;
|
|
815
816
|
}
|
|
816
817
|
|
|
817
818
|
declare const tokens: TokenConfig[];
|
package/dist/index.d.ts
CHANGED
|
@@ -765,17 +765,17 @@ declare class HyperliquidService {
|
|
|
765
765
|
error: string | null;
|
|
766
766
|
}>;
|
|
767
767
|
transfer(params: HyperliquidTransferParams): Promise<string>;
|
|
768
|
-
deposit(params: HyperliquidDepositParams): Promise<
|
|
769
|
-
getStatus(params: HyperliquidGetStatusParams): Promise<
|
|
768
|
+
deposit(params: HyperliquidDepositParams): Promise<unknown>;
|
|
769
|
+
getStatus(params: HyperliquidGetStatusParams): Promise<unknown>;
|
|
770
770
|
protected generatePermit(params: HyperliquidGeneratePermitParams): Promise<{
|
|
771
|
-
|
|
771
|
+
amount: string;
|
|
772
|
+
deadline: number;
|
|
772
773
|
owner: string;
|
|
773
774
|
r: string;
|
|
774
775
|
s: string;
|
|
775
776
|
spender: string;
|
|
776
|
-
|
|
777
|
+
token_address: string;
|
|
777
778
|
v: 28 | 27;
|
|
778
|
-
value: string;
|
|
779
779
|
}>;
|
|
780
780
|
}
|
|
781
781
|
declare const Hyperliquid: HyperliquidService;
|
|
@@ -812,6 +812,7 @@ interface HyperliquidDepositParams extends HyperliquidTransferParams {
|
|
|
812
812
|
txhash: string;
|
|
813
813
|
}
|
|
814
814
|
interface HyperliquidGetStatusParams {
|
|
815
|
+
depositId: string;
|
|
815
816
|
}
|
|
816
817
|
|
|
817
818
|
declare const tokens: TokenConfig[];
|
package/dist/index.js
CHANGED
|
@@ -4863,19 +4863,23 @@ var HyperliquidService = class {
|
|
|
4863
4863
|
});
|
|
4864
4864
|
console.log("permitParams: %o", permitParams);
|
|
4865
4865
|
const depositParams = {
|
|
4866
|
-
sender: quote?.quoteParam?.recipient,
|
|
4867
|
-
from_addr: quote?.quoteParam?.refundTo,
|
|
4868
4866
|
deposit_address: quote?.quote?.depositAddress,
|
|
4867
|
+
from_addr: quote?.quoteParam?.refundTo,
|
|
4868
|
+
from_amount: quote?.quote?.amountIn,
|
|
4869
|
+
from_chain: quote?.quoteParam?.fromToken?.blockchain,
|
|
4870
|
+
from_hash: txhash,
|
|
4869
4871
|
from_token: quote?.quoteParam?.fromToken?.contractAddress,
|
|
4872
|
+
sender: quote?.quoteParam?.recipient,
|
|
4873
|
+
to_amount: quote?.quoteParam?.amountWei,
|
|
4874
|
+
to_chain: quote?.quoteParam?.toToken?.blockchain,
|
|
4870
4875
|
to_token: quote?.quoteParam?.toToken?.contractAddress,
|
|
4871
|
-
from_hash: txhash,
|
|
4872
4876
|
type: Service.OneClick,
|
|
4873
4877
|
permit: permitParams
|
|
4874
4878
|
};
|
|
4875
4879
|
console.log("depositParams: %o", depositParams);
|
|
4876
4880
|
const depositRes = await request(OpenAPI, {
|
|
4877
4881
|
method: "POST",
|
|
4878
|
-
url: "/v0/deposit
|
|
4882
|
+
url: "/v0/deposit",
|
|
4879
4883
|
body: depositParams,
|
|
4880
4884
|
mediaType: "application/json",
|
|
4881
4885
|
errors: {
|
|
@@ -4884,8 +4888,21 @@ var HyperliquidService = class {
|
|
|
4884
4888
|
}
|
|
4885
4889
|
});
|
|
4886
4890
|
console.log("depositRes: %o", depositRes);
|
|
4891
|
+
return depositRes;
|
|
4887
4892
|
}
|
|
4888
4893
|
async getStatus(params) {
|
|
4894
|
+
return request(OpenAPI, {
|
|
4895
|
+
method: "GET",
|
|
4896
|
+
url: "/v0/deposit",
|
|
4897
|
+
query: {
|
|
4898
|
+
deposit_id: params.depositId
|
|
4899
|
+
},
|
|
4900
|
+
mediaType: "application/json",
|
|
4901
|
+
errors: {
|
|
4902
|
+
400: `Bad Request - Invalid input data`,
|
|
4903
|
+
401: `Unauthorized - JWT token is invalid`
|
|
4904
|
+
}
|
|
4905
|
+
});
|
|
4889
4906
|
}
|
|
4890
4907
|
async generatePermit(params) {
|
|
4891
4908
|
const {
|
|
@@ -4938,14 +4955,14 @@ var HyperliquidService = class {
|
|
|
4938
4955
|
});
|
|
4939
4956
|
const { v, r, s } = import_ethers.ethers.Signature.from(signature);
|
|
4940
4957
|
const permitParams = {
|
|
4941
|
-
|
|
4958
|
+
amount: value,
|
|
4959
|
+
deadline,
|
|
4942
4960
|
owner: address,
|
|
4943
4961
|
r,
|
|
4944
4962
|
s,
|
|
4945
4963
|
spender: SPENDER,
|
|
4946
|
-
|
|
4947
|
-
v
|
|
4948
|
-
value
|
|
4964
|
+
token_address: tokenAddress,
|
|
4965
|
+
v
|
|
4949
4966
|
};
|
|
4950
4967
|
console.log("permitParams: %o", permitParams);
|
|
4951
4968
|
return permitParams;
|
package/dist/index.mjs
CHANGED
|
@@ -4802,19 +4802,23 @@ var HyperliquidService = class {
|
|
|
4802
4802
|
});
|
|
4803
4803
|
console.log("permitParams: %o", permitParams);
|
|
4804
4804
|
const depositParams = {
|
|
4805
|
-
sender: quote?.quoteParam?.recipient,
|
|
4806
|
-
from_addr: quote?.quoteParam?.refundTo,
|
|
4807
4805
|
deposit_address: quote?.quote?.depositAddress,
|
|
4806
|
+
from_addr: quote?.quoteParam?.refundTo,
|
|
4807
|
+
from_amount: quote?.quote?.amountIn,
|
|
4808
|
+
from_chain: quote?.quoteParam?.fromToken?.blockchain,
|
|
4809
|
+
from_hash: txhash,
|
|
4808
4810
|
from_token: quote?.quoteParam?.fromToken?.contractAddress,
|
|
4811
|
+
sender: quote?.quoteParam?.recipient,
|
|
4812
|
+
to_amount: quote?.quoteParam?.amountWei,
|
|
4813
|
+
to_chain: quote?.quoteParam?.toToken?.blockchain,
|
|
4809
4814
|
to_token: quote?.quoteParam?.toToken?.contractAddress,
|
|
4810
|
-
from_hash: txhash,
|
|
4811
4815
|
type: Service.OneClick,
|
|
4812
4816
|
permit: permitParams
|
|
4813
4817
|
};
|
|
4814
4818
|
console.log("depositParams: %o", depositParams);
|
|
4815
4819
|
const depositRes = await request(OpenAPI, {
|
|
4816
4820
|
method: "POST",
|
|
4817
|
-
url: "/v0/deposit
|
|
4821
|
+
url: "/v0/deposit",
|
|
4818
4822
|
body: depositParams,
|
|
4819
4823
|
mediaType: "application/json",
|
|
4820
4824
|
errors: {
|
|
@@ -4823,8 +4827,21 @@ var HyperliquidService = class {
|
|
|
4823
4827
|
}
|
|
4824
4828
|
});
|
|
4825
4829
|
console.log("depositRes: %o", depositRes);
|
|
4830
|
+
return depositRes;
|
|
4826
4831
|
}
|
|
4827
4832
|
async getStatus(params) {
|
|
4833
|
+
return request(OpenAPI, {
|
|
4834
|
+
method: "GET",
|
|
4835
|
+
url: "/v0/deposit",
|
|
4836
|
+
query: {
|
|
4837
|
+
deposit_id: params.depositId
|
|
4838
|
+
},
|
|
4839
|
+
mediaType: "application/json",
|
|
4840
|
+
errors: {
|
|
4841
|
+
400: `Bad Request - Invalid input data`,
|
|
4842
|
+
401: `Unauthorized - JWT token is invalid`
|
|
4843
|
+
}
|
|
4844
|
+
});
|
|
4828
4845
|
}
|
|
4829
4846
|
async generatePermit(params) {
|
|
4830
4847
|
const {
|
|
@@ -4877,14 +4894,14 @@ var HyperliquidService = class {
|
|
|
4877
4894
|
});
|
|
4878
4895
|
const { v, r, s } = ethers.Signature.from(signature);
|
|
4879
4896
|
const permitParams = {
|
|
4880
|
-
|
|
4897
|
+
amount: value,
|
|
4898
|
+
deadline,
|
|
4881
4899
|
owner: address,
|
|
4882
4900
|
r,
|
|
4883
4901
|
s,
|
|
4884
4902
|
spender: SPENDER,
|
|
4885
|
-
|
|
4886
|
-
v
|
|
4887
|
-
value
|
|
4903
|
+
token_address: tokenAddress,
|
|
4904
|
+
v
|
|
4888
4905
|
};
|
|
4889
4906
|
console.log("permitParams: %o", permitParams);
|
|
4890
4907
|
return permitParams;
|