Skip to content

Commit 5d63fdb

Browse files
authored
refactor: rename vehicleId → actorId
refactor: rename vehicleId → actorId
2 parents b0be3f1 + 05fa05f commit 5d63fdb

62 files changed

Lines changed: 212 additions & 200 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
node_modules/
22
dist/
33
.pnpm-store/
4+
.venv-mkdocs/
5+
site/
46
*.test.js
57
*.test.d.ts
68
.DS_Store

docs/implementation/sdk.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ const grant = createPolicyGrant({
4646
const sba = createSignedBudgetAuthorization({
4747
grantId: grant.grantId,
4848
sessionId: "sess-123",
49-
vehicleId: "veh-456",
49+
actorId: "actor-001",
5050
policyHash: "a1b2c3",
5151
currency: "USD",
5252
maxAmountMinor: "3000",
@@ -93,7 +93,7 @@ const result = verifySettlement({
9393
// result.valid === true
9494
```
9595

96-
## Vehicle Wallet Roles
96+
## Actor Roles
9797

9898
In an autonomous deployment, the wallet plays both roles in this lifecycle:
9999

docs/reference/sdk.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ import {
5656
const budgetAuth = createBudgetAuthorization({
5757
grantId: grant.grantId, // from createPolicyGrant
5858
sessionId: "sess-123",
59-
vehicleId: "veh-456",
59+
actorId: "actor-001",
6060
policyHash: "a1b2c3",
6161
currency: "USD",
6262
maxAmountMinor: "3000",
@@ -70,7 +70,7 @@ const budgetAuth = createBudgetAuthorization({
7070
const sba = createSignedBudgetAuthorization({
7171
grantId: budgetAuth.grantId,
7272
sessionId: budgetAuth.sessionId,
73-
vehicleId: budgetAuth.vehicleId,
73+
actorId: budgetAuth.actorId,
7474
policyHash: budgetAuth.policyHash,
7575
currency: budgetAuth.currency,
7676
maxAmountMinor: budgetAuth.maxAmountMinor,

docs/reference/service-api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Issue a signed budget authorization from a policy grant.
2222
const sba = issueBudget({
2323
policyGrant,
2424
sessionId: "session-123",
25-
vehicleId: "vehicle-456",
25+
actorId: "actor-001",
2626
maxAmountMinor: "3000",
2727
destinationAllowlist: ["rParking", "rCharging"],
2828
});

examples/ev-charging/budget-auth.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"version": "1.0",
3-
"budgetId": "baa7d916-a377-47ef-a0ad-ac35c748f15c",
4-
"grantId": "5ad06052-234c-49e8-8719-3a6ca6b3965a",
3+
"budgetId": "155aaeb4-aa1d-4229-8938-bbdc61e1ca07",
4+
"grantId": "10325625-bb57-4a10-a512-606c9c936c24",
55
"sessionId": "22222222-2222-4222-8222-222222222222",
6-
"vehicleId": "ev-7890",
6+
"actorId": "ev-7890",
77
"policyHash": "a1b2c3d4e5f7",
88
"currency": "USD",
99
"minorUnit": 2,

examples/ev-charging/generate.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ const policyGrant = createPolicyGrant({
5858

5959
const budgetAuth = createBudgetAuthorization({
6060
sessionId: "22222222-2222-4222-8222-222222222222",
61-
vehicleId: "ev-7890",
61+
actorId: "ev-7890",
6262
grantId: policyGrant.grantId,
6363
policyHash,
6464
currency: "USD",
@@ -71,7 +71,7 @@ const budgetAuth = createBudgetAuthorization({
7171

7272
const signedBudgetAuth = createSignedBudgetAuthorization({
7373
sessionId: budgetAuth.sessionId,
74-
vehicleId: budgetAuth.vehicleId,
74+
actorId: budgetAuth.actorId,
7575
grantId: policyGrant.grantId,
7676
policyHash: budgetAuth.policyHash,
7777
currency: budgetAuth.currency,

examples/ev-charging/policy-grant.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"grantId": "5ad06052-234c-49e8-8719-3a6ca6b3965a",
2+
"grantId": "10325625-bb57-4a10-a512-606c9c936c24",
33
"policyHash": "a1b2c3d4e5f7",
44
"expiresAt": "2030-12-31T23:59:59Z",
55
"allowedRails": [

examples/ev-charging/settlement-bundle.json

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"decisionId": "dec-ev-1",
2929
"sessionId": "22222222-2222-4222-8222-222222222222",
3030
"policyHash": "a1b2c3d4e5f7",
31-
"budgetId": "a3dc0432-5a64-4d64-89ea-de61a3eede3e",
31+
"budgetId": "1565798f-6d51-4070-b3f9-8727f36290ad",
3232
"quoteId": "q1",
3333
"rail": "xrpl",
3434
"asset": {
@@ -39,18 +39,19 @@
3939
"amount": "25000000",
4040
"destination": "rChargingStation",
4141
"intentHash": "62b57f4ca753d014bca80b82cac2c7ca33850e3697c4707e636326e365c58687",
42-
"expiresAt": "2030-12-31T23:59:59Z"
42+
"expiresAt": "2030-12-31T23:59:59Z",
43+
"nonce": "53095b6c-8696-472d-90b7-a89be33bc806"
4344
},
44-
"signature": "+Oz+9+eGK32BeGW8FON0hj66wcPhN23TZ9xec9HZfLwC2oeKMDLBFZZCYTIh0Me8AxJbKQ0Jv+lOU6ZsIKOrDA==",
45-
"issuerKeyId": "mpcp-spa-signing-key-1"
45+
"issuerKeyId": "mpcp-spa-signing-key-1",
46+
"signature": "F43hQ+6I6Gj+7mvgtQZ8xl7KpeZIwloPCsKUlczMkhg5T++kJcdou/WOo05QncckJqESi9ibqC6wdLg1xdxtAQ=="
4647
},
4748
"sba": {
4849
"authorization": {
4950
"version": "1.0",
50-
"budgetId": "a3dc0432-5a64-4d64-89ea-de61a3eede3e",
51-
"grantId": "5ad06052-234c-49e8-8719-3a6ca6b3965a",
51+
"budgetId": "1565798f-6d51-4070-b3f9-8727f36290ad",
52+
"grantId": "10325625-bb57-4a10-a512-606c9c936c24",
5253
"sessionId": "22222222-2222-4222-8222-222222222222",
53-
"vehicleId": "ev-7890",
54+
"actorId": "ev-7890",
5455
"policyHash": "a1b2c3d4e5f7",
5556
"currency": "USD",
5657
"minorUnit": 2,
@@ -71,11 +72,11 @@
7172
],
7273
"expiresAt": "2030-12-31T23:59:59Z"
7374
},
74-
"signature": "WT0EExkYrd9KmjNtxR92YKfLOdpdLbgVAPuwZoP7+f+uioGz+N30kQICJAnIAB8mo8dacQz1otJZz17EfSCPCg==",
75-
"issuerKeyId": "mpcp-sba-signing-key-1"
75+
"issuerKeyId": "mpcp-sba-signing-key-1",
76+
"signature": "enh0ec0p2JvysBOpoitkESAzoJd/rl0+K9n54LFwVFtUFx2NuBHc4xKa6zOHslvCGsDAgb35fVt6qInLf+oQCA=="
7677
},
7778
"policyGrant": {
78-
"grantId": "5ad06052-234c-49e8-8719-3a6ca6b3965a",
79+
"grantId": "10325625-bb57-4a10-a512-606c9c936c24",
7980
"policyHash": "a1b2c3d4e5f7",
8081
"expiresAt": "2030-12-31T23:59:59Z",
8182
"allowedRails": [
@@ -129,6 +130,6 @@
129130
}
130131
]
131132
},
132-
"sbaPublicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEAT0Oq22kLSptosoBNSpYLDWuufSm8upVS5WTUal6d8CM=\n-----END PUBLIC KEY-----\n",
133-
"spaPublicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEAy2za2OJ7PYHyQ6ARF/ynBlgmVKvH8YFEmsPCMW7jApc=\n-----END PUBLIC KEY-----\n"
133+
"sbaPublicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEA0XxXWe8kRGwxGqP4P/WAyALlT4gwE0Mxry6yd7ekekc=\n-----END PUBLIC KEY-----\n",
134+
"spaPublicKeyPem": "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEArqv7N8PvYS5ojGR6B+ZPVdiXzGfQi6Sy+Km105Zi84I=\n-----END PUBLIC KEY-----\n"
134135
}

examples/ev-charging/signed-budget-auth.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"authorization": {
33
"version": "1.0",
4-
"budgetId": "a3dc0432-5a64-4d64-89ea-de61a3eede3e",
5-
"grantId": "5ad06052-234c-49e8-8719-3a6ca6b3965a",
4+
"budgetId": "1565798f-6d51-4070-b3f9-8727f36290ad",
5+
"grantId": "10325625-bb57-4a10-a512-606c9c936c24",
66
"sessionId": "22222222-2222-4222-8222-222222222222",
7-
"vehicleId": "ev-7890",
7+
"actorId": "ev-7890",
88
"policyHash": "a1b2c3d4e5f7",
99
"currency": "USD",
1010
"minorUnit": 2,
@@ -25,6 +25,6 @@
2525
],
2626
"expiresAt": "2030-12-31T23:59:59Z"
2727
},
28-
"signature": "WT0EExkYrd9KmjNtxR92YKfLOdpdLbgVAPuwZoP7+f+uioGz+N30kQICJAnIAB8mo8dacQz1otJZz17EfSCPCg==",
29-
"issuerKeyId": "mpcp-sba-signing-key-1"
28+
"issuerKeyId": "mpcp-sba-signing-key-1",
29+
"signature": "enh0ec0p2JvysBOpoitkESAzoJd/rl0+K9n54LFwVFtUFx2NuBHc4xKa6zOHslvCGsDAgb35fVt6qInLf+oQCA=="
3030
}

examples/ev-charging/spa.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"decisionId": "dec-ev-1",
55
"sessionId": "22222222-2222-4222-8222-222222222222",
66
"policyHash": "a1b2c3d4e5f7",
7-
"budgetId": "a3dc0432-5a64-4d64-89ea-de61a3eede3e",
7+
"budgetId": "1565798f-6d51-4070-b3f9-8727f36290ad",
88
"quoteId": "q1",
99
"rail": "xrpl",
1010
"asset": {
@@ -15,8 +15,9 @@
1515
"amount": "25000000",
1616
"destination": "rChargingStation",
1717
"intentHash": "62b57f4ca753d014bca80b82cac2c7ca33850e3697c4707e636326e365c58687",
18-
"expiresAt": "2030-12-31T23:59:59Z"
18+
"expiresAt": "2030-12-31T23:59:59Z",
19+
"nonce": "53095b6c-8696-472d-90b7-a89be33bc806"
1920
},
20-
"signature": "+Oz+9+eGK32BeGW8FON0hj66wcPhN23TZ9xec9HZfLwC2oeKMDLBFZZCYTIh0Me8AxJbKQ0Jv+lOU6ZsIKOrDA==",
21-
"issuerKeyId": "mpcp-spa-signing-key-1"
21+
"issuerKeyId": "mpcp-spa-signing-key-1",
22+
"signature": "F43hQ+6I6Gj+7mvgtQZ8xl7KpeZIwloPCsKUlczMkhg5T++kJcdou/WOo05QncckJqESi9ibqC6wdLg1xdxtAQ=="
2223
}

0 commit comments

Comments
 (0)