@pioneer-platform/pioneer-sdk 8.15.8 → 8.15.12

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.cjs CHANGED
@@ -891,9 +891,12 @@ class Pioneer {
891
891
  Object.keys(this.client.spec.paths).forEach((path) => {
892
892
  Object.keys(this.client.spec.paths[path]).forEach((method) => {
893
893
  const operationId = this.client.spec.paths[path][method].operationId;
894
- this.pioneer[operationId] = async (parameters) => {
894
+ this.pioneer[operationId] = async (parameters, queryParams) => {
895
895
  try {
896
896
  log.debug(TAG, `${operationId} called with:`, parameters);
897
+ if (queryParams) {
898
+ log.debug(TAG, `${operationId} query params:`, queryParams);
899
+ }
897
900
  if (operationId === "GetMarketInfo") {
898
901
  if (!Array.isArray(parameters)) {
899
902
  throw new Error(`GetMarketInfo requires an array of CAIP strings, got ${typeof parameters}`);
@@ -908,7 +911,8 @@ class Pioneer {
908
911
  let request = {
909
912
  operationId,
910
913
  parameters: {
911
- Authorization: this.queryKey
914
+ Authorization: this.queryKey,
915
+ ...queryParams || {}
912
916
  },
913
917
  responseContentType: "application/json"
914
918
  };
@@ -917,6 +921,7 @@ class Pioneer {
917
921
  } else {
918
922
  request.parameters = {
919
923
  ...parameters,
924
+ ...queryParams || {},
920
925
  Authorization: this.queryKey
921
926
  };
922
927
  }
@@ -2022,9 +2027,6 @@ async function createUnsignedRippleTx(caip, to, amount, memo, pubkeys, pioneer,
2022
2027
  to_address: to
2023
2028
  }
2024
2029
  };
2025
- if (desttag !== undefined) {
2026
- msg.DestinationTag = desttag;
2027
- }
2028
2030
  let tx = {
2029
2031
  type: "auth/StdTx",
2030
2032
  value: {
@@ -2037,18 +2039,16 @@ async function createUnsignedRippleTx(caip, to, amount, memo, pubkeys, pioneer,
2037
2039
  ],
2038
2040
  gas: "28000"
2039
2041
  },
2040
- memo: memo || "",
2042
+ memo: " ",
2041
2043
  msg: [msg],
2042
2044
  signatures: null
2043
2045
  }
2044
2046
  };
2045
2047
  const payment = {
2046
2048
  amount,
2047
- destination: to
2049
+ destination: to,
2050
+ destinationTag: desttag ? String(desttag) : "0"
2048
2051
  };
2049
- if (desttag !== undefined) {
2050
- payment.destinationTag = desttag;
2051
- }
2052
2052
  let unsignedTx = {
2053
2053
  addressNList: [2147483692, 2147483792, 2147483648, 0, 0],
2054
2054
  tx,
package/dist/index.es.js CHANGED
@@ -876,9 +876,12 @@ class Pioneer {
876
876
  Object.keys(this.client.spec.paths).forEach((path) => {
877
877
  Object.keys(this.client.spec.paths[path]).forEach((method) => {
878
878
  const operationId = this.client.spec.paths[path][method].operationId;
879
- this.pioneer[operationId] = async (parameters) => {
879
+ this.pioneer[operationId] = async (parameters, queryParams) => {
880
880
  try {
881
881
  log.debug(TAG, `${operationId} called with:`, parameters);
882
+ if (queryParams) {
883
+ log.debug(TAG, `${operationId} query params:`, queryParams);
884
+ }
882
885
  if (operationId === "GetMarketInfo") {
883
886
  if (!Array.isArray(parameters)) {
884
887
  throw new Error(`GetMarketInfo requires an array of CAIP strings, got ${typeof parameters}`);
@@ -893,7 +896,8 @@ class Pioneer {
893
896
  let request = {
894
897
  operationId,
895
898
  parameters: {
896
- Authorization: this.queryKey
899
+ Authorization: this.queryKey,
900
+ ...queryParams || {}
897
901
  },
898
902
  responseContentType: "application/json"
899
903
  };
@@ -902,6 +906,7 @@ class Pioneer {
902
906
  } else {
903
907
  request.parameters = {
904
908
  ...parameters,
909
+ ...queryParams || {},
905
910
  Authorization: this.queryKey
906
911
  };
907
912
  }
@@ -2206,9 +2211,6 @@ async function createUnsignedRippleTx(caip, to, amount, memo, pubkeys, pioneer,
2206
2211
  to_address: to
2207
2212
  }
2208
2213
  };
2209
- if (desttag !== undefined) {
2210
- msg.DestinationTag = desttag;
2211
- }
2212
2214
  let tx = {
2213
2215
  type: "auth/StdTx",
2214
2216
  value: {
@@ -2221,18 +2223,16 @@ async function createUnsignedRippleTx(caip, to, amount, memo, pubkeys, pioneer,
2221
2223
  ],
2222
2224
  gas: "28000"
2223
2225
  },
2224
- memo: memo || "",
2226
+ memo: " ",
2225
2227
  msg: [msg],
2226
2228
  signatures: null
2227
2229
  }
2228
2230
  };
2229
2231
  const payment = {
2230
2232
  amount,
2231
- destination: to
2233
+ destination: to,
2234
+ destinationTag: desttag ? String(desttag) : "0"
2232
2235
  };
2233
- if (desttag !== undefined) {
2234
- payment.destinationTag = desttag;
2235
- }
2236
2236
  let unsignedTx = {
2237
2237
  addressNList: [2147483692, 2147483792, 2147483648, 0, 0],
2238
2238
  tx,
package/dist/index.js CHANGED
@@ -876,9 +876,12 @@ class Pioneer {
876
876
  Object.keys(this.client.spec.paths).forEach((path) => {
877
877
  Object.keys(this.client.spec.paths[path]).forEach((method) => {
878
878
  const operationId = this.client.spec.paths[path][method].operationId;
879
- this.pioneer[operationId] = async (parameters) => {
879
+ this.pioneer[operationId] = async (parameters, queryParams) => {
880
880
  try {
881
881
  log.debug(TAG, `${operationId} called with:`, parameters);
882
+ if (queryParams) {
883
+ log.debug(TAG, `${operationId} query params:`, queryParams);
884
+ }
882
885
  if (operationId === "GetMarketInfo") {
883
886
  if (!Array.isArray(parameters)) {
884
887
  throw new Error(`GetMarketInfo requires an array of CAIP strings, got ${typeof parameters}`);
@@ -893,7 +896,8 @@ class Pioneer {
893
896
  let request = {
894
897
  operationId,
895
898
  parameters: {
896
- Authorization: this.queryKey
899
+ Authorization: this.queryKey,
900
+ ...queryParams || {}
897
901
  },
898
902
  responseContentType: "application/json"
899
903
  };
@@ -902,6 +906,7 @@ class Pioneer {
902
906
  } else {
903
907
  request.parameters = {
904
908
  ...parameters,
909
+ ...queryParams || {},
905
910
  Authorization: this.queryKey
906
911
  };
907
912
  }
@@ -2206,9 +2211,6 @@ async function createUnsignedRippleTx(caip, to, amount, memo, pubkeys, pioneer,
2206
2211
  to_address: to
2207
2212
  }
2208
2213
  };
2209
- if (desttag !== undefined) {
2210
- msg.DestinationTag = desttag;
2211
- }
2212
2214
  let tx = {
2213
2215
  type: "auth/StdTx",
2214
2216
  value: {
@@ -2221,18 +2223,16 @@ async function createUnsignedRippleTx(caip, to, amount, memo, pubkeys, pioneer,
2221
2223
  ],
2222
2224
  gas: "28000"
2223
2225
  },
2224
- memo: memo || "",
2226
+ memo: " ",
2225
2227
  msg: [msg],
2226
2228
  signatures: null
2227
2229
  }
2228
2230
  };
2229
2231
  const payment = {
2230
2232
  amount,
2231
- destination: to
2233
+ destination: to,
2234
+ destinationTag: desttag ? String(desttag) : "0"
2232
2235
  };
2233
- if (desttag !== undefined) {
2234
- payment.destinationTag = desttag;
2235
- }
2236
2236
  let unsignedTx = {
2237
2237
  addressNList: [2147483692, 2147483792, 2147483648, 0, 0],
2238
2238
  tx,
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "author": "highlander",
3
3
  "name": "@pioneer-platform/pioneer-sdk",
4
- "version": "8.15.8",
4
+ "version": "8.15.12",
5
5
  "dependencies": {
6
6
  "@keepkey/keepkey-sdk": "^0.2.62",
7
7
  "@pioneer-platform/loggerdog": "^8.11.0",
8
8
  "@pioneer-platform/pioneer-caip": "^9.10.0",
9
- "@pioneer-platform/pioneer-client": "^9.10.10",
9
+ "@pioneer-platform/pioneer-client": "^9.10.11",
10
10
  "@pioneer-platform/pioneer-coins": "^9.11.0",
11
11
  "@pioneer-platform/pioneer-discovery": "^8.14.1",
12
12
  "@pioneer-platform/pioneer-events": "^8.12.0",
@@ -79,7 +79,8 @@ export async function createUnsignedRippleTx(
79
79
  amount = amount.toString();
80
80
  }
81
81
 
82
- // Build message - only include DestinationTag if provided
82
+ // Build message - destination tag is NOT part of the msg structure
83
+ // It's only used in the payment object for KeepKey signing
83
84
  const msg: any = {
84
85
  type: 'ripple-sdk/MsgSend',
85
86
  value: {
@@ -93,9 +94,7 @@ export async function createUnsignedRippleTx(
93
94
  to_address: to,
94
95
  },
95
96
  };
96
- if (desttag !== undefined) {
97
- msg.DestinationTag = desttag;
98
- }
97
+ // Note: DestinationTag is handled in the payment object, NOT in msg
99
98
 
100
99
  let tx = {
101
100
  type: 'auth/StdTx',
@@ -109,20 +108,20 @@ export async function createUnsignedRippleTx(
109
108
  ],
110
109
  gas: '28000',
111
110
  },
112
- memo: memo || '',
111
+ // memo is NOT used for destination tags on XRP
112
+ // Destination tags are numeric IDs, not memos
113
+ memo: ' ',
113
114
  msg: [msg],
114
115
  signatures: null,
115
116
  },
116
117
  };
117
118
 
118
- // Build payment object - only include destinationTag if provided
119
+ // Build payment object - destinationTag must be numeric string (use "0" when not provided)
119
120
  const payment: any = {
120
121
  amount,
121
122
  destination: to,
123
+ destinationTag: desttag ? String(desttag) : '0', // Numeric string when provided, "0" when not
122
124
  };
123
- if (desttag !== undefined) {
124
- payment.destinationTag = desttag;
125
- }
126
125
 
127
126
  //Unsigned TX
128
127
  let unsignedTx = {