@medialane/sdk 0.133.0 → 0.135.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/{errors-DEz42hh5.d.cts → errors-BQGalSIU.d.cts} +205 -6
- package/dist/{errors-DxBa5Wne.d.ts → errors-BsNfDL85.d.ts} +205 -6
- package/dist/index.cjs +213 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +147 -3
- package/dist/index.d.ts +147 -3
- package/dist/index.js +210 -3
- package/dist/index.js.map +1 -1
- package/dist/starknet/index.cjs +130 -2
- package/dist/starknet/index.cjs.map +1 -1
- package/dist/starknet/index.d.cts +2 -2
- package/dist/starknet/index.d.ts +2 -2
- package/dist/starknet/index.js +130 -2
- package/dist/starknet/index.js.map +1 -1
- package/package.json +1 -1
package/dist/starknet/index.cjs
CHANGED
|
@@ -350,6 +350,11 @@ var ApiClient = class {
|
|
|
350
350
|
getActiveOrdersForToken(contract, tokenId) {
|
|
351
351
|
return this.get(`/v1/orders/token/${this.addr(contract)}/${tokenId}`);
|
|
352
352
|
}
|
|
353
|
+
/** Offers others made on the address's assets. */
|
|
354
|
+
getReceivedOffers(address, opts = {}) {
|
|
355
|
+
const params = new URLSearchParams({ page: String(opts.page ?? 1), limit: String(opts.limit ?? 50) });
|
|
356
|
+
return this.get(`/v1/orders/received/${this.addr(address)}?${params}`);
|
|
357
|
+
}
|
|
353
358
|
getOrdersByUser(address, page = 1, limit = 20) {
|
|
354
359
|
return this.get(
|
|
355
360
|
`/v1/orders/user/${this.addr(address)}?page=${page}&limit=${limit}`
|
|
@@ -517,6 +522,11 @@ var ApiClient = class {
|
|
|
517
522
|
uploadMetadata(metadata) {
|
|
518
523
|
return this.post("/v1/metadata/upload", metadata);
|
|
519
524
|
}
|
|
525
|
+
/** Pins several JSON files as one IPFS directory, e.g. a drop's token metadata. */
|
|
526
|
+
async uploadMetadataDirectory(files) {
|
|
527
|
+
const res = await this.post("/v1/metadata/upload-directory", { files });
|
|
528
|
+
return res.data;
|
|
529
|
+
}
|
|
520
530
|
resolveMetadata(uri) {
|
|
521
531
|
const params = new URLSearchParams({ uri });
|
|
522
532
|
return this.get(`/v1/metadata/resolve?${params.toString()}`);
|
|
@@ -848,7 +858,7 @@ var ApiClient = class {
|
|
|
848
858
|
});
|
|
849
859
|
}
|
|
850
860
|
getPopCollections(opts = {}) {
|
|
851
|
-
return this.getCollections(opts.page ?? 1, opts.limit ?? 20, void 0, opts.sort, "
|
|
861
|
+
return this.getCollections(opts.page ?? 1, opts.limit ?? 20, void 0, opts.sort, "pop-protocol");
|
|
852
862
|
}
|
|
853
863
|
async getPopEligibility(collection, wallet) {
|
|
854
864
|
const res = await this.get(
|
|
@@ -868,6 +878,7 @@ var ApiClient = class {
|
|
|
868
878
|
if (opts.page) params.set("page", String(opts.page));
|
|
869
879
|
if (opts.limit) params.set("limit", String(opts.limit));
|
|
870
880
|
if (opts.service) params.set("service", opts.service);
|
|
881
|
+
if (opts.sort) params.set("sort", opts.sort);
|
|
871
882
|
if (opts.chain) params.set("chain", opts.chain);
|
|
872
883
|
const qs = params.toString();
|
|
873
884
|
return this.get(`/v1/coins${qs ? `?${qs}` : ""}`);
|
|
@@ -898,7 +909,7 @@ var ApiClient = class {
|
|
|
898
909
|
});
|
|
899
910
|
}
|
|
900
911
|
getDropCollections(opts = {}) {
|
|
901
|
-
return this.getCollections(opts.page ?? 1, opts.limit ?? 20, void 0, opts.sort, "
|
|
912
|
+
return this.getCollections(opts.page ?? 1, opts.limit ?? 20, void 0, opts.sort, "drop-collection");
|
|
902
913
|
}
|
|
903
914
|
async getDropMintStatus(collection, wallet) {
|
|
904
915
|
const res = await this.get(
|
|
@@ -906,6 +917,123 @@ var ApiClient = class {
|
|
|
906
917
|
);
|
|
907
918
|
return res.data;
|
|
908
919
|
}
|
|
920
|
+
async getDropInfo(contract) {
|
|
921
|
+
const res = await this.request(
|
|
922
|
+
`/v1/drop/${this.addr(contract)}/info`,
|
|
923
|
+
{ method: "GET" },
|
|
924
|
+
{ allow404: true }
|
|
925
|
+
);
|
|
926
|
+
return res?.data ?? null;
|
|
927
|
+
}
|
|
928
|
+
async getDropState(contract) {
|
|
929
|
+
const res = await this.get(`/v1/drop/${this.addr(contract)}/state`);
|
|
930
|
+
return res.data;
|
|
931
|
+
}
|
|
932
|
+
async getTicket(contract, tokenId) {
|
|
933
|
+
const res = await this.get(`/v1/tickets/${this.addr(contract)}/${tokenId}`);
|
|
934
|
+
return res.data;
|
|
935
|
+
}
|
|
936
|
+
async getTicketCount(contract) {
|
|
937
|
+
const res = await this.get(`/v1/tickets/${this.addr(contract)}/count`);
|
|
938
|
+
return res.data.count;
|
|
939
|
+
}
|
|
940
|
+
async getClubMembership(contract, tokenId) {
|
|
941
|
+
const res = await this.get(`/v1/club/${this.addr(contract)}/${tokenId}`);
|
|
942
|
+
return res.data;
|
|
943
|
+
}
|
|
944
|
+
async isClubMember(contract, tokenId, wallet) {
|
|
945
|
+
const res = await this.get(
|
|
946
|
+
`/v1/club/${this.addr(contract)}/${tokenId}/member/${this.addr(wallet)}`
|
|
947
|
+
);
|
|
948
|
+
return res.data.isMember;
|
|
949
|
+
}
|
|
950
|
+
async getIpNftTokenData(contract, tokenId) {
|
|
951
|
+
const res = await this.get(`/v1/ipnft/${this.addr(contract)}/${tokenId}`);
|
|
952
|
+
return res.data;
|
|
953
|
+
}
|
|
954
|
+
async getPlatformStats() {
|
|
955
|
+
const res = await this.get("/v1/stats");
|
|
956
|
+
return res.data;
|
|
957
|
+
}
|
|
958
|
+
getTokens(query = {}) {
|
|
959
|
+
const params = new URLSearchParams();
|
|
960
|
+
if (query.page !== void 0) params.set("page", String(query.page));
|
|
961
|
+
if (query.limit !== void 0) params.set("limit", String(query.limit));
|
|
962
|
+
if (query.sort) params.set("sort", query.sort);
|
|
963
|
+
if (query.ipType) params.set("ipType", query.ipType);
|
|
964
|
+
if (query.derivatives) params.set("derivatives", query.derivatives);
|
|
965
|
+
const qs = params.toString();
|
|
966
|
+
return this.get(`/v1/tokens${qs ? `?${qs}` : ""}`);
|
|
967
|
+
}
|
|
968
|
+
async isCreatorHidden(wallet) {
|
|
969
|
+
const res = await this.get(`/v1/creators/${this.addr(wallet)}/hidden`);
|
|
970
|
+
return res.isHidden;
|
|
971
|
+
}
|
|
972
|
+
getMyUsernameClaim(siwsToken) {
|
|
973
|
+
return this.request("/v1/username-claims/me", {
|
|
974
|
+
method: "GET",
|
|
975
|
+
headers: this.bearer(siwsToken)
|
|
976
|
+
});
|
|
977
|
+
}
|
|
978
|
+
checkUsernameAvailability(username) {
|
|
979
|
+
return this.get(
|
|
980
|
+
`/v1/username-claims/check/${encodeURIComponent(username)}`
|
|
981
|
+
);
|
|
982
|
+
}
|
|
983
|
+
async submitUsernameClaim(username, siwsToken, notifyEmail) {
|
|
984
|
+
const res = await this.request("/v1/username-claims", {
|
|
985
|
+
method: "POST",
|
|
986
|
+
headers: this.bearer(siwsToken),
|
|
987
|
+
body: JSON.stringify({ username, ...notifyEmail ? { notifyEmail } : {} })
|
|
988
|
+
});
|
|
989
|
+
return res.claim;
|
|
990
|
+
}
|
|
991
|
+
async submitReport(report, siwsToken) {
|
|
992
|
+
await this.request("/v1/reports", {
|
|
993
|
+
method: "POST",
|
|
994
|
+
headers: this.bearer(siwsToken),
|
|
995
|
+
body: JSON.stringify(report)
|
|
996
|
+
});
|
|
997
|
+
}
|
|
998
|
+
generateWallet(newWalletSiwsToken, siwsToken) {
|
|
999
|
+
return this.request("/v1/users/me/generate-wallet", {
|
|
1000
|
+
method: "POST",
|
|
1001
|
+
headers: this.bearer(siwsToken),
|
|
1002
|
+
body: JSON.stringify({ newWalletSiwsToken })
|
|
1003
|
+
});
|
|
1004
|
+
}
|
|
1005
|
+
syncCoin(coinAddress, owner) {
|
|
1006
|
+
return this.post("/v1/coins/sync", { coinAddress, ...owner ? { owner } : {} });
|
|
1007
|
+
}
|
|
1008
|
+
registerCollection(contractAddress) {
|
|
1009
|
+
return this.post("/v1/collections/register", { contractAddress });
|
|
1010
|
+
}
|
|
1011
|
+
getSponsorshipOffers(query = {}) {
|
|
1012
|
+
const params = new URLSearchParams({ limit: String(query.limit ?? 50) });
|
|
1013
|
+
if (query.nftContract) params.set("nftContract", query.nftContract);
|
|
1014
|
+
if (query.author) params.set("author", query.author);
|
|
1015
|
+
if (query.owner) params.set("owner", query.owner);
|
|
1016
|
+
if (query.open !== void 0) params.set("open", String(query.open));
|
|
1017
|
+
return this.get(`/v1/sponsorship/offers?${params}`);
|
|
1018
|
+
}
|
|
1019
|
+
async getSponsorshipBids(offerId) {
|
|
1020
|
+
const res = await this.get(`/v1/sponsorship/offers/${encodeURIComponent(offerId)}/bids`);
|
|
1021
|
+
return res.data;
|
|
1022
|
+
}
|
|
1023
|
+
getSponsorshipProposals(query = {}) {
|
|
1024
|
+
const params = new URLSearchParams({ limit: String(query.limit ?? 50) });
|
|
1025
|
+
if (query.nftContract) params.set("nftContract", query.nftContract);
|
|
1026
|
+
if (query.proposer) params.set("proposer", query.proposer);
|
|
1027
|
+
if (query.owner) params.set("owner", query.owner);
|
|
1028
|
+
if (query.open !== void 0) params.set("open", String(query.open));
|
|
1029
|
+
return this.get(`/v1/sponsorship/proposals?${params}`);
|
|
1030
|
+
}
|
|
1031
|
+
getSponsorshipLicenses(query = {}) {
|
|
1032
|
+
const params = new URLSearchParams({ limit: String(query.limit ?? 50) });
|
|
1033
|
+
if (query.holder) params.set("holder", query.holder);
|
|
1034
|
+
if (query.author) params.set("author", query.author);
|
|
1035
|
+
return this.get(`/v1/sponsorship/licenses?${params}`);
|
|
1036
|
+
}
|
|
909
1037
|
async getRewards(address) {
|
|
910
1038
|
const res = await this.get(`/v1/rewards/${this.addr(address)}`);
|
|
911
1039
|
return res.data;
|