From 7a08819a93d06c1fbe07c4f63eda28b0358b0da6 Mon Sep 17 00:00:00 2001 From: bz888 Date: Mon, 11 Dec 2023 11:42:25 +1300 Subject: [PATCH 1/4] udpate signed delegate signture type --- packages/types/src/interfaces.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/types/src/interfaces.ts b/packages/types/src/interfaces.ts index 20eed2e7..0547ec69 100644 --- a/packages/types/src/interfaces.ts +++ b/packages/types/src/interfaces.ts @@ -99,7 +99,7 @@ export interface DeleteAccount { export interface SignedDelegate { delegate_action: DelegateAction; - signature: {signature: Uint8Array; public_key: string}; + signature: string; } export interface DelegateAction { From 64f920115073cf06815b06f7132bcd9b1111f6fb Mon Sep 17 00:00:00 2001 From: bz888 Date: Mon, 11 Dec 2023 14:08:25 +1300 Subject: [PATCH 2/4] update nested delegateActions --- packages/types/src/interfaces.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/types/src/interfaces.ts b/packages/types/src/interfaces.ts index 0547ec69..a2d06fe7 100644 --- a/packages/types/src/interfaces.ts +++ b/packages/types/src/interfaces.ts @@ -102,13 +102,15 @@ export interface SignedDelegate { signature: string; } +export type NonDelegateAction = Exclude; + export interface DelegateAction { /// Signer of the delegated actions sender_id: string; /// Receiver of the delegated actions. receiver_id: string; /// List of actions to be executed. - actions: NearAction[]; + actions: NearAction[]; /// Nonce to ensure that the same delegate action is not sent twice by a relayer and should match for given account's `public_key`. /// After this action is processed it will increment. nonce: BN; From 2623e3727ae1e7b7e1e408e36743569597e56bd3 Mon Sep 17 00:00:00 2001 From: bz888 Date: Mon, 11 Dec 2023 14:13:26 +1300 Subject: [PATCH 3/4] update changelog --- packages/types/CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/types/CHANGELOG.md b/packages/types/CHANGELOG.md index 65430e58..ac0c3a8c 100644 --- a/packages/types/CHANGELOG.md +++ b/packages/types/CHANGELOG.md @@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +### Changed +- Updated `SignedDelegateAction` types in accordance to near-docs (#90) ## [3.1.1] - 2023-11-30 ### Changed From a754297f131fec06d42bc9f6b9674208ece3d5d2 Mon Sep 17 00:00:00 2001 From: bz888 Date: Tue, 12 Dec 2023 13:50:46 +1300 Subject: [PATCH 4/4] update NonDelegateAction type --- packages/types/src/interfaces.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/types/src/interfaces.ts b/packages/types/src/interfaces.ts index a2d06fe7..8744e1a6 100644 --- a/packages/types/src/interfaces.ts +++ b/packages/types/src/interfaces.ts @@ -102,7 +102,7 @@ export interface SignedDelegate { signature: string; } -export type NonDelegateAction = Exclude; +export type NonDelegateAction = Record, Exclude>; export interface DelegateAction { /// Signer of the delegated actions @@ -110,7 +110,7 @@ export interface DelegateAction { /// Receiver of the delegated actions. receiver_id: string; /// List of actions to be executed. - actions: NearAction[]; + actions: NonDelegateAction[]; /// Nonce to ensure that the same delegate action is not sent twice by a relayer and should match for given account's `public_key`. /// After this action is processed it will increment. nonce: BN;