@openfort/openfort-node 0.7.3 → 0.7.5
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/CHANGELOG.md +12 -0
- package/dist/index.d.mts +294 -202
- package/dist/index.d.ts +294 -202
- package/dist/index.js +30 -14
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +29 -14
- package/dist/index.mjs.map +1 -1
- package/examples/evm/embedded/pregenerate.ts +1 -1
- package/openapi-auth.json +6 -0
- package/openapi.json +149 -22
- package/package.json +1 -1
- package/pnpm-workspace.yaml +4 -0
|
@@ -11,7 +11,7 @@ const openfort = new Openfort(process.env.OPENFORT_API_KEY!, {
|
|
|
11
11
|
// This creates the user and wallet before they authenticate
|
|
12
12
|
const result = await openfort.accounts.evm.embedded.pregenerate(
|
|
13
13
|
{
|
|
14
|
-
email: "jaume+
|
|
14
|
+
email: "jaume+1123123@openfort.xyz",
|
|
15
15
|
accountType: "Externally Owned Account"
|
|
16
16
|
},
|
|
17
17
|
{
|
package/openapi-auth.json
CHANGED
|
@@ -403,6 +403,9 @@
|
|
|
403
403
|
"updatedAt": {
|
|
404
404
|
"type": "string",
|
|
405
405
|
"format": "date-time"
|
|
406
|
+
},
|
|
407
|
+
"isAnonymous": {
|
|
408
|
+
"type": "boolean"
|
|
406
409
|
}
|
|
407
410
|
},
|
|
408
411
|
"required": [
|
|
@@ -1059,6 +1062,9 @@
|
|
|
1059
1062
|
"updatedAt": {
|
|
1060
1063
|
"type": "string",
|
|
1061
1064
|
"format": "date-time"
|
|
1065
|
+
},
|
|
1066
|
+
"isAnonymous": {
|
|
1067
|
+
"type": "boolean"
|
|
1062
1068
|
}
|
|
1063
1069
|
},
|
|
1064
1070
|
"required": [
|
package/openapi.json
CHANGED
|
@@ -5734,8 +5734,28 @@
|
|
|
5734
5734
|
},
|
|
5735
5735
|
"externalUserId": {
|
|
5736
5736
|
"type": "string",
|
|
5737
|
-
"description": "Filter by external user ID.",
|
|
5737
|
+
"description": "Filter by external user ID (accountId from linked accounts).",
|
|
5738
5738
|
"example": "123454456687897"
|
|
5739
|
+
},
|
|
5740
|
+
"email": {
|
|
5741
|
+
"type": "string",
|
|
5742
|
+
"description": "Filter by user email.",
|
|
5743
|
+
"example": "user@example.com"
|
|
5744
|
+
},
|
|
5745
|
+
"phoneNumber": {
|
|
5746
|
+
"type": "string",
|
|
5747
|
+
"description": "Filter by user phone number.",
|
|
5748
|
+
"example": "+1234567890"
|
|
5749
|
+
},
|
|
5750
|
+
"authProviderId": {
|
|
5751
|
+
"type": "string",
|
|
5752
|
+
"description": "Filter by provider ID (e.g., \"google\", \"apple\", \"siwe\", \"credential\").",
|
|
5753
|
+
"example": "google"
|
|
5754
|
+
},
|
|
5755
|
+
"walletClientType": {
|
|
5756
|
+
"type": "string",
|
|
5757
|
+
"description": "Filter by wallet client type (for SIWE accounts).",
|
|
5758
|
+
"example": "metamask"
|
|
5739
5759
|
}
|
|
5740
5760
|
},
|
|
5741
5761
|
"type": "object",
|
|
@@ -5827,6 +5847,9 @@
|
|
|
5827
5847
|
"user": {
|
|
5828
5848
|
"type": "string"
|
|
5829
5849
|
},
|
|
5850
|
+
"wallet": {
|
|
5851
|
+
"type": "string"
|
|
5852
|
+
},
|
|
5830
5853
|
"accountType": {
|
|
5831
5854
|
"type": "string"
|
|
5832
5855
|
},
|
|
@@ -5874,6 +5897,7 @@
|
|
|
5874
5897
|
"required": [
|
|
5875
5898
|
"id",
|
|
5876
5899
|
"user",
|
|
5900
|
+
"wallet",
|
|
5877
5901
|
"accountType",
|
|
5878
5902
|
"address",
|
|
5879
5903
|
"chainType",
|
|
@@ -6438,20 +6462,25 @@
|
|
|
6438
6462
|
"additionalProperties": false
|
|
6439
6463
|
},
|
|
6440
6464
|
"RegisterWalletSecretRequest": {
|
|
6441
|
-
"description": "Request to register a new wallet secret (authentication key).",
|
|
6465
|
+
"description": "Request to register a new wallet secret (authentication key).\n\nUses provided-key authentication: the walletAuthToken JWT must be signed by\nthe private key corresponding to the publicKey being registered.",
|
|
6442
6466
|
"properties": {
|
|
6443
6467
|
"publicKey": {
|
|
6444
6468
|
"type": "string",
|
|
6445
|
-
"description": "ECDSA P-256 public key for wallet authentication (PEM
|
|
6469
|
+
"description": "ECDSA P-256 public key for wallet authentication (PEM format).\nThis will be used to verify X-Wallet-Auth JWT signatures.",
|
|
6446
6470
|
"example": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE..."
|
|
6447
6471
|
},
|
|
6472
|
+
"walletAuthToken": {
|
|
6473
|
+
"type": "string",
|
|
6474
|
+
"description": "JWT signed with the private key corresponding to publicKey.\nThis proves possession of the private key without transmitting it.\n\nJWT must include: uris (matching request path), reqHash (SHA-256 of request body),\niat (issued at), nbf (not before), and optionally exp (expiration).",
|
|
6475
|
+
"example": "eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9..."
|
|
6476
|
+
},
|
|
6448
6477
|
"keyId": {
|
|
6449
6478
|
"type": "string",
|
|
6450
6479
|
"description": "Key identifier for the secret.\nUsed to identify this key in X-Wallet-Auth JWT headers.",
|
|
6451
6480
|
"example": "ws_1234567890"
|
|
6452
6481
|
}
|
|
6453
6482
|
},
|
|
6454
|
-
"required": ["publicKey"],
|
|
6483
|
+
"required": ["publicKey", "walletAuthToken"],
|
|
6455
6484
|
"type": "object",
|
|
6456
6485
|
"additionalProperties": false
|
|
6457
6486
|
},
|
|
@@ -6520,12 +6549,17 @@
|
|
|
6520
6549
|
"additionalProperties": false
|
|
6521
6550
|
},
|
|
6522
6551
|
"RotateWalletSecretRequest": {
|
|
6523
|
-
"description": "Request to rotate wallet secret (authentication key).",
|
|
6552
|
+
"description": "Request to rotate wallet secret (authentication key).\n\nUses provided-key authentication: the walletAuthToken JWT must be signed by\nthe private key corresponding to the newPublicKey being registered.",
|
|
6524
6553
|
"properties": {
|
|
6525
|
-
"
|
|
6554
|
+
"newPublicKey": {
|
|
6526
6555
|
"type": "string",
|
|
6527
|
-
"description": "New ECDSA P-256 public key for wallet authentication.\nThis will replace the current wallet secret used for X-Wallet-Auth JWT signing.",
|
|
6528
|
-
"example": "
|
|
6556
|
+
"description": "New ECDSA P-256 public key for wallet authentication (PEM format).\nThis will replace the current wallet secret used for X-Wallet-Auth JWT signing.",
|
|
6557
|
+
"example": "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE..."
|
|
6558
|
+
},
|
|
6559
|
+
"walletAuthToken": {
|
|
6560
|
+
"type": "string",
|
|
6561
|
+
"description": "JWT signed with the private key corresponding to newPublicKey.\nThis proves possession of the private key without transmitting it.\n\nJWT must include: uris (matching request path), reqHash (SHA-256 of request body),\niat (issued at), nbf (not before), and optionally exp (expiration).",
|
|
6562
|
+
"example": "eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9..."
|
|
6529
6563
|
},
|
|
6530
6564
|
"newKeyId": {
|
|
6531
6565
|
"type": "string",
|
|
@@ -6533,7 +6567,7 @@
|
|
|
6533
6567
|
"example": "ws_1234567890"
|
|
6534
6568
|
}
|
|
6535
6569
|
},
|
|
6536
|
-
"required": ["
|
|
6570
|
+
"required": ["newPublicKey", "walletAuthToken"],
|
|
6537
6571
|
"type": "object",
|
|
6538
6572
|
"additionalProperties": false
|
|
6539
6573
|
},
|
|
@@ -6545,6 +6579,9 @@
|
|
|
6545
6579
|
"user": {
|
|
6546
6580
|
"type": "string"
|
|
6547
6581
|
},
|
|
6582
|
+
"wallet": {
|
|
6583
|
+
"type": "string"
|
|
6584
|
+
},
|
|
6548
6585
|
"accountType": {
|
|
6549
6586
|
"type": "string"
|
|
6550
6587
|
},
|
|
@@ -6588,6 +6625,7 @@
|
|
|
6588
6625
|
"required": [
|
|
6589
6626
|
"id",
|
|
6590
6627
|
"user",
|
|
6628
|
+
"wallet",
|
|
6591
6629
|
"accountType",
|
|
6592
6630
|
"address",
|
|
6593
6631
|
"chainType",
|
|
@@ -6753,8 +6791,8 @@
|
|
|
6753
6791
|
},
|
|
6754
6792
|
"user": {
|
|
6755
6793
|
"type": "string",
|
|
6756
|
-
"description": "ID of the user this account belongs to (starts with `
|
|
6757
|
-
"example": "
|
|
6794
|
+
"description": "ID of the user this account belongs to (starts with `usr_`). If none is provided, a new user will be created.",
|
|
6795
|
+
"example": "usr_e0b84653-1741-4a3d-9e91-2b0fd2942f60"
|
|
6758
6796
|
},
|
|
6759
6797
|
"account": {
|
|
6760
6798
|
"type": "string",
|
|
@@ -7758,7 +7796,7 @@
|
|
|
7758
7796
|
"additionalProperties": false
|
|
7759
7797
|
},
|
|
7760
7798
|
"ApiKeyType": {
|
|
7761
|
-
"enum": ["pk", "sk", "pk_shield", "sk_shield"],
|
|
7799
|
+
"enum": ["pk", "sk", "pk_shield", "sk_shield", "pk_wallet"],
|
|
7762
7800
|
"type": "string"
|
|
7763
7801
|
},
|
|
7764
7802
|
"CreateProjectApiKeyRequest": {
|
|
@@ -9792,6 +9830,51 @@
|
|
|
9792
9830
|
}
|
|
9793
9831
|
},
|
|
9794
9832
|
"paths": {
|
|
9833
|
+
"/rpc/solana/{cluster}": {
|
|
9834
|
+
"post": {
|
|
9835
|
+
"operationId": "HandleSolanaRpcRequest",
|
|
9836
|
+
"responses": {
|
|
9837
|
+
"200": {
|
|
9838
|
+
"description": "JSON-RPC response",
|
|
9839
|
+
"content": {
|
|
9840
|
+
"application/json": {
|
|
9841
|
+
"schema": {
|
|
9842
|
+
"$ref": "#/components/schemas/JsonRpcResponse"
|
|
9843
|
+
}
|
|
9844
|
+
}
|
|
9845
|
+
}
|
|
9846
|
+
}
|
|
9847
|
+
},
|
|
9848
|
+
"description": "Execute Solana JSON-RPC 2.0 methods via Kora\n\nThis endpoint handles Solana-specific JSON-RPC 2.0 requests for gasless transactions\nusing the Kora paymaster service.\n\n**Supported clusters:**\n- `mainnet-beta` - Solana mainnet-beta\n- `devnet` - Solana devnet\n\n**Supported methods (per Kora JSON-RPC API spec):**\n- `getConfig`: Retrieve Kora server configuration\n- `getPayerSigner`: Get fee payer signer and payment destination\n- `getSupportedTokens`: List tokens accepted for fee payment\n- `getBlockhash`: Get latest blockhash\n- `estimateTransactionFee`: Estimate fees in lamports and token\n- `transferTransaction`: Create token transfer with Kora as fee payer\n- `signTransaction`: Sign transaction without broadcasting\n- `signAndSendTransaction`: Sign and broadcast to Solana",
|
|
9849
|
+
"summary": "Execute Solana Kora JSON-RPC methods",
|
|
9850
|
+
"tags": ["Solana RPC"],
|
|
9851
|
+
"security": [
|
|
9852
|
+
{
|
|
9853
|
+
"pk": []
|
|
9854
|
+
}
|
|
9855
|
+
],
|
|
9856
|
+
"parameters": [
|
|
9857
|
+
{
|
|
9858
|
+
"in": "path",
|
|
9859
|
+
"name": "cluster",
|
|
9860
|
+
"required": true,
|
|
9861
|
+
"schema": {
|
|
9862
|
+
"type": "string"
|
|
9863
|
+
}
|
|
9864
|
+
}
|
|
9865
|
+
],
|
|
9866
|
+
"requestBody": {
|
|
9867
|
+
"required": true,
|
|
9868
|
+
"content": {
|
|
9869
|
+
"application/json": {
|
|
9870
|
+
"schema": {
|
|
9871
|
+
"$ref": "#/components/schemas/JsonRpcRequest"
|
|
9872
|
+
}
|
|
9873
|
+
}
|
|
9874
|
+
}
|
|
9875
|
+
}
|
|
9876
|
+
}
|
|
9877
|
+
},
|
|
9795
9878
|
"/rpc": {
|
|
9796
9879
|
"post": {
|
|
9797
9880
|
"operationId": "HandleRpcRequest",
|
|
@@ -17251,7 +17334,7 @@
|
|
|
17251
17334
|
"url": "http://localhost:3000",
|
|
17252
17335
|
"data": [
|
|
17253
17336
|
{
|
|
17254
|
-
"id": "
|
|
17337
|
+
"id": "usr_***",
|
|
17255
17338
|
"createdAt": 123456789,
|
|
17256
17339
|
"name": "Satoshi",
|
|
17257
17340
|
"email": "satoshi@openfort.io",
|
|
@@ -17269,7 +17352,7 @@
|
|
|
17269
17352
|
]
|
|
17270
17353
|
},
|
|
17271
17354
|
{
|
|
17272
|
-
"id": "
|
|
17355
|
+
"id": "usr_***",
|
|
17273
17356
|
"createdAt": 123456789,
|
|
17274
17357
|
"name": "Nakamoto",
|
|
17275
17358
|
"email": "nakamoto@openfort.io",
|
|
@@ -17354,7 +17437,7 @@
|
|
|
17354
17437
|
"example": "John"
|
|
17355
17438
|
},
|
|
17356
17439
|
{
|
|
17357
|
-
"description": "Filter by external user ID.",
|
|
17440
|
+
"description": "Filter by external user ID (accountId from linked accounts).",
|
|
17358
17441
|
"in": "query",
|
|
17359
17442
|
"name": "externalUserId",
|
|
17360
17443
|
"required": false,
|
|
@@ -17362,6 +17445,46 @@
|
|
|
17362
17445
|
"type": "string"
|
|
17363
17446
|
},
|
|
17364
17447
|
"example": "123454456687897"
|
|
17448
|
+
},
|
|
17449
|
+
{
|
|
17450
|
+
"description": "Filter by user email.",
|
|
17451
|
+
"in": "query",
|
|
17452
|
+
"name": "email",
|
|
17453
|
+
"required": false,
|
|
17454
|
+
"schema": {
|
|
17455
|
+
"type": "string"
|
|
17456
|
+
},
|
|
17457
|
+
"example": "user@example.com"
|
|
17458
|
+
},
|
|
17459
|
+
{
|
|
17460
|
+
"description": "Filter by user phone number.",
|
|
17461
|
+
"in": "query",
|
|
17462
|
+
"name": "phoneNumber",
|
|
17463
|
+
"required": false,
|
|
17464
|
+
"schema": {
|
|
17465
|
+
"type": "string"
|
|
17466
|
+
},
|
|
17467
|
+
"example": "+1234567890"
|
|
17468
|
+
},
|
|
17469
|
+
{
|
|
17470
|
+
"description": "Filter by provider ID (e.g., \"google\", \"apple\", \"siwe\", \"credential\").",
|
|
17471
|
+
"in": "query",
|
|
17472
|
+
"name": "authProviderId",
|
|
17473
|
+
"required": false,
|
|
17474
|
+
"schema": {
|
|
17475
|
+
"type": "string"
|
|
17476
|
+
},
|
|
17477
|
+
"example": "google"
|
|
17478
|
+
},
|
|
17479
|
+
{
|
|
17480
|
+
"description": "Filter by wallet client type (for SIWE accounts).",
|
|
17481
|
+
"in": "query",
|
|
17482
|
+
"name": "walletClientType",
|
|
17483
|
+
"required": false,
|
|
17484
|
+
"schema": {
|
|
17485
|
+
"type": "string"
|
|
17486
|
+
},
|
|
17487
|
+
"example": "metamask"
|
|
17365
17488
|
}
|
|
17366
17489
|
]
|
|
17367
17490
|
}
|
|
@@ -17380,7 +17503,7 @@
|
|
|
17380
17503
|
"examples": {
|
|
17381
17504
|
"Example 1": {
|
|
17382
17505
|
"value": {
|
|
17383
|
-
"id": "
|
|
17506
|
+
"id": "usr_***",
|
|
17384
17507
|
"createdAt": 123456789,
|
|
17385
17508
|
"name": "Satoshi",
|
|
17386
17509
|
"email": "satoshi@openfort.io",
|
|
@@ -17903,7 +18026,7 @@
|
|
|
17903
18026
|
"description": "Unauthorized."
|
|
17904
18027
|
}
|
|
17905
18028
|
},
|
|
17906
|
-
"description": "Register a new wallet secret (authentication key).\n\nRegisters an ECDSA P-256 public key that will be used to verify\nX-Wallet-Auth JWT signatures. This is required before using WALLET_AUTH\nfor other backend wallet operations.",
|
|
18029
|
+
"description": "Register a new wallet secret (authentication key).\n\nRegisters an ECDSA P-256 public key that will be used to verify\nX-Wallet-Auth JWT signatures. This is required before using WALLET_AUTH\nfor other backend wallet operations.\n\nUses provided-key authentication: the request must include a walletAuthToken\nJWT signed by the private key corresponding to the publicKey being registered.\nThis proves possession of the private key without transmitting it.\n\nNote: Only ONE active secret is allowed per project. This call fails if an\nactive secret already exists; use rotateWalletSecret to replace an existing secret.",
|
|
17907
18030
|
"summary": "Register wallet secret.",
|
|
17908
18031
|
"tags": ["Backend Wallets"],
|
|
17909
18032
|
"security": [
|
|
@@ -17950,7 +18073,7 @@
|
|
|
17950
18073
|
"tags": ["Backend Wallets"],
|
|
17951
18074
|
"security": [
|
|
17952
18075
|
{
|
|
17953
|
-
"
|
|
18076
|
+
"user_project": []
|
|
17954
18077
|
}
|
|
17955
18078
|
],
|
|
17956
18079
|
"parameters": [],
|
|
@@ -17984,12 +18107,12 @@
|
|
|
17984
18107
|
"description": "Unauthorized."
|
|
17985
18108
|
}
|
|
17986
18109
|
},
|
|
17987
|
-
"description": "Rotate wallet secret (authentication key).\n\nReplaces the current wallet secret (ECDSA P-256 public key) used for\nX-Wallet-Auth JWT signing. The old secret will be
|
|
18110
|
+
"description": "Rotate wallet secret (authentication key).\n\nReplaces the current wallet secret (ECDSA P-256 public key) used for\nX-Wallet-Auth JWT signing. The old secret will be marked as \"rotated\"\nand immediately becomes unusable (no grace period).\n\nUses provided-key authentication: the request must include a walletAuthToken\nJWT signed by the private key corresponding to the NEW publicKey being registered.\nThis proves possession of the new private key without transmitting it.",
|
|
17988
18111
|
"summary": "Rotate wallet secret.",
|
|
17989
18112
|
"tags": ["Backend Wallets"],
|
|
17990
18113
|
"security": [
|
|
17991
18114
|
{
|
|
17992
|
-
"
|
|
18115
|
+
"user_project": []
|
|
17993
18116
|
}
|
|
17994
18117
|
],
|
|
17995
18118
|
"parameters": [],
|
|
@@ -20571,7 +20694,7 @@
|
|
|
20571
20694
|
"examples": {
|
|
20572
20695
|
"Example 1": {
|
|
20573
20696
|
"value": {
|
|
20574
|
-
"id": "
|
|
20697
|
+
"id": "usr_***",
|
|
20575
20698
|
"createdAt": 123456789,
|
|
20576
20699
|
"name": "Satoshi",
|
|
20577
20700
|
"email": "satoshi@openfort.io",
|
|
@@ -20624,7 +20747,7 @@
|
|
|
20624
20747
|
"examples": {
|
|
20625
20748
|
"Example 1": {
|
|
20626
20749
|
"value": {
|
|
20627
|
-
"id": "
|
|
20750
|
+
"id": "usr_***",
|
|
20628
20751
|
"createdAt": 123456789,
|
|
20629
20752
|
"name": "Satoshi",
|
|
20630
20753
|
"email": "satoshi@openfort.io",
|
|
@@ -20701,6 +20824,10 @@
|
|
|
20701
20824
|
"name": "Session keys",
|
|
20702
20825
|
"tags": ["Sessions"]
|
|
20703
20826
|
},
|
|
20827
|
+
{
|
|
20828
|
+
"name": "Contracts",
|
|
20829
|
+
"tags": ["Contracts"]
|
|
20830
|
+
},
|
|
20704
20831
|
{
|
|
20705
20832
|
"name": "Sponsor transactions & Models",
|
|
20706
20833
|
"tags": ["Policies"]
|
package/package.json
CHANGED