@pear-protocol/core-sdk 2.1.0 → 2.2.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.
- package/dist/core/index.d.ts +297 -232
- package/dist/core/index.js +41 -28
- package/package.json +3 -3
package/dist/core/index.js
CHANGED
|
@@ -719,52 +719,80 @@ class Core {
|
|
|
719
719
|
};
|
|
720
720
|
misc = {
|
|
721
721
|
lighter: {
|
|
722
|
+
...this.buildLighterMiscRoutes("/misc/lighter"),
|
|
723
|
+
/** Mints the Fun.xyz universal deposit addresses that credit a wallet's Lighter account. */
|
|
724
|
+
createUda: /* @__PURE__ */ __name(async (body, headers) => {
|
|
725
|
+
return await this.client.fetch(`/misc/lighter/uda`, {
|
|
726
|
+
method: "POST",
|
|
727
|
+
headers,
|
|
728
|
+
body
|
|
729
|
+
});
|
|
730
|
+
}, "createUda"),
|
|
731
|
+
/** Reads the deposits the Fun.xyz bridge has seen for one wallet. */
|
|
732
|
+
listUdaDeposits: /* @__PURE__ */ __name(async (walletAddress, headers) => {
|
|
733
|
+
return await this.client.fetch(`/misc/lighter/uda/${encodeURIComponent(walletAddress)}`, {
|
|
734
|
+
method: "GET",
|
|
735
|
+
headers
|
|
736
|
+
});
|
|
737
|
+
}, "listUdaDeposits")
|
|
738
|
+
},
|
|
739
|
+
// Lighter's Robinhood Chain deployment: the same signer surface bound to the RHC host and
|
|
740
|
+
// chain id. The Fun.xyz UDA routes stay zkLighter-only, so this client carries no deposit
|
|
741
|
+
// surface at all.
|
|
742
|
+
lighterRhc: this.buildLighterMiscRoutes("/misc/lighter-rhc")
|
|
743
|
+
};
|
|
744
|
+
/**
|
|
745
|
+
* The signer routes every Lighter deployment exposes, bound to one deployment's base path.
|
|
746
|
+
* zkLighter and Robinhood Chain share this whole surface; only the deployment behind it differs.
|
|
747
|
+
*/
|
|
748
|
+
buildLighterMiscRoutes(basePath) {
|
|
749
|
+
return {
|
|
722
750
|
createApiKey: /* @__PURE__ */ __name(async (body, headers) => {
|
|
723
|
-
return await this.client.fetch(
|
|
751
|
+
return await this.client.fetch(`${basePath}/create-api-key`, {
|
|
724
752
|
method: "POST",
|
|
725
753
|
headers,
|
|
726
754
|
body
|
|
727
755
|
});
|
|
728
756
|
}, "createApiKey"),
|
|
729
757
|
changePubKey: /* @__PURE__ */ __name(async (body, headers) => {
|
|
730
|
-
return await this.client.fetch(
|
|
758
|
+
return await this.client.fetch(`${basePath}/change-pub-key`, {
|
|
731
759
|
method: "POST",
|
|
732
760
|
headers,
|
|
733
761
|
body
|
|
734
762
|
});
|
|
735
763
|
}, "changePubKey"),
|
|
736
764
|
prepareApproveIntegrator: /* @__PURE__ */ __name(async (body, headers) => {
|
|
737
|
-
return await this.client.fetch(
|
|
765
|
+
return await this.client.fetch(`${basePath}/prepare-approve-integrator`, {
|
|
738
766
|
method: "POST",
|
|
739
767
|
headers,
|
|
740
768
|
body
|
|
741
769
|
});
|
|
742
770
|
}, "prepareApproveIntegrator"),
|
|
743
771
|
submitApproveIntegrator: /* @__PURE__ */ __name(async (body, headers) => {
|
|
744
|
-
return await this.client.fetch(
|
|
772
|
+
return await this.client.fetch(`${basePath}/submit-approve-integrator`, {
|
|
745
773
|
method: "POST",
|
|
746
774
|
headers,
|
|
747
775
|
body
|
|
748
776
|
});
|
|
749
777
|
}, "submitApproveIntegrator"),
|
|
750
778
|
createAuthToken: /* @__PURE__ */ __name(async (body, headers) => {
|
|
751
|
-
return await this.client.fetch(
|
|
779
|
+
return await this.client.fetch(`${basePath}/create-auth-token`, {
|
|
752
780
|
method: "POST",
|
|
753
781
|
headers,
|
|
754
782
|
body
|
|
755
783
|
});
|
|
756
784
|
}, "createAuthToken"),
|
|
757
|
-
/** Prepares a fast
|
|
785
|
+
/** Prepares a fast collateral withdrawal for L1 wallet authorization. */
|
|
758
786
|
prepareFastWithdraw: /* @__PURE__ */ __name(async (body, headers) => {
|
|
759
|
-
return await this.client.fetch(
|
|
787
|
+
return await this.client.fetch(`${basePath}/prepare-fast-withdraw`, {
|
|
760
788
|
method: "POST",
|
|
761
789
|
headers,
|
|
762
790
|
body
|
|
763
791
|
});
|
|
764
792
|
}, "prepareFastWithdraw"),
|
|
765
|
-
/** Submits a wallet-authorized fast
|
|
793
|
+
/** Submits a wallet-authorized fast collateral withdrawal. */
|
|
766
794
|
submitFastWithdraw: /* @__PURE__ */ __name(async (body, headers) => {
|
|
767
|
-
return await this.client.fetch(
|
|
795
|
+
return await this.client.fetch(`${basePath}/submit-fast-withdraw`, {
|
|
768
796
|
method: "POST",
|
|
769
797
|
headers,
|
|
770
798
|
body
|
|
@@ -772,29 +800,14 @@ class Core {
|
|
|
772
800
|
}, "submitFastWithdraw"),
|
|
773
801
|
/** Moves a Lighter account onto the standard, plus, or premium tier. */
|
|
774
802
|
changeAccountTier: /* @__PURE__ */ __name(async (body, headers) => {
|
|
775
|
-
return await this.client.fetch(
|
|
803
|
+
return await this.client.fetch(`${basePath}/change-account-tier`, {
|
|
776
804
|
method: "POST",
|
|
777
805
|
headers,
|
|
778
806
|
body
|
|
779
807
|
});
|
|
780
|
-
}, "changeAccountTier")
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
return await this.client.fetch(`/misc/lighter/uda`, {
|
|
784
|
-
method: "POST",
|
|
785
|
-
headers,
|
|
786
|
-
body
|
|
787
|
-
});
|
|
788
|
-
}, "createUda"),
|
|
789
|
-
/** Reads the deposits the Fun.xyz bridge has seen for one wallet. */
|
|
790
|
-
listUdaDeposits: /* @__PURE__ */ __name(async (walletAddress, headers) => {
|
|
791
|
-
return await this.client.fetch(`/misc/lighter/uda/${encodeURIComponent(walletAddress)}`, {
|
|
792
|
-
method: "GET",
|
|
793
|
-
headers
|
|
794
|
-
});
|
|
795
|
-
}, "listUdaDeposits")
|
|
796
|
-
}
|
|
797
|
-
};
|
|
808
|
+
}, "changeAccountTier")
|
|
809
|
+
};
|
|
810
|
+
}
|
|
798
811
|
statistics = {
|
|
799
812
|
volume: /* @__PURE__ */ __name(async (query, headers) => {
|
|
800
813
|
return await this.client.fetch(`/statistics/volume`, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pear-protocol/core-sdk",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2.0",
|
|
4
4
|
"description": "Pear Protocol Core SDK",
|
|
5
5
|
"private": false,
|
|
6
6
|
"type": "module",
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
"typecheck": "tsc --noEmit"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@pear-protocol/types": "^2.
|
|
30
|
-
"@pear-protocol/utils": "^1.
|
|
29
|
+
"@pear-protocol/types": "^2.2.0",
|
|
30
|
+
"@pear-protocol/utils": "^1.1.0",
|
|
31
31
|
"qs": "^6.14.0"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|