@dynamic-labs-wallet/stellar 0.0.353 → 0.1.0-request-signing

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.
@@ -1,45 +1,36 @@
1
- import { DynamicWalletClient, type ClientKeyShare, type DynamicWalletClientInternalOptions, type DynamicWalletClientProps, type ThresholdSignatureScheme, type RequestWithElevatedAccessToken } from '@dynamic-labs-wallet/browser';
2
- import type { SignMessageContext } from '@dynamic-labs/sdk-api-core';
1
+ import { DynamicWalletClient, type ClientKeyShare, type ThresholdSignatureScheme, type RequestWithElevatedAccessToken, type BaseSignParams, type ExportApprovalQuorumRequest } from '@dynamic-labs-wallet/browser';
3
2
  export declare class DynamicStellarWalletClient extends DynamicWalletClient {
4
3
  readonly chainName = "STELLAR";
5
- constructor({ environmentId, authToken, baseApiUrl, baseMPCRelayApiUrl, storageKey, debug, featureFlags, authMode, sdkVersion, forwardMPCClient, logger, }: DynamicWalletClientProps, internalOptions?: DynamicWalletClientInternalOptions);
6
- createWalletAccount({ thresholdSignatureScheme, password, onError, signedSessionId, }: {
4
+ createWalletAccount({ thresholdSignatureScheme, password, onError, signedSessionId, businessAccountId, }: {
7
5
  thresholdSignatureScheme: ThresholdSignatureScheme;
8
6
  password?: string;
9
7
  onError?: (error: Error) => void;
10
8
  signedSessionId: string;
9
+ businessAccountId?: string;
11
10
  }): Promise<{
12
11
  accountAddress: string;
13
12
  publicKeyHex: string;
14
13
  rawPublicKey: Uint8Array;
15
14
  }>;
16
- signMessage({ message, accountAddress, password, signedSessionId, mfaToken, elevatedAccessToken, context, onError, }: {
15
+ signMessage({ message, accountAddress, password, signedSessionId, mfaToken, elevatedAccessToken, context, approvalQuorum, onError, }: {
17
16
  message: string;
18
17
  accountAddress: string;
19
- password?: string;
20
- signedSessionId: string;
21
- mfaToken?: string;
22
- elevatedAccessToken?: string;
23
- context?: SignMessageContext;
24
- onError?: (error: Error) => void;
25
- }): Promise<string>;
26
- signTransaction({ senderAddress, transaction, password, signedSessionId, mfaToken, elevatedAccessToken, chainId, context, onError, }: {
18
+ } & BaseSignParams): Promise<string>;
19
+ signTransaction({ senderAddress, transaction, password, signedSessionId, mfaToken, elevatedAccessToken, chainId, context, approvalQuorum, onError, }: {
27
20
  senderAddress: string;
28
21
  /** XDR-encoded transaction envelope */
29
22
  transaction: string;
30
- password?: string;
31
- signedSessionId: string;
32
- mfaToken?: string;
33
- elevatedAccessToken?: string;
34
23
  chainId?: string;
35
- context?: SignMessageContext;
36
- onError?: (error: Error) => void;
37
- }): Promise<string>;
38
- exportPrivateKey({ accountAddress, password, signedSessionId, mfaToken, elevatedAccessToken, }: RequestWithElevatedAccessToken<{
24
+ } & BaseSignParams): Promise<string>;
25
+ exportPrivateKey({ accountAddress, password, signedSessionId, mfaToken, elevatedAccessToken, approvalQuorum, proposalId, }: RequestWithElevatedAccessToken<{
39
26
  accountAddress: string;
40
27
  password?: string;
41
28
  signedSessionId: string;
42
29
  mfaToken?: string;
30
+ /** The initiator's signed export Intent, from `prepareExportIntent`. */
31
+ approvalQuorum?: ExportApprovalQuorumRequest;
32
+ /** The approved export proposal being redeemed, from the consent error the export call raised. */
33
+ proposalId?: string;
43
34
  }>): Promise<string>;
44
35
  importPrivateKey({ privateKey, chainName, thresholdSignatureScheme, password, signedSessionId, onError, publicAddressCheck, legacyWalletId, }: {
45
36
  privateKey: string;
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/client/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,mBAAmB,EAGnB,KAAK,cAAc,EACnB,KAAK,kCAAkC,EACvC,KAAK,wBAAwB,EAC7B,KAAK,wBAAwB,EAC7B,KAAK,8BAA8B,EACpC,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAcrE,qBAAa,0BAA2B,SAAQ,mBAAmB;IACjE,QAAQ,CAAC,SAAS,aAAa;gBAG7B,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A6FF,0BAA0B,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM;IAsBnD,iBAAiB;CAKxB"}
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/client/client.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EAInB,KAAK,cAAc,EACnB,KAAK,wBAAwB,EAC7B,KAAK,8BAA8B,EACnC,KAAK,cAAc,EAGnB,KAAK,2BAA2B,EACjC,MAAM,8BAA8B,CAAC;AAetC,qBAAa,0BAA2B,SAAQ,mBAAmB;IACjE,QAAQ,CAAC,SAAS,aAAa;IAEzB,mBAAmB,CAAC,EACxB,wBAAwB,EACxB,QAAoB,EACpB,OAAO,EACP,eAAe,EACf,iBAAiB,GAClB,EAAE;QACD,wBAAwB,EAAE,wBAAwB,CAAC;QACnD,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;QACjC,eAAe,EAAE,MAAM,CAAC;QACxB,iBAAiB,CAAC,EAAE,MAAM,CAAC;KAC5B,GAAG,OAAO,CAAC;QACV,cAAc,EAAE,MAAM,CAAC;QACvB,YAAY,EAAE,MAAM,CAAC;QACrB,YAAY,EAAE,UAAU,CAAC;KAC1B,CAAC;IA4EI,WAAW,CAAC,EAChB,OAAO,EACP,cAAc,EACd,QAAoB,EACpB,eAAe,EACf,QAAQ,EACR,mBAAmB,EACnB,OAAO,EACP,cAAc,EACd,OAAO,GACR,EAAE;QACD,OAAO,EAAE,MAAM,CAAC;QAChB,cAAc,EAAE,MAAM,CAAC;KACxB,GAAG,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;IAwC9B,eAAe,CAAC,EACpB,aAAa,EACb,WAAW,EACX,QAAoB,EACpB,eAAe,EACf,QAAQ,EACR,mBAAmB,EACnB,OAAO,EACP,OAAO,EACP,cAAc,EACd,OAAO,GACR,EAAE;QACD,aAAa,EAAE,MAAM,CAAC;QACtB,uCAAuC;Q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ED
@@ -1,4 +1,5 @@
1
1
  export * from './client/index.js';
2
2
  export { STELLAR_NETWORK_PASSPHRASES, STELLAR_HORIZON_URLS, type StellarNetwork } from './client/constants.js';
3
3
  export * as sdkApiCore from '@dynamic-labs/sdk-api-core';
4
+ export { prepareStellarTransactionSigningOperation, resumeStellarTransactionSigningIntent } from './signingIntent.js';
4
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../packages/src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,OAAO,EAAE,2BAA2B,EAAE,oBAAoB,EAAE,KAAK,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC/G,OAAO,KAAK,UAAU,MAAM,4BAA4B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../packages/src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,OAAO,EAAE,2BAA2B,EAAE,oBAAoB,EAAE,KAAK,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC/G,OAAO,KAAK,UAAU,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,yCAAyC,EAAE,qCAAqC,EAAE,MAAM,oBAAoB,CAAC"}
@@ -0,0 +1,23 @@
1
+ import type { PreparedStellarTransactionSigningIntent, SigningIntent } from '@dynamic-labs-wallet/browser';
2
+ /**
3
+ * Describes a Stellar transaction for a signing-quorum intent from its XDR
4
+ * envelope. The sequence number and time bounds are not part of the
5
+ * description: they are refreshed when the approved intent is resumed.
6
+ */
7
+ export declare const prepareStellarTransactionSigningOperation: ({ transaction, accountAddress, chainId, }: {
8
+ transaction: string;
9
+ accountAddress: string;
10
+ chainId: string | undefined;
11
+ }) => PreparedStellarTransactionSigningIntent;
12
+ /**
13
+ * Rebuilds the XDR envelope of an approved Stellar transaction intent. The
14
+ * signed intent carries no sequence number or time bounds, so the caller
15
+ * supplies them as `lifetimeValue`, a JSON object with the account's current
16
+ * `sequence` as Horizon returns it (the builder increments it) and `minTime`
17
+ * and `maxTime` in seconds, all as decimal strings.
18
+ */
19
+ export declare const resumeStellarTransactionSigningIntent: ({ intent, lifetimeValue, }: {
20
+ intent: SigningIntent;
21
+ lifetimeValue: string | undefined;
22
+ }) => string;
23
+ //# sourceMappingURL=signingIntent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"signingIntent.d.ts","sourceRoot":"","sources":["../../packages/src/signingIntent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,uCAAuC,EACvC,aAAa,EAEd,MAAM,8BAA8B,CAAC;AAQtC;;;;GAIG;AACH,eAAO,MAAM,yCAAyC,8CAInD;IACD,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,MAAM,CAAC;IACvB,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;CAC7B,KAAG,uCAKH,CAAC;AA2BF;;;;;;GAMG;AACH,eAAO,MAAM,qCAAqC,+BAG/C;IACD,MAAM,EAAE,aAAa,CAAC;IACtB,aAAa,EAAE,MAAM,GAAG,SAAS,CAAC;CACnC,KAAG,MAUH,CAAC"}
@@ -0,0 +1,29 @@
1
+ import type { StellarTransactionOperation } from '@dynamic-labs-wallet/browser';
2
+ export type StellarTransactionChainId = StellarTransactionOperation['chainId'];
3
+ export type StellarTransactionLifetime = {
4
+ sequence: string;
5
+ minTime: string;
6
+ maxTime: string;
7
+ };
8
+ export declare const assertStellarChainId: (chainId: string | undefined) => StellarTransactionChainId;
9
+ /**
10
+ * Describes a classic Stellar transaction envelope for a signing-quorum intent.
11
+ * The sequence number and time bounds are not part of the description: they are
12
+ * refreshed when the approved intent is resumed.
13
+ */
14
+ export declare const parseStellarTransaction: ({ transaction, chainId, }: {
15
+ transaction: string;
16
+ chainId: StellarTransactionChainId;
17
+ }) => StellarTransactionOperation;
18
+ export declare const parseStellarTransactionLifetime: (lifetimeValue: string | undefined) => StellarTransactionLifetime;
19
+ /**
20
+ * Rebuilds the envelope of an approved Stellar transaction operation. The
21
+ * operation carries the total fee, but the builder prices every operation at a
22
+ * base fee, so a total that is not a multiple of the operation count is written
23
+ * onto the envelope after the build.
24
+ */
25
+ export declare const buildStellarTransaction: ({ operation, lifetime, }: {
26
+ operation: StellarTransactionOperation;
27
+ lifetime: StellarTransactionLifetime;
28
+ }) => string;
29
+ //# sourceMappingURL=stellarXdr.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stellarXdr.d.ts","sourceRoot":"","sources":["../../packages/src/stellarXdr.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAiC,2BAA2B,EAAE,MAAM,8BAA8B,CAAC;AAG/G,MAAM,MAAM,yBAAyB,GAAG,2BAA2B,CAAC,SAAS,CAAC,CAAC;AAE/E,MAAM,MAAM,0BAA0B,GAAG;IACvC,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAWF,eAAO,MAAM,oBAAoB,YAAa,MAAM,GAAG,SAAS,KAAG,yBAKlE,CAAC;AAmHF;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,8BAGjC;IACD,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,yBAAyB,CAAC;CACpC,KAAG,2BA2BH,CAAC;AAyEF,eAAO,MAAM,+BAA+B,kBAAmB,MAAM,GAAG,SAAS,KAAG,0BAoBnF,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,6BAGjC;IACD,SAAS,EAAE,2BAA2B,CAAC;IACvC,QAAQ,EAAE,0BAA0B,CAAC;CACtC,KAAG,MAkBH,CAAC"}
@@ -4,7 +4,7 @@
4
4
  */
5
5
  export declare const STELLAR_CHAIN_ID_TO_PASSPHRASE: Record<string, string>;
6
6
  /**
7
- * Gets the network passphrase from a numeric chainId, defaults to mainnet
7
+ * Gets the network passphrase from a numeric chainId, throws for any chainId other than '1', '2' or '3'
8
8
  */
9
9
  export declare const getNetworkPassphraseFromChainId: (chainId: string) => string;
10
10
  //# sourceMappingURL=getNetworkPassphrase.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"getNetworkPassphrase.d.ts","sourceRoot":"","sources":["../../../src/utils/getNetworkPassphrase/getNetworkPassphrase.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,eAAO,MAAM,8BAA8B,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAIjE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,+BAA+B,YAAa,MAAM,KAAG,MAEjE,CAAC"}
1
+ {"version":3,"file":"getNetworkPassphrase.d.ts","sourceRoot":"","sources":["../../../src/utils/getNetworkPassphrase/getNetworkPassphrase.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,eAAO,MAAM,8BAA8B,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAIjE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,+BAA+B,YAAa,MAAM,KAAG,MAKjE,CAAC"}