@spritz-finance/service-client 0.21.0 → 0.22.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.
@@ -116,6 +116,7 @@ export type ListListedKaminoVaultIdsResponse = {
116
116
  export type UserOpsSigner = {
117
117
  id: string;
118
118
  userId: string;
119
+ walletId?: string;
119
120
  curve: string;
120
121
  pathFormat: string;
121
122
  seedIndex: number;
@@ -126,5 +127,15 @@ export type UserOpsSigner = {
126
127
  entryPointVersion: string;
127
128
  };
128
129
  address: string;
130
+ stagedAt?: string;
131
+ retiredAt?: string;
129
132
  createdAt: string;
130
133
  };
134
+ export type OpsSignerMigrationState = {
135
+ requiresMigration: boolean;
136
+ sourceSigner: UserOpsSigner;
137
+ targetSigner?: UserOpsSigner;
138
+ };
139
+ export type OpsSignerReplacement = OpsSignerMigrationState & {
140
+ targetSigner: UserOpsSigner;
141
+ };
@@ -1,5 +1,5 @@
1
1
  export * as Web3Client from "./web3ServiceClient";
2
- import { ExactInQuoteInput, ExactInQuoteResponse, ListListedKaminoVaultIdsInput, ListListedKaminoVaultIdsResponse, OpsSignerType, Portfolio, SignerUsageType, SolanaPaymentBuildInput, SolanaPaymentBuildResult, TokenBalance, UserOpsSigner, WalletTokenBalanceInput } from "./types";
2
+ import { ExactInQuoteInput, ExactInQuoteResponse, ListListedKaminoVaultIdsInput, ListListedKaminoVaultIdsResponse, OpsSignerMigrationState, OpsSignerReplacement, OpsSignerType, Portfolio, SignerUsageType, SolanaPaymentBuildInput, SolanaPaymentBuildResult, TokenBalance, UserOpsSigner, WalletTokenBalanceInput } from "./types";
3
3
  export declare function getExactInQuote(input: ExactInQuoteInput): Promise<ExactInQuoteResponse>;
4
4
  export declare function getTokenBalances(input: WalletTokenBalanceInput): Promise<import("../types").ApiFailure | import("../types").ApiSuccess<TokenBalance[]>>;
5
5
  export declare function getPortfolio(address: string): Promise<import("../types").ApiFailure | import("../types").ApiSuccess<Portfolio>>;
@@ -24,5 +24,18 @@ export declare function ensureUserOpsSigner(input: {
24
24
  userId: string;
25
25
  signerType: OpsSignerType;
26
26
  }): Promise<import("../types").ApiFailure | import("../types").ApiSuccess<UserOpsSigner>>;
27
+ /**
28
+ * Creates an inactive signer in the current ops wallet for a legacy user. The
29
+ * existing signer remains active until its consumer completes the external
30
+ * authorisation cutover.
31
+ */
32
+ export declare function stageUserOpsSignerReplacement(input: {
33
+ userId: string;
34
+ signerType: OpsSignerType;
35
+ }): Promise<import("../types").ApiFailure | import("../types").ApiSuccess<OpsSignerReplacement>>;
36
+ export declare function getUserOpsSignerReplacement(input: {
37
+ userId: string;
38
+ signerType: OpsSignerType;
39
+ }): Promise<import("../types").ApiFailure | import("../types").ApiSuccess<OpsSignerMigrationState>>;
27
40
  export declare function buildSolanaPayment(input: SolanaPaymentBuildInput): Promise<import("../types").ApiFailure | import("../types").ApiSuccess<SolanaPaymentBuildResult>>;
28
41
  export declare function listListedKaminoVaultIds(input?: ListListedKaminoVaultIdsInput): Promise<import("../types").ApiFailure | import("../types").ApiSuccess<ListListedKaminoVaultIdsResponse>>;
@@ -41,6 +41,8 @@ exports.getUserOpsSigner = getUserOpsSigner;
41
41
  exports.getUserOpsSignerByAddress = getUserOpsSignerByAddress;
42
42
  exports.getSmartAccountAddress = getSmartAccountAddress;
43
43
  exports.ensureUserOpsSigner = ensureUserOpsSigner;
44
+ exports.stageUserOpsSignerReplacement = stageUserOpsSignerReplacement;
45
+ exports.getUserOpsSignerReplacement = getUserOpsSignerReplacement;
44
46
  exports.buildSolanaPayment = buildSolanaPayment;
45
47
  exports.listListedKaminoVaultIds = listListedKaminoVaultIds;
46
48
  exports.Web3Client = __importStar(require("./web3ServiceClient"));
@@ -88,6 +90,21 @@ async function ensureUserOpsSigner(input) {
88
90
  .post(`${WEB3_ENDPOINT}/ops-signer/user/${input.userId}?signerType=${input.signerType}`)
89
91
  .then((res) => res.data);
90
92
  }
93
+ /**
94
+ * Creates an inactive signer in the current ops wallet for a legacy user. The
95
+ * existing signer remains active until its consumer completes the external
96
+ * authorisation cutover.
97
+ */
98
+ async function stageUserOpsSignerReplacement(input) {
99
+ return serviceClient_1.baseClient
100
+ .post(`${WEB3_V2_ENDPOINT}/ops-signers/${input.userId}/replacement?signerType=${input.signerType}`)
101
+ .then((res) => res.data);
102
+ }
103
+ async function getUserOpsSignerReplacement(input) {
104
+ return serviceClient_1.baseClient
105
+ .get(`${WEB3_V2_ENDPOINT}/ops-signers/${input.userId}/replacement?signerType=${input.signerType}`)
106
+ .then((res) => res.data);
107
+ }
91
108
  async function buildSolanaPayment(input) {
92
109
  return serviceClient_1.baseClient
93
110
  .post(`${WEB3_V2_ENDPOINT}/solana-payment/build`, input)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spritz-finance/service-client",
3
- "version": "0.21.0",
3
+ "version": "0.22.0",
4
4
  "gitHead": "06f8e96b7b38c34df26a38da329331940675e4f8",
5
5
  "description": "Service client",
6
6
  "license": "ISC",