@spritz-finance/service-client 0.20.0 → 0.21.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.
@@ -14,8 +14,15 @@ export declare function getSmartAccountAddress(input: {
14
14
  userId: string;
15
15
  usageType: SignerUsageType;
16
16
  }): Promise<import("../types").ApiFailure | import("../types").ApiSuccess<`0x${string}`>>;
17
- export declare function createUserOpsSigner(input: {
17
+ /**
18
+ * Provisions the user's signer for `signerType` if they do not already have one
19
+ * and returns it. Turnkey bills per derived address, so signers are minted
20
+ * just-in-time by the first flow that needs one rather than at KYC — call this
21
+ * instead of `getUserOpsSigner` anywhere a missing signer should be created.
22
+ */
23
+ export declare function ensureUserOpsSigner(input: {
18
24
  userId: string;
19
- }): Promise<import("../types").ApiFailure | import("../types").ApiSuccess<boolean>>;
25
+ signerType: OpsSignerType;
26
+ }): Promise<import("../types").ApiFailure | import("../types").ApiSuccess<UserOpsSigner>>;
20
27
  export declare function buildSolanaPayment(input: SolanaPaymentBuildInput): Promise<import("../types").ApiFailure | import("../types").ApiSuccess<SolanaPaymentBuildResult>>;
21
28
  export declare function listListedKaminoVaultIds(input?: ListListedKaminoVaultIdsInput): Promise<import("../types").ApiFailure | import("../types").ApiSuccess<ListListedKaminoVaultIdsResponse>>;
@@ -40,7 +40,7 @@ exports.getPortfolio = getPortfolio;
40
40
  exports.getUserOpsSigner = getUserOpsSigner;
41
41
  exports.getUserOpsSignerByAddress = getUserOpsSignerByAddress;
42
42
  exports.getSmartAccountAddress = getSmartAccountAddress;
43
- exports.createUserOpsSigner = createUserOpsSigner;
43
+ exports.ensureUserOpsSigner = ensureUserOpsSigner;
44
44
  exports.buildSolanaPayment = buildSolanaPayment;
45
45
  exports.listListedKaminoVaultIds = listListedKaminoVaultIds;
46
46
  exports.Web3Client = __importStar(require("./web3ServiceClient"));
@@ -77,9 +77,15 @@ async function getSmartAccountAddress(input) {
77
77
  .get(`${WEB3_ENDPOINT}/ops-signer/smart-account/${input.userId}?usageType=${input.usageType}`)
78
78
  .then((res) => res.data);
79
79
  }
80
- async function createUserOpsSigner(input) {
80
+ /**
81
+ * Provisions the user's signer for `signerType` if they do not already have one
82
+ * and returns it. Turnkey bills per derived address, so signers are minted
83
+ * just-in-time by the first flow that needs one rather than at KYC — call this
84
+ * instead of `getUserOpsSigner` anywhere a missing signer should be created.
85
+ */
86
+ async function ensureUserOpsSigner(input) {
81
87
  return serviceClient_1.baseClient
82
- .post(`${WEB3_ENDPOINT}/ops-signer/user/${input.userId}`)
88
+ .post(`${WEB3_ENDPOINT}/ops-signer/user/${input.userId}?signerType=${input.signerType}`)
83
89
  .then((res) => res.data);
84
90
  }
85
91
  async function buildSolanaPayment(input) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spritz-finance/service-client",
3
- "version": "0.20.0",
3
+ "version": "0.21.0",
4
4
  "gitHead": "06f8e96b7b38c34df26a38da329331940675e4f8",
5
5
  "description": "Service client",
6
6
  "license": "ISC",