@iconlake/client 0.2.0 → 0.2.1

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.mjs CHANGED
@@ -89868,8 +89868,8 @@ function isSet$4(e) {
89868
89868
  return e != null;
89869
89869
  }
89870
89870
  const msgTypes = [
89871
- ["/iconlake.icon.MsgUpdateClass", MsgUpdateClass],
89872
- ["/iconlake.icon.MsgMint", MsgMint]
89871
+ ["/iconlake.icon.MsgMint", MsgMint],
89872
+ ["/iconlake.icon.MsgUpdateClass", MsgUpdateClass]
89873
89873
  ];
89874
89874
  class HttpClient {
89875
89875
  constructor({ securityWorker: t, secure: n, format: p, ...u } = {}) {
@@ -89923,8 +89923,9 @@ class HttpClient {
89923
89923
  class Api extends HttpClient {
89924
89924
  constructor() {
89925
89925
  super(...arguments), this.queryClass = (t, n = {}) => this.request({
89926
- path: `/iconlake/icon/class/${t}`,
89926
+ path: "/iconlake/icon/class",
89927
89927
  method: "GET",
89928
+ query: t,
89928
89929
  format: "json",
89929
89930
  ...n
89930
89931
  }), this.queryClasses = (t, n = {}) => this.request({
@@ -89940,11 +89941,12 @@ class Api extends HttpClient {
89940
89941
  type: "application/json",
89941
89942
  format: "json",
89942
89943
  ...n
89943
- }), this.queryNFT = (t, n, p = {}) => this.request({
89944
- path: `/iconlake/icon/nft/${t}/${n}`,
89944
+ }), this.queryNFT = (t, n = {}) => this.request({
89945
+ path: "/iconlake/icon/nft",
89945
89946
  method: "GET",
89947
+ query: t,
89946
89948
  format: "json",
89947
- ...p
89949
+ ...n
89948
89950
  }), this.queryNFTs = (t, n = {}) => this.request({
89949
89951
  path: "/iconlake/icon/nfts",
89950
89952
  method: "GET",
@@ -90580,40 +90582,40 @@ const defaultFee = {
90580
90582
  amount: [],
90581
90583
  gas: "200000"
90582
90584
  }, txClient = ({ signer: e, prefix: t, addr: n } = { addr: "http://localhost:26657", prefix: "cosmos" }) => ({
90583
- async sendMsgUpdateClass({ value: p, fee: u, memo: g }) {
90585
+ async sendMsgMint({ value: p, fee: u, memo: g }) {
90584
90586
  if (!e)
90585
- throw new Error("TxClient:sendMsgUpdateClass: Unable to sign Tx. Signer is not present.");
90587
+ throw new Error("TxClient:sendMsgMint: Unable to sign Tx. Signer is not present.");
90586
90588
  try {
90587
90589
  const { address: y } = (await e.getAccounts())[0], P = await build$5.SigningStargateClient.connectWithSigner(n, e, { registry: registry$1, prefix: t });
90588
- let N = this.msgUpdateClass({ value: MsgUpdateClass.fromPartial(p) });
90590
+ let N = this.msgMint({ value: MsgMint.fromPartial(p) });
90589
90591
  return await P.signAndBroadcast(y, [N], u || defaultFee, g);
90590
90592
  } catch (y) {
90591
- throw new Error("TxClient:sendMsgUpdateClass: Could not broadcast Tx: " + y.message);
90593
+ throw new Error("TxClient:sendMsgMint: Could not broadcast Tx: " + y.message);
90592
90594
  }
90593
90595
  },
90594
- async sendMsgMint({ value: p, fee: u, memo: g }) {
90596
+ async sendMsgUpdateClass({ value: p, fee: u, memo: g }) {
90595
90597
  if (!e)
90596
- throw new Error("TxClient:sendMsgMint: Unable to sign Tx. Signer is not present.");
90598
+ throw new Error("TxClient:sendMsgUpdateClass: Unable to sign Tx. Signer is not present.");
90597
90599
  try {
90598
90600
  const { address: y } = (await e.getAccounts())[0], P = await build$5.SigningStargateClient.connectWithSigner(n, e, { registry: registry$1, prefix: t });
90599
- let N = this.msgMint({ value: MsgMint.fromPartial(p) });
90601
+ let N = this.msgUpdateClass({ value: MsgUpdateClass.fromPartial(p) });
90600
90602
  return await P.signAndBroadcast(y, [N], u || defaultFee, g);
90601
90603
  } catch (y) {
90602
- throw new Error("TxClient:sendMsgMint: Could not broadcast Tx: " + y.message);
90604
+ throw new Error("TxClient:sendMsgUpdateClass: Could not broadcast Tx: " + y.message);
90603
90605
  }
90604
90606
  },
90605
- msgUpdateClass({ value: p }) {
90607
+ msgMint({ value: p }) {
90606
90608
  try {
90607
- return { typeUrl: "/iconlake.icon.MsgUpdateClass", value: MsgUpdateClass.fromPartial(p) };
90609
+ return { typeUrl: "/iconlake.icon.MsgMint", value: MsgMint.fromPartial(p) };
90608
90610
  } catch (u) {
90609
- throw new Error("TxClient:MsgUpdateClass: Could not create message: " + u.message);
90611
+ throw new Error("TxClient:MsgMint: Could not create message: " + u.message);
90610
90612
  }
90611
90613
  },
90612
- msgMint({ value: p }) {
90614
+ msgUpdateClass({ value: p }) {
90613
90615
  try {
90614
- return { typeUrl: "/iconlake.icon.MsgMint", value: MsgMint.fromPartial(p) };
90616
+ return { typeUrl: "/iconlake.icon.MsgUpdateClass", value: MsgUpdateClass.fromPartial(p) };
90615
90617
  } catch (u) {
90616
- throw new Error("TxClient:MsgMint: Could not create message: " + u.message);
90618
+ throw new Error("TxClient:MsgUpdateClass: Could not create message: " + u.message);
90617
90619
  }
90618
90620
  }
90619
90621
  }), queryClient = ({ addr: e } = { addr: "http://localhost:1317" }) => new Api({ baseURL: e });