@eco-foundation/api-schemas 0.6.0 → 0.7.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/openapi/v1.json CHANGED
@@ -1369,6 +1369,38 @@
1369
1369
  "type": "null"
1370
1370
  }
1371
1371
  ]
1372
+ },
1373
+ "vault": {
1374
+ "description": "This quote's intent vault: the CREATE2 address the source-chain Portal funds the intent through, derived from the quoted intent (route.salt included) — it changes whenever the salt does. It is the value to sign as erc-3009 authorization.to, permit2 spender and every permit3 leg account; a submit whose signed counterparty differs is rejected with vault-mismatch. Not case-normalized: compare it case-insensitively (isSameEvmAddress), never with ===, since a producer may publish EIP-55 checksummed while a signer sends lowercase. EVM source chains only: null or absent where the producer does not derive it (an SVM source, where the vault is a PDA).",
1375
+ "anyOf": [
1376
+ {
1377
+ "anyOf": [
1378
+ {
1379
+ "type": "string",
1380
+ "pattern": "^0x[0-9a-fA-F]{40}$"
1381
+ },
1382
+ {
1383
+ "anyOf": [
1384
+ {
1385
+ "type": "string",
1386
+ "pattern": "^T[1-9A-HJ-NP-Za-km-z]{33}$"
1387
+ },
1388
+ {
1389
+ "type": "string",
1390
+ "pattern": "^0x41[0-9a-fA-F]{40}$"
1391
+ }
1392
+ ]
1393
+ },
1394
+ {
1395
+ "type": "string",
1396
+ "pattern": "^[1-9A-HJ-NP-Za-km-z]{32,44}$"
1397
+ }
1398
+ ]
1399
+ },
1400
+ {
1401
+ "type": "null"
1402
+ }
1403
+ ]
1372
1404
  }
1373
1405
  },
1374
1406
  "required": [
@@ -2430,6 +2462,38 @@
2430
2462
  "type": "null"
2431
2463
  }
2432
2464
  ]
2465
+ },
2466
+ "vault": {
2467
+ "description": "This quote's intent vault: the CREATE2 address the source-chain Portal funds the intent through, derived from the quoted intent (route.salt included) — it changes whenever the salt does. It is the value to sign as erc-3009 authorization.to, permit2 spender and every permit3 leg account; a submit whose signed counterparty differs is rejected with vault-mismatch. Not case-normalized: compare it case-insensitively (isSameEvmAddress), never with ===, since a producer may publish EIP-55 checksummed while a signer sends lowercase. EVM source chains only: null or absent where the producer does not derive it (an SVM source, where the vault is a PDA).",
2468
+ "anyOf": [
2469
+ {
2470
+ "anyOf": [
2471
+ {
2472
+ "type": "string",
2473
+ "pattern": "^0x[0-9a-fA-F]{40}$"
2474
+ },
2475
+ {
2476
+ "anyOf": [
2477
+ {
2478
+ "type": "string",
2479
+ "pattern": "^T[1-9A-HJ-NP-Za-km-z]{33}$"
2480
+ },
2481
+ {
2482
+ "type": "string",
2483
+ "pattern": "^0x41[0-9a-fA-F]{40}$"
2484
+ }
2485
+ ]
2486
+ },
2487
+ {
2488
+ "type": "string",
2489
+ "pattern": "^[1-9A-HJ-NP-Za-km-z]{32,44}$"
2490
+ }
2491
+ ]
2492
+ },
2493
+ {
2494
+ "type": "null"
2495
+ }
2496
+ ]
2433
2497
  }
2434
2498
  },
2435
2499
  "required": [
@@ -2725,6 +2789,472 @@
2725
2789
  }
2726
2790
  }
2727
2791
  },
2792
+ "/v1/intents/submit/permit2": {
2793
+ "post": {
2794
+ "operationId": "intents.submit.permit2",
2795
+ "summary": "Submit a signed permit2 funding authorization. 202 with a gasless job on first sight; a duplicate signature returns the existing job with 200.",
2796
+ "tags": [
2797
+ "intents",
2798
+ "stable"
2799
+ ],
2800
+ "requestBody": {
2801
+ "required": true,
2802
+ "content": {
2803
+ "application/json": {
2804
+ "schema": {
2805
+ "type": "object",
2806
+ "properties": {
2807
+ "chainId": {
2808
+ "type": "integer",
2809
+ "exclusiveMinimum": 0,
2810
+ "maximum": 9007199254740991
2811
+ },
2812
+ "target": {
2813
+ "type": "object",
2814
+ "properties": {
2815
+ "quoteId": {
2816
+ "type": "string",
2817
+ "pattern": "^quote:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
2818
+ }
2819
+ },
2820
+ "required": [
2821
+ "quoteId"
2822
+ ],
2823
+ "additionalProperties": false
2824
+ },
2825
+ "permit2": {
2826
+ "type": "object",
2827
+ "properties": {
2828
+ "details": {
2829
+ "type": "object",
2830
+ "properties": {
2831
+ "token": {
2832
+ "type": "string",
2833
+ "pattern": "^0x[0-9a-fA-F]{40}$"
2834
+ },
2835
+ "amount": {
2836
+ "type": "string",
2837
+ "maxLength": 78,
2838
+ "pattern": "^(0|[1-9]\\d*)$"
2839
+ },
2840
+ "expiration": {
2841
+ "type": "integer",
2842
+ "minimum": 0,
2843
+ "maximum": 281474976710655,
2844
+ "description": "Permit2 allowance expiration (uint48, Unix seconds)"
2845
+ },
2846
+ "nonce": {
2847
+ "type": "integer",
2848
+ "minimum": 0,
2849
+ "maximum": 281474976710655
2850
+ }
2851
+ },
2852
+ "required": [
2853
+ "token",
2854
+ "amount",
2855
+ "expiration",
2856
+ "nonce"
2857
+ ]
2858
+ },
2859
+ "spender": {
2860
+ "type": "string",
2861
+ "pattern": "^0x[0-9a-fA-F]{40}$",
2862
+ "description": "The Permit2 spender — on a quote target, the quote's execution.vault"
2863
+ },
2864
+ "sigDeadline": {
2865
+ "type": "string",
2866
+ "maxLength": 78,
2867
+ "pattern": "^(0|[1-9]\\d*)$",
2868
+ "description": "Signature deadline (uint256 Unix seconds, decimal string; max-uint = no expiry)"
2869
+ }
2870
+ },
2871
+ "required": [
2872
+ "details",
2873
+ "spender",
2874
+ "sigDeadline"
2875
+ ]
2876
+ },
2877
+ "signature": {
2878
+ "type": "string",
2879
+ "minLength": 130,
2880
+ "maxLength": 132,
2881
+ "pattern": "^0x(?:[0-9a-fA-F]{2})*$"
2882
+ }
2883
+ },
2884
+ "required": [
2885
+ "chainId",
2886
+ "target",
2887
+ "permit2",
2888
+ "signature"
2889
+ ]
2890
+ }
2891
+ }
2892
+ }
2893
+ },
2894
+ "responses": {
2895
+ "202": {
2896
+ "description": "Success",
2897
+ "content": {
2898
+ "application/json": {
2899
+ "schema": {
2900
+ "type": "object",
2901
+ "properties": {
2902
+ "id": {
2903
+ "type": "string",
2904
+ "pattern": "^gasless:([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}|[0-9a-f]{24})$"
2905
+ },
2906
+ "status": {
2907
+ "type": "string",
2908
+ "enum": [
2909
+ "pending",
2910
+ "processing",
2911
+ "published",
2912
+ "partial",
2913
+ "failed",
2914
+ "unknown"
2915
+ ]
2916
+ },
2917
+ "signatureHash": {
2918
+ "type": "string",
2919
+ "pattern": "^0x[0-9a-fA-F]{64}$"
2920
+ },
2921
+ "subStatuses": {
2922
+ "type": "array",
2923
+ "items": {
2924
+ "type": "object",
2925
+ "properties": {
2926
+ "chainId": {
2927
+ "type": "integer",
2928
+ "exclusiveMinimum": 0,
2929
+ "maximum": 9007199254740991
2930
+ },
2931
+ "quoteIds": {
2932
+ "type": "array",
2933
+ "items": {
2934
+ "type": "string",
2935
+ "pattern": "^quote:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
2936
+ }
2937
+ },
2938
+ "txHash": {
2939
+ "anyOf": [
2940
+ {
2941
+ "type": "string"
2942
+ },
2943
+ {
2944
+ "type": "null"
2945
+ }
2946
+ ]
2947
+ },
2948
+ "intentHashes": {
2949
+ "type": "array",
2950
+ "items": {
2951
+ "type": "string",
2952
+ "pattern": "^0x[0-9a-fA-F]{64}$"
2953
+ }
2954
+ },
2955
+ "state": {
2956
+ "type": "string",
2957
+ "enum": [
2958
+ "pending",
2959
+ "submitted",
2960
+ "published",
2961
+ "failed"
2962
+ ]
2963
+ }
2964
+ },
2965
+ "required": [
2966
+ "chainId",
2967
+ "quoteIds",
2968
+ "txHash",
2969
+ "intentHashes",
2970
+ "state"
2971
+ ],
2972
+ "additionalProperties": {}
2973
+ }
2974
+ },
2975
+ "createdAt": {
2976
+ "type": "integer",
2977
+ "minimum": 0,
2978
+ "maximum": 4102444800
2979
+ },
2980
+ "updatedAt": {
2981
+ "type": "integer",
2982
+ "minimum": 0,
2983
+ "maximum": 4102444800
2984
+ }
2985
+ },
2986
+ "required": [
2987
+ "id",
2988
+ "status",
2989
+ "signatureHash",
2990
+ "subStatuses",
2991
+ "createdAt",
2992
+ "updatedAt"
2993
+ ],
2994
+ "additionalProperties": {}
2995
+ }
2996
+ }
2997
+ }
2998
+ },
2999
+ "default": {
3000
+ "description": "Error (RFC 9457 problem+json; see x-error-catalog)",
3001
+ "content": {
3002
+ "application/problem+json": {
3003
+ "schema": {
3004
+ "$ref": "#/components/schemas/Problem"
3005
+ }
3006
+ }
3007
+ }
3008
+ }
3009
+ }
3010
+ }
3011
+ },
3012
+ "/v1/intents/submit/permit3": {
3013
+ "post": {
3014
+ "operationId": "intents.submit.permit3",
3015
+ "summary": "Submit a signed permit3 funding authorization. 202 with a gasless job on first sight; a duplicate signature returns the existing job with 200.",
3016
+ "tags": [
3017
+ "intents",
3018
+ "stable"
3019
+ ],
3020
+ "requestBody": {
3021
+ "required": true,
3022
+ "content": {
3023
+ "application/json": {
3024
+ "schema": {
3025
+ "type": "object",
3026
+ "properties": {
3027
+ "target": {
3028
+ "type": "object",
3029
+ "properties": {
3030
+ "quoteId": {
3031
+ "type": "string",
3032
+ "pattern": "^quote:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
3033
+ }
3034
+ },
3035
+ "required": [
3036
+ "quoteId"
3037
+ ],
3038
+ "additionalProperties": false
3039
+ },
3040
+ "permit3": {
3041
+ "type": "object",
3042
+ "properties": {
3043
+ "owner": {
3044
+ "type": "string",
3045
+ "pattern": "^0x[0-9a-fA-F]{40}$"
3046
+ },
3047
+ "permitContract": {
3048
+ "type": "string",
3049
+ "pattern": "^0x[0-9a-fA-F]{40}$",
3050
+ "description": "The Permit3 contract the legs were signed against (the EIP-712 verifyingContract)"
3051
+ },
3052
+ "salt": {
3053
+ "type": "string",
3054
+ "pattern": "^0x[0-9a-fA-F]{64}$"
3055
+ },
3056
+ "deadline": {
3057
+ "type": "integer",
3058
+ "minimum": 0,
3059
+ "maximum": 4102444800
3060
+ },
3061
+ "timestamp": {
3062
+ "type": "integer",
3063
+ "minimum": 0,
3064
+ "maximum": 281474976710655,
3065
+ "description": "Permit3 ordering timestamp (uint48, Unix seconds)"
3066
+ },
3067
+ "merkleRoot": {
3068
+ "type": "string",
3069
+ "pattern": "^0x[0-9a-fA-F]{64}$",
3070
+ "description": "Merkle root over the legs, as signed"
3071
+ },
3072
+ "permits": {
3073
+ "minItems": 1,
3074
+ "type": "array",
3075
+ "items": {
3076
+ "type": "object",
3077
+ "properties": {
3078
+ "chainId": {
3079
+ "type": "integer",
3080
+ "exclusiveMinimum": 0,
3081
+ "maximum": 9007199254740991
3082
+ },
3083
+ "token": {
3084
+ "type": "string",
3085
+ "pattern": "^0x[0-9a-fA-F]{40}$"
3086
+ },
3087
+ "amount": {
3088
+ "type": "string",
3089
+ "maxLength": 78,
3090
+ "pattern": "^(0|[1-9]\\d*)$"
3091
+ },
3092
+ "account": {
3093
+ "type": "string",
3094
+ "pattern": "^0x[0-9a-fA-F]{40}$",
3095
+ "description": "Recipient (transfer mode) or spender (allowance mode) — on a quote target, the quote's execution.vault"
3096
+ },
3097
+ "modeOrExpiration": {
3098
+ "type": "integer",
3099
+ "minimum": 0,
3100
+ "maximum": 281474976710655,
3101
+ "description": "0 = transfer mode (funds pushed to account); any other value = allowance mode with this expiration, Unix seconds"
3102
+ }
3103
+ },
3104
+ "required": [
3105
+ "chainId",
3106
+ "token",
3107
+ "amount",
3108
+ "account",
3109
+ "modeOrExpiration"
3110
+ ]
3111
+ }
3112
+ }
3113
+ },
3114
+ "required": [
3115
+ "owner",
3116
+ "permitContract",
3117
+ "salt",
3118
+ "deadline",
3119
+ "timestamp",
3120
+ "merkleRoot",
3121
+ "permits"
3122
+ ]
3123
+ },
3124
+ "signature": {
3125
+ "type": "string",
3126
+ "minLength": 130,
3127
+ "maxLength": 132,
3128
+ "pattern": "^0x(?:[0-9a-fA-F]{2})*$"
3129
+ }
3130
+ },
3131
+ "required": [
3132
+ "target",
3133
+ "permit3",
3134
+ "signature"
3135
+ ]
3136
+ }
3137
+ }
3138
+ }
3139
+ },
3140
+ "responses": {
3141
+ "202": {
3142
+ "description": "Success",
3143
+ "content": {
3144
+ "application/json": {
3145
+ "schema": {
3146
+ "type": "object",
3147
+ "properties": {
3148
+ "id": {
3149
+ "type": "string",
3150
+ "pattern": "^gasless:([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}|[0-9a-f]{24})$"
3151
+ },
3152
+ "status": {
3153
+ "type": "string",
3154
+ "enum": [
3155
+ "pending",
3156
+ "processing",
3157
+ "published",
3158
+ "partial",
3159
+ "failed",
3160
+ "unknown"
3161
+ ]
3162
+ },
3163
+ "signatureHash": {
3164
+ "type": "string",
3165
+ "pattern": "^0x[0-9a-fA-F]{64}$"
3166
+ },
3167
+ "subStatuses": {
3168
+ "type": "array",
3169
+ "items": {
3170
+ "type": "object",
3171
+ "properties": {
3172
+ "chainId": {
3173
+ "type": "integer",
3174
+ "exclusiveMinimum": 0,
3175
+ "maximum": 9007199254740991
3176
+ },
3177
+ "quoteIds": {
3178
+ "type": "array",
3179
+ "items": {
3180
+ "type": "string",
3181
+ "pattern": "^quote:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
3182
+ }
3183
+ },
3184
+ "txHash": {
3185
+ "anyOf": [
3186
+ {
3187
+ "type": "string"
3188
+ },
3189
+ {
3190
+ "type": "null"
3191
+ }
3192
+ ]
3193
+ },
3194
+ "intentHashes": {
3195
+ "type": "array",
3196
+ "items": {
3197
+ "type": "string",
3198
+ "pattern": "^0x[0-9a-fA-F]{64}$"
3199
+ }
3200
+ },
3201
+ "state": {
3202
+ "type": "string",
3203
+ "enum": [
3204
+ "pending",
3205
+ "submitted",
3206
+ "published",
3207
+ "failed"
3208
+ ]
3209
+ }
3210
+ },
3211
+ "required": [
3212
+ "chainId",
3213
+ "quoteIds",
3214
+ "txHash",
3215
+ "intentHashes",
3216
+ "state"
3217
+ ],
3218
+ "additionalProperties": {}
3219
+ }
3220
+ },
3221
+ "createdAt": {
3222
+ "type": "integer",
3223
+ "minimum": 0,
3224
+ "maximum": 4102444800
3225
+ },
3226
+ "updatedAt": {
3227
+ "type": "integer",
3228
+ "minimum": 0,
3229
+ "maximum": 4102444800
3230
+ }
3231
+ },
3232
+ "required": [
3233
+ "id",
3234
+ "status",
3235
+ "signatureHash",
3236
+ "subStatuses",
3237
+ "createdAt",
3238
+ "updatedAt"
3239
+ ],
3240
+ "additionalProperties": {}
3241
+ }
3242
+ }
3243
+ }
3244
+ },
3245
+ "default": {
3246
+ "description": "Error (RFC 9457 problem+json; see x-error-catalog)",
3247
+ "content": {
3248
+ "application/problem+json": {
3249
+ "schema": {
3250
+ "$ref": "#/components/schemas/Problem"
3251
+ }
3252
+ }
3253
+ }
3254
+ }
3255
+ }
3256
+ }
3257
+ },
2728
3258
  "/v1/deposit-addresses/submit/erc-3009": {
2729
3259
  "post": {
2730
3260
  "operationId": "deposit-addresses.submit.erc-3009",
@@ -5167,6 +5697,14 @@
5167
5697
  "audience": "write",
5168
5698
  "legacyCodes": []
5169
5699
  },
5700
+ {
5701
+ "code": "vault-mismatch",
5702
+ "status": 400,
5703
+ "title": "The signed counterparty does not equal the quote's intent vault (execution.vault)",
5704
+ "type": "https://api.eco.com/v1/errors/vault-mismatch",
5705
+ "audience": "write",
5706
+ "legacyCodes": []
5707
+ },
5170
5708
  {
5171
5709
  "code": "invalid-signature",
5172
5710
  "status": 401,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eco-foundation/api-schemas",
3
- "version": "0.6.0",
3
+ "version": "0.7.0",
4
4
  "description": "Zod-first schemas, error catalog, golden fixtures, and generated OpenAPI 3.1 for the Eco /v1 API",
5
5
  "license": "MIT",
6
6
  "main": "./dist/index.js",