@1shotapi/client-sdk 1.0.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.
- package/README.md +162 -0
- package/dist/categories/chains.d.ts +21 -0
- package/dist/categories/chains.js +44 -0
- package/dist/categories/chains.js.map +1 -0
- package/dist/categories/contractEvents.d.ts +103 -0
- package/dist/categories/contractEvents.js +115 -0
- package/dist/categories/contractEvents.js.map +1 -0
- package/dist/categories/contractMethods.d.ts +377 -0
- package/dist/categories/contractMethods.js +317 -0
- package/dist/categories/contractMethods.js.map +1 -0
- package/dist/categories/structs.d.ts +40 -0
- package/dist/categories/structs.js +68 -0
- package/dist/categories/structs.js.map +1 -0
- package/dist/categories/transactions.d.ts +31 -0
- package/dist/categories/transactions.js +51 -0
- package/dist/categories/transactions.js.map +1 -0
- package/dist/categories/wallets.d.ts +167 -0
- package/dist/categories/wallets.js +238 -0
- package/dist/categories/wallets.js.map +1 -0
- package/dist/client.d.ts +22 -0
- package/dist/client.js +61 -0
- package/dist/client.js.map +1 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.js +22 -0
- package/dist/index.js.map +1 -0
- package/dist/types/abi.d.ts +32 -0
- package/dist/types/abi.js +2 -0
- package/dist/types/abi.js.map +1 -0
- package/dist/types/chain.d.ts +26 -0
- package/dist/types/chain.js +2 -0
- package/dist/types/chain.js.map +1 -0
- package/dist/types/client.d.ts +13 -0
- package/dist/types/client.js +2 -0
- package/dist/types/client.js.map +1 -0
- package/dist/types/common.d.ts +8 -0
- package/dist/types/common.js +2 -0
- package/dist/types/common.js.map +1 -0
- package/dist/types/contract.d.ts +5 -0
- package/dist/types/contract.js +2 -0
- package/dist/types/contract.js.map +1 -0
- package/dist/types/contractEvent.d.ts +46 -0
- package/dist/types/contractEvent.js +2 -0
- package/dist/types/contractEvent.js.map +1 -0
- package/dist/types/contractMethod.d.ts +31 -0
- package/dist/types/contractMethod.js +2 -0
- package/dist/types/contractMethod.js.map +1 -0
- package/dist/types/struct.d.ts +8 -0
- package/dist/types/struct.js +2 -0
- package/dist/types/struct.js.map +1 -0
- package/dist/types/transaction.d.ts +12 -0
- package/dist/types/transaction.js +2 -0
- package/dist/types/transaction.js.map +1 -0
- package/dist/types/wallet.d.ts +30 -0
- package/dist/types/wallet.js +2 -0
- package/dist/types/wallet.js.map +1 -0
- package/dist/types.d.ts +11 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/utils/webhook.d.ts +19 -0
- package/dist/utils/webhook.js +66 -0
- package/dist/utils/webhook.js.map +1 -0
- package/dist/validation/abi.d.ts +470 -0
- package/dist/validation/abi.js +99 -0
- package/dist/validation/abi.js.map +1 -0
- package/dist/validation/chain.d.ts +157 -0
- package/dist/validation/chain.js +71 -0
- package/dist/validation/chain.js.map +1 -0
- package/dist/validation/common.d.ts +17 -0
- package/dist/validation/common.js +16 -0
- package/dist/validation/common.js.map +1 -0
- package/dist/validation/contractEvent.d.ts +323 -0
- package/dist/validation/contractEvent.js +148 -0
- package/dist/validation/contractEvent.js.map +1 -0
- package/dist/validation/contractMethod.d.ts +2746 -0
- package/dist/validation/contractMethod.js +787 -0
- package/dist/validation/contractMethod.js.map +1 -0
- package/dist/validation/struct.d.ts +495 -0
- package/dist/validation/struct.js +291 -0
- package/dist/validation/struct.js.map +1 -0
- package/dist/validation/transaction.d.ts +359 -0
- package/dist/validation/transaction.js +206 -0
- package/dist/validation/transaction.js.map +1 -0
- package/dist/validation/wallet.d.ts +537 -0
- package/dist/validation/wallet.js +287 -0
- package/dist/validation/wallet.js.map +1 -0
- package/package.json +71 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contractMethods.js","sourceRoot":"","sources":["../../src/categories/contractMethods.ts"],"names":[],"mappings":"AAmBA,OAAO,EACL,oBAAoB,EACpB,wBAAwB,EACxB,4BAA4B,EAC5B,yBAAyB,EACzB,2BAA2B,EAC3B,sCAAsC,EACtC,gCAAgC,EAChC,2CAA2C,EAC3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AAE,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IACtD,CAAC;CACF"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { IOneShotClient } from "../types/client.js";
|
|
2
|
+
import { SolidityStruct, SolidityStructParamUpdateRequest, NewSolidityStructParam } from "../types/struct.js";
|
|
3
|
+
export declare class Structs {
|
|
4
|
+
private client;
|
|
5
|
+
constructor(client: IOneShotClient);
|
|
6
|
+
/**
|
|
7
|
+
* Update an existing solidity struct
|
|
8
|
+
* @param structId The ID of the struct to update
|
|
9
|
+
* @param name The new name for the struct
|
|
10
|
+
* @returns Promise<SolidityStruct>
|
|
11
|
+
* @throws {ZodError} If the name is invalid
|
|
12
|
+
*/
|
|
13
|
+
update(structId: string, name: string): Promise<SolidityStruct>;
|
|
14
|
+
/**
|
|
15
|
+
* Add a parameter to an existing struct
|
|
16
|
+
* @param businessId The business ID that owns the struct
|
|
17
|
+
* @param structId The ID of the struct to add the parameter to
|
|
18
|
+
* @param param The new parameter to add
|
|
19
|
+
* @returns Promise<SolidityStruct>
|
|
20
|
+
* @throws {ZodError} If the parameter is invalid
|
|
21
|
+
*/
|
|
22
|
+
addParam(businessId: string, structId: string, param: NewSolidityStructParam): Promise<SolidityStruct>;
|
|
23
|
+
/**
|
|
24
|
+
* Update multiple parameters of a struct
|
|
25
|
+
* @param businessId The business ID that owns the struct
|
|
26
|
+
* @param structId The ID of the struct to update
|
|
27
|
+
* @param updates Array of parameter updates
|
|
28
|
+
* @returns Promise<SolidityStruct>
|
|
29
|
+
* @throws {ZodError} If any of the updates are invalid
|
|
30
|
+
*/
|
|
31
|
+
updateParams(businessId: string, structId: string, updates: SolidityStructParamUpdateRequest[]): Promise<SolidityStruct>;
|
|
32
|
+
/**
|
|
33
|
+
* Remove a parameter from a struct
|
|
34
|
+
* @param structId The ID of the struct
|
|
35
|
+
* @param structParamId The ID of the parameter to remove
|
|
36
|
+
* @returns Promise<SolidityStruct>
|
|
37
|
+
* @throws {ZodError} If the parameter ID is invalid
|
|
38
|
+
*/
|
|
39
|
+
removeParam(structId: string, structParamId: string): Promise<SolidityStruct>;
|
|
40
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { structUpdateSchema, addStructParamSchema, updateStructParamsSchema, removeStructParamSchema, } from "../validation/struct.js";
|
|
2
|
+
export class Structs {
|
|
3
|
+
constructor(client) {
|
|
4
|
+
this.client = client;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Update an existing solidity struct
|
|
8
|
+
* @param structId The ID of the struct to update
|
|
9
|
+
* @param name The new name for the struct
|
|
10
|
+
* @returns Promise<SolidityStruct>
|
|
11
|
+
* @throws {ZodError} If the name is invalid
|
|
12
|
+
*/
|
|
13
|
+
async update(structId, name) {
|
|
14
|
+
// Validate the update parameters
|
|
15
|
+
const validatedData = structUpdateSchema.parse({ name });
|
|
16
|
+
return this.client.request("PUT", `/structs/${structId}`, validatedData);
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Add a parameter to an existing struct
|
|
20
|
+
* @param businessId The business ID that owns the struct
|
|
21
|
+
* @param structId The ID of the struct to add the parameter to
|
|
22
|
+
* @param param The new parameter to add
|
|
23
|
+
* @returns Promise<SolidityStruct>
|
|
24
|
+
* @throws {ZodError} If the parameter is invalid
|
|
25
|
+
*/
|
|
26
|
+
async addParam(businessId, structId, param) {
|
|
27
|
+
// Validate all parameters using the schema
|
|
28
|
+
const validatedParams = addStructParamSchema.parse({
|
|
29
|
+
businessId,
|
|
30
|
+
structId,
|
|
31
|
+
param,
|
|
32
|
+
});
|
|
33
|
+
return this.client.request("POST", `/business/${validatedParams.businessId}/structs/${validatedParams.structId}/params`, validatedParams.param);
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Update multiple parameters of a struct
|
|
37
|
+
* @param businessId The business ID that owns the struct
|
|
38
|
+
* @param structId The ID of the struct to update
|
|
39
|
+
* @param updates Array of parameter updates
|
|
40
|
+
* @returns Promise<SolidityStruct>
|
|
41
|
+
* @throws {ZodError} If any of the updates are invalid
|
|
42
|
+
*/
|
|
43
|
+
async updateParams(businessId, structId, updates) {
|
|
44
|
+
// Validate all parameters using the schema
|
|
45
|
+
const validatedParams = updateStructParamsSchema.parse({
|
|
46
|
+
businessId,
|
|
47
|
+
structId,
|
|
48
|
+
updates,
|
|
49
|
+
});
|
|
50
|
+
return this.client.request("PUT", `/business/${validatedParams.businessId}/structs/${validatedParams.structId}/params`, { updates: validatedParams.updates });
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Remove a parameter from a struct
|
|
54
|
+
* @param structId The ID of the struct
|
|
55
|
+
* @param structParamId The ID of the parameter to remove
|
|
56
|
+
* @returns Promise<SolidityStruct>
|
|
57
|
+
* @throws {ZodError} If the parameter ID is invalid
|
|
58
|
+
*/
|
|
59
|
+
async removeParam(structId, structParamId) {
|
|
60
|
+
// Validate all parameters using the schema
|
|
61
|
+
const validatedParams = removeStructParamSchema.parse({
|
|
62
|
+
structId,
|
|
63
|
+
structParamId,
|
|
64
|
+
});
|
|
65
|
+
return this.client.request("DELETE", `/structs/${validatedParams.structId}/params/${validatedParams.structParamId}`);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=structs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"structs.js","sourceRoot":"","sources":["../../src/categories/structs.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EACpB,wBAAwB,EACxB,uBAAuB,GACxB,MAAM,yBAAyB,CAAC;AAEjC,MAAM,OAAO,OAAO;IAClB,YAAoB,MAAsB;QAAtB,WAAM,GAAN,MAAM,CAAgB;IAAG,CAAC;IAE9C;;;;;;OAMG;IACH,KAAK,CAAC,MAAM,CAAC,QAAgB,EAAE,IAAY;QACzC,iCAAiC;QACjC,MAAM,aAAa,GAAG,kBAAkB,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC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
+
import { IOneShotClient } from "../types/client.js";
|
|
2
|
+
import { PagedResponse } from "../types/common.js";
|
|
3
|
+
import { Transaction } from "../types/transaction.js";
|
|
4
|
+
export declare class Transactions {
|
|
5
|
+
private client;
|
|
6
|
+
constructor(client: IOneShotClient);
|
|
7
|
+
/**
|
|
8
|
+
* Get a specific transaction
|
|
9
|
+
* @param transactionId The ID of the execution
|
|
10
|
+
* @returns Promise<Transaction>
|
|
11
|
+
* @throws {ZodError} If the IDs are invalid
|
|
12
|
+
*/
|
|
13
|
+
get(transactionId: string): Promise<Transaction>;
|
|
14
|
+
/**
|
|
15
|
+
* List transaction executions for a business
|
|
16
|
+
* @param businessId The business ID to list executions for
|
|
17
|
+
* @param params Optional filter parameters
|
|
18
|
+
* @returns Promise<PagedResponse<Transaction>>
|
|
19
|
+
* @throws {ZodError} If the parameters are invalid
|
|
20
|
+
*/
|
|
21
|
+
list(businessId: string, params?: {
|
|
22
|
+
pageSize?: number;
|
|
23
|
+
page?: number;
|
|
24
|
+
chainId?: number;
|
|
25
|
+
status?: "Pending" | "Submitted" | "Completed" | "Retrying" | "Failed";
|
|
26
|
+
walletId?: string;
|
|
27
|
+
contractMethodId?: string;
|
|
28
|
+
apiCredentialId?: string;
|
|
29
|
+
userId?: string;
|
|
30
|
+
}): Promise<PagedResponse<Transaction>>;
|
|
31
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { transactionSchema, transactionListSchema, getTransactionSchema, listTransactionsSchema, } from "../validation/transaction.js";
|
|
2
|
+
export class Transactions {
|
|
3
|
+
constructor(client) {
|
|
4
|
+
this.client = client;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Get a specific transaction
|
|
8
|
+
* @param transactionId The ID of the execution
|
|
9
|
+
* @returns Promise<Transaction>
|
|
10
|
+
* @throws {ZodError} If the IDs are invalid
|
|
11
|
+
*/
|
|
12
|
+
async get(transactionId) {
|
|
13
|
+
// Validate all parameters using the schema
|
|
14
|
+
const validatedParams = getTransactionSchema.parse({
|
|
15
|
+
transactionId,
|
|
16
|
+
});
|
|
17
|
+
const response = await this.client.request("GET", `/transactions/${validatedParams.transactionId}`);
|
|
18
|
+
// Validate the response
|
|
19
|
+
return transactionSchema.parse(response);
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* List transaction executions for a business
|
|
23
|
+
* @param businessId The business ID to list executions for
|
|
24
|
+
* @param params Optional filter parameters
|
|
25
|
+
* @returns Promise<PagedResponse<Transaction>>
|
|
26
|
+
* @throws {ZodError} If the parameters are invalid
|
|
27
|
+
*/
|
|
28
|
+
async list(businessId, params) {
|
|
29
|
+
// Validate all parameters using the schema
|
|
30
|
+
const validatedParams = listTransactionsSchema.parse({
|
|
31
|
+
businessId,
|
|
32
|
+
...params,
|
|
33
|
+
});
|
|
34
|
+
const queryParams = new URLSearchParams();
|
|
35
|
+
if (params) {
|
|
36
|
+
Object.entries(params).forEach(([key, value]) => {
|
|
37
|
+
if (value !== undefined) {
|
|
38
|
+
queryParams.append(key, value.toString());
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
const queryString = queryParams.toString();
|
|
43
|
+
const path = queryString
|
|
44
|
+
? `/business/${validatedParams.businessId}/transactions?${queryString}`
|
|
45
|
+
: `/business/${validatedParams.businessId}/transactions`;
|
|
46
|
+
const response = await this.client.request("GET", path);
|
|
47
|
+
// Validate the response
|
|
48
|
+
return transactionListSchema.parse(response);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=transactions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transactions.js","sourceRoot":"","sources":["../../src/categories/transactions.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,oBAAoB,EACpB,sBAAsB,GACvB,MAAM,8BAA8B,CAAC;AAEtC,MAAM,OAAO,YAAY;IACvB,YAAoB,MAAsB;QAAtB,WAAM,GAAN,MAA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ACxB,OAAO,qBAAqB,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IAC/C,CAAC;CACF"}
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import { z } from "zod/index.js";
|
|
2
|
+
import { IOneShotClient } from "../types/client.js";
|
|
3
|
+
import { PagedResponse } from "../types/common.js";
|
|
4
|
+
import { Transaction } from "../types/transaction.js";
|
|
5
|
+
import { Wallet, Delegation, SignatureResponse } from "../types/wallet.js";
|
|
6
|
+
declare const listWalletsSchemaOptions: z.ZodObject<Omit<{
|
|
7
|
+
businessId: z.ZodString;
|
|
8
|
+
chainId: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
9
|
+
pageSize: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
10
|
+
page: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
11
|
+
name: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
12
|
+
}, "businessId">, "strip", z.ZodTypeAny, {
|
|
13
|
+
name?: string | null | undefined;
|
|
14
|
+
chainId?: number | null | undefined;
|
|
15
|
+
page?: number | null | undefined;
|
|
16
|
+
pageSize?: number | null | undefined;
|
|
17
|
+
}, {
|
|
18
|
+
name?: string | null | undefined;
|
|
19
|
+
chainId?: number | null | undefined;
|
|
20
|
+
page?: number | null | undefined;
|
|
21
|
+
pageSize?: number | null | undefined;
|
|
22
|
+
}>;
|
|
23
|
+
declare const getWalletSchemaOptions: z.ZodObject<Omit<{
|
|
24
|
+
walletId: z.ZodString;
|
|
25
|
+
includeBalances: z.ZodNullable<z.ZodOptional<z.ZodBoolean>>;
|
|
26
|
+
}, "walletId">, "strip", z.ZodTypeAny, {
|
|
27
|
+
includeBalances?: boolean | null | undefined;
|
|
28
|
+
}, {
|
|
29
|
+
includeBalances?: boolean | null | undefined;
|
|
30
|
+
}>;
|
|
31
|
+
declare const listDelegationsSchemaOptions: z.ZodObject<Omit<{
|
|
32
|
+
walletId: z.ZodString;
|
|
33
|
+
pageSize: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
34
|
+
page: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
35
|
+
}, "walletId">, "strip", z.ZodTypeAny, {
|
|
36
|
+
page?: number | null | undefined;
|
|
37
|
+
pageSize?: number | null | undefined;
|
|
38
|
+
}, {
|
|
39
|
+
page?: number | null | undefined;
|
|
40
|
+
pageSize?: number | null | undefined;
|
|
41
|
+
}>;
|
|
42
|
+
declare const getSignatureSchemaOptions: z.ZodObject<Omit<{
|
|
43
|
+
walletId: z.ZodString;
|
|
44
|
+
type: z.ZodEnum<["erc3009", "permit2"]>;
|
|
45
|
+
contractAddress: z.ZodString;
|
|
46
|
+
destinationAddress: z.ZodString;
|
|
47
|
+
amount: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
48
|
+
validUntil: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
49
|
+
validAfter: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
50
|
+
}, "type" | "walletId">, "strip", z.ZodTypeAny, {
|
|
51
|
+
contractAddress: string;
|
|
52
|
+
destinationAddress: string;
|
|
53
|
+
amount?: string | null | undefined;
|
|
54
|
+
validUntil?: number | null | undefined;
|
|
55
|
+
validAfter?: number | null | undefined;
|
|
56
|
+
}, {
|
|
57
|
+
contractAddress: string;
|
|
58
|
+
destinationAddress: string;
|
|
59
|
+
amount?: string | null | undefined;
|
|
60
|
+
validUntil?: number | null | undefined;
|
|
61
|
+
validAfter?: number | null | undefined;
|
|
62
|
+
}>;
|
|
63
|
+
export declare class Wallets {
|
|
64
|
+
private client;
|
|
65
|
+
constructor(client: IOneShotClient);
|
|
66
|
+
/**
|
|
67
|
+
* List wallets for a business
|
|
68
|
+
* @param businessId The business ID to list wallets for
|
|
69
|
+
* @param params Optional filter parameters
|
|
70
|
+
* @returns Promise<PagedResponse<Wallet>>
|
|
71
|
+
* @throws {ZodError} If the parameters are invalid
|
|
72
|
+
*/
|
|
73
|
+
list(businessId: string, params?: z.infer<typeof listWalletsSchemaOptions>): Promise<PagedResponse<Wallet>>;
|
|
74
|
+
/**
|
|
75
|
+
* Create a new wallet for a business
|
|
76
|
+
* @param businessId The business ID to create the wallet for
|
|
77
|
+
* @param params Creation parameters including chainId, name, and optional description
|
|
78
|
+
* @returns Promise<Wallet>
|
|
79
|
+
* @throws {ZodError} If the parameters are invalid
|
|
80
|
+
*/
|
|
81
|
+
create(businessId: string, params: {
|
|
82
|
+
chainId: number;
|
|
83
|
+
name: string;
|
|
84
|
+
description?: string;
|
|
85
|
+
}): Promise<Wallet>;
|
|
86
|
+
/**
|
|
87
|
+
* Get a wallet by ID
|
|
88
|
+
* @param walletId The ID of the wallet to get
|
|
89
|
+
* @param includeBalances Whether to include balance information
|
|
90
|
+
* @returns Promise<Wallet>
|
|
91
|
+
* @throws {ZodError} If the parameters are invalid
|
|
92
|
+
*/
|
|
93
|
+
get(walletId: string, includeBalances?: z.infer<typeof getWalletSchemaOptions>): Promise<Wallet>;
|
|
94
|
+
/**
|
|
95
|
+
* Update a wallet
|
|
96
|
+
* @param walletId The ID of the wallet to update
|
|
97
|
+
* @param params Update parameters
|
|
98
|
+
* @returns Promise<Wallet>
|
|
99
|
+
* @throws {ZodError} If the parameters are invalid
|
|
100
|
+
*/
|
|
101
|
+
update(walletId: string, params: {
|
|
102
|
+
name?: string;
|
|
103
|
+
description?: string;
|
|
104
|
+
}): Promise<Wallet>;
|
|
105
|
+
/**
|
|
106
|
+
* Delete a wallet
|
|
107
|
+
* @param walletId The ID of the wallet to delete
|
|
108
|
+
* @returns Promise<{ success: boolean }>
|
|
109
|
+
* @throws {ZodError} If the wallet ID is invalid
|
|
110
|
+
*/
|
|
111
|
+
delete(walletId: string): Promise<{
|
|
112
|
+
success: boolean;
|
|
113
|
+
}>;
|
|
114
|
+
/**
|
|
115
|
+
* Transfer native tokens from a wallet
|
|
116
|
+
* @param walletId The ID of the wallet to transfer funds from
|
|
117
|
+
* @param params Transfer parameters including destination address, optional amount, and optional memo
|
|
118
|
+
* @returns Promise<Transaction>
|
|
119
|
+
* @throws {ZodError} If the parameters are invalid
|
|
120
|
+
*/
|
|
121
|
+
transfer(walletId: string, params: {
|
|
122
|
+
destinationAccountAddress: string;
|
|
123
|
+
transferAmount?: string;
|
|
124
|
+
memo?: string;
|
|
125
|
+
}): Promise<Transaction>;
|
|
126
|
+
/**
|
|
127
|
+
* List delegations for a wallet
|
|
128
|
+
* @param walletId The ID of the wallet to list delegations for
|
|
129
|
+
* @param params Optional pagination parameters
|
|
130
|
+
* @returns Promise<PagedResponse<Delegation>>
|
|
131
|
+
* @throws {ZodError} If the parameters are invalid
|
|
132
|
+
*/
|
|
133
|
+
listDelegations(walletId: string, params?: z.infer<typeof listDelegationsSchemaOptions>): Promise<PagedResponse<Delegation>>;
|
|
134
|
+
/**
|
|
135
|
+
* Create a new delegation for a wallet
|
|
136
|
+
* @param walletId The ID of the wallet to create the delegation for
|
|
137
|
+
* @param params Delegation creation parameters
|
|
138
|
+
* @returns Promise<Delegation>
|
|
139
|
+
* @throws {ZodError} If the parameters are invalid
|
|
140
|
+
*/
|
|
141
|
+
createDelegation(walletId: string, params: {
|
|
142
|
+
delegationData: string;
|
|
143
|
+
startTime?: number;
|
|
144
|
+
endTime?: number;
|
|
145
|
+
contractAddresses?: string[];
|
|
146
|
+
methods?: string[];
|
|
147
|
+
}): Promise<Delegation>;
|
|
148
|
+
/**
|
|
149
|
+
* Delete a delegation by its ID
|
|
150
|
+
* @param delegationId The ID of the delegation to delete
|
|
151
|
+
* @returns Promise<{ success: boolean }>
|
|
152
|
+
* @throws {ZodError} If the delegation ID is invalid
|
|
153
|
+
*/
|
|
154
|
+
deleteDelegation(delegationId: string): Promise<{
|
|
155
|
+
success: boolean;
|
|
156
|
+
}>;
|
|
157
|
+
/**
|
|
158
|
+
* Get a signature from a wallet
|
|
159
|
+
* @param walletId The ID of the wallet to get a signature from
|
|
160
|
+
* @param type The type of signature to get (erc3009 or permit2)
|
|
161
|
+
* @param params Signature parameters including contractAddress, destinationAddress, and optional amount, validUntil, validAfter
|
|
162
|
+
* @returns Promise<SignatureResponse>
|
|
163
|
+
* @throws {ZodError} If the parameters are invalid
|
|
164
|
+
*/
|
|
165
|
+
getSignature(walletId: string, type: "erc3009" | "permit2", params: z.infer<typeof getSignatureSchemaOptions>): Promise<SignatureResponse>;
|
|
166
|
+
}
|
|
167
|
+
export {};
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
import { walletSchema, walletListSchema, listWalletsSchema, createWalletSchema, getWalletSchema, updateWalletSchema, deleteWalletSchema, transferWalletSchema, delegationSchema, delegationListSchema, listDelegationsSchema, createDelegationSchema, deleteDelegationSchema, getSignatureSchema, signatureResponseSchema, } from "../validation/wallet.js";
|
|
2
|
+
const listWalletsSchemaOptions = listWalletsSchema.omit({ businessId: true });
|
|
3
|
+
const getWalletSchemaOptions = getWalletSchema.omit({ walletId: true });
|
|
4
|
+
const listDelegationsSchemaOptions = listDelegationsSchema.omit({ walletId: true });
|
|
5
|
+
const getSignatureSchemaOptions = getSignatureSchema.omit({ walletId: true, type: true });
|
|
6
|
+
export class Wallets {
|
|
7
|
+
constructor(client) {
|
|
8
|
+
this.client = client;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* List wallets for a business
|
|
12
|
+
* @param businessId The business ID to list wallets for
|
|
13
|
+
* @param params Optional filter parameters
|
|
14
|
+
* @returns Promise<PagedResponse<Wallet>>
|
|
15
|
+
* @throws {ZodError} If the parameters are invalid
|
|
16
|
+
*/
|
|
17
|
+
async list(businessId, params) {
|
|
18
|
+
// Validate all parameters using the schema
|
|
19
|
+
const validatedParams = listWalletsSchema.parse({
|
|
20
|
+
businessId,
|
|
21
|
+
...params,
|
|
22
|
+
});
|
|
23
|
+
const queryParams = new URLSearchParams();
|
|
24
|
+
if (params) {
|
|
25
|
+
Object.entries(params).forEach(([key, value]) => {
|
|
26
|
+
if (value != undefined) {
|
|
27
|
+
queryParams.append(key, value.toString());
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
const queryString = queryParams.toString();
|
|
32
|
+
const path = queryString
|
|
33
|
+
? `/business/${validatedParams.businessId}/wallets?${queryString}`
|
|
34
|
+
: `/business/${validatedParams.businessId}/wallets`;
|
|
35
|
+
const response = await this.client.request("GET", path);
|
|
36
|
+
// Validate the response
|
|
37
|
+
return walletListSchema.parse(response);
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Create a new wallet for a business
|
|
41
|
+
* @param businessId The business ID to create the wallet for
|
|
42
|
+
* @param params Creation parameters including chainId, name, and optional description
|
|
43
|
+
* @returns Promise<Wallet>
|
|
44
|
+
* @throws {ZodError} If the parameters are invalid
|
|
45
|
+
*/
|
|
46
|
+
async create(businessId, params) {
|
|
47
|
+
// Validate all parameters using the schema
|
|
48
|
+
const validatedParams = createWalletSchema.parse({
|
|
49
|
+
businessId,
|
|
50
|
+
...params,
|
|
51
|
+
});
|
|
52
|
+
const response = await this.client.request("POST", `/business/${validatedParams.businessId}/wallets`, {
|
|
53
|
+
chainId: validatedParams.chainId,
|
|
54
|
+
name: validatedParams.name,
|
|
55
|
+
description: validatedParams.description,
|
|
56
|
+
});
|
|
57
|
+
// Validate the response
|
|
58
|
+
return walletSchema.parse(response);
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Get a wallet by ID
|
|
62
|
+
* @param walletId The ID of the wallet to get
|
|
63
|
+
* @param includeBalances Whether to include balance information
|
|
64
|
+
* @returns Promise<Wallet>
|
|
65
|
+
* @throws {ZodError} If the parameters are invalid
|
|
66
|
+
*/
|
|
67
|
+
async get(walletId, includeBalances) {
|
|
68
|
+
// Validate all parameters using the schema
|
|
69
|
+
const validatedParams = getWalletSchema.parse({
|
|
70
|
+
walletId,
|
|
71
|
+
includeBalances,
|
|
72
|
+
});
|
|
73
|
+
const queryParams = new URLSearchParams();
|
|
74
|
+
if (validatedParams.includeBalances != undefined) {
|
|
75
|
+
queryParams.append("includeBalances", validatedParams.includeBalances.toString());
|
|
76
|
+
}
|
|
77
|
+
const queryString = queryParams.toString();
|
|
78
|
+
const path = queryString
|
|
79
|
+
? `/wallets/${validatedParams.walletId}?${queryString}`
|
|
80
|
+
: `/wallets/${validatedParams.walletId}`;
|
|
81
|
+
const response = await this.client.request("GET", path);
|
|
82
|
+
// Validate the response
|
|
83
|
+
return walletSchema.parse(response);
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Update a wallet
|
|
87
|
+
* @param walletId The ID of the wallet to update
|
|
88
|
+
* @param params Update parameters
|
|
89
|
+
* @returns Promise<Wallet>
|
|
90
|
+
* @throws {ZodError} If the parameters are invalid
|
|
91
|
+
*/
|
|
92
|
+
async update(walletId, params) {
|
|
93
|
+
// Validate all parameters using the schema
|
|
94
|
+
const validatedParams = updateWalletSchema.parse({
|
|
95
|
+
walletId,
|
|
96
|
+
...params,
|
|
97
|
+
});
|
|
98
|
+
const response = await this.client.request("PUT", `/wallets/${validatedParams.walletId}`, {
|
|
99
|
+
name: validatedParams.name,
|
|
100
|
+
description: validatedParams.description,
|
|
101
|
+
});
|
|
102
|
+
// Validate the response
|
|
103
|
+
return walletSchema.parse(response);
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Delete a wallet
|
|
107
|
+
* @param walletId The ID of the wallet to delete
|
|
108
|
+
* @returns Promise<{ success: boolean }>
|
|
109
|
+
* @throws {ZodError} If the wallet ID is invalid
|
|
110
|
+
*/
|
|
111
|
+
async delete(walletId) {
|
|
112
|
+
// Validate all parameters using the schema
|
|
113
|
+
const validatedParams = deleteWalletSchema.parse({
|
|
114
|
+
walletId,
|
|
115
|
+
});
|
|
116
|
+
return this.client.request("DELETE", `/wallets/${validatedParams.walletId}`);
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Transfer native tokens from a wallet
|
|
120
|
+
* @param walletId The ID of the wallet to transfer funds from
|
|
121
|
+
* @param params Transfer parameters including destination address, optional amount, and optional memo
|
|
122
|
+
* @returns Promise<Transaction>
|
|
123
|
+
* @throws {ZodError} If the parameters are invalid
|
|
124
|
+
*/
|
|
125
|
+
async transfer(walletId, params) {
|
|
126
|
+
// Validate all parameters using the schema
|
|
127
|
+
const validatedParams = transferWalletSchema.parse({
|
|
128
|
+
walletId,
|
|
129
|
+
...params,
|
|
130
|
+
});
|
|
131
|
+
const response = await this.client.request("POST", `/wallets/${validatedParams.walletId}/transfer`, {
|
|
132
|
+
destinationAccountAddress: validatedParams.destinationAccountAddress,
|
|
133
|
+
transferAmount: validatedParams.transferAmount,
|
|
134
|
+
memo: validatedParams.memo,
|
|
135
|
+
});
|
|
136
|
+
// Return the response (Transaction type is already validated by the API)
|
|
137
|
+
return response;
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* List delegations for a wallet
|
|
141
|
+
* @param walletId The ID of the wallet to list delegations for
|
|
142
|
+
* @param params Optional pagination parameters
|
|
143
|
+
* @returns Promise<PagedResponse<Delegation>>
|
|
144
|
+
* @throws {ZodError} If the parameters are invalid
|
|
145
|
+
*/
|
|
146
|
+
async listDelegations(walletId, params) {
|
|
147
|
+
// Validate all parameters using the schema
|
|
148
|
+
const validatedParams = listDelegationsSchema.parse({
|
|
149
|
+
walletId,
|
|
150
|
+
...params,
|
|
151
|
+
});
|
|
152
|
+
const queryParams = new URLSearchParams();
|
|
153
|
+
if (params) {
|
|
154
|
+
Object.entries(params).forEach(([key, value]) => {
|
|
155
|
+
if (value != undefined) {
|
|
156
|
+
queryParams.append(key, value.toString());
|
|
157
|
+
}
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
const queryString = queryParams.toString();
|
|
161
|
+
const path = queryString
|
|
162
|
+
? `/wallets/${validatedParams.walletId}/delegations?${queryString}`
|
|
163
|
+
: `/wallets/${validatedParams.walletId}/delegations`;
|
|
164
|
+
const response = await this.client.request("GET", path);
|
|
165
|
+
// Validate the response
|
|
166
|
+
return delegationListSchema.parse(response);
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Create a new delegation for a wallet
|
|
170
|
+
* @param walletId The ID of the wallet to create the delegation for
|
|
171
|
+
* @param params Delegation creation parameters
|
|
172
|
+
* @returns Promise<Delegation>
|
|
173
|
+
* @throws {ZodError} If the parameters are invalid
|
|
174
|
+
*/
|
|
175
|
+
async createDelegation(walletId, params) {
|
|
176
|
+
// Validate all parameters using the schema
|
|
177
|
+
const validatedParams = createDelegationSchema.parse({
|
|
178
|
+
walletId,
|
|
179
|
+
...params,
|
|
180
|
+
});
|
|
181
|
+
const response = await this.client.request("POST", `/wallets/${validatedParams.walletId}/delegations`, {
|
|
182
|
+
startTime: validatedParams.startTime,
|
|
183
|
+
endTime: validatedParams.endTime,
|
|
184
|
+
contractAddresses: validatedParams.contractAddresses,
|
|
185
|
+
methods: validatedParams.methods,
|
|
186
|
+
delegationData: validatedParams.delegationData,
|
|
187
|
+
});
|
|
188
|
+
// Validate the response
|
|
189
|
+
return delegationSchema.parse(response);
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* Delete a delegation by its ID
|
|
193
|
+
* @param delegationId The ID of the delegation to delete
|
|
194
|
+
* @returns Promise<{ success: boolean }>
|
|
195
|
+
* @throws {ZodError} If the delegation ID is invalid
|
|
196
|
+
*/
|
|
197
|
+
async deleteDelegation(delegationId) {
|
|
198
|
+
// Validate all parameters using the schema
|
|
199
|
+
const validatedParams = deleteDelegationSchema.parse({
|
|
200
|
+
delegationId,
|
|
201
|
+
});
|
|
202
|
+
return this.client.request("DELETE", `/delegation/${validatedParams.delegationId}`);
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* Get a signature from a wallet
|
|
206
|
+
* @param walletId The ID of the wallet to get a signature from
|
|
207
|
+
* @param type The type of signature to get (erc3009 or permit2)
|
|
208
|
+
* @param params Signature parameters including contractAddress, destinationAddress, and optional amount, validUntil, validAfter
|
|
209
|
+
* @returns Promise<SignatureResponse>
|
|
210
|
+
* @throws {ZodError} If the parameters are invalid
|
|
211
|
+
*/
|
|
212
|
+
async getSignature(walletId, type, params) {
|
|
213
|
+
// Validate all parameters using the schema
|
|
214
|
+
const validatedParams = getSignatureSchema.parse({
|
|
215
|
+
walletId,
|
|
216
|
+
type,
|
|
217
|
+
...params,
|
|
218
|
+
});
|
|
219
|
+
const queryParams = new URLSearchParams();
|
|
220
|
+
queryParams.append("contractAddress", validatedParams.contractAddress);
|
|
221
|
+
queryParams.append("destinationAddress", validatedParams.destinationAddress);
|
|
222
|
+
if (validatedParams.amount !== undefined && validatedParams.amount !== null) {
|
|
223
|
+
queryParams.append("amount", validatedParams.amount);
|
|
224
|
+
}
|
|
225
|
+
if (validatedParams.validUntil !== undefined && validatedParams.validUntil !== null) {
|
|
226
|
+
queryParams.append("validUntil", validatedParams.validUntil.toString());
|
|
227
|
+
}
|
|
228
|
+
if (validatedParams.validAfter !== undefined && validatedParams.validAfter !== null) {
|
|
229
|
+
queryParams.append("validAfter", validatedParams.validAfter.toString());
|
|
230
|
+
}
|
|
231
|
+
const queryString = queryParams.toString();
|
|
232
|
+
const path = `/wallets/${validatedParams.walletId}/signature/${validatedParams.type}?${queryString}`;
|
|
233
|
+
const response = await this.client.request("GET", path);
|
|
234
|
+
// Validate the response
|
|
235
|
+
return signatureResponseSchema.parse(response);
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
//# sourceMappingURL=wallets.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wallets.js","sourceRoot":"","sources":["../../src/categories/wallets.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,iBAAiB,EACjB,kBAAkB,EAClB,eAAe,EACf,kBAAkB,EAClB,kBAAkB,EAClB,oBAAoB,EACpB,gBAAgB,EAChB,oBAAoB,EACpB,qBAAqB,EACrB,sBAAsB,EACtB,sBAAsB,EACtB,kBAAkB,EAClB,uBAAuB,GACxB,MAAM,yBAAyB,CAAC;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,EAAE,CAAC;YAC5E,WAAW,CAAC,MAAM,CAAC,QAAQ,EAAE,eAAe,CAAC,MAAM,CAAC,CAAC;QACvD,CAAC;QACD,IAAI,eAAe,CAAC,UAAU,KAAK,SAAS,IAAI,eAAe,CAAC,UAAU,KAAK,IAAI,EAAE,CAAC;YACpF,WAAW,CAAC,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC,CAAC;QAC1E,CAAC;QACD,IAAI,eAAe,CAAC,UAAU,KAAK,SAAS,IAAI,eAAe,CAAC,UAAU,KAAK,IAAI,EAAE,CAAC;YACpF,WAAW,CAAC,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC,CAAC;QAC1E,CAAC;QAED,MAAM,WAAW,GAAG,WAAW,CAAC,QAAQ,EAAE,CAAC;QAC3C,MAAM,IAAI,GAAG,YAAY,eAAe,CAAC,QAAQ,cAAc,eAAe,CAAC,IAAI,IAAI,WAAW,EAAE,CAAC;QAErG,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CAAoB,KAAK,EAAE,IAAI,CAAC,CAAC;QAE3E,wBAAwB;QACxB,OAAO,uBAAuB,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IACjD,CAAC;CACF"}
|
package/dist/client.d.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Chains } from "./categories/chains.js";
|
|
2
|
+
import { ContractEvents } from "./categories/contractEvents.js";
|
|
3
|
+
import { ContractMethods } from "./categories/contractMethods.js";
|
|
4
|
+
import { Structs } from "./categories/structs.js";
|
|
5
|
+
import { Transactions } from "./categories/transactions.js";
|
|
6
|
+
import { Wallets } from "./categories/wallets.js";
|
|
7
|
+
import { IOneShotClient } from "./types/client.js";
|
|
8
|
+
import { ClientConfig } from "./types.js";
|
|
9
|
+
export declare class OneShotClient implements IOneShotClient {
|
|
10
|
+
private config;
|
|
11
|
+
private accessToken;
|
|
12
|
+
private tokenExpiry;
|
|
13
|
+
readonly transactions: Transactions;
|
|
14
|
+
readonly contractMethods: ContractMethods;
|
|
15
|
+
readonly wallets: Wallets;
|
|
16
|
+
readonly structs: Structs;
|
|
17
|
+
readonly chains: Chains;
|
|
18
|
+
readonly contractEvents: ContractEvents;
|
|
19
|
+
constructor(config: ClientConfig);
|
|
20
|
+
private getAccessToken;
|
|
21
|
+
request<T>(method: string, path: string, body?: unknown): Promise<T>;
|
|
22
|
+
}
|