@defuse-protocol/intents-sdk 0.35.1 → 0.36.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.
@@ -160,11 +160,14 @@ var IntentPayloadBuilder = class IntentPayloadBuilder {
160
160
  * Convenience method that combines build() and signing.
161
161
  *
162
162
  * @param signer - The intent signer to use
163
- * @returns Promise resolving to the signed multi-payload
163
+ * @returns Promise resolving to the signed multi-payload and the raw payload
164
164
  */
165
165
  async buildAndSign(signer) {
166
166
  const payload = await this.build();
167
- return signer.signIntent(payload);
167
+ return {
168
+ signed: await signer.signIntent(payload),
169
+ payload
170
+ };
168
171
  }
169
172
  /**
170
173
  * Create a new builder instance with the same configuration.
@@ -129,9 +129,12 @@ declare class IntentPayloadBuilder<HasSigner extends boolean = false> {
129
129
  * Convenience method that combines build() and signing.
130
130
  *
131
131
  * @param signer - The intent signer to use
132
- * @returns Promise resolving to the signed multi-payload
132
+ * @returns Promise resolving to the signed multi-payload and the raw payload
133
133
  */
134
- buildAndSign(signer: IIntentSigner): Promise<MultiPayload>;
134
+ buildAndSign(signer: IIntentSigner): Promise<{
135
+ signed: MultiPayload;
136
+ payload: IntentPayloadWithSigner<HasSigner>;
137
+ }>;
135
138
  /**
136
139
  * Create a new builder instance with the same configuration.
137
140
  * Useful when you need multiple independent builders.
@@ -129,9 +129,12 @@ declare class IntentPayloadBuilder<HasSigner extends boolean = false> {
129
129
  * Convenience method that combines build() and signing.
130
130
  *
131
131
  * @param signer - The intent signer to use
132
- * @returns Promise resolving to the signed multi-payload
132
+ * @returns Promise resolving to the signed multi-payload and the raw payload
133
133
  */
134
- buildAndSign(signer: IIntentSigner): Promise<MultiPayload>;
134
+ buildAndSign(signer: IIntentSigner): Promise<{
135
+ signed: MultiPayload;
136
+ payload: IntentPayloadWithSigner<HasSigner>;
137
+ }>;
135
138
  /**
136
139
  * Create a new builder instance with the same configuration.
137
140
  * Useful when you need multiple independent builders.
@@ -158,11 +158,14 @@ var IntentPayloadBuilder = class IntentPayloadBuilder {
158
158
  * Convenience method that combines build() and signing.
159
159
  *
160
160
  * @param signer - The intent signer to use
161
- * @returns Promise resolving to the signed multi-payload
161
+ * @returns Promise resolving to the signed multi-payload and the raw payload
162
162
  */
163
163
  async buildAndSign(signer) {
164
164
  const payload = await this.build();
165
- return signer.signIntent(payload);
165
+ return {
166
+ signed: await signer.signIntent(payload),
167
+ payload
168
+ };
166
169
  }
167
170
  /**
168
171
  * Create a new builder instance with the same configuration.
package/dist/src/sdk.cjs CHANGED
@@ -156,7 +156,8 @@ var IntentsSDK = class {
156
156
  builder.setDeadline(deadline);
157
157
  } else args.logger?.warn?.("Decoded nonce has unexpected structure, using default deadline");
158
158
  } catch {}
159
- return builder.buildAndSign(intentSigner);
159
+ const { signed } = await builder.buildAndSign(intentSigner);
160
+ return signed;
160
161
  }));
161
162
  await this.intentRelayer.publishIntents({
162
163
  multiPayloads: signedIntents,
package/dist/src/sdk.js CHANGED
@@ -151,7 +151,8 @@ var IntentsSDK = class {
151
151
  builder.setDeadline(deadline);
152
152
  } else args.logger?.warn?.("Decoded nonce has unexpected structure, using default deadline");
153
153
  } catch {}
154
- return builder.buildAndSign(intentSigner);
154
+ const { signed } = await builder.buildAndSign(intentSigner);
155
+ return signed;
155
156
  }));
156
157
  await this.intentRelayer.publishIntents({
157
158
  multiPayloads: signedIntents,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@defuse-protocol/intents-sdk",
3
- "version": "0.35.1",
3
+ "version": "0.36.0",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "sideEffects": false,