@brninpay/sdk 0.1.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.
Files changed (95) hide show
  1. package/.turbo/turbo-build.log +4 -0
  2. package/LICENSE +203 -0
  3. package/README.md +5 -0
  4. package/dist/actor-client.d.ts +13 -0
  5. package/dist/actor-client.d.ts.map +1 -0
  6. package/dist/actor-client.js +44 -0
  7. package/dist/actor-client.js.map +1 -0
  8. package/dist/bundler/client.d.ts +20 -0
  9. package/dist/bundler/client.d.ts.map +1 -0
  10. package/dist/bundler/client.js +228 -0
  11. package/dist/bundler/client.js.map +1 -0
  12. package/dist/bundler/providers/alchemy.d.ts +3 -0
  13. package/dist/bundler/providers/alchemy.d.ts.map +1 -0
  14. package/dist/bundler/providers/alchemy.js +15 -0
  15. package/dist/bundler/providers/alchemy.js.map +1 -0
  16. package/dist/bundler/providers/pimlico.d.ts +3 -0
  17. package/dist/bundler/providers/pimlico.d.ts.map +1 -0
  18. package/dist/bundler/providers/pimlico.js +12 -0
  19. package/dist/bundler/providers/pimlico.js.map +1 -0
  20. package/dist/client.d.ts +24 -0
  21. package/dist/client.d.ts.map +1 -0
  22. package/dist/client.js +352 -0
  23. package/dist/client.js.map +1 -0
  24. package/dist/conversion.d.ts +3 -0
  25. package/dist/conversion.d.ts.map +1 -0
  26. package/dist/conversion.js +27 -0
  27. package/dist/conversion.js.map +1 -0
  28. package/dist/erc4337/builder.d.ts +15 -0
  29. package/dist/erc4337/builder.d.ts.map +1 -0
  30. package/dist/erc4337/builder.js +144 -0
  31. package/dist/erc4337/builder.js.map +1 -0
  32. package/dist/erc4337/providers/kernel.d.ts +23 -0
  33. package/dist/erc4337/providers/kernel.d.ts.map +1 -0
  34. package/dist/erc4337/providers/kernel.js +120 -0
  35. package/dist/erc4337/providers/kernel.js.map +1 -0
  36. package/dist/erc4337/providers/safe.d.ts +23 -0
  37. package/dist/erc4337/providers/safe.d.ts.map +1 -0
  38. package/dist/erc4337/providers/safe.js +117 -0
  39. package/dist/erc4337/providers/safe.js.map +1 -0
  40. package/dist/erc4337/providers/types.d.ts +88 -0
  41. package/dist/erc4337/providers/types.d.ts.map +1 -0
  42. package/dist/erc4337/providers/types.js +35 -0
  43. package/dist/erc4337/providers/types.js.map +1 -0
  44. package/dist/erc4337/smart-wallet.d.ts +16 -0
  45. package/dist/erc4337/smart-wallet.d.ts.map +1 -0
  46. package/dist/erc4337/smart-wallet.js +86 -0
  47. package/dist/erc4337/smart-wallet.js.map +1 -0
  48. package/dist/index.d.ts +16 -0
  49. package/dist/index.d.ts.map +1 -0
  50. package/dist/index.js +15 -0
  51. package/dist/index.js.map +1 -0
  52. package/dist/modules/payment-intents.d.ts +99 -0
  53. package/dist/modules/payment-intents.d.ts.map +1 -0
  54. package/dist/modules/payment-intents.js +118 -0
  55. package/dist/modules/payment-intents.js.map +1 -0
  56. package/dist/modules/policies.d.ts +87 -0
  57. package/dist/modules/policies.d.ts.map +1 -0
  58. package/dist/modules/policies.js +61 -0
  59. package/dist/modules/policies.js.map +1 -0
  60. package/dist/paymaster/client.d.ts +11 -0
  61. package/dist/paymaster/client.d.ts.map +1 -0
  62. package/dist/paymaster/client.js +119 -0
  63. package/dist/paymaster/client.js.map +1 -0
  64. package/dist/runtimee.d.ts +4 -0
  65. package/dist/runtimee.d.ts.map +1 -0
  66. package/dist/runtimee.js +4 -0
  67. package/dist/runtimee.js.map +1 -0
  68. package/dist/types.d.ts +389 -0
  69. package/dist/types.d.ts.map +1 -0
  70. package/dist/types.js +2 -0
  71. package/dist/types.js.map +1 -0
  72. package/package.json +29 -0
  73. package/src/actor-client.ts +57 -0
  74. package/src/bundler/client.ts +306 -0
  75. package/src/bundler/providers/alchemy.ts +21 -0
  76. package/src/bundler/providers/pimlico.ts +17 -0
  77. package/src/client.ts +472 -0
  78. package/src/conversion.ts +25 -0
  79. package/src/erc4337/builder.ts +181 -0
  80. package/src/erc4337/providers/kernel.ts +136 -0
  81. package/src/erc4337/providers/safe.ts +133 -0
  82. package/src/erc4337/providers/types.ts +73 -0
  83. package/src/erc4337/smart-wallet.ts +115 -0
  84. package/src/index.ts +60 -0
  85. package/src/modules/payment-intents.ts +156 -0
  86. package/src/modules/policies.ts +79 -0
  87. package/src/paymaster/client.ts +155 -0
  88. package/src/runtimee.ts +3 -0
  89. package/src/types.ts +469 -0
  90. package/test/architecture/architecture-invariants.test.ts +61 -0
  91. package/test/client.test.ts +180 -0
  92. package/test/conversion.test.ts +42 -0
  93. package/test/runtimee.test.ts +30 -0
  94. package/tsconfig.json +9 -0
  95. package/vitest.config.ts +8 -0
@@ -0,0 +1,99 @@
1
+ import { parsePaymentIntent } from '@brninpay/core';
2
+ import type { CancelPaymentIntentParams, ClientTransport, CreatePaymentIntentParams, GetPaymentIntentOptions, ListPaymentIntentsParams, PaginatedResult, PaymentIntentPreview, PaymentIntentPreviewParams } from '../types.js';
3
+ export declare class PaymentIntentClient {
4
+ private readonly transport;
5
+ constructor(transport: ClientTransport);
6
+ createPaymentIntent(params: CreatePaymentIntentParams): Promise<{
7
+ id: string;
8
+ workspaceId: string;
9
+ actorId: string;
10
+ status: "draft" | "pending_policy" | "pending_approval" | "approved" | "rejected" | "pending_submission" | "submitted" | "confirming" | "succeeded" | "failed" | "cancelled" | "expired";
11
+ amount: {
12
+ value: bigint;
13
+ currency: "USDC";
14
+ decimals: number;
15
+ };
16
+ recipient: {
17
+ address: string;
18
+ chainId: number;
19
+ ensName?: string | null | undefined;
20
+ };
21
+ createdAt: string;
22
+ updatedAt: string;
23
+ expiresAt?: string | null | undefined;
24
+ idempotencyKey?: string | null | undefined;
25
+ description?: string | null | undefined;
26
+ reference?: string | null | undefined;
27
+ transactionHash?: string | null | undefined;
28
+ failure?: {
29
+ message: string;
30
+ code: string;
31
+ retryable: boolean;
32
+ detail?: Record<string, unknown> | undefined;
33
+ } | null | undefined;
34
+ metadata?: Record<string, unknown> | undefined;
35
+ }>;
36
+ getPaymentIntent(id: string, options?: GetPaymentIntentOptions): Promise<{
37
+ id: string;
38
+ workspaceId: string;
39
+ actorId: string;
40
+ status: "draft" | "pending_policy" | "pending_approval" | "approved" | "rejected" | "pending_submission" | "submitted" | "confirming" | "succeeded" | "failed" | "cancelled" | "expired";
41
+ amount: {
42
+ value: bigint;
43
+ currency: "USDC";
44
+ decimals: number;
45
+ };
46
+ recipient: {
47
+ address: string;
48
+ chainId: number;
49
+ ensName?: string | null | undefined;
50
+ };
51
+ createdAt: string;
52
+ updatedAt: string;
53
+ expiresAt?: string | null | undefined;
54
+ idempotencyKey?: string | null | undefined;
55
+ description?: string | null | undefined;
56
+ reference?: string | null | undefined;
57
+ transactionHash?: string | null | undefined;
58
+ failure?: {
59
+ message: string;
60
+ code: string;
61
+ retryable: boolean;
62
+ detail?: Record<string, unknown> | undefined;
63
+ } | null | undefined;
64
+ metadata?: Record<string, unknown> | undefined;
65
+ }>;
66
+ cancelPaymentIntent(id: string, params?: CancelPaymentIntentParams): Promise<{
67
+ id: string;
68
+ workspaceId: string;
69
+ actorId: string;
70
+ status: "draft" | "pending_policy" | "pending_approval" | "approved" | "rejected" | "pending_submission" | "submitted" | "confirming" | "succeeded" | "failed" | "cancelled" | "expired";
71
+ amount: {
72
+ value: bigint;
73
+ currency: "USDC";
74
+ decimals: number;
75
+ };
76
+ recipient: {
77
+ address: string;
78
+ chainId: number;
79
+ ensName?: string | null | undefined;
80
+ };
81
+ createdAt: string;
82
+ updatedAt: string;
83
+ expiresAt?: string | null | undefined;
84
+ idempotencyKey?: string | null | undefined;
85
+ description?: string | null | undefined;
86
+ reference?: string | null | undefined;
87
+ transactionHash?: string | null | undefined;
88
+ failure?: {
89
+ message: string;
90
+ code: string;
91
+ retryable: boolean;
92
+ detail?: Record<string, unknown> | undefined;
93
+ } | null | undefined;
94
+ metadata?: Record<string, unknown> | undefined;
95
+ }>;
96
+ previewPayment(params: PaymentIntentPreviewParams): Promise<PaymentIntentPreview>;
97
+ listPaymentIntents(params?: ListPaymentIntentsParams): Promise<PaginatedResult<ReturnType<typeof parsePaymentIntent>>>;
98
+ }
99
+ //# sourceMappingURL=payment-intents.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"payment-intents.d.ts","sourceRoot":"","sources":["../../src/modules/payment-intents.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,kBAAkB,EAEnB,MAAM,gBAAgB,CAAA;AACvB,OAAO,KAAK,EACV,yBAAyB,EACzB,eAAe,EACf,yBAAyB,EACzB,uBAAuB,EACvB,wBAAwB,EACxB,eAAe,EACf,oBAAoB,EACpB,0BAA0B,EAC3B,MAAM,aAAa,CAAA;AAcpB,qBAAa,mBAAmB;IAClB,OAAO,CAAC,QAAQ,CAAC,SAAS;gBAAT,SAAS,EAAE,eAAe;IAEjD,mBAAmB,CAAC,MAAM,EAAE,yBAAyB;;;;;;;;;;;;;mBAyHvB,CAAA;;;;;;;;;;;;;kBAIoW,CAAC;;;;IAvGnY,gBAAgB,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,GAAE,uBAA4B;;;;;;;;;;;;;mBAmGpC,CAAA;;;;;;;;;;;;;kBAIoW,CAAC;;;;IA/DnY,mBAAmB,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,GAAE,yBAA8B;;;;;;;;;;;;;mBA2DxC,CAAA;;;;;;;;;;;;;kBAIoW,CAAC;;;;IA7CnY,cAAc,CAAC,MAAM,EAAE,0BAA0B,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAqBjF,kBAAkB,CACtB,MAAM,GAAE,wBAA6B,GACpC,OAAO,CAAC,eAAe,CAAC,UAAU,CAAC,OAAO,kBAAkB,CAAC,CAAC,CAAC;CAqBnE"}
@@ -0,0 +1,118 @@
1
+ import { deserializeBigInts, parsePaymentIntent, ValidationError, } from '@brninpay/core';
2
+ function sleep(ms) {
3
+ return new Promise((resolve) => setTimeout(resolve, ms));
4
+ }
5
+ function normalizeAmount(amount) {
6
+ return {
7
+ currency: amount.currency,
8
+ value: BigInt(amount.value).toString(),
9
+ decimals: amount.decimals ?? 6,
10
+ };
11
+ }
12
+ export class PaymentIntentClient {
13
+ transport;
14
+ constructor(transport) {
15
+ this.transport = transport;
16
+ }
17
+ async createPaymentIntent(params) {
18
+ if (!params.idempotencyKey?.trim()) {
19
+ throw new ValidationError('createPaymentIntent requires a non-empty idempotencyKey', {
20
+ field: 'idempotencyKey',
21
+ });
22
+ }
23
+ const response = await this.transport.request({
24
+ path: '/v1/payment-intents',
25
+ method: 'POST',
26
+ headers: {
27
+ 'Idempotency-Key': params.idempotencyKey,
28
+ },
29
+ body: {
30
+ ...params,
31
+ amount: normalizeAmount(params.amount),
32
+ },
33
+ });
34
+ return parsePaymentIntent(deserializeBigInts(response));
35
+ }
36
+ async getPaymentIntent(id, options = {}) {
37
+ if (!id.trim()) {
38
+ throw new ValidationError('getPaymentIntent requires a payment intent id');
39
+ }
40
+ const loadOnce = async () => {
41
+ const response = await this.transport.request({
42
+ path: `/v1/payment-intents/${encodeURIComponent(id)}`,
43
+ method: 'GET',
44
+ });
45
+ return parsePaymentIntent(deserializeBigInts(response));
46
+ };
47
+ if (!options.waitForTerminalState) {
48
+ return loadOnce();
49
+ }
50
+ const startedAt = Date.now();
51
+ const pollIntervalMs = options.pollIntervalMs ?? 2_000;
52
+ const timeoutMs = options.timeoutMs ?? 60_000;
53
+ while (true) {
54
+ const paymentIntent = await loadOnce();
55
+ if (['rejected', 'succeeded', 'failed', 'cancelled', 'expired'].includes(paymentIntent.status)) {
56
+ return paymentIntent;
57
+ }
58
+ if (Date.now() - startedAt >= timeoutMs) {
59
+ throw new ValidationError('Timed out while waiting for payment intent to reach a terminal state', {
60
+ id,
61
+ timeoutMs,
62
+ currentStatus: paymentIntent.status,
63
+ });
64
+ }
65
+ await sleep(pollIntervalMs);
66
+ }
67
+ }
68
+ async cancelPaymentIntent(id, params = {}) {
69
+ const current = await this.getPaymentIntent(id);
70
+ if (['submitted', 'confirming', 'succeeded', 'failed'].includes(current.status)) {
71
+ throw new ValidationError(`Payment intent ${id} can no longer be cancelled`, {
72
+ id,
73
+ status: current.status,
74
+ });
75
+ }
76
+ const response = await this.transport.request({
77
+ path: `/v1/payment-intents/${encodeURIComponent(id)}/cancel`,
78
+ method: 'POST',
79
+ body: params,
80
+ });
81
+ return parsePaymentIntent(deserializeBigInts(response));
82
+ }
83
+ async previewPayment(params) {
84
+ const response = await this.transport.request({
85
+ path: '/v1/payment-intents/preview',
86
+ method: 'POST',
87
+ body: {
88
+ ...params,
89
+ amount: normalizeAmount(params.amount),
90
+ },
91
+ });
92
+ return {
93
+ ...response,
94
+ estimatedGas: response.estimatedGas !== undefined ? BigInt(response.estimatedGas) : undefined,
95
+ estimatedTotalCost: response.estimatedTotalCost !== undefined
96
+ ? BigInt(response.estimatedTotalCost)
97
+ : undefined,
98
+ };
99
+ }
100
+ async listPaymentIntents(params = {}) {
101
+ const response = await this.transport.request({
102
+ path: '/v1/payment-intents',
103
+ method: 'GET',
104
+ query: {
105
+ cursor: params.cursor,
106
+ limit: params.limit,
107
+ workspaceId: params.workspaceId,
108
+ actorId: params.actorId,
109
+ status: params.status,
110
+ },
111
+ });
112
+ return {
113
+ items: response.items.map((item) => parsePaymentIntent(deserializeBigInts(item))),
114
+ nextCursor: response.nextCursor ?? null,
115
+ };
116
+ }
117
+ }
118
+ //# sourceMappingURL=payment-intents.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"payment-intents.js","sourceRoot":"","sources":["../../src/modules/payment-intents.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,kBAAkB,EAClB,eAAe,GAChB,MAAM,gBAAgB,CAAA;AAYvB,SAAS,KAAK,CAAC,EAAU;IACvB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAA;AAC1D,CAAC;AAED,SAAS,eAAe,CAAC,MAA2C;IAClE,OAAO;QACL,QAAQ,EAAE,MAAM,CAAC,QAAQ;Q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AC,MAAM;aACtB;SACF,CAAC,CAAA;QAEF,OAAO;YACL,KAAK,EAAE,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,kBAAkB,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC,CAAC;YACjF,UAAU,EAAE,QAAQ,CAAC,UAAU,IAAI,IAAI;SACxC,CAAA;IACH,CAAC;CACF"}
@@ -0,0 +1,87 @@
1
+ import { parsePolicyDefinition } from '@brninpay/core';
2
+ import type { ClientTransport, CreatePolicyParams, ListPoliciesParams, PaginatedResult, UpdatePolicyParams } from '../types.js';
3
+ export declare class PolicyClient {
4
+ private readonly transport;
5
+ constructor(transport: ClientTransport);
6
+ createPolicy(params: CreatePolicyParams): Promise<{
7
+ id: string;
8
+ name: string;
9
+ currency: "USDC";
10
+ limit: bigint;
11
+ enabled: boolean;
12
+ kind: "budget";
13
+ softLimit?: bigint | undefined;
14
+ } | {
15
+ id: string;
16
+ name: string;
17
+ enabled: boolean;
18
+ kind: "allowlist";
19
+ addresses: string[];
20
+ chains?: number[] | undefined;
21
+ } | {
22
+ id: string;
23
+ name: string;
24
+ maxRequests: number;
25
+ intervalMs: number;
26
+ scope: "actor" | "workspace" | "ip";
27
+ enabled: boolean;
28
+ kind: "rate_limit";
29
+ burst?: number | undefined;
30
+ }>;
31
+ getPolicy(id: string): Promise<{
32
+ id: string;
33
+ name: string;
34
+ currency: "USDC";
35
+ limit: bigint;
36
+ enabled: boolean;
37
+ kind: "budget";
38
+ softLimit?: bigint | undefined;
39
+ } | {
40
+ id: string;
41
+ name: string;
42
+ enabled: boolean;
43
+ kind: "allowlist";
44
+ addresses: string[];
45
+ chains?: number[] | undefined;
46
+ } | {
47
+ id: string;
48
+ name: string;
49
+ maxRequests: number;
50
+ intervalMs: number;
51
+ scope: "actor" | "workspace" | "ip";
52
+ enabled: boolean;
53
+ kind: "rate_limit";
54
+ burst?: number | undefined;
55
+ }>;
56
+ listPolicies(params?: ListPoliciesParams): Promise<PaginatedResult<ReturnType<typeof parsePolicyDefinition>>>;
57
+ updatePolicy(params: UpdatePolicyParams): Promise<{
58
+ id: string;
59
+ name: string;
60
+ currency: "USDC";
61
+ limit: bigint;
62
+ enabled: boolean;
63
+ kind: "budget";
64
+ softLimit?: bigint | undefined;
65
+ } | {
66
+ id: string;
67
+ name: string;
68
+ enabled: boolean;
69
+ kind: "allowlist";
70
+ addresses: string[];
71
+ chains?: number[] | undefined;
72
+ } | {
73
+ id: string;
74
+ name: string;
75
+ maxRequests: number;
76
+ intervalMs: number;
77
+ scope: "actor" | "workspace" | "ip";
78
+ enabled: boolean;
79
+ kind: "rate_limit";
80
+ burst?: number | undefined;
81
+ }>;
82
+ deletePolicy(id: string): Promise<{
83
+ deleted: true;
84
+ id: string;
85
+ }>;
86
+ }
87
+ //# sourceMappingURL=policies.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"policies.d.ts","sourceRoot":"","sources":["../../src/modules/policies.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,qBAAqB,EAAmB,MAAM,gBAAgB,CAAA;AAC3F,OAAO,KAAK,EACV,eAAe,EACf,kBAAkB,EAClB,kBAAkB,EAClB,eAAe,EACf,kBAAkB,EACnB,MAAM,aAAa,CAAA;AAEpB,qBAAa,YAAY;IACX,OAAO,CAAC,QAAQ,CAAC,SAAS;gBAAT,SAAS,EAAE,eAAe;IAEjD,YAAY,CAAC,MAAM,EAAE,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;IAUvC,SAAS,CAAC,EAAE,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;IAapB,YAAY,CAAC,MAAM,GAAE,kBAAuB,GAAG,OAAO,CAAC,eAAe,CAAC,UAAU,CAAC,OAAO,qBAAqB,CAAC,CAAC,CAAC;IAuBjH,YAAY,CAAC,MAAM,EAAE,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;IAUvC,YAAY,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,IAAI,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC;CAUvE"}
@@ -0,0 +1,61 @@
1
+ import { deserializeBigInts, parsePolicyDefinition, ValidationError } from '@brninpay/core';
2
+ export class PolicyClient {
3
+ transport;
4
+ constructor(transport) {
5
+ this.transport = transport;
6
+ }
7
+ async createPolicy(params) {
8
+ const response = await this.transport.request({
9
+ path: '/v1/policies',
10
+ method: 'POST',
11
+ body: params,
12
+ });
13
+ return parsePolicyDefinition(deserializeBigInts(response));
14
+ }
15
+ async getPolicy(id) {
16
+ if (!id.trim()) {
17
+ throw new ValidationError('getPolicy requires a policy id');
18
+ }
19
+ const response = await this.transport.request({
20
+ path: `/v1/policies/${encodeURIComponent(id)}`,
21
+ method: 'GET',
22
+ });
23
+ return parsePolicyDefinition(deserializeBigInts(response));
24
+ }
25
+ async listPolicies(params = {}) {
26
+ const response = await this.transport.request({
27
+ path: '/v1/policies',
28
+ method: 'GET',
29
+ query: {
30
+ cursor: params.cursor,
31
+ limit: params.limit,
32
+ workspaceId: params.workspaceId,
33
+ actorId: params.actorId,
34
+ enabled: params.enabled,
35
+ kind: params.kind,
36
+ },
37
+ });
38
+ return {
39
+ items: response.items.map((item) => parsePolicyDefinition(deserializeBigInts(item))),
40
+ nextCursor: response.nextCursor ?? null,
41
+ };
42
+ }
43
+ async updatePolicy(params) {
44
+ const response = await this.transport.request({
45
+ path: `/v1/policies/${encodeURIComponent(params.id)}`,
46
+ method: 'PATCH',
47
+ body: params.patch,
48
+ });
49
+ return parsePolicyDefinition(deserializeBigInts(response));
50
+ }
51
+ async deletePolicy(id) {
52
+ if (!id.trim()) {
53
+ throw new ValidationError('deletePolicy requires a policy id');
54
+ }
55
+ return this.transport.request({
56
+ path: `/v1/policies/${encodeURIComponent(id)}`,
57
+ method: 'DELETE',
58
+ });
59
+ }
60
+ }
61
+ //# sourceMappingURL=policies.js.map
@@ -0,0 +1 @@
1
+ {"version":3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ACvB,OAAO,EAAE,MAAM,CAAC,OAAO;gBACvB,IAAI,EAAE,MAAM,CAAC,IAAI;aAClB;SACF,CAAC,CAAA;QAEF,OAAO;YACL,KAAK,EAAE,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,qBAAqB,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC,CAAC;YACpF,UAAU,EAAE,QAAQ,CAAC,UAAU,IAAI,IAAI;SACxC,CAAA;IACH,CAAC;IAED,KAAK,CAAC,YAAY,CAAC,MAA0B;QAC3C,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,OAAO,CAAU;YACrD,IAAI,EAAE,gBAAgB,kBAAkB,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE;YACrD,MAAM,EAAE,OAAO;YACf,IAAI,EAAE,MAAM,CAAC,KAAK;SACnB,CAAC,CAAA;QAEF,OAAO,qBAAqB,CAAC,kBAAkB,CAAC,QAAQ,CAAC,CAAC,CAAA;IAC5D,CAAC;IAED,KAAK,CAAC,YAAY,CAAC,EAAU;QAC3B,IAAI,CAAC,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC;YACf,MAAM,IAAI,eAAe,CAAC,mCAAmC,CAAC,CAAA;QAChE,CAAC;QAED,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,CAAgC;YAC3D,IAAI,EAAE,gBAAgB,kBAAkB,CAAC,EAAE,CAAC,EAAE;YAC9C,MAAM,EAAE,QAAQ;SACjB,CAAC,CAAA;IACJ,CAAC;CACF"}
@@ -0,0 +1,11 @@
1
+ import type { PaymasterClientConfig, SponsorshipContext, SponsorshipData, UserOperation } from '../types.js';
2
+ export declare class PaymasterClient {
3
+ private readonly config;
4
+ private readonly timeoutMs;
5
+ private readonly maxRetries;
6
+ private readonly logger;
7
+ private readonly fetchImplementation;
8
+ constructor(config: PaymasterClientConfig);
9
+ requestSponsorship(userOperation: UserOperation, context?: SponsorshipContext): Promise<SponsorshipData>;
10
+ }
11
+ //# sourceMappingURL=client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/paymaster/client.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,qBAAqB,EAErB,kBAAkB,EAClB,eAAe,EACf,aAAa,EACd,MAAM,aAAa,CAAA;AA+CpB,qBAAa,eAAe;IAMd,OAAO,CAAC,QAAQ,CAAC,MAAM;IALnC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAQ;IAClC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAQ;IACnC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAW;IAClC,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAAc;gBAErB,MAAM,EAAE,qBAAqB;IAOpD,kBAAkB,CACtB,aAAa,EAAE,aAAa,EAC5B,OAAO,CAAC,EAAE,kBAAkB,GAC3B,OAAO,CAAC,eAAe,CAAC;CAoF5B"}
@@ -0,0 +1,119 @@
1
+ import { AuthorizationError, ValidationError } from '@brninpay/core';
2
+ const defaultLogger = {
3
+ debug: () => undefined,
4
+ info: () => undefined,
5
+ warn: () => undefined,
6
+ error: () => undefined,
7
+ };
8
+ function serializeUserOperation(userOperation) {
9
+ if (userOperation.version === 'v0.6') {
10
+ return {
11
+ version: userOperation.version,
12
+ sender: userOperation.sender,
13
+ nonce: userOperation.nonce.toString(),
14
+ initCode: userOperation.initCode,
15
+ callData: userOperation.callData,
16
+ callGasLimit: userOperation.callGasLimit.toString(),
17
+ verificationGasLimit: userOperation.verificationGasLimit.toString(),
18
+ preVerificationGas: userOperation.preVerificationGas.toString(),
19
+ maxFeePerGas: userOperation.maxFeePerGas.toString(),
20
+ maxPriorityFeePerGas: userOperation.maxPriorityFeePerGas.toString(),
21
+ paymasterAndData: userOperation.paymasterAndData,
22
+ signature: userOperation.signature,
23
+ };
24
+ }
25
+ return {
26
+ version: userOperation.version,
27
+ sender: userOperation.sender,
28
+ nonce: userOperation.nonce.toString(),
29
+ factory: userOperation.factory,
30
+ factoryData: userOperation.factoryData,
31
+ callData: userOperation.callData,
32
+ callGasLimit: userOperation.callGasLimit.toString(),
33
+ verificationGasLimit: userOperation.verificationGasLimit.toString(),
34
+ preVerificationGas: userOperation.preVerificationGas.toString(),
35
+ maxFeePerGas: userOperation.maxFeePerGas.toString(),
36
+ maxPriorityFeePerGas: userOperation.maxPriorityFeePerGas.toString(),
37
+ paymaster: userOperation.paymaster,
38
+ paymasterVerificationGasLimit: userOperation.paymasterVerificationGasLimit.toString(),
39
+ paymasterPostOpGasLimit: userOperation.paymasterPostOpGasLimit.toString(),
40
+ paymasterData: userOperation.paymasterData,
41
+ signature: userOperation.signature,
42
+ };
43
+ }
44
+ export class PaymasterClient {
45
+ config;
46
+ timeoutMs;
47
+ maxRetries;
48
+ logger;
49
+ fetchImplementation;
50
+ constructor(config) {
51
+ this.config = config;
52
+ this.timeoutMs = config.timeoutMs ?? 15_000;
53
+ this.maxRetries = config.maxRetries ?? 1;
54
+ this.logger = config.logger ?? defaultLogger;
55
+ this.fetchImplementation = config.fetchImplementation ?? fetch.bind(globalThis);
56
+ }
57
+ async requestSponsorship(userOperation, context) {
58
+ let attempt = 0;
59
+ while (true) {
60
+ attempt += 1;
61
+ const controller = new AbortController();
62
+ const timeoutId = setTimeout(() => controller.abort('Paymaster request timed out'), this.timeoutMs);
63
+ try {
64
+ const response = await this.fetchImplementation(this.config.url, {
65
+ method: 'POST',
66
+ headers: {
67
+ 'Content-Type': 'application/json',
68
+ ...(this.config.apiKey ? { Authorization: `Bearer ${this.config.apiKey}` } : {}),
69
+ ...(this.config.headers ?? {}),
70
+ },
71
+ body: JSON.stringify({
72
+ userOperation: serializeUserOperation(userOperation),
73
+ context,
74
+ }),
75
+ signal: controller.signal,
76
+ });
77
+ const payload = (await response.json().catch(() => null));
78
+ if (!response.ok) {
79
+ throw new AuthorizationError(payload?.code ?? 'paymaster_rejected', payload?.message ?? `Paymaster rejected sponsorship with status ${response.status}`, payload);
80
+ }
81
+ if (userOperation.version === 'v0.6') {
82
+ if (!payload?.paymasterAndData) {
83
+ throw new ValidationError('Paymaster response missing paymasterAndData for v0.6 user operation');
84
+ }
85
+ return {
86
+ version: 'v0.6',
87
+ paymasterAndData: payload.paymasterAndData,
88
+ };
89
+ }
90
+ if (!payload?.paymaster ||
91
+ !payload.paymasterData ||
92
+ !payload.paymasterVerificationGasLimit ||
93
+ !payload.paymasterPostOpGasLimit) {
94
+ throw new ValidationError('Paymaster response missing v0.7 sponsorship fields');
95
+ }
96
+ return {
97
+ version: 'v0.7',
98
+ paymaster: payload.paymaster,
99
+ paymasterData: payload.paymasterData,
100
+ paymasterVerificationGasLimit: BigInt(payload.paymasterVerificationGasLimit),
101
+ paymasterPostOpGasLimit: BigInt(payload.paymasterPostOpGasLimit),
102
+ };
103
+ }
104
+ catch (error) {
105
+ if (attempt > this.maxRetries + 1) {
106
+ throw error;
107
+ }
108
+ this.logger.warn('Retrying paymaster sponsorship request', {
109
+ attempt,
110
+ error: error instanceof Error ? error.message : String(error),
111
+ });
112
+ }
113
+ finally {
114
+ clearTimeout(timeoutId);
115
+ }
116
+ }
117
+ }
118
+ }
119
+ //# sourceMappingURL=client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/paymaster/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AASpE,MAAM,aAAa,GAAc;IAC/B,KAAK,EAAE,GAAG,EAAE,CAAC,SAAS;IACtB,IAAI,EAAE,GAAG,EAAE,CAAC,SAAS;IACrB,IAAI,EAAE,GAAG,EAAE,CAAC,SAAS;IACrB,KAAK,EAAE,GAAG,EAAE,CAAC,SAAS;CACvB,CAAA;AAED,SAAS,sBAAsB,CAAC,aAA4B;IAC1D,IAAI,aAAa,CAAC,OAAO,KAAK,MAAM,EAAE,CAAC;QACrC,OAAO;YACL,OAAO,EAAE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AC,aAAa;oBACpC,6BAA6B,EAAE,MAAM,CAAC,OAAO,CAAC,6BAA6B,CAAC;oBAC5E,uBAAuB,EAAE,MAAM,CAAC,OAAO,CAAC,uBAAuB,CAAC;iBACjE,CAAA;YACH,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,IAAI,OAAO,GAAG,IAAI,CAAC,UAAU,GAAG,CAAC,EAAE,CAAC;oBAClC,MAAM,KAAK,CAAA;gBACb,CAAC;gBAED,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,wCAAwC,EAAE;oBACzD,OAAO;oBACP,KAAK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;iBAC9D,CAAC,CAAA;YACJ,CAAC;oBAAS,CAAC;gBACT,YAAY,CAAC,SAAS,CAAC,CAAA;YACzB,CAAC;QACH,CAAC;IACH,CAAC;CACF"}
@@ -0,0 +1,4 @@
1
+ import { BrninpayClient } from './client.js';
2
+ export declare class Runtimee extends BrninpayClient {
3
+ }
4
+ //# sourceMappingURL=runtimee.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtimee.d.ts","sourceRoot":"","sources":["../src/runtimee.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAE5C,qBAAa,QAAS,SAAQ,cAAc;CAAG"}
@@ -0,0 +1,4 @@
1
+ import { BrninpayClient } from './client.js';
2
+ export class Runtimee extends BrninpayClient {
3
+ }
4
+ //# sourceMappingURL=runtimee.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtimee.js","sourceRoot":"","sources":["../src/runtimee.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAE5C,MAAM,OAAO,QAAS,SAAQ,cAAc;CAAG"}