@console-wallet/dapp-sdk 1.0.0 → 1.1.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.
Files changed (59) hide show
  1. package/CHANGELOG.md +20 -192
  2. package/README.md +20 -16
  3. package/dist/cjs/api/client.api.d.ts +23 -0
  4. package/dist/cjs/api/generated-wallet-api.d.ts +189 -1
  5. package/dist/cjs/api/generated-wallet-api.js +129 -0
  6. package/dist/cjs/api/generated-wallet-api.js.map +1 -1
  7. package/dist/cjs/helpers/handleResponce.helper.d.ts +1 -1
  8. package/dist/cjs/index.d.ts +4 -0
  9. package/dist/cjs/requests/getCoinsBalance.d.ts +15 -0
  10. package/dist/cjs/requests/getCoinsBalance.js +37 -0
  11. package/dist/cjs/requests/getCoinsBalance.js.map +1 -0
  12. package/dist/cjs/requests/getNodeOffers.d.ts +13 -0
  13. package/dist/cjs/requests/getNodeOffers.js +35 -0
  14. package/dist/cjs/requests/getNodeOffers.js.map +1 -0
  15. package/dist/cjs/requests/getNodeTransfer.d.ts +13 -0
  16. package/dist/cjs/requests/getNodeTransfer.js +35 -0
  17. package/dist/cjs/requests/getNodeTransfer.js.map +1 -0
  18. package/dist/cjs/requests/getNodeTransfers.d.ts +15 -0
  19. package/dist/cjs/requests/getNodeTransfers.js +37 -0
  20. package/dist/cjs/requests/getNodeTransfers.js.map +1 -0
  21. package/dist/cjs/requests/index.d.ts +4 -0
  22. package/dist/cjs/requests/index.js +4 -0
  23. package/dist/cjs/requests/index.js.map +1 -1
  24. package/dist/cjs/types/communication.types.d.ts +5 -1
  25. package/dist/cjs/types/communication.types.js +4 -0
  26. package/dist/cjs/types/communication.types.js.map +1 -1
  27. package/dist/cjs/types/history.types.d.ts +24 -0
  28. package/dist/cjs/types/token.types.d.ts +21 -2
  29. package/dist/cjs/types/token.types.js +13 -1
  30. package/dist/cjs/types/token.types.js.map +1 -1
  31. package/dist/esm/api/client.api.d.ts +23 -0
  32. package/dist/esm/api/generated-wallet-api.d.ts +189 -1
  33. package/dist/esm/api/generated-wallet-api.js +129 -0
  34. package/dist/esm/api/generated-wallet-api.js.map +1 -1
  35. package/dist/esm/helpers/handleResponce.helper.d.ts +1 -1
  36. package/dist/esm/index.d.ts +4 -0
  37. package/dist/esm/requests/getCoinsBalance.d.ts +15 -0
  38. package/dist/esm/requests/getCoinsBalance.js +33 -0
  39. package/dist/esm/requests/getCoinsBalance.js.map +1 -0
  40. package/dist/esm/requests/getNodeOffers.d.ts +13 -0
  41. package/dist/esm/requests/getNodeOffers.js +31 -0
  42. package/dist/esm/requests/getNodeOffers.js.map +1 -0
  43. package/dist/esm/requests/getNodeTransfer.d.ts +13 -0
  44. package/dist/esm/requests/getNodeTransfer.js +31 -0
  45. package/dist/esm/requests/getNodeTransfer.js.map +1 -0
  46. package/dist/esm/requests/getNodeTransfers.d.ts +15 -0
  47. package/dist/esm/requests/getNodeTransfers.js +33 -0
  48. package/dist/esm/requests/getNodeTransfers.js.map +1 -0
  49. package/dist/esm/requests/index.d.ts +4 -0
  50. package/dist/esm/requests/index.js +4 -0
  51. package/dist/esm/requests/index.js.map +1 -1
  52. package/dist/esm/types/communication.types.d.ts +5 -1
  53. package/dist/esm/types/communication.types.js +4 -0
  54. package/dist/esm/types/communication.types.js.map +1 -1
  55. package/dist/esm/types/history.types.d.ts +24 -0
  56. package/dist/esm/types/token.types.d.ts +21 -2
  57. package/dist/esm/types/token.types.js +12 -0
  58. package/dist/esm/types/token.types.js.map +1 -1
  59. package/package.json +1 -1
@@ -0,0 +1,33 @@
1
+ import { WALLET_TARGET } from '../constants';
2
+ import { isExpectedResponse } from '../helpers/handleResponce.helper';
3
+ import { PUBLIC_REQUESTS } from '../types';
4
+ /**
5
+ * Fetches token balances and pricing details for the provided party.
6
+ *
7
+ * Emits `${PUBLIC_REQUESTS.GET_COINS_BALANCE}_RESPONSE` with balances and metadata.
8
+ * Origin should be connected; otherwise a connect flow may be required.
9
+ *
10
+ * @param {GetBalanceRequest} data Request payload with partyId and options.
11
+ * @param {string} data.party Party identifier to query balances for.
12
+ * @param {CANTON_NETWORK_VARIANTS} data.network Canton network to query against.
13
+ * @returns {Promise<GetBalanceResponse>} Tokens, split flag, and optional price.
14
+ * @example
15
+ * const res = await getCoinsBalance({ party: "123::122", network: CANTON_NETWORK_DEV });
16
+ */
17
+ export const getCoinsBalance = async (data) => new Promise((resolve) => {
18
+ const id = crypto.randomUUID();
19
+ window.postMessage({
20
+ type: PUBLIC_REQUESTS.GET_COINS_BALANCE,
21
+ target: WALLET_TARGET,
22
+ id,
23
+ ...data,
24
+ }, '*');
25
+ function handleResponse(event) {
26
+ if (isExpectedResponse(event, id, `${PUBLIC_REQUESTS.GET_COINS_BALANCE}_RESPONSE`)) {
27
+ window.removeEventListener('message', handleResponse);
28
+ resolve(event.data.data);
29
+ }
30
+ }
31
+ window.addEventListener('message', handleResponse);
32
+ });
33
+ //# sourceMappingURL=getCoinsBalance.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getCoinsBalance.js","sourceRoot":"","sources":["../../../src/requests/getCoinsBalance.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,EAAuC,eAAe,EAAE,MAAM,UAAU,CAAC;AAEhF;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,eAAe,GAA2D,KAAK,EAC1F,IAAI,EACJ,EAAE,CACF,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;IACtB,MAAM,EAAE,GAAG,MAAM,CAAC,UAAU,EAAE,CAAC;IAE/B,MAAM,CAAC,WAAW,CAChB;QACE,IAAI,EAAE,eAAe,CAAC,iBAAiB;QACvC,MAAM,EAAE,aAAa;QACrB,EAAE;QACF,GAAG,IAAI;KACR,EACD,GAAG,CACJ,CAAC;IAEF,SAAS,cAAc,CAAC,KAAmB;QACzC,IAAI,kBAAkB,CAAC,KAAK,EAAE,EAAE,EAAE,GAAG,eAAe,CAAC,iBAAiB,WAAW,CAAC,EAAE;YAClF,MAAM,CAAC,mBAAmB,CAAC,SAAS,EAAE,cAAc,CAAC,CAAC;YACtD,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;SAC1B;IACH,CAAC;IAED,MAAM,CAAC,gBAAgB,CAAC,SAAS,EAAE,cAAc,CAAC,CAAC;AACrD,CAAC,CAAC,CAAC"}
@@ -0,0 +1,13 @@
1
+ import { OffersFromNodeRequest, OffersFromNodeResponse } from '../types';
2
+ /**
3
+ * Retrieves offers history for a party using the indexer.
4
+ *
5
+ * Emits `${PUBLIC_REQUESTS.GET_NODE_OFFERS_HISTORY}_RESPONSE` with paged results.
6
+ * Origin should be connected; otherwise a connect flow may be required.
7
+ *
8
+ * @param {OffersFromNodeRequest} data Request payload (filters, pagination).
9
+ * @returns {Promise<OffersResponse>} Offer page data or null if none.
10
+ * @example
11
+ * const offers = await getNodeOffers({ ... });
12
+ */
13
+ export declare const getNodeOffers: (data: OffersFromNodeRequest) => Promise<OffersFromNodeResponse>;
@@ -0,0 +1,31 @@
1
+ import { WALLET_TARGET } from '../constants';
2
+ import { isExpectedResponse } from '../helpers/handleResponce.helper';
3
+ import { PUBLIC_REQUESTS } from '../types';
4
+ /**
5
+ * Retrieves offers history for a party using the indexer.
6
+ *
7
+ * Emits `${PUBLIC_REQUESTS.GET_NODE_OFFERS_HISTORY}_RESPONSE` with paged results.
8
+ * Origin should be connected; otherwise a connect flow may be required.
9
+ *
10
+ * @param {OffersFromNodeRequest} data Request payload (filters, pagination).
11
+ * @returns {Promise<OffersResponse>} Offer page data or null if none.
12
+ * @example
13
+ * const offers = await getNodeOffers({ ... });
14
+ */
15
+ export const getNodeOffers = async (data) => new Promise((resolve) => {
16
+ const id = crypto.randomUUID();
17
+ window.postMessage({
18
+ type: PUBLIC_REQUESTS.GET_NODE_OFFERS_HISTORY,
19
+ target: WALLET_TARGET,
20
+ id,
21
+ ...data,
22
+ }, '*');
23
+ function handleResponse(event) {
24
+ if (isExpectedResponse(event, id, `${PUBLIC_REQUESTS.GET_NODE_OFFERS_HISTORY}_RESPONSE`)) {
25
+ window.removeEventListener('message', handleResponse);
26
+ resolve(event.data.data);
27
+ }
28
+ }
29
+ window.addEventListener('message', handleResponse);
30
+ });
31
+ //# sourceMappingURL=getNodeOffers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getNodeOffers.js","sourceRoot":"","sources":["../../../src/requests/getNodeOffers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,EAAiD,eAAe,EAAE,MAAM,UAAU,CAAC;AAE1F;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,aAAa,GAEa,KAAK,EAAE,IAAI,EAAE,EAAE,CACpD,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;IACtB,MAAM,EAAE,GAAG,MAAM,CAAC,UAAU,EAAE,CAAC;IAE/B,MAAM,CAAC,WAAW,CAChB;QACE,IAAI,EAAE,eAAe,CAAC,uBAAuB;QAC7C,MAAM,EAAE,aAAa;QACrB,EAAE;QACF,GAAG,IAAI;KACR,EACD,GAAG,CACJ,CAAC;IAEF,SAAS,cAAc,CAAC,KAAmB;QACzC,IAAI,kBAAkB,CAAC,KAAK,EAAE,EAAE,EAAE,GAAG,eAAe,CAAC,uBAAuB,WAAW,CAAC,EAAE;YACxF,MAAM,CAAC,mBAAmB,CAAC,SAAS,EAAE,cAAc,CAAC,CAAC;YACtD,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;SAC1B;IACH,CAAC;IAED,MAAM,CAAC,gBAAgB,CAAC,SAAS,EAAE,cAAc,CAAC,CAAC;AACrD,CAAC,CAAC,CAAC"}
@@ -0,0 +1,13 @@
1
+ import { TransferFromNodeRequest, TransferFromNodeResponse } from '../types';
2
+ /**
3
+ * Retrieves detailed information for a single transfer event.
4
+ *
5
+ * Emits `${PUBLIC_REQUESTS.GET_NODE_TRANSFER_DETAILS}_RESPONSE` with transfer details.
6
+ * Origin should be connected; otherwise a connect flow may be required.
7
+ *
8
+ * @param {TransferFromNodeRequest} data Request payload with event_id.
9
+ * @returns {Promise<TransferFromNodeResponse>} Transfer details or null.
10
+ * @example
11
+ * const t = await getNodeTransfer({ ... });
12
+ */
13
+ export declare const getNodeTransfer: (data: TransferFromNodeRequest) => Promise<TransferFromNodeResponse>;
@@ -0,0 +1,31 @@
1
+ import { WALLET_TARGET } from '../constants';
2
+ import { isExpectedResponse } from '../helpers/handleResponce.helper';
3
+ import { PUBLIC_REQUESTS } from '../types';
4
+ /**
5
+ * Retrieves detailed information for a single transfer event.
6
+ *
7
+ * Emits `${PUBLIC_REQUESTS.GET_NODE_TRANSFER_DETAILS}_RESPONSE` with transfer details.
8
+ * Origin should be connected; otherwise a connect flow may be required.
9
+ *
10
+ * @param {TransferFromNodeRequest} data Request payload with event_id.
11
+ * @returns {Promise<TransferFromNodeResponse>} Transfer details or null.
12
+ * @example
13
+ * const t = await getNodeTransfer({ ... });
14
+ */
15
+ export const getNodeTransfer = async (data) => new Promise((resolve) => {
16
+ const id = crypto.randomUUID();
17
+ window.postMessage({
18
+ type: PUBLIC_REQUESTS.GET_NODE_TRANSFER_DETAILS,
19
+ target: WALLET_TARGET,
20
+ id,
21
+ ...data,
22
+ }, '*');
23
+ function handleResponse(event) {
24
+ if (isExpectedResponse(event, id, `${PUBLIC_REQUESTS.GET_NODE_TRANSFER_DETAILS}_RESPONSE`)) {
25
+ window.removeEventListener('message', handleResponse);
26
+ resolve(event.data.data);
27
+ }
28
+ }
29
+ window.addEventListener('message', handleResponse);
30
+ });
31
+ //# sourceMappingURL=getNodeTransfer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getNodeTransfer.js","sourceRoot":"","sources":["../../../src/requests/getNodeTransfer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,EAAE,eAAe,EAAqD,MAAM,UAAU,CAAC;AAE9F;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,eAAe,GAEa,KAAK,EAAE,IAAI,EAAE,EAAE,CACtD,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;IACtB,MAAM,EAAE,GAAG,MAAM,CAAC,UAAU,EAAE,CAAC;IAE/B,MAAM,CAAC,WAAW,CAChB;QACE,IAAI,EAAE,eAAe,CAAC,yBAAyB;QAC/C,MAAM,EAAE,aAAa;QACrB,EAAE;QACF,GAAG,IAAI;KACR,EACD,GAAG,CACJ,CAAC;IAEF,SAAS,cAAc,CAAC,KAAmB;QACzC,IAAI,kBAAkB,CAAC,KAAK,EAAE,EAAE,EAAE,GAAG,eAAe,CAAC,yBAAyB,WAAW,CAAC,EAAE;YAC1F,MAAM,CAAC,mBAAmB,CAAC,SAAS,EAAE,cAAc,CAAC,CAAC;YACtD,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;SAC1B;IACH,CAAC;IAED,MAAM,CAAC,gBAAgB,CAAC,SAAS,EAAE,cAAc,CAAC,CAAC;AACrD,CAAC,CAAC,CAAC"}
@@ -0,0 +1,15 @@
1
+ import { CoinTransfersFromNodeRequest, CoinTransfersFromNodeResponse } from '../types';
2
+ /**
3
+ * Retrieves token transfer history for a party using the indexer.
4
+ *
5
+ * Emits `${PUBLIC_REQUESTS.GET_NODE_TRANSFERS_HISTORY}_RESPONSE` with paged results.
6
+ * Origin should be connected; otherwise a connect flow may be required.
7
+ *
8
+ * @param {CoinTransfersFromNodeRequest} data Request payload (filters, pagination).
9
+ * @param {CoinTransfersFromNodeQuery} data.query Indexer query parameters (party filters, paging).
10
+ * @param {CANTON_NETWORK_VARIANTS} data.network Canton network to query against.
11
+ * @returns {Promise<any>} Transfer history payload or null if none.
12
+ * @example
13
+ * const list = await getNodeTransfers({ ... });
14
+ */
15
+ export declare const getNodeTransfers: (data: CoinTransfersFromNodeRequest) => Promise<CoinTransfersFromNodeResponse>;
@@ -0,0 +1,33 @@
1
+ import { WALLET_TARGET } from '../constants';
2
+ import { isExpectedResponse } from '../helpers/handleResponce.helper';
3
+ import { PUBLIC_REQUESTS, } from '../types';
4
+ /**
5
+ * Retrieves token transfer history for a party using the indexer.
6
+ *
7
+ * Emits `${PUBLIC_REQUESTS.GET_NODE_TRANSFERS_HISTORY}_RESPONSE` with paged results.
8
+ * Origin should be connected; otherwise a connect flow may be required.
9
+ *
10
+ * @param {CoinTransfersFromNodeRequest} data Request payload (filters, pagination).
11
+ * @param {CoinTransfersFromNodeQuery} data.query Indexer query parameters (party filters, paging).
12
+ * @param {CANTON_NETWORK_VARIANTS} data.network Canton network to query against.
13
+ * @returns {Promise<any>} Transfer history payload or null if none.
14
+ * @example
15
+ * const list = await getNodeTransfers({ ... });
16
+ */
17
+ export const getNodeTransfers = async (data) => new Promise((resolve) => {
18
+ const id = crypto.randomUUID();
19
+ window.postMessage({
20
+ type: PUBLIC_REQUESTS.GET_NODE_TRANSFERS_HISTORY,
21
+ target: WALLET_TARGET,
22
+ id,
23
+ ...data,
24
+ }, '*');
25
+ function handleResponse(event) {
26
+ if (isExpectedResponse(event, id, `${PUBLIC_REQUESTS.GET_NODE_TRANSFERS_HISTORY}_RESPONSE`)) {
27
+ window.removeEventListener('message', handleResponse);
28
+ resolve(event.data.data);
29
+ }
30
+ }
31
+ window.addEventListener('message', handleResponse);
32
+ });
33
+ //# sourceMappingURL=getNodeTransfers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getNodeTransfers.js","sourceRoot":"","sources":["../../../src/requests/getNodeTransfers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,EACL,eAAe,GAGhB,MAAM,UAAU,CAAC;AAElB;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAEiB,KAAK,EAAE,IAAI,EAAE,EAAE,CAC3D,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;IACtB,MAAM,EAAE,GAAG,MAAM,CAAC,UAAU,EAAE,CAAC;IAE/B,MAAM,CAAC,WAAW,CAChB;QACE,IAAI,EAAE,eAAe,CAAC,0BAA0B;QAChD,MAAM,EAAE,aAAa;QACrB,EAAE;QACF,GAAG,IAAI;KACR,EACD,GAAG,CACJ,CAAC;IAEF,SAAS,cAAc,CAAC,KAAmB;QACzC,IAAI,kBAAkB,CAAC,KAAK,EAAE,EAAE,EAAE,GAAG,eAAe,CAAC,0BAA0B,WAAW,CAAC,EAAE;YAC3F,MAAM,CAAC,mBAAmB,CAAC,SAAS,EAAE,cAAc,CAAC,CAAC;YACtD,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;SAC1B;IACH,CAAC;IAED,MAAM,CAAC,gBAAgB,CAAC,SAAS,EAAE,cAAc,CAAC,CAAC;AACrD,CAAC,CAAC,CAAC"}
@@ -8,6 +8,10 @@ export * from './getIsConnected';
8
8
  export * from './getStatus';
9
9
  export * from './getActiveNetwork';
10
10
  export * from './getBalance';
11
+ export * from './getCoinsBalance';
11
12
  export * from './getOffers';
12
13
  export * from './getTransfer';
13
14
  export * from './getTransfers';
15
+ export * from './getNodeOffers';
16
+ export * from './getNodeTransfer';
17
+ export * from './getNodeTransfers';
@@ -8,7 +8,11 @@ export * from './getIsConnected';
8
8
  export * from './getStatus';
9
9
  export * from './getActiveNetwork';
10
10
  export * from './getBalance';
11
+ export * from './getCoinsBalance';
11
12
  export * from './getOffers';
12
13
  export * from './getTransfer';
13
14
  export * from './getTransfers';
15
+ export * from './getNodeOffers';
16
+ export * from './getNodeTransfer';
17
+ export * from './getNodeTransfers';
14
18
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/requests/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AAEnC,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AAEjC,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC;AAEnC,cAAc,cAAc,CAAC;AAE7B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/requests/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AAEnC,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AAEjC,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC;AAEnC,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAElC,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAE/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC"}
@@ -25,9 +25,13 @@ export declare enum PUBLIC_REQUESTS {
25
25
  GET_ACCOUNTS = "GET_ACCOUNTS",
26
26
  GET_ACTIVE_ACCOUNT = "GET_ACTIVE_ACCOUNT",
27
27
  GET_BALANCE = "GET_BALANCE",
28
+ GET_COINS_BALANCE = "GET_COINS_BALANCE",
28
29
  GET_TRANSFERS_HISTORY = "GET_TRANSFERS_HISTORY",
29
30
  GET_TRANSFER_DETAILS = "GET_TRANSFER_DETAILS",
30
- GET_OFFERS_HISTORY = "GET_OFFERS_HISTORY"
31
+ GET_OFFERS_HISTORY = "GET_OFFERS_HISTORY",
32
+ GET_NODE_TRANSFERS_HISTORY = "GET_NODE_TRANSFERS_HISTORY",
33
+ GET_NODE_TRANSFER_DETAILS = "GET_NODE_TRANSFER_DETAILS",
34
+ GET_NODE_OFFERS_HISTORY = "GET_NODE_OFFERS_HISTORY"
31
35
  }
32
36
  /** Template-literal form for deriving a `${REQUEST}_RESPONSE` message type. */
33
37
  export type POSSIBLE_RESPONSE_TYPE = `${PUBLIC_REQUESTS}_RESPONSE`;
@@ -27,8 +27,12 @@ export var PUBLIC_REQUESTS;
27
27
  PUBLIC_REQUESTS["GET_ACCOUNTS"] = "GET_ACCOUNTS";
28
28
  PUBLIC_REQUESTS["GET_ACTIVE_ACCOUNT"] = "GET_ACTIVE_ACCOUNT";
29
29
  PUBLIC_REQUESTS["GET_BALANCE"] = "GET_BALANCE";
30
+ PUBLIC_REQUESTS["GET_COINS_BALANCE"] = "GET_COINS_BALANCE";
30
31
  PUBLIC_REQUESTS["GET_TRANSFERS_HISTORY"] = "GET_TRANSFERS_HISTORY";
31
32
  PUBLIC_REQUESTS["GET_TRANSFER_DETAILS"] = "GET_TRANSFER_DETAILS";
32
33
  PUBLIC_REQUESTS["GET_OFFERS_HISTORY"] = "GET_OFFERS_HISTORY";
34
+ PUBLIC_REQUESTS["GET_NODE_TRANSFERS_HISTORY"] = "GET_NODE_TRANSFERS_HISTORY";
35
+ PUBLIC_REQUESTS["GET_NODE_TRANSFER_DETAILS"] = "GET_NODE_TRANSFER_DETAILS";
36
+ PUBLIC_REQUESTS["GET_NODE_OFFERS_HISTORY"] = "GET_NODE_OFFERS_HISTORY";
33
37
  })(PUBLIC_REQUESTS || (PUBLIC_REQUESTS = {}));
34
38
  //# sourceMappingURL=communication.types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"communication.types.js","sourceRoot":"","sources":["../../../src/types/communication.types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,CAAN,IAAY,iBAOX;AAPD,WAAY,iBAAiB;IAC3B,4DAAuC,CAAA;IACvC,0DAAqC,CAAA;IACrC,8DAAyC,CAAA;IACzC,oDAA+B,CAAA;IAC/B,oDAA+B,CAAA;IAC/B,wDAAmC,CAAA;AACrC,CAAC,EAPW,iBAAiB,KAAjB,iBAAiB,QAO5B;AAED;;;GAGG;AACH,MAAM,CAAN,IAAY,eAmBX;AAnBD,WAAY,eAAe;IACzB,wEAAqD,CAAA;IACrD,sCAAmB,CAAA;IACnB,4CAAyB,CAAA;IACzB,wDAAqC,CAAA;IACrC,4DAAyC,CAAA;IAEzC,gDAA6B,CAAA;IAC7B,0CAAuB,CAAA;IAEvB,gDAA6B,CAAA;IAC7B,4DAAyC,CAAA;IAEzC,8CAA2B,CAAA;IAE3B,kEAA+C,CAAA;IAC/C,gEAA6C,CAAA;IAE7C,4DAAyC,CAAA;AAC3C,CAAC,EAnBW,eAAe,KAAf,eAAe,QAmB1B"}
1
+ {"version":3,"file":"communication.types.js","sourceRoot":"","sources":["../../../src/types/communication.types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,CAAN,IAAY,iBAOX;AAPD,WAAY,iBAAiB;IAC3B,4DAAuC,CAAA;IACvC,0DAAqC,CAAA;IACrC,8DAAyC,CAAA;IACzC,oDAA+B,CAAA;IAC/B,oDAA+B,CAAA;IAC/B,wDAAmC,CAAA;AACrC,CAAC,EAPW,iBAAiB,KAAjB,iBAAiB,QAO5B;AAED;;;GAGG;AACH,MAAM,CAAN,IAAY,eAuBX;AAvBD,WAAY,eAAe;IACzB,wEAAqD,CAAA;IACrD,sCAAmB,CAAA;IACnB,4CAAyB,CAAA;IACzB,wDAAqC,CAAA;IACrC,4DAAyC,CAAA;IAEzC,gDAA6B,CAAA;IAC7B,0CAAuB,CAAA;IAEvB,gDAA6B,CAAA;IAC7B,4DAAyC,CAAA;IAEzC,8CAA2B,CAAA;IAC3B,0DAAuC,CAAA;IAEvC,kEAA+C,CAAA;IAC/C,gEAA6C,CAAA;IAC7C,4DAAyC,CAAA;IAEzC,4EAAyD,CAAA;IACzD,0EAAuD,CAAA;IACvD,sEAAmD,CAAA;AACrD,CAAC,EAvBW,eAAe,KAAf,eAAe,QAuB1B"}
@@ -1,5 +1,6 @@
1
1
  import { api } from '../api';
2
2
  import { PagedByCombinedCursorResponseTokenTransferSummary, PagedByCombinedCursorResponseOffer } from '../api/generated-indexer-api';
3
+ import { GetPendingTransactionsResponseDTO, GetTransfersHistoryResponseDTO, TransferResponseDTO } from '../api/generated-wallet-api';
3
4
  import { CANTON_NETWORK_VARIANTS } from './token.types';
4
5
  /** Query parameters accepted by the indexer for party token transfers. */
5
6
  export type TokenTransfersQuery = Parameters<typeof api.indexer.tokenTransferByPartyIdV2>[0];
@@ -9,6 +10,14 @@ export type TokenTransfersRequest = {
9
10
  };
10
11
  /** Paged token transfer summaries or null if no data exists. */
11
12
  export type TokenTransfersResponse = PagedByCombinedCursorResponseTokenTransferSummary | null;
13
+ /** Query parameters accepted by the node for party standard coin transfers. */
14
+ export type CoinTransfersFromNodeQuery = Parameters<typeof api.wallet.api.transferHistoryControllerGetTransfers>[0];
15
+ export type CoinTransfersFromNodeRequest = {
16
+ query: CoinTransfersFromNodeQuery;
17
+ network: CANTON_NETWORK_VARIANTS;
18
+ };
19
+ /** Paged standard coin transfer summaries or null if no data exists. */
20
+ export type CoinTransfersFromNodeResponse = GetTransfersHistoryResponseDTO | null;
12
21
  /** Query parameters accepted by the indexer for offers by sender. */
13
22
  export type OffersQuery = Parameters<typeof api.indexer.offerBySenderPartyV2>[0];
14
23
  export type OffersRequest = {
@@ -17,6 +26,14 @@ export type OffersRequest = {
17
26
  };
18
27
  /** Paged offers response or null if no data exists. */
19
28
  export type OffersResponse = PagedByCombinedCursorResponseOffer | null;
29
+ /** Query parameters accepted by the indexer for offers by sender. */
30
+ export type OffersFromNodeQuery = Parameters<typeof api.indexer.offerBySenderPartyV2>[0];
31
+ export type OffersFromNodeRequest = {
32
+ query: OffersFromNodeQuery;
33
+ network: CANTON_NETWORK_VARIANTS;
34
+ };
35
+ /** Paged offers response or null if no data exists. */
36
+ export type OffersFromNodeResponse = GetPendingTransactionsResponseDTO | null;
20
37
  /** Request parameters for retrieving a single transfer by event ID. */
21
38
  export type TransferRequest = {
22
39
  eventId: string;
@@ -24,3 +41,10 @@ export type TransferRequest = {
24
41
  };
25
42
  /** Detailed transfer response or null if event is not found. */
26
43
  export type TransferResponse = Awaited<ReturnType<typeof api.indexer.tokenTransferByEventIdV2>> | null;
44
+ /** Request parameters for retrieving a single transfer by event ID. */
45
+ export type TransferFromNodeRequest = {
46
+ transferId: number;
47
+ network: CANTON_NETWORK_VARIANTS;
48
+ };
49
+ /** Detailed transfer response or null if event is not found. */
50
+ export type TransferFromNodeResponse = TransferResponseDTO | null;
@@ -1,3 +1,16 @@
1
+ import { CCPrices } from '../api/generated-indexer-api';
2
+ import { CoinBalanceResponseDTO } from '../api/generated-wallet-api';
3
+ export type Coin = CoinBalanceResponseDTO['coin'];
4
+ export declare const CoinVariants: {
5
+ readonly CC: "CC";
6
+ readonly CBTC: "CBTC";
7
+ readonly USDCx: "USDCx";
8
+ };
9
+ export declare enum CoinEnum {
10
+ CC = "CC",
11
+ CBTC = "CBTC",
12
+ USDCx = "USDCx"
13
+ }
1
14
  /**
2
15
  * Supported Canton network variants the wallet can operate against.
3
16
  */
@@ -27,14 +40,14 @@ export interface Network {
27
40
  */
28
41
  export type TokenData = {
29
42
  id: string;
30
- symbol: string;
43
+ symbol: CoinEnum;
31
44
  balance: string;
32
45
  balanceBigInt: string;
33
46
  decimals: number;
34
47
  name: string;
35
48
  price: string;
36
49
  balanceUsd?: string;
37
- network: Network;
50
+ network: CANTON_NETWORK_VARIANTS;
38
51
  imageSrc: string;
39
52
  };
40
53
  /** Party/network pair used to request balances from the wallet/indexer. */
@@ -48,3 +61,9 @@ export type GetBalanceResponse = {
48
61
  isSplitedBalance: boolean;
49
62
  price: string;
50
63
  };
64
+ export type GetCoinsResponse = {
65
+ tokens: TokenData[];
66
+ prices: {
67
+ [key in CoinEnum]: CCPrices | undefined;
68
+ } | null;
69
+ };
@@ -1,3 +1,15 @@
1
+ // Enum-like object bound to the DTO union
2
+ export const CoinVariants = {
3
+ CC: 'CC',
4
+ CBTC: 'CBTC',
5
+ USDCx: 'USDCx',
6
+ };
7
+ export var CoinEnum;
8
+ (function (CoinEnum) {
9
+ CoinEnum["CC"] = "CC";
10
+ CoinEnum["CBTC"] = "CBTC";
11
+ CoinEnum["USDCx"] = "USDCx";
12
+ })(CoinEnum || (CoinEnum = {}));
1
13
  /**
2
14
  * Supported Canton network variants the wallet can operate against.
3
15
  */
@@ -1 +1 @@
1
- {"version":3,"file":"token.types.js","sourceRoot":"","sources":["../../../src/types/token.types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAN,IAAY,uBAIX;AAJD,WAAY,uBAAuB;IACjC,oEAAyC,CAAA;IACzC,sEAA2C,CAAA;IAC3C,4DAAiC,CAAA;AACnC,CAAC,EAJW,uBAAuB,KAAvB,uBAAuB,QAIlC"}
1
+ {"version":3,"file":"token.types.js","sourceRoot":"","sources":["../../../src/types/token.types.ts"],"names":[],"mappings":"AAMA,0CAA0C;AAC1C,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,EAAE,EAAE,IAAI;IACR,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,OAAO;CACuB,CAAC;AAExC,MAAM,CAAN,IAAY,QAIX;AAJD,WAAY,QAAQ;IAClB,qBAAS,CAAA;IACT,yBAAa,CAAA;IACb,2BAAe,CAAA;AACjB,CAAC,EAJW,QAAQ,KAAR,QAAQ,QAInB;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,uBAIX;AAJD,WAAY,uBAAuB;IACjC,oEAAyC,CAAA;IACzC,sEAA2C,CAAA;IAC3C,4DAAiC,CAAA;AACnC,CAAC,EAJW,uBAAuB,KAAvB,uBAAuB,QAIlC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@console-wallet/dapp-sdk",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "description": "",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "module": "./dist/esm/index.js",