Skip to content

Commit 92ff207

Browse files
author
twilson63
committed
feat: lc messages and use slot/current for feed
1 parent d75d1d5 commit 92ff207

File tree

3 files changed

+19
-28
lines changed

3 files changed

+19
-28
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@permaweb/aos",
3-
"version": "2.0.7",
3+
"version": "2.0.8",
44
"private": true,
55
"repository": "https://github.com/permaweb/aos.git",
66
"license": "MIT",
@@ -22,7 +22,7 @@
2222
"test-all": "yarn workspaces --parallel run test"
2323
},
2424
"dependencies": {
25-
"@permaweb/aoconnect": "^0.0.89",
25+
"@permaweb/aoconnect": "^0.0.90",
2626
"arweave": "^1.15.1",
2727
"chalk": "^5.3.0",
2828
"figlet": "^1.7.0",

src/services/mainnet.js

Lines changed: 13 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -60,15 +60,13 @@ export function sendMessageMainnet({ processId, wallet, tags, data }, spinner) {
6060
const { request } = setupMainnet(wallet)
6161
const submitRequest = fromPromise(request)
6262
const params = {
63-
Type: 'Message',
63+
type: 'Message',
6464
path: `/${processId}[email protected]/push/[email protected]`,
6565
method: 'POST',
66-
...tags.filter(t => t.name !== 'device').reduce((a, t) => assoc(t.name, t.value, a), {}),
66+
...tags.reduce((a, t) => assoc(t.name, t.value, a), {}),
6767
'data-protocol': 'ao',
6868
variant: 'ao.N.1',
6969
target: processId,
70-
"accept-bundle": "true",
71-
// "accept-codec": "[email protected]",
7270
"signing-format": "ANS-104"
7371
}
7472
// set data if needed
@@ -144,17 +142,16 @@ export function spawnProcessMainnet({ wallet, src, tags, data, isHyper }) {
144142
const params = {
145143
path: '/push',
146144
method: 'POST',
147-
Type: 'Process',
145+
type: 'Process',
148146
device: '[email protected]',
149147
'scheduler-device': '[email protected]',
150148
'push-device': '[email protected]',
151149
'execution-device': '[email protected]',
152150
'data-protocol': 'ao',
153151
variant: 'ao.N.1',
152+
// ...tags.reduce((a, t) => assoc(t.name.toLowerCase(), t.value, a), {}),
154153
...tags.reduce((a, t) => assoc(t.name, t.value, a), {}),
155154
'aos-version': pkg.version,
156-
'accept-bundle': 'true',
157-
'codec-device': '[email protected]',
158155
'signing-format': 'ANS-104'
159156
}
160157
if (data) {
@@ -219,22 +216,20 @@ export async function liveMainnet(id, watch) {
219216
try {
220217
isJobRunning = true;
221218
// Get the current slot
222-
const currentSlotPath = `/${id}[email protected]/slot/current/body/[email protected]` // LIVE PARAMS
219+
const currentSlotPath = `/${id}[email protected]/slot/current` // LIVE PARAMS
223220
const currentSlotParams = {
224221
path: currentSlotPath,
225222
method: 'POST',
226223
device: '[email protected]',
227224
'data-protocol': 'ao',
228225
variant: 'ao.N.1',
229226
'aos-version': pkg.version,
230-
signingFormat: 'ANS-104',
231-
"accept-bundle": "true",
232-
"accept-codec": "[email protected]"
227+
'signing-format': 'ANS-104'
233228
}
234229
const currentSlot = await request(currentSlotParams)
235230
.then(res => res.body)
236-
.then(JSON.parse)
237-
.then(res => res.body)
231+
// .then(JSON.parse)
232+
// .then(res => res.body)
238233

239234
if (isNaN(cursor)) {
240235
cursor = currentSlot + 1
@@ -252,9 +247,7 @@ export async function liveMainnet(id, watch) {
252247
'push-device': '[email protected]',
253248
variant: 'ao.N.1',
254249
'aos-version': pkg.version,
255-
signingFormat: 'ANS-104',
256-
"accept-bundle": "true",
257-
"accept-codec": "[email protected]"
250+
'signing-format': 'ANS-104',
258251
}
259252
const results = await request(params)
260253
.then(res => res.body)
@@ -451,13 +444,11 @@ export async function handleNodeTopup(jwk, insufficientBalance) {
451444
'data-protocol': 'ao',
452445
variant: 'ao.N.1',
453446
target: PAYMENT.subledger,
454-
'accept-bundle': 'true',
455-
'accept-codec': '[email protected]',
456-
'signingFormat': 'ANS-104',
447+
'signing-format': 'ANS-104',
457448
action: 'Transfer',
458-
Recipient: walletAddress,
459-
Route: ledgerAddress,
460-
Quantity: sendQuantity
449+
recipient: walletAddress,
450+
route: ledgerAddress,
451+
quantity: sendQuantity
461452
}
462453

463454
const transferRes = await aoMainnet.request(transferParams);

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -835,10 +835,10 @@
835835
ramda "^0.30.0"
836836
zod "^3.23.5"
837837

838-
"@permaweb/aoconnect@^0.0.89":
839-
version "0.0.89"
840-
resolved "https://registry.yarnpkg.com/@permaweb/aoconnect/-/aoconnect-0.0.89.tgz#10f984e39675b60196f57887dc7afdea22594af9"
841-
integrity sha512-Wphud6V+KfQLn+siiWij/ms1TpRJ7CWA/rt01Jk+QKbQP5kW3IcncwmfNTFygoCdAQPterD6s5SHr/hNLlFCUQ==
838+
"@permaweb/aoconnect@^0.0.90":
839+
version "0.0.90"
840+
resolved "https://registry.yarnpkg.com/@permaweb/aoconnect/-/aoconnect-0.0.90.tgz#41dfec3f7ace9449a2af60feab04fb4c08d6c354"
841+
integrity sha512-VKEkwKV5Lv6q2pai38gz/ngcRML4iApWsJc5B8X8ow9fJIXnd9UK8y0HMbrKUF/VB5Eb8r8lJhDr76yiL6QWAA==
842842
dependencies:
843843
"@dha-team/arbundles" "1.0.3"
844844
"@permaweb/ao-scheduler-utils" "~0.0.25"

0 commit comments

Comments
 (0)